[PATCH] D46896: [llvm-objcopy] Add --strip-unneeded option
    Alexander Shaposhnikov via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu May 24 21:39:14 PDT 2018
    
    
  
alexshap added inline comments.
================
Comment at: tools/llvm-objcopy/llvm-objcopy.cpp:267
 
+    if (Config.StripUnneeded) {
+      for (auto &Section : Obj.sections())
----------------
jakehehrlich wrote:
> nit: If you could add a comment explaining what this is doing and why it needs to be here that would be great.
@paulsemel, wait,  but shouldn't it be right after Obj.removeSections(RemovePred); ?
(and in that case update the symbols table again)
For example, if one removes a group of sections (including the .group section itself),
the list of "referenced" symbols might potentially change, it's necessary to add a test for this case too, i think.
Repository:
  rL LLVM
https://reviews.llvm.org/D46896
    
    
More information about the llvm-commits
mailing list