brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ca16981 Raw
42 lines · plain
1# REQUIRES: x862# RUN: split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o4# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/def.s -o %t/def.o5# RUN: ld.lld %t/def.o -o %t/def.so -shared --soname=def6# RUN: ld.lld %t/a.o %t/def.so -o %t1 --wrap foo7# RUN: llvm-readelf --dyn-syms %t1 | FileCheck %s8 9# Test that the dynamic relocation uses foo. We used to produce a10# relocation with __real_foo.11 12# CHECK:      Symbol table '.dynsym' contains 2 entries:13# CHECK:      NOTYPE  LOCAL  DEFAULT  UND14# CHECK-NEXT: NOTYPE  GLOBAL DEFAULT  UND foo15 16# RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o17# RUN: ld.lld -shared --wrap foo %t/b.o -o %t2.so18# RUN: llvm-readelf --dyn-syms %t2.so | FileCheck %s --check-prefix=SYM219 20# SYM2:      Symbol table '.dynsym' contains 4 entries:21# SYM2:      NOTYPE  LOCAL  DEFAULT   UND22# SYM2-NEXT: NOTYPE  WEAK   DEFAULT   UND foo23# SYM2-NEXT: NOTYPE  WEAK   DEFAULT   UND __wrap_foo24# SYM2-NEXT: NOTYPE  GLOBAL DEFAULT [[#]] _start25 26#--- a.s27.global _start28_start:29	callq	__real_foo@plt30 31#--- def.s32.globl foo33foo:34 35#--- b.s36.weak foo37.weak __real_foo38.global _start39_start:40  call __real_foo@plt41  call foo@plt42