From 390c2888e7fb86aacbc7f532caf66dfba9395a49 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 19 Dec 2022 11:59:29 +1100 Subject: [PATCH] Fix aarch64 sections alignment binutils really wants a 64k alignment, and we also want to ensure .dynamic gets its own. This allows ld to generate multiple segments for execute and write, fixing a failure with binutils 2.39 Signed-off-by: Benjamin Herrenschmidt --- gnuefi/elf_aa64_efi.lds | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gnuefi/elf_aa64_efi.lds b/gnuefi/elf_aa64_efi.lds index 161f5fc..e21ba04 100644 --- a/gnuefi/elf_aa64_efi.lds +++ b/gnuefi/elf_aa64_efi.lds @@ -15,8 +15,7 @@ SECTIONS } _etext = .; _text_size = . - _text; - .dynamic : { *(.dynamic) } - .data : ALIGN(4096) + .data : ALIGN(0x10000) { _data = .; *(.sdata) @@ -68,11 +67,13 @@ SECTIONS _edata = .; _data_size = . - _data; - . = ALIGN(4096); + . = ALIGN(0x10000); + .dynamic : { *(.dynamic) } + . = ALIGN(0x10000); .dynsym : { *(.dynsym) } - . = ALIGN(4096); + . = ALIGN(0x10000); .dynstr : { *(.dynstr) } - . = ALIGN(4096); + . = ALIGN(0x10000); .note.gnu.build-id : { *(.note.gnu.build-id) } /DISCARD/ : {