summaryrefslogtreecommitdiffstats
path: root/BaseTools/Scripts/GccBase.lds
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-05-19 11:47:40 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-05-24 06:09:39 -0700
commit00b00cc57bfe0fca54c904d4dd44a263e243c88b (patch)
tree80c3916f0797fc3aa3b99e99169cfa7cb8fdc0a9 /BaseTools/Scripts/GccBase.lds
parenta0284a9a5820e470bae2557a7e25c426e62c8a4e (diff)
downloadedk2-00b00cc57bfe0fca54c904d4dd44a263e243c88b.tar.gz
edk2-00b00cc57bfe0fca54c904d4dd44a263e243c88b.tar.bz2
edk2-00b00cc57bfe0fca54c904d4dd44a263e243c88b.zip
BaseTools/Scripts: discard .gnu.hash section in GCC builds
Some builds of GCC/binutils will default to using the GNU flavor of the symbol hash table, and will emit it into a section called .gnu.hash rather than .hash. We have no use for its contents, and GenFw ignores it anyway, so it shouldn't really matter what we do with it. However, due to a workaround for AARCH64 we have in GenFw to deal with older GCCs that corrupt section-based relocations when merging sections during the final link, we need the ELF and PE/COFF views of the binary to be identical. Since we don't place the .gnu.hash section explicitly, it may end up at the beginning of the ELF binary, causing other sections to be shifted in the ELF view but not in the PE/COFF view. So let's add .gnu.hash to the GCC linker script. We don't care about its contents so add it to the /DISCARD/ section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Scripts/GccBase.lds')
-rw-r--r--BaseTools/Scripts/GccBase.lds2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds
index 41e5c0b4a7..847333c3de 100644
--- a/BaseTools/Scripts/GccBase.lds
+++ b/BaseTools/Scripts/GccBase.lds
@@ -78,7 +78,7 @@ SECTIONS {
*(.dynsym)
*(.dynstr)
*(.dynamic)
- *(.hash)
+ *(.hash .gnu.hash)
*(.comment)
*(COMMON)
}