cmd/go: correct gccgo buildid file on ARM

Bring in https://golang.org/cl/135297 from the gc repository to fix a
GCC bug report.

Original CL description:

    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: Ia53be178254f4e28d7e2c51031f5deb12448a431
Reviewed-on: https://go-review.googlesource.com/135360
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/go/cmd/go/internal/work/buildid.go b/libgo/go/cmd/go/internal/work/buildid.go
index 733938e..c7c07ed 100644
--- a/libgo/go/cmd/go/internal/work/buildid.go
+++ b/libgo/go/cmd/go/internal/work/buildid.go
@@ -337,8 +337,12 @@
 	}
 	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 {