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/Object/ELF.h"
16 #include "llvm/Object/ELFTypes.h"
17 #include "llvm/Support/ARMEHABI.h"
18 #include "llvm/Support/Debug.h"
19 #include "llvm/Support/Endian.h"
20 #include "llvm/Support/Format.h"
21 #include "llvm/Support/type_traits.h"
24 template <typename type_, size_t N>
25 size_t countof(const type_ (&)[N]) {
41 void (OpcodeDecoder::*Routine)(const uint8_t *Opcodes, unsigned &OI);
43 static const RingEntry Ring[];
45 void Decode_00xxxxxx(const uint8_t *Opcodes, unsigned &OI);
46 void Decode_01xxxxxx(const uint8_t *Opcodes, unsigned &OI);
47 void Decode_1000iiii_iiiiiiii(const uint8_t *Opcodes, unsigned &OI);
48 void Decode_10011101(const uint8_t *Opcodes, unsigned &OI);
49 void Decode_10011111(const uint8_t *Opcodes, unsigned &OI);
50 void Decode_1001nnnn(const uint8_t *Opcodes, unsigned &OI);
51 void Decode_10100nnn(const uint8_t *Opcodes, unsigned &OI);
52 void Decode_10101nnn(const uint8_t *Opcodes, unsigned &OI);
53 void Decode_10110000(const uint8_t *Opcodes, unsigned &OI);
54 void Decode_10110001_0000iiii(const uint8_t *Opcodes, unsigned &OI);
55 void Decode_10110010_uleb128(const uint8_t *Opcodes, unsigned &OI);
56 void Decode_10110011_sssscccc(const uint8_t *Opcodes, unsigned &OI);
57 void Decode_101101nn(const uint8_t *Opcodes, unsigned &OI);
58 void Decode_10111nnn(const uint8_t *Opcodes, unsigned &OI);
59 void Decode_11000110_sssscccc(const uint8_t *Opcodes, unsigned &OI);
60 void Decode_11000111_0000iiii(const uint8_t *Opcodes, unsigned &OI);
61 void Decode_11001000_sssscccc(const uint8_t *Opcodes, unsigned &OI);
62 void Decode_11001001_sssscccc(const uint8_t *Opcodes, unsigned &OI);
63 void Decode_11001yyy(const uint8_t *Opcodes, unsigned &OI);
64 void Decode_11000nnn(const uint8_t *Opcodes, unsigned &OI);
65 void Decode_11010nnn(const uint8_t *Opcodes, unsigned &OI);
66 void Decode_11xxxyyy(const uint8_t *Opcodes, unsigned &OI);
68 void PrintGPR(uint16_t GPRMask);
69 void PrintRegisters(uint32_t Mask, StringRef Prefix);
72 OpcodeDecoder(StreamWriter &SW) : SW(SW), OS(SW.getOStream()) {}
73 void Decode(const uint8_t *Opcodes, off_t Offset, size_t Length);
76 const OpcodeDecoder::RingEntry OpcodeDecoder::Ring[] = {
77 { 0xc0, 0x00, &OpcodeDecoder::Decode_00xxxxxx },
78 { 0xc0, 0x40, &OpcodeDecoder::Decode_01xxxxxx },
79 { 0xf0, 0x80, &OpcodeDecoder::Decode_1000iiii_iiiiiiii },
80 { 0xff, 0x9d, &OpcodeDecoder::Decode_10011101 },
81 { 0xff, 0x9f, &OpcodeDecoder::Decode_10011111 },
82 { 0xf0, 0x90, &OpcodeDecoder::Decode_1001nnnn },
83 { 0xf8, 0xa0, &OpcodeDecoder::Decode_10100nnn },
84 { 0xf8, 0xa8, &OpcodeDecoder::Decode_10101nnn },
85 { 0xff, 0xb0, &OpcodeDecoder::Decode_10110000 },
86 { 0xff, 0xb1, &OpcodeDecoder::Decode_10110001_0000iiii },
87 { 0xff, 0xb2, &OpcodeDecoder::Decode_10110010_uleb128 },
88 { 0xff, 0xb3, &OpcodeDecoder::Decode_10110011_sssscccc },
89 { 0xfc, 0xb4, &OpcodeDecoder::Decode_101101nn },
90 { 0xf8, 0xb8, &OpcodeDecoder::Decode_10111nnn },
91 { 0xff, 0xc6, &OpcodeDecoder::Decode_11000110_sssscccc },
92 { 0xff, 0xc7, &OpcodeDecoder::Decode_11000111_0000iiii },
93 { 0xff, 0xc8, &OpcodeDecoder::Decode_11001000_sssscccc },
94 { 0xff, 0xc9, &OpcodeDecoder::Decode_11001001_sssscccc },
95 { 0xc8, 0xc8, &OpcodeDecoder::Decode_11001yyy },
96 { 0xf8, 0xc0, &OpcodeDecoder::Decode_11000nnn },
97 { 0xf8, 0xd0, &OpcodeDecoder::Decode_11010nnn },
98 { 0xc0, 0xc0, &OpcodeDecoder::Decode_11xxxyyy },
101 void OpcodeDecoder::Decode_00xxxxxx(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_01xxxxxx(const uint8_t *Opcodes, unsigned &OI) {
107 uint8_t Opcode = Opcodes[OI++ ^ 3];
108 SW.startLine() << format("0x%02X ; vsp = vsp - %u\n", Opcode,
109 ((Opcode & 0x3f) << 2) + 4);
111 void OpcodeDecoder::Decode_1000iiii_iiiiiiii(const uint8_t *Opcodes,
113 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
114 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
116 uint16_t GPRMask = (Opcode1 << 4) | ((Opcode0 & 0x0f) << 12);
118 << format("0x%02X 0x%02X ; %s",
119 Opcode0, Opcode1, GPRMask ? "pop " : "refuse to unwind");
124 void OpcodeDecoder::Decode_10011101(const uint8_t *Opcodes, unsigned &OI) {
125 uint8_t Opcode = Opcodes[OI++ ^ 3];
126 SW.startLine() << format("0x%02X ; reserved (ARM MOVrr)\n", Opcode);
128 void OpcodeDecoder::Decode_10011111(const uint8_t *Opcodes, unsigned &OI) {
129 uint8_t Opcode = Opcodes[OI++ ^ 3];
130 SW.startLine() << format("0x%02X ; reserved (WiMMX MOVrr)\n", Opcode);
132 void OpcodeDecoder::Decode_1001nnnn(const uint8_t *Opcodes, unsigned &OI) {
133 uint8_t Opcode = Opcodes[OI++ ^ 3];
134 SW.startLine() << format("0x%02X ; vsp = r%u\n", Opcode, (Opcode & 0x0f));
136 void OpcodeDecoder::Decode_10100nnn(const uint8_t *Opcodes, unsigned &OI) {
137 uint8_t Opcode = Opcodes[OI++ ^ 3];
138 SW.startLine() << format("0x%02X ; pop ", Opcode);
139 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4));
142 void OpcodeDecoder::Decode_10101nnn(const uint8_t *Opcodes, unsigned &OI) {
143 uint8_t Opcode = Opcodes[OI++ ^ 3];
144 SW.startLine() << format("0x%02X ; pop ", Opcode);
145 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4) | (1 << 14));
148 void OpcodeDecoder::Decode_10110000(const uint8_t *Opcodes, unsigned &OI) {
149 uint8_t Opcode = Opcodes[OI++ ^ 3];
150 SW.startLine() << format("0x%02X ; finish\n", Opcode);
152 void OpcodeDecoder::Decode_10110001_0000iiii(const uint8_t *Opcodes,
154 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
155 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
158 << format("0x%02X 0x%02X ; %s", Opcode0, Opcode1,
159 ((Opcode1 & 0xf0) || Opcode1 == 0x00) ? "spare" : "pop ");
160 if (((Opcode1 & 0xf0) == 0x00) && Opcode1)
161 PrintGPR((Opcode1 & 0x0f));
164 void OpcodeDecoder::Decode_10110010_uleb128(const uint8_t *Opcodes,
166 uint8_t Opcode = Opcodes[OI++ ^ 3];
167 SW.startLine() << format("0x%02X ", Opcode);
169 SmallVector<uint8_t, 4> ULEB;
170 do { ULEB.push_back(Opcodes[OI ^ 3]); } while (Opcodes[OI++ ^ 3] & 0x80);
172 for (unsigned BI = 0, BE = ULEB.size(); BI != BE; ++BI)
173 OS << format("0x%02X ", ULEB[BI]);
176 for (unsigned BI = 0, BE = ULEB.size(); BI != BE; ++BI)
177 Value = Value | ((ULEB[BI] & 0x7f) << (7 * BI));
179 OS << format("; vsp = vsp + %" PRIu64 "\n", 0x204 + (Value << 2));
181 void OpcodeDecoder::Decode_10110011_sssscccc(const uint8_t *Opcodes,
183 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
184 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
185 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
186 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
187 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
188 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
191 void OpcodeDecoder::Decode_101101nn(const uint8_t *Opcodes, unsigned &OI) {
192 uint8_t Opcode = Opcodes[OI++ ^ 3];
193 SW.startLine() << format("0x%02X ; spare\n", Opcode);
195 void OpcodeDecoder::Decode_10111nnn(const uint8_t *Opcodes, unsigned &OI) {
196 uint8_t Opcode = Opcodes[OI++ ^ 3];
197 SW.startLine() << format("0x%02X ; pop ", Opcode);
198 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d");
201 void OpcodeDecoder::Decode_11000110_sssscccc(const uint8_t *Opcodes,
203 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
204 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
205 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
206 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
207 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
208 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "wR");
211 void OpcodeDecoder::Decode_11000111_0000iiii(const uint8_t *Opcodes,
213 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
214 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
216 << format("0x%02X 0x%02X ; %s", Opcode0, Opcode1,
217 ((Opcode1 & 0xf0) || Opcode1 == 0x00) ? "spare" : "pop ");
218 if ((Opcode1 & 0xf0) == 0x00 && Opcode1)
219 PrintRegisters(Opcode1 & 0x0f, "wCGR");
222 void OpcodeDecoder::Decode_11001000_sssscccc(const uint8_t *Opcodes,
224 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
225 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
226 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
227 uint8_t Start = 16 + ((Opcode1 & 0xf0) >> 4);
228 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
229 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
232 void OpcodeDecoder::Decode_11001001_sssscccc(const uint8_t *Opcodes,
234 uint8_t Opcode0 = Opcodes[OI++ ^ 3];
235 uint8_t Opcode1 = Opcodes[OI++ ^ 3];
236 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1);
237 uint8_t Start = ((Opcode1 & 0xf0) >> 4);
238 uint8_t Count = ((Opcode1 & 0x0f) >> 0);
239 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d");
242 void OpcodeDecoder::Decode_11001yyy(const uint8_t *Opcodes, unsigned &OI) {
243 uint8_t Opcode = Opcodes[OI++ ^ 3];
244 SW.startLine() << format("0x%02X ; spare\n", Opcode);
246 void OpcodeDecoder::Decode_11000nnn(const uint8_t *Opcodes, unsigned &OI) {
247 uint8_t Opcode = Opcodes[OI++ ^ 3];
248 SW.startLine() << format("0x%02X ; pop ", Opcode);
249 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 10), "wR");
252 void OpcodeDecoder::Decode_11010nnn(const uint8_t *Opcodes, unsigned &OI) {
253 uint8_t Opcode = Opcodes[OI++ ^ 3];
254 SW.startLine() << format("0x%02X ; pop ", Opcode);
255 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d");
258 void OpcodeDecoder::Decode_11xxxyyy(const uint8_t *Opcodes, unsigned &OI) {
259 uint8_t Opcode = Opcodes[OI++ ^ 3];
260 SW.startLine() << format("0x%02X ; spare\n", Opcode);
263 void OpcodeDecoder::PrintGPR(uint16_t GPRMask) {
264 static const char *GPRRegisterNames[16] = {
265 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
266 "fp", "ip", "sp", "lr", "pc"
271 for (unsigned RI = 0, RE = 17; RI < RE; ++RI) {
272 if (GPRMask & (1 << RI)) {
275 OS << GPRRegisterNames[RI];
282 void OpcodeDecoder::PrintRegisters(uint32_t VFPMask, StringRef Prefix) {
285 for (unsigned RI = 0, RE = 32; RI < RE; ++RI) {
286 if (VFPMask & (1 << RI)) {
296 void OpcodeDecoder::Decode(const uint8_t *Opcodes, off_t Offset, size_t Length) {
297 for (unsigned OCI = Offset; OCI < Length + Offset; ) {
298 bool Decoded = false;
299 for (unsigned REI = 0, REE = countof(Ring); REI != REE && !Decoded; ++REI) {
300 if ((Opcodes[OCI ^ 3] & Ring[REI].Mask) == Ring[REI].Value) {
301 (this->*Ring[REI].Routine)(Opcodes, OCI);
307 SW.startLine() << format("0x%02X ; reserved\n", Opcodes[OCI++ ^ 3]);
311 template <typename ET>
312 class PrinterContext {
314 const object::ELFFile<ET> *ELF;
316 typedef typename object::ELFFile<ET>::Elf_Sym Elf_Sym;
317 typedef typename object::ELFFile<ET>::Elf_Shdr Elf_Shdr;
319 typedef typename object::ELFFile<ET>::Elf_Rel_Iter Elf_Rel_iterator;
320 typedef typename object::ELFFile<ET>::Elf_Sym_Iter Elf_Sym_iterator;
321 typedef typename object::ELFFile<ET>::Elf_Shdr_Iter Elf_Shdr_iterator;
323 static const size_t IndexTableEntrySize;
325 static uint64_t PREL31(uint32_t Address, uint32_t Place) {
326 uint64_t Location = Address & 0x7fffffff;
327 if (Location & 0x04000000)
328 Location |= (uint64_t) ~0x7fffffff;
329 return Location + Place;
332 ErrorOr<StringRef> FunctionAtAddress(unsigned Section, uint64_t Address) const;
333 const Elf_Shdr *FindExceptionTable(unsigned IndexTableIndex,
334 off_t IndexTableOffset) const;
336 void PrintIndexTable(unsigned SectionIndex, const Elf_Shdr *IT) const;
337 void PrintExceptionTable(const Elf_Shdr *IT, const Elf_Shdr *EHT,
338 uint64_t TableEntryOffset) const;
339 void PrintOpcodes(const uint8_t *Entry, size_t Length, off_t Offset) const;
342 PrinterContext(StreamWriter &Writer, const object::ELFFile<ET> *File)
343 : SW(Writer), ELF(File) {}
345 void PrintUnwindInformation() const;
348 template <typename ET>
349 const size_t PrinterContext<ET>::IndexTableEntrySize = 8;
351 template <typename ET>
352 ErrorOr<StringRef> PrinterContext<ET>::FunctionAtAddress(unsigned Section,
353 uint64_t Address) const {
354 for (Elf_Sym_iterator SI = ELF->begin_symbols(), SE = ELF->end_symbols();
356 if (SI->st_shndx == Section && SI->st_value == Address &&
357 SI->getType() == ELF::STT_FUNC)
358 return ELF->getSymbolName(SI);
359 return readobj_error::unknown_symbol;
362 template <typename ET>
363 const typename object::ELFFile<ET>::Elf_Shdr *
364 PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
365 off_t IndexTableOffset) const {
366 /// Iterate through the sections, searching for the relocation section
367 /// associated with the unwind index table section specified by
368 /// IndexSectionIndex. Iterate the associated section searching for the
369 /// relocation associated with the index table entry specified by
370 /// IndexTableOffset. The symbol is the section symbol for the exception
371 /// handling table. Use this symbol to recover the actual exception handling
374 for (Elf_Shdr_iterator SI = ELF->begin_sections(), SE = ELF->end_sections();
376 if (SI->sh_type == ELF::SHT_REL && SI->sh_info == IndexSectionIndex) {
377 for (Elf_Rel_iterator RI = ELF->begin_rel(&*SI), RE = ELF->end_rel(&*SI);
379 if (static_cast<unsigned>(RI->r_offset) == IndexTableOffset) {
380 typename object::ELFFile<ET>::Elf_Rela RelA;
381 RelA.r_offset = RI->r_offset;
382 RelA.r_info = RI->r_info;
385 std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
386 ELF->getRelocationSymbol(&(*SI), &RelA);
388 return ELF->getSection(Symbol.second);
396 template <typename ET>
397 void PrinterContext<ET>::PrintExceptionTable(const Elf_Shdr *IT,
399 uint64_t TableEntryOffset) const {
400 ErrorOr<ArrayRef<uint8_t> > Contents = ELF->getSectionContents(EHT);
404 /// ARM EHABI Section 6.2 - The generic model
406 /// An exception-handling table entry for the generic model is laid out as:
410 /// +-+------------------------------+
411 /// |0| personality routine offset |
412 /// +-+------------------------------+
413 /// | personality routine data ... |
416 /// ARM EHABI Section 6.3 - The ARM-defined compact model
418 /// An exception-handling table entry for the compact model looks like:
422 /// +-+---+----+-----------------------+
423 /// |1| 0 | Ix | data for pers routine |
424 /// +-+---+----+-----------------------+
425 /// | more personality routine data |
427 const support::ulittle32_t Word =
428 *reinterpret_cast<const support::ulittle32_t *>(Contents->data() + TableEntryOffset);
430 if (Word & 0x80000000) {
431 SW.printString("Model", StringRef("Compact"));
433 unsigned PersonalityIndex = (Word & 0x0f000000) >> 24;
434 SW.printNumber("PersonalityIndex", PersonalityIndex);
436 switch (PersonalityIndex) {
437 case AEABI_UNWIND_CPP_PR0:
438 PrintOpcodes(Contents->data() + TableEntryOffset, 3, 1);
440 case AEABI_UNWIND_CPP_PR1:
441 case AEABI_UNWIND_CPP_PR2:
442 unsigned AdditionalWords = (Word & 0x00ff0000) >> 16;
443 PrintOpcodes(Contents->data() + TableEntryOffset, 2 + 4 * AdditionalWords,
448 SW.printString("Model", StringRef("Generic"));
450 uint64_t Address = PREL31(Word, EHT->sh_addr);
451 SW.printHex("PersonalityRoutineAddress", Address);
452 if (ErrorOr<StringRef> Name = FunctionAtAddress(EHT->sh_link, Address))
453 SW.printString("PersonalityRoutineName", *Name);
457 template <typename ET>
458 void PrinterContext<ET>::PrintOpcodes(const uint8_t *Entry,
459 size_t Length, off_t Offset) const {
460 ListScope OCC(SW, "Opcodes");
461 OpcodeDecoder(OCC.W).Decode(Entry, Offset, Length);
464 template <typename ET>
465 void PrinterContext<ET>::PrintIndexTable(unsigned SectionIndex,
466 const Elf_Shdr *IT) const {
467 ErrorOr<ArrayRef<uint8_t> > Contents = ELF->getSectionContents(IT);
471 /// ARM EHABI Section 5 - Index Table Entries
472 /// * The first word contains a PREL31 offset to the start of a function with
474 /// * The second word contains one of:
475 /// - The PREL31 offset of the start of the table entry for the function,
476 /// with bit 31 clear
477 /// - The exception-handling table entry itself with bit 31 set
478 /// - The special bit pattern EXIDX_CANTUNWIND, indicating that associated
479 /// frames cannot be unwound
481 const support::ulittle32_t *Data =
482 reinterpret_cast<const support::ulittle32_t *>(Contents->data());
483 const unsigned Entries = IT->sh_size / IndexTableEntrySize;
485 ListScope E(SW, "Entries");
486 for (unsigned Entry = 0; Entry < Entries; ++Entry) {
487 DictScope E(SW, "Entry");
489 const support::ulittle32_t Word0 =
490 Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 0];
491 const support::ulittle32_t Word1 =
492 Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 1];
494 if (Word0 & 0x80000000) {
495 errs() << "corrupt unwind data in section " << SectionIndex << "\n";
499 const uint64_t Offset = PREL31(Word0, IT->sh_addr);
500 SW.printHex("FunctionAddress", Offset);
501 if (ErrorOr<StringRef> Name = FunctionAtAddress(IT->sh_link, Offset))
502 SW.printString("FunctionName", *Name);
504 if (Word1 == EXIDX_CANTUNWIND) {
505 SW.printString("Model", StringRef("CantUnwind"));
509 if (Word1 & 0x80000000) {
510 SW.printString("Model", StringRef("Compact (Inline)"));
512 unsigned PersonalityIndex = (Word1 & 0x0f000000) >> 24;
513 SW.printNumber("PersonalityIndex", PersonalityIndex);
515 PrintOpcodes(Contents->data() + Entry * IndexTableEntrySize + 4, 3, 1);
517 const Elf_Shdr *EHT =
518 FindExceptionTable(SectionIndex, Entry * IndexTableEntrySize + 4);
520 if (ErrorOr<StringRef> Name = ELF->getSectionName(EHT))
521 SW.printString("ExceptionHandlingTable", *Name);
523 uint64_t TableEntryOffset = PREL31(Word1, IT->sh_addr);
524 SW.printHex("TableEntryOffset", TableEntryOffset);
526 PrintExceptionTable(IT, EHT, TableEntryOffset);
531 template <typename ET>
532 void PrinterContext<ET>::PrintUnwindInformation() const {
533 DictScope UI(SW, "UnwindInformation");
535 int SectionIndex = 0;
536 for (Elf_Shdr_iterator SI = ELF->begin_sections(), SE = ELF->end_sections();
537 SI != SE; ++SI, ++SectionIndex) {
538 if (SI->sh_type == ELF::SHT_ARM_EXIDX) {
539 const Elf_Shdr *IT = &(*SI);
541 DictScope UIT(SW, "UnwindIndexTable");
543 SW.printNumber("SectionIndex", SectionIndex);
544 if (ErrorOr<StringRef> SectionName = ELF->getSectionName(IT))
545 SW.printString("SectionName", *SectionName);
546 SW.printHex("SectionOffset", IT->sh_offset);
548 PrintIndexTable(SectionIndex, IT);