From 33213039e5d806f93a11561609c804cef7c065b3 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Thu, 7 May 2020 11:53:58 -0400 Subject: [PATCH] cmd/link: fix minor bug in trampoline insertion Fix a minor bug where it should use Textp2 instead of Textp. This doesn't affect correctness. It just made the pre-allocation less effective. Change-Id: Ib3fa8ab3c64037e3582933970d051f278286353b Reviewed-on: https://go-review.googlesource.com/c/go/+/232837 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Than McIntosh Reviewed-by: Jeremy Faller --- src/cmd/link/internal/ld/data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 162ef9ba4e..13ccb86a03 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -2177,7 +2177,7 @@ func (ctxt *Link) textaddress() { // merge tramps into Textp, keeping Textp in address order if ntramps != 0 { - newtextp := make([]loader.Sym, 0, len(ctxt.Textp)+ntramps) + newtextp := make([]loader.Sym, 0, len(ctxt.Textp2)+ntramps) i := 0 for _, s := range ctxt.Textp2 { for ; i < ntramps && ldr.SymValue(ctxt.tramps[i]) < ldr.SymValue(s); i++ { -- 2.50.0