diff mbox series

[2/2] mkimage: arm64-efi: Align first section to page

Message ID 20181128143107.37583-3-agraf@suse.de
State New
Headers show
Series arm64: Support HP Envy X2 | expand

Commit Message

Alexander Graf Nov. 28, 2018, 2:31 p.m. UTC
I encountered a broken edk2 implementation in the wild (HP Envy x2)
which fails to load PE binaries that have a non-page-aligned first
section (read: header is < 4k).

Work around this by just aligning the text start to page granule on the
arm64-efi target.

With this patch applied, I can successfully run grub on my HP Envy x2
system.

Signed-off-by: Alexander Graf <agraf@suse.de>

---
 util/mkimage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.19.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
diff mbox series

Patch

diff --git a/util/mkimage.c b/util/mkimage.c
index 05333a76a..bfdb0328a 100644
--- a/util/mkimage.c
+++ b/util/mkimage.c
@@ -605,7 +605,8 @@  static const struct grub_install_image_target_desc image_targets[] =
       .decompressor_uncompressed_size = TARGET_NO_FIELD,
       .decompressor_uncompressed_addr = TARGET_NO_FIELD,
       .section_align = GRUB_PE32_SECTION_ALIGNMENT,
-      .vaddr_offset = EFI64_HEADER_SIZE,
+      /* Needed for some broken edk2 implementations */
+      .vaddr_offset = 4096,
       .pe_target = GRUB_PE32_MACHINE_ARM64,
       .elf_target = EM_AARCH64,
     },