diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2015-07-14 13:25:32 +0000 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2015-07-14 13:25:32 +0000 |
commit | 4d0d1babfc181ef6ba75db9bbdf0b707b88820eb (patch) | |
tree | 94b03330c7ef58b6f5df15549cdbb62d04da3ede /lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp | |
parent | ab9907a217daebdfd3cec2110a8e8cdb34248d6d (diff) | |
download | bcm5719-llvm-4d0d1babfc181ef6ba75db9bbdf0b707b88820eb.tar.gz bcm5719-llvm-4d0d1babfc181ef6ba75db9bbdf0b707b88820eb.zip |
[ELF/AArch64] Fix export TLS dynamic symbol
This patch fixes the TLS dynamic variable exportation from .got.plt segments,
created by General-dynamic relocations (TLSDESC). Current code only export
symbols in dynamic table from .got sections.
llvm-svn: 242142
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp b/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp index ba4259479a8..9a9ec6cba12 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.cpp @@ -33,10 +33,12 @@ void AArch64ExecutableWriter::buildDynamicSymbolTable(const File &file) { for (auto sec : this->_layout.sections()) { if (auto section = dyn_cast<AtomSection<ELF64LE>>(sec)) { for (const auto &atom : section->atoms()) { - if (_targetLayout.getGOTSection().hasGlobalGOTEntry(atom->_atom)) { - this->_dynamicSymbolTable->addSymbol(atom->_atom, section->ordinal(), - atom->_virtualAddr, atom); - continue; + // Add all globals GOT symbols (in both .got and .got.plt sections) + // on dynamic symbol table. + for (const auto §ion : _targetLayout.getGOTSections()) { + if (section->hasGlobalGOTEntry(atom->_atom)) + _dynamicSymbolTable->addSymbol(atom->_atom, section->ordinal(), + atom->_virtualAddr, atom); } } } |