llvm.org GIT mirror llvm / 4c8d94c
[llvm-readobj] - Remove excessive `dynamic.test` dynamic.test is a test that checks dumping of dynamic tags. It uses precompiled objects as inputs and it is completely excessive nowadays: Now we have elf-dynamic-tags-machine-specific.test and elf-dynamic-tags.test. (https://github.com/llvm-mirror/llvm/blob/master/test/tools/llvm-readobj/elf-dynamic-tags-machine-specific.test) (https://github.com/llvm-mirror/llvm/blob/master/test/tools/llvm-readobj/elf-dynamic-tags.test) First is used to check target specific tags and second tests the common flags. These tests use YAML, which is much better than using precompiled binaries. Note that new reviews tend to update the YAML based tests to add new tags, e.g. see D62596. With this patch it became possible to remove dynamic-table-so.aarch64 binary from the inputs folder. (other binaries are still used in other tests). Differential revision: https://reviews.llvm.org/D62728 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362224 91177308-0d34-0410-b5e6-96231b3b80d8 George Rimar 11 months ago
3 changed file(s) with 0 addition(s) and 248 deletion(s). Raw diff Collapse all Expand all
test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64 less more
Binary diff not shown
33 // -o dynamic-table-so.mips
44 // clang -target mipsel-linux-gnu -lc dynamic-table.c \
55 // -o dynamic-table-exe.mips
6 // clang -target aarch64-linux-gnu -fPIC -shared dynamic-table.c\
7 // -o dynamic-table-so.aarch64
86 int puts(const char *);
97
108 __thread int foo;
+0
-246
test/tools/llvm-readobj/dynamic.test less more
None // Check dynamic section tags in case of shared library file.
1 RUN: llvm-readobj --dynamic-table %p/Inputs/dynamic-table-so.mips \
2 RUN: | FileCheck %s -check-prefix ELF-MIPS
3 RUN: llvm-readelf --dynamic-table %p/Inputs/dynamic-table-so.mips \
4 RUN: | FileCheck %s --strict-whitespace -check-prefix ELF-MIPS-GNU
5
6 ELF-MIPS: Format: ELF32-mips
7 ELF-MIPS: Arch: mipsel
8 ELF-MIPS: AddressSize: 32bit
9 ELF-MIPS: LoadName:
10 ELF-MIPS: DynamicSection [ (23 entries)
11 ELF-MIPS: Tag Type Name/Value
12 ELF-MIPS: 0x00000001 NEEDED Shared library: [libc.so.6]
13 ELF-MIPS: 0x0000000C INIT 0x528
14 ELF-MIPS: 0x0000000D FINI 0x860
15 ELF-MIPS: 0x00000004 HASH 0x210
16 ELF-MIPS: 0x00000005 STRTAB 0x3D8
17 ELF-MIPS: 0x00000006 SYMTAB 0x2A8
18 ELF-MIPS: 0x0000000A STRSZ 231 (bytes)
19 ELF-MIPS: 0x0000000B SYMENT 16 (bytes)
20 ELF-MIPS: 0x00000003 PLTGOT 0x108E0
21 ELF-MIPS: 0x00000011 REL 0x518
22 ELF-MIPS: 0x00000012 RELSZ 16 (bytes)
23 ELF-MIPS: 0x00000013 RELENT 8 (bytes)
24 ELF-MIPS: 0x70000001 MIPS_RLD_VERSION 1
25 ELF-MIPS: 0x70000005 MIPS_FLAGS NOTPOT
26 ELF-MIPS: 0x70000006 MIPS_BASE_ADDRESS 0x0
27 ELF-MIPS: 0x7000000A MIPS_LOCAL_GOTNO 10
28 ELF-MIPS: 0x70000011 MIPS_SYMTABNO 19
29 ELF-MIPS: 0x70000012 MIPS_UNREFEXTNO 26
30 ELF-MIPS: 0x70000013 MIPS_GOTSYM 0xD
31 ELF-MIPS: 0x6FFFFFFE VERNEED 0x4E8
32 ELF-MIPS: 0x6FFFFFFF VERNEEDNUM 1
33 ELF-MIPS: 0x6FFFFFF0 VERSYM 0x4C0
34 ELF-MIPS: 0x00000000 NULL 0x0
35 ELF-MIPS: ]
36
37 ELF-MIPS-GNU: Dynamic section at offset 0x{{.*}} contains 23 entries:
38 ELF-MIPS-GNU-NEXT: Tag Type Name/Value
39 ELF-MIPS-GNU-NEXT: 0x00000001 (NEEDED) Shared library: [libc.so.6]
40 ELF-MIPS-GNU-NEXT: 0x0000000c (INIT) 0x528
41 ELF-MIPS-GNU-NEXT: 0x0000000d (FINI) 0x860
42 ELF-MIPS-GNU-NEXT: 0x00000004 (HASH) 0x210
43 ELF-MIPS-GNU-NEXT: 0x00000005 (STRTAB) 0x3d8
44 ELF-MIPS-GNU-NEXT: 0x00000006 (SYMTAB) 0x2a8
45 ELF-MIPS-GNU-NEXT: 0x0000000a (STRSZ) 231 (bytes)
46 ELF-MIPS-GNU-NEXT: 0x0000000b (SYMENT) 16 (bytes)
47 ELF-MIPS-GNU-NEXT: 0x00000003 (PLTGOT) 0x108e0
48 ELF-MIPS-GNU-NEXT: 0x00000011 (REL) 0x518
49 ELF-MIPS-GNU-NEXT: 0x00000012 (RELSZ) 16 (bytes)
50 ELF-MIPS-GNU-NEXT: 0x00000013 (RELENT) 8 (bytes)
51 ELF-MIPS-GNU-NEXT: 0x70000001 (MIPS_RLD_VERSION) 1
52 ELF-MIPS-GNU-NEXT: 0x70000005 (MIPS_FLAGS) NOTPOT
53 ELF-MIPS-GNU-NEXT: 0x70000006 (MIPS_BASE_ADDRESS) 0x0
54 ELF-MIPS-GNU-NEXT: 0x7000000a (MIPS_LOCAL_GOTNO) 10
55 ELF-MIPS-GNU-NEXT: 0x70000011 (MIPS_SYMTABNO) 19
56 ELF-MIPS-GNU-NEXT: 0x70000012 (MIPS_UNREFEXTNO) 26
57 ELF-MIPS-GNU-NEXT: 0x70000013 (MIPS_GOTSYM) 0xd
58 ELF-MIPS-GNU-NEXT: 0x6ffffffe (VERNEED) 0x4e8
59 ELF-MIPS-GNU-NEXT: 0x6fffffff (VERNEEDNUM) 1
60 ELF-MIPS-GNU-NEXT: 0x6ffffff0 (VERSYM) 0x4c0
61 ELF-MIPS-GNU-NEXT: 0x00000000 (NULL) 0x0
62
63 // Check dynamic section tags in case of non-pic executable file.
64 RUN: llvm-readobj --dynamic-table %p/Inputs/dynamic-table-exe.mips \
65 RUN: | FileCheck %s -check-prefix ELF-MIPS-EXE
66
67 ELF-MIPS-EXE: Format: ELF32-mips
68 ELF-MIPS-EXE: Arch: mipsel
69 ELF-MIPS-EXE: AddressSize: 32bit
70 ELF-MIPS-EXE: LoadName:
71 ELF-MIPS-EXE: DynamicSection [ (26 entries)
72 ELF-MIPS-EXE: Tag Type Name/Value
73 ELF-MIPS-EXE: 0x00000001 NEEDED Shared library: [libc.so.6]
74 ELF-MIPS-EXE: 0x0000000C INIT 0x400418
75 ELF-MIPS-EXE: 0x0000000D FINI 0x4007B0
76 ELF-MIPS-EXE: 0x00000004 HASH 0x4002B8
77 ELF-MIPS-EXE: 0x00000005 STRTAB 0x40036C
78 ELF-MIPS-EXE: 0x00000006 SYMTAB 0x4002EC
79 ELF-MIPS-EXE: 0x0000000A STRSZ 107 (bytes)
80 ELF-MIPS-EXE: 0x0000000B SYMENT 16 (bytes)
81 ELF-MIPS-EXE: 0x70000016 MIPS_RLD_MAP 0x410880
82 ELF-MIPS-EXE: 0x00000015 DEBUG 0x0
83 ELF-MIPS-EXE: 0x00000003 PLTGOT 0x410890
84 ELF-MIPS-EXE: 0x70000001 MIPS_RLD_VERSION 1
85 ELF-MIPS-EXE: 0x70000005 MIPS_FLAGS NOTPOT
86 ELF-MIPS-EXE: 0x70000006 MIPS_BASE_ADDRESS 0x400000
87 ELF-MIPS-EXE: 0x7000000A MIPS_LOCAL_GOTNO 5
88 ELF-MIPS-EXE: 0x70000011 MIPS_SYMTABNO 8
89 ELF-MIPS-EXE: 0x70000012 MIPS_UNREFEXTNO 32
90 ELF-MIPS-EXE: 0x70000013 MIPS_GOTSYM 0x7
91 ELF-MIPS-EXE: 0x00000014 PLTREL REL
92 ELF-MIPS-EXE: 0x00000017 JMPREL 0x400408
93 ELF-MIPS-EXE: 0x00000002 PLTRELSZ 16 (bytes)
94 ELF-MIPS-EXE: 0x70000032 MIPS_PLTGOT 0x410854
95 ELF-MIPS-EXE: 0x6FFFFFFE VERNEED 0x4003E8
96 ELF-MIPS-EXE: 0x6FFFFFFF VERNEEDNUM 1
97 ELF-MIPS-EXE: 0x6FFFFFF0 VERSYM 0x4003D8
98 ELF-MIPS-EXE: 0x00000000 NULL 0x0
99 ELF-MIPS-EXE: ]
100
101 RUN: llvm-readobj --dynamic-table %p/Inputs/dynamic-table-exe.x86 \
102 RUN: | FileCheck %s -check-prefix ELF-X86-EXE
103
104 ELF-X86-EXE: Format: ELF32-i386
105 ELF-X86-EXE: Arch: i386
106 ELF-X86-EXE: AddressSize: 32bit
107 ELF-X86-EXE: LoadName:
108 ELF-X86-EXE: DynamicSection [ (30 entries)
109 ELF-X86-EXE: Tag Type Name/Value
110 ELF-X86-EXE: 0x00000001 NEEDED Shared library: [libstdc++.so.6]
111 ELF-X86-EXE: 0x00000001 NEEDED Shared library: [libgcc_s.so.1]
112 ELF-X86-EXE: 0x00000001 NEEDED Shared library: [libc.so.6]
113 ELF-X86-EXE: 0x0000000C INIT 0x62C
114 ELF-X86-EXE: 0x0000000D FINI 0x920
115 ELF-X86-EXE: 0x00000019 INIT_ARRAY 0x19FC
116 ELF-X86-EXE: 0x0000001B INIT_ARRAYSZ 4 (bytes)
117 ELF-X86-EXE: 0x0000001A FINI_ARRAY 0x1A00
118 ELF-X86-EXE: 0x0000001C FINI_ARRAYSZ 4 (bytes)
119 ELF-X86-EXE: 0x00000004 HASH 0x18C
120 ELF-X86-EXE: 0x6FFFFEF5 GNU_HASH 0x1E4
121 ELF-X86-EXE: 0x00000005 STRTAB 0x328
122 ELF-X86-EXE: 0x00000006 SYMTAB 0x218
123 ELF-X86-EXE: 0x0000000A STRSZ 408 (bytes)
124 ELF-X86-EXE: 0x0000000B SYMENT 16 (bytes)
125 ELF-X86-EXE: 0x00000015 DEBUG 0x0
126 ELF-X86-EXE: 0x00000003 PLTGOT 0x1B30
127 ELF-X86-EXE: 0x00000002 PLTRELSZ 64 (bytes)
128 ELF-X86-EXE: 0x00000014 PLTREL REL
129 ELF-X86-EXE: 0x00000017 JMPREL 0x5EC
130 ELF-X86-EXE: 0x00000011 REL 0x564
131 ELF-X86-EXE: 0x00000012 RELSZ 136 (bytes)
132 ELF-X86-EXE: 0x00000013 RELENT 8 (bytes)
133 ELF-X86-EXE: 0x00000016 TEXTREL
134 ELF-X86-EXE: 0x0000001E FLAGS TEXTREL
135 ELF-X86-EXE: 0x6FFFFFFE VERNEED 0x4E4
136 ELF-X86-EXE: 0x6FFFFFFF VERNEEDNUM 3
137 ELF-X86-EXE: 0x6FFFFFF0 VERSYM 0x4C0
138 ELF-X86-EXE: 0x6FFFFFFA RELCOUNT 6
139 ELF-X86-EXE: 0x00000000 NULL 0x0
140 ELF-X86-EXE: ]
141
142 RUN: llvm-readobj --dynamic-table %p/Inputs/dynamic-table-so.x86 \
143 RUN: | FileCheck %s -check-prefix ELF-X86-SO
144
145 ELF-X86-SO: Format: ELF64-x86-64
146 ELF-X86-SO: Arch: x86_64
147 ELF-X86-SO: AddressSize: 64bit
148 ELF-X86-SO: LoadName:
149 ELF-X86-SO: DynamicSection [ ({{[0-9]+}} entries)
150 ELF-X86-SO: Tag Type Name/Value
151 ELF-X86-SO: 0x0000000000000001 NEEDED Shared library: [libc.so.6]
152 ELF-X86-SO: 0x0000000000000001 NEEDED Shared library: [ld-linux-x86-64.so.2]
153 ELF-X86-SO: 0x000000007FFFFFFF FILTER Filter library: [filter.so]
154 ELF-X86-SO: 0x000000007FFFFFFD AUXILIARY Auxiliary library: [aux.so]
155 ELF-X86-SO: 0x000000000000000C INIT 0x{{[0-9A-F]+}}
156 ELF-X86-SO: 0x000000000000000D FINI 0x{{[0-9A-F]+}}
157 ELF-X86-SO: 0x0000000000000019 INIT_ARRAY 0x{{[0-9A-F]+}}
158 ELF-X86-SO: 0x000000000000001B INIT_ARRAYSZ 8 (bytes)
159 ELF-X86-SO: 0x000000000000001A FINI_ARRAY 0x{{[0-9A-F]+}}
160 ELF-X86-SO: 0x000000000000001C FINI_ARRAYSZ 8 (bytes)
161 ELF-X86-SO: 0x000000006FFFFEF5 GNU_HASH 0x1C8
162 ELF-X86-SO: 0x0000000000000005 STRTAB 0x3A0
163 ELF-X86-SO: 0x0000000000000006 SYMTAB 0x208
164 ELF-X86-SO: 0x000000000000000A STRSZ {{[0-9]+}} (bytes)
165 ELF-X86-SO: 0x000000000000000B SYMENT 24 (bytes)
166 ELF-X86-SO: 0x0000000000000003 PLTGOT 0x201000
167 ELF-X86-SO: 0x0000000000000002 PLTRELSZ 48 (bytes)
168 ELF-X86-SO: 0x0000000000000014 PLTREL RELA
169 ELF-X86-SO: 0x0000000000000017 JMPREL 0x{{[0-9A-F]+}}
170 ELF-X86-SO: 0x0000000000000007 RELA 0x{{[0-9A-F]+}}
171 ELF-X86-SO: 0x0000000000000008 RELASZ 240 (bytes)
172 ELF-X86-SO: 0x0000000000000009 RELAENT 24 (bytes)
173 ELF-X86-SO: 0x000000006FFFFFFE VERNEED 0x{{[0-9A-F]+}}
174 ELF-X86-SO: 0x000000006FFFFFFF VERNEEDNUM 2
175 ELF-X86-SO: 0x000000006FFFFFF0 VERSYM 0x{{[0-9A-F]+}}
176 ELF-X86-SO: 0x000000006FFFFFF9 RELACOUNT 3
177 ELF-X86-SO: 0x0000000000000000 NULL 0x0
178
179 RUN: llvm-readobj --dynamic-table %p/Inputs/dynamic-table-so.aarch64 \
180 RUN: | FileCheck %s -check-prefix ELF-AARCH64-SO
181 RUN: llvm-readelf --dynamic-table %p/Inputs/dynamic-table-so.aarch64 \
182 RUN: | FileCheck %s --strict-whitespace -check-prefix ELF-AARCH64-SO-GNU
183
184 ELF-AARCH64-SO: Format: ELF64-aarch64-little
185 ELF-AARCH64-SO: Arch: aarch64
186 ELF-AARCH64-SO: AddressSize: 64bit
187 ELF-AARCH64-SO: LoadName:
188 ELF-AARCH64-SO: DynamicSection [ (26 entries)
189 ELF-AARCH64-SO: Tag Type Name/Value
190 ELF-AARCH64-SO: 0x0000000000000001 NEEDED Shared library: [libc.so.6]
191 ELF-AARCH64-SO: 0x000000000000000C INIT 0x660
192 ELF-AARCH64-SO: 0x000000000000000D FINI 0x83C
193 ELF-AARCH64-SO: 0x0000000000000019 INIT_ARRAY 0x10DB8
194 ELF-AARCH64-SO: 0x000000000000001B INIT_ARRAYSZ 8 (bytes)
195 ELF-AARCH64-SO: 0x000000000000001A FINI_ARRAY 0x10DC0
196 ELF-AARCH64-SO: 0x000000000000001C FINI_ARRAYSZ 8 (bytes)
197 ELF-AARCH64-SO: 0x000000006FFFFEF5 GNU_HASH 0x1F0
198 ELF-AARCH64-SO: 0x0000000000000005 STRTAB 0x420
199 ELF-AARCH64-SO: 0x0000000000000006 SYMTAB 0x240
200 ELF-AARCH64-SO: 0x000000000000000A STRSZ 210 (bytes)
201 ELF-AARCH64-SO: 0x000000000000000B SYMENT 24 (bytes)
202 ELF-AARCH64-SO: 0x0000000000000003 PLTGOT 0x10FE8
203 ELF-AARCH64-SO: 0x0000000000000002 PLTRELSZ 96 (bytes)
204 ELF-AARCH64-SO: 0x0000000000000014 PLTREL RELA
205 ELF-AARCH64-SO: 0x0000000000000017 JMPREL 0x600
206 ELF-AARCH64-SO: 0x000000006FFFFEF6 TLSDESC_PLT 0x6D0
207 ELF-AARCH64-SO: 0x000000006FFFFEF7 TLSDESC_GOT 0x10FE0
208 ELF-AARCH64-SO: 0x0000000000000007 RELA 0x540
209 ELF-AARCH64-SO: 0x0000000000000008 RELASZ 192 (bytes)
210 ELF-AARCH64-SO: 0x0000000000000009 RELAENT 24 (bytes)
211 ELF-AARCH64-SO: 0x000000006FFFFFFE VERNEED 0x520
212 ELF-AARCH64-SO: 0x000000006FFFFFFF VERNEEDNUM 1
213 ELF-AARCH64-SO: 0x000000006FFFFFF0 VERSYM 0x4F2
214 ELF-AARCH64-SO: 0x000000006FFFFFF9 RELACOUNT 3
215 ELF-AARCH64-SO: 0x0000000000000000 NULL 0x0
216 ELF-AARCH64-SO: ]
217
218 ELF-AARCH64-SO-GNU: Dynamic section at offset 0x{{.*}} contains 26 entries:
219 ELF-AARCH64-SO-GNU-NEXT: Tag Type Name/Value
220 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
221 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000000c (INIT) 0x660
222 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000000d (FINI) 0x83c
223 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000019 (INIT_ARRAY) 0x10db8
224 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
225 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000001a (FINI_ARRAY) 0x10dc0
226 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
227 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffef5 (GNU_HASH) 0x1f0
228 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000005 (STRTAB) 0x420
229 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000006 (SYMTAB) 0x240
230 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000000a (STRSZ) 210 (bytes)
231 ELF-AARCH64-SO-GNU-NEXT: 0x000000000000000b (SYMENT) 24 (bytes)
232 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000003 (PLTGOT) 0x10fe8
233 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000002 (PLTRELSZ) 96 (bytes)
234 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000014 (PLTREL) RELA
235 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000017 (JMPREL) 0x600
236 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffef6 (TLSDESC_PLT) 0x6d0
237 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffef7 (TLSDESC_GOT) 0x10fe0
238 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000007 (RELA) 0x540
239 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000008 (RELASZ) 192 (bytes)
240 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000009 (RELAENT) 24 (bytes)
241 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffffe (VERNEED) 0x520
242 ELF-AARCH64-SO-GNU-NEXT: 0x000000006fffffff (VERNEEDNUM) 1
243 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffff0 (VERSYM) 0x4f2
244 ELF-AARCH64-SO-GNU-NEXT: 0x000000006ffffff9 (RELACOUNT) 3
245 ELF-AARCH64-SO-GNU-NEXT: 0x0000000000000000 (NULL) 0x0