brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 0115548 Raw
40 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t && split-file %s %t3 4## Check recompile with -fPIC error message5# RUN: llvm-mc -filetype=obj -triple=x86_64-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_X86_64_PC32 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=x86_64 -defsym ADDEND=1 %t/addend.s -o %t/1.o15# RUN: llvm-mc -filetype=obj -triple=x86_64 -defsym ADDEND=2147483648 %t/addend.s -o %t/2.o16# RUN: llvm-mc -filetype=obj -triple=x86_64 -defsym ADDEND=2147483649 %t/addend.s -o %t/3.o17 18# RUN: ld.lld --image-base=0 --section-start=.text=0x0 %t/1.o -o %t/1out19# RUN: ld.lld --image-base=0 --section-start=.text=0x0 %t/2.o -o %t/2out20# RUN: not ld.lld --image-base=0 --section-start=.text=0x0 %t/3.o -o /dev/null 2>&1 | FileCheck %s --check-prefix RANGE21 22# RANGE: relocation R_X86_64_PC32 out of range23 24# RUN: llvm-readelf --hex-dump=.text %t/1out | FileCheck %s -DADDEND=ffffffff --check-prefix DUMP25# RUN: llvm-readelf --hex-dump=.text %t/2out | FileCheck %s -DADDEND=00000080 --check-prefix DUMP26 27# DUMP:  0x00000000 [[ADDEND]]28 29#--- shared.s30.data31 .byte 0xe832 .long _shared - .33 34#--- addend.s35.text36.globl _start37_start:38    .reloc ., R_X86_64_PC32, .text-ADDEND39    .space 440