[PATCH] D53469: [DWARF] Use a function-local offset for AT_call_return_pc

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 21 13:32:22 PST 2019


dblaikie added subscribers: labath, probinson, dblaikie.
dblaikie added a comment.
Herald added a project: LLVM.

Am I mistaken, or is this non-conforming? The attribute has form DW_FORM_addr, but doesn't contain an address, it contains an offset relative to the start of the function?

While this conveniently avoids a relocation, it doesn't seem right. (it looks especially weird when you see DW_FORM_addr in a .dwo file where there can be no relocations, etc)

I think this would need something in the spec to support relative return_pc (perhaps the same way high_pc is spec'd? ("If the value of the DW_AT_high_pc is of class address, it is the address of the first location past the last instruction associated with the entity; if it is of class constant, the value is an unsigned integer offset which when added to the low PC gives the address of the first location past the last instruction associated with the entity" - in fact some generalization of that language could somewhat sidestep my "addr+offset" form request - if low_pc and return_pc got the language "if it's a constant, it's relative to the subprogram's low_pc" or relative to the nearest enclosing scope low_pc? (neither of those is perfectly satisfying though - with Propeller producing basic block sections, addresses within a function might not be relative to the start of the function (they might be relative to one of the floating basic block sections)... ))

(tagging the usual suspects - @aprantl @JDevlieghere @probinson @labath )


Repository:
  rL LLVM

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

https://reviews.llvm.org/D53469





More information about the llvm-commits mailing list