-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/compile: use common DWARF prefixes? #20463
Comments
Stuffing package variables inside a struct would definitely break delve but nothing we couldn't fix. The maintainers of the gdb and lldb plugins should also be notified of this. However, IMHO this is a unnecessary stopgap solution if compression gets implemented. |
Does anyone cc'd here have time to look into compression for 1.10? I looked again yesterday but got stuck--I couldn't figure out whether it was supposed to happen at the DWARF level (some DWARF indicator that subsequent data was compressed) or at the file container level ("hey ELF, this section is compressed"). I ended up assuming the latter, and since I'm on a mac figured I'd start with mach-o, but I couldn't find mach-o support for compressed sections. This all came up for me again because I made an otherwise worthwhile compiler change that added a few kb to helloworld's TEXT and nothing to DATA, but the DWARF additions were so big that it increased helloworld's binary size by 5%. |
DWARF compression is done at the file container level. There are two ways to do it. The older way is to prefix the DWARF section name with a 'z', as in '.zdebug_info'. The newer way, which applies to sections of all types, not just DWARF sections, is to set the Clearly Mach-O doesn't support the A
|
Thanks, Ian! That's exactly what I needed to know. I might play with this next week, if no one beats me to it. |
Closing in favor of #11799. I've copied Ian's hints there. |
Run
dwarfdump helloworld
and look through. There's a lot of duplication in variable names, e.g.Note the common package prefix. Is there any way in DWARF to indicate that these are part of a shared structure called "runtime" (maybe even pretending that runtime is a C struct)? And there are bigger shared prefixes as well, like package+type for methods.
I believe that this would provide worthwhile binary size savings. Observe that of the 36 bytes that the "runtime.statictmp_4" entry consumes, 20 is from its name. This wouldn't matter as much if we fixed #11799, but it would still be worth doing.
@heschik @aarzilli @mdempsky
The text was updated successfully, but these errors were encountered: