-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[LLD][COFF] Add support for -includeglob on ARM64X #129515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Include symbols from both symbol tables.
Similar to |
@llvm/pr-subscribers-lld @llvm/pr-subscribers-platform-windows Author: Jacek Caban (cjacek) ChangesInclude symbols from both symbol tables. Full diff: https://github.com/llvm/llvm-project/pull/129515.diff 2 Files Affected:
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:
|
@llvm/pr-subscribers-lld-coff Author: Jacek Caban (cjacek) ChangesInclude symbols from both symbol tables. Full diff: https://github.com/llvm/llvm-project/pull/129515.diff 2 Files Affected:
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.
Include symbols from both symbol tables.