[PATCH] D41051: [LLD] [COFF] Disallow -dynamicbase:no for arm and arm64

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 11:39:54 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD320517: [COFF] Disallow -dynamicbase:no for arm and arm64 (authored by mstorsjo, committed by ).

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41051

Files:
  COFF/Driver.cpp
  test/COFF/arm64-dynamicbase.s
  test/COFF/armnt-dynamicbase.test


Index: test/COFF/arm64-dynamicbase.s
===================================================================
--- test/COFF/arm64-dynamicbase.s
+++ test/COFF/arm64-dynamicbase.s
@@ -0,0 +1,8 @@
+// REQUIRES: aarch64
+// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %s -o %t.obj
+// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no 2>&1 | FileCheck %s
+ .globl _start
+_start:
+ ret
+
+# CHECK: dynamicbase:no is not compatible with arm64
Index: test/COFF/armnt-dynamicbase.test
===================================================================
--- test/COFF/armnt-dynamicbase.test
+++ test/COFF/armnt-dynamicbase.test
@@ -0,0 +1,3 @@
+# RUN: yaml2obj < %p/Inputs/armnt-executable.obj.yaml > %t.obj
+# RUN: not lld-link /out:%t.exe /entry:mainCRTStartup /subsystem:console %t.obj /dynamicbase:no 2>&1 | FileCheck %s
+# CHECK: dynamicbase:no is not compatible with arm
Index: COFF/Driver.cpp
===================================================================
--- COFF/Driver.cpp
+++ COFF/Driver.cpp
@@ -1078,6 +1078,11 @@
       Config->is64() &&
       Args.hasFlag(OPT_highentropyva, OPT_highentropyva_no, true);
 
+  if (!Config->DynamicBase &&
+      (Config->Machine == ARMNT || Config->Machine == ARM64))
+    error("/dynamicbase:no is not compatible with " +
+          machineToStr(Config->Machine));
+
   // Handle /entry and /dll
   if (auto *Arg = Args.getLastArg(OPT_entry)) {
     Config->Entry = addUndefined(mangle(Arg->getValue()));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41051.126592.patch
Type: text/x-patch
Size: 1488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/8453f0f5/attachment.bin>


More information about the llvm-commits mailing list