1# REQUIRES: mips
2# Check R_MIPS_GPREL32 relocation calculation.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5# RUN: echo "SECTIONS { \
6# RUN:         .rodata ALIGN(0x1000) : { *(.rodata) } \
7# RUN:         . = 0x20000; .text :  { *(.text) } \
8# RUN:       }" > %t.script
9# RUN: ld.lld -shared --script %t.script -o %t.so %t.o
10# RUN: llvm-objdump -s --section=.rodata -t %t.so | FileCheck %s
11
12  .text
13  .globl  __start
14__start:
15  lw      $t0,%call16(__start)($gp)
16foo:
17  nop
18bar:
19  nop
20
21  .section .rodata, "a"
22v1:
23  .gpword foo
24  .gpword bar
25
26# CHECK: SYMBOL TABLE:
27# CHECK: 00020008 l       .text           00000000 bar
28# CHECK: 00020004 l       .text           00000000 foo
29# CHECK: 00028000 l       .got            00000000 .hidden _gp
30
31# CHECK: Contents of section .rodata:
32# CHECK:  1000 ffff8004 ffff8008
33#              ^ 0x20004 - 0x28000
34#                       ^ 0x20008 - 0x28000
35