+ Sym.SimpleType = COFF::SymbolBaseType(Symbol.getBaseType());
+ Sym.ComplexType = COFF::SymbolComplexType(Symbol.getComplexType());
+ Sym.Header.StorageClass = Symbol.getStorageClass();
+ Sym.Header.Value = Symbol.getValue();
+ Sym.Header.SectionNumber = Symbol.getSectionNumber();
+ Sym.Header.NumberOfAuxSymbols = Symbol.getNumberOfAuxSymbols();
+
+ if (Symbol.getNumberOfAuxSymbols() > 0) {
+ ArrayRef<uint8_t> AuxData = Obj.getSymbolAuxData(Symbol);
+ if (Symbol.isFunctionDefinition()) {
+ // This symbol represents a function definition.
+ assert(Symbol.getNumberOfAuxSymbols() == 1 &&
+ "Expected a single aux symbol to describe this function!");
+
+ const object::coff_aux_function_definition *ObjFD =
+ reinterpret_cast<const object::coff_aux_function_definition *>(
+ AuxData.data());
+ dumpFunctionDefinition(&Sym, ObjFD);
+ } else if (Symbol.isFunctionLineInfo()) {
+ // This symbol describes function line number information.
+ assert(Symbol.getNumberOfAuxSymbols() == 1 &&
+ "Expected a single aux symbol to describe this function!");
+
+ const object::coff_aux_bf_and_ef_symbol *ObjBES =
+ reinterpret_cast<const object::coff_aux_bf_and_ef_symbol *>(
+ AuxData.data());
+ dumpbfAndEfLineInfo(&Sym, ObjBES);
+ } else if (Symbol.isAnyUndefined()) {
+ // This symbol represents a weak external definition.
+ assert(Symbol.getNumberOfAuxSymbols() == 1 &&
+ "Expected a single aux symbol to describe this weak symbol!");
+
+ const object::coff_aux_weak_external *ObjWE =
+ reinterpret_cast<const object::coff_aux_weak_external *>(
+ AuxData.data());
+ dumpWeakExternal(&Sym, ObjWE);
+ } else if (Symbol.isFileRecord()) {
+ // This symbol represents a file record.
+ Sym.File = StringRef(reinterpret_cast<const char *>(AuxData.data()),
+ Symbol.getNumberOfAuxSymbols() *
+ Obj.getSymbolTableEntrySize())
+ .rtrim(StringRef("\0", /*length=*/1));
+ } else if (Symbol.isSectionDefinition()) {
+ // This symbol represents a section definition.
+ assert(Symbol.getNumberOfAuxSymbols() == 1 &&
+ "Expected a single aux symbol to describe this section!");
+
+ const object::coff_aux_section_definition *ObjSD =
+ reinterpret_cast<const object::coff_aux_section_definition *>(
+ AuxData.data());
+ dumpSectionDefinition(&Sym, ObjSD, Symbol.isBigObj());
+ } else if (Symbol.isCLRToken()) {
+ // This symbol represents a CLR token definition.
+ assert(Symbol.getNumberOfAuxSymbols() == 1 &&
+ "Expected a single aux symbol to describe this CLR Token!");
+
+ const object::coff_aux_clr_token *ObjCLRToken =
+ reinterpret_cast<const object::coff_aux_clr_token *>(
+ AuxData.data());
+ dumpCLRTokenDefinition(&Sym, ObjCLRToken);
+ } else {
+ llvm_unreachable("Unhandled auxiliary symbol!");
+ }
+ }