• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s > %t
2# RUN: cp %t %t3
3# RUN: llvm-objcopy --strip-all %t %t2
4# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
5
6# Verify that the previous llvm-objcopy's run has not modified the input.
7# RUN: cmp %t %t3
8
9# RUN: llvm-strip %t3
10# RUN: cmp %t2 %t3
11
12# RUN: cp %t %t4
13# RUN: llvm-strip %t4 -o %t5
14# RUN: cmp %t2 %t5
15
16# Verify that the previous llvm-strip's run has not modified the input.
17# RUN: cmp %t %t4
18
19# RUN: cp %t %t-should-remain-the-same
20# RUN: llvm-strip %t4 -o %t-should-remain-the-same -o %t-should-be-stripped
21# RUN: cmp %t2 %t-should-be-stripped
22# RUN: cmp %t %t-should-remain-the-same
23
24# RUN: rm -f %t.a
25# RUN: llvm-ar crs %t.a %t
26# RUN: llvm-objcopy --strip-all %t.a %t.a
27# RUN: llvm-ar p %t.a > %t6
28# RUN: cmp %t2 %t6
29
30# RUN: cp %t %t7
31# RUN: llvm-strip -strip-all %t7
32# RUN: cmp %t2 %t7
33
34# RUN: cp %t %t8
35# RUN: llvm-strip --strip-all %t8
36# RUN: cmp %t2 %t8
37
38# Verify that a non-existent symbol table (after first call to llvm-strip)
39# can be handled correctly.
40# RUN: cp %t %t9
41# RUN: llvm-strip --strip-all -keep=unavailable_symbol %t9
42# RUN: llvm-strip --strip-all -keep=unavailable_symbol %t9
43# RUN: cmp %t2 %t9
44
45!ELF
46FileHeader:
47  Class:           ELFCLASS64
48  Data:            ELFDATA2LSB
49  Type:            ET_REL
50  Machine:         EM_X86_64
51Sections:
52  - Name:            .bss
53    Type:            SHT_NOBITS
54    Flags:           [ SHF_ALLOC ]
55  - Name:            .text
56    Type:            SHT_PROGBITS
57    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
58  - Name:            .blarg
59    Type:            SHT_PROGBITS
60    Flags:           [ ]
61  - Name:            .gnu.warning.foo
62    Type:            SHT_PROGBITS
63
64# CHECK: SectionHeaderCount: 5
65
66# CHECK: Name: .bss
67# CHECK: Name: .text
68# CHECK: Name: .gnu.warning.foo
69# CHECK: Name: .shstrtab
70