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