]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg: use global section alignment in custom linker script
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 11 Aug 2015 12:32:45 +0000 (12:32 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Tue, 11 Aug 2015 12:32:45 +0000 (12:32 +0000)
The ArmVirtPrePiUniCoreRelocatable module comes with its own GNU
linker script to create a PIE executable that can relocate itself
at runtime. In order to be able to build this module using CLANG,
we need to adhere to the section alignment passed via to the linker
using -z commmon-page-size, so add this to the linker script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18203 6f19259b-4bc3-4df7-8a09-765794883524

ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds

index 32af0696aa6bebc675de3b0becfbd1be5465549f..3c89722dcaabaad1239d56b5b41107af8e2f3e41 100644 (file)
 \r
 SECTIONS\r
 {\r
 \r
 SECTIONS\r
 {\r
-  .text 0x0 : {\r
+  .text 0x0 : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
     PROVIDE(__reloc_base = .);\r
 \r
     *(.text .text*)\r
     *(.got .got*)\r
     *(.rodata .rodata*)\r
     *(.data .data*)\r
     PROVIDE(__reloc_base = .);\r
 \r
     *(.text .text*)\r
     *(.got .got*)\r
     *(.rodata .rodata*)\r
     *(.data .data*)\r
+    *(.bss .bss*)\r
 \r
     . = ALIGN(0x20);\r
     PROVIDE(__reloc_start = .);\r
     *(.rela .rela*)\r
     PROVIDE(__reloc_end = .);\r
   }\r
 \r
     . = ALIGN(0x20);\r
     PROVIDE(__reloc_start = .);\r
     *(.rela .rela*)\r
     PROVIDE(__reloc_end = .);\r
   }\r
-  .bss ALIGN(0x20) : { *(.bss .bss*) }\r
 \r
   /DISCARD/ : {\r
     *(.note.GNU-stack)\r
 \r
   /DISCARD/ : {\r
     *(.note.GNU-stack)\r