[PATCH] D55902: [ELF] SymbolTable::addShared: don't set IsNeeded unless IsUsedInRegularObj

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 15:50:05 PST 2018


ruiu added inline comments.


================
Comment at: ELF/SymbolTable.cpp:512-514
+    if (!S->isWeak() && S->IsUsedInRegularObj && !Config->GcSections &&
+        WasUndefined)
       File.IsNeeded = true;
----------------
Thinking about this code, I'm no longer sure if this code makes sense. If IsNeeded is set correctly for --gc-sections, we can just remove this `if` and let the later pass to set an appropriate bit to IsNeeded, maybe?


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55902/new/

https://reviews.llvm.org/D55902





More information about the llvm-commits mailing list