From: Shankar Easwaran Date: Fri, 20 Mar 2015 23:47:05 +0000 (+0000) Subject: [ELF] Dont add local symbols for dynamic lookup. X-Git-Tag: llvmorg-3.7.0-rc1~8683 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14726cd11b8727a569917475bbffa4b09f94148c;p=platform%2Fupstream%2Fllvm.git [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 --- 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;