From 076dc2111bd15476e03ee39d153bdd5a1fb0a3e8 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Wed, 8 Jul 2020 18:32:36 -0400 Subject: [PATCH] [dev.link] cmd/compile: make compiler-generated ppc64 TOC symbols static 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 Reviewed-by: Cherry Zhang TryBot-Result: Gobot Gobot --- src/cmd/internal/obj/ppc64/obj9.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 7135488f9d..16881c634b 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -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) }) -- 2.48.1