diff options
author | ian <ian@FreeBSD.org> | 2016-04-09 19:09:06 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2016-04-09 19:09:06 +0000 |
commit | 02c6e6bd14411a4740ce0a788ebb4a2e308b0c7e (patch) | |
tree | 5217e261f828b06744f8fd26beb163caaa853cde | |
parent | b1f5ba96ab953fbf5cf52e9cca1214831cb6df42 (diff) | |
download | FreeBSD-src-02c6e6bd14411a4740ce0a788ebb4a2e308b0c7e.zip FreeBSD-src-02c6e6bd14411a4740ce0a788ebb4a2e308b0c7e.tar.gz |
Align the start of the text segment to an 8-byte boundary. This fixes
alignment aborts in ubldr.bin for RPi that started happening with clang 3.8
(earlier clang apparently didn't generate strd instructions that trigger
the alignment fault). The abort happened in ubldr.bin and not ubldr (elf
version) because the elf headers are 0xf4 bytes long, and stripping them
off left everything 4-byte aligned.
While here, also stop aligning the data segment to a page boundary, align
it to 8 bytes instead (aligning to a page just needlessly makes the file
bigger); pointed out by andrew@.
-rw-r--r-- | sys/boot/arm/uboot/ldscript.arm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/boot/arm/uboot/ldscript.arm b/sys/boot/arm/uboot/ldscript.arm index 1eb10a8..8eb604c 100644 --- a/sys/boot/arm/uboot/ldscript.arm +++ b/sys/boot/arm/uboot/ldscript.arm @@ -6,6 +6,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = UBLDR_LOADADDR + SIZEOF_HEADERS; + . = ALIGN(8); .text : { *(.text) @@ -47,8 +48,8 @@ SECTIONS .rodata1 : { *(.rodata1) } .sdata2 : { *(.sdata2) } .sbss2 : { *(.sbss2) } - /* Adjust the address for the data segment to the next page up. */ - . = ((. + 0x1000) & ~(0x1000 - 1)); + /* Adjust the address for the data segment to the doubleword boundary. */ + . = ALIGN(8); .data : { *(.data) |