From 14726cd11b8727a569917475bbffa4b09f94148c Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Fri, 20 Mar 2015 23:47:05 +0000 Subject: [PATCH] [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 --- lld/lib/ReaderWriter/ELF/DynamicFile.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lld/lib/ReaderWriter/ELF/DynamicFile.h b/lld/lib/ReaderWriter/ELF/DynamicFile.h index 8a30d9fd..c4e3e71 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; -- 2.7.4