[PATCH] D62062: [DWARF][RISCV] Add support for RISC-V relocations needed for debug info

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 06:32:03 PDT 2019


luismarques created this revision.
luismarques added reviewers: asb, bkramer, HsiangKai, rogfer01, apazos.
Herald added subscribers: llvm-commits, benna, psnobl, PkmX, rkruppe, shiva0217, kito-cheng, aprantl.
Herald added a project: LLVM.

When code relaxation is enabled many RISC-V fixups are not resolved but instead relocations are emitted. This happens even for DWARF debug sections. Therefore, to properly support the parsing of DWARF debug info we need to be able to resolve RISC-V relocations. This patch adds:

- Support for RISC-V relocations in `RelocationResolver`
- DWARF support for two relocations per object file offset
- DWARF changes to support relocations in more DIE fields

The two relocations per offset change is needed because some RISC-V relocations (used for label differences) come in pairs.

Relocations can also be emitted for DWARF fields where relocations were not yet evaluated. Adding relocation support for some of these fields is essencial. On the other hand, LLVM currently emits RISC-V relocations for fixups that could be safely evaluated, since they can never be affected by code relaxations. This patch also adds relocation support for the fields affected by those extraneous relocations (the DWARF unit entry `Length`, and the DWARF debug line entry `TotalLength` and `PrologueLength`), for testing purposes. The current plan is to remove those three relocation support changes from the final patch, but that will depend on the merge of a patch to prevent the emission of the extraneous relocations (see for instance https://reviews.llvm.org/D61584).


Repository:
  rL LLVM

https://reviews.llvm.org/D62062

Files:
  include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
  lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  lib/DebugInfo/DWARF/DWARFFormValue.cpp
  lib/DebugInfo/DWARF/DWARFUnit.cpp
  lib/Object/RelocationResolver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62062.200025.patch
Type: text/x-patch
Size: 7162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190517/f5dab48e/attachment.bin>


More information about the llvm-commits mailing list