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

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 07:33:00 PDT 2019


sidneym marked 2 inline comments 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
----------------
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.


================
Comment at: test/tools/llvm-objcopy/ELF/discard-all-debug.test:29
+CHECK-NOT:    Name: .rela.debug_line
+CHECK:    Name: .strtab
----------------
grimar wrote:
> Seems instead of lines 3-29 all you really need is just this line:
> 
> ```
> # RUN: llvm-readobj --sections %t | FileCheck %s --implicit-check-not=.debug_
> ```
I didn't know about this option I will make the change, thanks.


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