arch: aarch64: align .{rodata,data,bss} to 8 bytes

ALIGN(4) is left over from 32-bit linker script templates. On
aarch64 the natural pointer/long alignment is 8, and these sections
usually contain 64-bit constants (pointer tables, 64-bit literals). The
4-byte alignment was harmless because the linker happens to align
individual symbols anyway, but let's just align it properly for the
sake of correctness. For BSS also ensure we have extra padding before
the end of the section.
This commit is contained in:
Ivaylo Ivanov
2026-05-27 16:07:59 +00:00
parent b6ca1fc1ff
commit 89ead8a57a

View File

@@ -50,21 +50,22 @@ SECTIONS
}
#endif
.rodata ALIGN(4) : {
.rodata ALIGN(8) : {
*(.rodata)
*(.rodata.*)
}
.data ALIGN(4) : {
.data ALIGN(8) : {
*(.data)
*(.data.*)
}
.bss ALIGN(4) : {
.bss ALIGN(8) : {
__bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(8);
__bss_end = .;
}