]> Cypherpunks repositories - gostls13.git/commit
cmd/link: support DWARF compression on Darwin
authorHeschi Kreinick <heschi@google.com>
Wed, 20 Jun 2018 20:45:25 +0000 (16:45 -0400)
committerHeschi Kreinick <heschi@google.com>
Fri, 22 Jun 2018 19:16:14 +0000 (19:16 +0000)
commit726a2d04ea457430d0ecfd8ee1e9ffebcb78e2f6
treed1210b1592c9886560870f531585666e6ec014af
parent3dced519cbabc213df369d9112206986e62687fa
cmd/link: support DWARF compression on Darwin

We want to compress DWARF even on macOS, but the native toolchain isn't
going to understand it. Add a flag that can be used to disable
compression, then add Darwin to the whitelist used during internal
linking.

Unlike GNU ld, the Darwin linker doesn't have a handy linker flag to do
compression. But since we're already doing surgery to put the DWARF in
the output executable in the first place, compressing it at the same
time isn't unduly difficult. This does have the slightly odd effect of
compressing some Apple proprietary debug sections, which absolutely
nothing will understand. Leaving them uncompressed didn't make much
sense, though, since I doubt they're useful without (say) __debug_info.

Updates #11799

Change-Id: Ie00b0215c630a798c59d009a641e2d13f0e7ea01
Reviewed-on: https://go-review.googlesource.com/120155
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/macho_combine_dwarf.go
src/cmd/link/internal/ld/main.go