This is an archive of the discontinued LLVM Phabricator instance.

[DWARFLinker][DWARFv5] Support debug_loclists.
ClosedPublic

Authored by avl on Mar 9 2023, 3:23 AM.

Details

Summary

This patch adds support of DWARFv5 .debug_loclists table.
As DWARFLinker resolves relocations, it is able to always
use DW_FORM_addr instead of DW_FORM_addrx. DW_FORM_addrx
helps to minimize number of relocations, it is also used for
split DWARF. Both of these cases are not relevant for the
DWARFLinker. Thus, this patch converts all DW_FORM_addrx
forms into the DW_FORM_addr. And, as the result, it converts
location lists of DW_FORM_loclistx form into the DW_FORM_sec_offset.
For the --update case all DW_FORM_addrx, DW_FORM_loclistx
are preserved as is.

Depends On D145499

Diff Detail

Event Timeline

avl created this revision.Mar 9 2023, 3:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 3:23 AM
avl requested review of this revision.Mar 9 2023, 3:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 3:23 AM
avl added a reviewer: friss.Mar 9 2023, 7:51 AM
aprantl accepted this revision.Mar 14 2023, 5:39 PM

Mechanically, this patch looks great to me. @JDevlieghere, do you have any high-level concerns?

This revision is now accepted and ready to land.Mar 14 2023, 5:39 PM
JDevlieghere accepted this revision.Mar 14 2023, 9:39 PM

LGTM modulo some nits in the comments.

llvm/include/llvm/DWARFLinker/DWARFLinker.h
133
136
142
752
llvm/lib/DWARFLinker/DWARFLinker.cpp
1789

Other warnings start with a capital.

llvm/lib/DWARFLinker/DWARFStreamer.cpp
544
avl added a comment.Mar 15 2023, 3:26 AM

Thank you for the review!

This revision was automatically updated to reflect the committed changes.
llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-loclists.test