[PATCH] D19490: ELF: Teach section GC to also GC shared symbols.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 13:41:33 PDT 2016


ruiu 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.
----------------
So this code movement is just to move code to the file where it is used (plus a small cleanup), right?

================
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);
+  }
----------------
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?


http://reviews.llvm.org/D19490





More information about the llvm-commits mailing list