1// arm-reloc.def -- ARM relocation definitions. 2 3// Copyright (C) 2010-2014 Free Software Foundation, Inc. 4// Written by Doug Kwan <dougkwan@google.com>. 5 6// This file is part of gold. 7 8// This program is free software; you can redistribute it and/or modify 9// it under the terms of the GNU General Public License as published by 10// the Free Software Foundation; either version 3 of the License, or 11// (at your option) any later version. 12 13// This program is distributed in the hope that it will be useful, 14// but WITHOUT ANY WARRANTY; without even the implied warranty of 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16// GNU General Public License for more details. 17 18// You should have received a copy of the GNU General Public License 19// along with this program; if not, write to the Free Software 20// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 21// MA 02110-1301, USA. 22 23// The information here is based on the official ARM document "ELF for ARM 24// Architecture" (Document number ARM IHI 0044C). The first five columns of 25// the table below are derived from Table 4-8 in the ARM ELF document. Each 26// relocation from Table 4-8 corresponds to one relocation definition in the 27// table below. A relocation definition has the following information: 28// 29// Name: This is the name of the relocation without the "R_ARM_" prefix. 30// 31// Type: Relocation type. There are four. 32// - STATIC for static relocations processed by a static linker. 33// - DYNAMIC for dynamic relocations processed by a dynamic linker. 34// - PRIVATE for R_ARM_PRIVATE_<n> private relocation type. 35// - OBSOLETE for old relocation types no longer used. 36// We do not use DEPRECATED as a distinct type since we still have to 37// handle deprecated relocations so we one of the types above. 38// 39// Deprecated: Whether this is a deprecated relocation type. The linker 40// is expected to handle these though they should not be generated by fully 41// conforming tool-chains. 42// 43// Operation: An expression specifying how the linker should perform a 44// relocation. If there is no operation or the operation cannot be 45// specified, it is "NONE". 46// 47// Implemented: Whether this is implemented by the gold. 48// 49// Group_index: For a group relocation type, it is one of 0, 1 or 2. For 50// a non-group relocation type, it is -1. 51// 52// Overflow: Whether gold should check for overflow. This is "No" by default 53// for relocation types DYNAMIC, PRIVATE and OBSOLETE. 54// 55// Overflow-----------------------------------------------------------------+ 56// Group index----------------------------------------------------------+ | 57// Implemented-------------------------------------------------------+ | | 58// Operation-------------------------------+ | | | 59// Class----------------------------+ | | | | 60// Deprecated--------------------+ | | | | | 61// Type----------------+ | | | | | | 62// Name | | | | | | | 63// | | | | | | | | 64RD(NONE , STATIC , N, MISC , NONE , Y, -1, N) 65RD(PC24 , STATIC , Y, ARM , ((S + A) | T) - P , Y, -1, Y) 66RD(ABS32 , STATIC , N, DATA , (S + A) | T , Y, -1, N) 67RD(REL32 , STATIC , N, DATA , ((S + A) | T) - P , Y, -1, N) 68RD(LDR_PC_G0 , STATIC , N, ARM , S + A - P , Y, 0, Y) 69RD(ABS16 , STATIC , N, DATA , S + A , Y, -1, Y) 70RD(ABS12 , STATIC , N, ARM , S + A , Y, -1, Y) 71RD(THM_ABS5 , STATIC , N, THM16, S + A , Y, -1, Y) 72RD(ABS8 , STATIC , N, DATA , S + A , Y, -1, Y) 73RD(SBREL32 , STATIC , N, DATA , ((S + A) | T) - B(S) , N, -1, N) 74RD(THM_CALL , STATIC , N, THM32, ((S + A) | T) - P , Y, -1, Y) 75RD(THM_PC8 , STATIC , N, THM16, S + A - Pa , Y, -1, Y) 76RD(BREL_ADJ , DYNAMIC , N, DATA , DELTA_B(S) + A , Y, -1, N) 77RD(TLS_DESC , DYNAMIC , N, DATA , NONE , Y, -1, N) 78RD(THM_SWI8 , OBSOLETE, N, NONE , NONE , N, -1, N) 79RD(XPC25 , OBSOLETE, N, NONE , NONE , N, -1, N) 80RD(THM_XPC22 , OBSOLETE, N, NONE , NONE , N, -1, N) 81RD(TLS_DTPMOD32 , DYNAMIC , N, DATA , Module(S) , Y, -1, N) 82RD(TLS_DTPOFF32 , DYNAMIC , N, DATA , S + A - TLS , Y, -1, N) 83RD(TLS_TPOFF32 , DYNAMIC , N, DATA , S + A - tp , Y, -1, N) 84RD(COPY , DYNAMIC , N, MISC , NONE , Y, -1, N) 85RD(GLOB_DAT , DYNAMIC , N, DATA , (S + A) | T , Y, -1, N) 86RD(JUMP_SLOT , DYNAMIC , N, DATA , (S + A) | T , Y, -1, N) 87RD(RELATIVE , DYNAMIC , N, DATA , B(S) + A , Y, -1, N) 88RD(GOTOFF32 , STATIC , N, DATA , ((S + A) | T) - GOT_ORG, Y, -1, N) 89RD(BASE_PREL , STATIC , N, DATA , B(S) + A - P , Y, -1, N) 90RD(GOT_BREL , STATIC , N, DATA , GOT(S) + A - GOT_ORG , Y, -1, N) 91RD(PLT32 , STATIC , Y, ARM , ((S + A) | T) - P , Y, -1, Y) 92RD(CALL , STATIC , N, ARM , ((S + A) | T) - P , Y, -1, Y) 93RD(JUMP24 , STATIC , N, ARM , ((S + A) | T) - P , Y, -1, Y) 94RD(THM_JUMP24 , STATIC , N, THM32, ((S + A) | T) - P , Y, -1, Y) 95RD(BASE_ABS , STATIC , N, DATA , B(S) + A , Y, -1, N) 96RD(ALU_PCREL_7_0 , OBSOLETE, N, NONE , NONE , N, -1, N) 97RD(ALU_PCREL_15_8 , OBSOLETE, N, NONE , NONE , N, -1, N) 98RD(ALU_PCREL_23_15 , OBSOLETE, N, NONE , NONE , N, -1, N) 99RD(LDR_SBREL_11_0_NC , STATIC , Y, ARM , S + A - B(S) , N, -1, N) 100RD(ALU_SBREL_19_12_NC, STATIC , Y, ARM , S + A - B(S) , N, -1, N) 101RD(ALU_SBREL_27_20_CK, STATIC , Y, ARM , S + A - B(S) , N, -1, Y) 102RD(TARGET1 , STATIC , N, MISC , NONE , Y, -1, N) 103RD(SBREL31 , STATIC , Y, DATA , ((S + A) | T) - B(S) , N, -1, N) 104RD(V4BX , STATIC , N, MISC , NONE , Y, -1, N) 105RD(TARGET2 , STATIC , N, MISC , NONE , Y, -1, N) 106RD(PREL31 , STATIC , N, DATA , ((S + A) | T) - P , Y, -1, Y) 107RD(MOVW_ABS_NC , STATIC , N, ARM , (S + A) | T , Y, -1, N) 108RD(MOVT_ABS , STATIC , N, ARM , S + A , Y, -1, Y) 109RD(MOVW_PREL_NC , STATIC , N, ARM , ((S + A) | T) - P , Y, -1, N) 110RD(MOVT_PREL , STATIC , N, ARM , (S + A) - P , Y, -1, Y) 111RD(THM_MOVW_ABS_NC , STATIC , N, THM32, (S + A) | T , Y, -1, N) 112RD(THM_MOVT_ABS , STATIC , N, THM32, S + A , Y, -1, N) 113RD(THM_MOVW_PREL_NC , STATIC , N, THM32, ((S + A) | T) - P , Y, -1, N) 114RD(THM_MOVT_PREL , STATIC , N, THM32, S + A - P , Y, -1, N) 115RD(THM_JUMP19 , STATIC , N, THM32, ((S + A) | T) - P , Y, -1, Y) 116RD(THM_JUMP6 , STATIC , N, THM16, S + A - P , Y, -1, Y) 117RD(THM_ALU_PREL_11_0 , STATIC , N, THM32, ((S + A) | T) - Pa , Y, -1, Y) 118RD(THM_PC12 , STATIC , N, THM32, S + A - Pa , Y, -1, Y) 119RD(ABS32_NOI , STATIC , N, DATA , S + A , Y, -1, N) 120RD(REL32_NOI , STATIC , N, DATA , S + A - P , N, -1, N) 121RD(ALU_PC_G0_NC , STATIC , N, ARM , ((S + A) | T) - P , Y, 0, N) 122RD(ALU_PC_G0 , STATIC , N, ARM , ((S + A) | T) - P , Y, 0, Y) 123RD(ALU_PC_G1_NC , STATIC , N, ARM , ((S + A) | T) - P , Y, 1, N) 124RD(ALU_PC_G1 , STATIC , N, ARM , ((S + A) | T) - P , Y, 1, Y) 125RD(ALU_PC_G2 , STATIC , N, ARM , ((S + A) | T) - P , Y, 2, Y) 126RD(LDR_PC_G1 , STATIC , N, ARM , S + A - P , Y, 1, Y) 127RD(LDR_PC_G2 , STATIC , N, ARM , S + A - P , Y, 2, Y) 128RD(LDRS_PC_G0 , STATIC , N, ARM , S + A - P , Y, 0, Y) 129RD(LDRS_PC_G1 , STATIC , N, ARM , S + A - P , Y, 1, Y) 130RD(LDRS_PC_G2 , STATIC , N, ARM , S + A - P , Y, 2, Y) 131RD(LDC_PC_G0 , STATIC , N, ARM , S + A - P , Y, 0, Y) 132RD(LDC_PC_G1 , STATIC , N, ARM , S + A - P , Y, 1, Y) 133RD(LDC_PC_G2 , STATIC , N, ARM , S + A - P , Y, 2, Y) 134RD(ALU_SB_G0_NC , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, 0, N) 135RD(ALU_SB_G0 , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, 0, Y) 136RD(ALU_SB_G1_NC , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, 1, N) 137RD(ALU_SB_G1 , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, 1, Y) 138RD(ALU_SB_G2 , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, 2, Y) 139RD(LDR_SB_G0 , STATIC , N, ARM , S + A - B(S) , Y, 0, Y) 140RD(LDR_SB_G1 , STATIC , N, ARM , S + A - B(S) , Y, 1, Y) 141RD(LDR_SB_G2 , STATIC , N, ARM , S + A - B(S) , Y, 2, Y) 142RD(LDRS_SB_G0 , STATIC , N, ARM , S + A - B(S) , Y, 0, Y) 143RD(LDRS_SB_G1 , STATIC , N, ARM , S + A - B(S) , Y, 1, Y) 144RD(LDRS_SB_G2 , STATIC , N, ARM , S + A - B(S) , Y, 2, Y) 145RD(LDC_SB_G0 , STATIC , N, ARM , S + A - B(S) , Y, 0, Y) 146RD(LDC_SB_G1 , STATIC , N, ARM , S + A - B(S) , Y, 1, Y) 147RD(LDC_SB_G2 , STATIC , N, ARM , S + A - B(S) , Y, 2, Y) 148RD(MOVW_BREL_NC , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, -1, N) 149RD(MOVT_BREL , STATIC , N, ARM , S + A - B(S) , Y, -1, Y) 150RD(MOVW_BREL , STATIC , N, ARM , ((S + A) | T) - B(S) , Y, -1, Y) 151RD(THM_MOVW_BREL_NC , STATIC , N, THM32, ((S + A) | T) - B(S) , Y, -1, N) 152RD(THM_MOVT_BREL , STATIC , N, THM32, S + A - B(S) , Y, -1, N) 153RD(THM_MOVW_BREL , STATIC , N, THM32, ((S + A) | T) - B(S) , Y, -1, Y) 154RD(TLS_GOTDESC , STATIC , N, DATA , NONE , Y, -1, N) 155RD(TLS_CALL , STATIC , N, ARM , NONE , N, -1, Y) 156RD(TLS_DESCSEQ , STATIC , N, ARM , NONE , N, -1, Y) 157RD(THM_TLS_CALL , STATIC , N, THM32, NONE , N, -1, Y) 158RD(PLT32_ABS , STATIC , N, DATA , PLT(S) + A , N, -1, N) 159RD(GOT_ABS , STATIC , N, DATA , GOT(S) + A , N, -1, N) 160RD(GOT_PREL , STATIC , N, DATA , GOT(S) + A - P , Y, -1, N) 161RD(GOT_BREL12 , STATIC , N, ARM , GOT(S) + A - GOT_ORG , N, -1, Y) 162RD(GOTOFF12 , STATIC , N, ARM , S + A - GOT_ORG , N, -1, Y) 163RD(GOTRELAX , STATIC , N, MISC , NONE , N, -1, N) 164RD(GNU_VTENTRY , STATIC , Y, DATA , NONE , Y, -1, N) 165RD(GNU_VTINHERIT , STATIC , Y, DATA , NONE , Y, -1, N) 166RD(THM_JUMP11 , STATIC , N, THM16, S + A - P , Y, -1, Y) 167RD(THM_JUMP8 , STATIC , N, THM16, S + A - P , Y, -1, Y) 168RD(TLS_GD32 , STATIC , N, DATA , GOT(S) + A - P , Y, -1, N) 169RD(TLS_LDM32 , STATIC , N, DATA , GOT(S) + A - P , Y, -1, N) 170RD(TLS_LDO32 , STATIC , N, DATA , S + A - TLS , Y, -1, N) 171RD(TLS_IE32 , STATIC , N, DATA , GOT(S) + A - P , Y, -1, N) 172RD(TLS_LE32 , STATIC , N, DATA , S + A - tp , Y, -1, N) 173RD(TLS_LDO12 , STATIC , N, ARM , S + A - TLS , N, -1, Y) 174RD(TLS_LE12 , STATIC , N, ARM , S + A - tp , N, -1, Y) 175RD(TLS_IE12GP , STATIC , N, ARM , GOT(S) + A - GOT_ORG , N, -1, Y) 176RD(PRIVATE_0 , PRIVATE , N, NONE , NONE , N, -1, N) 177RD(PRIVATE_1 , PRIVATE , N, NONE , NONE , N, -1, N) 178RD(PRIVATE_2 , PRIVATE , N, NONE , NONE , N, -1, N) 179RD(PRIVATE_3 , PRIVATE , N, NONE , NONE , N, -1, N) 180RD(PRIVATE_4 , PRIVATE , N, NONE , NONE , N, -1, N) 181RD(PRIVATE_5 , PRIVATE , N, NONE , NONE , N, -1, N) 182RD(PRIVATE_6 , PRIVATE , N, NONE , NONE , N, -1, N) 183RD(PRIVATE_7 , PRIVATE , N, NONE , NONE , N, -1, N) 184RD(PRIVATE_8 , PRIVATE , N, NONE , NONE , N, -1, N) 185RD(PRIVATE_9 , PRIVATE , N, NONE , NONE , N, -1, N) 186RD(PRIVATE_10 , PRIVATE , N, NONE , NONE , N, -1, N) 187RD(PRIVATE_11 , PRIVATE , N, NONE , NONE , N, -1, N) 188RD(PRIVATE_12 , PRIVATE , N, NONE , NONE , N, -1, N) 189RD(PRIVATE_13 , PRIVATE , N, NONE , NONE , N, -1, N) 190RD(PRIVATE_14 , PRIVATE , N, NONE , NONE , N, -1, N) 191RD(PRIVATE_15 , PRIVATE , N, NONE , NONE , N, -1, N) 192RD(ME_TOO , OBSOLETE, N, NONE , NONE , N, -1, N) 193RD(THM_TLS_DESCSEQ16 , STATIC , N, THM16, NONE , N, -1, Y) 194RD(THM_TLS_DESCSEQ32 , STATIC , N, THM32, NONE , N, -1, Y) 195