* grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Fix

current address calculation.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-15 19:32:41 +01:00
parent 96f8caf812
commit 384ad7cc1b
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
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> 2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/reed_solomon.c (decode_block): Allocate on heap and not * grub-core/lib/reed_solomon.c (decode_block): Allocate on heap and not

View file

@ -244,16 +244,16 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator,
curload = module + s->sh_addr + s->sh_size; 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)) if (curload < module + sizeof (e))
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_shnum * e.e_shentsize);
e.e_shoff = curload - module; e.e_shoff = curload - module;
curload += e.e_shnum * e.e_shentsize; 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_phnum * e.e_phentsize);
e.e_phoff = curload - module; e.e_phoff = curload - module;
curload += e.e_phnum * e.e_phentsize; curload += e.e_phnum * e.e_phentsize;