1// REQUIRES: mips
2// RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t
3// RUN: ld.lld -shared %t -o %t2
4// RUN: llvm-readelf --sections --symbols %t2 | FileCheck %s
5
6// The Mips _GLOBAL_OFFSET_TABLE_ should be defined at the start of the .got
7
8.globl  a
9.hidden a
10.type   a,@object
11.comm   a,4,4
12
13.globl  f
14.type   f,@function
15f:
16 ld      $v0,%got_page(a)($gp)
17 daddiu  $v0,$v0,%got_ofst(a)
18
19.global _start
20.type _start,@function
21_start:
22 lw      $t0,%call16(f)($gp)
23 .word _GLOBAL_OFFSET_TABLE_ - .
24
25// CHECK: {{.*}} .got PROGBITS [[GOT:[0-9a-f]+]]
26// CHECK: {{.*}} [[GOT]] {{.*}} _GLOBAL_OFFSET_TABLE_
27