llvm-project/llvm/tools/llvm-readobj
Shoaib Meenai 7375448893 [llvm-readobj] Prefer ILT to IAT for reading COFF imports
We're seeing binutils ld produce binaries where the import address
table's NameRVA entry is actually a VA instead (i.e. it's already base
relocated), which llvm-readobj then chokes on. Both dumpbin and the
Windows loader are able to handle these binaries correctly, however, and
we can make llvm-readobj handle them correctly too by iterating the
import lookup table (which doesn't have a relocated NameRVA) rather than
the import address table.

The import lookup table and the import address table are supposed to be
identical on disk, and prior to r277298 the import lookup table would be
used by `llvm-readobj -coff-imports` anyway, so this shouldn't have any
functional change (except in the case of our malformed binaries). The
import lookup table can apparently be missing when using old Borland
linkers, so fall back to the import address table in that case.

Resolves PR31766.

Differential Revision: https://reviews.llvm.org/D31362

llvm-svn: 298812
2017-03-26 17:10:11 +00:00
..
ARMEHABIPrinter.h [ELF] Convert ELF.h to Expected<T>. 2016-11-16 05:10:28 +00:00
ARMWinEHPrinter.cpp Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow 2016-06-24 18:24:42 +00:00
ARMWinEHPrinter.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
CMakeLists.txt [pdb] Add the ability to resolve TypeServer PDBs. 2017-02-16 23:35:45 +00:00
COFFDumper.cpp [llvm-readobj] Prefer ILT to IAT for reading COFF imports 2017-03-26 17:10:11 +00:00
COFFImportDumper.cpp llvm-readobj: Dump more info for COFF import libraries. 2015-08-28 10:27:50 +00:00
CodeView.h Silence gcc warning about ternary and enumerations 2016-01-28 23:59:35 +00:00
ELFDumper.cpp [AMDGPU] Restructure code object metadata creation 2017-03-22 22:32:22 +00:00
Error.cpp Remove LLVM_NOEXCEPT and replace it with noexcept 2016-10-19 23:52:38 +00:00
Error.h
LLVMBuild.txt [pdb] Add the ability to resolve TypeServer PDBs. 2017-02-16 23:35:45 +00:00
MachODumper.cpp Add LC_BUILD_VERSION load command 2017-01-23 20:07:55 +00:00
ObjDumper.cpp Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
ObjDumper.h [PDB] Split item and type records when merging type streams 2017-03-24 17:26:38 +00:00
StackMapPrinter.h [Stackmap] Added callsite counts to emitted function information. 2016-09-14 20:22:03 +00:00
WasmDumper.cpp Fix llvm-readobj build error after r293569 2017-01-30 23:58:51 +00:00
Win64EHDumper.cpp Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow 2016-06-24 18:24:42 +00:00
Win64EHDumper.h Move llvm-readobj/StreamWriter to Support. 2016-05-03 00:28:04 +00:00
llvm-readobj.cpp [PDB] Split item and type records when merging type streams 2017-03-24 17:26:38 +00:00
llvm-readobj.h [CodeView] Decouple record deserialization from visitor dispatch. 2016-08-05 21:45:34 +00:00