]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: iterate over Textp2 in stack check pass
authorCherry Zhang <cherryyz@google.com>
Thu, 5 Mar 2020 20:05:17 +0000 (15:05 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 6 Mar 2020 16:54:13 +0000 (16:54 +0000)
Implement a TODO in CL 220059, now that CL 220985 is in.

Change-Id: I7273a7b9e1e7c0b916780571c9c954da21366429
Reviewed-on: https://go-review.googlesource.com/c/go/+/222239
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/lib.go

index d88eb1fd169324bf01aca4cd9ec70cfea437a52e..7eea8a7dadc669ee7d44ef8e89e758ebb661233c 100644 (file)
@@ -2147,21 +2147,14 @@ func (ctxt *Link) dostkcheck() {
 
        // Check every function, but do the nosplit functions in a first pass,
        // to make the printed failure chains as short as possible.
-       // TODO: iterate over Textp
-       for s, n := loader.Sym(1), ldr.NSym(); int(s) < n; s++ {
-               if !ldr.AttrReachable(s) || ldr.SymType(s) != sym.STEXT {
-                       continue
-               }
+       for _, s := range ctxt.Textp2 {
                if ldr.IsNoSplit(s) {
                        ch.sym = s
                        sc.check(&ch, 0)
                }
        }
 
-       for s, n := loader.Sym(1), ldr.NSym(); int(s) < n; s++ {
-               if !ldr.AttrReachable(s) || ldr.SymType(s) != sym.STEXT {
-                       continue
-               }
+       for _, s := range ctxt.Textp2 {
                if !ldr.IsNoSplit(s) {
                        ch.sym = s
                        sc.check(&ch, 0)