Commit d0a978f5 authored by Alex Brainman's avatar Alex Brainman

cmd/link: reorder pe sections

dwarf writing code assumes that dwarf sections follow
.data and .bss, not .ctors. Make pe section writing code
match that assumption.

For #10776.

Change-Id: I128c3ad125f7d0db19e922f165704a054b2af7ba
Reviewed-on: https://go-review.googlesource.com/36980Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 6db4d92e
......@@ -1196,14 +1196,16 @@ func Asmbpe(ctxt *Link) {
b.Characteristics = IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE | IMAGE_SCN_ALIGN_32BYTES
b.PointerToRawData = 0
bsssect = pensect
c = addinitarray(ctxt)
}
if !*FlagS {
dwarfaddpeheaders(ctxt)
}
if Linkmode == LinkExternal {
c = addinitarray(ctxt)
}
Cseek(int64(nextfileoff))
if Linkmode != LinkExternal {
addimports(ctxt, d)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment