This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][ARM] Fix incorrect debug information for RWPI accessed globals
ClosedPublic

Authored by labrinea on Oct 8 2021, 5:57 AM.

Details

Summary

When compiling for the RWPI relocation model [1], 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 [2] is R_ARM_ABS32 instead of R_ARM_SBREL32

References:
[1] ARM Read-Write Position Independence: https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#read-write-position-independence-rwpi
[2] ARM ELF32 relocation types: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#5612relocation-types

Diff Detail

Event Timeline

labrinea created this revision.Oct 8 2021, 5:57 AM
labrinea requested review of this revision.Oct 8 2021, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 5:57 AM

It may be worth adding to the description some links to the Procedure Call Standard for the Arm Architecute which describe RWPI:

labrinea edited the summary of this revision. (Show Details)Oct 12 2021, 2:59 AM
aprantl accepted this revision.Oct 15 2021, 11:18 AM

Looks reasonable.

This revision is now accepted and ready to land.Oct 15 2021, 11:18 AM
This revision was landed with ongoing or failed builds.Oct 18 2021, 1:30 PM
This revision was automatically updated to reflect the committed changes.