]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sections
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 23 Jul 2016 08:14:11 +0000 (10:14 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 2 Aug 2016 06:21:46 +0000 (08:21 +0200)
Newer versions of ld automatically emit .gnu.hash and .note.gnu.build-id
sections, which are not listed in the linker script, and will end up
breaking the build with an allocation conflict, e.g.,

  /usr/bin/aarch64-linux-gnu-ld: section .note.gnu.build-id loaded at
    [0000000000000000,0000000000000023] overlaps section .text loaded at
    [0000000000000000,0000000000017dbf]

Since we don't require or care about these sections, update the linker
script so that they are discarded. Note that this involves emitting the
.note.gnu.build-id section into a non-allocatable segment to prevent the
linker from noticing that it is being discarded (and subsequently
complaining about it)

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

index 832ad147446831be4c9b414e3204697d576cfc64..44df7840adfdad9a6236ca6256948540a9e2708d 100644 (file)
@@ -30,8 +30,11 @@ SECTIONS
     PROVIDE(__reloc_end = .);\r
   }\r
 \r
+  .note (INFO) : { *(.note.gnu.build-id) }\r
+\r
   /DISCARD/ : {\r
     *(.note.GNU-stack)\r
+    *(.gnu.hash)\r
     *(.gnu_debuglink)\r
     *(.interp)\r
     *(.dynamic)\r