xref: /llvm-project/lld/test/ELF/mips-call16.s (revision 75cdab6dc2453a508157a9c383b93373a93078d6)
1# REQUIRES: mips
2# Check R_MIPS_CALL16 relocation calculation.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5# RUN: ld.lld %t.o -shared -o %t.so
6# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s
7# RUN: llvm-readelf -A --symbols %t.so | FileCheck -check-prefix=GOT %s
8
9  .text
10  .globl  __start
11__start:
12  lw      $t0,%call16(g1)($gp)
13
14  .globl g1
15  .type  g1,@function
16g1:
17  nop
18
19# CHECK:      Disassembly of section .text:
20# CHECK-EMPTY:
21# CHECK-NEXT: <__start>:
22# CHECK-NEXT:      {{.*}}:  lw  $8, -32744
23
24# GOT: Symbol table '.symtab'
25# GOT: {{.*}}:  [[G1:[0-9a-f]+]]  {{.*}} g1
26
27# GOT: Primary GOT:
28# GOT:  Global entries:
29# GOT:   {{.*}} -32744(gp) [[G1]] [[G1]] FUNC 7 g1
30