Merging r327562: ------------------------------------------------------------------------ r327562 | mstorsjo | 2018-03-14 22:17:24 +0200 (Wed, 14 Mar 2018) | 1 line [MinGW] Add support for the GNU ld flag --kill-at ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/lld/branches/release_60@332084 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/MinGW/Driver.cpp b/MinGW/Driver.cpp index 6d3bea5..0b7e083 100644 --- a/MinGW/Driver.cpp +++ b/MinGW/Driver.cpp
@@ -154,6 +154,8 @@ Add("-debug:dwarf"); if (Args.hasArg(OPT_large_address_aware)) Add("-largeaddressaware"); + if (Args.hasArg(OPT_kill_at)) + Add("-kill-at"); if (Args.getLastArgValue(OPT_m) != "thumb2pe" && Args.getLastArgValue(OPT_m) != "arm64pe" && !Args.hasArg(OPT_dynamicbase))
diff --git a/MinGW/Options.td b/MinGW/Options.td index 34bf920..5baf6cb 100644 --- a/MinGW/Options.td +++ b/MinGW/Options.td
@@ -14,6 +14,7 @@ def gc_sections: F<"gc-sections">, HelpText<"Remove unused sections">; def icf: J<"icf=">, HelpText<"Identical code folding">; def image_base: S<"image-base">, HelpText<"Base address of the program">; +def kill_at: F<"kill-at">, HelpText<"Remove @n from exported symbols">; def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">, HelpText<"Root name of library to use">; def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
diff --git a/test/MinGW/driver.test b/test/MinGW/driver.test index 8bf70a9..45d19be 100644 --- a/test/MinGW/driver.test +++ b/test/MinGW/driver.test
@@ -124,3 +124,7 @@ RUN: ld.lld -### -m i386pep foo.o --icf=all | FileCheck -check-prefix ICF %s RUN: ld.lld -### -m i386pep foo.o -icf=all | FileCheck -check-prefix ICF %s ICF: -opt:icf + +RUN: ld.lld -### foo.o -m i386pe -shared --kill-at | FileCheck -check-prefix=KILL-AT %s +RUN: ld.lld -### foo.o -m i386pe -shared -kill-at | FileCheck -check-prefix=KILL-AT %s +KILL-AT: -kill-at