ARMRelocationFunctions.h revision 0dea6bc96bb52346737966839ac68644f7939f58
1//===- ARMRelocationFunction.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_ARM_APPLY_RELOC_FUNC(Name) \
11static ARMRelocator::Result Name    (Relocation& pEntry, \
12                                     ARMRelocator& pParent);
13
14#define DECL_ARM_APPLY_RELOC_FUNCS \
15DECL_ARM_APPLY_RELOC_FUNC(none)             \
16DECL_ARM_APPLY_RELOC_FUNC(abs32)            \
17DECL_ARM_APPLY_RELOC_FUNC(rel32)            \
18DECL_ARM_APPLY_RELOC_FUNC(gotoff32)         \
19DECL_ARM_APPLY_RELOC_FUNC(base_prel)        \
20DECL_ARM_APPLY_RELOC_FUNC(got_brel)         \
21DECL_ARM_APPLY_RELOC_FUNC(call)             \
22DECL_ARM_APPLY_RELOC_FUNC(thm_call)         \
23DECL_ARM_APPLY_RELOC_FUNC(movw_prel_nc)     \
24DECL_ARM_APPLY_RELOC_FUNC(movw_abs_nc)      \
25DECL_ARM_APPLY_RELOC_FUNC(movt_abs)         \
26DECL_ARM_APPLY_RELOC_FUNC(movt_prel)        \
27DECL_ARM_APPLY_RELOC_FUNC(thm_movw_abs_nc)  \
28DECL_ARM_APPLY_RELOC_FUNC(thm_movw_prel_nc) \
29DECL_ARM_APPLY_RELOC_FUNC(thm_movw_brel)    \
30DECL_ARM_APPLY_RELOC_FUNC(thm_movt_abs)     \
31DECL_ARM_APPLY_RELOC_FUNC(thm_movt_prel)    \
32DECL_ARM_APPLY_RELOC_FUNC(prel31)           \
33DECL_ARM_APPLY_RELOC_FUNC(got_prel)         \
34DECL_ARM_APPLY_RELOC_FUNC(tls)              \
35DECL_ARM_APPLY_RELOC_FUNC(thm_jump8)        \
36DECL_ARM_APPLY_RELOC_FUNC(thm_jump11)       \
37DECL_ARM_APPLY_RELOC_FUNC(thm_jump19)       \
38DECL_ARM_APPLY_RELOC_FUNC(unsupport)
39
40
41#define DECL_ARM_APPLY_RELOC_FUNC_PTRS \
42  { &none,               0, "R_ARM_NONE"              },  \
43  { &call,               1, "R_ARM_PC24"              },  \
44  { &abs32,              2, "R_ARM_ABS32"             },  \
45  { &rel32,              3, "R_ARM_REL32"             },  \
46  { &unsupport,          4, "R_ARM_LDR_PC_G0"         },  \
47  { &unsupport,          5, "R_ARM_ABS16"             },  \
48  { &unsupport,          6, "R_ARM_ABS12"             },  \
49  { &unsupport,          7, "R_ARM_THM_ABS5"          },  \
50  { &unsupport,          8, "R_ARM_ABS8"              },  \
51  { &unsupport,          9, "R_ARM_SBREL32"           },  \
52  { &thm_call,          10, "R_ARM_THM_CALL"          },  \
53  { &unsupport,         11, "R_ARM_THM_PC8"           },  \
54  { &unsupport,         12, "R_ARM_BREL_ADJ"          },  \
55  { &unsupport,         13, "R_ARM_TLS_DESC"          },  \
56  { &unsupport,         14, "R_ARM_THM_SWI8"          },  \
57  { &unsupport,         15, "R_ARM_XPC25"             },  \
58  { &unsupport,         16, "R_ARM_THM_XPC22"         },  \
59  { &unsupport,         17, "R_ARM_TLS_DTPMOD32"      },  \
60  { &unsupport,         18, "R_ARM_TLS_DTPOFF32"      },  \
61  { &unsupport,         19, "R_ARM_TLS_TPOFF32"       },  \
62  { &unsupport,         20, "R_ARM_COPY"              },  \
63  { &unsupport,         21, "R_ARM_GLOB_DAT"          },  \
64  { &unsupport,         22, "R_ARM_JUMP_SLOT"         },  \
65  { &unsupport,         23, "R_ARM_RELATIVE"          },  \
66  { &gotoff32,          24, "R_ARM_GOTOFF32"          },  \
67  { &base_prel,         25, "R_ARM_BASE_PREL"         },  \
68  { &got_brel,          26, "R_ARM_GOT_BREL"          },  \
69  { &call,              27, "R_ARM_PLT32"             },  \
70  { &call,              28, "R_ARM_CALL"              },  \
71  { &call,              29, "R_ARM_JUMP24"            },  \
72  { &thm_call,          30, "R_ARM_THM_JUMP24"        },  \
73  { &unsupport,         31, "R_ARM_BASE_ABS"          },  \
74  { &unsupport,         32, "R_ARM_ALU_PCREL_7_0"     },  \
75  { &unsupport,         33, "R_ARM_ALU_PCREL_15_8"    },  \
76  { &unsupport,         34, "R_ARM_ALU_PCREL_23_15"   },  \
77  { &unsupport,         35, "R_ARM_LDR_SBREL_11_0_NC" },  \
78  { &unsupport,         36, "R_ARM_ALU_SBREL_19_12_NC"},  \
79  { &unsupport,         37, "R_ARM_ALU_SBREL_27_20_CK"},  \
80  { &abs32,             38, "R_ARM_TARGET1"           },  \
81  { &unsupport,         39, "R_ARM_SBREL31"           },  \
82  { &none,              40, "R_ARM_V4BX"              },  \
83  { &got_prel,          41, "R_ARM_TARGET2"           },  \
84  { &prel31,            42, "R_ARM_PREL31"            },  \
85  { &movw_abs_nc,       43, "R_ARM_MOVW_ABS_NC"       },  \
86  { &movt_abs,          44, "R_ARM_MOVT_ABS"          },  \
87  { &movw_prel_nc,      45, "R_ARM_MOVW_PREL_NC"      },  \
88  { &movt_prel,         46, "R_ARM_MOVT_PREL"         },  \
89  { &thm_movw_abs_nc,   47, "R_ARM_THM_MOVW_ABS_NC"   },  \
90  { &thm_movt_abs,      48, "R_ARM_THM_MOVT_ABS"      },  \
91  { &thm_movw_prel_nc,  49, "R_ARM_THM_MOVW_PREL_NC"  },  \
92  { &thm_movt_prel,     50, "R_ARM_THM_MOVT_PREL"     },  \
93  { &thm_jump19,        51, "R_ARM_THM_JUMP19"        },  \
94  { &unsupport,         52, "R_ARM_THM_JUMP6"         },  \
95  { &unsupport,         53, "R_ARM_THM_ALU_PREL_11_0" },  \
96  { &unsupport,         54, "R_ARM_THM_PC12"          },  \
97  { &unsupport,         55, "R_ARM_ABS32_NOI"         },  \
98  { &unsupport,         56, "R_ARM_REL32_NOI"         },  \
99  { &unsupport,         57, "R_ARM_ALU_PC_G0_NC"      },  \
100  { &unsupport,         58, "R_ARM_ALU_PC_G0"         },  \
101  { &unsupport,         59, "R_ARM_ALU_PC_G1_NC"      },  \
102  { &unsupport,         60, "R_ARM_ALU_PC_G1"         },  \
103  { &unsupport,         61, "R_ARM_ALU_PC_G2"         },  \
104  { &unsupport,         62, "R_ARM_LDR_PC_G1"         },  \
105  { &unsupport,         63, "R_ARM_LDR_PC_G2"         },  \
106  { &unsupport,         64, "R_ARM_LDRS_PC_G0"        },  \
107  { &unsupport,         65, "R_ARM_LDRS_PC_G1"        },  \
108  { &unsupport,         66, "R_ARM_LDRS_PC_G2"        },  \
109  { &unsupport,         67, "R_ARM_LDC_PC_G0"         },  \
110  { &unsupport,         68, "R_ARM_LDC_PC_G1"         },  \
111  { &unsupport,         69, "R_ARM_LDC_PC_G2"         },  \
112  { &unsupport,         70, "R_ARM_ALU_SB_G0_NC"      },  \
113  { &unsupport,         71, "R_ARM_ALU_SB_G0"         },  \
114  { &unsupport,         72, "R_ARM_ALU_SB_G1_NC"      },  \
115  { &unsupport,         73, "R_ARM_ALU_SB_G1"         },  \
116  { &unsupport,         74, "R_ARM_ALU_SB_G2"         },  \
117  { &unsupport,         75, "R_ARM_LDR_SB_G0"         },  \
118  { &unsupport,         76, "R_ARM_LDR_SB_G1"         },  \
119  { &unsupport,         77, "R_ARM_LDR_SB_G2"         },  \
120  { &unsupport,         78, "R_ARM_LDRS_SB_G0"        },  \
121  { &unsupport,         79, "R_ARM_LDRS_SB_G1"        },  \
122  { &unsupport,         80, "R_ARM_LDRS_SB_G2"        },  \
123  { &unsupport,         81, "R_ARM_LDC_SB_G0"         },  \
124  { &unsupport,         82, "R_ARM_LDC_SB_G1"         },  \
125  { &unsupport,         83, "R_ARM_LDC_SB_G2"         },  \
126  { &unsupport,         84, "R_ARM_MOVW_BREL_NC"      },  \
127  { &unsupport,         85, "R_ARM_MOVT_BREL"         },  \
128  { &unsupport,         86, "R_ARM_MOVW_BREL"         },  \
129  { &thm_movw_brel,     87, "R_ARM_THM_MOVW_BREL_NC"  },  \
130  { &thm_movt_prel,     88, "R_ARM_THM_MOVT_BREL"     },  \
131  { &thm_movw_brel,     89, "R_ARM_THM_MOVW_BREL"     },  \
132  { &unsupport,         90, "R_ARM_TLS_GOTDESC"       },  \
133  { &unsupport,         91, "R_ARM_TLS_CALL"          },  \
134  { &unsupport,         92, "R_ARM_TLS_DESCSEQ"       },  \
135  { &unsupport,         93, "R_ARM_THM_TLS_CALL"      },  \
136  { &unsupport,         94, "R_ARM_PLT32_ABS"         },  \
137  { &unsupport,         95, "R_ARM_GOT_ABS"           },  \
138  { &got_prel,          96, "R_ARM_GOT_PREL"          },  \
139  { &unsupport,         97, "R_ARM_GOT_PREL12"        },  \
140  { &unsupport,         98, "R_ARM_GOTOFF12"          },  \
141  { &unsupport,         99, "R_ARM_GOTRELAX"          },  \
142  { &unsupport,        100, "R_ARM_GNU_VTENTRY"       },  \
143  { &unsupport,        101, "R_ARM_GNU_VTINERIT"      },  \
144  { &thm_jump11,       102, "R_ARM_THM_JUMP11"        },  \
145  { &thm_jump8,        103, "R_ARM_THM_JUMP8"         },  \
146  { &tls,              104, "R_ARM_TLS_GD32"          },  \
147  { &unsupport,        105, "R_ARM_TLS_LDM32"         },  \
148  { &unsupport,        106, "R_ARM_TLS_LDO32"         },  \
149  { &tls,              107, "R_ARM_TLS_IE32"          },  \
150  { &tls,              108, "R_ARM_TLS_LE32"          },  \
151  { &unsupport,        109, "R_ARM_TLS_LDO12"         },  \
152  { &unsupport,        110, "R_ARM_TLS_LE12"          },  \
153  { &unsupport,        111, "R_ARM_TLS_IE12GP"        },  \
154  { &unsupport,        112, "R_ARM_PRIVATE_0"         },  \
155  { &unsupport,        113, "R_ARM_PRIVATE_1"         },  \
156  { &unsupport,        114, "R_ARM_PRIVATE_2"         },  \
157  { &unsupport,        115, "R_ARM_PRIVATE_3"         },  \
158  { &unsupport,        116, "R_ARM_PRIVATE_4"         },  \
159  { &unsupport,        117, "R_ARM_PRIVATE_5"         },  \
160  { &unsupport,        118, "R_ARM_PRIVATE_6"         },  \
161  { &unsupport,        119, "R_ARM_PRIVATE_7"         },  \
162  { &unsupport,        120, "R_ARM_PRIVATE_8"         },  \
163  { &unsupport,        121, "R_ARM_PRIVATE_9"         },  \
164  { &unsupport,        122, "R_ARM_PRIVATE_10"        },  \
165  { &unsupport,        123, "R_ARM_PRIVATE_11"        },  \
166  { &unsupport,        124, "R_ARM_PRIVATE_12"        },  \
167  { &unsupport,        125, "R_ARM_PRIVATE_13"        },  \
168  { &unsupport,        126, "R_ARM_PRIVATE_14"        },  \
169  { &unsupport,        127, "R_ARM_PRIVATE_15"        },  \
170  { &unsupport,        128, "R_ARM_ME_TOO"            },  \
171  { &unsupport,        129, "R_ARM_THM_TLS_DESCSEQ16" },  \
172  { &unsupport,        130, "R_ARM_THM_TLS_DESCSEQ32" }
173