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