Skip to content

Commit 85d0fbe

Browse files
authored
[lld] Don't allow -dynamicbase:no on ARM64EC.
1 parent 26b2b5a commit 85d0fbe

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lld/COFF/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
21812181
args.hasFlag(OPT_highentropyva, OPT_highentropyva_no, true);
21822182

21832183
if (!config->dynamicBase &&
2184-
(config->machine == ARMNT || config->machine == ARM64))
2184+
(config->machine == ARMNT || isAnyArm64(config->machine)))
21852185
error("/dynamicbase:no is not compatible with " +
21862186
machineToStr(config->machine));
21872187

lld/test/COFF/arm64-dynamicbase.s

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// REQUIRES: aarch64
22
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows %s -o %t.obj
33
// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no 2>&1 | FileCheck %s
4+
5+
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.obj
6+
// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no -machine:arm64ec 2>&1 \
7+
// RUN: | FileCheck %s -check-prefix=ARM64EC
8+
// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no -machine:arm64x -dll -noentry 2>&1 \
9+
// RUN: | FileCheck %s -check-prefix=ARM64X
410
.globl _start
511
_start:
612
ret
713

814
# CHECK: dynamicbase:no is not compatible with arm64
15+
# ARM64EC: dynamicbase:no is not compatible with arm64ec
16+
# ARM64X: dynamicbase:no is not compatible with arm64x

0 commit comments

Comments
 (0)