]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: add .file directive to GNU assembly files
authorCherry Mui <cherryyz@google.com>
Fri, 2 Dec 2022 18:34:03 +0000 (13:34 -0500)
committerCherry Mui <cherryyz@google.com>
Mon, 5 Dec 2022 16:41:48 +0000 (16:41 +0000)
Without it, at least on ARM64 with older BFD linker, it will
include the file of the object file (which is of a temporary path)
as a debug symbol into the binary, causing the build to be
nondeterministic. Adding a .file directive makes it to create a
STT_FILE symbol with deterministic input, and prevent the linker
creating one using the temporary object file path.

Fixes #57035.

Change-Id: I3ab716b240f60f7a891af2f7e10b467df67d1f31
Reviewed-on: https://go-review.googlesource.com/c/go/+/454838
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>

src/runtime/cgo/gcc_386.S
src/runtime/cgo/gcc_aix_ppc64.S
src/runtime/cgo/gcc_amd64.S
src/runtime/cgo/gcc_arm.S
src/runtime/cgo/gcc_arm64.S
src/runtime/cgo/gcc_linux_ppc64x.S
src/runtime/cgo/gcc_loong64.S
src/runtime/cgo/gcc_mips64x.S
src/runtime/cgo/gcc_mipsx.S
src/runtime/cgo/gcc_riscv64.S
src/runtime/cgo/gcc_s390x.S

index ff55b2cc6313255997d044222c20aedac56a1384..5e6d715ce2ff9d43e2ab2a14548e95d0698e4c8a 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_386.S"
+
 /*
  * Apple still insists on underscore prefixes for C function names.
  */
index a00fae24d219e05d2f2047d5c4eb0e71426b7b41..a77363ee25002b902ba784e04d593d6d9c58a503 100644 (file)
@@ -5,6 +5,8 @@
 // +build ppc64
 // +build aix
 
+.file "gcc_aix_ppc64.S"
+
 /*
  * void crosscall_ppc64(void (*fn)(void), void *g)
  *
index 46699d1d9ccaf10d7cc7b6486aa797041c9e6454..5a1629e28c403a0b90f1b12e60d7e50175db55b7 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_amd64.S"
+
 /*
  * Apple still insists on underscore prefixes for C function names.
  */
index fe1c48be3f863692dcf9931792ca8bcca15c0b29..6e8c14a28d86a4669b76c8d0a9df9b223d37d319 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_arm.S"
+
 /*
  * Apple still insists on underscore prefixes for C function names.
  */
index 9154d2aaf4196d0260b634da94ecb37859b7efb8..865f67c38f3150fc948892d17f0d316609adcaba 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_arm64.S"
+
 /*
  * Apple still insists on underscore prefixes for C function names.
  */
index 595eb38460904d0f25b2ab536b9cb40e624092d2..957ef3ab1bd3cf15aa219a7222b0599e60991473 100644 (file)
@@ -5,6 +5,8 @@
 // +build ppc64 ppc64le
 // +build linux
 
+.file "gcc_linux_ppc64x.S"
+
 /*
  * Apple still insists on underscore prefixes for C function names.
  */
index 100aa33cc2baf0d4fa9d60b977e39815da6eedf6..9947aa61e8371dfefbd9f784d83ccdeeefb11524 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_loong4.S"
+
 /*
  * void crosscall1(void (*fn)(void), void (*setg_gcc)(void *g), void *g)
  *
index 908dd2135c8b0f2f08cb5f14237ebf66b82eae14..ec24d7199c2204bc2f8c4a42e9925cb92bd65b9f 100644 (file)
@@ -4,6 +4,8 @@
 
 // +build mips64 mips64le
 
+.file "gcc_mips64x.S"
+
 /*
  * void crosscall1(void (*fn)(void), void (*setg_gcc)(void *g), void *g)
  *
index 54f4b8201a69fea9be5c85976d472c4459838c98..2867f6a0527749a864aa404eb5ac16b3ea68ce65 100644 (file)
@@ -4,6 +4,8 @@
 
 // +build mips mipsle
 
+.file "gcc_mipsx.S"
+
 /*
  * void crosscall1(void (*fn)(void), void (*setg_gcc)(void *g), void *g)
  *
index f429dc64ee69d7b86cd34a45f11687d3d0ef3634..8f07649c68b4ff5a97b8faecb70627c3eaca207e 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_riscv64.S"
+
 /*
  * void crosscall1(void (*fn)(void), void (*setg_gcc)(void *g), void *g)
  *
index 614de4b43b867f49230c3778756da5f0af2b4390..8bd30fedd3b4518c2b550504a06ccdaa8dcfc5b1 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+.file "gcc_s390x.S"
+
 /*
  * void crosscall_s390x(void (*fn)(void), void *g)
  *