Index: tools/llvm-readobj/COFFDumper.cpp =================================================================== --- tools/llvm-readobj/COFFDumper.cpp +++ tools/llvm-readobj/COFFDumper.cpp @@ -1439,12 +1439,18 @@ StringRef Name; error(I.getName(Name)); W.printString("Name", Name); - uint32_t Addr; - error(I.getImportLookupTableRVA(Addr)); - W.printHex("ImportLookupTableRVA", Addr); - error(I.getImportAddressTableRVA(Addr)); - W.printHex("ImportAddressTableRVA", Addr); - printImportedSymbols(I.imported_symbols()); + uint32_t ImportLookupTableAddr; + error(I.getImportLookupTableRVA(ImportLookupTableAddr)); + W.printHex("ImportLookupTableRVA", ImportLookupTableAddr); + uint32_t ImportAddressTableAddr; + error(I.getImportAddressTableRVA(ImportAddressTableAddr)); + W.printHex("ImportAddressTableRVA", ImportAddressTableAddr); + // The import lookup table can be missing with certain older linkers, so + // fall back to the import address table in that case. + if (ImportLookupTableAddr) + printImportedSymbols(I.lookup_table_symbols()); + else + printImportedSymbols(I.imported_symbols()); } // Delay imports