[PATCH] D38790: [ELF] Avoid keeping useless undefined symbols in .dynsym.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 15:24:57 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Writer.cpp:1281-1291
     if (InX::DynSymTab && S->includeInDynsym()) {
+      if (Body->isUndefined() && !Body->IsUsedInReloc)
+        // This symbol was most probably used in a section, which was collected
+        // in the GC phase. We don't need such symbols in the dynamic symbols
+        // table because they solely introduce useless dependencies.
+        continue;
       InX::DynSymTab->addSymbol(Body);
----------------
I don't think this is logically correct. If `includeInDynsym` returns true, the symbol should be included in a .dynsym regardless of other conditions. You should modify other place so that `includeInDynsym` works correctly.


https://reviews.llvm.org/D38790





More information about the llvm-commits mailing list