File: reloc-directive-label-offset.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (75 lines) | stat: -rw-r--r-- 3,240 bytes parent folder | download | duplicates (4)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# RUN: llvm-mc -triple mips-unknown-linux %s -show-encoding -target-abi=o32 \
# RUN:     | FileCheck --check-prefixes=ASM,ASM-32 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n32 \
# RUN:     | FileCheck --check-prefixes=ASM,ASM-64 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n64 \
# RUN:     | FileCheck --check-prefixes=ASM,ASM-64 %s
# RUN: llvm-mc -triple mips-unknown-linux %s -show-encoding -target-abi=o32 \
# RUN:     -filetype=obj | llvm-readobj -r | FileCheck -check-prefix=OBJ-O32 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n32 \
# RUN:     -filetype=obj | llvm-readobj -r | FileCheck -check-prefix=OBJ-N32 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n64 \
# RUN:     -filetype=obj | llvm-readobj -r | FileCheck -check-prefix=OBJ-N64 %s

  .text
foo: # ASM-LABEL: foo:
  nop
1:
  nop
  .reloc 1b, R_MIPS_NONE, foo       # ASM-32: .reloc ($tmp0), R_MIPS_NONE, foo
                                    # ASM-64: .reloc .Ltmp0, R_MIPS_NONE, foo
  nop
  .reloc 1f, R_MIPS_32, foo         # ASM-32: .reloc ($tmp1), R_MIPS_32, foo
                                    # ASM-64: .reloc .Ltmp1, R_MIPS_32, foo
1:
  nop
  .reloc 1f, R_MIPS_CALL16, foo     # ASM-32: .reloc ($tmp2), R_MIPS_CALL16, foo
                                    # ASM-64: .reloc .Ltmp2, R_MIPS_CALL16, foo
1:
  nop
  .reloc 2f, R_MIPS_GOT_DISP, foo   # ASM-32: .reloc ($tmp3), R_MIPS_GOT_DISP, foo
                                    # ASM-64: .reloc .Ltmp3, R_MIPS_GOT_DISP, foo
  nop

  .reloc 3f, R_MIPS_GOT_PAGE, foo   # ASM-32: .reloc ($tmp4), R_MIPS_GOT_PAGE, foo
                                    # ASM-64: .reloc .Ltmp4, R_MIPS_GOT_PAGE, foo
  nop
bar:
  nop
2:
  nop
3:
  nop
  .reloc bar, R_MIPS_GOT_OFST, foo  # ASM: .reloc bar, R_MIPS_GOT_OFST, foo
  nop
  .reloc foo, R_MIPS_32, foo        # ASM: .reloc foo, R_MIPS_32, foo
  nop
1:
  nop

# OBJ-O32-LABEL: Relocations [
# OBJ-O32:           0x0 R_MIPS_32 .text 0x0
# OBJ-O32-NEXT:      0x4 R_MIPS_NONE .text 0x0
# OBJ-O32-NEXT:      0xC R_MIPS_32 .text 0x0
# OBJ-O32-NEXT:      0x10 R_MIPS_CALL16 foo 0x0
# OBJ-O32-NEXT:      0x1C R_MIPS_GOT_OFST .text 0x0
# OBJ-O32-NEXT:      0x20 R_MIPS_GOT_DISP foo 0x0
# OBJ-O32-NEXT:      0x24 R_MIPS_GOT_PAGE .text 0x0

# OBJ-N32-LABEL: Relocations [
# OBJ-N32:           0x4 R_MIPS_NONE .text 0x0
# OBJ-N32-NEXT:      0x1C R_MIPS_GOT_OFST .text 0x0
# OBJ-N32-NEXT:      0x0 R_MIPS_32 .text 0x0
# OBJ-N32-NEXT:      0xC R_MIPS_32 .text 0x0
# OBJ-N32-NEXT:      0x10 R_MIPS_CALL16 foo 0x0
# OBJ-N32-NEXT:      0x20 R_MIPS_GOT_DISP foo 0x0
# OBJ-N32-NEXT:      0x24 R_MIPS_GOT_PAGE .text 0x0

# OBJ-N64-LABEL: Relocations [
# OBJ-N64:           0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
# OBJ-N64-NEXT:      0x1C R_MIPS_GOT_OFST/R_MIPS_NONE/R_MIPS_NONE .text 0x0
# OBJ-N64-NEXT:      0x0 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x0
# OBJ-N64-NEXT:      0xC R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x0
# OBJ-N64-NEXT:      0x10 R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE foo 0x0
# OBJ-N64-NEXT:      0x20 R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE foo 0x0
# OBJ-N64-NEXT:      0x24 R_MIPS_GOT_PAGE/R_MIPS_NONE/R_MIPS_NONE .text 0x0