Skip to content

Commit 3321303

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Jeremy Faller <[email protected]>
1 parent 6f52790 commit 3321303

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/link/internal/ld/data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ func (ctxt *Link) textaddress() {
21772177

21782178
// merge tramps into Textp, keeping Textp in address order
21792179
if ntramps != 0 {
2180-
newtextp := make([]loader.Sym, 0, len(ctxt.Textp)+ntramps)
2180+
newtextp := make([]loader.Sym, 0, len(ctxt.Textp2)+ntramps)
21812181
i := 0
21822182
for _, s := range ctxt.Textp2 {
21832183
for ; i < ntramps && ldr.SymValue(ctxt.tramps[i]) < ldr.SymValue(s); i++ {

0 commit comments

Comments
 (0)