aboutsummaryrefslogtreecommitdiff
path: root/test/ELF/mips-got-string.s
blob: 598865c681f6e3f82b9d44bad8f4ba5c7116e32b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Check R_MIPS_GOT16 relocation against merge section.

# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -o %t.o %s
# RUN: ld.lld -shared -o %t.so %t.o
# RUN: llvm-readobj -t -mips-plt-got %t.so | FileCheck %s

# REQUIRES: mips

# CHECK:      Symbol {
# CHECK:        Name: $.str
# CHECK-NEXT:   Value: 0xF4
# CHECK:      }

# CHECK:      Local entries [
# CHECK-NEXT:   Entry {
# CHECK-NEXT:     Address:
# CHECK-NEXT:     Access: -32744
# CHECK-NEXT:     Initial: 0x0
# CHECK:        }
# CHECK:      ]

  .text
  lw     $t9, %got($.str)($gp)
  addiu  $a0, $t9, %lo($.str)

  .section  .rodata.str,"aMS",@progbits,1
$.str:
  .asciz "foo"