File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -536,6 +536,15 @@ void SymbolTable::initializeLoadConfig() {
536536 auto sym =
537537 dyn_cast_or_null<DefinedRegular>(findUnderscore (" _load_config_used" ));
538538 if (!sym) {
539+ if (isEC ()) {
540+ Warn (ctx) << " EC version of '_load_config_used' is missing" ;
541+ return ;
542+ }
543+ if (ctx.hybridSymtab ) {
544+ Warn (ctx) << " native version of '_load_config_used' is missing for "
545+ " ARM64X target" ;
546+ return ;
547+ }
539548 if (ctx.config .guardCF != GuardCFLevel::Off)
540549 Warn (ctx)
541550 << " Control Flow Guard is enabled but '_load_config_used' is missing" ;
Original file line number Diff line number Diff line change 88// RUN: llvm-mc -filetype=obj -triple=aarch64-windows loadconfig-short.s -o loadconfig-short.obj
99// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows loadconfig-short.s -o loadconfig-short-arm64ec.obj
1010
11- // RUN: lld-link -machine:arm64x -out:out.dll -dll -noentry loadconfig.obj test.obj
11+ // RUN: lld-link -machine:arm64x -out:out-warn.dll -dll -noentry test.obj \
12+ // RUN: 2>&1 | FileCheck --check-prefixes=WARN-LOADCFG,WARN-EC-LOADCFG %s
13+ // WARN-LOADCFG: lld-link: warning: native version of '_load_config_used' is missing for ARM64X target
14+ // WARN-EC-LOADCFG: lld-link: warning: EC version of '_load_config_used' is missing
15+
16+ // RUN: lld-link -machine:arm64x -out:out-nonative.dll -dll -noentry loadconfig-ec.obj chpe.obj \
17+ // RUN: 2>&1 | FileCheck --check-prefixes=WARN-LOADCFG --implicit-check-not EC %s
18+
19+ // RUN: lld-link -machine:arm64ec -out:out-ec.dll -dll -noentry chpe.obj \
20+ // RUN: 2>&1 | FileCheck --check-prefixes=WARN-EC-LOADCFG --implicit-check-not native %s
21+
22+ // RUN: lld-link -machine:arm64x -out:out.dll -dll -noentry loadconfig.obj test.obj \
23+ // RUN: 2>&1 | FileCheck --check-prefixes=WARN-EC-LOADCFG --implicit-check-not native %s
1224
1325// RUN: llvm-readobj --coff-load-config out.dll | FileCheck --check-prefix=DYNRELOCS %s
1426// DYNRELOCS: DynamicValueRelocTableOffset: 0xC
You can’t perform that action at this time.
0 commit comments