I have spoken with Russ (off-list) regarding moving DWARF generation out of
the linker and into the compiler, and he expressed some hesitation in
moving in that direction, specifically his response was:
I would prefer not to move the DWARF code out of the linker, at least not
what's there today. In particular the file/line number tables are rewritten
by the linker to reflect the $GOROOT at the time of link, and that's
important for making binary distributions a bit more relocatable (within
the file system). Another problem is that Go's fine-grained dead code
elimination is not well aligned with DWARF's compilation units, unless you
make every declaration its own compilation unit. I think that the linker
will necessarily need to stay involved.
I admit I haven't had to time recently to fully think through solutions,
but unless we can address those concerns I would say that the best way
forward, at least for this cycle, would be to improve the information
provided to the linker from the compiler, and take a look at cleaning up
and potentially optimizing the DWARF code in the linker.
Otherwise, if we can come up with solutions to the above concerns I think
moving the generation into the compiler (specifically the new SSA back end)
would be the appropriate way to go, as it would prevent duplicate work
upfront (work to introduce new instructions to pass from compiler to
linker, etc) that would be removed if/when DWARF generation is moved into
Also, Ryan I responded to your off-list mail, but I am very interested in
helping with this work.
On Wednesday, February 24, 2016 at 11:01:39 AM UTC-8, Ryan Brown wrote:
I would like to work on improving the dwarf information generated for go
binaries. In particular I'd like to start with these issues:https://github.com/golang/go/issues/12899https://github.com/golang/go/issues/13949
I've looked at these both before and they require more information than is
currently available when generating dwarf.
My big question is, should I be trying to pass this information from the
compiler to the linker (presumably by adding new instructions), or are we
better off moving dwarf generation into the compiler?
Also I don't know anything about the new ssa backend. Does it support
dwarf at all? Does it use the same linker?
-- Ryan Brown
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.