forked from OSchip/llvm-project
9438221785
This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like it already does for plain .res files. This requires providing the whole COFFObjectFile to ResourceSectionRef. This supports both object files and executables. For executables, the DataRVA field is used as is to look up the right section. For object files, ideally we would need to complete linking of them and fix up all relocations to know what the DataRVA field would end up being. In practice, the only thing that makes sense for an RVA field is an ADDR32NB relocation. Thus, find a relocation pointing at this field, verify that it has the expected type, locate the symbol it points at, look up the section the symbol points at, and read from the right offset in that section. This works both for GNU windres object files (which use one single .rsrc section, with all relocations against the base of the .rsrc section, with the original value of the DataRVA field being the offset of the data from the beginning of the .rsrc section) and cvtres object files (with two separate .rsrc$01 and .rsrc$02 sections, and one symbol per data entry, with the original pre-relocated DataRVA field being set to zero). Differential Revision: https://reviews.llvm.org/D66820 llvm-svn: 370433 |
||
---|---|---|
.. | ||
ARMEHABIPrinter.h | ||
ARMWinEHPrinter.cpp | ||
ARMWinEHPrinter.h | ||
CMakeLists.txt | ||
COFFDumper.cpp | ||
COFFImportDumper.cpp | ||
DwarfCFIEHPrinter.h | ||
ELFDumper.cpp | ||
Error.cpp | ||
Error.h | ||
LLVMBuild.txt | ||
MachODumper.cpp | ||
ObjDumper.cpp | ||
ObjDumper.h | ||
StackMapPrinter.h | ||
WasmDumper.cpp | ||
Win64EHDumper.cpp | ||
Win64EHDumper.h | ||
WindowsResourceDumper.cpp | ||
WindowsResourceDumper.h | ||
XCOFFDumper.cpp | ||
llvm-readobj.cpp | ||
llvm-readobj.h |