* grub-core/kern/dl.c (grub_dl_load_segments): Fix alignment handling.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-11-16 21:40:50 +01:00
parent bb41695449
commit 10b64f1cf4
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2011-11-16 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/dl.c (grub_dl_load_segments): Fix alignment handling.
2011-11-16 Vladimir Serbinenko <phcoder@gmail.com> 2011-11-16 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/dl.c (grub_dl_unload): Fix freeing segments. * grub-core/kern/dl.c (grub_dl_unload): Fix freeing segments.

View file

@ -243,7 +243,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
i < e->e_shnum; i < e->e_shnum;
i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize)) i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize))
{ {
tsize += ALIGN_UP (s->sh_size, s->sh_addralign); tsize = ALIGN_UP (tsize, s->sh_addralign) + s->sh_size;
if (talign < s->sh_addralign) if (talign < s->sh_addralign)
talign = s->sh_addralign; talign = s->sh_addralign;
} }