cmd/link: default generic ABI compression for ELF

This CL change all debug dwarf headers to generic ABI
"Compression header" for ELF
(http://www.sco.com/developers/gabi/latest/ch4.sheader.html#compression_header)

Fixes #50796

Change-Id: I188625e596f11cd120dbd802ac2d79341d5eaf41
Reviewed-on: https://go-review.googlesource.com/c/go/+/380755
Trust: mzh <mzh@golangcn.org>
Run-TryBot: mzh <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Meng Zhuo 2022-01-26 10:23:48 +08:00 committed by mzh
parent 6e49c592de
commit d34287a4f6
7 changed files with 71 additions and 11 deletions

View file

@ -1477,7 +1477,7 @@ func (ctxt *Link) hostlink() {
argv = append(argv, unusedArguments)
}
const compressDWARF = "-Wl,--compress-debug-sections=zlib-gnu"
const compressDWARF = "-Wl,--compress-debug-sections=zlib"
if ctxt.compressDWARF && linkerFlagSupported(ctxt.Arch, argv[0], altLinker, compressDWARF) {
argv = append(argv, compressDWARF)
}