xref: /llvm-project/llvm/test/tools/llvm-readobj/ELF/reloc-types-mips.test (revision d9cf9bd4b3c30221a2ec348cdfb01a24d84927b6)
1## Test that llvm-readobj/llvm-readelf shows proper relocation type
2## names and values for mips target.
3
4# RUN: yaml2obj %s -o %t-mips.o
5# RUN: llvm-readobj -r --expand-relocs %t-mips.o | FileCheck %s
6
7# CHECK: Type: R_MIPS_NONE (0)
8# CHECK: Type: R_MIPS_16 (1)
9# CHECK: Type: R_MIPS_32 (2)
10# CHECK: Type: R_MIPS_REL32 (3)
11# CHECK: Type: R_MIPS_26 (4)
12# CHECK: Type: R_MIPS_HI16 (5)
13# CHECK: Type: R_MIPS_LO16 (6)
14# CHECK: Type: R_MIPS_GPREL16 (7)
15# CHECK: Type: R_MIPS_LITERAL (8)
16# CHECK: Type: R_MIPS_GOT16 (9)
17# CHECK: Type: R_MIPS_PC16 (10)
18# CHECK: Type: R_MIPS_CALL16 (11)
19# CHECK: Type: R_MIPS_GPREL32 (12)
20# CHECK: Type: R_MIPS_SHIFT5 (16)
21# CHECK: Type: R_MIPS_SHIFT6 (17)
22# CHECK: Type: R_MIPS_64 (18)
23# CHECK: Type: R_MIPS_GOT_DISP (19)
24# CHECK: Type: R_MIPS_GOT_PAGE (20)
25# CHECK: Type: R_MIPS_GOT_OFST (21)
26# CHECK: Type: R_MIPS_GOT_HI16 (22)
27# CHECK: Type: R_MIPS_GOT_LO16 (23)
28# CHECK: Type: R_MIPS_SUB (24)
29# CHECK: Type: R_MIPS_INSERT_A (25)
30# CHECK: Type: R_MIPS_INSERT_B (26)
31# CHECK: Type: R_MIPS_DELETE (27)
32# CHECK: Type: R_MIPS_HIGHER (28)
33# CHECK: Type: R_MIPS_HIGHEST (29)
34# CHECK: Type: R_MIPS_CALL_HI16 (30)
35# CHECK: Type: R_MIPS_CALL_LO16 (31)
36# CHECK: Type: R_MIPS_SCN_DISP (32)
37# CHECK: Type: R_MIPS_REL16 (33)
38# CHECK: Type: R_MIPS_ADD_IMMEDIATE (34)
39# CHECK: Type: R_MIPS_PJUMP (35)
40# CHECK: Type: R_MIPS_RELGOT (36)
41# CHECK: Type: R_MIPS_JALR (37)
42# CHECK: Type: R_MIPS_TLS_DTPMOD32 (38)
43# CHECK: Type: R_MIPS_TLS_DTPREL32 (39)
44# CHECK: Type: R_MIPS_TLS_DTPMOD64 (40)
45# CHECK: Type: R_MIPS_TLS_DTPREL64 (41)
46# CHECK: Type: R_MIPS_TLS_GD (42)
47# CHECK: Type: R_MIPS_TLS_LDM (43)
48# CHECK: Type: R_MIPS_TLS_DTPREL_HI16 (44)
49# CHECK: Type: R_MIPS_TLS_DTPREL_LO16 (45)
50# CHECK: Type: R_MIPS_TLS_GOTTPREL (46)
51# CHECK: Type: R_MIPS_TLS_TPREL32 (47)
52# CHECK: Type: R_MIPS_TLS_TPREL64 (48)
53# CHECK: Type: R_MIPS_TLS_TPREL_HI16 (49)
54# CHECK: Type: R_MIPS_TLS_TPREL_LO16 (50)
55# CHECK: Type: R_MIPS_GLOB_DAT (51)
56# CHECK: Type: R_MIPS_COPY (126)
57# CHECK: Type: R_MIPS_JUMP_SLOT (127)
58# CHECK: Type: R_MIPS_NUM (218)
59
60--- !ELF
61FileHeader:
62  Class:   ELFCLASS32
63  Data:    ELFDATA2MSB
64  Type:    ET_REL
65  Machine: EM_MIPS
66Sections:
67  - Name: .rel.text
68    Type: SHT_REL
69    Relocations:
70      - Type: R_MIPS_NONE
71      - Type: R_MIPS_16
72      - Type: R_MIPS_32
73      - Type: R_MIPS_REL32
74      - Type: R_MIPS_26
75      - Type: R_MIPS_HI16
76      - Type: R_MIPS_LO16
77      - Type: R_MIPS_GPREL16
78      - Type: R_MIPS_LITERAL
79      - Type: R_MIPS_GOT16
80      - Type: R_MIPS_PC16
81      - Type: R_MIPS_CALL16
82      - Type: R_MIPS_GPREL32
83      - Type: R_MIPS_SHIFT5
84      - Type: R_MIPS_SHIFT6
85      - Type: R_MIPS_64
86      - Type: R_MIPS_GOT_DISP
87      - Type: R_MIPS_GOT_PAGE
88      - Type: R_MIPS_GOT_OFST
89      - Type: R_MIPS_GOT_HI16
90      - Type: R_MIPS_GOT_LO16
91      - Type: R_MIPS_SUB
92      - Type: R_MIPS_INSERT_A
93      - Type: R_MIPS_INSERT_B
94      - Type: R_MIPS_DELETE
95      - Type: R_MIPS_HIGHER
96      - Type: R_MIPS_HIGHEST
97      - Type: R_MIPS_CALL_HI16
98      - Type: R_MIPS_CALL_LO16
99      - Type: R_MIPS_SCN_DISP
100      - Type: R_MIPS_REL16
101      - Type: R_MIPS_ADD_IMMEDIATE
102      - Type: R_MIPS_PJUMP
103      - Type: R_MIPS_RELGOT
104      - Type: R_MIPS_JALR
105      - Type: R_MIPS_TLS_DTPMOD32
106      - Type: R_MIPS_TLS_DTPREL32
107      - Type: R_MIPS_TLS_DTPMOD64
108      - Type: R_MIPS_TLS_DTPREL64
109      - Type: R_MIPS_TLS_GD
110      - Type: R_MIPS_TLS_LDM
111      - Type: R_MIPS_TLS_DTPREL_HI16
112      - Type: R_MIPS_TLS_DTPREL_LO16
113      - Type: R_MIPS_TLS_GOTTPREL
114      - Type: R_MIPS_TLS_TPREL32
115      - Type: R_MIPS_TLS_TPREL64
116      - Type: R_MIPS_TLS_TPREL_HI16
117      - Type: R_MIPS_TLS_TPREL_LO16
118      - Type: R_MIPS_GLOB_DAT
119      - Type: R_MIPS_COPY
120      - Type: R_MIPS_JUMP_SLOT
121      - Type: R_MIPS_NUM
122