mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
cmd/link: consider alignment in carrier symbol size calculation
Currently, when we calculate the size of a carrier symbol, we use the previous symbol's end address as the start. But the symbol actually starts after applying the alignment. Do this in the size calculation. Should fix AIX build. Updates #53372. Change-Id: I17942b1fe8027dce12b78c8e8c80ea6cebcee240 Reviewed-on: https://go-review.googlesource.com/c/go/+/412734 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
bcce8ef498
commit
1d9d99b7ce
|
@ -1854,6 +1854,9 @@ func (state *dodataState) allocateDataSections(ctxt *Link) {
|
|||
}
|
||||
for _, symn := range sym.ReadOnly {
|
||||
symnStartValue := state.datsize
|
||||
if len(state.data[symn]) != 0 {
|
||||
symnStartValue = aligndatsize(state, symnStartValue, state.data[symn][0])
|
||||
}
|
||||
state.assignToSection(sect, symn, sym.SRODATA)
|
||||
setCarrierSize(symn, state.datsize-symnStartValue)
|
||||
if ctxt.HeadType == objabi.Haix {
|
||||
|
@ -1935,6 +1938,9 @@ func (state *dodataState) allocateDataSections(ctxt *Link) {
|
|||
|
||||
symn := sym.RelROMap[symnro]
|
||||
symnStartValue := state.datsize
|
||||
if len(state.data[symn]) != 0 {
|
||||
symnStartValue = aligndatsize(state, symnStartValue, state.data[symn][0])
|
||||
}
|
||||
|
||||
for _, s := range state.data[symn] {
|
||||
outer := ldr.OuterSym(s)
|
||||
|
|
Loading…
Reference in a new issue