[PATCH] D58027: [llvm-objcopy] Add --strip-unneeded-symbol(s)

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 11:34:09 PST 2019


rupprecht accepted this revision.
rupprecht added inline comments.
This revision is now accepted and ready to land.


================
Comment at: tools/llvm-objcopy/ELF/ELFObjcopy.cpp:368
 
-      if (Config.StripUnneeded && !Sym.Referenced &&
-          (Sym.Binding == STB_LOCAL || Sym.getShndx() == SHN_UNDEF) &&
-          Sym.Type != STT_FILE && Sym.Type != STT_SECTION)
-        return true;
+      if (isUnneededSymbol(Sym))
+        if (Config.StripUnneeded ||
----------------
nit: these checks should be inverted, i.e. first check if the command line flag has been set, and then call `isUnneededSymbol()` to see if it applies.


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

https://reviews.llvm.org/D58027





More information about the llvm-commits mailing list