summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/DynamicFile.h
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2015-03-20 23:47:05 +0000
committerShankar Easwaran <shankare@codeaurora.org>2015-03-20 23:47:05 +0000
commit14726cd11b8727a569917475bbffa4b09f94148c (patch)
tree112bdd1156511b8e8e24c5d0b741f6fde7067666 /lld/lib/ReaderWriter/ELF/DynamicFile.h
parent07f6ce0b83ac97879e2d1010c329158ee6db17b8 (diff)
downloadbcm5719-llvm-14726cd11b8727a569917475bbffa4b09f94148c.tar.gz
bcm5719-llvm-14726cd11b8727a569917475bbffa4b09f94148c.zip
[ELF] Dont add local symbols for dynamic lookup.
Unable to add a unit test for this, as there is only one local undefined symbol in regular shared libraries without a name. llvm-svn: 232867
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/DynamicFile.h')
-rw-r--r--lld/lib/ReaderWriter/ELF/DynamicFile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/ELF/DynamicFile.h b/lld/lib/ReaderWriter/ELF/DynamicFile.h
index 8a30d9fd31a..c4e3e7165ef 100644
--- a/lld/lib/ReaderWriter/ELF/DynamicFile.h
+++ b/lld/lib/ReaderWriter/ELF/DynamicFile.h
@@ -64,6 +64,11 @@ protected:
if ((ec = name.getError()))
return ec;
+ // Dont add local symbols to dynamic entries. The first symbol in the
+ // dynamic symbol table is a local symbol.
+ if (i->getBinding() == llvm::ELF::STB_LOCAL)
+ continue;
+
// TODO: Add absolute symbols
if (i->st_shndx == llvm::ELF::SHN_ABS)
continue;
OpenPOWER on IntegriCloud