mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 23:36:40 +00:00
[LLD][COFF] Pull _load_config_used symbol from both symbol tables on ARM64X (#122837)
This commit is contained in:
parent
3bb969f3eb
commit
80084e9cb6
@ -2571,9 +2571,12 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
|
||||
ctx.symtab.addLibcall(s);
|
||||
}
|
||||
|
||||
// Windows specific -- if __load_config_used can be resolved, resolve it.
|
||||
if (ctx.symtab.findUnderscore("_load_config_used"))
|
||||
ctx.symtab.addGCRoot(ctx.symtab.mangle("_load_config_used"));
|
||||
ctx.forEachSymtab([&](SymbolTable &symtab) {
|
||||
// Windows specific -- if __load_config_used can be resolved, resolve
|
||||
// it.
|
||||
if (symtab.findUnderscore("_load_config_used"))
|
||||
symtab.addGCRoot(symtab.mangle("_load_config_used"));
|
||||
});
|
||||
|
||||
if (args.hasArg(OPT_include_optional)) {
|
||||
// Handle /includeoptional
|
||||
|
@ -7,6 +7,7 @@
|
||||
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows loadconfig-ec.s -o loadconfig-ec.obj
|
||||
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows loadconfig-short.s -o loadconfig-short.obj
|
||||
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows loadconfig-short.s -o loadconfig-short-arm64ec.obj
|
||||
// RUN: llvm-lib -machine:arm64x -out:loadconfig.lib loadconfig.obj loadconfig-ec.obj
|
||||
|
||||
// RUN: lld-link -machine:arm64x -out:out-warn.dll -dll -noentry test.obj \
|
||||
// RUN: 2>&1 | FileCheck --check-prefixes=WARN-LOADCFG,WARN-EC-LOADCFG %s
|
||||
@ -158,6 +159,10 @@
|
||||
// BASERELOC-NEXT: Address: 0x2074
|
||||
// BASERELOC-NEXT: }
|
||||
|
||||
// RUN: lld-link -machine:arm64x -out:out-hyb-lib.dll -dll -noentry loadconfig.lib chpe.obj test.obj
|
||||
// RUN: llvm-readobj --coff-load-config out-hyb-lib.dll | FileCheck --check-prefix=LOADCFG %s
|
||||
// RUN: llvm-readobj --coff-basereloc out-hyb-lib.dll | FileCheck --check-prefix=BASERELOC %s
|
||||
|
||||
#--- test.s
|
||||
.data
|
||||
sym:
|
||||
|
Loading…
x
Reference in New Issue
Block a user