cmd/go: correct gccgo buildid file on ARM
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 14 Sep 2018 19:42:01 +0000 (19:42 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 14 Sep 2018 19:42:01 +0000 (19:42 +0000)
    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.

    Reviewed-on: https://go-review.googlesource.com/135360

From-SVN: r264330

gcc/go/gofrontend/MERGE
libgo/go/cmd/go/internal/work/buildid.go

index d801077bf0ccc882a447d4238dc67155fe5c5f3d..3af5bd412675b6acda8e1b0c45daa3384e3b6a13 100644 (file)
@@ -1,4 +1,4 @@
-3fd61802286c81e5fb672f682d9e661181184d1f
+92a14213215fd93df7240fa9d376a1213b1d5a74
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 733938e0adebd5155ca53da8cd5fd3620d2a5628..c7c07ed0186971a3c4fca5e3e1784168d38e343d 100644 (file)
@@ -337,8 +337,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 {