[PATCH] D19490: ELF: Teach section GC to also GC shared symbols.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 25 13:56:23 PDT 2016
pcc added inline comments.
================
Comment at: ELF/MarkLive.cpp:42
@@ -40,1 +41,3 @@
+// A resolved relocation. The Sec and Offset fields are set if the relocation
+// was resolved to an offset within a section. Otherwise the Sym field is set.
----------------
ruiu wrote:
> So this code movement is just to move code to the file where it is used (plus a small cleanup), right?
Yes.
================
Comment at: ELF/MarkLive.cpp:165-168
@@ +164,6 @@
+ for (Symbol *S : Symtab->getSymbols()) {
+ if (S->Body->isShared())
+ S->IsUsedInRegularObj = false;
+ else if (S->includeInDynsym())
+ MarkSymbol(S->Body);
+ }
----------------
ruiu wrote:
> Is this order safe? If getSymbols happens to return non-shared symbols and shared symbols in this order, then you would clear IsUsedInRegularObj bit for all shared symbols, wouldn't you?
We only ever process a shared symbol when we remove an section from the work list and call `forEachSuccessor`. `MarkSymbol` only calls `Enqueue` with a section+offset, never a symbol.
http://reviews.llvm.org/D19490
More information about the llvm-commits
mailing list