]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj: remove LSym.Etext
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 15 Mar 2016 05:28:04 +0000 (22:28 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 16 Mar 2016 20:52:21 +0000 (20:52 +0000)
Use a local variable instead.

Passes toolstash -cmp.

Change-Id: I9623a40ff0d568f11afd1279b6aaa1c33eda644c
Reviewed-on: https://go-review.googlesource.com/20730
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/sizeof_test.go

index 835890d60185cdf836e25a293fa9f55114704c7e..cbf4bf4183df3d6df05aac647aee78eb3c3e65fd 100644 (file)
@@ -337,7 +337,6 @@ type LSym struct {
        Gotype *LSym
        Autom  *Auto
        Text   *Prog
-       Etext  *Prog
        Pcln   *Pcln
        P      []byte
        R      []Reloc
index 70c2d9d5f9439e759bfacf52493f896522c5f946..f782644d883a1c828627bf9aa78bfcee4771a3b5 100644 (file)
@@ -131,6 +131,7 @@ func flushplist(ctxt *Link, freeProgs bool) {
        // Ignore ctxt->plist boundaries. There are no guarantees there,
        // and the assemblers just use one big list.
        var curtext *LSym
+       var etext *Prog
        var text []*LSym
 
        for pl := ctxt.Plist; pl != nil; pl = pl.Link {
@@ -228,7 +229,7 @@ func flushplist(ctxt *Link, freeProgs bool) {
                                }
                                s.Type = STEXT
                                s.Text = p
-                               s.Etext = p
+                               etext = p
                                curtext = s
                                continue
 
@@ -247,11 +248,11 @@ func flushplist(ctxt *Link, freeProgs bool) {
                        }
 
                        if curtext == nil {
+                               etext = nil
                                continue
                        }
-                       s := curtext
-                       s.Etext.Link = p
-                       s.Etext = p
+                       etext.Link = p
+                       etext = p
                }
        }
 
@@ -293,7 +294,6 @@ func flushplist(ctxt *Link, freeProgs bool) {
                linkpcln(ctxt, s)
                if freeProgs {
                        s.Text = nil
-                       s.Etext = nil
                }
        }
 
index 28dbba888de4066f30fe3a88862c59810e29f91a..14bdbe20dc8c8deccd64599ebbf466381a8ea577 100644 (file)
@@ -23,7 +23,7 @@ func TestSizeof(t *testing.T) {
                _64bit uintptr     // size on 64bit platforms
        }{
                {Addr{}, 52, 80},
-               {LSym{}, 88, 152},
+               {LSym{}, 84, 144},
                {Prog{}, 196, 288},
        }