[lld] r232867 - [ELF] Dont add local symbols for dynamic lookup.

Shankar Easwaran shankare at codeaurora.org
Fri Mar 20 16:47:05 PDT 2015


Author: shankare
Date: Fri Mar 20 18:47:05 2015
New Revision: 232867

URL: http://llvm.org/viewvc/llvm-project?rev=232867&view=rev
Log:
[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.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/DynamicFile.h

Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicFile.h?rev=232867&r1=232866&r2=232867&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicFile.h Fri Mar 20 18:47:05 2015
@@ -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;





More information about the llvm-commits mailing list