diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-04-27 18:44:28 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-04-27 18:44:28 +0000 |
commit | 046e306d9551e341450ab22b1563d624a28ac3e7 (patch) | |
tree | 5c4caf78474243f02c437cddd80f6e64f9ee9c9a | |
parent | 746126662fdc60bcd4e3deb3bf1e7210a85a0134 (diff) |
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/branches/gcc-8-branch@259721 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libgo/go/cmd/go/internal/work/buildid.go | 12 |
1 files changed, 9 insertions, 3 deletions
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")) { |