2 # RUN: split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/def.s -o %t/def.o
5 # RUN: ld.lld %t/def.o -o %t/def.so -shared --soname=def
6 # RUN: ld.lld %t/a.o %t/def.so -o %t1 --wrap foo
7 # RUN: llvm-readelf --dyn-syms %t1 | FileCheck %s
9 # Test that the dynamic relocation uses foo. We used to produce a
10 # relocation with __real_foo.
12 # CHECK: Symbol table '.dynsym' contains 2 entries:
13 # CHECK: NOTYPE LOCAL DEFAULT UND
14 # CHECK-NEXT: NOTYPE GLOBAL DEFAULT UND foo
16 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o
17 # RUN: ld.lld -shared --wrap foo %t/b.o -o %t2.so
18 # RUN: llvm-readelf --dyn-syms %t2.so | FileCheck %s --check-prefix=SYM2
20 # SYM2: Symbol table '.dynsym' contains 4 entries:
21 # SYM2: NOTYPE LOCAL DEFAULT UND
22 # SYM2-NEXT: NOTYPE WEAK DEFAULT UND foo
23 # SYM2-NEXT: NOTYPE WEAK DEFAULT UND __wrap_foo
24 # SYM2-NEXT: NOTYPE GLOBAL DEFAULT [[#]] _start