1 # RUN: yaml2obj %s > %t
3 # RUN: llvm-objcopy --strip-unneeded %t %t2
4 # Verify that llvm-objcopy has not modified the input.
6 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
8 # Verify that --keep-file-symbols works together with --strip-unneeded
9 # RUN: llvm-objcopy --keep-file-symbols --strip-unneeded %t %t2b
10 # RUN: llvm-readobj --symbols %t2b | FileCheck %s --check-prefix=FILESYM
12 # RUN: llvm-objcopy --strip-unneeded-symbol=bar \
14 # RUN: llvm-readobj --symbols %t3 | FileCheck %s --check-prefixes=STRIP-BAR,REMAIN
16 # RUN: llvm-objcopy --regex --strip-unneeded-symbol='.*' %t %t4
19 # RUN: echo " bar # bar " > %t.list.txt
20 # RUN: echo "foobar" >> %t.list.txt
21 # RUN: echo "foobaz" >> %t.list.txt
22 # RUN: echo " # comment " >> %t.list.txt
23 # RUN: llvm-objcopy --strip-unneeded-symbols %t.list.txt %t %t5
26 # RUN: echo " .* # * - remove all " > %t.list2.txt
27 # RUN: llvm-objcopy --regex --strip-unneeded-symbols %t.list2.txt %t %t6
30 # Verify that llvm-strip modifies the symbol table the same way.
31 # RUN: llvm-strip --strip-unneeded %t
43 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
45 AddressAlign: 0x0000000000000010
50 AddressAlign: 0x0000000000000004
53 - SectionOrType: GRP_COMDAT
54 - SectionOrType: .text
103 #CHECK-NEXT: Symbol {
105 #CHECK-NEXT: Value: 0x0
107 #CHECK-NEXT: Binding: Local
108 #CHECK-NEXT: Type: None
109 #CHECK-NEXT: Other: 0
110 #CHECK-NEXT: Section: Undefined
112 #CHECK-NEXT: Symbol {
113 #CHECK-NEXT: Name: foo
114 #CHECK-NEXT: Value: 0x1000
116 #CHECK-NEXT: Binding: Local
117 #CHECK-NEXT: Type: Function
118 #CHECK-NEXT: Other: 0
119 #CHECK-NEXT: Section: .text
121 #CHECK-NEXT: Symbol {
122 #CHECK-NEXT: Name: barfoo
123 #CHECK-NEXT: Value: 0x1010
125 #CHECK-NEXT: Binding: Local
126 #CHECK-NEXT: Type: Function
127 #CHECK-NEXT: Other: 0
128 #CHECK-NEXT: Section: .text
130 #CHECK-NEXT: Symbol {
131 #CHECK-NEXT: Name: sectionSymbol
132 #CHECK-NEXT: Value: 0x0
134 #CHECK-NEXT: Binding: Local
135 #CHECK-NEXT: Type: Section
136 #CHECK-NEXT: Other: 0
137 #CHECK-NEXT: Section: Undefined
139 #CHECK-NEXT: Symbol {
140 #CHECK-NEXT: Name: barbaz
141 #CHECK-NEXT: Value: 0x1020
143 #CHECK-NEXT: Binding: Global
144 #CHECK-NEXT: Type: Function
145 #CHECK-NEXT: Other: 0
146 #CHECK-NEXT: Section: .text
148 #CHECK-NEXT: Symbol {
149 #CHECK-NEXT: Name: baz
150 #CHECK-NEXT: Value: 0x1018
152 #CHECK-NEXT: Binding: Weak
153 #CHECK-NEXT: Type: Function
154 #CHECK-NEXT: Other: 0
155 #CHECK-NEXT: Section: .text
159 #FILESYM: Name: fileSymbol
160 #FILESYM-NEXT: Value: 0x0
162 #STRIP-BAR-NOT: Name: bar ({{.*}})
163 #REMAIN: Name: foobar
164 #REMAIN: Name: foobaz