[PATCH] D61092: [llvm-strip] Have --discard-all imply --strip-debug

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 14:47:57 PDT 2019


jakehehrlich added a comment.

This appears to be correct. StripDebug is a preety simple and minimal field so we can go ahead and add this. The keep symbol thing still looks a bit funny.

Can you add this behavior to llvm-objcopy as well? We don't want them to be inconsistent.



================
Comment at: test/tools/llvm-objcopy/ELF/discard-all-debug.test:2
+# RUN: cp %p/Inputs/dwarf.dwo %t
+# RUN: llvm-strip --keep-symbol=.L.str --discard-all %t
+# RUN: llvm-readobj --file-headers --sections %t | FileCheck %s
----------------
sidneym wrote:
> grimar wrote:
> > When I call GNU strip, it works without `--keep-symbol=.L.str` for this input.
> > Do you know why whe have a difference here?
> GNU strip doesn't issue a message when a reference is still required, it just keeps it.
> The fatal error llvm-strip produces can cause some issues when trying to use it as a drop-in replacement for gnu strip.  The error is generated in removeSymbols and if there was a way to infer that strip was the executable perhaps that check could be avoided.
This doesn't explain grimar's question from my perspective and I have the same question.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61092





More information about the llvm-commits mailing list