[PATCH] D59553: [LLD][ELF][DebugInfo] llvm-symbolizer shows incorrect source line info if --gc-sections used

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 12:58:50 PDT 2019


echristo added a comment.

In D59553#1436890 <https://reviews.llvm.org/D59553#1436890>, @probinson wrote:

> Does this do the right thing for a 32-bit target?  64-bit is common, but not universal.
>
> Re. the underlying DWARF issues:
>  I can't remember whether the DWARF committee has ever considered specifying a special value for "address does not exist" but I doubt it, because the DWARF spec states "If an entity has no associated machine code, none of these [address-related] attributes are specified." (DWARF v5 section 2.17, p.51.) So, the current position of the DWARF spec is that the linker is supposed to rewrite the DWARF, I guess.
>
> I can imagine a couple of ways to fix this in the DWARF spec, so that linkers can be allowed to strip entities without rewriting the DWARF, but you won't get that fix until DWARF v6 which has to be years in the future.  In the meantime using "-2" is probably the simplest hack.


Likely the best way to solve this would be to put the debug information for the rest of it in the same section group as the function. In particular the subprogram die for the concrete function should be in a section group along with the function. This was part of the considerations with bringing other things back into the debug_info section in dwarf5 as well.


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list