[PATCH] D82828: [ELF] Don't resolve a relocation in .debug_line referencing an ICF folded symbol to the tombstone value

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 09:12:20 PDT 2020


MaskRay added a comment.

In D82828#2122029 <https://reviews.llvm.org/D82828#2122029>, @jhenderson wrote:

> I think this is the right fix, but slightly for the wrong reasons. You're describing the problem as the confusing addresses for debuggers, whereas I'm saying it's the inability to set a breakpoint on a folded function's line that is the problem. The two are related but not quite the same. In the "confusing addresses" case, one way to fix it would be to update debuggers to recognise the tombstones and special-case them. That would be fine, except that it doesn't allow a user to set a breakpoint on lives that were folded in (i.e. my point). Hence, it's important to characterise this as "I want to be able to set breakpoints on folded-in functions".
>
> I've suggested comment changes inline to reflect this.


Thanks. Adopted.

> By the way, what about discarded COMDATs? They're similar in concept, but implemented differently, at least at the front-end, so might deserve their own test case?

Dead relocations in .debug_line due to non-prevailing COMDATs is not special cased like ICF. COMDATs usually have the same file:line (in a common .h) There is no loss of debugging experience.

In few cases two translation units may define a `inline` function in different places. In that case, we never have any GNU ld PRETEND logic (https://sourceware.org/pipermail/binutils/2020-June/111784.html ). Setting a breakpoint on a non-prevailing function never works. This patch doesn't change anything. This should already been clear in debug-dead-reloc.s, so I don't think an additional test for .debug_line is necessary.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82828





More information about the llvm-commits mailing list