Commit 9568d54f authored by David Crawshaw's avatar David Crawshaw Committed by Michael Hudson-Doyle

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: default avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: default avatarMichael Munday <munday@ca.ibm.com>
parent 11f10410
......@@ -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
}
}
......
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