]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Fix
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 15 Dec 2011 18:32:41 +0000 (19:32 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 15 Dec 2011 18:32:41 +0000 (19:32 +0100)
current address calculation.

ChangeLog
grub-core/loader/i386/bsdXX.c

index 0063cdf04b10ae6c00e21b5c9826a54a24da7caa..2bd1aa287394306589af6e03be3fe59c88666bce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * grub-core/lib/reed_solomon.c (decode_block): Allocate on heap and not
index 92d2675348576152f89b3d10705ef71c7044c5cb..7cec7a8efecb72f2c8eb3d2b2cc8b1ee9c14537c 100644 (file)
@@ -244,16 +244,16 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator,
        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;