xref: /llvm-project/lld/test/ELF/mips-gp-local.s (revision 75cdab6dc2453a508157a9c383b93373a93078d6)
1# REQUIRES: mips
2# Check handling of relocations against __gnu_local_gp symbol.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5# RUN: echo "SECTIONS { \
6# RUN:         . = 0x10000; .text ALIGN(0x1000) : { *(.text) } \
7# RUN:         . = 0x30000; .got :  { *(.got) } \
8# RUN:       }" > %t.script
9# RUN: ld.lld --script %t.script -o %t.exe %t.o
10# RUN: llvm-objdump --no-print-imm-hex -d -t --no-show-raw-insn %t.exe | FileCheck %s
11
12# CHECK: 00037ff0 l .got  00000000 .hidden _gp
13# CHECK: 00011000 g .text 00000000 __start
14
15# CHECK:      <__start>:
16# CHECK-NEXT:    lui   $8, 3
17# CHECK-NEXT:    addi  $8, $8, 32752
18
19  .text
20  .globl  __start
21__start:
22  lui    $t0,%hi(__gnu_local_gp)
23  addi   $t0,$t0,%lo(__gnu_local_gp)
24