Remove some extra sanity-checking code from the loader's RelocVariant
method, since it was yielding a slowdown of 1-2% linking kubernetes
hyperkube (once again a reminder that relocation processing is a very
performance-sensitive part of the linker).
Change-Id: Ifbc0662f3f96c5f54131103ce6f7439ecfb9b9dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/227477
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
// RelocVariant returns the 'variant' property of a relocation on
// some specific symbol.
func (l *Loader) RelocVariant(s Sym, ri int) sym.RelocVariant {
- if relocs := l.Relocs(s); ri >= relocs.Count() {
- panic("invalid relocation ID")
- }
return l.relocVariant[relocId{s, ri}]
}