[lld] 2d0eb5d - [LLD][COFF] Add support for -includeglob on ARM64X (#129515)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 3 13:39:45 PST 2025


Author: Jacek Caban
Date: 2025-03-03T22:39:42+01:00
New Revision: 2d0eb5df4fb4e028e86310e631789b65cb009bf1

URL: https://github.com/llvm/llvm-project/commit/2d0eb5df4fb4e028e86310e631789b65cb009bf1
DIFF: https://github.com/llvm/llvm-project/commit/2d0eb5df4fb4e028e86310e631789b65cb009bf1.diff

LOG: [LLD][COFF] Add support for -includeglob on ARM64X (#129515)

Include symbols from both symbol tables.

Added: 
    

Modified: 
    lld/COFF/Driver.cpp
    lld/test/COFF/arm64x-includeoptional.s

Removed: 
    


################################################################################
diff  --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index b9bde9bb428e6..b60d93d45086e 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -2568,7 +2568,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
 
   // Handle /includeglob
   for (StringRef pat : args::getStrings(args, OPT_incl_glob))
-    ctx.symtab.addUndefinedGlob(pat);
+    ctx.forEachSymtab(
+        [&](SymbolTable &symtab) { symtab.addUndefinedGlob(pat); });
 
   // Create wrapped symbols for -wrap option.
   ctx.forEachSymtab([&](SymbolTable &symtab) {

diff  --git a/lld/test/COFF/arm64x-includeoptional.s b/lld/test/COFF/arm64x-includeoptional.s
index bf02075d96779..63b1e89082797 100644
--- a/lld/test/COFF/arm64x-includeoptional.s
+++ b/lld/test/COFF/arm64x-includeoptional.s
@@ -11,6 +11,9 @@
 // RUN: llvm-readobj --hex-dump=.test %t.dll | FileCheck %s
 // CHECK: 0x180004000 01000000 01000000
 
+// RUN: lld-link -machine:arm64x -dll -noentry -out:%t-glob.dll %t-test.lib -includeglob:sym
+// RUN: llvm-readobj --hex-dump=.test %t-glob.dll | FileCheck %s
+
         .globl sym
         .section .test,"dr"
 sym:


        


More information about the llvm-commits mailing list