Skip to content

Commit

Permalink
cmd/go: correct gccgo buildid file on ARM
Browse files Browse the repository at this point in the history
The GNU assembler for ARM treats @ as a comment character, so section
types must be written using % instead.

Fixes https://gcc.gnu.org/PR87260.

Change-Id: I5461e4bf5b20793db321f540c7f25a9e6e12b6f4
Reviewed-on: https://go-review.googlesource.com/135297
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
  • Loading branch information
ianlancetaylor committed Sep 14, 2018
1 parent 16687a3 commit a708353
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cmd/go/internal/work/buildid.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,12 @@ func (b *Builder) gccgoBuildIDELFFile(a *Action) (string, error) {
}
fmt.Fprintf(&buf, "\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")
secType := "@progbits"
if cfg.Goarch == "arm" {
secType = "%progbits"
}
fmt.Fprintf(&buf, "\t"+`.section .note.GNU-stack,"",%s`+"\n", secType)
fmt.Fprintf(&buf, "\t"+`.section .note.GNU-split-stack,"",%s`+"\n", secType)
}

if cfg.BuildN || cfg.BuildX {
Expand Down

0 comments on commit a708353

Please sign in to comment.