mirror of
https://github.com/golang/go
synced 2024-10-04 21:11:22 -06:00
cmd/link: fix reordering of plt/rel
For the Solaris and S/390 builders. Change-Id: Id9a83e0df91e6d0df8488ec5e2a546ba8e2d800e Reviewed-on: https://go-review.googlesource.com/22327 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Michael Munday <munday@ca.ibm.com>
This commit is contained in:
parent
11f1041022
commit
9568d54fb8
@ -1863,16 +1863,16 @@ func dodataSect(symn int, syms []*LSym) []*LSym {
|
||||
}
|
||||
}
|
||||
if reli >= 0 && plti >= 0 && plti != reli+1 {
|
||||
newSyms := make([]*LSym, 0, len(syms))
|
||||
plt := syms[plti]
|
||||
newSyms = append(newSyms, syms[:reli+1]...)
|
||||
newSyms = append(newSyms, plt)
|
||||
newSyms = append(newSyms, syms[reli+1:plti]...)
|
||||
newSyms = append(newSyms, syms[plti+1:]...)
|
||||
if len(newSyms) != len(syms) {
|
||||
Diag("plt move failed: len %d/%d", len(newSyms), len(syms))
|
||||
var first, second int
|
||||
if plti > reli {
|
||||
first, second = reli, plti
|
||||
} else {
|
||||
first, second = plti, reli
|
||||
}
|
||||
syms = newSyms
|
||||
rel, plt := syms[reli], syms[plti]
|
||||
copy(syms[first+2:], syms[first+1:second])
|
||||
syms[first+0] = rel
|
||||
syms[first+1] = plt
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user