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

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 03:57:16 PDT 2019


bd1976llvm added a comment.

<Trying again via phabricator rather than replying on the list.>

In D59553#1438602 <https://reviews.llvm.org/D59553#1438602>, @echristo wrote:

> Oh, and as far as dwarf aware linking I'd arguably prefer a separate tool ala dsymutil or dwz rather than incorporating it into the linker. I do agree that such a tool is incredibly useful and should be part of our ongoing development plan around debug info.


dwz looks great. I was unaware that it existed. Thanks!

Is GNU compatibility an issue? I did some research on this a while ago:

GOLD:
Stripping (gc-sections):
.debug_info   - patch low pc to 0
.debug_ranges - patch low address to 0 and high address to "size of function + 1".

Deduplication (icf):
.debug_info   - patch low pc to the address of the chosen function
.debug_ranges - patch the start and end addresses to the start and end addresses of the chosen
function

COMDATs:
.debug_info   - patch low pc to 0
.debug_ranges - patch the start and end addresses to the start and end addresses of the chosen
function

GNU LD:
Stripping (gc-sections):
.debug_info   - patch low pc to 0
.debug_ranges - patch the low and high address to 1 to make a size 0 range.

Deduplication (icf):
.debug_info   - N/A
.debug_ranges - N/A

COMDATs:
.debug_info   - patch low pc to 0
.debug_ranges - patch the start and end addresses to the start and end addresses of the chosen
function
 What does GDB make of -1/-2???


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list