1RUN: llvm-readobj -s -t -dt -dynamic-table -needed-libs \
2RUN:              %p/Inputs/shared-object-test.elf-i386 \
3RUN:         | FileCheck %s -check-prefix ELF
4RUN: llvm-readobj -s -t -dt -dynamic-table -needed-libs \
5RUN:              %p/Inputs/shared-object-test.elf-i386 \
6RUN:         | FileCheck %s -check-prefix ELF32
7
8RUN: llvm-readobj -s -t -dt -dynamic-table -needed-libs \
9RUN:            %p/Inputs/shared-object-test.elf-x86-64 \
10RUN:         | FileCheck %s -check-prefix ELF
11RUN: llvm-readobj -s -t -dt -dynamic-table -needed-libs \
12RUN:            %p/Inputs/shared-object-test.elf-x86-64 \
13RUN:         | FileCheck %s -check-prefix ELF64
14
15ELF64: Format:      ELF64-x86-64
16ELF64: Arch:        x86_64
17ELF64: AddressSize: 64bit
18ELF64: LoadName:    libfoo.so
19
20ELF32: Format:      ELF32-i386
21ELF32: Arch:        i386
22ELF32: AddressSize: 32bit
23ELF32: LoadName:    libfoo.so
24
25ELF: Sections [
26ELF:   Section {
27ELF:     Name:  (0)
28ELF:     Type: SHT_NULL
29ELF:     Flags [ (0x0)
30ELF:     ]
31ELF:   }
32ELF:   Section {
33ELF:     Name: .hash
34ELF:     Type: SHT_HASH
35ELF:     Flags [ (0x2)
36ELF:       SHF_ALLOC
37ELF:     ]
38ELF:   }
39ELF:   Section {
40ELF:     Name: .dynsym
41ELF:     Type: SHT_DYNSYM
42ELF:     Flags [ (0x2)
43ELF:       SHF_ALLOC
44ELF:     ]
45ELF:   }
46ELF:   Section {
47ELF:     Name: .dynstr
48ELF:     Type: SHT_STRTAB
49ELF:     Flags [ (0x2)
50ELF:       SHF_ALLOC
51ELF:     ]
52ELF:   }
53ELF:   Section {
54ELF:     Name: .text
55ELF:     Type: SHT_PROGBITS
56ELF:     Flags [ (0x6)
57ELF:       SHF_ALLOC
58ELF:       SHF_EXECINSTR
59ELF:     ]
60ELF:   }
61ELF:   Section {
62ELF:     Name: .eh_frame
63ELF:     Type: SHT_PROGBITS
64ELF:     Flags [ (0x2)
65ELF:       SHF_ALLOC
66ELF:     ]
67ELF:   }
68ELF:   Section {
69ELF:     Name: .tdata
70ELF:     Type: SHT_PROGBITS
71ELF:     Flags [ (0x403)
72ELF:       SHF_ALLOC
73ELF:       SHF_TLS
74ELF:       SHF_WRITE
75ELF:     ]
76ELF:   }
77ELF:   Section {
78ELF:     Name: .dynamic
79ELF:     Type: SHT_DYNAMIC
80ELF:     Flags [ (0x3)
81ELF:       SHF_ALLOC
82ELF:       SHF_WRITE
83ELF:     ]
84ELF:   }
85ELF:   Section {
86ELF:     Name: .got.plt
87ELF:     Type: SHT_PROGBITS
88ELF:     Flags [ (0x3)
89ELF:       SHF_ALLOC
90ELF:       SHF_WRITE
91ELF:     ]
92ELF:   }
93ELF:   Section {
94ELF:     Name: .data
95ELF:     Type: SHT_PROGBITS
96ELF:     Flags [ (0x3)
97ELF:       SHF_ALLOC
98ELF:       SHF_WRITE
99ELF:     ]
100ELF:   }
101ELF:   Section {
102ELF:     Name: .bss
103ELF:     Type: SHT_NOBITS
104ELF:     Flags [ (0x3)
105ELF:       SHF_ALLOC
106ELF:       SHF_WRITE
107ELF:     ]
108ELF:   }
109ELF:   Section {
110ELF:     Name: .shstrtab
111ELF:     Type: SHT_STRTAB
112ELF:     Flags [ (0x0)
113ELF:     ]
114ELF:   }
115ELF:   Section {
116ELF:     Name: .symtab
117ELF:     Type: SHT_SYMTAB
118ELF:     Flags [ (0x0)
119ELF:     ]
120ELF:   }
121ELF:   Section {
122ELF:     Name: .strtab
123ELF:     Type: SHT_STRTAB
124ELF:     Flags [ (0x0)
125ELF:     ]
126ELF:   }
127ELF: ]
128
129ELF: Symbols [
130ELF:   Symbol {
131ELF:     Name: .hash
132ELF:     Binding: Local
133ELF:     Type: Section
134ELF:     Section: .hash
135ELF:   }
136ELF:   Symbol {
137ELF:     Name: .dynsym
138ELF:     Binding: Local
139ELF:     Type: Section
140ELF:     Section: .dynsym
141ELF:   }
142ELF:   Symbol {
143ELF:     Name: .dynstr
144ELF:     Binding: Local
145ELF:     Type: Section
146ELF:     Section: .dynstr
147ELF:   }
148ELF:   Symbol {
149ELF:     Name: .text
150ELF:     Binding: Local
151ELF:     Type: Section
152ELF:     Section: .text
153ELF:   }
154ELF:   Symbol {
155ELF:     Name: .eh_frame
156ELF:     Binding: Local
157ELF:     Type: Section
158ELF:     Section: .eh_frame
159ELF:   }
160ELF:   Symbol {
161ELF:     Name: .tdata
162ELF:     Binding: Local
163ELF:     Type: Section
164ELF:     Section: .tdata
165ELF:   }
166ELF:   Symbol {
167ELF:     Name: .dynamic
168ELF:     Binding: Local
169ELF:     Type: Section
170ELF:     Section: .dynamic
171ELF:   }
172ELF:   Symbol {
173ELF:     Name: .got.plt
174ELF:     Binding: Local
175ELF:     Type: Section
176ELF:     Section: .got.plt
177ELF:   }
178ELF:   Symbol {
179ELF:     Name: .data
180ELF:     Binding: Local
181ELF:     Type: Section
182ELF:     Section: .data
183ELF:   }
184ELF:   Symbol {
185ELF:     Name: .bss
186ELF:     Binding: Local
187ELF:     Type: Section
188ELF:     Section: .bss
189ELF:   }
190ELF:   Symbol {
191ELF:     Name: shared.ll
192ELF:     Binding: Local
193ELF:     Type: File
194ELF:     Section: Absolute (0xFFF1)
195ELF:   }
196ELF:   Symbol {
197ELF:     Name: local_func
198ELF:     Binding: Local
199ELF:     Type: Function
200ELF:     Section: .text
201ELF:   }
202ELF:   Symbol {
203ELF:     Name: _GLOBAL_OFFSET_TABLE_
204ELF:     Binding: Local
205ELF:     Type: Object
206ELF:     Section: Absolute (0xFFF1)
207ELF:   }
208ELF:   Symbol {
209ELF:     Name: _DYNAMIC
210ELF:     Binding: Local
211ELF:     Type: Object
212ELF:     Section: Absolute (0xFFF1)
213ELF:   }
214ELF:   Symbol {
215ELF:     Name: common_sym
216ELF:     Binding: Global
217ELF:     Type: Object
218ELF:     Section: .bss
219ELF:   }
220ELF:   Symbol {
221ELF:     Name: tls_sym
222ELF:     Binding: Global
223ELF:     Type: TLS
224ELF:     Section: .tdata
225ELF:   }
226ELF:   Symbol {
227ELF:     Name: defined_sym
228ELF:     Binding: Global
229ELF:     Type: Object
230ELF:     Section: .data
231ELF:   }
232ELF:   Symbol {
233ELF:     Name: __bss_start
234ELF:     Binding: Global
235ELF:     Type: None
236ELF:     Section: Absolute (0xFFF1)
237ELF:   }
238ELF:   Symbol {
239ELF:     Name: _end
240ELF:     Binding: Global
241ELF:     Type: None
242ELF:     Section: Absolute (0xFFF1)
243ELF:   }
244ELF:   Symbol {
245ELF:     Name: global_func
246ELF:     Binding: Global
247ELF:     Type: Function
248ELF:     Section: .text
249ELF:   }
250ELF:   Symbol {
251ELF:     Name: _edata
252ELF:     Binding: Global
253ELF:     Type: None
254ELF:     Section: Absolute (0xFFF1)
255ELF:   }
256ELF: ]
257
258ELF: DynamicSymbols [
259ELF:   Symbol {
260ELF:     Name: common_sym
261ELF:     Binding: Global
262ELF:     Type: Object
263ELF:     Section: .bss
264ELF:   }
265ELF:   Symbol {
266ELF:     Name: tls_sym
267ELF:     Binding: Global
268ELF:     Type: TLS
269ELF:     Section: .tdata
270ELF:   }
271ELF:   Symbol {
272ELF:     Name: defined_sym
273ELF:     Binding: Global
274ELF:     Type: Object
275ELF:     Section: .data
276ELF:   }
277ELF:   Symbol {
278ELF:     Name: __bss_start
279ELF:     Binding: Global
280ELF:     Type: None
281ELF:     Section: Absolute (0xFFF1)
282ELF:   }
283ELF:   Symbol {
284ELF:     Name: _end
285ELF:     Binding: Global
286ELF:     Type: None
287ELF:     Section: Absolute (0xFFF1)
288ELF:   }
289ELF:   Symbol {
290ELF:     Name: global_func
291ELF:     Binding: Global
292ELF:     Type: Function
293ELF:     Section: .text
294ELF:   }
295ELF:   Symbol {
296ELF:     Name: _edata
297ELF:     Binding: Global
298ELF:     Type: None
299ELF:     Section: Absolute (0xFFF1)
300ELF:   }
301ELF: ]
302
303ELF: DynamicSection [ (9 entries)
304ELF:   Tag        Type                 Name/Value
305ELF:   00000001 NEEDED               SharedLibrary (libc.so.6)
306ELF:   00000001 NEEDED               SharedLibrary (libm.so.6)
307ELF:   0000000E SONAME               LibrarySoname (libfoo.so)
308ELF:   00000004 HASH                 {{[0-9a-f]+}}
309ELF:   00000005 STRTAB               {{[0-9a-f]+}}
310ELF:   00000006 SYMTAB               {{[0-9a-f]+}}
311ELF:   0000000A STRSZ                {{[0-9]+}} (bytes)
312ELF:   0000000B SYMENT               {{[0-9]+}} (bytes)
313ELF:   00000000 NULL                 0x0
314ELF: ]
315
316ELF:      NeededLibraries [
317ELF-NEXT:  libc.so.6
318ELF-NEXT:  libm.so.6
319ELF-NEXT: ]
320