brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 11e89e0 Raw
46 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o3# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/ztext.s -o %t2.o4# RUN: ld.lld %t2.o -o %t2.so -shared -soname=so5 6# RUN: ld.lld -z notext %t.o %t2.so -o %t -shared7# RUN: llvm-readobj  --dynamic-table -r %t | FileCheck %s8# RUN: ld.lld -z notext %t.o %t2.so -o %t2 -pie9# RUN: llvm-readobj  --dynamic-table -r %t2 | FileCheck %s10# RUN: ld.lld -z notext %t.o %t2.so -o %t311# RUN: llvm-readobj  --dynamic-table -r %t3 | FileCheck --check-prefix=STATIC %s12 13# RUN: not ld.lld %t.o %t2.so -o /dev/null -shared 2>&1 | FileCheck --check-prefix=ERR %s14# RUN: not ld.lld -z text %t.o %t2.so -o /dev/null -shared 2>&1 | FileCheck --check-prefix=ERR %s15# ERR: error: relocation R_X86_64_64 cannot be used against symbol 'bar'; recompile with -fPIC16 17# If the preference is to have text relocations, don't create plt of copy relocations.18 19# CHECK: DynamicSection [20# CHECK:   FLAGS TEXTREL21# CHECK:   TEXTREL 0x022 23# CHECK:      Relocations [24# CHECK-NEXT:   Section {{.*}} .rela.dyn {25# CHECK-NEXT:     0x12A0 R_X86_64_RELATIVE - 0x12A026# CHECK-NEXT:     0x12A8 R_X86_64_64 bar 0x027# CHECK-NEXT:     0x12B0 R_X86_64_PC64 zed 0x028# CHECK-NEXT:   }29# CHECK-NEXT: ]30 31# STATIC: DynamicSection [32# STATIC:   FLAGS TEXTREL33# STATIC:   TEXTREL 0x034 35# STATIC:      Relocations [36# STATIC-NEXT:   Section {{.*}} .rela.dyn {37# STATIC-NEXT:     0x201290 R_X86_64_64 bar 0x038# STATIC-NEXT:     0x201298 R_X86_64_PC64 zed 0x039# STATIC-NEXT:   }40# STATIC-NEXT: ]41 42foo:43.quad foo44.quad bar45.quad zed - .46