]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: deal with relaxed XIP alignment
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 2 Aug 2016 10:08:03 +0000 (12:08 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 2 Aug 2016 12:04:00 +0000 (14:04 +0200)
Commit b89919ee8f8c ("BaseTools AARCH64: override XIP module linker
alignment to 32 bytes") updated the various AARCH64 toolchain definitions
to allow SEC, PEI_CORE and PEIM modules to be built with minimal alignment
requirements even when using the AArch64 small code model which normally
requires 4 KB section alignment.

This involves conversion of ADRP instructions into ADR instructions, which
can only be done reliably if the ELF and the PE/COFF sections appear at
the same offset modulo 4 KB.

The ArmVirtPrePiUniCoreRelocatable linker script did not yet take this
into account, so update it by starting the .text section at the next
appropriately aligned offset PECOFF_HEADER_SIZE bytes into the image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds

index 44df7840adfdad9a6236ca6256948540a9e2708d..492a8fff380f995221676e0db027f2934889235e 100644 (file)
 \r
 SECTIONS\r
 {\r
-  .text 0x0 : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
-    PROVIDE(__reloc_base = .);\r
+  PROVIDE(__reloc_base = .);\r
 \r
+  . = PECOFF_HEADER_SIZE;\r
+  .text : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
     *(.text .text*)\r
     *(.got .got*)\r
     *(.rodata .rodata*)\r