[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
Mon Dec 11 23:06:49 PST 2017
mstorsjo updated this revision to Diff 126504.
mstorsjo edited the summary of this revision.
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
@@ -93,14 +93,14 @@
RUN: ld.lld -### -m i386pep foo.o --large-address-aware | FileCheck -check-prefix LARGE-ADDRESS-AWARE %s
LARGE-ADDRESS-AWARE: -largeaddressaware
+RUN: ld.lld -### -m i386pe foo.o | FileCheck -check-prefix DEFAULT-DISABLE-FLAGS %s
RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix DEFAULT-DISABLE-FLAGS %s
DEFAULT-DISABLE-FLAGS: -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".
-RUN: ld.lld -### -m i386pep foo.o --dynamicbase | FileCheck -check-prefix DYNAMICBASE %s
-RUN: ld.lld -### -m i386pep foo.o -dynamicbase | FileCheck -check-prefix DYNAMICBASE %s
-DYNAMICBASE: -dynamicbase -
+RUN: ld.lld -### -m i386pe --dynamicbase foo.o | FileCheck -check-prefix NO-DEFAULT-DISABLE-FLAGS %s
+RUN: ld.lld -### -m i386pep -dynamicbase foo.o | FileCheck -check-prefix NO-DEFAULT-DISABLE-FLAGS %s
+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
RUN: ld.lld -### -m i386pep foo.o --image-base 0x1230000 | FileCheck -check-prefix IMAGE-BASE %s
RUN: ld.lld -### -m i386pep foo.o -image-base 0x1230000 | FileCheck -check-prefix IMAGE-BASE %s
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" && !Args.hasArg(OPT_dynamicbase))
+ Add("-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.126504.patch
Type: text/x-patch
Size: 2086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/74b45261/attachment.bin>
More information about the llvm-commits
mailing list