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

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 12:21:31 PDT 2019


sidneym marked an inline comment as done.
sidneym added inline comments.


================
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
----------------
jakehehrlich wrote:
> 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.
The binary used for the testcase has a symbol with a reference that cannot be stripped.  GNU-strip will leave it in place with no message or warning, llvm errors out unless explicitly kept.  The code doing it is: RelocationSection::removeSymbols in Object.cpp



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