Skip to content

Commit

Permalink
Fix aarch64 sections alignment
Browse files Browse the repository at this point in the history
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 <benh@amazon.com>
  • Loading branch information
ozbenh committed Dec 21, 2022
1 parent cf6d591 commit 390c288
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gnuefi/elf_aa64_efi.lds
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ SECTIONS
}
_etext = .;
_text_size = . - _text;
.dynamic : { *(.dynamic) }
.data : ALIGN(4096)
.data : ALIGN(0x10000)
{
_data = .;
*(.sdata)
Expand Down Expand Up @@ -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/ :
{
Expand Down

0 comments on commit 390c288

Please sign in to comment.