Skip to content

Commit 811167e

Browse files
committed
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 <[email protected]> Run-TryBot: Jason A. Donenfeld <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent a51daac commit 811167e

File tree

1 file changed

+2
-2
lines changed
  • src/cmd/link/internal/ld

1 file changed

+2
-2
lines changed

src/cmd/link/internal/ld/lib.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,6 @@ func (ctxt *Link) hostlink() {
13431343
if ctxt.HeadType == objabi.Hdarwin {
13441344
argv = append(argv, "-dynamiclib")
13451345
} else {
1346-
// ELF.
1347-
argv = append(argv, "-Wl,-Bsymbolic")
13481346
if ctxt.UseRelro() {
13491347
argv = append(argv, "-Wl,-z,relro")
13501348
}
@@ -1357,6 +1355,8 @@ func (ctxt *Link) hostlink() {
13571355
// Pass -z nodelete to mark the shared library as
13581356
// non-closeable: a dlclose will do nothing.
13591357
argv = append(argv, "-Wl,-z,nodelete")
1358+
// Only pass Bsymbolic on non-Windows.
1359+
argv = append(argv, "-Wl,-Bsymbolic")
13601360
}
13611361
}
13621362
case BuildModeShared:

0 commit comments

Comments
 (0)