35 lines · plain
1# REQUIRES: mips2# Check R_MIPS_GPREL32 relocation calculation.3 4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o5# RUN: echo "SECTIONS { \6# RUN: .rodata ALIGN(0x1000) : { *(.rodata) } \7# RUN: . = 0x20000; .text : { *(.text) } \8# RUN: }" > %t.script9# RUN: ld.lld -shared --script %t.script -o %t.so %t.o10# RUN: llvm-objdump -s --section=.rodata -t %t.so | FileCheck %s11 12 .text13 .globl __start14__start:15 lw $t0,%call16(__start)($gp)16foo:17 nop18bar:19 nop20 21 .section .rodata, "a"22v1:23 .gpword foo24 .gpword bar25 26# CHECK: SYMBOL TABLE:27# CHECK: 00020004 l .text 00000000 foo28# CHECK: 00020008 l .text 00000000 bar29# CHECK: 00028000 l .got 00000000 .hidden _gp30 31# CHECK: Contents of section .rodata:32# CHECK: 1000 ffff8004 ffff800833# ^ 0x20004 - 0x2800034# ^ 0x20008 - 0x2800035