From 7afda0dfb6becb30df21bff01183c4d70f874dfb Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 27 Apr 2018 18:01:00 +0000 Subject: [PATCH] PR go/85429 cmd/go: add Solaris assembler syntax for gccgo buildid file The Solaris assembler uses a different syntax for section directives. This is https://golang.org/cl/109140 ported over to gccgo. Reviewed-on: https://go-review.googlesource.com/109141 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259719 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/cmd/go/internal/work/buildid.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a97408ab7e6..24592d26a10 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -7b37b9c3f9338a1387ee1e2301de89c3d2d87d2b +32861fd0acb0f3232f66be4791388b27e71c9990 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/cmd/go/internal/work/buildid.go b/libgo/go/cmd/go/internal/work/buildid.go index a08de26c823..7f1ee506329 100644 --- a/libgo/go/cmd/go/internal/work/buildid.go +++ b/libgo/go/cmd/go/internal/work/buildid.go @@ -309,7 +309,11 @@ func (b *Builder) gccgoBuildIDELFFile(a *Action) (string, error) { sfile := a.Objdir + "_buildid.s" var buf bytes.Buffer - fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n") + if cfg.Goos != "solaris" { + fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n") + } else { + fmt.Fprintf(&buf, "\t"+`.section ".go.buildid",#exclude`+"\n") + } fmt.Fprintf(&buf, "\t.byte ") for i := 0; i < len(a.buildID); i++ { if i > 0 { @@ -322,8 +326,10 @@ func (b *Builder) gccgoBuildIDELFFile(a *Action) (string, error) { fmt.Fprintf(&buf, "%#02x", a.buildID[i]) } fmt.Fprintf(&buf, "\n") - fmt.Fprintf(&buf, "\t"+`.section .note.GNU-stack,"",@progbits`+"\n") - fmt.Fprintf(&buf, "\t"+`.section .note.GNU-split-stack,"",@progbits`+"\n") + if cfg.Goos != "solaris" { + fmt.Fprintf(&buf, "\t"+`.section .note.GNU-stack,"",@progbits`+"\n") + fmt.Fprintf(&buf, "\t"+`.section .note.GNU-split-stack,"",@progbits`+"\n") + } if cfg.BuildN || cfg.BuildX { for _, line := range bytes.Split(buf.Bytes(), []byte("\n")) { -- 2.11.4.GIT