Skip to content

Commit

Permalink
Merge commit '21a6dbd400ff' from llvm.org/main into next
Browse files Browse the repository at this point in the history
  • Loading branch information
git apple-llvm automerger committed Dec 20, 2024
2 parents bccede9 + 21a6dbd commit 5eb76de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lld/COFF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2727,8 +2727,10 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
createECExportThunks();

// Resolve remaining undefined symbols and warn about imported locals.
while (ctx.symtab.resolveRemainingUndefines())
run();
ctx.forEachSymtab([&](SymbolTable &symtab) {
while (symtab.resolveRemainingUndefines())
run();
});

if (errorCount())
return;
Expand Down
13 changes: 13 additions & 0 deletions lld/test/COFF/arm64x-symtab.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-windows sym.s -o sym-x86_64.obj
// RUN: llvm-mc -filetype=obj -triple=aarch64-windows symref.s -o symref-aarch64.obj
// RUN: llvm-mc -filetype=obj -triple=arm64ec-windows symref.s -o symref-arm64ec.obj
// RUN: llvm-mc -filetype=obj -triple=x86_64-windows symref.s -o symref-x86_64.obj
// RUN: llvm-lib -machine:arm64x -out:sym.lib sym-aarch64.obj sym-arm64ec.obj

// Check that native object files can't reference EC symbols.
Expand All @@ -15,6 +16,18 @@
// UNDEF: lld-link: error: undefined symbol: sym
// UNDEF-NEXT: >>> referenced by symref-aarch64.obj:(.data)

// Check that EC object files can't reference native symbols.

// RUN: not lld-link -machine:arm64x -dll -noentry -out:out.dll symref-arm64ec.obj sym-aarch64.obj \
// RUN: 2>&1 | FileCheck --check-prefix=UNDEFEC %s
// UNDEFEC: lld-link: error: undefined symbol: sym
// UNDEFEC-NEXT: >>> referenced by symref-arm64ec.obj:(.data)

// RUN: not lld-link -machine:arm64x -dll -noentry -out:out.dll symref-x86_64.obj sym-aarch64.obj \
// RUN: 2>&1 | FileCheck --check-prefix=UNDEFX86 %s
// UNDEFX86: lld-link: error: undefined symbol: sym
// UNDEFX86-NEXT: >>> referenced by symref-x86_64.obj:(.data)

// RUN: not lld-link -machine:arm64x -dll -noentry -out:err2.dll symref-aarch64.obj sym-x86_64.obj \
// RUN: 2>&1 | FileCheck --check-prefix=UNDEF %s

Expand Down

0 comments on commit 5eb76de

Please sign in to comment.