This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwarfutil][DWARFv5] fix reading of DW_FORM_addrx attribute.
ClosedPublic

Authored by avl on Sep 5 2022, 9:30 AM.

Details

Summary

llvm::dwarfutil::ObjFileAddressMap::relocateIndexedAddr() does not
read address value. The relocateIndexedAddr() should not relocate
the address as the linked binary has already resolved relocations.
But it should read the value. This patch adds the reading value
of the address.

Diff Detail

Event Timeline

avl created this revision.Sep 5 2022, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 9:30 AM
Herald added a subscriber: emaste. · View Herald Transcript
avl requested review of this revision.Sep 5 2022, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 9:30 AM

Test probably doesn't need 8 functions? I'd think two would be enough to show the addresses are handled properly.
Could the test be YAML instead of binary? I know YAML doesn't handle DWARF very well so the answer might be "no."

avl updated this revision to Diff 459685.Sep 13 2022, 2:03 AM

addressed comments(converted test to yaml, reduced number of functions in test)

Looks good to me. I will let the DWARFLinker owners do the final approval.

This revision is now accepted and ready to land.Sep 22 2022, 6:59 AM
This revision was landed with ongoing or failed builds.Sep 23 2022, 12:20 AM
This revision was automatically updated to reflect the committed changes.