This is an archive of the discontinued LLVM Phabricator instance.

[DWARFv5][DWARFLinker] Remove dsymutil-classic compatibility feature as it leads to an error.
ClosedPublic

Authored by avl on Jun 28 2023, 9:35 AM.

Details

Summary

DWARFLinker has a compatibility feature with dsymutil-classic.
It may keep location expression attribute even if does not
reference live address. Current llvm-dwarfdump --verify
reports a error if variable references an address but is not
added into the .debug_names table.

error: Name Index @ 0x0: Entry for DIE @ 0xf35 (DW_TAG_variable) with name seed missing.

DW_TAG_variable

DW_AT_name      ("seed")
DW_AT_type      (0x00000000000047b7 "uint64_t")
DW_AT_location  (DW_OP_addr 0x9ff8)  <<<< dead address

DWARFLinker does not add the variable into .debug_names table
because it references dead address. To have a valid variable and
consistent accelerator table it is necessary to remove location expression
referencing dead address. This patch removes dsymutil-classic
compatibilty feature.

Diff Detail

Event Timeline

avl created this revision.Jun 28 2023, 9:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 9:35 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
avl requested review of this revision.Jun 28 2023, 9:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 9:35 AM
JDevlieghere accepted this revision.Jun 28 2023, 10:21 AM

LGTM

llvm/include/llvm/DWARFLinker/DWARFLinker.h
595–601
This revision is now accepted and ready to land.Jun 28 2023, 10:21 AM
fdeazeve added inline comments.Jun 28 2023, 11:30 AM
llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
99

The phrasing here is slightly broken.

Maybe something like: "Is this a variable with a location attribute referencing address?"

avl added a comment.Jun 29 2023, 6:46 AM

Thank you for the review. Will update comments in the committed patch.