1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:10:22 -07:00

cmd/link: do not pass -Bsymbolic for PE DLLs

This is only a valid option on ELF. Binutils accepts it, but LLVM
rejects it, so for Windows, it's best to just omit it.

Updates #44250.
Updates #39326.
Updates #38755.
Updates #36439.
Updates #43800.

Change-Id: Iffd2345d757f23dd737e63bd464cd412527077c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/291632
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Jason A. Donenfeld 2021-02-14 14:44:14 +01:00
parent a51daac840
commit 811167e2c9

View File

@ -1343,8 +1343,6 @@ func (ctxt *Link) hostlink() {
if ctxt.HeadType == objabi.Hdarwin {
argv = append(argv, "-dynamiclib")
} else {
// ELF.
argv = append(argv, "-Wl,-Bsymbolic")
if ctxt.UseRelro() {
argv = append(argv, "-Wl,-z,relro")
}
@ -1357,6 +1355,8 @@ func (ctxt *Link) hostlink() {
// Pass -z nodelete to mark the shared library as
// non-closeable: a dlclose will do nothing.
argv = append(argv, "-Wl,-z,nodelete")
// Only pass Bsymbolic on non-Windows.
argv = append(argv, "-Wl,-Bsymbolic")
}
}
case BuildModeShared: