The linker refuses using -dynamicbase:no on these architectures.
Stop passing -dynamicbase (which just reinforces the lld-link
default) for simplicity.
Differential Revision: https://reviews.llvm.org/D41052
llvm-svn: 320518
GNU ld doesn't seem to support --icf at all, but this was suggested
in D39885, and GNU gold seems to support it.
Differential Revision: https://reviews.llvm.org/D40019
llvm-svn: 318283
All of these are disabled by default in GNU ld, but enabled by default
in lld.
Disable dynamicbase by default since it potentially could cause
compatibility issues, but just ignore the others since the lld
default should be fine for most concievable cases.
Differential Revision: https://reviews.llvm.org/D40017
llvm-svn: 318281
In GNU ld, this option is only available on i386, not on x86_64
(where it's enabled by default with no option to disable it either).
Differential Revision: https://reviews.llvm.org/D40015
llvm-svn: 318280
Previously, the COFF driver would call exit(0) when called
as a library. Now it takes `ExitEarly` option, and if it
is false, it doesn't exit. So it is now more library-friendly.
Furthermore, link() calls freeArena() before returning, to
clean up resources.
Based on an Andrew Kelley's patch.
Differential Revision: https://reviews.llvm.org/D39202
llvm-svn: 316370
Arg instances can be claimed. After claimed, its `isClaimed` function
returns true. We do not use that notion in lld, so using NoClaim
versions of functions is just confusing. This patch is to just use
hasArg instead of hasArgNoClaim.
llvm-svn: 313187
There are no alises handled by this switch, but getUnaliasesdOption is
preferred way of doing this. This is also consistent with ELF and COFF.
llvm-svn: 313180
This is how the flag is documented in GNU binutils ld; -Bstatic
only applies to -l options after it, until the next -Bdynamic.
Differential Revision: https://reviews.llvm.org/D37794
llvm-svn: 313175
In MinGW configurations (GCC, or clang with a *-windows-gnu target),
the -export directives in the object file contains the undecorated
symbol name, while it is decorated in MSVC configurations. (On the
command line, link.exe takes an undecorated symbol name for the
-export argument though.)
Differential Revision: https://reviews.llvm.org/D37772
llvm-svn: 313174
On i386, the --entry parameter to GNU ld is supposed to be a decorated
symbol name, while it is an undecorated name in link.exe.
Differential Revision: https://reviews.llvm.org/D37710
llvm-svn: 313066
This adds support for passing LTO flags to the MINGW driver
in GNU LD style i.e. -mllvm flag -> /mllvm:flag
Reviewers: ruiu, mstorsjo
Differential Revision: https://reviews.llvm.org/D37712
llvm-svn: 312956
Pass the -verbose option through to the COFF linker, and show the
arguments passed to it. If the -### option is specified, just show
the produced argument list and exit, just like in clang.
Replace the first argument with "lld-link" in order to produce a
correct command line.
Differential Revision: https://reviews.llvm.org/D37706
llvm-svn: 312944
Summary:
In addition to removing a few global variables and functions, I believe
this patch improves code readability a bit in general.
Reviewers: mstorsjo, martell
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37699
llvm-svn: 312940
When building COFF programs many targets such as mingw prefer
to have a gnu ld frontend. Rather then having a fully fledged
standalone driver we wrap a shim around the LINK driver.
Extra tests were provided by mstorsjo
Reviewers: mstorsjo, ruiu
Differential Revision: https://reviews.llvm.org/D33880
llvm-svn: 312926