OSDN Git Service

[llvm-strip]Add --no-strip-all to disable --strip-all behaviour (including default...
[android-x86/external-llvm.git] / test / tools / llvm-objcopy / ELF / remove-linked-section.test
1 # RUN: yaml2obj %s -o %t.o
2 # RUN: not llvm-objcopy -R .foo %t.o %t1 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
3 # RUN: cp %t.o %t2
4 # RUN: not llvm-strip --no-strip-all -R .foo %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
5
6 --- !ELF
7 FileHeader:
8   Class:           ELFCLASS64
9   Data:            ELFDATA2LSB
10   Type:            ET_REL
11   Machine:         EM_X86_64
12 Sections:
13   - Name:            .foo
14     Type:            SHT_PROGBITS
15   - Name:            .bar
16     Type:            SHT_PROGBITS
17     Link:            .foo
18
19 # ERR: Section .foo cannot be removed because it is referenced by the section .bar
20
21 # RUN: llvm-objcopy --allow-broken-links -R .foo %t.o %t3
22 # RUN: llvm-readobj --sections %t3 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
23 # RUN: cp %t.o %t4
24 # RUN: llvm-strip --no-strip-all --allow-broken-links -R .foo %t4
25 # RUN: llvm-readobj --sections %t4 | FileCheck %s --check-prefix=SECTIONS --implicit-check-not=.foo
26
27 # SECTIONS:      Name: .bar
28 # SECTIONS:      Link
29 # SECTIONS-SAME: : 0