]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/compile: make compiler-generated ppc64 TOC symbols static
authorThan McIntosh <thanm@google.com>
Wed, 8 Jul 2020 22:32:36 +0000 (18:32 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 8 Jul 2020 23:51:08 +0000 (23:51 +0000)
Set the AttrStatic flag on compiler-emitted TOC symbols for ppc64; these
symbols don't need to go into the final symbol table in Go binaries.
This fixes a buglet introduced by CL 240539 that was causing failures
on the aix builder.

Change-Id: If8b63bcf6d2791f1ec5a0c371d2d11e806202fd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/241637
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/internal/obj/ppc64/obj9.go

index 7135488f9d14170c8700d9bcfb6b5913fde7ff8d..16881c634b85250effe6ba4e6b4bd30b6918f70e 100644 (file)
@@ -142,6 +142,7 @@ func (c *ctxt9) rewriteToUseTOC(p *obj.Prog) {
                symtoc := c.ctxt.LookupInit("TOC."+sym.Name, func(s *obj.LSym) {
                        s.Type = objabi.SDATA
                        s.Set(obj.AttrDuplicateOK, true)
+                       s.Set(obj.AttrStatic, true)
                        c.ctxt.Data = append(c.ctxt.Data, s)
                        s.WriteAddr(c.ctxt, 0, 8, sym, 0)
                })
@@ -223,6 +224,7 @@ func (c *ctxt9) rewriteToUseTOC(p *obj.Prog) {
        symtoc := c.ctxt.LookupInit("TOC."+source.Sym.Name, func(s *obj.LSym) {
                s.Type = objabi.SDATA
                s.Set(obj.AttrDuplicateOK, true)
+               s.Set(obj.AttrStatic, true)
                c.ctxt.Data = append(c.ctxt.Data, s)
                s.WriteAddr(c.ctxt, 0, 8, source.Sym, 0)
        })