File: mips-micro-relocs.s

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (59 lines) | stat: -rw-r--r-- 2,564 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Check handling of microMIPS relocations.

# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -mattr=micromips %S/Inputs/mips-micro.s -o %t1eb.o
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -mattr=micromips %s -o %t2eb.o
# RUN: ld.lld -o %teb.exe %t1eb.o %t2eb.o
# RUN: llvm-objdump -d -t -mattr=micromips %teb.exe \
# RUN:   | FileCheck --check-prefixes=EB,SYM %s

# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -mattr=micromips %S/Inputs/mips-micro.s -o %t1el.o
# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -mattr=micromips %s -o %t2el.o
# RUN: ld.lld -o %tel.exe %t1el.o %t2el.o
# RUN: llvm-objdump -d -t -mattr=micromips %tel.exe \
# RUN:   | FileCheck --check-prefixes=EL,SYM %s

# REQUIRES: mips

# EB:      __start:
# EB-NEXT:      20010:       41 a3 00 01     lui     $3, 1
# EB-NEXT:      20014:       30 63 7f df     addiu   $3, $3, 32735
# EB-NEXT:      20018:       fc 7c 80 18     lw      $3, -32744($gp)
# EB-NEXT:      2001c:       fc 63 80 18     lw      $3, -32744($3)
# EB-NEXT:      20020:       8f 70           beqz16  $6, -32
# EB-NEXT:      20022:       00 7e 00 00     sll     $3, $fp, 0
# EB-NEXT:      20026:       cf ec           b16     -40
# EB-NEXT:      20028:       00 00 00 00     nop
# EB-NEXT:      2002c:       94 00 ff e8     b       -44

# EL:      __start:
# EL-NEXT:      20010:       a3 41 01 00     lui     $3, 1
# EL-NEXT:      20014:       63 30 df 7f     addiu   $3, $3, 32735
# EL-NEXT:      20018:       7c fc 18 80     lw      $3, -32744($gp)
# EL-NEXT:      2001c:       63 fc 18 80     lw      $3, -32744($3)
# EL-NEXT:      20020:       70 8f           beqz16  $6, -32
# EL-NEXT:      20022:       7e 00 00 00     sll     $3, $fp, 0
# EL-NEXT:      20026:       ec cf           b16     -40
# EL-NEXT:      20028:       00 00 00 00     nop
# EL-NEXT:      2002c:       00 94 e8 ff     b       -44

# SYM: 00037ff0         .got            00000000 .hidden _gp
# SYM: 00020000 g F     .text           00000000 foo
# SYM: 00020010         .text           00000000 __start

  .text
  .set micromips
  .global __start
__start:
  lui     $3, %hi(_gp_disp)       # R_MICROMIPS_HI16
  addiu   $3, $3, %lo(_gp_disp)   # R_MICROMIPS_LO16

  lw      $3, %call16(foo)($gp)   # R_MICROMIPS_CALL16
  lw      $3, %got(foo)($3)       # R_MICROMIPS_GOT16

  beqz16  $6, foo                 # R_MICROMIPS_PC7_S1
  b16     foo                     # R_MICROMIPS_PC10_S1
  b       foo                     # R_MICROMIPS_PC16_S1