llvm-project/llvm/test/tools/llvm-cvtres
Martin Storsjo 9438221785 [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
..
Inputs
combined.test [COFF] Add a ResourceSectionRef method for getting resource contents 2019-08-30 06:55:49 +00:00
duplicate.test
help.test Let writeWindowsResourceCOFF() take a TimeStamp parameter 2019-06-11 11:26:50 +00:00
machine.test [llvm-readobj] Change -long-option to --long-option in tests. NFC 2019-05-01 05:27:20 +00:00
object.test [COFF] Add a ResourceSectionRef method for getting resource contents 2019-08-30 06:55:49 +00:00
parse.test
symbols.test [llvm-readobj] Change -long-option to --long-option in tests. NFC 2019-05-01 05:27:20 +00:00
timestamp.test Let writeWindowsResourceCOFF() take a TimeStamp parameter 2019-06-11 11:26:50 +00:00