Skip to content

Commit c1949c6

Browse files
MaskRaytstellar
authored andcommitted
[ELF] --no-undefined-warning: demote error to warning for release/16.x
Close #61208
1 parent 35232f3 commit c1949c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lld/ELF/SymbolTable.cpp

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

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

Lines changed: 3 additions & 3 deletions
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)