]> Cypherpunks repositories - gostls13.git/commit
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)
commitad55b878e7d5c641aec1c07bb549742e76c77208
tree82889c78ba6163ee8b107b72e4873c5c173bfc3c
parent3a7a528c2d7ee0c7b2988a7aee0b9347e973cbed
runtime/cgo: add .file directive to GNU assembly files

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