+2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Fix
+ current address calculation.
+
2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/reed_solomon.c (decode_block): Allocate on heap and not
curload = module + s->sh_addr + s->sh_size;
}
- load (file, UINT_TO_PTR (module), 0, sizeof (e));
+ load (file, (grub_uint8_t *) chunk_src + module - *kern_end, 0, sizeof (e));
if (curload < module + sizeof (e))
curload = module + sizeof (e);
- load (file, UINT_TO_PTR (curload), e.e_shoff,
+ load (file, (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_shoff,
e.e_shnum * e.e_shentsize);
e.e_shoff = curload - module;
curload += e.e_shnum * e.e_shentsize;
- load (file, UINT_TO_PTR (curload), e.e_phoff,
+ load (file, (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_phoff,
e.e_phnum * e.e_phentsize);
e.e_phoff = curload - module;
curload += e.e_phnum * e.e_phentsize;