llvm.org GIT mirror llvm / ffd66b2
[ELF] Fix GCC8 warnings about "fall through", NFCI Add break statements in Object/ELF.cpp since the code should consider the generic tags for Hexagon, MIPS, and PPC. Add a test (copied from llvm-readobj) to show that this works correctly (earlier versions of this patch would have asserted). The warnings in X86ELFObjectWriter.cpp are actually false-positives since the nested switch() handles all possible values and returns in all cases. Make this explicit by adding llvm_unreachable's. Differential Revision: https://reviews.llvm.org/D58837 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356037 91177308-0d34-0410-b5e6-96231b3b80d8 Jonas Hahnfeld 1 year, 2 months ago
5 changed file(s) with 311 addition(s) and 193 deletion(s). Raw diff Collapse all Expand all
437437 #include "llvm/BinaryFormat/DynamicTags.def"
438438 #undef HEXAGON_DYNAMIC_TAG
439439 }
440 break;
440441
441442 case ELF::EM_MIPS:
442443 switch (Type) {
444445 #include "llvm/BinaryFormat/DynamicTags.def"
445446 #undef MIPS_DYNAMIC_TAG
446447 }
448 break;
447449
448450 case ELF::EM_PPC64:
449451 switch (Type) {
451453 #include "llvm/BinaryFormat/DynamicTags.def"
452454 #undef PPC64_DYNAMIC_TAG
453455 }
456 break;
454457 }
455458 #undef DYNAMIC_TAG
456459 switch (Type) {
112112 case RT64_8:
113113 return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8;
114114 }
115 llvm_unreachable("unexpected relocation type!");
115116 case MCSymbolRefExpr::VK_GOT:
116117 switch (Type) {
117118 case RT64_64:
123124 case RT64_8:
124125 llvm_unreachable("Unimplemented");
125126 }
127 llvm_unreachable("unexpected relocation type!");
126128 case MCSymbolRefExpr::VK_GOTOFF:
127129 assert(Type == RT64_64);
128130 assert(!IsPCRel);
139141 case RT64_8:
140142 llvm_unreachable("Unimplemented");
141143 }
144 llvm_unreachable("unexpected relocation type!");
142145 case MCSymbolRefExpr::VK_DTPOFF:
143146 assert(!IsPCRel);
144147 switch (Type) {
151154 case RT64_8:
152155 llvm_unreachable("Unimplemented");
153156 }
157 llvm_unreachable("unexpected relocation type!");
154158 case MCSymbolRefExpr::VK_SIZE:
155159 assert(!IsPCRel);
156160 switch (Type) {
163167 case RT64_8:
164168 llvm_unreachable("Unimplemented");
165169 }
170 llvm_unreachable("unexpected relocation type!");
166171 case MCSymbolRefExpr::VK_TLSCALL:
167172 return ELF::R_X86_64_TLSDESC_CALL;
168173 case MCSymbolRefExpr::VK_TLSDESC:
195200 case X86::reloc_riprel_4byte_movq_load:
196201 return ELF::R_X86_64_REX_GOTPCRELX;
197202 }
203 llvm_unreachable("unexpected relocation type!");
198204 }
199205 }
200206
232238 case RT32_8:
233239 return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8;
234240 }
241 llvm_unreachable("unexpected relocation type!");
235242 case MCSymbolRefExpr::VK_GOT:
236243 assert(Type == RT32_32);
237244 if (IsPCRel)
0 # Test that hexagon machine-specific tags can be dumped.
1 # RUN: yaml2obj --docnum=1 -o %t.hex \
2 # RUN: %S/../llvm-readobj/Inputs/elf-dynamic-tags-machine-specific.yaml
3 # RUN: llvm-objdump -p %t.hex | FileCheck %s --check-prefix=HEXAGON
4
5 # HEXAGON: Dynamic Section:
6 # HEXAGON-NEXT: HASH 0x0000000000001000
7 # HEXAGON-NEXT: HEXAGON_SYMSZ 0x0000000000000010
8 # HEXAGON-NEXT: HEXAGON_VER 0x0000000000001000
9 # HEXAGON-NEXT: HEXAGON_PLT 0x0000000000001000
10 # HEXAGON-NEXT: 0x1234abcd 0x0000000000000001
11
12
13 # Test that MIPS machine-specific tags can be dumped.
14 # RUN: yaml2obj --docnum=2 -o %t.mips \
15 # RUN: %S/../llvm-readobj/Inputs/elf-dynamic-tags-machine-specific.yaml
16 # RUN: llvm-objdump -p %t.mips | FileCheck %s --check-prefix=MIPS
17
18 # MIPS: Dynamic Section:
19 # MIPS-NEXT: HASH 0x0000000000001000
20 # MIPS-NEXT: MIPS_RLD_VERSION 0x0000000012345678
21 # MIPS-NEXT: MIPS_TIME_STAMP 0x0000000011223344
22 # MIPS-NEXT: MIPS_ICHECKSUM 0x0000000011112222
23 # MIPS-NEXT: MIPS_IVERSION 0x0000000000000001
24 # MIPS-NEXT: MIPS_FLAGS 0x0000000011111111
25 # MIPS-NEXT: MIPS_BASE_ADDRESS 0x0000000087654321
26 # MIPS-NEXT: MIPS_MSYM 0x0000000000001000
27 # MIPS-NEXT: MIPS_CONFLICT 0x0000000000001000
28 # MIPS-NEXT: MIPS_LIBLIST 0x0000000000001000
29 # MIPS-NEXT: MIPS_LOCAL_GOTNO 0x0000000000000001
30 # MIPS-NEXT: MIPS_CONFLICTNO 0x0000000000000001
31 # MIPS-NEXT: MIPS_LIBLISTNO 0x0000000000000001
32 # MIPS-NEXT: MIPS_SYMTABNO 0x0000000000000001
33 # MIPS-NEXT: MIPS_UNREFEXTNO 0x0000000000000000
34 # MIPS-NEXT: MIPS_GOTSYM 0x0000000000000000
35 # MIPS-NEXT: MIPS_HIPAGENO 0x0000000088776655
36 # MIPS-NEXT: MIPS_RLD_MAP 0x0000000000001000
37 # MIPS-NEXT: MIPS_DELTA_CLASS 0x0000000000001000
38 # MIPS-NEXT: MIPS_DELTA_CLASS_NO 0x0000000000000001
39 # MIPS-NEXT: MIPS_DELTA_INSTANCE 0x0000000000001000
40 # MIPS-NEXT: MIPS_DELTA_INSTANCE_NO0x0000000000000001
41 # MIPS-NEXT: MIPS_DELTA_RELOC 0x0000000000001000
42 # MIPS-NEXT: MIPS_DELTA_RELOC_NO 0x0000000000000001
43 # MIPS-NEXT: MIPS_DELTA_SYM 0x0000000000001000
44 # MIPS-NEXT: MIPS_DELTA_SYM_NO 0x0000000000000001
45 # MIPS-NEXT: MIPS_DELTA_CLASSSYM 0x0000000000001000
46 # MIPS-NEXT: MIPS_DELTA_CLASSSYM_NO0x0000000000000001
47 # MIPS-NEXT: MIPS_CXX_FLAGS 0x0000000088887777
48 # MIPS-NEXT: MIPS_PIXIE_INIT 0x0000000000001000
49 # MIPS-NEXT: MIPS_LOCALPAGE_GOTIDX0x0000000000000001
50 # MIPS-NEXT: MIPS_LOCAL_GOTIDX 0x0000000000000001
51 # MIPS-NEXT: MIPS_HIDDEN_GOTIDX 0x0000000000000001
52 # MIPS-NEXT: MIPS_PROTECTED_GOTIDX0x0000000000000001
53 # MIPS-NEXT: MIPS_OPTIONS 0x0000000000001000
54 # MIPS-NEXT: MIPS_INTERFACE 0x0000000000001000
55 # MIPS-NEXT: MIPS_DYNSTR_ALIGN 0x0000000088888888
56 # MIPS-NEXT: MIPS_INTERFACE_SIZE 0x0000000000000010
57 # MIPS-NEXT: MIPS_RLD_TEXT_RESOLVE_ADDR0x0000000000000008
58 # MIPS-NEXT: MIPS_PERF_SUFFIX 0x0000000000000000
59 # MIPS-NEXT: MIPS_COMPACT_SIZE 0x0000000000000010
60 # MIPS-NEXT: MIPS_GP_VALUE 0x0000000000000001
61 # MIPS-NEXT: MIPS_AUX_DYNAMIC 0x0000000000001000
62 # MIPS-NEXT: MIPS_PLTGOT 0x0000000000001000
63 # MIPS-NEXT: MIPS_RWPLT 0x0000000000001000
64 # MIPS-NEXT: MIPS_RLD_MAP_REL 0x0000000000001000
65 # MIPS-NEXT: 0x1234abcd 0x0000000000000001
66
67
68 # Test that PPC64 machine-specific tags can be dumped.
69 # RUN: yaml2obj --docnum=3 -o %t.ppc \
70 # RUN: %S/../llvm-readobj/Inputs/elf-dynamic-tags-machine-specific.yaml
71 # RUN: llvm-objdump -p %t.ppc | FileCheck %s --check-prefix=PPC
72
73 # PPC: Dynamic Section:
74 # PPC-NEXT: HASH 0x0000000000001000
75 # PPC-NEXT: PPC64_GLINK 0x0000000000001000
76 # PPC-NEXT: 0x1234abcd 0x0000000000000001
0 # Used by llvm-readobj/elf-dynamic-tags-machine-specific.test and
1 # llvm-objdump/elf-dynamic-section-machine-specific.test.
2
3 # First document: Hexagon
4 --- !ELF
5 FileHeader:
6 Class: ELFCLASS64
7 Data: ELFDATA2LSB
8 Type: ET_EXEC
9 Machine: EM_HEXAGON
10 Sections:
11 - Name: .dynstr
12 Type: SHT_STRTAB
13 Address: 0x1000
14 Size: 0x10
15 Content: "004400550066007700"
16 - Name: .dynamic
17 Type: SHT_DYNAMIC
18 Address: 0x1010
19 Entries:
20 - Tag: DT_HASH
21 Value: 0x1000
22 - Tag: DT_HEXAGON_SYMSZ
23 Value: 0x10
24 - Tag: DT_HEXAGON_VER
25 Value: 0x1000
26 - Tag: DT_HEXAGON_PLT
27 Value: 0x1000
28 - Tag: 0x1234abcd
29 Value: 0x1
30 - Tag: DT_NULL
31 Value: 0
32 ProgramHeaders:
33 - Type: PT_LOAD
34 VAddr: 0x1000
35 Sections:
36 - Section: .dynstr
37 - Section: .dynamic
38 - Type: PT_DYNAMIC
39 VAddr: 0x1010
40 Sections:
41 - Section: .dynamic
42
43 # Second document: MIPS
44 --- !ELF
45 FileHeader:
46 Class: ELFCLASS64
47 Data: ELFDATA2LSB
48 Type: ET_EXEC
49 Machine: EM_MIPS
50 Sections:
51 - Name: .dynstr
52 Type: SHT_STRTAB
53 Address: 0x1000
54 Size: 0x10
55 Content: "004400550066007700"
56 - Name: .dynamic
57 Type: SHT_DYNAMIC
58 Address: 0x1010
59 Entries:
60 - Tag: DT_HASH
61 Value: 0x1000
62 - Tag: DT_MIPS_RLD_VERSION
63 Value: 0x12345678
64 - Tag: DT_MIPS_TIME_STAMP
65 Value: 0x11223344
66 - Tag: DT_MIPS_ICHECKSUM
67 Value: 0x11112222
68 - Tag: DT_MIPS_IVERSION
69 Value: 0x1
70 - Tag: DT_MIPS_FLAGS
71 Value: 0x11111111
72 - Tag: DT_MIPS_BASE_ADDRESS
73 Value: 0x87654321
74 - Tag: DT_MIPS_MSYM
75 Value: 0x1000
76 - Tag: DT_MIPS_CONFLICT
77 Value: 0x1000
78 - Tag: DT_MIPS_LIBLIST
79 Value: 0x1000
80 - Tag: DT_MIPS_LOCAL_GOTNO
81 Value: 0x1
82 - Tag: DT_MIPS_CONFLICTNO
83 Value: 0x1
84 - Tag: DT_MIPS_LIBLISTNO
85 Value: 0x1
86 - Tag: DT_MIPS_SYMTABNO
87 Value: 0x1
88 - Tag: DT_MIPS_UNREFEXTNO
89 Value: 0x0
90 - Tag: DT_MIPS_GOTSYM
91 Value: 0x0
92 - Tag: DT_MIPS_HIPAGENO
93 Value: 0x88776655
94 - Tag: DT_MIPS_RLD_MAP
95 Value: 0x1000
96 - Tag: DT_MIPS_DELTA_CLASS
97 Value: 0x1000
98 - Tag: DT_MIPS_DELTA_CLASS_NO
99 Value: 0x1
100 - Tag: DT_MIPS_DELTA_INSTANCE
101 Value: 0x1000
102 - Tag: DT_MIPS_DELTA_INSTANCE_NO
103 Value: 0x1
104 - Tag: DT_MIPS_DELTA_RELOC
105 Value: 0x1000
106 - Tag: DT_MIPS_DELTA_RELOC_NO
107 Value: 0x1
108 - Tag: DT_MIPS_DELTA_SYM
109 Value: 0x1000
110 - Tag: DT_MIPS_DELTA_SYM_NO
111 Value: 0x1
112 - Tag: DT_MIPS_DELTA_CLASSSYM
113 Value: 0x1000
114 - Tag: DT_MIPS_DELTA_CLASSSYM_NO
115 Value: 0x1
116 - Tag: DT_MIPS_CXX_FLAGS
117 Value: 0x88887777
118 - Tag: DT_MIPS_PIXIE_INIT
119 Value: 0x1000
120 - Tag: DT_MIPS_LOCALPAGE_GOTIDX
121 Value: 0x1
122 - Tag: DT_MIPS_LOCAL_GOTIDX
123 Value: 0x1
124 - Tag: DT_MIPS_HIDDEN_GOTIDX
125 Value: 0x1
126 - Tag: DT_MIPS_PROTECTED_GOTIDX
127 Value: 0x1
128 - Tag: DT_MIPS_OPTIONS
129 Value: 0x1000
130 - Tag: DT_MIPS_INTERFACE
131 Value: 0x1000
132 - Tag: DT_MIPS_DYNSTR_ALIGN
133 Value: 0x88888888
134 - Tag: DT_MIPS_INTERFACE_SIZE
135 Value: 0x10
136 - Tag: DT_MIPS_RLD_TEXT_RESOLVE_ADDR
137 Value: 0x8
138 - Tag: DT_MIPS_PERF_SUFFIX
139 Value: 0x0
140 - Tag: DT_MIPS_COMPACT_SIZE
141 Value: 0x10
142 - Tag: DT_MIPS_GP_VALUE
143 Value: 0x1
144 - Tag: DT_MIPS_AUX_DYNAMIC
145 Value: 0x1000
146 - Tag: DT_MIPS_PLTGOT
147 Value: 0x1000
148 - Tag: DT_MIPS_RWPLT
149 Value: 0x1000
150 - Tag: DT_MIPS_RLD_MAP_REL
151 Value: 0x1000
152 - Tag: 0x1234abcd
153 Value: 0x1
154 - Tag: DT_NULL
155 Value: 0
156 ProgramHeaders:
157 - Type: PT_LOAD
158 VAddr: 0x1000
159 Sections:
160 - Section: .dynstr
161 - Section: .dynamic
162 - Type: PT_DYNAMIC
163 VAddr: 0x1010
164 Sections:
165 - Section: .dynamic
166
167 # Third document: PPC64
168 --- !ELF
169 FileHeader:
170 Class: ELFCLASS64
171 Data: ELFDATA2LSB
172 Type: ET_EXEC
173 Machine: EM_PPC64
174 Sections:
175 - Name: .dynstr
176 Type: SHT_STRTAB
177 Address: 0x1000
178 Size: 0x10
179 Content: "004400550066007700"
180 - Name: .dynamic
181 Type: SHT_DYNAMIC
182 Address: 0x1010
183 Entries:
184 - Tag: DT_HASH
185 Value: 0x1000
186 - Tag: DT_PPC64_GLINK
187 Value: 0x1000
188 - Tag: 0x1234abcd
189 Value: 0x1
190 - Tag: DT_NULL
191 Value: 0
192 ProgramHeaders:
193 - Type: PT_LOAD
194 VAddr: 0x1000
195 Sections:
196 - Section: .dynstr
197 - Section: .dynamic
198 - Type: PT_DYNAMIC
199 VAddr: 0x1010
200 Sections:
201 - Section: .dynamic
0 # Test that hexagon machine-specific tags can be dumped.
1 # RUN: yaml2obj --docnum=1 %s -o %t.hex
1 # RUN: yaml2obj --docnum=1 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.hex
22 # RUN: llvm-readobj --dynamic-table %t.hex | FileCheck %s --check-prefix=LLVM-HEXAGON
33 # RUN: llvm-readelf --dynamic-table %t.hex | FileCheck %s --check-prefix=GNU-HEXAGON
44
5 --- !ELF
6 FileHeader:
7 Class: ELFCLASS64
8 Data: ELFDATA2LSB
9 Type: ET_EXEC
10 Machine: EM_HEXAGON
11 Sections:
12 - Name: .dynstr
13 Type: SHT_STRTAB
14 Address: 0x1000
15 Size: 0x10
16 Content: "004400550066007700"
17 - Name: .dynamic
18 Type: SHT_DYNAMIC
19 Address: 0x1010
20 Entries:
21 - Tag: DT_HEXAGON_SYMSZ
22 Value: 0x10
23 - Tag: DT_HEXAGON_VER
24 Value: 0x1000
25 - Tag: DT_HEXAGON_PLT
26 Value: 0x1000
27 - Tag: DT_NULL
28 Value: 0
29 ProgramHeaders:
30 - Type: PT_LOAD
31 VAddr: 0x1000
32 Sections:
33 - Section: .dynstr
34 - Section: .dynamic
35 - Type: PT_DYNAMIC
36 VAddr: 0x1010
37 Sections:
38 - Section: .dynamic
39
40 # LLVM-HEXAGON: DynamicSection [ (4 entries)
5 # LLVM-HEXAGON: DynamicSection [ (6 entries)
416 # LLVM-HEXAGON-NEXT: Tag Type Name/Value
7 # LLVM-HEXAGON-NEXT: 0x0000000000000004 HASH 0x1000
428 # LLVM-HEXAGON-NEXT: 0x0000000070000000 HEXAGON_SYMSZ 0x10
439 # LLVM-HEXAGON-NEXT: 0x0000000070000001 HEXAGON_VER 4096
4410 # LLVM-HEXAGON-NEXT: 0x0000000070000002 HEXAGON_PLT 0x1000
11 # LLVM-HEXAGON-NEXT: 0x000000001234ABCD unknown 0x1
4512 # LLVM-HEXAGON-NEXT: 0x0000000000000000 NULL 0x0
4613 # LLVM-HEXAGON-NEXT: ]
4714
48 # GNU-HEXAGON: DynamicSection [ (4 entries)
15 # GNU-HEXAGON: DynamicSection [ (6 entries)
4916 # GNU-HEXAGON-NEXT: Tag Type Name/Value
17 # GNU-HEXAGON-NEXT: 0x0000000000000004 HASH 0x1000
5018 # GNU-HEXAGON-NEXT: 0x0000000070000000 HEXAGON_SYMSZ 0x10
5119 # GNU-HEXAGON-NEXT: 0x0000000070000001 HEXAGON_VER 4096
5220 # GNU-HEXAGON-NEXT: 0x0000000070000002 HEXAGON_PLT 0x1000
21 # GNU-HEXAGON-NEXT: 0x000000001234abcd unknown 0x1
5322 # GNU-HEXAGON-NEXT: 0x0000000000000000 NULL 0x0
5423 # GNU-HEXAGON-NEXT: ]
5524
25
5626 # Test that MIPS machine-specific tags can be dumped.
57 # RUN: yaml2obj --docnum=2 %s -o %t.mips
27 # RUN: yaml2obj --docnum=2 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.mips
5828 # RUN: llvm-readobj --dynamic-table %t.mips | FileCheck %s --check-prefix=LLVM-MIPS
5929 # RUN: llvm-readelf --dynamic-table %t.mips | FileCheck %s --check-prefix=GNU-MIPS
6030
61 # LLVM-MIPS: DynamicSection [ (46 entries)
31 # LLVM-MIPS: DynamicSection [ (48 entries)
6232 # LLVM-MIPS-NEXT: Tag Type Name/Value
33 # LLVM-MIPS-NEXT: 0x0000000000000004 HASH 0x1000
6334 # LLVM-MIPS-NEXT: 0x0000000070000001 MIPS_RLD_VERSION 305419896
6435 # LLVM-MIPS-NEXT: 0x0000000070000002 MIPS_TIME_STAMP 0x11223344
6536 # LLVM-MIPS-NEXT: 0x0000000070000003 MIPS_ICHECKSUM 0x11112222
10576 # LLVM-MIPS-NEXT: 0x0000000070000032 MIPS_PLTGOT 0x1000
10677 # LLVM-MIPS-NEXT: 0x0000000070000034 MIPS_RWPLT 0x1000
10778 # LLVM-MIPS-NEXT: 0x0000000070000035 MIPS_RLD_MAP_REL 0x1000
79 # LLVM-MIPS-NEXT: 0x000000001234ABCD unknown 0x1
10880 # LLVM-MIPS-NEXT: 0x0000000000000000 NULL 0x0
10981 # LLVM-MIPS-NEXT: ]
11082
111 # GNU-MIPS: DynamicSection [ (46 entries)
83 # GNU-MIPS: DynamicSection [ (48 entries)
11284 # GNU-MIPS-NEXT: Tag Type Name/Value
85 # GNU-MIPS-NEXT: 0x0000000000000004 HASH 0x1000
11386 # GNU-MIPS-NEXT: 0x0000000070000001 MIPS_RLD_VERSION 305419896
11487 # GNU-MIPS-NEXT: 0x0000000070000002 MIPS_TIME_STAMP 0x11223344
11588 # GNU-MIPS-NEXT: 0x0000000070000003 MIPS_ICHECKSUM 0x11112222
155128 # GNU-MIPS-NEXT: 0x0000000070000032 MIPS_PLTGOT 0x1000
156129 # GNU-MIPS-NEXT: 0x0000000070000034 MIPS_RWPLT 0x1000
157130 # GNU-MIPS-NEXT: 0x0000000070000035 MIPS_RLD_MAP_REL 0x1000
131 # GNU-MIPS-NEXT: 0x000000001234abcd unknown 0x1
158132 # GNU-MIPS-NEXT: 0x0000000000000000 NULL 0x0
159133 # GNU-MIPS-NEXT: ]
160134
161 --- !ELF
162 FileHeader:
163 Class: ELFCLASS64
164 Data: ELFDATA2LSB
165 Type: ET_EXEC
166 Machine: EM_MIPS
167 Sections:
168 - Name: .dynstr
169 Type: SHT_STRTAB
170 Address: 0x1000
171 Size: 0x10
172 Content: "004400550066007700"
173 - Name: .dynamic
174 Type: SHT_DYNAMIC
175 Address: 0x1010
176 Entries:
177 - Tag: DT_MIPS_RLD_VERSION
178 Value: 0x12345678
179 - Tag: DT_MIPS_TIME_STAMP
180 Value: 0x11223344
181 - Tag: DT_MIPS_ICHECKSUM
182 Value: 0x11112222
183 - Tag: DT_MIPS_IVERSION
184 Value: 0x1
185 - Tag: DT_MIPS_FLAGS
186 Value: 0x11111111
187 - Tag: DT_MIPS_BASE_ADDRESS
188 Value: 0x87654321
189 - Tag: DT_MIPS_MSYM
190 Value: 0x1000
191 - Tag: DT_MIPS_CONFLICT
192 Value: 0x1000
193 - Tag: DT_MIPS_LIBLIST
194 Value: 0x1000
195 - Tag: DT_MIPS_LOCAL_GOTNO
196 Value: 0x1
197 - Tag: DT_MIPS_CONFLICTNO
198 Value: 0x1
199 - Tag: DT_MIPS_LIBLISTNO
200 Value: 0x1
201 - Tag: DT_MIPS_SYMTABNO
202 Value: 0x1
203 - Tag: DT_MIPS_UNREFEXTNO
204 Value: 0x0
205 - Tag: DT_MIPS_GOTSYM
206 Value: 0x0
207 - Tag: DT_MIPS_HIPAGENO
208 Value: 0x88776655
209 - Tag: DT_MIPS_RLD_MAP
210 Value: 0x1000
211 - Tag: DT_MIPS_DELTA_CLASS
212 Value: 0x1000
213 - Tag: DT_MIPS_DELTA_CLASS_NO
214 Value: 0x1
215 - Tag: DT_MIPS_DELTA_INSTANCE
216 Value: 0x1000
217 - Tag: DT_MIPS_DELTA_INSTANCE_NO
218 Value: 0x1
219 - Tag: DT_MIPS_DELTA_RELOC
220 Value: 0x1000
221 - Tag: DT_MIPS_DELTA_RELOC_NO
222 Value: 0x1
223 - Tag: DT_MIPS_DELTA_SYM
224 Value: 0x1000
225 - Tag: DT_MIPS_DELTA_SYM_NO
226 Value: 0x1
227 - Tag: DT_MIPS_DELTA_CLASSSYM
228 Value: 0x1000
229 - Tag: DT_MIPS_DELTA_CLASSSYM_NO
230 Value: 0x1
231 - Tag: DT_MIPS_CXX_FLAGS
232 Value: 0x88887777
233 - Tag: DT_MIPS_PIXIE_INIT
234 Value: 0x1000
235 - Tag: DT_MIPS_LOCALPAGE_GOTIDX
236 Value: 0x1
237 - Tag: DT_MIPS_LOCAL_GOTIDX
238 Value: 0x1
239 - Tag: DT_MIPS_HIDDEN_GOTIDX
240 Value: 0x1
241 - Tag: DT_MIPS_PROTECTED_GOTIDX
242 Value: 0x1
243 - Tag: DT_MIPS_OPTIONS
244 Value: 0x1000
245 - Tag: DT_MIPS_INTERFACE
246 Value: 0x1000
247 - Tag: DT_MIPS_DYNSTR_ALIGN
248 Value: 0x88888888
249 - Tag: DT_MIPS_INTERFACE_SIZE
250 Value: 0x10
251 - Tag: DT_MIPS_RLD_TEXT_RESOLVE_ADDR
252 Value: 0x8
253 - Tag: DT_MIPS_PERF_SUFFIX
254 Value: 0x0
255 - Tag: DT_MIPS_COMPACT_SIZE
256 Value: 0x10
257 - Tag: DT_MIPS_GP_VALUE
258 Value: 0x1
259 - Tag: DT_MIPS_AUX_DYNAMIC
260 Value: 0x1000
261 - Tag: DT_MIPS_PLTGOT
262 Value: 0x1000
263 - Tag: DT_MIPS_RWPLT
264 Value: 0x1000
265 - Tag: DT_MIPS_RLD_MAP_REL
266 Value: 0x1000
267 - Tag: DT_NULL
268 Value: 0
269 ProgramHeaders:
270 - Type: PT_LOAD
271 VAddr: 0x1000
272 Sections:
273 - Section: .dynstr
274 - Section: .dynamic
275 - Type: PT_DYNAMIC
276 VAddr: 0x1010
277 Sections:
278 - Section: .dynamic
279135
280136 # Test that PPC64 machine-specific tags can be dumped.
281 # RUN: yaml2obj --docnum=3 %s -o %t.ppc
137 # RUN: yaml2obj --docnum=3 %S/Inputs/elf-dynamic-tags-machine-specific.yaml -o %t.ppc
282138 # RUN: llvm-readobj --dynamic-table %t.ppc | FileCheck %s --check-prefix=LLVM-PPC
283139 # RUN: llvm-readelf --dynamic-table %t.ppc | FileCheck %s --check-prefix=GNU-PPC
284140
285 # LLVM-PPC: DynamicSection [ (2 entries)
141 # LLVM-PPC: DynamicSection [ (4 entries)
286142 # LLVM-PPC-NEXT: Tag Type Name/Value
143 # LLVM-PPC-NEXT: 0x0000000000000004 HASH 0x1000
287144 # LLVM-PPC-NEXT: 0x0000000070000000 PPC64_GLINK 0x1000
145 # LLVM-PPC-NEXT: 0x000000001234ABCD unknown 0x1
288146 # LLVM-PPC-NEXT: 0x0000000000000000 NULL 0x0
289147 # LLVM-PPC-NEXT: ]
290148
291 # GNU-PPC: DynamicSection [ (2 entries)
149 # GNU-PPC: DynamicSection [ (4 entries)
292150 # GNU-PPC-NEXT: Tag Type Name/Value
151 # GNU-PPC-NEXT: 0x0000000000000004 HASH 0x1000
293152 # GNU-PPC-NEXT: 0x0000000070000000 PPC64_GLINK 0x1000
153 # GNU-PPC-NEXT: 0x000000001234abcd unknown 0x1
294154 # GNU-PPC-NEXT: 0x0000000000000000 NULL 0x0
295155 # GNU-PPC-NEXT: ]
296
297 --- !ELF
298 FileHeader:
299 Class: ELFCLASS64
300 Data: ELFDATA2LSB
301 Type: ET_EXEC
302 Machine: EM_PPC64
303 Sections:
304 - Name: .dynstr
305 Type: SHT_STRTAB
306 Address: 0x1000
307 Size: 0x10
308 Content: "004400550066007700"
309 - Name: .dynamic
310 Type: SHT_DYNAMIC
311 Address: 0x1010
312 Entries:
313 - Tag: DT_PPC64_GLINK
314 Value: 0x1000
315 - Tag: DT_NULL
316 Value: 0
317 ProgramHeaders:
318 - Type: PT_LOAD
319 VAddr: 0x1000
320 Sections:
321 - Section: .dynstr
322 - Section: .dynamic
323 - Type: PT_DYNAMIC
324 VAddr: 0x1010
325 Sections:
326 - Section: .dynamic