brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4839e58 Raw
35 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o3// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/wrap-no-real.s -o %t2.o4// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/wrap-no-real2.s -o %t3.o5// RUN: ld.lld -o %t3.so -shared --soname=t3 %t3.o6 7// RUN: ld.lld -o %t %t1.o %t2.o -wrap foo8// RUN: llvm-objdump -d %t | FileCheck %s9// RUN: llvm-readelf -s -x .got %t | FileCheck --check-prefix=READELF --implicit-check-not=__real_ %s10 11// CHECK: <_start>:12// CHECK-NEXT: movq {{.*}}(%rip), %rax  # 0x2021b013// CHECK-NEXT: movq {{.*}}(%rip), %rbx  # 0x2021b014// CHECK-NEXT: movq {{.*}}(%rip), %rcx  # 0x2021a815 16// READELF:      0000000000011000  0 NOTYPE GLOBAL DEFAULT ABS foo17// READELF:      0000000000011010  0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo18// READELF:      Hex dump of section '.got':19// READELF-NEXT: 0x[[#%x,ADDR:]] 00100100 00000000 10100100 0000000020 21// RUN: ld.lld -o %t2 %t1.o %t2.o %t3.so --wrap foo22// RUN: llvm-objdump -d %t2 | FileCheck --check-prefix=CHECK2 %s23// RUN: llvm-readelf -s -x .got %t2 | FileCheck --check-prefix=READELF --implicit-check-not=__real_ %s24 25// CHECK2: <_start>:26// CHECK2-NEXT: movq {{.*}}(%rip), %rax  # 0x2022c027// CHECK2-NEXT: movq {{.*}}(%rip), %rbx  # 0x2022c028// CHECK2-NEXT: movq {{.*}}(%rip), %rcx  # 0x2022b829 30.global _start31_start:32  mov foo@gotpcrel(%rip), %rax33  mov __wrap_foo@gotpcrel(%rip), %rbx34  mov __real_foo@gotpcrel(%rip), %rcx35