mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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:
parent
c144a94b26
commit
c7c72378a3
1 changed files with 2 additions and 3 deletions
|
|
@ -1444,7 +1444,6 @@ func (ctxt *Link) dodata() {
|
||||||
state.makeRelroForSharedLib(ctxt)
|
state.makeRelroForSharedLib(ctxt)
|
||||||
|
|
||||||
// Sort symbols.
|
// Sort symbols.
|
||||||
var dataMaxAlign [sym.SXREF]int32
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
for symn := range state.data {
|
for symn := range state.data {
|
||||||
symn := sym.SymKind(symn)
|
symn := sym.SymKind(symn)
|
||||||
|
|
@ -1459,8 +1458,8 @@ func (ctxt *Link) dodata() {
|
||||||
if ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal {
|
if ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal {
|
||||||
// These symbols must have the same alignment as their section.
|
// These symbols must have the same alignment as their section.
|
||||||
// Otherwize, ld might change the layout of Go sections.
|
// Otherwize, ld might change the layout of Go sections.
|
||||||
ctxt.Syms.ROLookup("runtime.data", 0).Align = dataMaxAlign[sym.SDATA]
|
ctxt.Syms.ROLookup("runtime.data", 0).Align = state.dataMaxAlign[sym.SDATA]
|
||||||
ctxt.Syms.ROLookup("runtime.bss", 0).Align = dataMaxAlign[sym.SBSS]
|
ctxt.Syms.ROLookup("runtime.bss", 0).Align = state.dataMaxAlign[sym.SBSS]
|
||||||
}
|
}
|
||||||
|
|
||||||
state.allocateSections(ctxt)
|
state.allocateSections(ctxt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue