[DebugInfo][ARM] Fix incorrect debug information for RWPI accessed globals
authorAlexandros Lamprineas <alexandroslamprineas@Alexandross-MacBook-Air.local>
Mon, 18 Oct 2021 18:24:05 +0000 (19:24 +0100)
committerAlexandros Lamprineas <alexandroslamprineas@Alexandross-MacBook-Air.local>
Mon, 18 Oct 2021 20:29:46 +0000 (21:29 +0100)
commit04dc68710ad2b30a1d3b4a2ca33005af2c9460eb
tree84eda00fe374a818ff4656b52c22db24366b8255
parentb8ce97372d85ef0e6103ec8055fc5154f3bb5862
[DebugInfo][ARM] Fix incorrect debug information for RWPI accessed globals

When compiling for the RWPI relocation model the debug information is wrong:

* the debug location is described as { DW_OP_addr Var }
  instead of { DW_OP_constNu Var DW_OP_bregX 0 DW_OP_plus }
* the relocation type is R_ARM_ABS32 instead of R_ARM_SBREL32

Differential Revision: https://reviews.llvm.org/D111404
llvm/include/llvm/Target/TargetLoweringObjectFile.h
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/Target/ARM/ARMTargetObjectFile.cpp
llvm/lib/Target/ARM/ARMTargetObjectFile.h
llvm/test/DebugInfo/ARM/rwpi.ll [new file with mode: 0644]