grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/7] mkimage: Replace hardcoded 0x400 in R_ARM_ABS32 relocation


From: Ian Campbell
Subject: [PATCH 2/7] mkimage: Replace hardcoded 0x400 in R_ARM_ABS32 relocation
Date: Sun, 29 Dec 2013 18:47:31 +0000

In http://lists.gnu.org/archive/html/grub-devel/2013-04/msg00034.html Leif
suggested that this should actually be "SUFFIX (entry_point)" saying:
    _start gets bumped down a bit, so all relative relocations need to follow,
    and then I "un-adjust" for the absolutes. Not too proud of that bit of code.

I think this "bumping down" actually comes from the image type's vaddr_offset
and therefore it is more correct to adjust by this amount.

Signed-off-by: Ian Campbell <address@hidden>
Cc: address@hidden
---
 util/grub-mkimagexx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index d059396..f5e514f 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -868,7 +868,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr 
*sections,
                       grub_util_info ("  ABS32:\toffset=%d\t(0x%08x)",
                                       (int) sym_addr, (int) sym_addr);
                       /* Data will be naturally aligned */
-                      sym_addr += 0x400;
+                      sym_addr += image_target->vaddr_offset;
                       *target = grub_host_to_target32 (grub_target_to_host32 
(*target) + sym_addr);
                     }
                     break;
-- 
1.8.4.rc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]