[PATCH] D46896: [llvm-objcopy] Add --strip-unneeded option

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 01:36:50 PDT 2018


jhenderson added a comment.

Could you add a test for --strip-unneeded and group sections, please.

Thinking more about testing, what's the behaviour of --strip-unneeded + --remove-section <some relocation section> and are we happy with it?



================
Comment at: tools/llvm-objcopy/Object.h:347
   uint8_t Visibility;
+  uint32_t RelocRefs;
 
----------------
As this now includes group references, it should probably be renamed. Perhaps simply "ReferenceCount" or something similar?


================
Comment at: tools/llvm-objcopy/Object.h:468
   void setSymTab(const SymbolTableSection *SymTabSec) { SymTab = SymTabSec; }
-  void setSymbol(const Symbol *S) { Sym = S; }
+  void setSymbol(Symbol *S) { Sym = S; ++Sym->RelocRefs; }
   void setFlagWord(ELF::Elf32_Word W) { FlagWord = W; }
----------------
Is this really how clang-format formats this?


Repository:
  rL LLVM

https://reviews.llvm.org/D46896





More information about the llvm-commits mailing list