2015-10-02 01:24:24 +08:00
|
|
|
# --allow-shlib-undefined and --no-allow-shlib-undefined are fully
|
2015-10-02 01:33:36 +08:00
|
|
|
# ignored in linker implementation.
|
2015-10-02 01:24:24 +08:00
|
|
|
# --allow-shlib-undefined is set by default
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
|
|
|
|
# RUN: %p/Inputs/allow-shlib-undefined.s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld -shared %t -o %t.so
|
2015-10-02 01:24:24 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
|
|
|
|
|
|
|
|
# Executable: should link with DSO containing undefined symbols in any case.
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t1 %t.so -o %t2
|
|
|
|
# RUN: ld.lld --no-allow-shlib-undefined %t1 %t.so -o %t2
|
|
|
|
# RUN: ld.lld --allow-shlib-undefined %t1 %t.so -o %t2
|
2015-10-02 01:33:36 +08:00
|
|
|
|
|
|
|
# DSO with undefines:
|
2015-10-02 01:24:24 +08:00
|
|
|
# should link with or without any of these options.
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld -shared %t -o %t.so
|
|
|
|
# RUN: ld.lld -shared --allow-shlib-undefined %t -o %t.so
|
|
|
|
# RUN: ld.lld -shared --no-allow-shlib-undefined %t -o %t.so
|
2015-10-02 01:33:36 +08:00
|
|
|
|
2015-10-02 01:24:24 +08:00
|
|
|
# Executable still should not link when have undefines inside.
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: not ld.lld %t -o %t.so
|
2015-10-02 01:24:24 +08:00
|
|
|
|
|
|
|
.globl _start
|
2015-10-02 01:33:36 +08:00
|
|
|
_start:
|
2016-03-29 16:35:42 +08:00
|
|
|
callq _shared@PLT
|