[dev.link] cmd/link: fix buglet in dodata

Fix AIX build.

Change-Id: I5c0f1390a62c684bb0b162c3309902566cc6b025
Reviewed-on: https://go-review.googlesource.com/c/go/+/228477
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-04-15 21:55:35 -04:00
parent c144a94b26
commit c7c72378a3

View file

@ -1444,7 +1444,6 @@ func (ctxt *Link) dodata() {
state.makeRelroForSharedLib(ctxt)
// Sort symbols.
var dataMaxAlign [sym.SXREF]int32
var wg sync.WaitGroup
for symn := range state.data {
symn := sym.SymKind(symn)
@ -1459,8 +1458,8 @@ func (ctxt *Link) dodata() {
if ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal {
// These symbols must have the same alignment as their section.
// Otherwize, ld might change the layout of Go sections.
ctxt.Syms.ROLookup("runtime.data", 0).Align = dataMaxAlign[sym.SDATA]
ctxt.Syms.ROLookup("runtime.bss", 0).Align = dataMaxAlign[sym.SBSS]
ctxt.Syms.ROLookup("runtime.data", 0).Align = state.dataMaxAlign[sym.SDATA]
ctxt.Syms.ROLookup("runtime.bss", 0).Align = state.dataMaxAlign[sym.SBSS]
}
state.allocateSections(ctxt)