From 556f377582edb6b117c164490c8d13ae0c4bda0a Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 3 Nov 2008 13:08:21 +0000 Subject: [PATCH] 2008-11-03 Bean * kern/elf.c (grub_elf32_load): Revert to previous code. (grub_elf64_load): Likewise. * loader/i386/bsd.c (grub_bsd_elf32_hook): Change return address. --- ChangeLog | 7 +++++++ kern/elf.c | 4 ++-- loader/i386/bsd.c | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f29bfb841..aead197a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-03 Bean + + * kern/elf.c (grub_elf32_load): Revert to previous code. + (grub_elf64_load): Likewise. + + * loader/i386/bsd.c (grub_bsd_elf32_hook): Change return address. + 2008-11-01 Robert Millan * Makefile.in (CPPFLAGS): Fix builddir=. assumption. diff --git a/kern/elf.c b/kern/elf.c index 2b1e223f7..8ddf9e540 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -232,9 +232,9 @@ grub_elf32_load (grub_elf_t _elf, grub_elf32_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; + load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; - load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; @@ -411,9 +411,9 @@ grub_elf64_load (grub_elf_t _elf, grub_elf64_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; + load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; - load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 4966afa86..25d0f5990 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -454,7 +454,7 @@ grub_bsd_load_aout (grub_file_t file) } static grub_err_t -grub_bsd_elf32_hook (Elf32_Phdr * phdr, UNUSED grub_addr_t * addr) +grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr) { Elf32_Addr paddr; @@ -472,6 +472,8 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr, UNUSED grub_addr_t * addr) if (paddr + phdr->p_memsz > kern_end) kern_end = paddr + phdr->p_memsz; + *addr = paddr; + return GRUB_ERR_NONE; }