1 ## Check that we are able to dump MIPS GOT entries using -A properly.
3 ## Check how we dump 64-bit inputs.
5 # RUN: yaml2obj --docnum=1 -DTYPE=ET_REL %s -o %t.got.o
6 # RUN: yaml2obj --docnum=1 -DTYPE=ET_DYN %s -o %t.got.so
7 # RUN: yaml2obj --docnum=1 -DTYPE=ET_EXEC %s -o %t.got.exe
9 # RUN: llvm-readobj -A %t.got.o 2>&1 | FileCheck %s -DOTHERNUM=0 -check-prefix=BASIC-LLVM
10 # RUN: llvm-readobj -A %t.got.so 2>&1 | FileCheck %s -DOTHERNUM=0 -check-prefix=BASIC-LLVM
11 # RUN: llvm-readobj -A %t.got.exe 2>&1 | FileCheck %s -DOTHERNUM=0 -check-prefix=BASIC-LLVM
12 # RUN: llvm-readelf -A %t.got.o 2>&1 | FileCheck %s -check-prefix=BASIC-GNU \
13 # RUN: --implicit-check-not="Number of" --strict-whitespace --match-full-lines
14 # RUN: llvm-readelf -A %t.got.so 2>&1 | FileCheck %s -check-prefix=BASIC-GNU \
15 # RUN: --implicit-check-not="Number of" --strict-whitespace --match-full-lines
16 # RUN: llvm-readelf -A %t.got.exe 2>&1 | FileCheck %s -check-prefix=BASIC-GNU \
17 # RUN: --implicit-check-not="Number of" --strict-whitespace --match-full-lines
23 Type: [[TYPE=ET_EXEC]]
29 ContentArray: [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ## Lazy resolver.
30 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ## Module pointer (GNU extension)
31 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, ## Local entry 1
32 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, ## Local entry 2
33 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, ## Global entry 1
34 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB ] ## Global entry 2
38 ShType: [[DYNAMICTYPE=<none>]]
40 - Tag: DT_MIPS_LOCAL_GOTNO
51 # BASIC-LLVM: Primary GOT {
52 # BASIC-LLVM-NEXT: Canonical gp value: 0x9112
53 # BASIC-LLVM-NEXT: Reserved entries [
54 # BASIC-LLVM-NEXT: Entry {
55 # BASIC-LLVM-NEXT: Address: 0x1122
56 # BASIC-LLVM-NEXT: Access: -32752
57 # BASIC-LLVM-NEXT: Initial: 0x0
58 # BASIC-LLVM-NEXT: Purpose: Lazy resolver
60 # BASIC-LLVM-NEXT: Entry {
61 # BASIC-LLVM-NEXT: Address: 0x112A
62 # BASIC-LLVM-NEXT: Access: -32744
63 # BASIC-LLVM-NEXT: Initial: 0xFFFFFFFFFFFFFFFF
64 # BASIC-LLVM-NEXT: Purpose: Module pointer (GNU extension)
67 # BASIC-LLVM-NEXT: Local entries [
68 # BASIC-LLVM-NEXT: Entry {
69 # BASIC-LLVM-NEXT: Address: 0x1132
70 # BASIC-LLVM-NEXT: Access: -32736
71 # BASIC-LLVM-NEXT: Initial: 0x1111111111111111
73 # BASIC-LLVM-NEXT: Entry {
74 # BASIC-LLVM-NEXT: Address: 0x113A
75 # BASIC-LLVM-NEXT: Access: -32728
76 # BASIC-LLVM-NEXT: Initial: 0x2222222222222222
79 # BASIC-LLVM-NEXT: Global entries [
80 # BASIC-LLVM-NEXT: Entry {
81 # BASIC-LLVM-NEXT: Address: 0x1142
82 # BASIC-LLVM-NEXT: Access: -32720
83 # BASIC-LLVM-NEXT: Initial: 0xAAAAAAAAAAAAAAAA
84 # BASIC-LLVM-NEXT: Value: 0x0
85 # BASIC-LLVM-NEXT: Type: None (0x0)
86 # BASIC-LLVM-NEXT: Section: Undefined (0x0)
87 # BASIC-LLVM-NEXT: Name: foo (5)
89 # BASIC-LLVM-NEXT: Entry {
90 # BASIC-LLVM-NEXT: Address: 0x114A
91 # BASIC-LLVM-NEXT: Access: -32712
92 # BASIC-LLVM-NEXT: Initial: 0xBBBBBBBBBBBBBBBB
93 # BASIC-LLVM-NEXT: Value: 0x0
94 # BASIC-LLVM-NEXT: Type: Function (0x2)
95 # BASIC-LLVM-NEXT: Section: Undefined (0x0)
96 # BASIC-LLVM-NEXT: Name: bar (1)
99 # BASIC-LLVM-NEXT: Number of TLS and multi-GOT entries: [[OTHERNUM]]
102 # BASIC-GNU:Primary GOT:
103 # BASIC-GNU-NEXT: Canonical gp value: 0000000000009112
105 # BASIC-GNU-NEXT: Reserved entries:
106 # BASIC-GNU-NEXT: Address Access Initial Purpose
107 # BASIC-GNU-NEXT: 0000000000001122 -32752(gp) 0000000000000000 Lazy resolver
108 # BASIC-GNU-NEXT: 000000000000112a -32744(gp) ffffffffffffffff Module pointer (GNU extension)
110 # BASIC-GNU-NEXT: Local entries:
111 # BASIC-GNU-NEXT: Address Access Initial
112 # BASIC-GNU-NEXT: 0000000000001132 -32736(gp) 1111111111111111 {{$}}
113 # BASIC-GNU-NEXT: 000000000000113a -32728(gp) 2222222222222222 {{$}}
115 # BASIC-GNU-NEXT: Global entries:
116 # BASIC-GNU-NEXT: Address Access Initial Sym.Val. Type Ndx Name
117 # BASIC-GNU-NEXT: 0000000000001142 -32720(gp) aaaaaaaaaaaaaaaa 0000000000000000 NOTYPE UND foo
118 # BASIC-GNU-NEXT: 000000000000114a -32712(gp) bbbbbbbbbbbbbbbb 0000000000000000 FUNC UND bar
120 # BASIC-GNU-OTHER-NEXT: Number of TLS and multi-GOT entries [[OTHERNUM]]
122 ## Check we are able to print the number of TLS and multi-GOT entries properly.
124 # RUN: yaml2obj --docnum=1 %s -DSIZE=56 -o %t.other.entries1.exe
125 # RUN: yaml2obj --docnum=1 %s -DSIZE=64 -o %t.other.entries2.exe
126 # RUN: llvm-readobj -A %t.other.entries1.exe 2>&1 | FileCheck %s -DOTHERNUM=1 --check-prefix=BASIC-LLVM
127 # RUN: llvm-readobj -A %t.other.entries2.exe 2>&1 | FileCheck %s -DOTHERNUM=2 -check-prefix=BASIC-LLVM
128 # RUN: llvm-readelf -A %t.other.entries1.exe 2>&1 | FileCheck %s -DOTHERNUM=1 \
129 # RUN: --check-prefixes=BASIC-GNU,BASIC-GNU-OTHER --strict-whitespace --match-full-lines
130 # RUN: llvm-readelf -A %t.other.entries2.exe 2>&1 | FileCheck %s -DOTHERNUM=2 \
131 # RUN: --check-prefixes=BASIC-GNU,BASIC-GNU-OTHER --strict-whitespace --match-full-lines
133 ## Check how we print static GOT. Our code assumes that the GOT is static when there
134 ## is no .dynamic section, so we change its type to hide it.
136 # RUN: yaml2obj --docnum=1 -DDYNAMICTYPE=SHT_PROGBITS %s -o %t.got-static.exe
137 # RUN: llvm-readobj -A %t.got-static.exe | FileCheck %s --check-prefix=STATIC-GOT-LLVM
138 # RUN: llvm-readelf -A %t.got-static.exe | FileCheck %s --check-prefix=STATIC-GOT-GNU
140 # STATIC-GOT-LLVM: Static GOT {
141 # STATIC-GOT-LLVM-NEXT: Canonical gp value: 0x9112
142 # STATIC-GOT-LLVM-NEXT: Reserved entries [
143 # STATIC-GOT-LLVM-NEXT: Entry {
144 # STATIC-GOT-LLVM-NEXT: Address: 0x1122
145 # STATIC-GOT-LLVM-NEXT: Access: -32752
146 # STATIC-GOT-LLVM-NEXT: Initial: 0x0
147 # STATIC-GOT-LLVM-NEXT: Purpose: Lazy resolver
148 # STATIC-GOT-LLVM-NEXT: }
149 # STATIC-GOT-LLVM-NEXT: Entry {
150 # STATIC-GOT-LLVM-NEXT: Address: 0x112A
151 # STATIC-GOT-LLVM-NEXT: Access: -32744
152 # STATIC-GOT-LLVM-NEXT: Initial: 0xFFFFFFFFFFFFFFFF
153 # STATIC-GOT-LLVM-NEXT: Purpose: Module pointer (GNU extension)
154 # STATIC-GOT-LLVM-NEXT: }
155 # STATIC-GOT-LLVM-NEXT: ]
156 # STATIC-GOT-LLVM-NEXT: Local entries [
157 # STATIC-GOT-LLVM-NEXT: Entry {
158 # STATIC-GOT-LLVM-NEXT: Address: 0x1132
159 # STATIC-GOT-LLVM-NEXT: Access: -32736
160 # STATIC-GOT-LLVM-NEXT: Initial: 0x1111111111111111
161 # STATIC-GOT-LLVM-NEXT: }
162 # STATIC-GOT-LLVM-NEXT: Entry {
163 # STATIC-GOT-LLVM-NEXT: Address: 0x113A
164 # STATIC-GOT-LLVM-NEXT: Access: -32728
165 # STATIC-GOT-LLVM-NEXT: Initial: 0x2222222222222222
166 # STATIC-GOT-LLVM-NEXT: }
167 # STATIC-GOT-LLVM-NEXT: Entry {
168 # STATIC-GOT-LLVM-NEXT: Address: 0x1142
169 # STATIC-GOT-LLVM-NEXT: Access: -32720
170 # STATIC-GOT-LLVM-NEXT: Initial: 0xAAAAAAAAAAAAAAAA
171 # STATIC-GOT-LLVM-NEXT: }
172 # STATIC-GOT-LLVM-NEXT: Entry {
173 # STATIC-GOT-LLVM-NEXT: Address: 0x114A
174 # STATIC-GOT-LLVM-NEXT: Access: -32712
175 # STATIC-GOT-LLVM-NEXT: Initial: 0xBBBBBBBBBBBBBBBB
176 # STATIC-GOT-LLVM-NEXT: }
177 # STATIC-GOT-LLVM-NEXT: ]
178 # STATIC-GOT-LLVM-NEXT: }
180 # STATIC-GOT-GNU: Static GOT:
181 # STATIC-GOT-GNU-NEXT: Canonical gp value: 0000000000009112
182 # STATIC-GOT-GNU-EMPTY:
183 # STATIC-GOT-GNU-NEXT: Reserved entries:
184 # STATIC-GOT-GNU-NEXT: Address Access Initial Purpose
185 # STATIC-GOT-GNU-NEXT: 0000000000001122 -32752(gp) 0000000000000000 Lazy resolver
186 # STATIC-GOT-GNU-NEXT: 000000000000112a -32744(gp) ffffffffffffffff Module pointer (GNU extension)
187 # STATIC-GOT-GNU-EMPTY:
188 # STATIC-GOT-GNU-NEXT: Local entries:
189 # STATIC-GOT-GNU-NEXT: Address Access Initial
190 # STATIC-GOT-GNU-NEXT: 0000000000001132 -32736(gp) 1111111111111111
191 # STATIC-GOT-GNU-NEXT: 000000000000113a -32728(gp) 2222222222222222
192 # STATIC-GOT-GNU-NEXT: 0000000000001142 -32720(gp) aaaaaaaaaaaaaaaa
193 # STATIC-GOT-GNU-NEXT: 000000000000114a -32712(gp) bbbbbbbbbbbbbbbb
194 # STATIC-GOT-GNU-EMPTY:
195 # STATIC-GOT-GNU-NOT: {{.}}
197 ## Check how we dump 32-bit inputs.
199 # RUN: yaml2obj --docnum=2 %s -o %t.got32.exe
200 # RUN: llvm-readobj -A %t.got32.exe 2>&1 | FileCheck %s -check-prefix=BASIC32-LLVM
201 # RUN: llvm-readelf -A %t.got32.exe 2>&1 | FileCheck %s -check-prefix=BASIC32-GNU \
202 # RUN: --strict-whitespace --match-full-lines
204 # BASIC32-LLVM: Primary GOT {
205 # BASIC32-LLVM-NEXT: Canonical gp value: 0x9112
206 # BASIC32-LLVM-NEXT: Reserved entries [
207 # BASIC32-LLVM-NEXT: Entry {
208 # BASIC32-LLVM-NEXT: Address: 0x1122
209 # BASIC32-LLVM-NEXT: Access: -32752
210 # BASIC32-LLVM-NEXT: Initial: 0x0
211 # BASIC32-LLVM-NEXT: Purpose: Lazy resolver
212 # BASIC32-LLVM-NEXT: }
213 # BASIC32-LLVM-NEXT: Entry {
214 # BASIC32-LLVM-NEXT: Address: 0x1126
215 # BASIC32-LLVM-NEXT: Access: -32748
216 # BASIC32-LLVM-NEXT: Initial: 0xFFFFFFFF
217 # BASIC32-LLVM-NEXT: Purpose: Module pointer (GNU extension)
218 # BASIC32-LLVM-NEXT: }
219 # BASIC32-LLVM-NEXT: ]
220 # BASIC32-LLVM-NEXT: Local entries [
221 # BASIC32-LLVM-NEXT: Entry {
222 # BASIC32-LLVM-NEXT: Address: 0x112A
223 # BASIC32-LLVM-NEXT: Access: -32744
224 # BASIC32-LLVM-NEXT: Initial: 0x11111111
225 # BASIC32-LLVM-NEXT: }
226 # BASIC32-LLVM-NEXT: Entry {
227 # BASIC32-LLVM-NEXT: Address: 0x112E
228 # BASIC32-LLVM-NEXT: Access: -32740
229 # BASIC32-LLVM-NEXT: Initial: 0x22222222
230 # BASIC32-LLVM-NEXT: }
231 # BASIC32-LLVM-NEXT: ]
232 # BASIC32-LLVM-NEXT: Global entries [
233 # BASIC32-LLVM-NEXT: Entry {
234 # BASIC32-LLVM-NEXT: Address: 0x1132
235 # BASIC32-LLVM-NEXT: Access: -32736
236 # BASIC32-LLVM-NEXT: Initial: 0xAAAAAAAA
237 # BASIC32-LLVM-NEXT: Value: 0x0
238 # BASIC32-LLVM-NEXT: Type: None (0x0)
239 # BASIC32-LLVM-NEXT: Section: Undefined (0x0)
240 # BASIC32-LLVM-NEXT: Name: foo (5)
241 # BASIC32-LLVM-NEXT: }
242 # BASIC32-LLVM-NEXT: Entry {
243 # BASIC32-LLVM-NEXT: Address: 0x1136
244 # BASIC32-LLVM-NEXT: Access: -32732
245 # BASIC32-LLVM-NEXT: Initial: 0xBBBBBBBB
246 # BASIC32-LLVM-NEXT: Value: 0x0
247 # BASIC32-LLVM-NEXT: Type: Function (0x2)
248 # BASIC32-LLVM-NEXT: Section: Undefined (0x0)
249 # BASIC32-LLVM-NEXT: Name: bar (1)
250 # BASIC32-LLVM-NEXT: }
251 # BASIC32-LLVM-NEXT: ]
252 # BASIC32-LLVM-NEXT: Number of TLS and multi-GOT entries: 1
253 # BASIC32-LLVM-NEXT: }
255 # BASIC32-GNU:Primary GOT:
256 # BASIC32-GNU-NEXT: Canonical gp value: 00009112
258 # BASIC32-GNU-NEXT: Reserved entries:
259 # BASIC32-GNU-NEXT: Address Access Initial Purpose
260 # BASIC32-GNU-NEXT: 00001122 -32752(gp) 00000000 Lazy resolver
261 # BASIC32-GNU-NEXT: 00001126 -32748(gp) ffffffff Module pointer (GNU extension)
263 # BASIC32-GNU-NEXT: Local entries:
264 # BASIC32-GNU-NEXT: Address Access Initial
265 # BASIC32-GNU-NEXT: 0000112a -32744(gp) 11111111 {{$}}
266 # BASIC32-GNU-NEXT: 0000112e -32740(gp) 22222222 {{$}}
268 # BASIC32-GNU-NEXT: Global entries:
269 # BASIC32-GNU-NEXT: Address Access Initial Sym.Val. Type Ndx Name
270 # BASIC32-GNU-NEXT: 00001132 -32736(gp) aaaaaaaa 00000000 NOTYPE UND foo
271 # BASIC32-GNU-NEXT: 00001136 -32732(gp) bbbbbbbb 00000000 FUNC UND bar
273 # BASIC32-GNU-NEXT: Number of TLS and multi-GOT entries 1
285 ContentArray: [ 0x00, 0x00, 0x00, 0x00, ## Lazy resolver.
286 0xFF, 0xFF, 0xFF, 0xFF, ## Module pointer (GNU extension).
287 0x11, 0x11, 0x11, 0x11, ## Local entry 1.
288 0x22, 0x22, 0x22, 0x22, ## Local entry 2.
289 0xAA, 0xAA, 0xAA, 0xAA, ## Global entry 1.
290 0xBB, 0xBB, 0xBB, 0xBB, ## Global entry 2.
291 0x00, 0x00, 0x00, 0x00 ] ## Other entry.
295 - Tag: DT_MIPS_LOCAL_GOTNO
297 - Tag: DT_MIPS_GOTSYM
306 ## Check what we print when there are no local nor global GOT entries.
308 # RUN: yaml2obj --docnum=3 %s -o %t.got-noentries.exe
309 # RUN: llvm-readobj -A %t.got-noentries.exe | FileCheck %s --check-prefix=GOT-EMPTY-LLVM
310 # RUN: llvm-readelf -A %t.got-noentries.exe | FileCheck %s --check-prefix=GOT-EMPTY-GNU
312 # GOT-EMPTY-LLVM: Primary GOT {
313 # GOT-EMPTY-LLVM-NEXT: Canonical gp value: 0x9112
314 # GOT-EMPTY-LLVM-NEXT: Reserved entries [
315 # GOT-EMPTY-LLVM-NEXT: Entry {
316 # GOT-EMPTY-LLVM-NEXT: Address: 0x1122
317 # GOT-EMPTY-LLVM-NEXT: Access: -32752
318 # GOT-EMPTY-LLVM-NEXT: Initial: 0x0
319 # GOT-EMPTY-LLVM-NEXT: Purpose: Lazy resolver
320 # GOT-EMPTY-LLVM-NEXT: }
321 # GOT-EMPTY-LLVM-NEXT: Entry {
322 # GOT-EMPTY-LLVM-NEXT: Address: 0x112A
323 # GOT-EMPTY-LLVM-NEXT: Access: -32744
324 # GOT-EMPTY-LLVM-NEXT: Initial: 0xFFFFFFFFFFFFFFFF
325 # GOT-EMPTY-LLVM-NEXT: Purpose: Module pointer (GNU extension)
326 # GOT-EMPTY-LLVM-NEXT: }
327 # GOT-EMPTY-LLVM-NEXT: ]
328 # GOT-EMPTY-LLVM-NEXT: Local entries [
329 # GOT-EMPTY-LLVM-NEXT: ]
330 # GOT-EMPTY-LLVM-NEXT: Global entries [
331 # GOT-EMPTY-LLVM-NEXT: ]
332 # GOT-EMPTY-LLVM-NEXT: Number of TLS and multi-GOT entries: 0
333 # GOT-EMPTY-LLVM-NEXT: }
335 # GOT-EMPTY-GNU: Primary GOT:
336 # GOT-EMPTY-GNU-NEXT: Canonical gp value: 0000000000009112
337 # GOT-EMPTY-GNU-EMPTY:
338 # GOT-EMPTY-GNU-NEXT: Reserved entries:
339 # GOT-EMPTY-GNU-NEXT: Address Access Initial Purpose
340 # GOT-EMPTY-GNU-NEXT: 0000000000001122 -32752(gp) 0000000000000000 Lazy resolver
341 # GOT-EMPTY-GNU-NEXT: 000000000000112a -32744(gp) ffffffffffffffff Module pointer (GNU extension)
342 # GOT-EMPTY-GNU-NOT: {{.}}
354 ContentArray: [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ## Lazy resolver.
355 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ] ## Module pointer (GNU extension)
356 Size: [[SIZE=<none>]]
360 - Tag: DT_MIPS_LOCAL_GOTNO
362 - Tag: DT_MIPS_GOTSYM
368 ## Check we report errors when dynamic tags, needed for dumping GOT, are missing.
370 # RUN: yaml2obj --docnum=4 -DTAG1=DT_MIPS_LOCAL_GOTNO -DTAG2=DT_MIPS_GOTSYM %s -o %t.err1.o
371 # RUN: llvm-readobj -A %t.err1.o 2>&1 | FileCheck %s -DFILE=%t.err1.o -check-prefixes=NO-OUTPUT,ERR1
373 # RUN: yaml2obj --docnum=4 -DTAG1=DT_PLTGOT -DTAG2=DT_MIPS_GOTSYM %s -o %t.err2.o
374 # RUN: llvm-readobj -A %t.err2.o 2>&1 | FileCheck %s -DFILE=%t.err2.o -check-prefixes=NO-OUTPUT,ERR2
376 # RUN: yaml2obj --docnum=4 -DTAG1=DT_PLTGOT -DTAG2=DT_MIPS_LOCAL_GOTNO %s -o %t.err3.o
377 # RUN: llvm-readobj -A %t.err3.o 2>&1 | FileCheck %s -DFILE=%t.err3.o -check-prefixes=NO-OUTPUT,ERR3
397 # RUN: yaml2obj --docnum=5 -DVAL1=0xffff %s -o %t.err4.o
398 # RUN: llvm-readobj -A %t.err4.o 2>&1 | FileCheck %s -DFILE=%t.err4.o -check-prefixes=NO-OUTPUT,ERR4
400 # RUN: yaml2obj --docnum=5 -DVAL2=0xffff %s -o %t.err5.o
401 # RUN: llvm-readobj -A %t.err5.o 2>&1 | FileCheck %s -DFILE=%t.err5.o -check-prefixes=NO-OUTPUT,ERR5
413 - Tag: DT_MIPS_LOCAL_GOTNO
415 - Tag: DT_MIPS_GOTSYM
421 # NO-OUTPUT: LoadName: <Not found>
422 # NO-OUTPUT-NEXT: There is no .MIPS.abiflags section in the file.
423 # NO-OUTPUT-NEXT: There is no .MIPS.options section in the file.
424 # NO-OUTPUT-NEXT: There is no .reginfo section in the file.
426 # ERR1-NEXT: warning: '[[FILE]]': cannot find PLTGOT dynamic tag
427 # ERR2-NEXT: warning: '[[FILE]]': cannot find MIPS_LOCAL_GOTNO dynamic tag
428 # ERR3-NEXT: warning: '[[FILE]]': cannot find MIPS_GOTSYM dynamic tag
429 # ERR4-NEXT: warning: '[[FILE]]': DT_MIPS_GOTSYM value (65535) exceeds the number of dynamic symbols (1)
430 # ERR5-NEXT: warning: '[[FILE]]': there is no non-empty GOT section at 0xffff
433 # NO-OUTPUT-NOT: {{.}}
435 ## Check that we do not report a warning about the .got section when we are able to locate it by name.
436 # RUN: yaml2obj --docnum=6 -DNAME=0xffff %s -o %t.err6.o
437 # RUN: llvm-readobj -A %t.err6.o 2>&1 | \
438 # RUN: FileCheck %s -DFILE=%t.err6.o -check-prefix=NAME-ERR-FOUND --implicit-check-not=warning:
439 # RUN: llvm-readelf -A %t.err6.o 2>&1 | \
440 # RUN: FileCheck %s -DFILE=%t.err6.o -check-prefix=NAME-ERR-FOUND --implicit-check-not=warning:
442 # NAME-ERR-FOUND: warning: '[[FILE]]': unable to read the name of SHT_PROGBITS section with index 1: a section [index 1] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table
443 # NAME-ERR-FOUND-NEXT: warning: '[[FILE]]': unable to read the name of SHT_PROGBITS section with index 3: a section [index 3] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table
453 ShName: [[NAME=<none>]]
456 ShName: [[GOTNAME=<none>]]
458 ShName: [[NAME=<none>]]
460 ## Check we report a warning when we are unable to find the .got section due to an error.
461 # RUN: yaml2obj --docnum=6 -DGOTNAME=0xffff %s -o %t.err7.o
462 # RUN: llvm-readelf -A %t.err7.o 2>&1 | FileCheck %s -DFILE=%t.err7.o --check-prefix=NAME-ERR-NOTFOUND --implicit-check-not=warning:
463 # RUN: llvm-readobj -A %t.err7.o 2>&1 | FileCheck %s -DFILE=%t.err7.o --check-prefix=NAME-ERR-NOTFOUND --implicit-check-not=warning:
465 # NAME-ERR-NOTFOUND: warning: '[[FILE]]': unable to read the name of SHT_PROGBITS section with index 2: a section [index 2] has an invalid sh_name (0xffff) offset which goes past the end of the section name string table
467 ## Check that we correctly show .got section content when there are some other zero-sized
468 ## sections with the same address as the .got section.
469 ## In this test the empty .data section has the same address as the .got section.
471 # RUN: yaml2obj --docnum=7 %s -o %t.err7.o
472 # RUN: llvm-readobj -A %t.err7.o 2>&1 | FileCheck %s -DFILE=%t.err7.o --check-prefix=SAME-ADDR-LLVM
473 # RUN: llvm-readelf -A %t.err7.o 2>&1 | FileCheck %s -DFILE=%t.err7.o --check-prefix=SAME-ADDR-GNU
475 # SAME-ADDR-LLVM: Primary GOT {
476 # SAME-ADDR-LLVM-NEXT: Canonical gp value: 0x9112
477 # SAME-ADDR-LLVM-NEXT: Reserved entries [
478 # SAME-ADDR-LLVM-NEXT: Entry {
479 # SAME-ADDR-LLVM-NEXT: Address: 0x1122
480 # SAME-ADDR-LLVM-NEXT: Access: -32752
481 # SAME-ADDR-LLVM-NEXT: Initial: 0x0
482 # SAME-ADDR-LLVM-NEXT: Purpose: Lazy resolver
483 # SAME-ADDR-LLVM-NEXT: }
484 # SAME-ADDR-LLVM-NEXT: ]
485 # SAME-ADDR-LLVM-NEXT: Local entries [
486 # SAME-ADDR-LLVM-NEXT: ]
487 # SAME-ADDR-LLVM-NEXT: Global entries [
488 # SAME-ADDR-LLVM-NEXT: Entry {
489 # SAME-ADDR-LLVM-NEXT: Address: 0x112A
490 # SAME-ADDR-LLVM-NEXT: Access: -32744
491 # SAME-ADDR-LLVM-NEXT: Initial: 0x0
492 # SAME-ADDR-LLVM-NEXT: Value: 0x0
493 # SAME-ADDR-LLVM-NEXT: Type: None (0x0)
494 # SAME-ADDR-LLVM-NEXT: Section: Undefined (0x0)
495 # SAME-ADDR-LLVM-NEXT: Name: foo (1)
496 # SAME-ADDR-LLVM-NEXT: }
497 # SAME-ADDR-LLVM-NEXT: ]
498 # SAME-ADDR-LLVM-NEXT: Number of TLS and multi-GOT entries: 0
499 # SAME-ADDR-LLVM-NEXT: }
501 # SAME-ADDR-GNU: Primary GOT:
502 # SAME-ADDR-GNU-NEXT: Canonical gp value: 0000000000009112
503 # SAME-ADDR-GNU-EMPTY:
504 # SAME-ADDR-GNU-NEXT: Reserved entries:
505 # SAME-ADDR-GNU-NEXT: Address Access Initial Purpose
506 # SAME-ADDR-GNU-NEXT: 0000000000001122 -32752(gp) 0000000000000000 Lazy resolver
507 # SAME-ADDR-GNU-EMPTY:
508 # SAME-ADDR-GNU-NEXT: Global entries:
509 # SAME-ADDR-GNU-NEXT: Address Access Initial Sym.Val. Type Ndx Name
510 # SAME-ADDR-GNU-NEXT: 000000000000112a -32744(gp) 0000000000000000 0000000000000000 NOTYPE UND foo
530 - Tag: DT_MIPS_LOCAL_GOTNO
532 - Tag: DT_MIPS_GOTSYM
539 ## Check how we print global GOT entries when they are unnamed section symbols.
540 # RUN: yaml2obj --docnum=8 %s -o %t.err8.o
541 # RUN: llvm-readobj -A %t.err8.o 2>&1 | FileCheck %s -DFILE=%t.err8.o --check-prefix=SEC-SYMS-LLVM
542 # RUN: llvm-readelf -A %t.err8.o 2>&1 | FileCheck %s -DFILE=%t.err8.o --check-prefix=SEC-SYMS-GNU
544 # SEC-SYMS-LLVM: Global entries [
545 # SEC-SYMS-LLVM-NEXT: Entry {
546 # SEC-SYMS-LLVM: Section: Absolute (0xFFF1)
547 # SEC-SYMS-LLVM-NEXT: warning: '[[FILE]]': unable to get section index for symbol with st_shndx = 0xfff1 (SHN_ABS)
548 # SEC-SYMS-LLVM-NEXT: Name: <?> (0)
549 # SEC-SYMS-LLVM-NEXT: }
550 # SEC-SYMS-LLVM-NEXT: Entry {
551 # SEC-SYMS-LLVM: Section: .got (0x1)
552 # SEC-SYMS-LLVM-NEXT: Name: .got (0)
553 # SEC-SYMS-LLVM-NEXT: }
554 # SEC-SYMS-LLVM-NEXT: Entry {
555 # SEC-SYMS-LLVM: Section: Common (0xFFF2)
556 # SEC-SYMS-LLVM-NEXT: warning: '[[FILE]]': unable to get section index for symbol with st_shndx = 0xfff2 (SHN_COMMON)
557 # SEC-SYMS-LLVM-NEXT: Name: <?> (0)
558 # SEC-SYMS-LLVM-NEXT: }
559 # SEC-SYMS-LLVM-NEXT: Entry {
560 # SEC-SYMS-LLVM: Type: Section (0x3)
561 # SEC-SYMS-LLVM-NEXT: warning: '[[FILE]]': found an extended symbol index (4), but unable to locate the extended symbol index table
562 # SEC-SYMS-LLVM-NEXT: Section: Reserved (0xFFFF)
563 # SEC-SYMS-LLVM-NEXT: Name: <?> (0)
564 # SEC-SYMS-LLVM-NEXT: }
565 # SEC-SYMS-LLVM-NEXT: ]
567 # SEC-SYMS-GNU: Global entries:
568 # SEC-SYMS-GNU-NEXT: {{.*}} Ndx Name
569 # SEC-SYMS-GNU-NEXT: warning: '[[FILE]]': unable to get section index for symbol with st_shndx = 0xfff1 (SHN_ABS)
570 # SEC-SYMS-GNU-NEXT: {{.*}} ABS <?>
571 # SEC-SYMS-GNU-NEXT: {{.*}} 1 .got
572 # SEC-SYMS-GNU-NEXT: warning: '[[FILE]]': unable to get section index for symbol with st_shndx = 0xfff2 (SHN_COMMON)
573 # SEC-SYMS-GNU-NEXT: {{.*}} COM <?>
574 # SEC-SYMS-GNU-NEXT: warning: '[[FILE]]': found an extended symbol index (4), but unable to locate the extended symbol index table
575 # SEC-SYMS-GNU-NEXT: {{.*}} RSV[0xffff] <?>
591 - Tag: DT_MIPS_LOCAL_GOTNO
593 - Tag: DT_MIPS_GOTSYM