[PATCH] D130206: CodeGen: use address form for DW_AT_high_pc on RISCV

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 10:18:05 PDT 2022


compnerd added a comment.

In D130206#3666984 <https://reviews.llvm.org/D130206#3666984>, @MaskRay wrote:

> This does not fix the incompatibility with RISC-V linker relaxation. This changes DW_AT_high_pc from a length to (pre-DWARF-v4) an address.

Correct, this is not to fix the incompatibility with relaxation, it is to fix the compatibility with no relaxation and fission.

> The address needs to be relocated as well. The correct approach is to use .debug_addr indirection via DW_FORM_addrx.

Interesting, do we have any target currently using that form?

> This is useful with linker relaxation, though, as it can decrease the number of relocations.
>
> https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation#code-addresses I am going to revise some paragraphs about DWARF.

Yes, this should be able to reduce the number of relocations at the cost of debug info size.  However, given that we currently fail to emit the object file this seems like a good tradeoff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130206/new/

https://reviews.llvm.org/D130206



More information about the llvm-commits mailing list