[lld] [LLD][COFF] Add support for the -defArm64Native argument (PR #123850)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 07:58:46 PST 2025


================
@@ -2291,6 +2291,12 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
   if (auto *arg = args.getLastArg(OPT_deffile)) {
     // parseModuleDefs mutates Config object.
     mainSymtab.parseModuleDefs(arg->getValue());
+    if (ctx.hybridSymtab) {
+      // MSVC ignores the /defArm64Native argument on non-ARM64X targets.
+      // It is also ignored if the /def option is not specified.
+      if (auto *arg = args.getLastArg(OPT_defarm64native))
+        ctx.symtab.parseModuleDefs(arg->getValue());
----------------
cjacek wrote:

Yes, which symbol table is considered 'main' or 'primary' depends on the context. In the writer, the main one is `ctx.symtab`, as it’s directly referenced by the PE headers. Here, for lack of a better term, I meant the symbol table to which the main arguments should apply (though not all do yet). I'll add a comment for clarification.

https://github.com/llvm/llvm-project/pull/123850


More information about the llvm-commits mailing list