If certain switches are not specified, llvm-strip behaves as if --strip-all were specified. This means that for testing, when we don't want the stripping behaviour, we have to specify one of these switches, which can be confusing. This change adds --no-strip-all to allow an alternative way of suppressing the default stripping, in a less confusing manner. Reviewed by: jakehehrlich, MaskRay Differential Revision: https://reviews.llvm.org/D61377 llvm-svn: 359781
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
# RUN: yaml2obj %s -o %t.o
|
|
# RUN: not llvm-objcopy -R .foo %t.o %t1 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
|
|
# RUN: cp %t.o %t2
|
|
# RUN: not llvm-strip --no-strip-all -R .foo %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
- Name: .bar
|
|
Type: SHT_PROGBITS
|
|
Link: .foo
|
|
|
|
# ERR: Section .foo cannot be removed because it is referenced by the section .bar
|
|
|
|
# RUN: llvm-objcopy --allow-broken-links -R .foo %t.o %t3
|
|
# RUN: llvm-readobj --sections %t3 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
|
|
# RUN: cp %t.o %t4
|
|
# RUN: llvm-strip --no-strip-all --allow-broken-links -R .foo %t4
|
|
# RUN: llvm-readobj --sections %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
|
|
|
|
# SECTIONS: Name: .bar
|
|
# SECTIONS: Link
|
|
# SECTIONS-SAME: : 0
|