[PATCH] D149022: [LLD][COFF] Print object file name for unsupported directives

Alvin Wong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 07:07:07 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9b15e9840f50: [LLD][COFF] Print object file name for unsupported directives (authored by alvinhochun).

Changed prior to commit:
  https://reviews.llvm.org/D149022?vs=516176&id=516398#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149022/new/

https://reviews.llvm.org/D149022

Files:
  lld/COFF/Driver.cpp
  lld/test/COFF/directives-unsupported.s


Index: lld/test/COFF/directives-unsupported.s
===================================================================
--- /dev/null
+++ lld/test/COFF/directives-unsupported.s
@@ -0,0 +1,15 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -triple=x86_64-windows %s -filetype=obj -o %t.obj
+
+# RUN: not lld-link -dll -out:%t.dll -entry:entry %t.obj -subsystem:console 2>&1 | FileCheck %s
+
+# CHECK: warning: ignoring unknown argument: -unknowndirectivename
+# CHECK: error: -unknowndirectivename is not allowed in .drectve ({{.*}}.obj)
+
+  .global entry
+  .text
+entry:
+  ret
+  .section .drectve
+  .ascii " -unknowndirectivename "
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -447,7 +447,8 @@
     case OPT_throwingnew:
       break;
     default:
-      error(arg->getSpelling() + " is not allowed in .drectve");
+      error(arg->getSpelling() + " is not allowed in .drectve (" +
+            toString(file) + ")");
     }
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149022.516398.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230424/aa5226e6/attachment.bin>


More information about the llvm-commits mailing list