]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: directly get max pc value in findfunctab
authorXia Bin <snyh@snyh.org>
Mon, 19 Nov 2018 03:24:12 +0000 (11:24 +0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 19 Nov 2018 22:06:10 +0000 (22:06 +0000)
Change-Id: I70afd2f7b6783926174c4e66565b711cffeb97c5
Reviewed-on: https://go-review.googlesource.com/c/150141
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/pcln.go

index 3eb3d058824f79400acb09d2ea2533e68896c883..ba098611c084e49b603a2c124398f66d3a3a00ff 100644 (file)
@@ -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.