]> git.proxmox.com Git - grub2.git/blob - debian/patches/arm-align-section-alignment-with-manual-reloc-offset.patch
New upstream release candidate (2.04~rc1)
[grub2.git] / debian / patches / arm-align-section-alignment-with-manual-reloc-offset.patch
1 From 878c8d3485c6e3a1abba6e636fe2580a716bc3f7 Mon Sep 17 00:00:00 2001
2 From: Alexander Graf <agraf@csgraf.de>
3 Date: Tue, 30 Apr 2019 22:43:57 +0200
4 Subject: arm: Align section alignment with manual relocation offset code
5
6 The arm relocation code has a manual special case for EFI binaries to
7 add the natural alignment to its own relocation awareness.
8
9 Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
10 boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
11 the change in that branch that we forgot as well.
12
13 This fixes running 32bit arm grub efi binaries for me again.
14
15 Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
16 Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
17 Reported-by: Steve McIntyre <steve@einval.com>
18 Signed-off-by: Alexander Graf <agraf@csgraf.de>
19 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
20 Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
21 Tested-by: Julien ROBIN <julien.robin28@free.fr>
22 Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
23
24 Bug-Debian: https://bugs.debian.org/927269
25 Origin: other, https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00132.html
26 Last-Update: 2019-05-03
27
28 Patch-Name: arm-align-section-alignment-with-manual-reloc-offset.patch
29 ---
30 util/grub-mkimagexx.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
34 index 470fbf4dd..bc087c2b5 100644
35 --- a/util/grub-mkimagexx.c
36 +++ b/util/grub-mkimagexx.c
37 @@ -1137,7 +1137,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
38 (int) sym_addr, (int) sym_addr);
39 /* Data will be naturally aligned */
40 if (image_target->id == IMAGE_EFI)
41 - sym_addr += 0x400;
42 + sym_addr += GRUB_PE32_SECTION_ALIGNMENT;
43 *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr);
44 }
45 break;