[PATCH] D41052: [LLD] [MinGW] Don't pass -dynamicbase:no by default for arm/arm64
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 9 13:52:56 PST 2017
mstorsjo created this revision.
Herald added subscribers: kristof.beyls, aemerson.
The linker refuses (since https://reviews.llvm.org/D41051) using -dynamicbase:no on these architectures.
https://reviews.llvm.org/D41052
Files:
MinGW/Driver.cpp
test/MinGW/driver.test
Index: test/MinGW/driver.test
===================================================================
--- test/MinGW/driver.test
+++ test/MinGW/driver.test
@@ -95,6 +95,9 @@
RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix DEFAULT-DISABLE-FLAGS %s
DEFAULT-DISABLE-FLAGS: -dynamicbase:no
+RUN: ld.lld -### -m thumb2pe foo.o | FileCheck -check-prefix NO-DEFAULT-DISABLE-FLAGS %s
+RUN: ld.lld -### -m arm64pe foo.o | FileCheck -check-prefix NO-DEFAULT-DISABLE-FLAGS %s
+NO-DEFAULT-DISABLE-FLAGS-NOT: -dynamicbase:no
# The extra '-' in the following check pattern is intentional, to make sure
# that a check for "-dynamicbase" doesn't match the default "-dynamicbase:no".
Index: MinGW/Driver.cpp
===================================================================
--- MinGW/Driver.cpp
+++ MinGW/Driver.cpp
@@ -159,7 +159,9 @@
if (Args.hasArg(OPT_large_address_aware))
Add("-largeaddressaware");
- Add(Args.hasArg(OPT_dynamicbase) ? "-dynamicbase" : "-dynamicbase:no");
+ if (Args.getLastArgValue(OPT_m) != "thumb2pe" &&
+ Args.getLastArgValue(OPT_m) != "arm64pe")
+ Add(Args.hasArg(OPT_dynamicbase) ? "-dynamicbase" : "-dynamicbase:no");
if (Args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false))
Add("-opt:ref");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41052.126282.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171209/af751980/attachment.bin>
More information about the llvm-commits
mailing list