[lld] Support --unresolved-symbols=@<file> option in LLD for ELF (PR #142917)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 09:37:44 PDT 2025


================
@@ -804,6 +804,13 @@ static bool maybeReportUndefined(Ctx &ctx, Undefined &sym,
   if (ctx.arg.unresolvedSymbols == UnresolvedPolicy::Ignore && canBeExternal)
     return false;
 
+  // Skip undefined symbols from list
+  for (const auto &ignoredUndef : ctx.arg.unresolvedSymbolsList) {
+    if (ignoredUndef == sym.getName()) {
----------------
MaskRay wrote:

omit braces in this case. 

ctx.arg.unresolvedSymbolsList can be a DenseSet<CachedStringRef> to improve performance when the list is long.
I'd file a binutils feature request before rushing to add an option

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


More information about the llvm-commits mailing list