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

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 12:53:14 PDT 2019


probinson added a comment.

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.


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list