[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / dynamic-list-preempt2.s
blob16306d201d8ef57a36a836a9aa5bbe55333beb28
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 # RUN: ld.lld %t.o -shared -soname=t.so -o %t.so
5 # RUN: echo '{ foo; };' > %t.list
6 # RUN: ld.lld %t.o %t.so -shared --dynamic-list %t.list -o %t
7 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=SYM %s
8 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=REL %s
10 ## foo and bar interpose symbols in another DSO, so both are exported,
11 ## even if --dynamic-list specifies only foo.
13 # SYM-DAG: bar
14 # SYM-DAG: foo
16 ## bar is not specified in --dynamic-list, so it is not preemptable when
17 ## producing a DSO, and its PLT does not have an associated JUMP_SLOT.
19 # REL: .rela.plt {
20 # REL-NEXT: R_X86_64_JUMP_SLOT foo 0x0
21 # REL-NEXT: }
23 .globl foo, bar
24 foo:
25 bar:
26 ret
28 call foo@PLT
29 call bar@PLT