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