[PATCH] D140478: [RISCV] For Dwarf v5, emit indices into .debug_addr for range list entries

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 22:09:30 PST 2023


dblaikie added a comment.

>> What does it mean for it to be per-function? Can it vary at all between functions in the same module? (if not, why is it per-function?)
>
> It governs whether or not that function's text relocations are paired with R_RISCV_RELAX to tell the linker it can relax them.

OK, then it seems reasonable that this be handled for DWARF on a per-function basis. We shouldn't use an addr+addr representation for a function that won't change size at link time (equally `needRelocSymbolsForAddrRange` couldn't provide the right answer if it's not implemented per-function, right? Which Function does it consider? If it's not looking at the right function it might conclude there's no linker relaxation for the whole module, when one function does have relaxation)

If a label pair doesn't have enough info (you can get the relaxation from the MCSection, retrievable from the MCSymbol? Or is it a function of using a different kind of instruction or relocation (so not a property of the section or symbol) - in which case, the dwarf emission code could keep the MachineFunction or similar for each address range, then that could be passed into the callback and queried to determine if relaxation is enabled)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140478



More information about the llvm-commits mailing list