brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 034b076 Raw
40 lines · plain
1# REQUIRES: systemz2# RUN: rm -rf %t && split-file %s %t3 4## Check recompile with -fPIC error message5# RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %t/shared.s -o %t/shared.o6# RUN: not ld.lld -shared %t/shared.o -o /dev/null 2>&1 | FileCheck %s7 8# CHECK: error: relocation R_390_PC16 cannot be used against symbol '_shared'; recompile with -fPIC9# CHECK: >>> defined in {{.*}}10# CHECK: >>> referenced by {{.*}}:(.data+0x1)11 12## Check patching of negative addends13 14# RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=1 %t/addend.s -o %t/1.o15# RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=32768 %t/addend.s -o %t/2.o16# RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=32769 %t/addend.s -o %t/3.o17 18# RUN: ld.lld --image-base=0 -Ttext=0 %t/1.o -o %t/1out19# RUN: ld.lld --image-base=0 -Ttext=0 %t/2.o -o %t/2out20# RUN: not ld.lld --image-base=0 -Ttext=0 %t/3.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/3.o --check-prefix RANGE21 22# RANGE: error: [[FILE]]:(.text+0x0): relocation R_390_PC16 out of range23 24# RUN: llvm-readelf --hex-dump=.text %t/1out | FileCheck %s -DADDEND=ffff --check-prefix DUMP25# RUN: llvm-readelf --hex-dump=.text %t/2out | FileCheck %s -DADDEND=8000 --check-prefix DUMP26 27# DUMP:  0x00000000 [[ADDEND]]28 29#--- shared.s30.data31 .byte 0xe832 .word _shared - .33 34#--- addend.s35.text36.globl _start37_start:38    .reloc ., R_390_PC16, .text-ADDEND39    .space 240