brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · a8f42ae Raw
28 lines · plain
1// REQUIRES: riscv2// RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o3// RUN: ld.lld %t.o -o %t.so -shared --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=WARN4// RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s5// RUN: llvm-objdump --no-print-imm-hex -s -d %t.so | FileCheck %s6 7// SEC: .got PROGBITS 00000000000023908 9  .section .data10  .globl bar11bar:12 13  .globl _start14_start:  // PC = 0x33a815// %gotpcrel(bar)   = 0x2398 (got entry for `bar`) - 0x33a8 (.) = 0xf0efffff16// %gotpcrel(bar+4) = 0x2398 (got entry for `bar`) - 0x33ac (.) + 4 = 0xf0efffff17// %gotpcrel(bar-4) = 0x2398 (got entry for `bar`) - 0x33b0 (.) - 4 = 0xe4efffff18// CHECK:      Contents of section .data:19// CHECK-NEXT:  {{.*}} f0efffff f0efffff e4efffff20  .word %gotpcrel(bar)21  .word %gotpcrel(bar+4)22  .word %gotpcrel(bar-4)23 24// WARN: relocation R_RISCV_GOT32_PCREL out of range: {{.*}} is not in [-2147483648, 2147483647]; references 'baz'25// WARN: relocation R_RISCV_GOT32_PCREL out of range: {{.*}} is not in [-2147483648, 2147483647]; references 'baz'26  .word %gotpcrel(baz+0xffffffff)27  .word %gotpcrel(baz-0xffffffff)28