• Austin Clements's avatar
    cmd/link: one DWARF compilation unit per package · d4dda76b
    Austin Clements authored
    Currently, the linker generates one huge DWARF compilation unit for
    the entire Go binary. This commit creates a separate compilation unit
    and line table per Go package.
    
    We temporarily lose compilation unit PC range information, since it's
    now discontiguous, so harder to emit. We'll bring it back in the next
    commit.
    
    Beyond being "more traditional", this has various technical
    advantages:
    
    * It should speed up line table lookup, since that requires a
      sequential scan of the line table. With this change, a debugger can
      first locate the per-package line table and then scan only that line
      table.
    
    * Once we emit compilation unit PC ranges again, this should also
      speed up various other debugger reverse PC lookups.
    
    * It puts us in a good position to move more DWARF generation into the
      compiler, which could produce at least the CU header, per-function
      line table fragments, and per-function frame unwinding info that the
      linker could simply paste together.
    
    * It will let us record a per-package compiler command-line flags
      (#22168).
    
    Change-Id: Ibac642890984636b3ef1d4b37fe97f4453c2cc84
    Reviewed-on: https://go-review.googlesource.com/69973
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
    Reviewed-by: 's avatarThan McIntosh <thanm@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    d4dda76b
Name
Last commit
Last update
..
objfile.go Loading commit data...