Skip to content

Commit 6ea589a

Browse files
MaskRayguoyuqi020
authored andcommitted
[ELF] --no-undefined-warning: demote error to warning for release/16.x
Close llvm#61208
1 parent 85bbc3d commit 6ea589a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lld/ELF/SymbolTable.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ void SymbolTable::scanVersionScript() {
278278
pat.isExternCpp, /*hasWildCard=*/false},
279279
id, ver, /*includeNonDefault=*/true);
280280
if (!found && !config->undefinedVersion)
281-
errorOrWarn("version script assignment of '" + ver + "' to symbol '" +
282-
pat.name + "' failed: symbol not defined");
281+
warn("version script assignment of '" + ver + "' to symbol '" +
282+
pat.name + "' failed: symbol not defined");
283283
};
284284
for (SymbolVersion &pat : v.nonLocalPatterns)
285285
if (!pat.hasWildcard)

lld/test/ELF/version-script-noundef.s

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# RUN: not ld.lld --version-script %t.script -shared %t.o -o /dev/null \
66
# RUN: --fatal-warnings 2>&1 | FileCheck -check-prefix=ERR1 %s
77
# RUN: ld.lld --version-script %t.script -shared --undefined-version %t.o -o %t.so
8-
# RUN: not ld.lld --version-script %t.script -shared --no-undefined-version \
8+
# RUN: ld.lld --version-script %t.script -shared --no-undefined-version \
99
# RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR1 %s
1010
# ERR1: version script assignment of 'VERSION_1.0' to symbol 'bar' failed: symbol not defined
1111

1212
# RUN: echo "VERSION_1.0 { global: und; };" > %t2.script
13-
# RUN: not ld.lld --version-script %t2.script -shared --no-undefined-version \
13+
# RUN: ld.lld --version-script %t2.script -shared --no-undefined-version \
1414
# RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR2 %s
1515
# ERR2: version script assignment of 'VERSION_1.0' to symbol 'und' failed: symbol not defined
1616

1717
# RUN: echo "VERSION_1.0 { local: und; };" > %t3.script
18-
# RUN: not ld.lld --version-script %t3.script -shared --no-undefined-version \
18+
# RUN: ld.lld --version-script %t3.script -shared --no-undefined-version \
1919
# RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR3 %s
2020
# ERR3: version script assignment of 'local' to symbol 'und' failed: symbol not defined
2121

0 commit comments

Comments
 (0)