diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-04-27 18:44:28 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-04-27 18:44:28 +0000 |
commit | 1ff66e706878453e881e1121771a1079e4540526 (patch) | |
tree | 5c4caf78474243f02c437cddd80f6e64f9ee9c9a | |
parent | 21cdb808372b58424def746d128deb99024b1489 (diff) |
re PR go/85429 (Several gotools tests FAIL with Solaris as)
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
From-SVN: r259721
-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")) { |