diff options
| author | Heschi Kreinick <heschi@google.com> | 2018-06-19 15:39:17 -0400 |
|---|---|---|
| committer | Heschi Kreinick <heschi@google.com> | 2018-06-19 22:13:43 +0000 |
| commit | 83515df3f31cc70eab2ea4af77e675cabe1eefd5 (patch) | |
| tree | 28780aa543ea36a8caecc3cb00d5b4e25ac59ebe /src | |
| parent | 500293d8dce663dafea7482f06a6c828faf4e88b (diff) | |
| download | go-83515df3f31cc70eab2ea4af77e675cabe1eefd5.tar.xz | |
cmd/link: enable DWARF compression on Windows
Simple follow-on to CL 118276. Everything worked except that the
compressed sections need to be aligned at PEFILEALIGN.
Fixes #25927
Updates #11799
Change-Id: Iec871defe30e3e66055d64a5ae77d5a7aca355f5
Reviewed-on: https://go-review.googlesource.com/119816
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/link/internal/ld/dwarf.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 3824dc3c2a..1dd45969c7 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -1951,7 +1951,7 @@ func dwarfaddelfsectionsyms(ctxt *Link) { // relocations are applied. After this, dwarfp will contain a // different (new) set of symbols, and sections may have been replaced. func dwarfcompress(ctxt *Link) { - if !ctxt.IsELF || ctxt.LinkMode == LinkExternal { + if !(ctxt.IsELF || ctxt.HeadType == objabi.Hwindows) || ctxt.LinkMode == LinkExternal { return } @@ -1998,6 +1998,10 @@ func dwarfcompress(ctxt *Link) { log.Fatalf("%s: unexpected sub-symbols", s) } pos += uint64(s.Size) + if ctxt.HeadType == objabi.Hwindows { + pos = uint64(Rnd(int64(pos), PEFILEALIGN)) + } + } Segdwarf.Length = pos - Segdwarf.Vaddr } |
