[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
Fri Mar 22 03:57:15 PDT 2019


probinson added a comment.

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

> In D59553#1437670 <https://reviews.llvm.org/D59553#1437670>, @probinson wrote:
>
> > @jhenderson  and I did a prototype of DWARF-unit-per-function last year, and I was not favorably impressed by the numbers. But maybe he still has the actual data kicking around somewhere.  We did not solve all the issues to our satisfaction before we ran out of time.
> >  I've also had chats with @bd1976llvm about fragmenting .debug_info per-function without wrapping everything in units; you get into requiring some section-order things but it saves the unit-per-function overhead.
>
>
> This is pretty much what I was talking about. You definitely don't need to do it as units if you're just including the concrete function. FWIW this is what I was talking about in the dwarf meeting where we talked about bringing units back into debug_info :)


And now I understand what you were saying back then!  Section fragments for concrete but strippable functions does make sense, given that the object file can be constructed in a way that the linker doesn't need to know anything special in order to form a syntactically correct unit.  Cross-fragment references need to be relocations not immediate, which is sad, but we get a size benefit in the end.



================
Comment at: lld/test/ELF/gc-sections-debuginfo.s:34
+# CHECK-NEXT: SectionData (
+# CHECK64-NEXT:   0000: FEFFFFFF FFFFFFFF                    |
+# CHECK32-NEXT:   0000: FEFFFFFF                     |
----------------
jhenderson wrote:
> grimar wrote:
> > Please remove the spaces after `...FFF` and `|` symbol, no need to test we print it here.
> It's worth noting that unless you are using FileCheck's --strict-whitespace, then all contiguous runs of whitespace, both in the pattern and the output, are treated as a single space, so this extra spacing has no effect currently either. If you want to be sure that the number ends when it does, with not output afterwards, you can also do something like `FFFF{{ }}` or `FFFF{{$}}` which will check that a space or end of line respectively follows immediately.
I disagree. Certainly for the 32-bit case we want to show that there is only a 32-bit value, and to do that we must check for something after the value. For consistency doing the same for the 64-bit case is appropriate.


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list