2019-07-11 19:16:44 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
|
2019-08-05 22:31:39 +08:00
|
|
|
# RUN: echo '{ global: foo; };' > %tg.ver
|
2019-07-11 19:16:44 +08:00
|
|
|
# RUN: echo '{ local: foo; };' > %tl.ver
|
2019-08-05 22:31:39 +08:00
|
|
|
# RUN: echo '{ global: foo; local: *; };' > %tgl.ver
|
2019-07-11 19:16:44 +08:00
|
|
|
# RUN: echo 'V1 { global: foo; };' > %t1.ver
|
|
|
|
# RUN: echo 'V2 { global: foo; };' > %t2.ver
|
2019-07-11 19:16:51 +08:00
|
|
|
# RUN: echo 'V2 { global: notexist; local: f*; };' > %t2w.ver
|
2019-07-11 19:16:44 +08:00
|
|
|
|
2019-08-05 22:31:39 +08:00
|
|
|
## Note, ld.bfd errors on these cases.
|
2019-07-11 19:16:44 +08:00
|
|
|
# RUN: ld.lld -shared %t.o --version-script %tl.ver --version-script %t1.ver \
|
|
|
|
# RUN: -o %t.so 2>&1 | FileCheck --check-prefix=LOCAL %s
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=LOCAL-SYM %s
|
|
|
|
# RUN: ld.lld -shared %t.o --version-script %tg.ver --version-script %t1.ver \
|
|
|
|
# RUN: -o %t.so 2>&1 | FileCheck --check-prefix=GLOBAL %s
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=GLOBAL-SYM %s
|
2019-08-05 22:31:39 +08:00
|
|
|
# RUN: ld.lld -shared %t.o --version-script %tgl.ver --version-script %t1.ver \
|
|
|
|
# RUN: -o %t.so 2>&1 | FileCheck --check-prefix=GLOBAL %s
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=GLOBAL-SYM %s
|
2019-07-11 19:16:44 +08:00
|
|
|
|
|
|
|
## Note, ld.bfd silently accepts this case.
|
|
|
|
# RUN: ld.lld -shared %t.o --version-script %t1.ver --version-script %t2.ver \
|
|
|
|
# RUN: -o %t.so 2>&1 | FileCheck --check-prefix=V1-WARN %s
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=V1-SYM %s
|
|
|
|
|
2019-07-11 19:16:51 +08:00
|
|
|
# RUN: ld.lld -shared %t.o --version-script %t1.ver --version-script %t2w.ver \
|
|
|
|
# RUN: -o %t.so --fatal-warnings
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=V1-SYM %s
|
|
|
|
|
2019-07-11 19:16:44 +08:00
|
|
|
# LOCAL: warning: attempt to reassign symbol 'foo' of VER_NDX_LOCAL to version 'V1'
|
|
|
|
# LOCAL-SYM-NOT: foo
|
|
|
|
|
|
|
|
# GLOBAL: warning: attempt to reassign symbol 'foo' of VER_NDX_GLOBAL to version 'V1'
|
|
|
|
# GLOBAL-SYM: foo{{$}}
|
|
|
|
|
|
|
|
# V1-WARN: warning: attempt to reassign symbol 'foo' of version 'V1' to version 'V2'
|
|
|
|
# V1-SYM: foo@@V1
|
|
|
|
|
|
|
|
.globl foo
|
|
|
|
foo:
|