7e98da0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
7e98da0
From: Alexander Graf <agraf@csgraf.de>
7e98da0
Date: Tue, 30 Apr 2019 22:43:57 +0200
7e98da0
Subject: [PATCH] arm: Align section alignment with manual relocation offset
7e98da0
 code
7e98da0
7e98da0
The arm relocation code has a manual special case for EFI binaries to
7e98da0
add the natural alignment to its own relocation awareness.
7e98da0
7e98da0
Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
7e98da0
boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
7e98da0
the change in that branch that we forgot as well.
7e98da0
7e98da0
This fixes running 32bit arm grub efi binaries for me again.
7e98da0
7e98da0
Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
7e98da0
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7e98da0
Reported-by: Steve McIntyre <steve@einval.com>
7e98da0
Signed-off-by: Alexander Graf <agraf@csgraf.de>
7e98da0
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
7e98da0
Tested-by: Julien ROBIN <julien.robin28@free.fr>
7e98da0
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7e98da0
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
7e98da0
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
7e98da0
---
7e98da0
 util/grub-mkimagexx.c | 2 +-
7e98da0
 1 file changed, 1 insertion(+), 1 deletion(-)
7e98da0
7e98da0
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
7e98da0
index 86e6254a27e..75773446d0f 100644
7e98da0
--- a/util/grub-mkimagexx.c
7e98da0
+++ b/util/grub-mkimagexx.c
7e98da0
@@ -1099,7 +1099,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
7e98da0
 				       (int) sym_addr, (int) sym_addr);
7e98da0
 		       /* Data will be naturally aligned */
7e98da0
 		       if (image_target->id == IMAGE_EFI)
7e98da0
-			 sym_addr += 0x400;
7e98da0
+			 sym_addr += GRUB_PE32_SECTION_ALIGNMENT;
7e98da0
 		       *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr);
7e98da0
 		     }
7e98da0
 		     break;