[lld] Don't allow -dynamicbase:no on ARM64EC.

This commit is contained in:
Jacek Caban 2023-10-11 18:09:00 +02:00 committed by GitHub
parent 26b2b5a5ea
commit 85d0fbeaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -2181,7 +2181,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
args.hasFlag(OPT_highentropyva, OPT_highentropyva_no, true);
if (!config->dynamicBase &&
(config->machine == ARMNT || config->machine == ARM64))
(config->machine == ARMNT || isAnyArm64(config->machine)))
error("/dynamicbase:no is not compatible with " +
machineToStr(config->machine));

View File

@ -1,8 +1,16 @@
// 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
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %s -o %t.obj
// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no -machine:arm64ec 2>&1 \
// RUN: | FileCheck %s -check-prefix=ARM64EC
// RUN: not lld-link -entry:_start -subsystem:console %t.obj -out:%t.exe -dynamicbase:no -machine:arm64x -dll -noentry 2>&1 \
// RUN: | FileCheck %s -check-prefix=ARM64X
.globl _start
_start:
ret
# CHECK: dynamicbase:no is not compatible with arm64
# ARM64EC: dynamicbase:no is not compatible with arm64ec
# ARM64X: dynamicbase:no is not compatible with arm64x