diff options
author | Than McIntosh <thanm@google.com> | 2021-06-03 14:50:10 -0400 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2021-06-03 19:38:56 +0000 |
commit | 6d9830111402d9bd69893a8ad6074ac92a5ddd0d (patch) | |
tree | b0d810c785f02bf6c1814b453fddd27d75247f86 | |
parent | e0d029f75846f84f79e63f6100c57047f4a3fa98 (diff) | |
download | go-6d9830111402d9bd69893a8ad6074ac92a5ddd0d.tar.gz go-6d9830111402d9bd69893a8ad6074ac92a5ddd0d.zip |
cmd/link: use correct alignment in PE DWARF sections
Set the correct section flags to insure that .debug_* sections are
using 1-byte alignment instead of the default. This seems to be
important for later versions of LLVM-mingw on windows (shows up on the
windows/arm64 builder).
Updates #46406.
Change-Id: I023d5208374f867552ba68b45011f7990159868f
Reviewed-on: https://go-review.googlesource.com/c/go/+/324763
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
-rw-r--r-- | src/cmd/link/internal/ld/pe.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/pe.go b/src/cmd/link/internal/ld/pe.go index 3540c07da1..8eb4231c3a 100644 --- a/src/cmd/link/internal/ld/pe.go +++ b/src/cmd/link/internal/ld/pe.go @@ -475,7 +475,7 @@ func (f *peFile) addDWARFSection(name string, size int) *peSection { off := f.stringTable.add(name) h := f.addSection(name, size, size) h.shortName = fmt.Sprintf("/%d", off) - h.characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_CNT_INITIALIZED_DATA + h.characteristics = IMAGE_SCN_ALIGN_1BYTES | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_CNT_INITIALIZED_DATA return h } |