[llvm-branch-commits] [lld] c1949c6 - [ELF] --no-undefined-warning: demote error to warning for release/16.x

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 8 05:58:44 PST 2023


Author: Fangrui Song
Date: 2023-03-08T05:58:21-08:00
New Revision: c1949c6a310ae965be4995f46e9b47c56dc5f05f

URL: https://github.com/llvm/llvm-project/commit/c1949c6a310ae965be4995f46e9b47c56dc5f05f
DIFF: https://github.com/llvm/llvm-project/commit/c1949c6a310ae965be4995f46e9b47c56dc5f05f.diff

LOG: [ELF] --no-undefined-warning: demote error to warning for release/16.x

Close https://github.com/llvm/llvm-project/issues/61208

Added: 
    

Modified: 
    lld/ELF/SymbolTable.cpp
    lld/test/ELF/version-script-noundef.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index f09d0d7f90958..f616245233b19 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -277,8 +277,8 @@ void SymbolTable::scanVersionScript() {
                                    pat.isExternCpp, /*hasWildCard=*/false},
                                   id, ver, /*includeNonDefault=*/true);
       if (!found && !config->undefinedVersion)
-        errorOrWarn("version script assignment of '" + ver + "' to symbol '" +
-                    pat.name + "' failed: symbol not defined");
+        warn("version script assignment of '" + ver + "' to symbol '" +
+             pat.name + "' failed: symbol not defined");
     };
     for (SymbolVersion &pat : v.nonLocalPatterns)
       if (!pat.hasWildcard)

diff  --git a/lld/test/ELF/version-script-noundef.s b/lld/test/ELF/version-script-noundef.s
index b99fb1779f6eb..9cdfa1ea6998d 100644
--- a/lld/test/ELF/version-script-noundef.s
+++ b/lld/test/ELF/version-script-noundef.s
@@ -5,17 +5,17 @@
 # RUN: not ld.lld --version-script %t.script -shared %t.o -o /dev/null \
 # RUN:    --fatal-warnings 2>&1 | FileCheck -check-prefix=ERR1 %s
 # RUN: ld.lld --version-script %t.script -shared --undefined-version %t.o -o %t.so
-# RUN: not ld.lld --version-script %t.script -shared --no-undefined-version \
+# RUN: ld.lld --version-script %t.script -shared --no-undefined-version \
 # RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR1 %s
 # ERR1: version script assignment of 'VERSION_1.0' to symbol 'bar' failed: symbol not defined
 
 # RUN: echo "VERSION_1.0 { global: und; };" > %t2.script
-# RUN: not ld.lld --version-script %t2.script -shared --no-undefined-version \
+# RUN: ld.lld --version-script %t2.script -shared --no-undefined-version \
 # RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR2 %s
 # ERR2: version script assignment of 'VERSION_1.0' to symbol 'und' failed: symbol not defined
 
 # RUN: echo "VERSION_1.0 { local: und; };" > %t3.script
-# RUN: not ld.lld --version-script %t3.script -shared --no-undefined-version \
+# RUN: ld.lld --version-script %t3.script -shared --no-undefined-version \
 # RUN:   %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR3 %s
 # ERR3: version script assignment of 'local' to symbol 'und' failed: symbol not defined
 


        


More information about the llvm-branch-commits mailing list