[PATCH] D31362: [llvm-readobj] Prefer ILT to IAT for reading COFF imports

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 10:22:30 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL298812: [llvm-readobj] Prefer ILT to IAT for reading COFF imports (authored by smeenai).

Changed prior to commit:
  https://reviews.llvm.org/D31362?vs=93028&id=93077#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31362

Files:
  llvm/trunk/tools/llvm-readobj/COFFDumper.cpp


Index: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
+++ llvm/trunk/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 ILTAddr;
+    error(I.getImportLookupTableRVA(ILTAddr));
+    W.printHex("ImportLookupTableRVA", ILTAddr);
+    uint32_t IATAddr;
+    error(I.getImportAddressTableRVA(IATAddr));
+    W.printHex("ImportAddressTableRVA", IATAddr);
+    // The import lookup table can be missing with certain older linkers, so
+    // fall back to the import address table in that case.
+    if (ILTAddr)
+      printImportedSymbols(I.lookup_table_symbols());
+    else
+      printImportedSymbols(I.imported_symbols());
   }
 
   // Delay imports


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31362.93077.patch
Type: text/x-patch
Size: 1124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170326/c76acb85/attachment.bin>


More information about the llvm-commits mailing list