[PATCH] D139559: [lld/mac] Abort link immediately on invalid -undefined argument
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 10:51:53 PST 2022
thakis updated this revision to Diff 480980.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139559/new/
https://reviews.llvm.org/D139559
Files:
lld/MachO/Driver.cpp
lld/test/MachO/treat-undef-sym.s
Index: lld/test/MachO/treat-undef-sym.s
===================================================================
--- lld/test/MachO/treat-undef-sym.s
+++ lld/test/MachO/treat-undef-sym.s
@@ -43,17 +43,16 @@
# ERROR-NEXT: >>> referenced by
# INVAL-WARNING: error: '-undefined warning' only valid with '-flat_namespace'
-# INVAL-WARNING-NEXT: error: undefined symbol: _bar
+# INVAL-WARNING-NOT: error: undefined symbol: _bar
# INVAL-SUPPRESS: error: '-undefined suppress' only valid with '-flat_namespace'
-# INVAL-SUPPRESS-NEXT: error: undefined symbol: _bar
+# INVAL-SUPPRESS-NOT: error: undefined symbol: _bar
# WARNING: warning: undefined symbol: _bar
# WARNING-NEXT: >>> referenced by
# UNKNOWN: unknown -undefined TREATMENT 'bogus'
-# UNKNOWN-NEXT: error: undefined symbol: _bar
-# UNKNOWN-NEXT: >>> referenced by
+# UNKNOWN-NOT: error: undefined symbol: _bar
# BIND: Lazy bind table:
# BIND: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} flat-namespace _bar
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -1608,6 +1608,8 @@
: NamespaceKind::flat;
config->undefinedSymbolTreatment = getUndefinedSymbolTreatment(args);
+ if (errorCount())
+ return false;
if (config->outputType == MH_EXECUTE)
config->entry = symtab->addUndefined(args.getLastArgValue(OPT_e, "_main"),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139559.480980.patch
Type: text/x-patch
Size: 1438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/263c0acf/attachment.bin>
More information about the llvm-commits
mailing list