[dsymutil] Fix double relocation of DW_AT_call_return_pc
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 14 Feb 2020 01:39:29 +0000 (17:39 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 14 Feb 2020 01:42:48 +0000 (17:42 -0800)
commit5feb80e748924606531ba28c97fe65145c65372e
treed224046fdf9124affbb629a9553d7de10c68edc0
parentec89335c47bf316b6a43055343ea55a0a72a1953
[dsymutil] Fix double relocation of DW_AT_call_return_pc

When the DW_AT_call_return_pc matches a relocation, the call return pc
would get relocated twice, once because of the relocation in the object
file and once because of dsymutil. The same problem exists for the low
and high PC and the fix is the same. We remember the low, high and
return pc of the original DIE and relocate that, rather than the
potentially already relocated value.

Reviewed offline by Fred Riss.
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/tools/dsymutil/Inputs/private/tmp/call_return_pc/call [new file with mode: 0755]
llvm/test/tools/dsymutil/Inputs/private/tmp/call_return_pc/call.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/call-site-entry-reloc.test [new file with mode: 0644]