1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib/Object
Martin Storsjo 5e8195f9a7 [COFF] Add a ResourceSectionRef method for getting resource contents
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
2019-08-30 06:55:49 +00:00
..
Archive.cpp [llvm-ar] Fix support for archives with members larger than 4GB 2019-07-23 14:44:21 +00:00
ArchiveWriter.cpp [llvm-ar] Fix support for archives with members larger than 4GB 2019-07-23 14:44:21 +00:00
Binary.cpp [Object] Add tapi files to object 2019-08-21 23:30:53 +00:00
CMakeLists.txt [Object] Add tapi files to object 2019-08-21 23:30:53 +00:00
COFFImportFile.cpp [llvm-dlltool] Respect NONAME keyword 2019-05-22 09:49:54 +00:00
COFFModuleDefinition.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
COFFObjectFile.cpp [COFF] Add a ResourceSectionRef method for getting resource contents 2019-08-30 06:55:49 +00:00
Decompressor.cpp Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>" 2019-08-14 11:10:11 +00:00
ELF.cpp [Object/ELF.h] - Improve error reporting. 2019-07-05 11:28:49 +00:00
ELFObjectFile.cpp [llvm-objdump] Add the missing ARMv8 subarch detection 2019-08-28 06:37:22 +00:00
Error.cpp [Object] isNotObjectErrorInvalidFileType: simplify 2019-07-13 09:28:33 +00:00
IRObjectFile.cpp Recommit [Object] Change object::SectionRef::getContents() to return Expected<StringRef> 2019-05-16 13:24:04 +00:00
IRSymtab.cpp [ELF] Implement Dependent Libraries Feature 2019-05-17 03:44:15 +00:00
LLVMBuild.txt [Object] Add tapi files to object 2019-08-21 23:30:53 +00:00
MachOObjectFile.cpp [yaml2obj/obj2yaml][MachO] Allow setting custom section data 2019-08-20 08:49:07 +00:00
MachOUniversal.cpp [Object] Add public MaxSectionAlignment to MachOUniversal 2019-07-25 00:29:13 +00:00
Minidump.cpp Minidump: Add support for the MemoryList stream 2019-05-16 15:17:30 +00:00
ModuleSymbolTable.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Object.cpp Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>" 2019-08-14 11:10:11 +00:00
ObjectFile.cpp [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
RecordStreamer.cpp [AsmPrinter] Remove hidden flag -print-schedule. 2019-02-04 12:51:26 +00:00
RecordStreamer.h [AsmPrinter] Remove hidden flag -print-schedule. 2019-02-04 12:51:26 +00:00
RelocationResolver.cpp [BPF] Fix bpf llvm-objdump issues. 2019-08-17 22:12:00 +00:00
SymbolicFile.cpp [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
SymbolSize.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TapiFile.cpp [Object] FIX: update PlatformKind name in TapiFile 2019-08-21 23:57:57 +00:00
TapiUniversal.cpp [Object] Add tapi files to object 2019-08-21 23:30:53 +00:00
WasmObjectFile.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
WindowsMachineFlag.cpp Share /machine: handling code with llvm-cvtres too 2019-06-12 11:32:43 +00:00
WindowsResource.cpp Be explicit about Windows coff name trailing character policy 2019-08-21 07:54:42 +00:00
XCOFFObjectFile.cpp [XCOFF][AIX] Generate symbol table entries with llvm-readobj 2019-08-27 18:54:46 +00:00