This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil][DWARFv5] fix DW_FORM_addrx attribute offset calculation.
ClosedPublic

Authored by avl on Aug 25 2022, 4:26 AM.

Details

Summary

DWARFLinker::DIECloner::cloneAddressAttribute() contains call to
relocateIndexedAddr(StartOffset, EndOffset). StartOffset is
incorrectly calculated. Val.getRawUValue() is an index into the
.debug_addr table, so it should be multiplied
by Unit.getOrigUnit().getAddressByteSize().

Diff Detail

Event Timeline

avl created this revision.Aug 25 2022, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 4:26 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
avl requested review of this revision.Aug 25 2022, 4:26 AM
Herald added a project: Restricted Project. · View Herald Transcript

Looks good to me, but I will let the dsymutil maintainers give the approval.

This revision is now accepted and ready to land.Aug 25 2022, 4:51 PM
avl added a comment.Aug 26 2022, 5:22 AM

@clayborg @JDevlieghere Thank you for the review!

llvm/test/tools/dsymutil/X86/dwarf5-addrx.test