When fixing up relocations in PropagateLoaderChangesToSymbols, don't
reallocate the target sym.Symbol relocation slice if it already has
the desired size (this gets rid of some unneeded allocations).
Change-Id: I05287772c18cab861c2df805fa9497103fb00dcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/224420
Reviewed-by: Jeremy Faller <jeremy@golang.org>
s := l.Syms[cand]
relocs := l.Relocs(cand)
rslice = relocs.ReadAll(rslice)
- s.R = make([]sym.Reloc, len(rslice))
+ if len(s.R) != len(rslice) {
+ s.R = make([]sym.Reloc, len(rslice))
+ }
l.convertRelocations(rslice, s, true)
}