]> Cypherpunks repositories - gostls13.git/commit
cmd/link: avoid use of -T when linking with lld
authorThan McIntosh <thanm@google.com>
Mon, 14 Dec 2020 18:03:06 +0000 (13:03 -0500)
committerThan McIntosh <thanm@google.com>
Fri, 18 Dec 2020 00:16:17 +0000 (00:16 +0000)
commit740851bacafd8e47b9a6ce0cd8fa8e05506a7382
tree662602714202735e24b5becac872f437031cddd7
parentf1778c28a9c6a898e9d78207847d61b189c49b5c
cmd/link: avoid use of -T when linking with lld

When doing external linking on Windows, auto-detect the linker flavor
(bfd vs gold vs lld) and when linking with "lld", avoid the use of
"-T" (linker script), since this option is not supported by lld.
[Note: the Go linker currently employs -T to ensure proper placement
of the .debug_gdb_scripts section, to work around issues in older
versions of binutils; LLD recognizes this section and does place it
properly].

Updates #39326.

Change-Id: I3ea79cdceef2316bf86eccdb60188ac3655264ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/278932
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/lib.go