MipsRelocationFunctions.h revision f33f6de54db174aa679a4b6d1e040d37e95541c0
1//===- MipsRelocationFunction.h -------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#define DECL_MIPS_APPLY_RELOC_FUNC(Name) \
11static MipsRelocator::Result Name(MipsRelocationInfo& pReloc, \
12                                  MipsRelocator& pParent);
13
14#define DECL_MIPS_APPLY_RELOC_FUNCS \
15DECL_MIPS_APPLY_RELOC_FUNC(none) \
16DECL_MIPS_APPLY_RELOC_FUNC(abs32) \
17DECL_MIPS_APPLY_RELOC_FUNC(rel26) \
18DECL_MIPS_APPLY_RELOC_FUNC(hi16) \
19DECL_MIPS_APPLY_RELOC_FUNC(lo16) \
20DECL_MIPS_APPLY_RELOC_FUNC(gprel16) \
21DECL_MIPS_APPLY_RELOC_FUNC(got16) \
22DECL_MIPS_APPLY_RELOC_FUNC(call16) \
23DECL_MIPS_APPLY_RELOC_FUNC(gprel32) \
24DECL_MIPS_APPLY_RELOC_FUNC(abs64) \
25DECL_MIPS_APPLY_RELOC_FUNC(gotdisp) \
26DECL_MIPS_APPLY_RELOC_FUNC(gotoff) \
27DECL_MIPS_APPLY_RELOC_FUNC(gothi16) \
28DECL_MIPS_APPLY_RELOC_FUNC(gotlo16) \
29DECL_MIPS_APPLY_RELOC_FUNC(sub) \
30DECL_MIPS_APPLY_RELOC_FUNC(jalr) \
31DECL_MIPS_APPLY_RELOC_FUNC(la25lui) \
32DECL_MIPS_APPLY_RELOC_FUNC(la25j) \
33DECL_MIPS_APPLY_RELOC_FUNC(la25add) \
34DECL_MIPS_APPLY_RELOC_FUNC(pc32) \
35DECL_MIPS_APPLY_RELOC_FUNC(unsupport)
36
37#define DECL_MIPS_APPLY_RELOC_FUNC_PTRS \
38  { &none,         0, "R_MIPS_NONE",                  0}, \
39  { &unsupport,    1, "R_MIPS_16",                   16}, \
40  { &abs32,        2, "R_MIPS_32",                   32}, \
41  { &unsupport,    3, "R_MIPS_REL32",                32}, \
42  { &rel26,        4, "R_MIPS_26",                   26}, \
43  { &hi16,         5, "R_MIPS_HI16",                 16}, \
44  { &lo16,         6, "R_MIPS_LO16",                 16}, \
45  { &gprel16,      7, "R_MIPS_GPREL16",              16}, \
46  { &unsupport,    8, "R_MIPS_LITERAL",              16}, \
47  { &got16,        9, "R_MIPS_GOT16",                16}, \
48  { &unsupport,   10, "R_MIPS_PC16",                 16}, \
49  { &call16,      11, "R_MIPS_CALL16",               16}, \
50  { &gprel32,     12, "R_MIPS_GPREL32",              32}, \
51  { &none,        13, "R_MIPS_UNUSED1",               0}, \
52  { &none,        14, "R_MIPS_UNUSED2",               0}, \
53  { &none,        15, "R_MIPS_UNUSED3",               0}, \
54  { &unsupport,   16, "R_MIPS_SHIFT5",               32}, \
55  { &unsupport,   17, "R_MIPS_SHIFT6",               32}, \
56  { &abs64,       18, "R_MIPS_64",                   64}, \
57  { &gotdisp,     19, "R_MIPS_GOT_DISP",             16}, \
58  { &gotdisp,     20, "R_MIPS_GOT_PAGE",             16}, \
59  { &gotoff,      21, "R_MIPS_GOT_OFST",             16}, \
60  { &gothi16,     22, "R_MIPS_GOT_HI16",             16}, \
61  { &gotlo16,     23, "R_MIPS_GOT_LO16",             16}, \
62  { &sub,         24, "R_MIPS_SUB",                  64}, \
63  { &unsupport,   25, "R_MIPS_INSERT_A",              0}, \
64  { &unsupport,   26, "R_MIPS_INSERT_B",              0}, \
65  { &unsupport,   27, "R_MIPS_DELETE",                0}, \
66  { &unsupport,   28, "R_MIPS_HIGHER",               16}, \
67  { &unsupport,   29, "R_MIPS_HIGHEST",              16}, \
68  { &gothi16,     30, "R_MIPS_CALL_HI16",            16}, \
69  { &gotlo16,     31, "R_MIPS_CALL_LO16",            16}, \
70  { &unsupport,   32, "R_MIPS_SCN_DISP",             32}, \
71  { &unsupport,   33, "R_MIPS_REL16",                 0}, \
72  { &unsupport,   34, "R_MIPS_ADD_IMMEDIATE",         0}, \
73  { &unsupport,   35, "R_MIPS_PJUMP",                 0}, \
74  { &unsupport,   36, "R_MIPS_RELGOT",                0}, \
75  { &jalr,        37, "R_MIPS_JALR",                 32}, \
76  { &unsupport,   38, "R_MIPS_TLS_DTPMOD32",         32}, \
77  { &unsupport,   39, "R_MIPS_TLS_DTPREL32",         32}, \
78  { &unsupport,   40, "R_MIPS_TLS_DTPMOD64",          0}, \
79  { &unsupport,   41, "R_MIPS_TLS_DTPREL64",          0}, \
80  { &unsupport,   42, "R_MIPS_TLS_GD",               16}, \
81  { &unsupport,   43, "R_MIPS_TLS_LDM",              16}, \
82  { &unsupport,   44, "R_MIPS_TLS_DTPREL_HI16",      16}, \
83  { &unsupport,   45, "R_MIPS_TLS_DTPREL_LO16",      16}, \
84  { &unsupport,   46, "R_MIPS_TLS_GOTTPREL",         16}, \
85  { &unsupport,   47, "R_MIPS_TLS_TPREL32",          32}, \
86  { &unsupport,   48, "R_MIPS_TLS_TPREL64",           0}, \
87  { &unsupport,   49, "R_MIPS_TLS_TPREL_HI16",       16}, \
88  { &unsupport,   50, "R_MIPS_TLS_TPREL_LO16",       16}, \
89  { &unsupport,   51, "R_MIPS_GLOB_DAT",              0}, \
90  { &unsupport,   52, "",                             0}, \
91  { &unsupport,   53, "",                             0}, \
92  { &unsupport,   54, "",                             0}, \
93  { &unsupport,   55, "",                             0}, \
94  { &unsupport,   56, "",                             0}, \
95  { &unsupport,   57, "",                             0}, \
96  { &unsupport,   58, "",                             0}, \
97  { &unsupport,   59, "",                             0}, \
98  { &unsupport,   60, "",                             0}, \
99  { &unsupport,   61, "",                             0}, \
100  { &unsupport,   62, "",                             0}, \
101  { &unsupport,   63, "",                             0}, \
102  { &unsupport,   64, "",                             0}, \
103  { &unsupport,   65, "",                             0}, \
104  { &unsupport,   66, "",                             0}, \
105  { &unsupport,   67, "",                             0}, \
106  { &unsupport,   68, "",                             0}, \
107  { &unsupport,   69, "",                             0}, \
108  { &unsupport,   70, "",                             0}, \
109  { &unsupport,   71, "",                             0}, \
110  { &unsupport,   72, "",                             0}, \
111  { &unsupport,   73, "",                             0}, \
112  { &unsupport,   74, "",                             0}, \
113  { &unsupport,   75, "",                             0}, \
114  { &unsupport,   76, "",                             0}, \
115  { &unsupport,   77, "",                             0}, \
116  { &unsupport,   78, "",                             0}, \
117  { &unsupport,   79, "",                             0}, \
118  { &unsupport,   80, "",                             0}, \
119  { &unsupport,   81, "",                             0}, \
120  { &unsupport,   82, "",                             0}, \
121  { &unsupport,   83, "",                             0}, \
122  { &unsupport,   84, "",                             0}, \
123  { &unsupport,   85, "",                             0}, \
124  { &unsupport,   86, "",                             0}, \
125  { &unsupport,   87, "",                             0}, \
126  { &unsupport,   88, "",                             0}, \
127  { &unsupport,   89, "",                             0}, \
128  { &unsupport,   90, "",                             0}, \
129  { &unsupport,   91, "",                             0}, \
130  { &unsupport,   92, "",                             0}, \
131  { &unsupport,   93, "",                             0}, \
132  { &unsupport,   94, "",                             0}, \
133  { &unsupport,   95, "",                             0}, \
134  { &unsupport,   96, "",                             0}, \
135  { &unsupport,   97, "",                             0}, \
136  { &unsupport,   98, "",                             0}, \
137  { &unsupport,   99, "",                             0}, \
138  { &unsupport,  100, "R_MIPS16_26",                  0}, \
139  { &unsupport,  101, "R_MIPS16_GPREL",               0}, \
140  { &unsupport,  102, "R_MIPS16_GOT16",               0}, \
141  { &unsupport,  103, "R_MIPS16_CALL16",              0}, \
142  { &unsupport,  104, "R_MIPS16_HI16",                0}, \
143  { &unsupport,  105, "R_MIPS16_LO16",                0}, \
144  { &unsupport,  106, "R_MIPS16_TLS_GD",              0}, \
145  { &unsupport,  107, "R_MIPS16_TLS_LDM",             0}, \
146  { &unsupport,  108, "R_MIPS16_TLS_DTPREL_HI16",     0}, \
147  { &unsupport,  109, "R_MIPS16_TLS_DTPREL_LO16",     0}, \
148  { &unsupport,  110, "R_MIPS16_TLS_GOTTPREL",        0}, \
149  { &unsupport,  111, "R_MIPS16_TLS_TPREL_HI16",      0}, \
150  { &unsupport,  112, "R_MIPS16_TLS_TPREL_LO16",      0}, \
151  { &unsupport,  113, "",                             0}, \
152  { &unsupport,  114, "",                             0}, \
153  { &unsupport,  115, "",                             0}, \
154  { &unsupport,  116, "",                             0}, \
155  { &unsupport,  117, "",                             0}, \
156  { &unsupport,  118, "",                             0}, \
157  { &unsupport,  119, "",                             0}, \
158  { &unsupport,  120, "",                             0}, \
159  { &unsupport,  121, "",                             0}, \
160  { &unsupport,  122, "",                             0}, \
161  { &unsupport,  123, "",                             0}, \
162  { &unsupport,  124, "",                             0}, \
163  { &unsupport,  125, "",                             0}, \
164  { &unsupport,  126, "R_MIPS_COPY",                  0}, \
165  { &unsupport,  127, "R_MIPS_JUMP_SLOT",             0}, \
166  { &unsupport,  128, "",                             0}, \
167  { &unsupport,  129, "",                             0}, \
168  { &unsupport,  130, "",                             0}, \
169  { &unsupport,  131, "",                             0}, \
170  { &unsupport,  132, "",                             0}, \
171  { &unsupport,  133, "R_MICROMIPS_26_S1",            0}, \
172  { &unsupport,  134, "R_MICROMIPS_HI16",             0}, \
173  { &unsupport,  135, "R_MICROMIPS_LO16",             0}, \
174  { &unsupport,  136, "R_MICROMIPS_GPREL16",          0}, \
175  { &unsupport,  137, "R_MICROMIPS_LITERAL",          0}, \
176  { &unsupport,  138, "R_MICROMIPS_GOT16",            0}, \
177  { &unsupport,  139, "R_MICROMIPS_PC7_S1",           0}, \
178  { &unsupport,  140, "R_MICROMIPS_PC10_S1",          0}, \
179  { &unsupport,  141, "R_MICROMIPS_PC16_S1",          0}, \
180  { &unsupport,  142, "R_MICROMIPS_CALL16",           0}, \
181  { &unsupport,  143, "R_MICROMIPS_GOT_DISP",         0}, \
182  { &unsupport,  144, "R_MICROMIPS_GOT_PAGE",         0}, \
183  { &unsupport,  145, "R_MICROMIPS_GOT_OFST",         0}, \
184  { &unsupport,  146, "R_MICROMIPS_GOT_HI16",         0}, \
185  { &unsupport,  147, "R_MICROMIPS_GOT_LO16",         0}, \
186  { &unsupport,  148, "R_MICROMIPS_SUB",              0}, \
187  { &unsupport,  149, "R_MICROMIPS_HIGHER",           0}, \
188  { &unsupport,  150, "R_MICROMIPS_HIGHEST",          0}, \
189  { &unsupport,  151, "R_MICROMIPS_CALL_HI16",        0}, \
190  { &unsupport,  152, "R_MICROMIPS_CALL_LO16",        0}, \
191  { &unsupport,  153, "R_MICROMIPS_SCN_DISP",         0}, \
192  { &unsupport,  154, "R_MICROMIPS_JALR",             0}, \
193  { &unsupport,  155, "R_MICROMIPS_HI0_LO16",         0}, \
194  { &unsupport,  156, "",                             0}, \
195  { &unsupport,  157, "",                             0}, \
196  { &unsupport,  158, "",                             0}, \
197  { &unsupport,  159, "",                             0}, \
198  { &unsupport,  160, "",                             0}, \
199  { &unsupport,  161, "",                             0}, \
200  { &unsupport,  162, "R_MICROMIPS_TLS_GD",           0}, \
201  { &unsupport,  163, "R_MICROMIPS_TLS_LDM",          0}, \
202  { &unsupport,  164, "R_MICROMIPS_TLS_DTPREL_HI16",  0}, \
203  { &unsupport,  165, "R_MICROMIPS_TLS_DTPREL_LO16",  0}, \
204  { &unsupport,  166, "R_MICROMIPS_TLS_GOTTPREL",     0}, \
205  { &unsupport,  167, "",                             0}, \
206  { &unsupport,  168, "",                             0}, \
207  { &unsupport,  169, "R_MICROMIPS_TLS_TPREL_HI16",   0}, \
208  { &unsupport,  170, "R_MICROMIPS_TLS_TPREL_LO16",   0}, \
209  { &unsupport,  171, "",                             0}, \
210  { &unsupport,  172, "R_MICROMIPS_GPREL7_S2",        0}, \
211  { &unsupport,  173, "R_MICROMIPS_PC23_S2",          0}, \
212  { &unsupport,  174, "",                             0}, \
213  { &unsupport,  175, "",                             0}, \
214  { &unsupport,  176, "",                             0}, \
215  { &unsupport,  177, "",                             0}, \
216  { &unsupport,  178, "",                             0}, \
217  { &unsupport,  179, "",                             0}, \
218  { &unsupport,  180, "",                             0}, \
219  { &unsupport,  181, "",                             0}, \
220  { &unsupport,  182, "",                             0}, \
221  { &unsupport,  183, "",                             0}, \
222  { &unsupport,  184, "",                             0}, \
223  { &unsupport,  185, "",                             0}, \
224  { &unsupport,  186, "",                             0}, \
225  { &unsupport,  187, "",                             0}, \
226  { &unsupport,  188, "",                             0}, \
227  { &unsupport,  189, "",                             0}, \
228  { &unsupport,  190, "",                             0}, \
229  { &unsupport,  191, "",                             0}, \
230  { &unsupport,  192, "",                             0}, \
231  { &unsupport,  193, "",                             0}, \
232  { &unsupport,  194, "",                             0}, \
233  { &unsupport,  195, "",                             0}, \
234  { &unsupport,  196, "",                             0}, \
235  { &unsupport,  197, "",                             0}, \
236  { &unsupport,  198, "",                             0}, \
237  { &unsupport,  199, "",                             0}, \
238  { &la25lui,    200, "R_MIPS_LA25_LUI",             16}, \
239  { &la25j,      201, "R_MIPS_LA25_J",               26}, \
240  { &la25add,    202, "R_MIPS_LA25_ADD",             16}, \
241  { &unsupport,  203, "",                             0}, \
242  { &unsupport,  204, "",                             0}, \
243  { &unsupport,  205, "",                             0}, \
244  { &unsupport,  206, "",                             0}, \
245  { &unsupport,  207, "",                             0}, \
246  { &unsupport,  208, "",                             0}, \
247  { &unsupport,  209, "",                             0}, \
248  { &unsupport,  210, "",                             0}, \
249  { &unsupport,  211, "",                             0}, \
250  { &unsupport,  212, "",                             0}, \
251  { &unsupport,  213, "",                             0}, \
252  { &unsupport,  214, "",                             0}, \
253  { &unsupport,  215, "",                             0}, \
254  { &unsupport,  216, "",                             0}, \
255  { &unsupport,  217, "",                             0}, \
256  { &unsupport,  218, "",                             0}, \
257  { &unsupport,  219, "",                             0}, \
258  { &unsupport,  220, "",                             0}, \
259  { &unsupport,  221, "",                             0}, \
260  { &unsupport,  222, "",                             0}, \
261  { &unsupport,  223, "",                             0}, \
262  { &unsupport,  224, "",                             0}, \
263  { &unsupport,  225, "",                             0}, \
264  { &unsupport,  226, "",                             0}, \
265  { &unsupport,  227, "",                             0}, \
266  { &unsupport,  228, "",                             0}, \
267  { &unsupport,  229, "",                             0}, \
268  { &unsupport,  230, "",                             0}, \
269  { &unsupport,  231, "",                             0}, \
270  { &unsupport,  232, "",                             0}, \
271  { &unsupport,  233, "",                             0}, \
272  { &unsupport,  234, "",                             0}, \
273  { &unsupport,  235, "",                             0}, \
274  { &unsupport,  236, "",                             0}, \
275  { &unsupport,  237, "",                             0}, \
276  { &unsupport,  238, "",                             0}, \
277  { &unsupport,  239, "",                             0}, \
278  { &unsupport,  240, "",                             0}, \
279  { &unsupport,  241, "",                             0}, \
280  { &unsupport,  242, "",                             0}, \
281  { &unsupport,  243, "",                             0}, \
282  { &unsupport,  244, "",                             0}, \
283  { &unsupport,  245, "",                             0}, \
284  { &unsupport,  246, "",                             0}, \
285  { &unsupport,  247, "",                             0}, \
286  { &pc32,       248, "R_MIPS_PC32",                  0}, \
287  { &unsupport,  249, "",                             0}, \
288  { &unsupport,  250, "R_MIPS_GNU_REL16_S2",          0}, \
289  { &unsupport,  251, "",                             0}, \
290  { &unsupport,  252, "",                             0}, \
291  { &unsupport,  253, "R_MIPS_GNU_VTINHERIT",         0}, \
292  { &unsupport,  254, "R_MIPS_GNU_VTENTRY",           0}
293