This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Fix/improve printing WinEH unwind info for linked PE images
ClosedPublic

Authored by mstorsjo on Dec 10 2019, 2:14 PM.

Details

Summary

ARMWinEHPrinter was already designed to handle linked PE images (since d2941b43f40d), but resolving symbols didn't consistently take the image base into account (as linked images seldom have a symbol table, except for in MinGW setups).

Win64EHDumper wasn't really designed to handle linked images (it would crash if executed on such a file), but a few concepts (getSymbol, taking a virtual address instead of a relocation, and getSectionContaining for finding the section containing a certain virtual address) can be borrowed from ARMWinEHPrinter.

Adjust ARMWinEHPrinter to print the address of the exception handler routine as a VA instead of an RVA, consistently with other addresses in the same printout, and make Win64EHDumper print addresses similarly for image cases.

Diff Detail

Event Timeline

mstorsjo created this revision.Dec 10 2019, 2:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
mstorsjo edited the summary of this revision. (Show Details)Dec 10 2019, 2:15 PM
rnk accepted this revision.Dec 10 2019, 3:23 PM

lgtm

This revision is now accepted and ready to land.Dec 10 2019, 3:23 PM
This revision was automatically updated to reflect the committed changes.