From 3d72ca9908ba2696e1acafa7d7f8fee21131fe5e Mon Sep 17 00:00:00 2001 From: Xia Bin Date: Mon, 19 Nov 2018 11:24:12 +0800 Subject: [PATCH] cmd/link: directly get max pc value in findfunctab Change-Id: I70afd2f7b6783926174c4e66565b711cffeb97c5 Reviewed-on: https://go-review.googlesource.com/c/150141 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/pcln.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go index 3eb3d05882..ba098611c0 100644 --- a/src/cmd/link/internal/ld/pcln.go +++ b/src/cmd/link/internal/ld/pcln.go @@ -520,10 +520,8 @@ func (ctxt *Link) findfunctab() { // find min and max address min := ctxt.Textp[0].Value - max := int64(0) - for _, s := range ctxt.Textp { - max = s.Value + s.Size - } + lastp := ctxt.Textp[len(ctxt.Textp)-1] + max := lastp.Value + lastp.Size // for each subbucket, compute the minimum of all symbol indexes // that map to that subbucket. -- 2.50.0