mirror of
https://github.com/golang/go
synced 2024-11-19 05:24:42 -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:
parent
a51daac840
commit
811167e2c9
@ -1343,8 +1343,6 @@ func (ctxt *Link) hostlink() {
|
|||||||
if ctxt.HeadType == objabi.Hdarwin {
|
if ctxt.HeadType == objabi.Hdarwin {
|
||||||
argv = append(argv, "-dynamiclib")
|
argv = append(argv, "-dynamiclib")
|
||||||
} else {
|
} else {
|
||||||
// ELF.
|
|
||||||
argv = append(argv, "-Wl,-Bsymbolic")
|
|
||||||
if ctxt.UseRelro() {
|
if ctxt.UseRelro() {
|
||||||
argv = append(argv, "-Wl,-z,relro")
|
argv = append(argv, "-Wl,-z,relro")
|
||||||
}
|
}
|
||||||
@ -1357,6 +1355,8 @@ func (ctxt *Link) hostlink() {
|
|||||||
// Pass -z nodelete to mark the shared library as
|
// Pass -z nodelete to mark the shared library as
|
||||||
// non-closeable: a dlclose will do nothing.
|
// non-closeable: a dlclose will do nothing.
|
||||||
argv = append(argv, "-Wl,-z,nodelete")
|
argv = append(argv, "-Wl,-z,nodelete")
|
||||||
|
// Only pass Bsymbolic on non-Windows.
|
||||||
|
argv = append(argv, "-Wl,-Bsymbolic")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case BuildModeShared:
|
case BuildModeShared:
|
||||||
|
Loading…
Reference in New Issue
Block a user