Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: DWARF data too large #5158

Closed
robpike opened this issue Mar 29, 2013 · 7 comments
Closed

cmd/link: DWARF data too large #5158

robpike opened this issue Mar 29, 2013 · 7 comments

Comments

@robpike
Copy link
Contributor

robpike commented Mar 29, 2013

At Go 1.1, roughly, this program:

package main

import (
    "fmt"
)

func main() {
    fmt.Println("hello")
}

compiled on linux/amd64 produces a 1.5MB binary, roughly half of which is debugging data
(the rest is mostly runtime text and data). That data seems to be expansive and args and
locals data for instance is written down twice, two different ways. It would also be
possible to avoid generating much of the detail for the runtime. It would also be
possible to compress the DWARF information.

We should spend some time making the binaries smaller.
@minux
Copy link
Member

minux commented Mar 30, 2013

Comment 1:

one possible solution, as discussed in issue #4735, is to make the runtime use
the dwarf data for backtrace so that we don't need to include two copies of
data for the same information (pc <-> file:line table, for example).
it will also give us more incentive to compact the dwarf sections.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 2:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/ld: DWARF data too large cmd/link: DWARF data too large Jun 8, 2015
@agnivade
Copy link
Contributor

I believe #6853 is the main umbrella issue for tracking work in binary size reduction. That should include work in reducing DWARF data. I think this can be closed.

@ianlancetaylor
Copy link
Contributor

On tip the binary is about 2M and the DWARF info is about 650K. The DWARF info is 32.5% of the executable size. So it looks like the executable size has gotten larger and the DWARF size has gotten smaller.

But we're still not compressing the debug info, which would be an easy win. I'm going to leave this open at least for that.

@ianlancetaylor
Copy link
Contributor

Actually, compressing debug info is #11799. Closing this one.

@golang golang locked and limited conversation to collaborators Dec 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants