Skip to content

Commit b1fdeee

Browse files
Revert "[LLD] Enable --no-undefined-version by default."
This reverts commit eedbe44.
1 parent e1e260c commit b1fdeee

11 files changed

+14
-18
lines changed

lld/ELF/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static void readConfigs(opt::InputArgList &args) {
12441244
config->trace = args.hasArg(OPT_trace);
12451245
config->undefined = args::getStrings(args, OPT_undefined);
12461246
config->undefinedVersion =
1247-
args.hasFlag(OPT_undefined_version, OPT_no_undefined_version, false);
1247+
args.hasFlag(OPT_undefined_version, OPT_no_undefined_version, true);
12481248
config->unique = args.hasArg(OPT_unique);
12491249
config->useAndroidRelrTags = args.hasFlag(
12501250
OPT_use_android_relr_tags, OPT_no_use_android_relr_tags, false);

lld/ELF/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ defm unresolved_symbols:
443443
Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">;
444444

445445
defm undefined_version: B<"undefined-version",
446-
"Allow unused version in version script (disabled by default)",
446+
"Allow unused version in version script (default)",
447447
"Report version scripts that refer undefined symbols">;
448448

449449
defm rsp_quoting: EEq<"rsp-quoting", "Quoting style for response files">,

lld/docs/ReleaseNotes.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ ELF Improvements
3333
(`D133548 <https://reviews.llvm.org/D133548>`_)
3434
* ``--no-warnings``/``-w`` is now available to suppress warnings.
3535
(`D136569 <https://reviews.llvm.org/D136569>`_)
36-
* ``--no-undefined-version`` is now the default; symbols named in version
37-
scripts that have no matching symbol in the output will be reported. Use
38-
``--undefined-version`` to revert to the old behavior.
3936

4037
Breaking changes
4138
----------------

lld/docs/ld.lld.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ Do not set the text data sections to be writable, page align sections.
352352
Disable target-specific relaxations. For x86-64 this disables R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX GOT optimization.
353353
.It Fl -no-rosegment
354354
Do not put read-only non-executable sections in their own segment.
355-
.It Fl -undefined-version
356-
Do not report version scripts that refer to undefined symbols.
355+
.It Fl -no-undefined-version
356+
Report version scripts that refer undefined symbols.
357357
.It Fl -no-undefined
358358
Report unresolved symbols even if the linker is creating a shared library.
359359
.It Fl -no-warn-symbol-ordering

lld/test/ELF/verdef-defaultver.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/verdef-defaultver.s -o %t1
55
# RUN: echo "V1 { global: a; b; local: *; };" > %t.script
66
# RUN: echo "V2 { global: b; c; } V1;" >> %t.script
7-
# RUN: ld.lld --hash-style=sysv -shared -soname shared %t1 --version-script %t.script --undefined-version -o %t.so
7+
# RUN: ld.lld --hash-style=sysv -shared -soname shared %t1 --version-script %t.script -o %t.so
88
# RUN: llvm-readobj -V --dyn-syms %t.so | FileCheck --check-prefix=DSO %s
99

1010
# DSO: DynamicSymbols [
@@ -195,9 +195,9 @@
195195
# EXE-NEXT: ]
196196

197197
# RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
198-
# RUN: ld.lld -shared --version-script=%t.script --fatal-warnings --undefined-version %t.so b.o -o b.so
198+
# RUN: ld.lld -shared --version-script=%t.script --fatal-warnings %t.so b.o -o b.so
199199
# RUN: llvm-readelf --dyn-syms b.so | FileCheck %s --check-prefix=PREEMPT
200-
# RUN: ld.lld -shared --version-script=%t.script --fatal-warnings --undefined-version b.o %t.so -o b.so
200+
# RUN: ld.lld -shared --version-script=%t.script --fatal-warnings b.o %t.so -o b.so
201201
# RUN: llvm-readelf --dyn-syms b.so | FileCheck %s --check-prefix=PREEMPT
202202

203203
# PREEMPT-DAG: a@@V1

lld/test/ELF/verdef-dependency.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# RUN: echo "LIBSAMPLE_1.0 { global: a; local: *; };" > %t.script
44
# RUN: echo "LIBSAMPLE_2.0 { global: b; local: *; } LIBSAMPLE_1.0;" >> %t.script
55
# RUN: echo "LIBSAMPLE_3.0 { global: c; } LIBSAMPLE_2.0;" >> %t.script
6-
# RUN: ld.lld --version-script %t.script --undefined-version -shared -soname shared %t.o -o %t.so
6+
# RUN: ld.lld --version-script %t.script -shared -soname shared %t.o -o %t.so
77
# RUN: llvm-readobj -V --dyn-syms %t.so | FileCheck --check-prefix=DSO %s
88

99
# DSO: VersionDefinitions [

lld/test/ELF/verneed.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# REQUIRES: x86
22
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed1.s -o %t1.o
33
# RUN: echo "v1 {}; v2 {}; v3 { global: f1; local: *; };" > %t.script
4-
# RUN: ld.lld -shared %t1.o --version-script %t.script --undefined-version -o %t1.so -soname verneed1.so.0
4+
# RUN: ld.lld -shared %t1.o --version-script %t.script -o %t1.so -soname verneed1.so.0
55
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed2.s -o %t2.o
6-
# RUN: ld.lld -shared %t2.o --version-script %t.script --undefined-version -o %t2.so -soname verneed2.so.0
6+
# RUN: ld.lld -shared %t2.o --version-script %t.script -o %t2.so -soname verneed2.so.0
77

88
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
99
# RUN: ld.lld --hash-style=sysv %t.o %t1.so %t2.so -o %t

lld/test/ELF/version-script-extern-undefined.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
44
# RUN: echo "FOO { global: extern \"C++\" { \"abb(int)\"; }; };" > %t.script
5-
# RUN: ld.lld --version-script %t.script --undefined-version -shared %t.o -o %t.so
5+
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
66
# RUN: llvm-readobj -V %t.so | FileCheck %s
77

88
# CHECK: VersionSymbols [

lld/test/ELF/version-script-local-preemptible.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# RUN: echo "{ global: main; local: *; };" > %t.script
1111

1212
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
13-
# RUN: ld.lld %t.o %t.so -o %t -version-script %t.script --undefined-version
13+
# RUN: ld.lld %t.o %t.so -o %t -version-script %t.script
1414
# RUN: llvm-readelf -r --symbols %t | FileCheck %s
1515

1616
# CHECK: Relocation section '.rela.plt' at offset {{.*}} contains 1 entries:

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# RUN: echo "VERSION_1.0 { global: bar; };" > %t.script
44
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
5-
# RUN: not ld.lld --version-script %t.script -shared %t.o -o /dev/null \
6-
# RUN: --fatal-warnings 2>&1 | FileCheck -check-prefix=ERR1 %s
5+
# RUN: ld.lld --version-script %t.script -shared %t.o -o /dev/null --fatal-warnings
76
# RUN: ld.lld --version-script %t.script -shared --undefined-version %t.o -o %t.so
87
# RUN: not ld.lld --version-script %t.script -shared --no-undefined-version \
98
# RUN: %t.o -o %t.so 2>&1 | FileCheck -check-prefix=ERR1 %s

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=V1-SYM %s
2525

2626
# RUN: ld.lld -shared %t.o --version-script %t1.ver --version-script %t2w.ver \
27-
# RUN: -o %t.so --fatal-warnings --undefined-version
27+
# RUN: -o %t.so --fatal-warnings
2828
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=V1-SYM %s
2929

3030
# LOCAL: warning: attempt to reassign symbol 'foo' of VER_NDX_LOCAL to version 'V1'

0 commit comments

Comments
 (0)