grub-devel
[Top][All Lists]
Advanced

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

[PATCH] arm: Align section alignment with manual relocation offset code


From: Alexander Graf
Subject: [PATCH] arm: Align section alignment with manual relocation offset code
Date: Sun, 28 Apr 2019 00:55:42 +0200

The arm relocation code has a manual special case for EFI binaries to
add the natural alignment to its own relocation awareness.

Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
the change in that branch that we forgot as well.

This fixes running 32bit arm grub efi binaries for me again.

Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
Reported-by: Heinrich Schuchardt <address@hidden>
Reported-by: Steve McIntyre <address@hidden>
Signed-off-by: Alexander Graf <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 a79034e7b..2059890c3 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -1137,7 +1137,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct 
section_metadata *smd,
                                       (int) sym_addr, (int) sym_addr);
                       /* Data will be naturally aligned */
                       if (image_target->id == IMAGE_EFI)
-                        sym_addr += 0x400;
+                        sym_addr += GRUB_PE32_SECTION_ALIGNMENT;
                       *target = grub_host_to_target32 (grub_target_to_host32 
(*target) + sym_addr);
                     }
                     break;
-- 
2.16.4




reply via email to

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