[DWARFLinker] Refactor cloneAddressAttribute().
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Thu, 2 Feb 2023 16:17:52 +0000 (17:17 +0100)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Mon, 13 Feb 2023 11:25:22 +0000 (12:25 +0100)
commit4c273cd071150912fd6f1e4aee12148cf78a6410
treec2deb6b00e2a7ce3083e274d28c2369c13ac4aad
parent30f515a9101da65de3ca32306c9de80fb16c9f92
[DWARFLinker] Refactor cloneAddressAttribute().

As a preparation for implementing DWARFv5 address ranges generation,
this patch refactors cloneAddressAttribute() method. It has special
handling for addresses which can be relocated in some unrelated value,
for applying relocations twice, for indexed addresses. Instead of
all these special handlings this patch uses general handling:

Read attribute value from InputDIE and apply PCOffset.

Another thing is that current handling of DW_FORM_addrx misses the
fact that relocations might be applied twice in some cases. This
patch fixes this problem also.

Differential Revision: https://reviews.llvm.org/D143269
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/tools/dsymutil/Inputs/call-dwarf5.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/dwarf5-call-site-entry-reloc.test [new file with mode: 0644]
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.h
llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp