1 //===--- ARMEHABIPrinter.h - ARM EHABI Unwind Information Printer ----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_READOBJ_ARMEHABI_PRINTER_H
11 #define LLVM_READOBJ_ARMEHABI_PRINTER_H
14 #include "StreamWriter.h"
15 #include "llvm/ADT/STLExtras.h"
16 #include "llvm/Object/ELF.h"
17 #include "llvm/Object/ELFTypes.h"
18 #include "llvm/Support/ARMEHABI.h"
19 #include "llvm/Support/Debug.h"
20 #include "llvm/Support/Endian.h"
21 #include "llvm/Support/Format.h"
22 #include "llvm/Support/type_traits.h"
25 using std::error_code;
36 void (OpcodeDecoder::*Routine)(const uint8_t *Opcodes, unsigned &OI);
38 static const RingEntry Ring[];
40 void Decode_00xxxxxx(const uint8_t *Opcodes, unsigned &OI);
41 void Decode_01xxxxxx(const uint8_t *Opcodes, unsigned &OI);
42 void Decode_1000iiii_iiiiiiii(const uint8_t *Opcodes, unsigned &OI);
43 void Decode_10011101(const uint8_t *Opcodes, unsigned &OI);
44 void Decode_10011111(const uint8_t *Opcodes, unsigned &OI);
45 void Decode_1001nnnn(const uint8_t *Opcodes, unsigned &OI);
46 void Decode_10100nnn(const uint8_t *Opcodes, unsigned &OI);
47 void Decode_10101nnn(const uint8_t *Opcodes, unsigned &OI);
48 void Decode_10110000(const uint8_t *Opcodes, unsigned &OI);
49 void Decode_10110001_0000iiii(const uint8_t *Opcodes, unsigned &OI);
50 void Decode_10110010_uleb128(const uint8_t *Opcodes, unsigned &OI);
51 void Decode_10110011_sssscccc(const uint8_t *Opcodes, unsigned &OI);
52 void Decode_101101nn(const uint8_t *Opcodes, unsigned &OI);
53 void Decode_10111nnn(const uint8_t *Opcodes, unsigned &OI);
54 void Decode_11000110_sssscccc(const uint8_t *Opcodes, unsigned &OI);
55 void Decode_11000111_0000iiii(const uint8_t *Opcodes, unsigned &OI);
56 void Decode_11001000_sssscccc(const uint8_t *Opcodes, unsigned &OI);
57 void Decode_11001001_sssscccc(const uint8_t *Opcodes, unsigned &OI);
58 void Decode_11001yyy(const uint8_t *Opcodes, unsigned &OI);
59 void Decode_11000nnn(const uint8_t *Opcodes, unsigned &OI);
60 void Decode_11010nnn(const uint8_t *Opcodes, unsigned &OI);
61 void Decode_11xxxyyy(const uint8_t *Opcodes, unsigned &OI);
63 void PrintGPR(uint16_t GPRMask);
64 void PrintRegisters(uint32_t Mask, StringRef Prefix);
67 OpcodeDecoder(StreamWriter &SW) : SW(SW), OS(SW.getOStream()) {}
68 void Decode(const uint8_t *Opcodes, off_t Offset, size_t Length);
71 const OpcodeDecoder::RingEntry OpcodeDecoder::Ring[] = {
72 { 0xc0, 0x00, &OpcodeDecoder::Decode_00xxxxxx },
73 { 0xc0, 0x40, &OpcodeDecoder::Decode_01xxxxxx },
74 { 0xf0, 0x80, &OpcodeDecoder::Decode_1000iiii_iiiiiiii },
75 { 0xff, 0x9d, &OpcodeDecoder::Decode_10011101 },
76 { 0xff, 0x9f, &OpcodeDecoder::Decode_10011111 },
77 { 0xf0, 0x90, &OpcodeDecoder::Decode_1001nnnn },
78 { 0xf8, 0xa0, &OpcodeDecoder::Decode_10100nnn },
79 { 0xf8, 0xa8, &OpcodeDecoder::Decode_10101nnn },
80 { 0xff, 0xb0, &OpcodeDecoder::Decode_10110000 },
81 { 0xff, 0xb1, &OpcodeDecoder::Decode_10110001_0000iiii },
82 { 0xff, 0xb2, &OpcodeDecoder::Decode_10110010_uleb128 },
83 { 0xff, 0xb3, &OpcodeDecoder::Decode_10110011_sssscccc },
84 { 0xfc, 0xb4, &OpcodeDecoder::Decode_101101nn },
85 { 0xf8, 0xb8, &OpcodeDecoder::Decode_10111nnn },
86 { 0xff, 0xc6, &OpcodeDecoder::Decode_11000110_sssscccc },
87 { 0xff, 0xc7, &OpcodeDecoder::Decode_11000111_0000iiii },
88 { 0xff, 0xc8, &OpcodeDecoder::Decode_11001000_sssscccc },
89 { 0xff, 0xc9, &OpcodeDecoder::Decode_11001001_sssscccc },
90 { 0xc8, 0xc8, &OpcodeDecoder::Decode_11001yyy },
91 { 0xf8, 0xc0, &OpcodeDecoder::Decode_11000nnn },
92 { 0xf8, 0xd0, &OpcodeDecoder::Decode_11010nnn },
93 { 0xc0, 0xc0, &OpcodeDecoder::Decode_11xxxyyy },
96 void OpcodeDecoder::Decode_00xxxxxx(const uint8_t *Opcodes, unsigned &OI) {
97 uint8_t Opcode = Opcodes[OI++ ^ 3];
98 SW.startLine() << format("0x%02X ; vsp = vsp + %u\n", Opcode,
99 ((Opcode & 0x3f) << 2) + 4);
101 void OpcodeDecoder::Decode_01xxxxxx(const uint8_t *Opcodes, unsigned &OI) {
102 uint8_t Opcode = Opcodes[OI++ ^ 3];
103 SW.startLine() << format("0x%02X ; vsp = vsp - %u\n", Opcode,
104 ((Opcode & 0x3f) << 2) + 4);
106 void OpcodeDecoder::Decode_1000iiii_iiiiiiii(const uint8_t *Opcodes,
108 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
109 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
111 uint16_t GPRMask = (Opcode1 << 4) | ((Opcode0 & 0x0f) << 12);
113 << format("0x%02X 0x%02X ; %s",
114 Opcode0, Opcode1, GPRMask ? "pop " : "refuse to unwind");
119 void OpcodeDecoder::Decode_10011101(const uint8_t *Opcodes, unsigned &OI) {
120 uint8_t Opcode = Opcodes[OI++ ^ 3];
121 SW.startLine() << format("0x%02X ; reserved (ARM MOVrr)\n", Opcode);
123 void OpcodeDecoder::Decode_10011111(const uint8_t *Opcodes, unsigned &OI) {
124 uint8_t Opcode = Opcodes[OI++ ^ 3];
125 SW.startLine() << format("0x%02X ; reserved (WiMMX MOVrr)\n", Opcode);
127 void OpcodeDecoder::Decode_1001nnnn(const uint8_t *Opcodes, unsigned &OI) {
128 uint8_t Opcode = Opcodes[OI++ ^ 3];
129 SW.startLine() << format("0x%02X ; vsp = r%u\n", Opcode, (Opcode & 0x0f));
131 void OpcodeDecoder::Decode_10100nnn(const uint8_t *Opcodes, unsigned &OI) {
132 uint8_t Opcode = Opcodes[OI++ ^ 3];
133 SW.startLine() << format("0x%02X ; pop ", Opcode);
134 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4));
137 void OpcodeDecoder::Decode_10101nnn(const uint8_t *Opcodes, unsigned &OI) {
138 uint8_t Opcode = Opcodes[OI++ ^ 3];
139 SW.startLine() << format("0x%02X ; pop ", Opcode);
140 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4) | (1 << 14));
143 void OpcodeDecoder::Decode_10110000(const uint8_t *Opcodes, unsigned &OI) {
144 uint8_t Opcode = Opcodes[OI++ ^ 3];
145 SW.startLine() << format("0x%02X ; finish\n", Opcode);
147 void OpcodeDecoder::Decode_10110001_0000iiii(const uint8_t *Opcodes,
149 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
150 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
153 << format("0x%02X 0x%02X ; %s", Opcode0, Opcode1,
154 ((Opcode1 & 0xf0) || Opcode1 == 0x00) ? "spare" : "pop ");
155 if (((Opcode1 & 0xf0) == 0x00) && Opcode1)
156 PrintGPR((Opcode1 & 0x0f));
159 void OpcodeDecoder::Decode_10110010_uleb128(const uint8_t *Opcodes,
161 uint8_t Opcode = Opcodes[OI++ ^ 3];
162 SW.startLine() << format("0x%02X ", Opcode);
164 SmallVector<uint8_t, 4> ULEB;
165 do { ULEB.push_back(Opcodes[OI ^ 3]); } while (Opcodes[OI++ ^ 3] & 0x80);
167 for (unsigned BI = 0, BE = ULEB.size(); BI != BE; ++BI)
168 OS << format("0x%02X ", ULEB[BI]);
171 for (unsigned BI = 0, BE = ULEB.size(); BI != BE; ++BI)
172 Value = Value | ((ULEB[BI] & 0x7f) << (7 * BI));
174 OS << format("; vsp = vsp + %" PRIu64 "\n", 0x204 + (Value << 2));
176 void OpcodeDecoder::Decode_10110011_sssscccc(const uint8_t *Opcodes,
178 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
179 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
180 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
181 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
182 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
183 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
186 void OpcodeDecoder::Decode_101101nn(const uint8_t *Opcodes, unsigned &OI) {
187 uint8_t Opcode = Opcodes[OI++ ^ 3];
188 SW.startLine() << format("0x%02X ; spare\n", Opcode);
190 void OpcodeDecoder::Decode_10111nnn(const uint8_t *Opcodes, unsigned &OI) {
191 uint8_t Opcode = Opcodes[OI++ ^ 3];
192 SW.startLine() << format("0x%02X ; pop ", Opcode);
193 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d");
196 void OpcodeDecoder::Decode_11000110_sssscccc(const uint8_t *Opcodes,
198 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
199 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
200 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
201 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
202 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
203 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "wR");
206 void OpcodeDecoder::Decode_11000111_0000iiii(const uint8_t *Opcodes,
208 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
209 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
211 << format("0x%02X 0x%02X ; %s", Opcode0, Opcode1,
212 ((Opcode1 & 0xf0) || Opcode1 == 0x00) ? "spare" : "pop ");
213 if ((Opcode1 & 0xf0) == 0x00 && Opcode1)
214 PrintRegisters(Opcode1 & 0x0f, "wCGR");
217 void OpcodeDecoder::Decode_11001000_sssscccc(const uint8_t *Opcodes,
219 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
220 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
221 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
222 uint8_t Start = 16 + ((Opcode1 & 0xf0) >> 4);
223 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
224 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
227 void OpcodeDecoder::Decode_11001001_sssscccc(const uint8_t *Opcodes,
229 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
230 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
231 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
232 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
233 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
234 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
237 void OpcodeDecoder::Decode_11001yyy(const uint8_t *Opcodes, unsigned &OI) {
238 uint8_t Opcode = Opcodes[OI++ ^ 3];
239 SW.startLine() << format("0x%02X ; spare\n", Opcode);
241 void OpcodeDecoder::Decode_11000nnn(const uint8_t *Opcodes, unsigned &OI) {
242 uint8_t Opcode = Opcodes[OI++ ^ 3];
243 SW.startLine() << format("0x%02X ; pop ", Opcode);
244 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 10), "wR");
247 void OpcodeDecoder::Decode_11010nnn(const uint8_t *Opcodes, unsigned &OI) {
248 uint8_t Opcode = Opcodes[OI++ ^ 3];
249 SW.startLine() << format("0x%02X ; pop ", Opcode);
250 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d");
253 void OpcodeDecoder::Decode_11xxxyyy(const uint8_t *Opcodes, unsigned &OI) {
254 uint8_t Opcode = Opcodes[OI++ ^ 3];
255 SW.startLine() << format("0x%02X ; spare\n", Opcode);
258 void OpcodeDecoder::PrintGPR(uint16_t GPRMask) {
259 static const char *GPRRegisterNames[16] = {
260 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
261 "fp", "ip", "sp", "lr", "pc"
266 for (unsigned RI = 0, RE = 17; RI < RE; ++RI) {
267 if (GPRMask & (1 << RI)) {
270 OS << GPRRegisterNames[RI];
277 void OpcodeDecoder::PrintRegisters(uint32_t VFPMask, StringRef Prefix) {
280 for (unsigned RI = 0, RE = 32; RI < RE; ++RI) {
281 if (VFPMask & (1 << RI)) {
291 void OpcodeDecoder::Decode(const uint8_t *Opcodes, off_t Offset, size_t Length) {
292 for (unsigned OCI = Offset; OCI < Length + Offset; ) {
293 bool Decoded = false;
294 for (unsigned REI = 0, REE = array_lengthof(Ring);
295 REI != REE && !Decoded; ++REI) {
296 if ((Opcodes[OCI ^ 3] & Ring[REI].Mask) == Ring[REI].Value) {
297 (this->*Ring[REI].Routine)(Opcodes, OCI);
303 SW.startLine() << format("0x%02X ; reserved\n", Opcodes[OCI++ ^ 3]);
307 template <typename ET>
308 class PrinterContext {
310 const object::ELFFile<ET> *ELF;
312 typedef typename object::ELFFile<ET>::Elf_Sym Elf_Sym;
313 typedef typename object::ELFFile<ET>::Elf_Shdr Elf_Shdr;
315 typedef typename object::ELFFile<ET>::Elf_Rel_Iter Elf_Rel_iterator;
316 typedef typename object::ELFFile<ET>::Elf_Sym_Iter Elf_Sym_iterator;
317 typedef typename object::ELFFile<ET>::Elf_Shdr_Iter Elf_Shdr_iterator;
319 static const size_t IndexTableEntrySize;
321 static uint64_t PREL31(uint32_t Address, uint32_t Place) {
322 uint64_t Location = Address & 0x7fffffff;
323 if (Location & 0x04000000)
324 Location |= (uint64_t) ~0x7fffffff;
325 return Location + Place;
328 ErrorOr<StringRef> FunctionAtAddress(unsigned Section, uint64_t Address) const;
329 const Elf_Shdr *FindExceptionTable(unsigned IndexTableIndex,
330 off_t IndexTableOffset) const;
332 void PrintIndexTable(unsigned SectionIndex, const Elf_Shdr *IT) const;
333 void PrintExceptionTable(const Elf_Shdr *IT, const Elf_Shdr *EHT,
334 uint64_t TableEntryOffset) const;
335 void PrintOpcodes(const uint8_t *Entry, size_t Length, off_t Offset) const;
338 PrinterContext(StreamWriter &Writer, const object::ELFFile<ET> *File)
339 : SW(Writer), ELF(File) {}
341 void PrintUnwindInformation() const;
344 template <typename ET>
345 const size_t PrinterContext<ET>::IndexTableEntrySize = 8;
347 template <typename ET>
348 ErrorOr<StringRef> PrinterContext<ET>::FunctionAtAddress(unsigned Section,
349 uint64_t Address) const {
350 for (Elf_Sym_iterator SI = ELF->begin_symbols(), SE = ELF->end_symbols();
352 if (SI->st_shndx == Section && SI->st_value == Address &&
353 SI->getType() == ELF::STT_FUNC)
354 return ELF->getSymbolName(SI);
355 return readobj_error::unknown_symbol;
358 template <typename ET>
359 const typename object::ELFFile<ET>::Elf_Shdr *
360 PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
361 off_t IndexTableOffset) const {
362 /// Iterate through the sections, searching for the relocation section
363 /// associated with the unwind index table section specified by
364 /// IndexSectionIndex. Iterate the associated section searching for the
365 /// relocation associated with the index table entry specified by
366 /// IndexTableOffset. The symbol is the section symbol for the exception
367 /// handling table. Use this symbol to recover the actual exception handling
370 for (Elf_Shdr_iterator SI = ELF->begin_sections(), SE = ELF->end_sections();
372 if (SI->sh_type == ELF::SHT_REL && SI->sh_info == IndexSectionIndex) {
373 for (Elf_Rel_iterator RI = ELF->begin_rel(&*SI), RE = ELF->end_rel(&*SI);
375 if (RI->r_offset == static_cast<unsigned>(IndexTableOffset)) {
376 typename object::ELFFile<ET>::Elf_Rela RelA;
377 RelA.r_offset = RI->r_offset;
378 RelA.r_info = RI->r_info;
381 std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
382 ELF->getRelocationSymbol(&(*SI), &RelA);
384 return ELF->getSection(Symbol.second);
392 template <typename ET>
393 void PrinterContext<ET>::PrintExceptionTable(const Elf_Shdr *IT,
395 uint64_t TableEntryOffset) const {
396 ErrorOr<ArrayRef<uint8_t> > Contents = ELF->getSectionContents(EHT);
400 /// ARM EHABI Section 6.2 - The generic model
402 /// An exception-handling table entry for the generic model is laid out as:
406 /// +-+------------------------------+
407 /// |0| personality routine offset |
408 /// +-+------------------------------+
409 /// | personality routine data ... |
412 /// ARM EHABI Section 6.3 - The ARM-defined compact model
414 /// An exception-handling table entry for the compact model looks like:
418 /// +-+---+----+-----------------------+
419 /// |1| 0 | Ix | data for pers routine |
420 /// +-+---+----+-----------------------+
421 /// | more personality routine data |
423 const support::ulittle32_t Word =
424 *reinterpret_cast<const support::ulittle32_t *>(Contents->data() + TableEntryOffset);
426 if (Word & 0x80000000) {
427 SW.printString("Model", StringRef("Compact"));
429 unsigned PersonalityIndex = (Word & 0x0f000000) >> 24;
430 SW.printNumber("PersonalityIndex", PersonalityIndex);
432 switch (PersonalityIndex) {
433 case AEABI_UNWIND_CPP_PR0:
434 PrintOpcodes(Contents->data() + TableEntryOffset, 3, 1);
436 case AEABI_UNWIND_CPP_PR1:
437 case AEABI_UNWIND_CPP_PR2:
438 unsigned AdditionalWords = (Word & 0x00ff0000) >> 16;
439 PrintOpcodes(Contents->data() + TableEntryOffset, 2 + 4 * AdditionalWords,
444 SW.printString("Model", StringRef("Generic"));
446 uint64_t Address = PREL31(Word, EHT->sh_addr);
447 SW.printHex("PersonalityRoutineAddress", Address);
448 if (ErrorOr<StringRef> Name = FunctionAtAddress(EHT->sh_link, Address))
449 SW.printString("PersonalityRoutineName", *Name);
453 template <typename ET>
454 void PrinterContext<ET>::PrintOpcodes(const uint8_t *Entry,
455 size_t Length, off_t Offset) const {
456 ListScope OCC(SW, "Opcodes");
457 OpcodeDecoder(OCC.W).Decode(Entry, Offset, Length);
460 template <typename ET>
461 void PrinterContext<ET>::PrintIndexTable(unsigned SectionIndex,
462 const Elf_Shdr *IT) const {
463 ErrorOr<ArrayRef<uint8_t> > Contents = ELF->getSectionContents(IT);
467 /// ARM EHABI Section 5 - Index Table Entries
468 /// * The first word contains a PREL31 offset to the start of a function with
470 /// * The second word contains one of:
471 /// - The PREL31 offset of the start of the table entry for the function,
472 /// with bit 31 clear
473 /// - The exception-handling table entry itself with bit 31 set
474 /// - The special bit pattern EXIDX_CANTUNWIND, indicating that associated
475 /// frames cannot be unwound
477 const support::ulittle32_t *Data =
478 reinterpret_cast<const support::ulittle32_t *>(Contents->data());
479 const unsigned Entries = IT->sh_size / IndexTableEntrySize;
481 ListScope E(SW, "Entries");
482 for (unsigned Entry = 0; Entry < Entries; ++Entry) {
483 DictScope E(SW, "Entry");
485 const support::ulittle32_t Word0 =
486 Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 0];
487 const support::ulittle32_t Word1 =
488 Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 1];
490 if (Word0 & 0x80000000) {
491 errs() << "corrupt unwind data in section " << SectionIndex << "\n";
495 const uint64_t Offset = PREL31(Word0, IT->sh_addr);
496 SW.printHex("FunctionAddress", Offset);
497 if (ErrorOr<StringRef> Name = FunctionAtAddress(IT->sh_link, Offset))
498 SW.printString("FunctionName", *Name);
500 if (Word1 == EXIDX_CANTUNWIND) {
501 SW.printString("Model", StringRef("CantUnwind"));
505 if (Word1 & 0x80000000) {
506 SW.printString("Model", StringRef("Compact (Inline)"));
508 unsigned PersonalityIndex = (Word1 & 0x0f000000) >> 24;
509 SW.printNumber("PersonalityIndex", PersonalityIndex);
511 PrintOpcodes(Contents->data() + Entry * IndexTableEntrySize + 4, 3, 1);
513 const Elf_Shdr *EHT =
514 FindExceptionTable(SectionIndex, Entry * IndexTableEntrySize + 4);
516 if (ErrorOr<StringRef> Name = ELF->getSectionName(EHT))
517 SW.printString("ExceptionHandlingTable", *Name);
519 uint64_t TableEntryOffset = PREL31(Word1, IT->sh_addr);
520 SW.printHex("TableEntryOffset", TableEntryOffset);
522 PrintExceptionTable(IT, EHT, TableEntryOffset);
527 template <typename ET>
528 void PrinterContext<ET>::PrintUnwindInformation() const {
529 DictScope UI(SW, "UnwindInformation");
531 int SectionIndex = 0;
532 for (Elf_Shdr_iterator SI = ELF->begin_sections(), SE = ELF->end_sections();
533 SI != SE; ++SI, ++SectionIndex) {
534 if (SI->sh_type == ELF::SHT_ARM_EXIDX) {
535 const Elf_Shdr *IT = &(*SI);
537 DictScope UIT(SW, "UnwindIndexTable");
539 SW.printNumber("SectionIndex", SectionIndex);
540 if (ErrorOr<StringRef> SectionName = ELF->getSectionName(IT))
541 SW.printString("SectionName", *SectionName);
542 SW.printHex("SectionOffset", IT->sh_offset);
544 PrintIndexTable(SectionIndex, IT);