This is an archive of the discontinued LLVM Phabricator instance.

[PDB] read/dump fixups from PDB dbi stream
Needs ReviewPublic

Authored by jackoalan on Jul 1 2020, 5:48 PM.

Details

Summary

Binaries linked with /DEBUGTYPE:CV,FIXUP have a fixup substream present in the generated PDB's dbi.
This is essentially the equivalent of GCC's --emit-relocs. The fixup stream contains a list of all static
relocations performed by the linker. Each fixup entry uses the XFIXUP_DATA structure found in the cvdump
reference implementation.

Changes to llvm-pdbutil's dump tool can dump this information with -fixups or -all. The DbiStream public
API provides access to this stream array for tools that may be interested in cross-referencing symbols with
their usages.

Diff Detail

Event Timeline

jackoalan created this revision.Jul 1 2020, 5:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 5:48 PM
jackoalan added a comment.EditedJul 1 2020, 6:01 PM

I'd like some input on whether or not to include fixup dumping in the -all option. Relocations can quickly become numerous in a moderately complex binary.

On the other hand, fixups aren't included in binaries with default linker options, so it's reasonable to assume if the PDB includes these, the developer is interested in accessing them.