1 //===-- COFFDump.cpp - COFF-specific dumper ---------------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
11 /// This file implements the COFF-specific dumper for llvm-objdump.
12 /// It outputs the Win64 EH data structures as plain text.
13 /// The encoding of the unwind codes is described in MSDN:
14 /// http://msdn.microsoft.com/en-us/library/ck9asaa9.aspx
16 //===----------------------------------------------------------------------===//
18 #include "llvm-objdump.h"
19 #include "llvm/Object/COFF.h"
20 #include "llvm/Object/COFFImportFile.h"
21 #include "llvm/Object/ObjectFile.h"
22 #include "llvm/Support/Format.h"
23 #include "llvm/Support/Win64EH.h"
24 #include "llvm/Support/raw_ostream.h"
27 using namespace object;
28 using namespace llvm::Win64EH;
30 // Returns the name of the unwind code.
31 static StringRef getUnwindCodeTypeName(uint8_t Code) {
33 default: llvm_unreachable("Invalid unwind code");
34 case UOP_PushNonVol: return "UOP_PushNonVol";
35 case UOP_AllocLarge: return "UOP_AllocLarge";
36 case UOP_AllocSmall: return "UOP_AllocSmall";
37 case UOP_SetFPReg: return "UOP_SetFPReg";
38 case UOP_SaveNonVol: return "UOP_SaveNonVol";
39 case UOP_SaveNonVolBig: return "UOP_SaveNonVolBig";
40 case UOP_SaveXMM128: return "UOP_SaveXMM128";
41 case UOP_SaveXMM128Big: return "UOP_SaveXMM128Big";
42 case UOP_PushMachFrame: return "UOP_PushMachFrame";
46 // Returns the name of a referenced register.
47 static StringRef getUnwindRegisterName(uint8_t Reg) {
49 default: llvm_unreachable("Invalid register");
60 case 10: return "R10";
61 case 11: return "R11";
62 case 12: return "R12";
63 case 13: return "R13";
64 case 14: return "R14";
65 case 15: return "R15";
69 // Calculates the number of array slots required for the unwind code.
70 static unsigned getNumUsedSlots(const UnwindCode &UnwindCode) {
71 switch (UnwindCode.getUnwindOp()) {
72 default: llvm_unreachable("Invalid unwind code");
76 case UOP_PushMachFrame:
81 case UOP_SaveNonVolBig:
82 case UOP_SaveXMM128Big:
85 return (UnwindCode.getOpInfo() == 0) ? 2 : 3;
89 // Prints one unwind code. Because an unwind code can occupy up to 3 slots in
90 // the unwind codes array, this function requires that the correct number of
92 static void printUnwindCode(ArrayRef<UnwindCode> UCs) {
93 assert(UCs.size() >= getNumUsedSlots(UCs[0]));
94 outs() << format(" 0x%02x: ", unsigned(UCs[0].u.CodeOffset))
95 << getUnwindCodeTypeName(UCs[0].getUnwindOp());
96 switch (UCs[0].getUnwindOp()) {
98 outs() << " " << getUnwindRegisterName(UCs[0].getOpInfo());
101 if (UCs[0].getOpInfo() == 0) {
102 outs() << " " << UCs[1].FrameOffset;
104 outs() << " " << UCs[1].FrameOffset
105 + (static_cast<uint32_t>(UCs[2].FrameOffset) << 16);
109 outs() << " " << ((UCs[0].getOpInfo() + 1) * 8);
115 outs() << " " << getUnwindRegisterName(UCs[0].getOpInfo())
116 << format(" [0x%04x]", 8 * UCs[1].FrameOffset);
118 case UOP_SaveNonVolBig:
119 outs() << " " << getUnwindRegisterName(UCs[0].getOpInfo())
120 << format(" [0x%08x]", UCs[1].FrameOffset
121 + (static_cast<uint32_t>(UCs[2].FrameOffset) << 16));
124 outs() << " XMM" << static_cast<uint32_t>(UCs[0].getOpInfo())
125 << format(" [0x%04x]", 16 * UCs[1].FrameOffset);
127 case UOP_SaveXMM128Big:
128 outs() << " XMM" << UCs[0].getOpInfo()
129 << format(" [0x%08x]", UCs[1].FrameOffset
130 + (static_cast<uint32_t>(UCs[2].FrameOffset) << 16));
132 case UOP_PushMachFrame:
133 outs() << " " << (UCs[0].getOpInfo() ? "w/o" : "w")
140 static void printAllUnwindCodes(ArrayRef<UnwindCode> UCs) {
141 for (const UnwindCode *I = UCs.begin(), *E = UCs.end(); I < E; ) {
142 unsigned UsedSlots = getNumUsedSlots(*I);
143 if (UsedSlots > UCs.size()) {
144 outs() << "Unwind data corrupted: Encountered unwind op "
145 << getUnwindCodeTypeName((*I).getUnwindOp())
146 << " which requires " << UsedSlots
147 << " slots, but only " << UCs.size()
148 << " remaining in buffer";
151 printUnwindCode(makeArrayRef(I, E));
156 // Given a symbol sym this functions returns the address and section of it.
157 static std::error_code
158 resolveSectionAndAddress(const COFFObjectFile *Obj, const SymbolRef &Sym,
159 const coff_section *&ResolvedSection,
160 uint64_t &ResolvedAddr) {
161 Expected<uint64_t> ResolvedAddrOrErr = Sym.getAddress();
162 if (!ResolvedAddrOrErr)
163 return errorToErrorCode(ResolvedAddrOrErr.takeError());
164 ResolvedAddr = *ResolvedAddrOrErr;
165 Expected<section_iterator> Iter = Sym.getSection();
167 return errorToErrorCode(Iter.takeError());
168 ResolvedSection = Obj->getCOFFSection(**Iter);
169 return std::error_code();
172 // Given a vector of relocations for a section and an offset into this section
173 // the function returns the symbol used for the relocation at the offset.
174 static std::error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
175 uint64_t Offset, SymbolRef &Sym) {
176 for (auto &R : Rels) {
177 uint64_t Ofs = R.getOffset();
179 Sym = *R.getSymbol();
180 return std::error_code();
183 return object_error::parse_failed;
186 // Given a vector of relocations for a section and an offset into this section
187 // the function resolves the symbol used for the relocation at the offset and
188 // returns the section content and the address inside the content pointed to
190 static std::error_code
191 getSectionContents(const COFFObjectFile *Obj,
192 const std::vector<RelocationRef> &Rels, uint64_t Offset,
193 ArrayRef<uint8_t> &Contents, uint64_t &Addr) {
195 if (std::error_code EC = resolveSymbol(Rels, Offset, Sym))
197 const coff_section *Section;
198 if (std::error_code EC = resolveSectionAndAddress(Obj, Sym, Section, Addr))
200 if (std::error_code EC = Obj->getSectionContents(Section, Contents))
202 return std::error_code();
205 // Given a vector of relocations for a section and an offset into this section
206 // the function returns the name of the symbol used for the relocation at the
208 static std::error_code resolveSymbolName(const std::vector<RelocationRef> &Rels,
209 uint64_t Offset, StringRef &Name) {
211 if (std::error_code EC = resolveSymbol(Rels, Offset, Sym))
213 Expected<StringRef> NameOrErr = Sym.getName();
215 return errorToErrorCode(NameOrErr.takeError());
217 return std::error_code();
220 static void printCOFFSymbolAddress(llvm::raw_ostream &Out,
221 const std::vector<RelocationRef> &Rels,
222 uint64_t Offset, uint32_t Disp) {
224 if (!resolveSymbolName(Rels, Offset, Sym)) {
227 Out << format(" + 0x%04x", Disp);
229 Out << format("0x%04x", Disp);
234 printSEHTable(const COFFObjectFile *Obj, uint32_t TableVA, int Count) {
238 const pe32_header *PE32Header;
239 error(Obj->getPE32Header(PE32Header));
240 uint32_t ImageBase = PE32Header->ImageBase;
241 uintptr_t IntPtr = 0;
242 error(Obj->getVaPtr(TableVA, IntPtr));
243 const support::ulittle32_t *P = (const support::ulittle32_t *)IntPtr;
244 outs() << "SEH Table:";
245 for (int I = 0; I < Count; ++I)
246 outs() << format(" 0x%x", P[I] + ImageBase);
250 template <typename T>
251 static void printTLSDirectoryT(const coff_tls_directory<T> *TLSDir) {
252 size_t FormatWidth = sizeof(T) * 2;
253 outs() << "TLS directory:"
254 << "\n StartAddressOfRawData: "
255 << format_hex(TLSDir->StartAddressOfRawData, FormatWidth)
256 << "\n EndAddressOfRawData: "
257 << format_hex(TLSDir->EndAddressOfRawData, FormatWidth)
258 << "\n AddressOfIndex: "
259 << format_hex(TLSDir->AddressOfIndex, FormatWidth)
260 << "\n AddressOfCallBacks: "
261 << format_hex(TLSDir->AddressOfCallBacks, FormatWidth)
262 << "\n SizeOfZeroFill: "
263 << TLSDir->SizeOfZeroFill
264 << "\n Characteristics: "
265 << TLSDir->Characteristics
267 << TLSDir->getAlignment()
271 static void printTLSDirectory(const COFFObjectFile *Obj) {
272 const pe32_header *PE32Header;
273 error(Obj->getPE32Header(PE32Header));
275 const pe32plus_header *PE32PlusHeader;
276 error(Obj->getPE32PlusHeader(PE32PlusHeader));
278 // Skip if it's not executable.
279 if (!PE32Header && !PE32PlusHeader)
282 const data_directory *DataDir;
283 error(Obj->getDataDirectory(COFF::TLS_TABLE, DataDir));
284 uintptr_t IntPtr = 0;
285 if (DataDir->RelativeVirtualAddress == 0)
287 error(Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr));
290 auto *TLSDir = reinterpret_cast<const coff_tls_directory32 *>(IntPtr);
291 printTLSDirectoryT(TLSDir);
293 auto *TLSDir = reinterpret_cast<const coff_tls_directory64 *>(IntPtr);
294 printTLSDirectoryT(TLSDir);
300 static void printLoadConfiguration(const COFFObjectFile *Obj) {
301 // Skip if it's not executable.
302 const pe32_header *PE32Header;
303 error(Obj->getPE32Header(PE32Header));
307 // Currently only x86 is supported
308 if (Obj->getMachine() != COFF::IMAGE_FILE_MACHINE_I386)
311 const data_directory *DataDir;
312 error(Obj->getDataDirectory(COFF::LOAD_CONFIG_TABLE, DataDir));
313 uintptr_t IntPtr = 0;
314 if (DataDir->RelativeVirtualAddress == 0)
316 error(Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr));
318 auto *LoadConf = reinterpret_cast<const coff_load_configuration32 *>(IntPtr);
319 outs() << "Load configuration:"
320 << "\n Timestamp: " << LoadConf->TimeDateStamp
321 << "\n Major Version: " << LoadConf->MajorVersion
322 << "\n Minor Version: " << LoadConf->MinorVersion
323 << "\n GlobalFlags Clear: " << LoadConf->GlobalFlagsClear
324 << "\n GlobalFlags Set: " << LoadConf->GlobalFlagsSet
325 << "\n Critical Section Default Timeout: " << LoadConf->CriticalSectionDefaultTimeout
326 << "\n Decommit Free Block Threshold: " << LoadConf->DeCommitFreeBlockThreshold
327 << "\n Decommit Total Free Threshold: " << LoadConf->DeCommitTotalFreeThreshold
328 << "\n Lock Prefix Table: " << LoadConf->LockPrefixTable
329 << "\n Maximum Allocation Size: " << LoadConf->MaximumAllocationSize
330 << "\n Virtual Memory Threshold: " << LoadConf->VirtualMemoryThreshold
331 << "\n Process Affinity Mask: " << LoadConf->ProcessAffinityMask
332 << "\n Process Heap Flags: " << LoadConf->ProcessHeapFlags
333 << "\n CSD Version: " << LoadConf->CSDVersion
334 << "\n Security Cookie: " << LoadConf->SecurityCookie
335 << "\n SEH Table: " << LoadConf->SEHandlerTable
336 << "\n SEH Count: " << LoadConf->SEHandlerCount
338 printSEHTable(Obj, LoadConf->SEHandlerTable, LoadConf->SEHandlerCount);
342 // Prints import tables. The import table is a table containing the list of
343 // DLL name and symbol names which will be linked by the loader.
344 static void printImportTables(const COFFObjectFile *Obj) {
345 import_directory_iterator I = Obj->import_directory_begin();
346 import_directory_iterator E = Obj->import_directory_end();
349 outs() << "The Import Tables:\n";
350 for (const ImportDirectoryEntryRef &DirRef : Obj->import_directories()) {
351 const coff_import_directory_table_entry *Dir;
353 if (DirRef.getImportTableEntry(Dir)) return;
354 if (DirRef.getName(Name)) return;
356 outs() << format(" lookup %08x time %08x fwd %08x name %08x addr %08x\n\n",
357 static_cast<uint32_t>(Dir->ImportLookupTableRVA),
358 static_cast<uint32_t>(Dir->TimeDateStamp),
359 static_cast<uint32_t>(Dir->ForwarderChain),
360 static_cast<uint32_t>(Dir->NameRVA),
361 static_cast<uint32_t>(Dir->ImportAddressTableRVA));
362 outs() << " DLL Name: " << Name << "\n";
363 outs() << " Hint/Ord Name\n";
364 for (const ImportedSymbolRef &Entry : DirRef.imported_symbols()) {
366 if (Entry.isOrdinal(IsOrdinal))
370 if (Entry.getOrdinal(Ordinal))
372 outs() << format(" % 6d\n", Ordinal);
375 uint32_t HintNameRVA;
376 if (Entry.getHintNameRVA(HintNameRVA))
380 if (Obj->getHintName(HintNameRVA, Hint, Name))
382 outs() << format(" % 6d ", Hint) << Name << "\n";
388 // Prints export tables. The export table is a table containing the list of
389 // exported symbol from the DLL.
390 static void printExportTable(const COFFObjectFile *Obj) {
391 outs() << "Export Table:\n";
392 export_directory_iterator I = Obj->export_directory_begin();
393 export_directory_iterator E = Obj->export_directory_end();
397 uint32_t OrdinalBase;
398 if (I->getDllName(DllName))
400 if (I->getOrdinalBase(OrdinalBase))
402 outs() << " DLL name: " << DllName << "\n";
403 outs() << " Ordinal base: " << OrdinalBase << "\n";
404 outs() << " Ordinal RVA Name\n";
405 for (; I != E; I = ++I) {
407 if (I->getOrdinal(Ordinal))
410 if (I->getExportRVA(RVA))
413 if (I->isForwarder(IsForwarder))
417 // Export table entries can be used to re-export symbols that
418 // this COFF file is imported from some DLLs. This is rare.
419 // In most cases IsForwarder is false.
420 outs() << format(" % 4d ", Ordinal);
422 outs() << format(" % 4d %# 8x", Ordinal, RVA);
426 if (I->getSymbolName(Name))
429 outs() << " " << Name;
432 if (I->getForwardTo(S))
434 outs() << " (forwarded to " << S << ")";
440 // Given the COFF object file, this function returns the relocations for .pdata
441 // and the pointer to "runtime function" structs.
442 static bool getPDataSection(const COFFObjectFile *Obj,
443 std::vector<RelocationRef> &Rels,
444 const RuntimeFunction *&RFStart, int &NumRFs) {
445 for (const SectionRef &Section : Obj->sections()) {
447 error(Section.getName(Name));
448 if (Name != ".pdata")
451 const coff_section *Pdata = Obj->getCOFFSection(Section);
452 for (const RelocationRef &Reloc : Section.relocations())
453 Rels.push_back(Reloc);
455 // Sort relocations by address.
456 llvm::sort(Rels.begin(), Rels.end(), RelocAddressLess);
458 ArrayRef<uint8_t> Contents;
459 error(Obj->getSectionContents(Pdata, Contents));
460 if (Contents.empty())
463 RFStart = reinterpret_cast<const RuntimeFunction *>(Contents.data());
464 NumRFs = Contents.size() / sizeof(RuntimeFunction);
470 static void printWin64EHUnwindInfo(const Win64EH::UnwindInfo *UI) {
471 // The casts to int are required in order to output the value as number.
472 // Without the casts the value would be interpreted as char data (which
473 // results in garbage output).
474 outs() << " Version: " << static_cast<int>(UI->getVersion()) << "\n";
475 outs() << " Flags: " << static_cast<int>(UI->getFlags());
476 if (UI->getFlags()) {
477 if (UI->getFlags() & UNW_ExceptionHandler)
478 outs() << " UNW_ExceptionHandler";
479 if (UI->getFlags() & UNW_TerminateHandler)
480 outs() << " UNW_TerminateHandler";
481 if (UI->getFlags() & UNW_ChainInfo)
482 outs() << " UNW_ChainInfo";
485 outs() << " Size of prolog: " << static_cast<int>(UI->PrologSize) << "\n";
486 outs() << " Number of Codes: " << static_cast<int>(UI->NumCodes) << "\n";
487 // Maybe this should move to output of UOP_SetFPReg?
488 if (UI->getFrameRegister()) {
489 outs() << " Frame register: "
490 << getUnwindRegisterName(UI->getFrameRegister()) << "\n";
491 outs() << " Frame offset: " << 16 * UI->getFrameOffset() << "\n";
493 outs() << " No frame pointer used\n";
495 if (UI->getFlags() & (UNW_ExceptionHandler | UNW_TerminateHandler)) {
496 // FIXME: Output exception handler data
497 } else if (UI->getFlags() & UNW_ChainInfo) {
498 // FIXME: Output chained unwind info
502 outs() << " Unwind Codes:\n";
504 printAllUnwindCodes(makeArrayRef(&UI->UnwindCodes[0], UI->NumCodes));
510 /// Prints out the given RuntimeFunction struct for x64, assuming that Obj is
511 /// pointing to an executable file.
512 static void printRuntimeFunction(const COFFObjectFile *Obj,
513 const RuntimeFunction &RF) {
514 if (!RF.StartAddress)
516 outs() << "Function Table:\n"
517 << format(" Start Address: 0x%04x\n",
518 static_cast<uint32_t>(RF.StartAddress))
519 << format(" End Address: 0x%04x\n",
520 static_cast<uint32_t>(RF.EndAddress))
521 << format(" Unwind Info Address: 0x%04x\n",
522 static_cast<uint32_t>(RF.UnwindInfoOffset));
524 if (Obj->getRvaPtr(RF.UnwindInfoOffset, addr))
526 printWin64EHUnwindInfo(reinterpret_cast<const Win64EH::UnwindInfo *>(addr));
529 /// Prints out the given RuntimeFunction struct for x64, assuming that Obj is
530 /// pointing to an object file. Unlike executable, fields in RuntimeFunction
531 /// struct are filled with zeros, but instead there are relocations pointing to
532 /// them so that the linker will fill targets' RVAs to the fields at link
533 /// time. This function interprets the relocations to find the data to be used
534 /// in the resulting executable.
535 static void printRuntimeFunctionRels(const COFFObjectFile *Obj,
536 const RuntimeFunction &RF,
537 uint64_t SectionOffset,
538 const std::vector<RelocationRef> &Rels) {
539 outs() << "Function Table:\n";
540 outs() << " Start Address: ";
541 printCOFFSymbolAddress(outs(), Rels,
543 /*offsetof(RuntimeFunction, StartAddress)*/ 0,
547 outs() << " End Address: ";
548 printCOFFSymbolAddress(outs(), Rels,
550 /*offsetof(RuntimeFunction, EndAddress)*/ 4,
554 outs() << " Unwind Info Address: ";
555 printCOFFSymbolAddress(outs(), Rels,
557 /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
558 RF.UnwindInfoOffset);
561 ArrayRef<uint8_t> XContents;
562 uint64_t UnwindInfoOffset = 0;
563 error(getSectionContents(
564 Obj, Rels, SectionOffset +
565 /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
566 XContents, UnwindInfoOffset));
567 if (XContents.empty())
570 UnwindInfoOffset += RF.UnwindInfoOffset;
571 if (UnwindInfoOffset > XContents.size())
574 auto *UI = reinterpret_cast<const Win64EH::UnwindInfo *>(XContents.data() +
576 printWin64EHUnwindInfo(UI);
579 void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
580 if (Obj->getMachine() != COFF::IMAGE_FILE_MACHINE_AMD64) {
581 errs() << "Unsupported image machine type "
582 "(currently only AMD64 is supported).\n";
586 std::vector<RelocationRef> Rels;
587 const RuntimeFunction *RFStart;
589 if (!getPDataSection(Obj, Rels, RFStart, NumRFs))
591 ArrayRef<RuntimeFunction> RFs(RFStart, NumRFs);
593 bool IsExecutable = Rels.empty();
595 for (const RuntimeFunction &RF : RFs)
596 printRuntimeFunction(Obj, RF);
600 for (const RuntimeFunction &RF : RFs) {
601 uint64_t SectionOffset =
602 std::distance(RFs.begin(), &RF) * sizeof(RuntimeFunction);
603 printRuntimeFunctionRels(Obj, RF, SectionOffset, Rels);
607 void llvm::printCOFFFileHeader(const object::ObjectFile *Obj) {
608 const COFFObjectFile *file = dyn_cast<const COFFObjectFile>(Obj);
609 printTLSDirectory(file);
610 printLoadConfiguration(file);
611 printImportTables(file);
612 printExportTable(file);
615 void llvm::printCOFFSymbolTable(const object::COFFImportFile *i) {
617 bool IsCode = i->getCOFFImportHeader()->getType() == COFF::IMPORT_CODE;
619 for (const object::BasicSymbolRef &Sym : i->symbols()) {
621 raw_string_ostream NS(Name);
626 outs() << "[" << format("%2d", Index) << "]"
627 << "(sec " << format("%2d", 0) << ")"
628 << "(fl 0x00)" // Flag bits, which COFF doesn't have.
629 << "(ty " << format("%3x", (IsCode && Index) ? 32 : 0) << ")"
630 << "(scl " << format("%3x", 0) << ") "
631 << "(nx " << 0 << ") "
632 << "0x" << format("%08x", 0) << " " << Name << '\n';
638 void llvm::printCOFFSymbolTable(const COFFObjectFile *coff) {
639 for (unsigned SI = 0, SE = coff->getNumberOfSymbols(); SI != SE; ++SI) {
640 Expected<COFFSymbolRef> Symbol = coff->getSymbol(SI);
642 error(errorToErrorCode(Symbol.takeError()));
643 error(coff->getSymbolName(*Symbol, Name));
645 outs() << "[" << format("%2d", SI) << "]"
646 << "(sec " << format("%2d", int(Symbol->getSectionNumber())) << ")"
647 << "(fl 0x00)" // Flag bits, which COFF doesn't have.
648 << "(ty " << format("%3x", unsigned(Symbol->getType())) << ")"
649 << "(scl " << format("%3x", unsigned(Symbol->getStorageClass())) << ") "
650 << "(nx " << unsigned(Symbol->getNumberOfAuxSymbols()) << ") "
651 << "0x" << format("%08x", unsigned(Symbol->getValue())) << " "
654 for (unsigned AI = 0, AE = Symbol->getNumberOfAuxSymbols(); AI < AE; ++AI, ++SI) {
655 if (Symbol->isSectionDefinition()) {
656 const coff_aux_section_definition *asd;
657 error(coff->getAuxSymbol<coff_aux_section_definition>(SI + 1, asd));
659 int32_t AuxNumber = asd->getNumber(Symbol->isBigObj());
662 << format("scnlen 0x%x nreloc %d nlnno %d checksum 0x%x "
663 , unsigned(asd->Length)
664 , unsigned(asd->NumberOfRelocations)
665 , unsigned(asd->NumberOfLinenumbers)
666 , unsigned(asd->CheckSum))
667 << format("assoc %d comdat %d\n"
668 , unsigned(AuxNumber)
669 , unsigned(asd->Selection));
670 } else if (Symbol->isFileRecord()) {
671 const char *FileName;
672 error(coff->getAuxSymbol<char>(SI + 1, FileName));
674 StringRef Name(FileName, Symbol->getNumberOfAuxSymbols() *
675 coff->getSymbolTableEntrySize());
676 outs() << "AUX " << Name.rtrim(StringRef("\0", 1)) << '\n';
678 SI = SI + Symbol->getNumberOfAuxSymbols();
680 } else if (Symbol->isWeakExternal()) {
681 const coff_aux_weak_external *awe;
682 error(coff->getAuxSymbol<coff_aux_weak_external>(SI + 1, awe));
684 outs() << "AUX " << format("indx %d srch %d\n",
685 static_cast<uint32_t>(awe->TagIndex),
686 static_cast<uint32_t>(awe->Characteristics));
688 outs() << "AUX Unknown\n";