133965Sjdp/* BFD support for handling relocation entries. 278828Sobrien Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3218822Sdim 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 433965Sjdp Free Software Foundation, Inc. 533965Sjdp Written by Cygnus Support. 633965Sjdp 7130561Sobrien This file is part of BFD, the Binary File Descriptor library. 833965Sjdp 9130561Sobrien This program is free software; you can redistribute it and/or modify 10130561Sobrien it under the terms of the GNU General Public License as published by 11130561Sobrien the Free Software Foundation; either version 2 of the License, or 12130561Sobrien (at your option) any later version. 1333965Sjdp 14130561Sobrien This program is distributed in the hope that it will be useful, 15130561Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 16130561Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17130561Sobrien GNU General Public License for more details. 1833965Sjdp 19130561Sobrien You should have received a copy of the GNU General Public License 20130561Sobrien along with this program; if not, write to the Free Software 21218822Sdim Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 2233965Sjdp 2333965Sjdp/* 2433965SjdpSECTION 2533965Sjdp Relocations 2633965Sjdp 2733965Sjdp BFD maintains relocations in much the same way it maintains 2833965Sjdp symbols: they are left alone until required, then read in 2960484Sobrien en-masse and translated into an internal form. A common 3033965Sjdp routine <<bfd_perform_relocation>> acts upon the 3133965Sjdp canonical form to do the fixup. 3233965Sjdp 3333965Sjdp Relocations are maintained on a per section basis, 3433965Sjdp while symbols are maintained on a per BFD basis. 3533965Sjdp 3633965Sjdp All that a back end has to do to fit the BFD interface is to create 3733965Sjdp a <<struct reloc_cache_entry>> for each relocation 3833965Sjdp in a particular section, and fill in the right bits of the structures. 3933965Sjdp 4033965Sjdp@menu 4133965Sjdp@* typedef arelent:: 4233965Sjdp@* howto manager:: 4333965Sjdp@end menu 4433965Sjdp 4533965Sjdp*/ 4633965Sjdp 4733965Sjdp/* DO compile in the reloc_code name table from libbfd.h. */ 4833965Sjdp#define _BFD_MAKE_TABLE_bfd_reloc_code_real 4933965Sjdp 50218822Sdim#include "sysdep.h" 5133965Sjdp#include "bfd.h" 5233965Sjdp#include "bfdlink.h" 5333965Sjdp#include "libbfd.h" 5433965Sjdp/* 5533965SjdpDOCDD 5633965SjdpINODE 5733965Sjdp typedef arelent, howto manager, Relocations, Relocations 5833965Sjdp 5933965SjdpSUBSECTION 6033965Sjdp typedef arelent 6133965Sjdp 6233965Sjdp This is the structure of a relocation entry: 6333965Sjdp 6433965SjdpCODE_FRAGMENT 6533965Sjdp. 6633965Sjdp.typedef enum bfd_reloc_status 6733965Sjdp.{ 6891041Sobrien. {* No errors detected. *} 6933965Sjdp. bfd_reloc_ok, 7033965Sjdp. 7191041Sobrien. {* The relocation was performed, but there was an overflow. *} 7233965Sjdp. bfd_reloc_overflow, 7333965Sjdp. 7491041Sobrien. {* The address to relocate was not within the section supplied. *} 7533965Sjdp. bfd_reloc_outofrange, 7633965Sjdp. 7791041Sobrien. {* Used by special functions. *} 7833965Sjdp. bfd_reloc_continue, 7933965Sjdp. 8091041Sobrien. {* Unsupported relocation size requested. *} 8133965Sjdp. bfd_reloc_notsupported, 8233965Sjdp. 8391041Sobrien. {* Unused. *} 8433965Sjdp. bfd_reloc_other, 8533965Sjdp. 8691041Sobrien. {* The symbol to relocate against was undefined. *} 8733965Sjdp. bfd_reloc_undefined, 8833965Sjdp. 8989857Sobrien. {* The relocation was performed, but may not be ok - presently 9089857Sobrien. generated only when linking i960 coff files with i960 b.out 9189857Sobrien. symbols. If this type is returned, the error_message argument 9289857Sobrien. to bfd_perform_relocation will be set. *} 9333965Sjdp. bfd_reloc_dangerous 9433965Sjdp. } 9533965Sjdp. bfd_reloc_status_type; 9633965Sjdp. 9733965Sjdp. 9833965Sjdp.typedef struct reloc_cache_entry 9933965Sjdp.{ 10091041Sobrien. {* A pointer into the canonical table of pointers. *} 101130561Sobrien. struct bfd_symbol **sym_ptr_ptr; 10233965Sjdp. 10391041Sobrien. {* offset in section. *} 10433965Sjdp. bfd_size_type address; 10533965Sjdp. 10691041Sobrien. {* addend for relocation value. *} 10733965Sjdp. bfd_vma addend; 10833965Sjdp. 10991041Sobrien. {* Pointer to how to perform the required relocation. *} 11033965Sjdp. reloc_howto_type *howto; 11133965Sjdp. 11291041Sobrien.} 11391041Sobrien.arelent; 11491041Sobrien. 11533965Sjdp*/ 11633965Sjdp 11733965Sjdp/* 11833965SjdpDESCRIPTION 11933965Sjdp 12033965Sjdp Here is a description of each of the fields within an <<arelent>>: 12133965Sjdp 12233965Sjdp o <<sym_ptr_ptr>> 12333965Sjdp 12433965Sjdp The symbol table pointer points to a pointer to the symbol 125130561Sobrien associated with the relocation request. It is the pointer 126130561Sobrien into the table returned by the back end's 127130561Sobrien <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is 128130561Sobrien referenced through a pointer to a pointer so that tools like 129130561Sobrien the linker can fix up all the symbols of the same name by 130130561Sobrien modifying only one pointer. The relocation routine looks in 131130561Sobrien the symbol and uses the base of the section the symbol is 132130561Sobrien attached to and the value of the symbol as the initial 133130561Sobrien relocation offset. If the symbol pointer is zero, then the 134130561Sobrien section provided is looked up. 13533965Sjdp 13633965Sjdp o <<address>> 13733965Sjdp 13833965Sjdp The <<address>> field gives the offset in bytes from the base of 13933965Sjdp the section data which owns the relocation record to the first 14033965Sjdp byte of relocatable information. The actual data relocated 14133965Sjdp will be relative to this point; for example, a relocation 14233965Sjdp type which modifies the bottom two bytes of a four byte word 14333965Sjdp would not touch the first byte pointed to in a big endian 14433965Sjdp world. 14533965Sjdp 14633965Sjdp o <<addend>> 14733965Sjdp 14833965Sjdp The <<addend>> is a value provided by the back end to be added (!) 14933965Sjdp to the relocation offset. Its interpretation is dependent upon 15033965Sjdp the howto. For example, on the 68k the code: 15133965Sjdp 15233965Sjdp| char foo[]; 15333965Sjdp| main() 15433965Sjdp| { 15533965Sjdp| return foo[0x12345678]; 15633965Sjdp| } 15733965Sjdp 15833965Sjdp Could be compiled into: 15933965Sjdp 16033965Sjdp| linkw fp,#-4 16133965Sjdp| moveb @@#12345678,d0 16233965Sjdp| extbl d0 16333965Sjdp| unlk fp 16433965Sjdp| rts 16533965Sjdp 16633965Sjdp This could create a reloc pointing to <<foo>>, but leave the 16733965Sjdp offset in the data, something like: 16833965Sjdp 16933965Sjdp|RELOCATION RECORDS FOR [.text]: 17033965Sjdp|offset type value 17133965Sjdp|00000006 32 _foo 17233965Sjdp| 17333965Sjdp|00000000 4e56 fffc ; linkw fp,#-4 17433965Sjdp|00000004 1039 1234 5678 ; moveb @@#12345678,d0 17533965Sjdp|0000000a 49c0 ; extbl d0 17633965Sjdp|0000000c 4e5e ; unlk fp 17733965Sjdp|0000000e 4e75 ; rts 17833965Sjdp 17933965Sjdp Using coff and an 88k, some instructions don't have enough 18033965Sjdp space in them to represent the full address range, and 18133965Sjdp pointers have to be loaded in two parts. So you'd get something like: 18233965Sjdp 18333965Sjdp| or.u r13,r0,hi16(_foo+0x12345678) 18433965Sjdp| ld.b r2,r13,lo16(_foo+0x12345678) 18533965Sjdp| jmp r1 18633965Sjdp 18733965Sjdp This should create two relocs, both pointing to <<_foo>>, and with 18833965Sjdp 0x12340000 in their addend field. The data would consist of: 18933965Sjdp 19033965Sjdp|RELOCATION RECORDS FOR [.text]: 19133965Sjdp|offset type value 19233965Sjdp|00000002 HVRT16 _foo+0x12340000 19333965Sjdp|00000006 LVRT16 _foo+0x12340000 19433965Sjdp| 19533965Sjdp|00000000 5da05678 ; or.u r13,r0,0x5678 19633965Sjdp|00000004 1c4d5678 ; ld.b r2,r13,0x5678 19733965Sjdp|00000008 f400c001 ; jmp r1 19833965Sjdp 19933965Sjdp The relocation routine digs out the value from the data, adds 20033965Sjdp it to the addend to get the original offset, and then adds the 20133965Sjdp value of <<_foo>>. Note that all 32 bits have to be kept around 20233965Sjdp somewhere, to cope with carry from bit 15 to bit 16. 20333965Sjdp 20433965Sjdp One further example is the sparc and the a.out format. The 20533965Sjdp sparc has a similar problem to the 88k, in that some 20633965Sjdp instructions don't have room for an entire offset, but on the 20733965Sjdp sparc the parts are created in odd sized lumps. The designers of 20833965Sjdp the a.out format chose to not use the data within the section 20933965Sjdp for storing part of the offset; all the offset is kept within 21033965Sjdp the reloc. Anything in the data should be ignored. 21133965Sjdp 21233965Sjdp| save %sp,-112,%sp 21333965Sjdp| sethi %hi(_foo+0x12345678),%g2 21433965Sjdp| ldsb [%g2+%lo(_foo+0x12345678)],%i0 21533965Sjdp| ret 21633965Sjdp| restore 21733965Sjdp 21833965Sjdp Both relocs contain a pointer to <<foo>>, and the offsets 21933965Sjdp contain junk. 22033965Sjdp 22133965Sjdp|RELOCATION RECORDS FOR [.text]: 22233965Sjdp|offset type value 22333965Sjdp|00000004 HI22 _foo+0x12345678 22433965Sjdp|00000008 LO10 _foo+0x12345678 22533965Sjdp| 22633965Sjdp|00000000 9de3bf90 ; save %sp,-112,%sp 22733965Sjdp|00000004 05000000 ; sethi %hi(_foo+0),%g2 22833965Sjdp|00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 22933965Sjdp|0000000c 81c7e008 ; ret 23033965Sjdp|00000010 81e80000 ; restore 23133965Sjdp 23233965Sjdp o <<howto>> 23333965Sjdp 23433965Sjdp The <<howto>> field can be imagined as a 23533965Sjdp relocation instruction. It is a pointer to a structure which 23633965Sjdp contains information on what to do with all of the other 23733965Sjdp information in the reloc record and data section. A back end 23833965Sjdp would normally have a relocation instruction set and turn 23933965Sjdp relocations into pointers to the correct structure on input - 24033965Sjdp but it would be possible to create each howto field on demand. 24133965Sjdp 24233965Sjdp*/ 24333965Sjdp 24433965Sjdp/* 24533965SjdpSUBSUBSECTION 24633965Sjdp <<enum complain_overflow>> 24733965Sjdp 24833965Sjdp Indicates what sort of overflow checking should be done when 24933965Sjdp performing a relocation. 25033965Sjdp 25133965SjdpCODE_FRAGMENT 25233965Sjdp. 25333965Sjdp.enum complain_overflow 25433965Sjdp.{ 25591041Sobrien. {* Do not complain on overflow. *} 25633965Sjdp. complain_overflow_dont, 25733965Sjdp. 258218822Sdim. {* Complain if the value overflows when considered as a signed 259218822Sdim. number one bit larger than the field. ie. A bitfield of N bits 260218822Sdim. is allowed to represent -2**n to 2**n-1. *} 26133965Sjdp. complain_overflow_bitfield, 26233965Sjdp. 263218822Sdim. {* Complain if the value overflows when considered as a signed 26491041Sobrien. number. *} 26533965Sjdp. complain_overflow_signed, 26633965Sjdp. 26789857Sobrien. {* Complain if the value overflows when considered as an 26891041Sobrien. unsigned number. *} 26933965Sjdp. complain_overflow_unsigned 27033965Sjdp.}; 27133965Sjdp 27233965Sjdp*/ 27333965Sjdp 27433965Sjdp/* 27533965SjdpSUBSUBSECTION 27633965Sjdp <<reloc_howto_type>> 27733965Sjdp 27833965Sjdp The <<reloc_howto_type>> is a structure which contains all the 27933965Sjdp information that libbfd needs to know to tie up a back end's data. 28033965Sjdp 28133965SjdpCODE_FRAGMENT 282130561Sobrien.struct bfd_symbol; {* Forward declaration. *} 28333965Sjdp. 28433965Sjdp.struct reloc_howto_struct 28533965Sjdp.{ 28689857Sobrien. {* The type field has mainly a documentary use - the back end can 28789857Sobrien. do what it wants with it, though normally the back end's 28889857Sobrien. external idea of what a reloc number is stored 28989857Sobrien. in this field. For example, a PC relative word relocation 29089857Sobrien. in a coff environment has the type 023 - because that's 29189857Sobrien. what the outside world calls a R_PCRWORD reloc. *} 29233965Sjdp. unsigned int type; 29333965Sjdp. 29489857Sobrien. {* The value the final relocation is shifted right by. This drops 29589857Sobrien. unwanted data from the relocation. *} 29633965Sjdp. unsigned int rightshift; 29733965Sjdp. 29889857Sobrien. {* The size of the item to be relocated. This is *not* a 29989857Sobrien. power-of-two measure. To get the number of bytes operated 30089857Sobrien. on by a type of relocation, use bfd_get_reloc_size. *} 30133965Sjdp. int size; 30233965Sjdp. 30389857Sobrien. {* The number of bits in the item to be relocated. This is used 30489857Sobrien. when doing overflow checking. *} 30533965Sjdp. unsigned int bitsize; 30633965Sjdp. 30789857Sobrien. {* Notes that the relocation is relative to the location in the 30889857Sobrien. data section of the addend. The relocation function will 30989857Sobrien. subtract from the relocation value the address of the location 31089857Sobrien. being relocated. *} 311130561Sobrien. bfd_boolean pc_relative; 31233965Sjdp. 31389857Sobrien. {* The bit position of the reloc value in the destination. 31489857Sobrien. The relocated value is left shifted by this amount. *} 31533965Sjdp. unsigned int bitpos; 31633965Sjdp. 31789857Sobrien. {* What type of overflow error should be checked for when 31889857Sobrien. relocating. *} 31933965Sjdp. enum complain_overflow complain_on_overflow; 32033965Sjdp. 32189857Sobrien. {* If this field is non null, then the supplied function is 32289857Sobrien. called rather than the normal function. This allows really 323130561Sobrien. strange relocation methods to be accommodated (e.g., i960 callj 32489857Sobrien. instructions). *} 32533965Sjdp. bfd_reloc_status_type (*special_function) 326130561Sobrien. (bfd *, arelent *, struct bfd_symbol *, void *, asection *, 327130561Sobrien. bfd *, char **); 32833965Sjdp. 32989857Sobrien. {* The textual name of the relocation type. *} 33033965Sjdp. char *name; 33133965Sjdp. 33289857Sobrien. {* Some formats record a relocation addend in the section contents 33389857Sobrien. rather than with the relocation. For ELF formats this is the 33489857Sobrien. distinction between USE_REL and USE_RELA (though the code checks 33589857Sobrien. for USE_REL == 1/0). The value of this field is TRUE if the 33689857Sobrien. addend is recorded with the section contents; when performing a 33789857Sobrien. partial link (ld -r) the section contents (the data) will be 33889857Sobrien. modified. The value of this field is FALSE if addends are 33989857Sobrien. recorded with the relocation (in arelent.addend); when performing 34089857Sobrien. a partial link the relocation will be modified. 34189857Sobrien. All relocations for all ELF USE_RELA targets should set this field 34289857Sobrien. to FALSE (values of TRUE should be looked on with suspicion). 34389857Sobrien. However, the converse is not true: not all relocations of all ELF 34489857Sobrien. USE_REL targets set this field to TRUE. Why this is so is peculiar 34589857Sobrien. to each particular target. For relocs that aren't used in partial 34689857Sobrien. links (e.g. GOT stuff) it doesn't matter what this is set to. *} 347130561Sobrien. bfd_boolean partial_inplace; 34833965Sjdp. 349130561Sobrien. {* src_mask selects the part of the instruction (or data) to be used 350130561Sobrien. in the relocation sum. If the target relocations don't have an 351130561Sobrien. addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 352130561Sobrien. dst_mask to extract the addend from the section contents. If 353130561Sobrien. relocations do have an addend in the reloc, eg. ELF USE_RELA, this 354130561Sobrien. field should be zero. Non-zero values for ELF USE_RELA targets are 355130561Sobrien. bogus as in those cases the value in the dst_mask part of the 356130561Sobrien. section contents should be treated as garbage. *} 35733965Sjdp. bfd_vma src_mask; 35833965Sjdp. 359130561Sobrien. {* dst_mask selects which parts of the instruction (or data) are 360130561Sobrien. replaced with a relocated value. *} 36133965Sjdp. bfd_vma dst_mask; 36233965Sjdp. 36389857Sobrien. {* When some formats create PC relative instructions, they leave 36489857Sobrien. the value of the pc of the place being relocated in the offset 36589857Sobrien. slot of the instruction, so that a PC relative relocation can 36689857Sobrien. be made just by adding in an ordinary offset (e.g., sun3 a.out). 36789857Sobrien. Some formats leave the displacement part of an instruction 36889857Sobrien. empty (e.g., m88k bcs); this flag signals the fact. *} 369130561Sobrien. bfd_boolean pcrel_offset; 37033965Sjdp.}; 37191041Sobrien. 37233965Sjdp*/ 37333965Sjdp 37433965Sjdp/* 37533965SjdpFUNCTION 37633965Sjdp The HOWTO Macro 37733965Sjdp 37833965SjdpDESCRIPTION 37933965Sjdp The HOWTO define is horrible and will go away. 38033965Sjdp 38189857Sobrien.#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 38289857Sobrien. { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 38333965Sjdp 38433965SjdpDESCRIPTION 38533965Sjdp And will be replaced with the totally magic way. But for the 38633965Sjdp moment, we are compatible, so do it this way. 38733965Sjdp 38889857Sobrien.#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 38989857Sobrien. HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 390130561Sobrien. NAME, FALSE, 0, 0, IN) 39133965Sjdp. 39260484Sobrien 39333965SjdpDESCRIPTION 39460484Sobrien This is used to fill in an empty howto entry in an array. 39560484Sobrien 39660484Sobrien.#define EMPTY_HOWTO(C) \ 397130561Sobrien. HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 398130561Sobrien. NULL, FALSE, 0, 0, FALSE) 39960484Sobrien. 40060484Sobrien 40160484SobrienDESCRIPTION 40233965Sjdp Helper routine to turn a symbol into a relocation value. 40333965Sjdp 40489857Sobrien.#define HOWTO_PREPARE(relocation, symbol) \ 40589857Sobrien. { \ 406130561Sobrien. if (symbol != NULL) \ 40789857Sobrien. { \ 40889857Sobrien. if (bfd_is_com_section (symbol->section)) \ 40989857Sobrien. { \ 41089857Sobrien. relocation = 0; \ 41189857Sobrien. } \ 41289857Sobrien. else \ 41389857Sobrien. { \ 41489857Sobrien. relocation = symbol->value; \ 41589857Sobrien. } \ 41689857Sobrien. } \ 41789857Sobrien. } 41891041Sobrien. 41933965Sjdp*/ 42033965Sjdp 42133965Sjdp/* 42233965SjdpFUNCTION 42333965Sjdp bfd_get_reloc_size 42433965Sjdp 42533965SjdpSYNOPSIS 42638889Sjdp unsigned int bfd_get_reloc_size (reloc_howto_type *); 42733965Sjdp 42833965SjdpDESCRIPTION 42933965Sjdp For a reloc_howto_type that operates on a fixed number of bytes, 43033965Sjdp this returns the number of bytes operated on. 43133965Sjdp */ 43233965Sjdp 43338889Sjdpunsigned int 434130561Sobrienbfd_get_reloc_size (reloc_howto_type *howto) 43533965Sjdp{ 43633965Sjdp switch (howto->size) 43733965Sjdp { 43833965Sjdp case 0: return 1; 43933965Sjdp case 1: return 2; 44033965Sjdp case 2: return 4; 44133965Sjdp case 3: return 0; 44233965Sjdp case 4: return 8; 44333965Sjdp case 8: return 16; 44433965Sjdp case -2: return 4; 44533965Sjdp default: abort (); 44633965Sjdp } 44733965Sjdp} 44833965Sjdp 44933965Sjdp/* 45033965SjdpTYPEDEF 45133965Sjdp arelent_chain 45233965Sjdp 45333965SjdpDESCRIPTION 45433965Sjdp 45533965Sjdp How relocs are tied together in an <<asection>>: 45633965Sjdp 45789857Sobrien.typedef struct relent_chain 45889857Sobrien.{ 45933965Sjdp. arelent relent; 46089857Sobrien. struct relent_chain *next; 46191041Sobrien.} 46291041Sobrien.arelent_chain; 46391041Sobrien. 46433965Sjdp*/ 46533965Sjdp 46660484Sobrien/* N_ONES produces N one bits, without overflowing machine arithmetic. */ 46760484Sobrien#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1) 46833965Sjdp 46938889Sjdp/* 47038889SjdpFUNCTION 47138889Sjdp bfd_check_overflow 47233965Sjdp 47338889SjdpSYNOPSIS 474130561Sobrien bfd_reloc_status_type bfd_check_overflow 475130561Sobrien (enum complain_overflow how, 476130561Sobrien unsigned int bitsize, 477130561Sobrien unsigned int rightshift, 478130561Sobrien unsigned int addrsize, 479130561Sobrien bfd_vma relocation); 48038889Sjdp 48138889SjdpDESCRIPTION 48260484Sobrien Perform overflow checking on @var{relocation} which has 48360484Sobrien @var{bitsize} significant bits and will be shifted right by 48460484Sobrien @var{rightshift} bits, on a machine with addresses containing 48560484Sobrien @var{addrsize} significant bits. The result is either of 48660484Sobrien @code{bfd_reloc_ok} or @code{bfd_reloc_overflow}. 48738889Sjdp 48838889Sjdp*/ 48938889Sjdp 49038889Sjdpbfd_reloc_status_type 491130561Sobrienbfd_check_overflow (enum complain_overflow how, 492130561Sobrien unsigned int bitsize, 493130561Sobrien unsigned int rightshift, 494130561Sobrien unsigned int addrsize, 495130561Sobrien bfd_vma relocation) 49638889Sjdp{ 49760484Sobrien bfd_vma fieldmask, addrmask, signmask, ss, a; 49838889Sjdp bfd_reloc_status_type flag = bfd_reloc_ok; 49938889Sjdp 50060484Sobrien /* Note: BITSIZE should always be <= ADDRSIZE, but in case it's not, 50160484Sobrien we'll be permissive: extra bits in the field mask will 50260484Sobrien automatically extend the address mask for purposes of the 50360484Sobrien overflow check. */ 50460484Sobrien fieldmask = N_ONES (bitsize); 505218822Sdim signmask = ~fieldmask; 50660484Sobrien addrmask = N_ONES (addrsize) | fieldmask; 507218822Sdim a = (relocation & addrmask) >> rightshift;; 50860484Sobrien 50938889Sjdp switch (how) 51038889Sjdp { 51138889Sjdp case complain_overflow_dont: 51238889Sjdp break; 51338889Sjdp 51438889Sjdp case complain_overflow_signed: 51560484Sobrien /* If any sign bits are set, all sign bits must be set. That 51660484Sobrien is, A must be a valid negative address after shifting. */ 51760484Sobrien signmask = ~ (fieldmask >> 1); 518218822Sdim /* Fall thru */ 519218822Sdim 520218822Sdim case complain_overflow_bitfield: 521218822Sdim /* Bitfields are sometimes signed, sometimes unsigned. We 522218822Sdim explicitly allow an address wrap too, which means a bitfield 523218822Sdim of n bits is allowed to store -2**n to 2**n-1. Thus overflow 524218822Sdim if the value has some, but not all, bits set outside the 525218822Sdim field. */ 52660484Sobrien ss = a & signmask; 52760484Sobrien if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) 52860484Sobrien flag = bfd_reloc_overflow; 52938889Sjdp break; 53038889Sjdp 53138889Sjdp case complain_overflow_unsigned: 53260484Sobrien /* We have an overflow if the address does not fit in the field. */ 533218822Sdim if ((a & signmask) != 0) 53460484Sobrien flag = bfd_reloc_overflow; 53538889Sjdp break; 53638889Sjdp 53738889Sjdp default: 53838889Sjdp abort (); 53938889Sjdp } 54038889Sjdp 54138889Sjdp return flag; 54238889Sjdp} 54338889Sjdp 54433965Sjdp/* 54533965SjdpFUNCTION 54633965Sjdp bfd_perform_relocation 54733965Sjdp 54833965SjdpSYNOPSIS 549130561Sobrien bfd_reloc_status_type bfd_perform_relocation 550130561Sobrien (bfd *abfd, 551130561Sobrien arelent *reloc_entry, 552130561Sobrien void *data, 553130561Sobrien asection *input_section, 554130561Sobrien bfd *output_bfd, 555130561Sobrien char **error_message); 55633965Sjdp 55733965SjdpDESCRIPTION 55833965Sjdp If @var{output_bfd} is supplied to this function, the 55933965Sjdp generated image will be relocatable; the relocations are 56033965Sjdp copied to the output file after they have been changed to 56133965Sjdp reflect the new state of the world. There are two ways of 56233965Sjdp reflecting the results of partial linkage in an output file: 56333965Sjdp by modifying the output data in place, and by modifying the 56433965Sjdp relocation record. Some native formats (e.g., basic a.out and 56533965Sjdp basic coff) have no way of specifying an addend in the 56633965Sjdp relocation type, so the addend has to go in the output data. 56733965Sjdp This is no big deal since in these formats the output data 56833965Sjdp slot will always be big enough for the addend. Complex reloc 56933965Sjdp types with addends were invented to solve just this problem. 57033965Sjdp The @var{error_message} argument is set to an error message if 57133965Sjdp this return @code{bfd_reloc_dangerous}. 57233965Sjdp 57333965Sjdp*/ 57433965Sjdp 57533965Sjdpbfd_reloc_status_type 576130561Sobrienbfd_perform_relocation (bfd *abfd, 577130561Sobrien arelent *reloc_entry, 578130561Sobrien void *data, 579130561Sobrien asection *input_section, 580130561Sobrien bfd *output_bfd, 581130561Sobrien char **error_message) 58233965Sjdp{ 58333965Sjdp bfd_vma relocation; 58433965Sjdp bfd_reloc_status_type flag = bfd_reloc_ok; 58560484Sobrien bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd); 58633965Sjdp bfd_vma output_base = 0; 58733965Sjdp reloc_howto_type *howto = reloc_entry->howto; 58833965Sjdp asection *reloc_target_output_section; 58933965Sjdp asymbol *symbol; 59033965Sjdp 59133965Sjdp symbol = *(reloc_entry->sym_ptr_ptr); 59233965Sjdp if (bfd_is_abs_section (symbol->section) 593130561Sobrien && output_bfd != NULL) 59433965Sjdp { 59533965Sjdp reloc_entry->address += input_section->output_offset; 59633965Sjdp return bfd_reloc_ok; 59733965Sjdp } 59833965Sjdp 599130561Sobrien /* If we are not producing relocatable output, return an error if 60033965Sjdp the symbol is not defined. An undefined weak symbol is 60133965Sjdp considered to have a value of zero (SVR4 ABI, p. 4-27). */ 60233965Sjdp if (bfd_is_und_section (symbol->section) 60333965Sjdp && (symbol->flags & BSF_WEAK) == 0 604130561Sobrien && output_bfd == NULL) 60533965Sjdp flag = bfd_reloc_undefined; 60633965Sjdp 60733965Sjdp /* If there is a function supplied to handle this relocation type, 60833965Sjdp call it. It'll return `bfd_reloc_continue' if further processing 60933965Sjdp can be done. */ 61033965Sjdp if (howto->special_function) 61133965Sjdp { 61233965Sjdp bfd_reloc_status_type cont; 61333965Sjdp cont = howto->special_function (abfd, reloc_entry, symbol, data, 61433965Sjdp input_section, output_bfd, 61533965Sjdp error_message); 61633965Sjdp if (cont != bfd_reloc_continue) 61733965Sjdp return cont; 61833965Sjdp } 61933965Sjdp 62033965Sjdp /* Is the address of the relocation really within the section? */ 621218822Sdim if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) 62233965Sjdp return bfd_reloc_outofrange; 62333965Sjdp 624130561Sobrien /* Work out which section the relocation is targeted at and the 62533965Sjdp initial relocation command value. */ 62633965Sjdp 62733965Sjdp /* Get symbol value. (Common symbols are special.) */ 62833965Sjdp if (bfd_is_com_section (symbol->section)) 62933965Sjdp relocation = 0; 63033965Sjdp else 63133965Sjdp relocation = symbol->value; 63233965Sjdp 63333965Sjdp reloc_target_output_section = symbol->section->output_section; 63433965Sjdp 63533965Sjdp /* Convert input-section-relative symbol value to absolute. */ 636130561Sobrien if ((output_bfd && ! howto->partial_inplace) 637130561Sobrien || reloc_target_output_section == NULL) 63833965Sjdp output_base = 0; 63933965Sjdp else 64033965Sjdp output_base = reloc_target_output_section->vma; 64133965Sjdp 64233965Sjdp relocation += output_base + symbol->section->output_offset; 64333965Sjdp 64433965Sjdp /* Add in supplied addend. */ 64533965Sjdp relocation += reloc_entry->addend; 64633965Sjdp 64733965Sjdp /* Here the variable relocation holds the final address of the 64833965Sjdp symbol we are relocating against, plus any addend. */ 64933965Sjdp 650104834Sobrien if (howto->pc_relative) 65133965Sjdp { 65233965Sjdp /* This is a PC relative relocation. We want to set RELOCATION 65333965Sjdp to the distance between the address of the symbol and the 65433965Sjdp location. RELOCATION is already the address of the symbol. 65533965Sjdp 65633965Sjdp We start by subtracting the address of the section containing 65733965Sjdp the location. 65833965Sjdp 65933965Sjdp If pcrel_offset is set, we must further subtract the position 66033965Sjdp of the location within the section. Some targets arrange for 66133965Sjdp the addend to be the negative of the position of the location 66233965Sjdp within the section; for example, i386-aout does this. For 663130561Sobrien i386-aout, pcrel_offset is FALSE. Some other targets do not 66433965Sjdp include the position of the location; for example, m88kbcs, 665130561Sobrien or ELF. For those targets, pcrel_offset is TRUE. 66633965Sjdp 667130561Sobrien If we are producing relocatable output, then we must ensure 66833965Sjdp that this reloc will be correctly computed when the final 669130561Sobrien relocation is done. If pcrel_offset is FALSE we want to wind 67033965Sjdp up with the negative of the location within the section, 67133965Sjdp which means we must adjust the existing addend by the change 672130561Sobrien in the location within the section. If pcrel_offset is TRUE 67333965Sjdp we do not want to adjust the existing addend at all. 67433965Sjdp 67533965Sjdp FIXME: This seems logical to me, but for the case of 676130561Sobrien producing relocatable output it is not what the code 67733965Sjdp actually does. I don't want to change it, because it seems 67833965Sjdp far too likely that something will break. */ 67933965Sjdp 68033965Sjdp relocation -= 68133965Sjdp input_section->output_section->vma + input_section->output_offset; 68233965Sjdp 683104834Sobrien if (howto->pcrel_offset) 68433965Sjdp relocation -= reloc_entry->address; 68533965Sjdp } 68633965Sjdp 687130561Sobrien if (output_bfd != NULL) 68833965Sjdp { 689104834Sobrien if (! howto->partial_inplace) 69033965Sjdp { 69133965Sjdp /* This is a partial relocation, and we want to apply the relocation 69233965Sjdp to the reloc entry rather than the raw data. Modify the reloc 69333965Sjdp inplace to reflect what we now know. */ 69433965Sjdp reloc_entry->addend = relocation; 69533965Sjdp reloc_entry->address += input_section->output_offset; 69633965Sjdp return flag; 69733965Sjdp } 69833965Sjdp else 69933965Sjdp { 70033965Sjdp /* This is a partial relocation, but inplace, so modify the 70133965Sjdp reloc record a bit. 70233965Sjdp 70333965Sjdp If we've relocated with a symbol with a section, change 70433965Sjdp into a ref to the section belonging to the symbol. */ 70533965Sjdp 70633965Sjdp reloc_entry->address += input_section->output_offset; 70733965Sjdp 70833965Sjdp /* WTF?? */ 70933965Sjdp if (abfd->xvec->flavour == bfd_target_coff_flavour 71033965Sjdp && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 71133965Sjdp && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) 71233965Sjdp { 71333965Sjdp /* For m68k-coff, the addend was being subtracted twice during 71433965Sjdp relocation with -r. Removing the line below this comment 71533965Sjdp fixes that problem; see PR 2953. 71633965Sjdp 71733965SjdpHowever, Ian wrote the following, regarding removing the line below, 71833965Sjdpwhich explains why it is still enabled: --djm 71933965Sjdp 72033965SjdpIf you put a patch like that into BFD you need to check all the COFF 72133965Sjdplinkers. I am fairly certain that patch will break coff-i386 (e.g., 72233965SjdpSCO); see coff_i386_reloc in coff-i386.c where I worked around the 72333965Sjdpproblem in a different way. There may very well be a reason that the 72433965Sjdpcode works as it does. 72533965Sjdp 72633965SjdpHmmm. The first obvious point is that bfd_perform_relocation should 72733965Sjdpnot have any tests that depend upon the flavour. It's seem like 72833965Sjdpentirely the wrong place for such a thing. The second obvious point 72933965Sjdpis that the current code ignores the reloc addend when producing 730130561Sobrienrelocatable output for COFF. That's peculiar. In fact, I really 73133965Sjdphave no idea what the point of the line you want to remove is. 73233965Sjdp 73333965SjdpA typical COFF reloc subtracts the old value of the symbol and adds in 73433965Sjdpthe new value to the location in the object file (if it's a pc 73533965Sjdprelative reloc it adds the difference between the symbol value and the 73633965Sjdplocation). When relocating we need to preserve that property. 73733965Sjdp 73833965SjdpBFD handles this by setting the addend to the negative of the old 73933965Sjdpvalue of the symbol. Unfortunately it handles common symbols in a 74033965Sjdpnon-standard way (it doesn't subtract the old value) but that's a 74133965Sjdpdifferent story (we can't change it without losing backward 74233965Sjdpcompatibility with old object files) (coff-i386 does subtract the old 74333965Sjdpvalue, to be compatible with existing coff-i386 targets, like SCO). 74433965Sjdp 745130561SobrienSo everything works fine when not producing relocatable output. When 746130561Sobrienwe are producing relocatable output, logically we should do exactly 747130561Sobrienwhat we do when not producing relocatable output. Therefore, your 74833965Sjdppatch is correct. In fact, it should probably always just set 74933965Sjdpreloc_entry->addend to 0 for all cases, since it is, in fact, going to 75033965Sjdpadd the value into the object file. This won't hurt the COFF code, 75133965Sjdpwhich doesn't use the addend; I'm not sure what it will do to other 75233965Sjdpformats (the thing to check for would be whether any formats both use 75333965Sjdpthe addend and set partial_inplace). 75433965Sjdp 755130561SobrienWhen I wanted to make coff-i386 produce relocatable output, I ran 75633965Sjdpinto the problem that you are running into: I wanted to remove that 75733965Sjdpline. Rather than risk it, I made the coff-i386 relocs use a special 75833965Sjdpfunction; it's coff_i386_reloc in coff-i386.c. The function 75933965Sjdpspecifically adds the addend field into the object file, knowing that 76033965Sjdpbfd_perform_relocation is not going to. If you remove that line, then 76133965Sjdpcoff-i386.c will wind up adding the addend field in twice. It's 76233965Sjdptrivial to fix; it just needs to be done. 76333965Sjdp 76433965SjdpThe problem with removing the line is just that it may break some 76533965Sjdpworking code. With BFD it's hard to be sure of anything. The right 76633965Sjdpway to deal with this is simply to build and test at least all the 76733965Sjdpsupported COFF targets. It should be straightforward if time and disk 76833965Sjdpspace consuming. For each target: 76933965Sjdp 1) build the linker 77033965Sjdp 2) generate some executable, and link it using -r (I would 77133965Sjdp probably use paranoia.o and link against newlib/libc.a, which 77233965Sjdp for all the supported targets would be available in 77333965Sjdp /usr/cygnus/progressive/H-host/target/lib/libc.a). 77433965Sjdp 3) make the change to reloc.c 77533965Sjdp 4) rebuild the linker 77633965Sjdp 5) repeat step 2 77733965Sjdp 6) if the resulting object files are the same, you have at least 77833965Sjdp made it no worse 77933965Sjdp 7) if they are different you have to figure out which version is 78033965Sjdp right 78133965Sjdp*/ 78233965Sjdp relocation -= reloc_entry->addend; 78333965Sjdp reloc_entry->addend = 0; 78433965Sjdp } 78533965Sjdp else 78633965Sjdp { 78733965Sjdp reloc_entry->addend = relocation; 78833965Sjdp } 78933965Sjdp } 79033965Sjdp } 79133965Sjdp else 79233965Sjdp { 79333965Sjdp reloc_entry->addend = 0; 79433965Sjdp } 79533965Sjdp 79633965Sjdp /* FIXME: This overflow checking is incomplete, because the value 79733965Sjdp might have overflowed before we get here. For a correct check we 79833965Sjdp need to compute the value in a size larger than bitsize, but we 79933965Sjdp can't reasonably do that for a reloc the same size as a host 80033965Sjdp machine word. 80133965Sjdp FIXME: We should also do overflow checking on the result after 80233965Sjdp adding in the value contained in the object file. */ 80333965Sjdp if (howto->complain_on_overflow != complain_overflow_dont 80433965Sjdp && flag == bfd_reloc_ok) 80560484Sobrien flag = bfd_check_overflow (howto->complain_on_overflow, 80660484Sobrien howto->bitsize, 80760484Sobrien howto->rightshift, 80860484Sobrien bfd_arch_bits_per_address (abfd), 80960484Sobrien relocation); 81033965Sjdp 81191041Sobrien /* Either we are relocating all the way, or we don't want to apply 81291041Sobrien the relocation to the reloc entry (probably because there isn't 81391041Sobrien any room in the output format to describe addends to relocs). */ 81433965Sjdp 81533965Sjdp /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler 81633965Sjdp (OSF version 1.3, compiler version 3.11). It miscompiles the 81733965Sjdp following program: 81833965Sjdp 81933965Sjdp struct str 82033965Sjdp { 82133965Sjdp unsigned int i0; 82233965Sjdp } s = { 0 }; 82333965Sjdp 82433965Sjdp int 82533965Sjdp main () 82633965Sjdp { 82733965Sjdp unsigned long x; 82833965Sjdp 82933965Sjdp x = 0x100000000; 83033965Sjdp x <<= (unsigned long) s.i0; 83133965Sjdp if (x == 0) 83233965Sjdp printf ("failed\n"); 83333965Sjdp else 83433965Sjdp printf ("succeeded (%lx)\n", x); 83533965Sjdp } 83633965Sjdp */ 83733965Sjdp 83833965Sjdp relocation >>= (bfd_vma) howto->rightshift; 83933965Sjdp 84091041Sobrien /* Shift everything up to where it's going to be used. */ 84133965Sjdp relocation <<= (bfd_vma) howto->bitpos; 84233965Sjdp 84391041Sobrien /* Wait for the day when all have the mask in them. */ 84433965Sjdp 84533965Sjdp /* What we do: 84633965Sjdp i instruction to be left alone 84733965Sjdp o offset within instruction 84833965Sjdp r relocation offset to apply 84933965Sjdp S src mask 85033965Sjdp D dst mask 85133965Sjdp N ~dst mask 85233965Sjdp A part 1 85333965Sjdp B part 2 85433965Sjdp R result 85533965Sjdp 85633965Sjdp Do this: 85760484Sobrien (( i i i i i o o o o o from bfd_get<size> 85860484Sobrien and S S S S S) to get the size offset we want 85960484Sobrien + r r r r r r r r r r) to get the final value to place 86033965Sjdp and D D D D D to chop to right size 86133965Sjdp ----------------------- 86260484Sobrien = A A A A A 86333965Sjdp And this: 86460484Sobrien ( i i i i i o o o o o from bfd_get<size> 86560484Sobrien and N N N N N ) get instruction 86633965Sjdp ----------------------- 86760484Sobrien = B B B B B 86833965Sjdp 86933965Sjdp And then: 87060484Sobrien ( B B B B B 87160484Sobrien or A A A A A) 87233965Sjdp ----------------------- 87360484Sobrien = R R R R R R R R R R put into bfd_put<size> 87433965Sjdp */ 87533965Sjdp 87633965Sjdp#define DOIT(x) \ 87733965Sjdp x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) 87833965Sjdp 87933965Sjdp switch (howto->size) 88033965Sjdp { 88133965Sjdp case 0: 88233965Sjdp { 88360484Sobrien char x = bfd_get_8 (abfd, (char *) data + octets); 88433965Sjdp DOIT (x); 88560484Sobrien bfd_put_8 (abfd, x, (unsigned char *) data + octets); 88633965Sjdp } 88733965Sjdp break; 88833965Sjdp 88933965Sjdp case 1: 89033965Sjdp { 89160484Sobrien short x = bfd_get_16 (abfd, (bfd_byte *) data + octets); 89233965Sjdp DOIT (x); 89389857Sobrien bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + octets); 89433965Sjdp } 89533965Sjdp break; 89633965Sjdp case 2: 89733965Sjdp { 89860484Sobrien long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); 89933965Sjdp DOIT (x); 90089857Sobrien bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 90133965Sjdp } 90233965Sjdp break; 90333965Sjdp case -2: 90433965Sjdp { 90560484Sobrien long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); 90633965Sjdp relocation = -relocation; 90733965Sjdp DOIT (x); 90889857Sobrien bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 90933965Sjdp } 91033965Sjdp break; 91133965Sjdp 91233965Sjdp case -1: 91333965Sjdp { 91460484Sobrien long x = bfd_get_16 (abfd, (bfd_byte *) data + octets); 91533965Sjdp relocation = -relocation; 91633965Sjdp DOIT (x); 91789857Sobrien bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 91833965Sjdp } 91933965Sjdp break; 92033965Sjdp 92133965Sjdp case 3: 92233965Sjdp /* Do nothing */ 92333965Sjdp break; 92433965Sjdp 92533965Sjdp case 4: 92633965Sjdp#ifdef BFD64 92733965Sjdp { 92860484Sobrien bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + octets); 92933965Sjdp DOIT (x); 93060484Sobrien bfd_put_64 (abfd, x, (bfd_byte *) data + octets); 93133965Sjdp } 93233965Sjdp#else 93333965Sjdp abort (); 93433965Sjdp#endif 93533965Sjdp break; 93633965Sjdp default: 93733965Sjdp return bfd_reloc_other; 93833965Sjdp } 93933965Sjdp 94033965Sjdp return flag; 94133965Sjdp} 94233965Sjdp 94333965Sjdp/* 94433965SjdpFUNCTION 94533965Sjdp bfd_install_relocation 94633965Sjdp 94733965SjdpSYNOPSIS 948130561Sobrien bfd_reloc_status_type bfd_install_relocation 949130561Sobrien (bfd *abfd, 950130561Sobrien arelent *reloc_entry, 951130561Sobrien void *data, bfd_vma data_start, 952130561Sobrien asection *input_section, 953130561Sobrien char **error_message); 95433965Sjdp 95533965SjdpDESCRIPTION 95633965Sjdp This looks remarkably like <<bfd_perform_relocation>>, except it 95733965Sjdp does not expect that the section contents have been filled in. 95833965Sjdp I.e., it's suitable for use when creating, rather than applying 95933965Sjdp a relocation. 96033965Sjdp 96133965Sjdp For now, this function should be considered reserved for the 96233965Sjdp assembler. 96333965Sjdp*/ 96433965Sjdp 96533965Sjdpbfd_reloc_status_type 966130561Sobrienbfd_install_relocation (bfd *abfd, 967130561Sobrien arelent *reloc_entry, 968130561Sobrien void *data_start, 969130561Sobrien bfd_vma data_start_offset, 970130561Sobrien asection *input_section, 971130561Sobrien char **error_message) 97233965Sjdp{ 97333965Sjdp bfd_vma relocation; 97433965Sjdp bfd_reloc_status_type flag = bfd_reloc_ok; 97560484Sobrien bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd); 97633965Sjdp bfd_vma output_base = 0; 97733965Sjdp reloc_howto_type *howto = reloc_entry->howto; 97833965Sjdp asection *reloc_target_output_section; 97933965Sjdp asymbol *symbol; 98033965Sjdp bfd_byte *data; 98133965Sjdp 98233965Sjdp symbol = *(reloc_entry->sym_ptr_ptr); 98333965Sjdp if (bfd_is_abs_section (symbol->section)) 98433965Sjdp { 98533965Sjdp reloc_entry->address += input_section->output_offset; 98633965Sjdp return bfd_reloc_ok; 98733965Sjdp } 98833965Sjdp 98933965Sjdp /* If there is a function supplied to handle this relocation type, 99033965Sjdp call it. It'll return `bfd_reloc_continue' if further processing 99133965Sjdp can be done. */ 99233965Sjdp if (howto->special_function) 99333965Sjdp { 99433965Sjdp bfd_reloc_status_type cont; 99560484Sobrien 99633965Sjdp /* XXX - The special_function calls haven't been fixed up to deal 99733965Sjdp with creating new relocations and section contents. */ 99833965Sjdp cont = howto->special_function (abfd, reloc_entry, symbol, 99933965Sjdp /* XXX - Non-portable! */ 100033965Sjdp ((bfd_byte *) data_start 100133965Sjdp - data_start_offset), 100233965Sjdp input_section, abfd, error_message); 100333965Sjdp if (cont != bfd_reloc_continue) 100433965Sjdp return cont; 100533965Sjdp } 100633965Sjdp 100733965Sjdp /* Is the address of the relocation really within the section? */ 1008218822Sdim if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) 100933965Sjdp return bfd_reloc_outofrange; 101033965Sjdp 1011130561Sobrien /* Work out which section the relocation is targeted at and the 101233965Sjdp initial relocation command value. */ 101333965Sjdp 101433965Sjdp /* Get symbol value. (Common symbols are special.) */ 101533965Sjdp if (bfd_is_com_section (symbol->section)) 101633965Sjdp relocation = 0; 101733965Sjdp else 101833965Sjdp relocation = symbol->value; 101933965Sjdp 102033965Sjdp reloc_target_output_section = symbol->section->output_section; 102133965Sjdp 102233965Sjdp /* Convert input-section-relative symbol value to absolute. */ 1023104834Sobrien if (! howto->partial_inplace) 102433965Sjdp output_base = 0; 102533965Sjdp else 102633965Sjdp output_base = reloc_target_output_section->vma; 102733965Sjdp 102833965Sjdp relocation += output_base + symbol->section->output_offset; 102933965Sjdp 103033965Sjdp /* Add in supplied addend. */ 103133965Sjdp relocation += reloc_entry->addend; 103233965Sjdp 103333965Sjdp /* Here the variable relocation holds the final address of the 103433965Sjdp symbol we are relocating against, plus any addend. */ 103533965Sjdp 1036104834Sobrien if (howto->pc_relative) 103733965Sjdp { 103833965Sjdp /* This is a PC relative relocation. We want to set RELOCATION 103933965Sjdp to the distance between the address of the symbol and the 104033965Sjdp location. RELOCATION is already the address of the symbol. 104133965Sjdp 104233965Sjdp We start by subtracting the address of the section containing 104333965Sjdp the location. 104433965Sjdp 104533965Sjdp If pcrel_offset is set, we must further subtract the position 104633965Sjdp of the location within the section. Some targets arrange for 104733965Sjdp the addend to be the negative of the position of the location 104833965Sjdp within the section; for example, i386-aout does this. For 1049130561Sobrien i386-aout, pcrel_offset is FALSE. Some other targets do not 105033965Sjdp include the position of the location; for example, m88kbcs, 1051130561Sobrien or ELF. For those targets, pcrel_offset is TRUE. 105233965Sjdp 1053130561Sobrien If we are producing relocatable output, then we must ensure 105433965Sjdp that this reloc will be correctly computed when the final 1055130561Sobrien relocation is done. If pcrel_offset is FALSE we want to wind 105633965Sjdp up with the negative of the location within the section, 105733965Sjdp which means we must adjust the existing addend by the change 1058130561Sobrien in the location within the section. If pcrel_offset is TRUE 105933965Sjdp we do not want to adjust the existing addend at all. 106033965Sjdp 106133965Sjdp FIXME: This seems logical to me, but for the case of 1062130561Sobrien producing relocatable output it is not what the code 106333965Sjdp actually does. I don't want to change it, because it seems 106433965Sjdp far too likely that something will break. */ 106533965Sjdp 106633965Sjdp relocation -= 106733965Sjdp input_section->output_section->vma + input_section->output_offset; 106833965Sjdp 1069104834Sobrien if (howto->pcrel_offset && howto->partial_inplace) 107033965Sjdp relocation -= reloc_entry->address; 107133965Sjdp } 107233965Sjdp 1073104834Sobrien if (! howto->partial_inplace) 107433965Sjdp { 107533965Sjdp /* This is a partial relocation, and we want to apply the relocation 107633965Sjdp to the reloc entry rather than the raw data. Modify the reloc 107733965Sjdp inplace to reflect what we now know. */ 107833965Sjdp reloc_entry->addend = relocation; 107933965Sjdp reloc_entry->address += input_section->output_offset; 108033965Sjdp return flag; 108133965Sjdp } 108233965Sjdp else 108333965Sjdp { 108433965Sjdp /* This is a partial relocation, but inplace, so modify the 108533965Sjdp reloc record a bit. 108633965Sjdp 108733965Sjdp If we've relocated with a symbol with a section, change 108833965Sjdp into a ref to the section belonging to the symbol. */ 108933965Sjdp reloc_entry->address += input_section->output_offset; 109033965Sjdp 109133965Sjdp /* WTF?? */ 109233965Sjdp if (abfd->xvec->flavour == bfd_target_coff_flavour 109333965Sjdp && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 109433965Sjdp && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) 109533965Sjdp { 109633965Sjdp 1097218822Sdim /* For m68k-coff, the addend was being subtracted twice during 1098218822Sdim relocation with -r. Removing the line below this comment 1099218822Sdim fixes that problem; see PR 2953. 1100218822Sdim 110133965SjdpHowever, Ian wrote the following, regarding removing the line below, 110233965Sjdpwhich explains why it is still enabled: --djm 110333965Sjdp 110433965SjdpIf you put a patch like that into BFD you need to check all the COFF 110533965Sjdplinkers. I am fairly certain that patch will break coff-i386 (e.g., 110633965SjdpSCO); see coff_i386_reloc in coff-i386.c where I worked around the 110733965Sjdpproblem in a different way. There may very well be a reason that the 110833965Sjdpcode works as it does. 110933965Sjdp 111033965SjdpHmmm. The first obvious point is that bfd_install_relocation should 111133965Sjdpnot have any tests that depend upon the flavour. It's seem like 111233965Sjdpentirely the wrong place for such a thing. The second obvious point 111333965Sjdpis that the current code ignores the reloc addend when producing 1114130561Sobrienrelocatable output for COFF. That's peculiar. In fact, I really 111533965Sjdphave no idea what the point of the line you want to remove is. 111633965Sjdp 111733965SjdpA typical COFF reloc subtracts the old value of the symbol and adds in 111833965Sjdpthe new value to the location in the object file (if it's a pc 111933965Sjdprelative reloc it adds the difference between the symbol value and the 112033965Sjdplocation). When relocating we need to preserve that property. 112133965Sjdp 112233965SjdpBFD handles this by setting the addend to the negative of the old 112333965Sjdpvalue of the symbol. Unfortunately it handles common symbols in a 112433965Sjdpnon-standard way (it doesn't subtract the old value) but that's a 112533965Sjdpdifferent story (we can't change it without losing backward 112633965Sjdpcompatibility with old object files) (coff-i386 does subtract the old 112733965Sjdpvalue, to be compatible with existing coff-i386 targets, like SCO). 112833965Sjdp 1129130561SobrienSo everything works fine when not producing relocatable output. When 1130130561Sobrienwe are producing relocatable output, logically we should do exactly 1131130561Sobrienwhat we do when not producing relocatable output. Therefore, your 113233965Sjdppatch is correct. In fact, it should probably always just set 113333965Sjdpreloc_entry->addend to 0 for all cases, since it is, in fact, going to 113433965Sjdpadd the value into the object file. This won't hurt the COFF code, 113533965Sjdpwhich doesn't use the addend; I'm not sure what it will do to other 113633965Sjdpformats (the thing to check for would be whether any formats both use 113733965Sjdpthe addend and set partial_inplace). 113833965Sjdp 1139130561SobrienWhen I wanted to make coff-i386 produce relocatable output, I ran 114033965Sjdpinto the problem that you are running into: I wanted to remove that 114133965Sjdpline. Rather than risk it, I made the coff-i386 relocs use a special 114233965Sjdpfunction; it's coff_i386_reloc in coff-i386.c. The function 114333965Sjdpspecifically adds the addend field into the object file, knowing that 114433965Sjdpbfd_install_relocation is not going to. If you remove that line, then 114533965Sjdpcoff-i386.c will wind up adding the addend field in twice. It's 114633965Sjdptrivial to fix; it just needs to be done. 114733965Sjdp 114833965SjdpThe problem with removing the line is just that it may break some 114933965Sjdpworking code. With BFD it's hard to be sure of anything. The right 115033965Sjdpway to deal with this is simply to build and test at least all the 115133965Sjdpsupported COFF targets. It should be straightforward if time and disk 115233965Sjdpspace consuming. For each target: 115333965Sjdp 1) build the linker 115433965Sjdp 2) generate some executable, and link it using -r (I would 115533965Sjdp probably use paranoia.o and link against newlib/libc.a, which 115633965Sjdp for all the supported targets would be available in 115733965Sjdp /usr/cygnus/progressive/H-host/target/lib/libc.a). 115833965Sjdp 3) make the change to reloc.c 115933965Sjdp 4) rebuild the linker 116033965Sjdp 5) repeat step 2 116133965Sjdp 6) if the resulting object files are the same, you have at least 116233965Sjdp made it no worse 116333965Sjdp 7) if they are different you have to figure out which version is 116491041Sobrien right. */ 116533965Sjdp relocation -= reloc_entry->addend; 1166218822Sdim /* FIXME: There should be no target specific code here... */ 1167218822Sdim if (strcmp (abfd->xvec->name, "coff-z8k") != 0) 1168218822Sdim reloc_entry->addend = 0; 116933965Sjdp } 117033965Sjdp else 117133965Sjdp { 117233965Sjdp reloc_entry->addend = relocation; 117333965Sjdp } 117433965Sjdp } 117533965Sjdp 117633965Sjdp /* FIXME: This overflow checking is incomplete, because the value 117733965Sjdp might have overflowed before we get here. For a correct check we 117833965Sjdp need to compute the value in a size larger than bitsize, but we 117933965Sjdp can't reasonably do that for a reloc the same size as a host 118033965Sjdp machine word. 118133965Sjdp FIXME: We should also do overflow checking on the result after 118233965Sjdp adding in the value contained in the object file. */ 118333965Sjdp if (howto->complain_on_overflow != complain_overflow_dont) 118460484Sobrien flag = bfd_check_overflow (howto->complain_on_overflow, 118560484Sobrien howto->bitsize, 118660484Sobrien howto->rightshift, 118760484Sobrien bfd_arch_bits_per_address (abfd), 118860484Sobrien relocation); 118933965Sjdp 119091041Sobrien /* Either we are relocating all the way, or we don't want to apply 119191041Sobrien the relocation to the reloc entry (probably because there isn't 119291041Sobrien any room in the output format to describe addends to relocs). */ 119333965Sjdp 119433965Sjdp /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler 119533965Sjdp (OSF version 1.3, compiler version 3.11). It miscompiles the 119633965Sjdp following program: 119733965Sjdp 119833965Sjdp struct str 119933965Sjdp { 120033965Sjdp unsigned int i0; 120133965Sjdp } s = { 0 }; 120233965Sjdp 120333965Sjdp int 120433965Sjdp main () 120533965Sjdp { 120633965Sjdp unsigned long x; 120733965Sjdp 120833965Sjdp x = 0x100000000; 120933965Sjdp x <<= (unsigned long) s.i0; 121033965Sjdp if (x == 0) 121133965Sjdp printf ("failed\n"); 121233965Sjdp else 121333965Sjdp printf ("succeeded (%lx)\n", x); 121433965Sjdp } 121533965Sjdp */ 121633965Sjdp 121733965Sjdp relocation >>= (bfd_vma) howto->rightshift; 121833965Sjdp 121991041Sobrien /* Shift everything up to where it's going to be used. */ 122033965Sjdp relocation <<= (bfd_vma) howto->bitpos; 122133965Sjdp 122291041Sobrien /* Wait for the day when all have the mask in them. */ 122333965Sjdp 122433965Sjdp /* What we do: 122533965Sjdp i instruction to be left alone 122633965Sjdp o offset within instruction 122733965Sjdp r relocation offset to apply 122833965Sjdp S src mask 122933965Sjdp D dst mask 123033965Sjdp N ~dst mask 123133965Sjdp A part 1 123233965Sjdp B part 2 123333965Sjdp R result 123433965Sjdp 123533965Sjdp Do this: 123660484Sobrien (( i i i i i o o o o o from bfd_get<size> 123760484Sobrien and S S S S S) to get the size offset we want 123860484Sobrien + r r r r r r r r r r) to get the final value to place 123933965Sjdp and D D D D D to chop to right size 124033965Sjdp ----------------------- 124160484Sobrien = A A A A A 124233965Sjdp And this: 124360484Sobrien ( i i i i i o o o o o from bfd_get<size> 124460484Sobrien and N N N N N ) get instruction 124533965Sjdp ----------------------- 124660484Sobrien = B B B B B 124733965Sjdp 124833965Sjdp And then: 124960484Sobrien ( B B B B B 125060484Sobrien or A A A A A) 125133965Sjdp ----------------------- 125260484Sobrien = R R R R R R R R R R put into bfd_put<size> 125333965Sjdp */ 125433965Sjdp 125533965Sjdp#define DOIT(x) \ 125633965Sjdp x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) 125733965Sjdp 125860484Sobrien data = (bfd_byte *) data_start + (octets - data_start_offset); 125933965Sjdp 126033965Sjdp switch (howto->size) 126133965Sjdp { 126233965Sjdp case 0: 126333965Sjdp { 1264130561Sobrien char x = bfd_get_8 (abfd, data); 126533965Sjdp DOIT (x); 1266130561Sobrien bfd_put_8 (abfd, x, data); 126733965Sjdp } 126833965Sjdp break; 126933965Sjdp 127033965Sjdp case 1: 127133965Sjdp { 1272130561Sobrien short x = bfd_get_16 (abfd, data); 127333965Sjdp DOIT (x); 1274130561Sobrien bfd_put_16 (abfd, (bfd_vma) x, data); 127533965Sjdp } 127633965Sjdp break; 127733965Sjdp case 2: 127833965Sjdp { 1279130561Sobrien long x = bfd_get_32 (abfd, data); 128033965Sjdp DOIT (x); 1281130561Sobrien bfd_put_32 (abfd, (bfd_vma) x, data); 128233965Sjdp } 128333965Sjdp break; 128433965Sjdp case -2: 128533965Sjdp { 1286130561Sobrien long x = bfd_get_32 (abfd, data); 128733965Sjdp relocation = -relocation; 128833965Sjdp DOIT (x); 1289130561Sobrien bfd_put_32 (abfd, (bfd_vma) x, data); 129033965Sjdp } 129133965Sjdp break; 129233965Sjdp 129333965Sjdp case 3: 129433965Sjdp /* Do nothing */ 129533965Sjdp break; 129633965Sjdp 129733965Sjdp case 4: 129833965Sjdp { 1299130561Sobrien bfd_vma x = bfd_get_64 (abfd, data); 130033965Sjdp DOIT (x); 1301130561Sobrien bfd_put_64 (abfd, x, data); 130233965Sjdp } 130333965Sjdp break; 130433965Sjdp default: 130533965Sjdp return bfd_reloc_other; 130633965Sjdp } 130733965Sjdp 130833965Sjdp return flag; 130933965Sjdp} 131033965Sjdp 131133965Sjdp/* This relocation routine is used by some of the backend linkers. 131233965Sjdp They do not construct asymbol or arelent structures, so there is no 131333965Sjdp reason for them to use bfd_perform_relocation. Also, 131433965Sjdp bfd_perform_relocation is so hacked up it is easier to write a new 131533965Sjdp function than to try to deal with it. 131633965Sjdp 131738889Sjdp This routine does a final relocation. Whether it is useful for a 1318130561Sobrien relocatable link depends upon how the object format defines 131938889Sjdp relocations. 132033965Sjdp 132133965Sjdp FIXME: This routine ignores any special_function in the HOWTO, 132233965Sjdp since the existing special_function values have been written for 132333965Sjdp bfd_perform_relocation. 132433965Sjdp 132533965Sjdp HOWTO is the reloc howto information. 132633965Sjdp INPUT_BFD is the BFD which the reloc applies to. 132733965Sjdp INPUT_SECTION is the section which the reloc applies to. 132833965Sjdp CONTENTS is the contents of the section. 132933965Sjdp ADDRESS is the address of the reloc within INPUT_SECTION. 133033965Sjdp VALUE is the value of the symbol the reloc refers to. 133133965Sjdp ADDEND is the addend of the reloc. */ 133233965Sjdp 133333965Sjdpbfd_reloc_status_type 1334130561Sobrien_bfd_final_link_relocate (reloc_howto_type *howto, 1335130561Sobrien bfd *input_bfd, 1336130561Sobrien asection *input_section, 1337130561Sobrien bfd_byte *contents, 1338130561Sobrien bfd_vma address, 1339130561Sobrien bfd_vma value, 1340130561Sobrien bfd_vma addend) 134133965Sjdp{ 134233965Sjdp bfd_vma relocation; 134333965Sjdp 134433965Sjdp /* Sanity check the address. */ 1345218822Sdim if (address > bfd_get_section_limit (input_bfd, input_section)) 134633965Sjdp return bfd_reloc_outofrange; 134733965Sjdp 134833965Sjdp /* This function assumes that we are dealing with a basic relocation 134933965Sjdp against a symbol. We want to compute the value of the symbol to 135033965Sjdp relocate to. This is just VALUE, the value of the symbol, plus 135133965Sjdp ADDEND, any addend associated with the reloc. */ 135233965Sjdp relocation = value + addend; 135333965Sjdp 135433965Sjdp /* If the relocation is PC relative, we want to set RELOCATION to 135533965Sjdp the distance between the symbol (currently in RELOCATION) and the 135633965Sjdp location we are relocating. Some targets (e.g., i386-aout) 135733965Sjdp arrange for the contents of the section to be the negative of the 135833965Sjdp offset of the location within the section; for such targets 1359130561Sobrien pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF) 136033965Sjdp simply leave the contents of the section as zero; for such 1361130561Sobrien targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not 136233965Sjdp need to subtract out the offset of the location within the 136333965Sjdp section (which is just ADDRESS). */ 136433965Sjdp if (howto->pc_relative) 136533965Sjdp { 136633965Sjdp relocation -= (input_section->output_section->vma 136733965Sjdp + input_section->output_offset); 136833965Sjdp if (howto->pcrel_offset) 136933965Sjdp relocation -= address; 137033965Sjdp } 137133965Sjdp 137233965Sjdp return _bfd_relocate_contents (howto, input_bfd, relocation, 137333965Sjdp contents + address); 137433965Sjdp} 137533965Sjdp 137633965Sjdp/* Relocate a given location using a given value and howto. */ 137733965Sjdp 137833965Sjdpbfd_reloc_status_type 1379130561Sobrien_bfd_relocate_contents (reloc_howto_type *howto, 1380130561Sobrien bfd *input_bfd, 1381130561Sobrien bfd_vma relocation, 1382130561Sobrien bfd_byte *location) 138333965Sjdp{ 138433965Sjdp int size; 138560484Sobrien bfd_vma x = 0; 138660484Sobrien bfd_reloc_status_type flag; 138760484Sobrien unsigned int rightshift = howto->rightshift; 138860484Sobrien unsigned int bitpos = howto->bitpos; 138933965Sjdp 139033965Sjdp /* If the size is negative, negate RELOCATION. This isn't very 139133965Sjdp general. */ 139233965Sjdp if (howto->size < 0) 139333965Sjdp relocation = -relocation; 139433965Sjdp 139533965Sjdp /* Get the value we are going to relocate. */ 139633965Sjdp size = bfd_get_reloc_size (howto); 139733965Sjdp switch (size) 139833965Sjdp { 139933965Sjdp default: 140033965Sjdp case 0: 140133965Sjdp abort (); 140233965Sjdp case 1: 140333965Sjdp x = bfd_get_8 (input_bfd, location); 140433965Sjdp break; 140533965Sjdp case 2: 140633965Sjdp x = bfd_get_16 (input_bfd, location); 140733965Sjdp break; 140833965Sjdp case 4: 140933965Sjdp x = bfd_get_32 (input_bfd, location); 141033965Sjdp break; 141133965Sjdp case 8: 141233965Sjdp#ifdef BFD64 141333965Sjdp x = bfd_get_64 (input_bfd, location); 141433965Sjdp#else 141533965Sjdp abort (); 141633965Sjdp#endif 141733965Sjdp break; 141833965Sjdp } 141933965Sjdp 142033965Sjdp /* Check for overflow. FIXME: We may drop bits during the addition 142133965Sjdp which we don't check for. We must either check at every single 142233965Sjdp operation, which would be tedious, or we must do the computations 142333965Sjdp in a type larger than bfd_vma, which would be inefficient. */ 142460484Sobrien flag = bfd_reloc_ok; 142533965Sjdp if (howto->complain_on_overflow != complain_overflow_dont) 142633965Sjdp { 142760484Sobrien bfd_vma addrmask, fieldmask, signmask, ss; 142860484Sobrien bfd_vma a, b, sum; 142933965Sjdp 143060484Sobrien /* Get the values to be added together. For signed and unsigned 143160484Sobrien relocations, we assume that all values should be truncated to 143260484Sobrien the size of an address. For bitfields, all the bits matter. 143360484Sobrien See also bfd_check_overflow. */ 143460484Sobrien fieldmask = N_ONES (howto->bitsize); 1435218822Sdim signmask = ~fieldmask; 143660484Sobrien addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask; 1437218822Sdim a = (relocation & addrmask) >> rightshift; 1438218822Sdim b = (x & howto->src_mask & addrmask) >> bitpos; 143960484Sobrien 144060484Sobrien switch (howto->complain_on_overflow) 144133965Sjdp { 144260484Sobrien case complain_overflow_signed: 144360484Sobrien /* If any sign bits are set, all sign bits must be set. 144460484Sobrien That is, A must be a valid negative address after 144560484Sobrien shifting. */ 1446218822Sdim signmask = ~(fieldmask >> 1); 1447218822Sdim /* Fall thru */ 1448218822Sdim 1449218822Sdim case complain_overflow_bitfield: 1450218822Sdim /* Much like the signed check, but for a field one bit 1451218822Sdim wider. We allow a bitfield to represent numbers in the 1452218822Sdim range -2**n to 2**n-1, where n is the number of bits in the 1453218822Sdim field. Note that when bfd_vma is 32 bits, a 32-bit reloc 1454218822Sdim can't overflow, which is exactly what we want. */ 145560484Sobrien ss = a & signmask; 145660484Sobrien if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) 145760484Sobrien flag = bfd_reloc_overflow; 145833965Sjdp 145960484Sobrien /* We only need this next bit of code if the sign bit of B 146060484Sobrien is below the sign bit of A. This would only happen if 146160484Sobrien SRC_MASK had fewer bits than BITSIZE. Note that if 146260484Sobrien SRC_MASK has more bits than BITSIZE, we can get into 146360484Sobrien trouble; we would need to verify that B is in range, as 146460484Sobrien we do for A above. */ 1465218822Sdim ss = ((~howto->src_mask) >> 1) & howto->src_mask; 1466218822Sdim ss >>= bitpos; 146733965Sjdp 146860484Sobrien /* Set all the bits above the sign bit. */ 1469218822Sdim b = (b ^ ss) - ss; 147033965Sjdp 147160484Sobrien /* Now we can do the addition. */ 147260484Sobrien sum = a + b; 147333965Sjdp 147460484Sobrien /* See if the result has the correct sign. Bits above the 147560484Sobrien sign bit are junk now; ignore them. If the sum is 147660484Sobrien positive, make sure we did not have all negative inputs; 147760484Sobrien if the sum is negative, make sure we did not have all 147860484Sobrien positive inputs. The test below looks only at the sign 147960484Sobrien bits, and it really just 148060484Sobrien SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM) 1481218822Sdim 1482218822Sdim We mask with addrmask here to explicitly allow an address 1483218822Sdim wrap-around. The Linux kernel relies on it, and it is 1484218822Sdim the only way to write assembler code which can run when 1485218822Sdim loaded at a location 0x80000000 away from the location at 1486218822Sdim which it is linked. */ 1487218822Sdim if (((~(a ^ b)) & (a ^ sum)) & signmask & addrmask) 148860484Sobrien flag = bfd_reloc_overflow; 148933965Sjdp break; 149060484Sobrien 149133965Sjdp case complain_overflow_unsigned: 149260484Sobrien /* Checking for an unsigned overflow is relatively easy: 149360484Sobrien trim the addresses and add, and trim the result as well. 149460484Sobrien Overflow is normally indicated when the result does not 149560484Sobrien fit in the field. However, we also need to consider the 149660484Sobrien case when, e.g., fieldmask is 0x7fffffff or smaller, an 149760484Sobrien input is 0x80000000, and bfd_vma is only 32 bits; then we 149860484Sobrien will get sum == 0, but there is an overflow, since the 149960484Sobrien inputs did not fit in the field. Instead of doing a 150060484Sobrien separate test, we can check for this by or-ing in the 150160484Sobrien operands when testing for the sum overflowing its final 150260484Sobrien field. */ 150360484Sobrien sum = (a + b) & addrmask; 1504218822Sdim if ((a | b | sum) & signmask) 150560484Sobrien flag = bfd_reloc_overflow; 150633965Sjdp break; 150760484Sobrien 150833965Sjdp default: 150933965Sjdp abort (); 151033965Sjdp } 151133965Sjdp } 151233965Sjdp 151333965Sjdp /* Put RELOCATION in the right bits. */ 151460484Sobrien relocation >>= (bfd_vma) rightshift; 151560484Sobrien relocation <<= (bfd_vma) bitpos; 151633965Sjdp 151733965Sjdp /* Add RELOCATION to the right bits of X. */ 151833965Sjdp x = ((x & ~howto->dst_mask) 151933965Sjdp | (((x & howto->src_mask) + relocation) & howto->dst_mask)); 152033965Sjdp 152133965Sjdp /* Put the relocated value back in the object file. */ 152233965Sjdp switch (size) 152333965Sjdp { 152433965Sjdp default: 152533965Sjdp abort (); 152633965Sjdp case 1: 152733965Sjdp bfd_put_8 (input_bfd, x, location); 152833965Sjdp break; 152933965Sjdp case 2: 153033965Sjdp bfd_put_16 (input_bfd, x, location); 153133965Sjdp break; 153233965Sjdp case 4: 153333965Sjdp bfd_put_32 (input_bfd, x, location); 153433965Sjdp break; 153533965Sjdp case 8: 153633965Sjdp#ifdef BFD64 153733965Sjdp bfd_put_64 (input_bfd, x, location); 153833965Sjdp#else 153933965Sjdp abort (); 154033965Sjdp#endif 154133965Sjdp break; 154233965Sjdp } 154333965Sjdp 154460484Sobrien return flag; 154533965Sjdp} 154633965Sjdp 1547218822Sdim/* Clear a given location using a given howto, by applying a relocation value 1548218822Sdim of zero and discarding any in-place addend. This is used for fixed-up 1549218822Sdim relocations against discarded symbols, to make ignorable debug or unwind 1550218822Sdim information more obvious. */ 1551218822Sdim 1552218822Sdimvoid 1553218822Sdim_bfd_clear_contents (reloc_howto_type *howto, 1554218822Sdim bfd *input_bfd, 1555218822Sdim bfd_byte *location) 1556218822Sdim{ 1557218822Sdim int size; 1558218822Sdim bfd_vma x = 0; 1559218822Sdim 1560218822Sdim /* Get the value we are going to relocate. */ 1561218822Sdim size = bfd_get_reloc_size (howto); 1562218822Sdim switch (size) 1563218822Sdim { 1564218822Sdim default: 1565218822Sdim case 0: 1566218822Sdim abort (); 1567218822Sdim case 1: 1568218822Sdim x = bfd_get_8 (input_bfd, location); 1569218822Sdim break; 1570218822Sdim case 2: 1571218822Sdim x = bfd_get_16 (input_bfd, location); 1572218822Sdim break; 1573218822Sdim case 4: 1574218822Sdim x = bfd_get_32 (input_bfd, location); 1575218822Sdim break; 1576218822Sdim case 8: 1577218822Sdim#ifdef BFD64 1578218822Sdim x = bfd_get_64 (input_bfd, location); 1579218822Sdim#else 1580218822Sdim abort (); 1581218822Sdim#endif 1582218822Sdim break; 1583218822Sdim } 1584218822Sdim 1585218822Sdim /* Zero out the unwanted bits of X. */ 1586218822Sdim x &= ~howto->dst_mask; 1587218822Sdim 1588218822Sdim /* Put the relocated value back in the object file. */ 1589218822Sdim switch (size) 1590218822Sdim { 1591218822Sdim default: 1592218822Sdim case 0: 1593218822Sdim abort (); 1594218822Sdim case 1: 1595218822Sdim bfd_put_8 (input_bfd, x, location); 1596218822Sdim break; 1597218822Sdim case 2: 1598218822Sdim bfd_put_16 (input_bfd, x, location); 1599218822Sdim break; 1600218822Sdim case 4: 1601218822Sdim bfd_put_32 (input_bfd, x, location); 1602218822Sdim break; 1603218822Sdim case 8: 1604218822Sdim#ifdef BFD64 1605218822Sdim bfd_put_64 (input_bfd, x, location); 1606218822Sdim#else 1607218822Sdim abort (); 1608218822Sdim#endif 1609218822Sdim break; 1610218822Sdim } 1611218822Sdim} 1612218822Sdim 161333965Sjdp/* 161433965SjdpDOCDD 161533965SjdpINODE 161633965Sjdp howto manager, , typedef arelent, Relocations 161733965Sjdp 1618218822SdimSUBSECTION 161933965Sjdp The howto manager 162033965Sjdp 162133965Sjdp When an application wants to create a relocation, but doesn't 162233965Sjdp know what the target machine might call it, it can find out by 162333965Sjdp using this bit of code. 162433965Sjdp 162533965Sjdp*/ 162633965Sjdp 162733965Sjdp/* 162833965SjdpTYPEDEF 162933965Sjdp bfd_reloc_code_type 163033965Sjdp 163133965SjdpDESCRIPTION 163233965Sjdp The insides of a reloc code. The idea is that, eventually, there 163333965Sjdp will be one enumerator for every type of relocation we ever do. 163433965Sjdp Pass one of these values to <<bfd_reloc_type_lookup>>, and it'll 163533965Sjdp return a howto pointer. 163633965Sjdp 163733965Sjdp This does mean that the application must determine the correct 163833965Sjdp enumerator value; you can't get a howto pointer from a random set 163933965Sjdp of attributes. 164033965Sjdp 164133965SjdpSENUM 164233965Sjdp bfd_reloc_code_real 164333965Sjdp 164433965SjdpENUM 164533965Sjdp BFD_RELOC_64 164633965SjdpENUMX 164733965Sjdp BFD_RELOC_32 164833965SjdpENUMX 164933965Sjdp BFD_RELOC_26 165033965SjdpENUMX 165133965Sjdp BFD_RELOC_24 165233965SjdpENUMX 165333965Sjdp BFD_RELOC_16 165433965SjdpENUMX 165533965Sjdp BFD_RELOC_14 165633965SjdpENUMX 165733965Sjdp BFD_RELOC_8 165833965SjdpENUMDOC 165933965Sjdp Basic absolute relocations of N bits. 166033965Sjdp 166133965SjdpENUM 166233965Sjdp BFD_RELOC_64_PCREL 166333965SjdpENUMX 166433965Sjdp BFD_RELOC_32_PCREL 166533965SjdpENUMX 166633965Sjdp BFD_RELOC_24_PCREL 166733965SjdpENUMX 166833965Sjdp BFD_RELOC_16_PCREL 166933965SjdpENUMX 167033965Sjdp BFD_RELOC_12_PCREL 167133965SjdpENUMX 167233965Sjdp BFD_RELOC_8_PCREL 167333965SjdpENUMDOC 167433965Sjdp PC-relative relocations. Sometimes these are relative to the address 167533965Sjdpof the relocation itself; sometimes they are relative to the start of 167633965Sjdpthe section containing the relocation. It depends on the specific target. 167733965Sjdp 167833965SjdpThe 24-bit relocation is used in some Intel 960 configurations. 167933965Sjdp 168033965SjdpENUM 1681218822Sdim BFD_RELOC_32_SECREL 1682218822SdimENUMDOC 1683218822Sdim Section relative relocations. Some targets need this for DWARF2. 1684218822Sdim 1685218822SdimENUM 168633965Sjdp BFD_RELOC_32_GOT_PCREL 168733965SjdpENUMX 168833965Sjdp BFD_RELOC_16_GOT_PCREL 168933965SjdpENUMX 169033965Sjdp BFD_RELOC_8_GOT_PCREL 169133965SjdpENUMX 169233965Sjdp BFD_RELOC_32_GOTOFF 169333965SjdpENUMX 169433965Sjdp BFD_RELOC_16_GOTOFF 169533965SjdpENUMX 169633965Sjdp BFD_RELOC_LO16_GOTOFF 169733965SjdpENUMX 169833965Sjdp BFD_RELOC_HI16_GOTOFF 169933965SjdpENUMX 170033965Sjdp BFD_RELOC_HI16_S_GOTOFF 170133965SjdpENUMX 170233965Sjdp BFD_RELOC_8_GOTOFF 170333965SjdpENUMX 170489857Sobrien BFD_RELOC_64_PLT_PCREL 170589857SobrienENUMX 170633965Sjdp BFD_RELOC_32_PLT_PCREL 170733965SjdpENUMX 170833965Sjdp BFD_RELOC_24_PLT_PCREL 170933965SjdpENUMX 171033965Sjdp BFD_RELOC_16_PLT_PCREL 171133965SjdpENUMX 171233965Sjdp BFD_RELOC_8_PLT_PCREL 171333965SjdpENUMX 171489857Sobrien BFD_RELOC_64_PLTOFF 171589857SobrienENUMX 171633965Sjdp BFD_RELOC_32_PLTOFF 171733965SjdpENUMX 171833965Sjdp BFD_RELOC_16_PLTOFF 171933965SjdpENUMX 172033965Sjdp BFD_RELOC_LO16_PLTOFF 172133965SjdpENUMX 172233965Sjdp BFD_RELOC_HI16_PLTOFF 172333965SjdpENUMX 172433965Sjdp BFD_RELOC_HI16_S_PLTOFF 172533965SjdpENUMX 172633965Sjdp BFD_RELOC_8_PLTOFF 172733965SjdpENUMDOC 172833965Sjdp For ELF. 172933965Sjdp 173033965SjdpENUM 173133965Sjdp BFD_RELOC_68K_GLOB_DAT 173233965SjdpENUMX 173333965Sjdp BFD_RELOC_68K_JMP_SLOT 173433965SjdpENUMX 173533965Sjdp BFD_RELOC_68K_RELATIVE 173633965SjdpENUMDOC 173733965Sjdp Relocations used by 68K ELF. 173833965Sjdp 173933965SjdpENUM 174033965Sjdp BFD_RELOC_32_BASEREL 174133965SjdpENUMX 174233965Sjdp BFD_RELOC_16_BASEREL 174333965SjdpENUMX 174433965Sjdp BFD_RELOC_LO16_BASEREL 174533965SjdpENUMX 174633965Sjdp BFD_RELOC_HI16_BASEREL 174733965SjdpENUMX 174833965Sjdp BFD_RELOC_HI16_S_BASEREL 174933965SjdpENUMX 175033965Sjdp BFD_RELOC_8_BASEREL 175133965SjdpENUMX 175233965Sjdp BFD_RELOC_RVA 175333965SjdpENUMDOC 175433965Sjdp Linkage-table relative. 175533965Sjdp 175633965SjdpENUM 175733965Sjdp BFD_RELOC_8_FFnn 175833965SjdpENUMDOC 175933965Sjdp Absolute 8-bit relocation, but used to form an address like 0xFFnn. 176033965Sjdp 176133965SjdpENUM 176233965Sjdp BFD_RELOC_32_PCREL_S2 176333965SjdpENUMX 176433965Sjdp BFD_RELOC_16_PCREL_S2 176533965SjdpENUMX 176633965Sjdp BFD_RELOC_23_PCREL_S2 176733965SjdpENUMDOC 176833965Sjdp These PC-relative relocations are stored as word displacements -- 176933965Sjdpi.e., byte displacements shifted right two bits. The 30-bit word 177033965Sjdpdisplacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the 177133965SjdpSPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 177233965Sjdpsigned 16-bit displacement is used on the MIPS, and the 23-bit 177333965Sjdpdisplacement is used on the Alpha. 177433965Sjdp 177533965SjdpENUM 177633965Sjdp BFD_RELOC_HI22 177733965SjdpENUMX 177833965Sjdp BFD_RELOC_LO10 177933965SjdpENUMDOC 178033965Sjdp High 22 bits and low 10 bits of 32-bit value, placed into lower bits of 178133965Sjdpthe target word. These are used on the SPARC. 178233965Sjdp 178333965SjdpENUM 178433965Sjdp BFD_RELOC_GPREL16 178533965SjdpENUMX 178633965Sjdp BFD_RELOC_GPREL32 178733965SjdpENUMDOC 178833965Sjdp For systems that allocate a Global Pointer register, these are 178933965Sjdpdisplacements off that register. These relocation types are 179033965Sjdphandled specially, because the value the register will have is 179133965Sjdpdecided relatively late. 179233965Sjdp 179333965SjdpENUM 179433965Sjdp BFD_RELOC_I960_CALLJ 179533965SjdpENUMDOC 179633965Sjdp Reloc types used for i960/b.out. 179733965Sjdp 179833965SjdpENUM 179933965Sjdp BFD_RELOC_NONE 180033965SjdpENUMX 180133965Sjdp BFD_RELOC_SPARC_WDISP22 180233965SjdpENUMX 180333965Sjdp BFD_RELOC_SPARC22 180433965SjdpENUMX 180533965Sjdp BFD_RELOC_SPARC13 180633965SjdpENUMX 180733965Sjdp BFD_RELOC_SPARC_GOT10 180833965SjdpENUMX 180933965Sjdp BFD_RELOC_SPARC_GOT13 181033965SjdpENUMX 181133965Sjdp BFD_RELOC_SPARC_GOT22 181233965SjdpENUMX 181333965Sjdp BFD_RELOC_SPARC_PC10 181433965SjdpENUMX 181533965Sjdp BFD_RELOC_SPARC_PC22 181633965SjdpENUMX 181733965Sjdp BFD_RELOC_SPARC_WPLT30 181833965SjdpENUMX 181933965Sjdp BFD_RELOC_SPARC_COPY 182033965SjdpENUMX 182133965Sjdp BFD_RELOC_SPARC_GLOB_DAT 182233965SjdpENUMX 182333965Sjdp BFD_RELOC_SPARC_JMP_SLOT 182433965SjdpENUMX 182533965Sjdp BFD_RELOC_SPARC_RELATIVE 182633965SjdpENUMX 182778828Sobrien BFD_RELOC_SPARC_UA16 182878828SobrienENUMX 182933965Sjdp BFD_RELOC_SPARC_UA32 183078828SobrienENUMX 183178828Sobrien BFD_RELOC_SPARC_UA64 183233965SjdpENUMDOC 183333965Sjdp SPARC ELF relocations. There is probably some overlap with other 183433965Sjdp relocation types already defined. 183533965Sjdp 183633965SjdpENUM 183733965Sjdp BFD_RELOC_SPARC_BASE13 183833965SjdpENUMX 183933965Sjdp BFD_RELOC_SPARC_BASE22 184033965SjdpENUMDOC 184133965Sjdp I think these are specific to SPARC a.out (e.g., Sun 4). 184233965Sjdp 184333965SjdpENUMEQ 184433965Sjdp BFD_RELOC_SPARC_64 184533965Sjdp BFD_RELOC_64 184633965SjdpENUMX 184733965Sjdp BFD_RELOC_SPARC_10 184833965SjdpENUMX 184933965Sjdp BFD_RELOC_SPARC_11 185033965SjdpENUMX 185133965Sjdp BFD_RELOC_SPARC_OLO10 185233965SjdpENUMX 185333965Sjdp BFD_RELOC_SPARC_HH22 185433965SjdpENUMX 185533965Sjdp BFD_RELOC_SPARC_HM10 185633965SjdpENUMX 185733965Sjdp BFD_RELOC_SPARC_LM22 185833965SjdpENUMX 185933965Sjdp BFD_RELOC_SPARC_PC_HH22 186033965SjdpENUMX 186133965Sjdp BFD_RELOC_SPARC_PC_HM10 186233965SjdpENUMX 186333965Sjdp BFD_RELOC_SPARC_PC_LM22 186433965SjdpENUMX 186533965Sjdp BFD_RELOC_SPARC_WDISP16 186633965SjdpENUMX 186733965Sjdp BFD_RELOC_SPARC_WDISP19 186833965SjdpENUMX 186933965Sjdp BFD_RELOC_SPARC_7 187033965SjdpENUMX 187133965Sjdp BFD_RELOC_SPARC_6 187233965SjdpENUMX 187333965Sjdp BFD_RELOC_SPARC_5 187438889SjdpENUMEQX 187538889Sjdp BFD_RELOC_SPARC_DISP64 187638889Sjdp BFD_RELOC_64_PCREL 187738889SjdpENUMX 187889857Sobrien BFD_RELOC_SPARC_PLT32 187989857SobrienENUMX 188038889Sjdp BFD_RELOC_SPARC_PLT64 188138889SjdpENUMX 188238889Sjdp BFD_RELOC_SPARC_HIX22 188338889SjdpENUMX 188438889Sjdp BFD_RELOC_SPARC_LOX10 188538889SjdpENUMX 188638889Sjdp BFD_RELOC_SPARC_H44 188738889SjdpENUMX 188838889Sjdp BFD_RELOC_SPARC_M44 188938889SjdpENUMX 189038889Sjdp BFD_RELOC_SPARC_L44 189138889SjdpENUMX 189238889Sjdp BFD_RELOC_SPARC_REGISTER 189333965SjdpENUMDOC 189438889Sjdp SPARC64 relocations 189533965Sjdp 189633965SjdpENUM 189760484Sobrien BFD_RELOC_SPARC_REV32 189860484SobrienENUMDOC 189960484Sobrien SPARC little endian relocation 1900130561SobrienENUM 1901130561Sobrien BFD_RELOC_SPARC_TLS_GD_HI22 1902130561SobrienENUMX 1903130561Sobrien BFD_RELOC_SPARC_TLS_GD_LO10 1904130561SobrienENUMX 1905130561Sobrien BFD_RELOC_SPARC_TLS_GD_ADD 1906130561SobrienENUMX 1907130561Sobrien BFD_RELOC_SPARC_TLS_GD_CALL 1908130561SobrienENUMX 1909130561Sobrien BFD_RELOC_SPARC_TLS_LDM_HI22 1910130561SobrienENUMX 1911130561Sobrien BFD_RELOC_SPARC_TLS_LDM_LO10 1912130561SobrienENUMX 1913130561Sobrien BFD_RELOC_SPARC_TLS_LDM_ADD 1914130561SobrienENUMX 1915130561Sobrien BFD_RELOC_SPARC_TLS_LDM_CALL 1916130561SobrienENUMX 1917130561Sobrien BFD_RELOC_SPARC_TLS_LDO_HIX22 1918130561SobrienENUMX 1919130561Sobrien BFD_RELOC_SPARC_TLS_LDO_LOX10 1920130561SobrienENUMX 1921130561Sobrien BFD_RELOC_SPARC_TLS_LDO_ADD 1922130561SobrienENUMX 1923130561Sobrien BFD_RELOC_SPARC_TLS_IE_HI22 1924130561SobrienENUMX 1925130561Sobrien BFD_RELOC_SPARC_TLS_IE_LO10 1926130561SobrienENUMX 1927130561Sobrien BFD_RELOC_SPARC_TLS_IE_LD 1928130561SobrienENUMX 1929130561Sobrien BFD_RELOC_SPARC_TLS_IE_LDX 1930130561SobrienENUMX 1931130561Sobrien BFD_RELOC_SPARC_TLS_IE_ADD 1932130561SobrienENUMX 1933130561Sobrien BFD_RELOC_SPARC_TLS_LE_HIX22 1934130561SobrienENUMX 1935130561Sobrien BFD_RELOC_SPARC_TLS_LE_LOX10 1936130561SobrienENUMX 1937130561Sobrien BFD_RELOC_SPARC_TLS_DTPMOD32 1938130561SobrienENUMX 1939130561Sobrien BFD_RELOC_SPARC_TLS_DTPMOD64 1940130561SobrienENUMX 1941130561Sobrien BFD_RELOC_SPARC_TLS_DTPOFF32 1942130561SobrienENUMX 1943130561Sobrien BFD_RELOC_SPARC_TLS_DTPOFF64 1944130561SobrienENUMX 1945130561Sobrien BFD_RELOC_SPARC_TLS_TPOFF32 1946130561SobrienENUMX 1947130561Sobrien BFD_RELOC_SPARC_TLS_TPOFF64 1948130561SobrienENUMDOC 1949130561Sobrien SPARC TLS relocations 195060484Sobrien 195160484SobrienENUM 1952218822Sdim BFD_RELOC_SPU_IMM7 1953218822SdimENUMX 1954218822Sdim BFD_RELOC_SPU_IMM8 1955218822SdimENUMX 1956218822Sdim BFD_RELOC_SPU_IMM10 1957218822SdimENUMX 1958218822Sdim BFD_RELOC_SPU_IMM10W 1959218822SdimENUMX 1960218822Sdim BFD_RELOC_SPU_IMM16 1961218822SdimENUMX 1962218822Sdim BFD_RELOC_SPU_IMM16W 1963218822SdimENUMX 1964218822Sdim BFD_RELOC_SPU_IMM18 1965218822SdimENUMX 1966218822Sdim BFD_RELOC_SPU_PCREL9a 1967218822SdimENUMX 1968218822Sdim BFD_RELOC_SPU_PCREL9b 1969218822SdimENUMX 1970218822Sdim BFD_RELOC_SPU_PCREL16 1971218822SdimENUMX 1972218822Sdim BFD_RELOC_SPU_LO16 1973218822SdimENUMX 1974218822Sdim BFD_RELOC_SPU_HI16 1975218822SdimENUMX 1976218822Sdim BFD_RELOC_SPU_PPU32 1977218822SdimENUMX 1978218822Sdim BFD_RELOC_SPU_PPU64 1979218822SdimENUMDOC 1980218822Sdim SPU Relocations. 1981218822Sdim 1982218822SdimENUM 198333965Sjdp BFD_RELOC_ALPHA_GPDISP_HI16 198433965SjdpENUMDOC 198533965Sjdp Alpha ECOFF and ELF relocations. Some of these treat the symbol or 198633965Sjdp "addend" in some special way. 198733965Sjdp For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when 198833965Sjdp writing; when reading, it will be the absolute section symbol. The 198933965Sjdp addend is the displacement in bytes of the "lda" instruction from 199033965Sjdp the "ldah" instruction (which is at the address of this reloc). 199133965SjdpENUM 199233965Sjdp BFD_RELOC_ALPHA_GPDISP_LO16 199333965SjdpENUMDOC 199433965Sjdp For GPDISP_LO16 ("ignore") relocations, the symbol is handled as 199533965Sjdp with GPDISP_HI16 relocs. The addend is ignored when writing the 199633965Sjdp relocations out, and is filled in with the file's GP value on 199733965Sjdp reading, for convenience. 199833965Sjdp 199933965SjdpENUM 200033965Sjdp BFD_RELOC_ALPHA_GPDISP 200133965SjdpENUMDOC 200233965Sjdp The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 200333965Sjdp relocation except that there is no accompanying GPDISP_LO16 200433965Sjdp relocation. 200533965Sjdp 200633965SjdpENUM 200733965Sjdp BFD_RELOC_ALPHA_LITERAL 200833965SjdpENUMX 200933965Sjdp BFD_RELOC_ALPHA_ELF_LITERAL 201033965SjdpENUMX 201133965Sjdp BFD_RELOC_ALPHA_LITUSE 201233965SjdpENUMDOC 201333965Sjdp The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; 201433965Sjdp the assembler turns it into a LDQ instruction to load the address of 201533965Sjdp the symbol, and then fills in a register in the real instruction. 201633965Sjdp 201733965Sjdp The LITERAL reloc, at the LDQ instruction, refers to the .lita 201833965Sjdp section symbol. The addend is ignored when writing, but is filled 201933965Sjdp in with the file's GP value on reading, for convenience, as with the 202033965Sjdp GPDISP_LO16 reloc. 202133965Sjdp 202233965Sjdp The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. 202333965Sjdp It should refer to the symbol to be referenced, as with 16_GOTOFF, 202433965Sjdp but it generates output not based on the position within the .got 202533965Sjdp section, but relative to the GP value chosen for the file during the 202633965Sjdp final link stage. 202733965Sjdp 202833965Sjdp The LITUSE reloc, on the instruction using the loaded address, gives 202933965Sjdp information to the linker that it might be able to use to optimize 203033965Sjdp away some literal section references. The symbol is ignored (read 203133965Sjdp as the absolute section symbol), and the "addend" indicates the type 203233965Sjdp of instruction using the register: 203333965Sjdp 1 - "memory" fmt insn 203433965Sjdp 2 - byte-manipulation (byte offset reg) 203533965Sjdp 3 - jsr (target of branch) 203633965Sjdp 203733965SjdpENUM 203833965Sjdp BFD_RELOC_ALPHA_HINT 203933965SjdpENUMDOC 204033965Sjdp The HINT relocation indicates a value that should be filled into the 204133965Sjdp "hint" field of a jmp/jsr/ret instruction, for possible branch- 204233965Sjdp prediction logic which may be provided on some processors. 204333965Sjdp 204433965SjdpENUM 204533965Sjdp BFD_RELOC_ALPHA_LINKAGE 204633965SjdpENUMDOC 204733965Sjdp The LINKAGE relocation outputs a linkage pair in the object file, 204833965Sjdp which is filled by the linker. 204933965Sjdp 205033965SjdpENUM 205133965Sjdp BFD_RELOC_ALPHA_CODEADDR 205233965SjdpENUMDOC 205333965Sjdp The CODEADDR relocation outputs a STO_CA in the object file, 205433965Sjdp which is filled by the linker. 205533965Sjdp 205633965SjdpENUM 205789857Sobrien BFD_RELOC_ALPHA_GPREL_HI16 205889857SobrienENUMX 205989857Sobrien BFD_RELOC_ALPHA_GPREL_LO16 206089857SobrienENUMDOC 206189857Sobrien The GPREL_HI/LO relocations together form a 32-bit offset from the 206289857Sobrien GP register. 206389857Sobrien 206489857SobrienENUM 206591041Sobrien BFD_RELOC_ALPHA_BRSGP 206691041SobrienENUMDOC 206791041Sobrien Like BFD_RELOC_23_PCREL_S2, except that the source and target must 2068130561Sobrien share a common GP, and the target address is adjusted for 206991041Sobrien STO_ALPHA_STD_GPLOAD. 207091041Sobrien 207191041SobrienENUM 2072104834Sobrien BFD_RELOC_ALPHA_TLSGD 2073104834SobrienENUMX 2074104834Sobrien BFD_RELOC_ALPHA_TLSLDM 2075104834SobrienENUMX 2076104834Sobrien BFD_RELOC_ALPHA_DTPMOD64 2077104834SobrienENUMX 2078104834Sobrien BFD_RELOC_ALPHA_GOTDTPREL16 2079104834SobrienENUMX 2080104834Sobrien BFD_RELOC_ALPHA_DTPREL64 2081104834SobrienENUMX 2082104834Sobrien BFD_RELOC_ALPHA_DTPREL_HI16 2083104834SobrienENUMX 2084104834Sobrien BFD_RELOC_ALPHA_DTPREL_LO16 2085104834SobrienENUMX 2086104834Sobrien BFD_RELOC_ALPHA_DTPREL16 2087104834SobrienENUMX 2088104834Sobrien BFD_RELOC_ALPHA_GOTTPREL16 2089104834SobrienENUMX 2090104834Sobrien BFD_RELOC_ALPHA_TPREL64 2091104834SobrienENUMX 2092104834Sobrien BFD_RELOC_ALPHA_TPREL_HI16 2093104834SobrienENUMX 2094104834Sobrien BFD_RELOC_ALPHA_TPREL_LO16 2095104834SobrienENUMX 2096104834Sobrien BFD_RELOC_ALPHA_TPREL16 2097104834SobrienENUMDOC 2098104834Sobrien Alpha thread-local storage relocations. 2099104834Sobrien 2100104834SobrienENUM 210133965Sjdp BFD_RELOC_MIPS_JMP 210233965SjdpENUMDOC 210333965Sjdp Bits 27..2 of the relocation address shifted right 2 bits; 210433965Sjdp simple reloc otherwise. 210533965Sjdp 210633965SjdpENUM 210733965Sjdp BFD_RELOC_MIPS16_JMP 210833965SjdpENUMDOC 210933965Sjdp The MIPS16 jump instruction. 211033965Sjdp 211133965SjdpENUM 211233965Sjdp BFD_RELOC_MIPS16_GPREL 211333965SjdpENUMDOC 211433965Sjdp MIPS16 GP relative reloc. 211533965Sjdp 211633965SjdpENUM 211733965Sjdp BFD_RELOC_HI16 211833965SjdpENUMDOC 211933965Sjdp High 16 bits of 32-bit value; simple reloc. 212033965SjdpENUM 212133965Sjdp BFD_RELOC_HI16_S 212233965SjdpENUMDOC 212333965Sjdp High 16 bits of 32-bit value but the low 16 bits will be sign 212433965Sjdp extended and added to form the final result. If the low 16 212533965Sjdp bits form a negative number, we need to add one to the high value 212633965Sjdp to compensate for the borrow when the low bits are added. 212733965SjdpENUM 212833965Sjdp BFD_RELOC_LO16 212933965SjdpENUMDOC 213033965Sjdp Low 16 bits. 2131218822Sdim 213233965SjdpENUM 2133218822Sdim BFD_RELOC_HI16_PCREL 213433965SjdpENUMDOC 2135218822Sdim High 16 bits of 32-bit pc-relative value 213633965SjdpENUM 2137218822Sdim BFD_RELOC_HI16_S_PCREL 213833965SjdpENUMDOC 2139218822Sdim High 16 bits of 32-bit pc-relative value, adjusted 2140218822SdimENUM 2141218822Sdim BFD_RELOC_LO16_PCREL 2142218822SdimENUMDOC 2143218822Sdim Low 16 bits of pc-relative value 214433965Sjdp 214533965SjdpENUM 2146218822Sdim BFD_RELOC_MIPS16_HI16 2147218822SdimENUMDOC 2148218822Sdim MIPS16 high 16 bits of 32-bit value. 2149218822SdimENUM 2150218822Sdim BFD_RELOC_MIPS16_HI16_S 2151218822SdimENUMDOC 2152218822Sdim MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign 2153218822Sdim extended and added to form the final result. If the low 16 2154218822Sdim bits form a negative number, we need to add one to the high value 2155218822Sdim to compensate for the borrow when the low bits are added. 2156218822SdimENUM 2157218822Sdim BFD_RELOC_MIPS16_LO16 2158218822SdimENUMDOC 2159218822Sdim MIPS16 low 16 bits. 2160218822Sdim 2161218822SdimENUM 216233965Sjdp BFD_RELOC_MIPS_LITERAL 216333965SjdpENUMDOC 216433965Sjdp Relocation against a MIPS literal section. 216533965Sjdp 216633965SjdpENUM 216733965Sjdp BFD_RELOC_MIPS_GOT16 216833965SjdpENUMX 216933965Sjdp BFD_RELOC_MIPS_CALL16 217033965SjdpENUMX 217133965Sjdp BFD_RELOC_MIPS_GOT_HI16 217233965SjdpENUMX 217333965Sjdp BFD_RELOC_MIPS_GOT_LO16 217433965SjdpENUMX 217533965Sjdp BFD_RELOC_MIPS_CALL_HI16 217633965SjdpENUMX 217733965Sjdp BFD_RELOC_MIPS_CALL_LO16 217860484SobrienENUMX 217960484Sobrien BFD_RELOC_MIPS_SUB 218060484SobrienENUMX 218160484Sobrien BFD_RELOC_MIPS_GOT_PAGE 218260484SobrienENUMX 218360484Sobrien BFD_RELOC_MIPS_GOT_OFST 218460484SobrienENUMX 218560484Sobrien BFD_RELOC_MIPS_GOT_DISP 218678828SobrienENUMX 218778828Sobrien BFD_RELOC_MIPS_SHIFT5 218878828SobrienENUMX 218978828Sobrien BFD_RELOC_MIPS_SHIFT6 219078828SobrienENUMX 219178828Sobrien BFD_RELOC_MIPS_INSERT_A 219278828SobrienENUMX 219378828Sobrien BFD_RELOC_MIPS_INSERT_B 219478828SobrienENUMX 219578828Sobrien BFD_RELOC_MIPS_DELETE 219678828SobrienENUMX 219778828Sobrien BFD_RELOC_MIPS_HIGHEST 219878828SobrienENUMX 219978828Sobrien BFD_RELOC_MIPS_HIGHER 220078828SobrienENUMX 220178828Sobrien BFD_RELOC_MIPS_SCN_DISP 220278828SobrienENUMX 220378828Sobrien BFD_RELOC_MIPS_REL16 220478828SobrienENUMX 220578828Sobrien BFD_RELOC_MIPS_RELGOT 220678828SobrienENUMX 220778828Sobrien BFD_RELOC_MIPS_JALR 2208218822SdimENUMX 2209218822Sdim BFD_RELOC_MIPS_TLS_DTPMOD32 2210218822SdimENUMX 2211218822Sdim BFD_RELOC_MIPS_TLS_DTPREL32 2212218822SdimENUMX 2213218822Sdim BFD_RELOC_MIPS_TLS_DTPMOD64 2214218822SdimENUMX 2215218822Sdim BFD_RELOC_MIPS_TLS_DTPREL64 2216218822SdimENUMX 2217218822Sdim BFD_RELOC_MIPS_TLS_GD 2218218822SdimENUMX 2219218822Sdim BFD_RELOC_MIPS_TLS_LDM 2220218822SdimENUMX 2221218822Sdim BFD_RELOC_MIPS_TLS_DTPREL_HI16 2222218822SdimENUMX 2223218822Sdim BFD_RELOC_MIPS_TLS_DTPREL_LO16 2224218822SdimENUMX 2225218822Sdim BFD_RELOC_MIPS_TLS_GOTTPREL 2226218822SdimENUMX 2227218822Sdim BFD_RELOC_MIPS_TLS_TPREL32 2228218822SdimENUMX 2229218822Sdim BFD_RELOC_MIPS_TLS_TPREL64 2230218822SdimENUMX 2231218822Sdim BFD_RELOC_MIPS_TLS_TPREL_HI16 2232218822SdimENUMX 2233218822Sdim BFD_RELOC_MIPS_TLS_TPREL_LO16 2234130561SobrienENUMDOC 2235130561Sobrien MIPS ELF relocations. 223638889SjdpCOMMENT 2237130561Sobrien 2238104834SobrienENUM 2239218822Sdim BFD_RELOC_MIPS_COPY 2240218822SdimENUMX 2241218822Sdim BFD_RELOC_MIPS_JUMP_SLOT 2242218822SdimENUMDOC 2243218822Sdim MIPS ELF relocations (VxWorks extensions). 2244218822SdimCOMMENT 2245218822Sdim 2246218822SdimENUM 2247104834Sobrien BFD_RELOC_FRV_LABEL16 2248104834SobrienENUMX 2249104834Sobrien BFD_RELOC_FRV_LABEL24 2250104834SobrienENUMX 2251104834Sobrien BFD_RELOC_FRV_LO16 2252104834SobrienENUMX 2253104834Sobrien BFD_RELOC_FRV_HI16 2254104834SobrienENUMX 2255104834Sobrien BFD_RELOC_FRV_GPREL12 2256104834SobrienENUMX 2257104834Sobrien BFD_RELOC_FRV_GPRELU12 2258104834SobrienENUMX 2259104834Sobrien BFD_RELOC_FRV_GPREL32 2260104834SobrienENUMX 2261104834Sobrien BFD_RELOC_FRV_GPRELHI 2262104834SobrienENUMX 2263104834Sobrien BFD_RELOC_FRV_GPRELLO 2264130561SobrienENUMX 2265130561Sobrien BFD_RELOC_FRV_GOT12 2266130561SobrienENUMX 2267130561Sobrien BFD_RELOC_FRV_GOTHI 2268130561SobrienENUMX 2269130561Sobrien BFD_RELOC_FRV_GOTLO 2270130561SobrienENUMX 2271130561Sobrien BFD_RELOC_FRV_FUNCDESC 2272130561SobrienENUMX 2273130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOT12 2274130561SobrienENUMX 2275130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTHI 2276130561SobrienENUMX 2277130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTLO 2278130561SobrienENUMX 2279130561Sobrien BFD_RELOC_FRV_FUNCDESC_VALUE 2280130561SobrienENUMX 2281130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFF12 2282130561SobrienENUMX 2283130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFFHI 2284130561SobrienENUMX 2285130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFFLO 2286130561SobrienENUMX 2287130561Sobrien BFD_RELOC_FRV_GOTOFF12 2288130561SobrienENUMX 2289130561Sobrien BFD_RELOC_FRV_GOTOFFHI 2290130561SobrienENUMX 2291130561Sobrien BFD_RELOC_FRV_GOTOFFLO 2292218822SdimENUMX 2293218822Sdim BFD_RELOC_FRV_GETTLSOFF 2294218822SdimENUMX 2295218822Sdim BFD_RELOC_FRV_TLSDESC_VALUE 2296218822SdimENUMX 2297218822Sdim BFD_RELOC_FRV_GOTTLSDESC12 2298218822SdimENUMX 2299218822Sdim BFD_RELOC_FRV_GOTTLSDESCHI 2300218822SdimENUMX 2301218822Sdim BFD_RELOC_FRV_GOTTLSDESCLO 2302218822SdimENUMX 2303218822Sdim BFD_RELOC_FRV_TLSMOFF12 2304218822SdimENUMX 2305218822Sdim BFD_RELOC_FRV_TLSMOFFHI 2306218822SdimENUMX 2307218822Sdim BFD_RELOC_FRV_TLSMOFFLO 2308218822SdimENUMX 2309218822Sdim BFD_RELOC_FRV_GOTTLSOFF12 2310218822SdimENUMX 2311218822Sdim BFD_RELOC_FRV_GOTTLSOFFHI 2312218822SdimENUMX 2313218822Sdim BFD_RELOC_FRV_GOTTLSOFFLO 2314218822SdimENUMX 2315218822Sdim BFD_RELOC_FRV_TLSOFF 2316218822SdimENUMX 2317218822Sdim BFD_RELOC_FRV_TLSDESC_RELAX 2318218822SdimENUMX 2319218822Sdim BFD_RELOC_FRV_GETTLSOFF_RELAX 2320218822SdimENUMX 2321218822Sdim BFD_RELOC_FRV_TLSOFF_RELAX 2322218822SdimENUMX 2323218822Sdim BFD_RELOC_FRV_TLSMOFF 2324104834SobrienENUMDOC 2325104834Sobrien Fujitsu Frv Relocations. 232691041SobrienCOMMENT 2327130561Sobrien 2328130561SobrienENUM 2329130561Sobrien BFD_RELOC_MN10300_GOTOFF24 233033965SjdpENUMDOC 2331130561Sobrien This is a 24bit GOT-relative reloc for the mn10300. 2332130561SobrienENUM 2333130561Sobrien BFD_RELOC_MN10300_GOT32 2334130561SobrienENUMDOC 2335130561Sobrien This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes 2336130561Sobrien in the instruction. 2337130561SobrienENUM 2338130561Sobrien BFD_RELOC_MN10300_GOT24 2339130561SobrienENUMDOC 2340130561Sobrien This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes 2341130561Sobrien in the instruction. 2342130561SobrienENUM 2343130561Sobrien BFD_RELOC_MN10300_GOT16 2344130561SobrienENUMDOC 2345130561Sobrien This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes 2346130561Sobrien in the instruction. 2347130561SobrienENUM 2348130561Sobrien BFD_RELOC_MN10300_COPY 2349130561SobrienENUMDOC 2350130561Sobrien Copy symbol at runtime. 2351130561SobrienENUM 2352130561Sobrien BFD_RELOC_MN10300_GLOB_DAT 2353130561SobrienENUMDOC 2354130561Sobrien Create GOT entry. 2355130561SobrienENUM 2356130561Sobrien BFD_RELOC_MN10300_JMP_SLOT 2357130561SobrienENUMDOC 2358130561Sobrien Create PLT entry. 2359130561SobrienENUM 2360130561Sobrien BFD_RELOC_MN10300_RELATIVE 2361130561SobrienENUMDOC 2362130561Sobrien Adjust by program base. 236338889SjdpCOMMENT 236438889Sjdp 236533965SjdpENUM 236633965Sjdp BFD_RELOC_386_GOT32 236733965SjdpENUMX 236833965Sjdp BFD_RELOC_386_PLT32 236933965SjdpENUMX 237033965Sjdp BFD_RELOC_386_COPY 237133965SjdpENUMX 237233965Sjdp BFD_RELOC_386_GLOB_DAT 237333965SjdpENUMX 237433965Sjdp BFD_RELOC_386_JUMP_SLOT 237533965SjdpENUMX 237633965Sjdp BFD_RELOC_386_RELATIVE 237733965SjdpENUMX 237833965Sjdp BFD_RELOC_386_GOTOFF 237933965SjdpENUMX 238033965Sjdp BFD_RELOC_386_GOTPC 2381104834SobrienENUMX 2382104834Sobrien BFD_RELOC_386_TLS_TPOFF 2383104834SobrienENUMX 2384104834Sobrien BFD_RELOC_386_TLS_IE 2385104834SobrienENUMX 2386104834Sobrien BFD_RELOC_386_TLS_GOTIE 2387104834SobrienENUMX 2388104834Sobrien BFD_RELOC_386_TLS_LE 2389104834SobrienENUMX 2390104834Sobrien BFD_RELOC_386_TLS_GD 2391104834SobrienENUMX 2392104834Sobrien BFD_RELOC_386_TLS_LDM 2393104834SobrienENUMX 2394104834Sobrien BFD_RELOC_386_TLS_LDO_32 2395104834SobrienENUMX 2396104834Sobrien BFD_RELOC_386_TLS_IE_32 2397104834SobrienENUMX 2398104834Sobrien BFD_RELOC_386_TLS_LE_32 2399104834SobrienENUMX 2400104834Sobrien BFD_RELOC_386_TLS_DTPMOD32 2401104834SobrienENUMX 2402104834Sobrien BFD_RELOC_386_TLS_DTPOFF32 2403104834SobrienENUMX 2404104834Sobrien BFD_RELOC_386_TLS_TPOFF32 2405218822SdimENUMX 2406218822Sdim BFD_RELOC_386_TLS_GOTDESC 2407218822SdimENUMX 2408218822Sdim BFD_RELOC_386_TLS_DESC_CALL 2409218822SdimENUMX 2410218822Sdim BFD_RELOC_386_TLS_DESC 241133965SjdpENUMDOC 241233965Sjdp i386/elf relocations 241333965Sjdp 241433965SjdpENUM 241577298Sobrien BFD_RELOC_X86_64_GOT32 241677298SobrienENUMX 241777298Sobrien BFD_RELOC_X86_64_PLT32 241877298SobrienENUMX 241977298Sobrien BFD_RELOC_X86_64_COPY 242077298SobrienENUMX 242177298Sobrien BFD_RELOC_X86_64_GLOB_DAT 242277298SobrienENUMX 242377298Sobrien BFD_RELOC_X86_64_JUMP_SLOT 242477298SobrienENUMX 242577298Sobrien BFD_RELOC_X86_64_RELATIVE 242677298SobrienENUMX 242777298Sobrien BFD_RELOC_X86_64_GOTPCREL 242877298SobrienENUMX 242977298Sobrien BFD_RELOC_X86_64_32S 2430130561SobrienENUMX 2431130561Sobrien BFD_RELOC_X86_64_DTPMOD64 2432130561SobrienENUMX 2433130561Sobrien BFD_RELOC_X86_64_DTPOFF64 2434130561SobrienENUMX 2435130561Sobrien BFD_RELOC_X86_64_TPOFF64 2436130561SobrienENUMX 2437130561Sobrien BFD_RELOC_X86_64_TLSGD 2438130561SobrienENUMX 2439130561Sobrien BFD_RELOC_X86_64_TLSLD 2440130561SobrienENUMX 2441130561Sobrien BFD_RELOC_X86_64_DTPOFF32 2442130561SobrienENUMX 2443130561Sobrien BFD_RELOC_X86_64_GOTTPOFF 2444130561SobrienENUMX 2445130561Sobrien BFD_RELOC_X86_64_TPOFF32 2446218822SdimENUMX 2447218822Sdim BFD_RELOC_X86_64_GOTOFF64 2448218822SdimENUMX 2449218822Sdim BFD_RELOC_X86_64_GOTPC32 2450218822SdimENUMX 2451218822Sdim BFD_RELOC_X86_64_GOT64 2452218822SdimENUMX 2453218822Sdim BFD_RELOC_X86_64_GOTPCREL64 2454218822SdimENUMX 2455218822Sdim BFD_RELOC_X86_64_GOTPC64 2456218822SdimENUMX 2457218822Sdim BFD_RELOC_X86_64_GOTPLT64 2458218822SdimENUMX 2459218822Sdim BFD_RELOC_X86_64_PLTOFF64 2460218822SdimENUMX 2461218822Sdim BFD_RELOC_X86_64_GOTPC32_TLSDESC 2462218822SdimENUMX 2463218822Sdim BFD_RELOC_X86_64_TLSDESC_CALL 2464218822SdimENUMX 2465218822Sdim BFD_RELOC_X86_64_TLSDESC 246677298SobrienENUMDOC 246777298Sobrien x86-64/elf relocations 246877298Sobrien 246977298SobrienENUM 247033965Sjdp BFD_RELOC_NS32K_IMM_8 247133965SjdpENUMX 247233965Sjdp BFD_RELOC_NS32K_IMM_16 247333965SjdpENUMX 247433965Sjdp BFD_RELOC_NS32K_IMM_32 247533965SjdpENUMX 247633965Sjdp BFD_RELOC_NS32K_IMM_8_PCREL 247733965SjdpENUMX 247833965Sjdp BFD_RELOC_NS32K_IMM_16_PCREL 247933965SjdpENUMX 248033965Sjdp BFD_RELOC_NS32K_IMM_32_PCREL 248133965SjdpENUMX 248233965Sjdp BFD_RELOC_NS32K_DISP_8 248333965SjdpENUMX 248433965Sjdp BFD_RELOC_NS32K_DISP_16 248533965SjdpENUMX 248633965Sjdp BFD_RELOC_NS32K_DISP_32 248733965SjdpENUMX 248833965Sjdp BFD_RELOC_NS32K_DISP_8_PCREL 248933965SjdpENUMX 249033965Sjdp BFD_RELOC_NS32K_DISP_16_PCREL 249133965SjdpENUMX 249233965Sjdp BFD_RELOC_NS32K_DISP_32_PCREL 249333965SjdpENUMDOC 249433965Sjdp ns32k relocations 249533965Sjdp 249633965SjdpENUM 249789857Sobrien BFD_RELOC_PDP11_DISP_8_PCREL 249889857SobrienENUMX 249989857Sobrien BFD_RELOC_PDP11_DISP_6_PCREL 250089857SobrienENUMDOC 250189857Sobrien PDP11 relocations 250289857Sobrien 250389857SobrienENUM 250460484Sobrien BFD_RELOC_PJ_CODE_HI16 250560484SobrienENUMX 250660484Sobrien BFD_RELOC_PJ_CODE_LO16 250760484SobrienENUMX 250860484Sobrien BFD_RELOC_PJ_CODE_DIR16 250960484SobrienENUMX 251060484Sobrien BFD_RELOC_PJ_CODE_DIR32 251160484SobrienENUMX 251260484Sobrien BFD_RELOC_PJ_CODE_REL16 251360484SobrienENUMX 251460484Sobrien BFD_RELOC_PJ_CODE_REL32 251560484SobrienENUMDOC 251660484Sobrien Picojava relocs. Not all of these appear in object files. 251760484Sobrien 251860484SobrienENUM 251933965Sjdp BFD_RELOC_PPC_B26 252033965SjdpENUMX 252133965Sjdp BFD_RELOC_PPC_BA26 252233965SjdpENUMX 252333965Sjdp BFD_RELOC_PPC_TOC16 252433965SjdpENUMX 252533965Sjdp BFD_RELOC_PPC_B16 252633965SjdpENUMX 252733965Sjdp BFD_RELOC_PPC_B16_BRTAKEN 252833965SjdpENUMX 252933965Sjdp BFD_RELOC_PPC_B16_BRNTAKEN 253033965SjdpENUMX 253133965Sjdp BFD_RELOC_PPC_BA16 253233965SjdpENUMX 253333965Sjdp BFD_RELOC_PPC_BA16_BRTAKEN 253433965SjdpENUMX 253533965Sjdp BFD_RELOC_PPC_BA16_BRNTAKEN 253633965SjdpENUMX 253733965Sjdp BFD_RELOC_PPC_COPY 253833965SjdpENUMX 253933965Sjdp BFD_RELOC_PPC_GLOB_DAT 254033965SjdpENUMX 254133965Sjdp BFD_RELOC_PPC_JMP_SLOT 254233965SjdpENUMX 254333965Sjdp BFD_RELOC_PPC_RELATIVE 254433965SjdpENUMX 254533965Sjdp BFD_RELOC_PPC_LOCAL24PC 254633965SjdpENUMX 254733965Sjdp BFD_RELOC_PPC_EMB_NADDR32 254833965SjdpENUMX 254933965Sjdp BFD_RELOC_PPC_EMB_NADDR16 255033965SjdpENUMX 255133965Sjdp BFD_RELOC_PPC_EMB_NADDR16_LO 255233965SjdpENUMX 255333965Sjdp BFD_RELOC_PPC_EMB_NADDR16_HI 255433965SjdpENUMX 255533965Sjdp BFD_RELOC_PPC_EMB_NADDR16_HA 255633965SjdpENUMX 255733965Sjdp BFD_RELOC_PPC_EMB_SDAI16 255833965SjdpENUMX 255933965Sjdp BFD_RELOC_PPC_EMB_SDA2I16 256033965SjdpENUMX 256133965Sjdp BFD_RELOC_PPC_EMB_SDA2REL 256233965SjdpENUMX 256333965Sjdp BFD_RELOC_PPC_EMB_SDA21 256433965SjdpENUMX 256533965Sjdp BFD_RELOC_PPC_EMB_MRKREF 256633965SjdpENUMX 256733965Sjdp BFD_RELOC_PPC_EMB_RELSEC16 256833965SjdpENUMX 256933965Sjdp BFD_RELOC_PPC_EMB_RELST_LO 257033965SjdpENUMX 257133965Sjdp BFD_RELOC_PPC_EMB_RELST_HI 257233965SjdpENUMX 257333965Sjdp BFD_RELOC_PPC_EMB_RELST_HA 257433965SjdpENUMX 257533965Sjdp BFD_RELOC_PPC_EMB_BIT_FLD 257633965SjdpENUMX 257733965Sjdp BFD_RELOC_PPC_EMB_RELSDA 257889857SobrienENUMX 257989857Sobrien BFD_RELOC_PPC64_HIGHER 258089857SobrienENUMX 258189857Sobrien BFD_RELOC_PPC64_HIGHER_S 258289857SobrienENUMX 258389857Sobrien BFD_RELOC_PPC64_HIGHEST 258489857SobrienENUMX 258589857Sobrien BFD_RELOC_PPC64_HIGHEST_S 258689857SobrienENUMX 258789857Sobrien BFD_RELOC_PPC64_TOC16_LO 258889857SobrienENUMX 258989857Sobrien BFD_RELOC_PPC64_TOC16_HI 259089857SobrienENUMX 259189857Sobrien BFD_RELOC_PPC64_TOC16_HA 259289857SobrienENUMX 259389857Sobrien BFD_RELOC_PPC64_TOC 259489857SobrienENUMX 259589857Sobrien BFD_RELOC_PPC64_PLTGOT16 259689857SobrienENUMX 259789857Sobrien BFD_RELOC_PPC64_PLTGOT16_LO 259889857SobrienENUMX 259989857Sobrien BFD_RELOC_PPC64_PLTGOT16_HI 260089857SobrienENUMX 260189857Sobrien BFD_RELOC_PPC64_PLTGOT16_HA 260289857SobrienENUMX 260389857Sobrien BFD_RELOC_PPC64_ADDR16_DS 260489857SobrienENUMX 260589857Sobrien BFD_RELOC_PPC64_ADDR16_LO_DS 260689857SobrienENUMX 260789857Sobrien BFD_RELOC_PPC64_GOT16_DS 260889857SobrienENUMX 260989857Sobrien BFD_RELOC_PPC64_GOT16_LO_DS 261089857SobrienENUMX 261189857Sobrien BFD_RELOC_PPC64_PLT16_LO_DS 261289857SobrienENUMX 261389857Sobrien BFD_RELOC_PPC64_SECTOFF_DS 261489857SobrienENUMX 261589857Sobrien BFD_RELOC_PPC64_SECTOFF_LO_DS 261689857SobrienENUMX 261789857Sobrien BFD_RELOC_PPC64_TOC16_DS 261889857SobrienENUMX 261989857Sobrien BFD_RELOC_PPC64_TOC16_LO_DS 262089857SobrienENUMX 262189857Sobrien BFD_RELOC_PPC64_PLTGOT16_DS 262289857SobrienENUMX 262389857Sobrien BFD_RELOC_PPC64_PLTGOT16_LO_DS 262433965SjdpENUMDOC 262533965Sjdp Power(rs6000) and PowerPC relocations. 262633965Sjdp 262733965SjdpENUM 2628130561Sobrien BFD_RELOC_PPC_TLS 2629130561SobrienENUMX 2630275718Sjhibbits BFD_RELOC_PPC_TLSGD 2631275718SjhibbitsENUMX 2632275718Sjhibbits BFD_RELOC_PPC_TLSLD 2633275718SjhibbitsENUMX 2634130561Sobrien BFD_RELOC_PPC_DTPMOD 2635130561SobrienENUMX 2636130561Sobrien BFD_RELOC_PPC_TPREL16 2637130561SobrienENUMX 2638130561Sobrien BFD_RELOC_PPC_TPREL16_LO 2639130561SobrienENUMX 2640130561Sobrien BFD_RELOC_PPC_TPREL16_HI 2641130561SobrienENUMX 2642130561Sobrien BFD_RELOC_PPC_TPREL16_HA 2643130561SobrienENUMX 2644130561Sobrien BFD_RELOC_PPC_TPREL 2645130561SobrienENUMX 2646130561Sobrien BFD_RELOC_PPC_DTPREL16 2647130561SobrienENUMX 2648130561Sobrien BFD_RELOC_PPC_DTPREL16_LO 2649130561SobrienENUMX 2650130561Sobrien BFD_RELOC_PPC_DTPREL16_HI 2651130561SobrienENUMX 2652130561Sobrien BFD_RELOC_PPC_DTPREL16_HA 2653130561SobrienENUMX 2654130561Sobrien BFD_RELOC_PPC_DTPREL 2655130561SobrienENUMX 2656130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16 2657130561SobrienENUMX 2658130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_LO 2659130561SobrienENUMX 2660130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_HI 2661130561SobrienENUMX 2662130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_HA 2663130561SobrienENUMX 2664130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16 2665130561SobrienENUMX 2666130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_LO 2667130561SobrienENUMX 2668130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_HI 2669130561SobrienENUMX 2670130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_HA 2671130561SobrienENUMX 2672130561Sobrien BFD_RELOC_PPC_GOT_TPREL16 2673130561SobrienENUMX 2674130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_LO 2675130561SobrienENUMX 2676130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_HI 2677130561SobrienENUMX 2678130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_HA 2679130561SobrienENUMX 2680130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16 2681130561SobrienENUMX 2682130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_LO 2683130561SobrienENUMX 2684130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_HI 2685130561SobrienENUMX 2686130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_HA 2687130561SobrienENUMX 2688130561Sobrien BFD_RELOC_PPC64_TPREL16_DS 2689130561SobrienENUMX 2690130561Sobrien BFD_RELOC_PPC64_TPREL16_LO_DS 2691130561SobrienENUMX 2692130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHER 2693130561SobrienENUMX 2694130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHERA 2695130561SobrienENUMX 2696130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHEST 2697130561SobrienENUMX 2698130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHESTA 2699130561SobrienENUMX 2700130561Sobrien BFD_RELOC_PPC64_DTPREL16_DS 2701130561SobrienENUMX 2702130561Sobrien BFD_RELOC_PPC64_DTPREL16_LO_DS 2703130561SobrienENUMX 2704130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHER 2705130561SobrienENUMX 2706130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHERA 2707130561SobrienENUMX 2708130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHEST 2709130561SobrienENUMX 2710130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHESTA 2711130561SobrienENUMDOC 2712130561Sobrien PowerPC and PowerPC64 thread-local storage relocations. 2713130561Sobrien 2714130561SobrienENUM 271560484Sobrien BFD_RELOC_I370_D12 271660484SobrienENUMDOC 271760484Sobrien IBM 370/390 relocations 271860484Sobrien 271960484SobrienENUM 272033965Sjdp BFD_RELOC_CTOR 272133965SjdpENUMDOC 2722130561Sobrien The type of reloc used to build a constructor table - at the moment 272333965Sjdp probably a 32 bit wide absolute relocation, but the target can choose. 272433965Sjdp It generally does map to one of the other relocation types. 272533965Sjdp 272633965SjdpENUM 272733965Sjdp BFD_RELOC_ARM_PCREL_BRANCH 272833965SjdpENUMDOC 272933965Sjdp ARM 26 bit pc-relative branch. The lowest two bits must be zero and are 273033965Sjdp not stored in the instruction. 273133965SjdpENUM 273277298Sobrien BFD_RELOC_ARM_PCREL_BLX 273377298SobrienENUMDOC 273477298Sobrien ARM 26 bit pc-relative branch. The lowest bit must be zero and is 273577298Sobrien not stored in the instruction. The 2nd lowest bit comes from a 1 bit 273677298Sobrien field in the instruction. 273777298SobrienENUM 273877298Sobrien BFD_RELOC_THUMB_PCREL_BLX 273977298SobrienENUMDOC 274077298Sobrien Thumb 22 bit pc-relative branch. The lowest bit must be zero and is 274177298Sobrien not stored in the instruction. The 2nd lowest bit comes from a 1 bit 274277298Sobrien field in the instruction. 274377298SobrienENUM 2744218822Sdim BFD_RELOC_ARM_PCREL_CALL 2745218822SdimENUMDOC 2746218822Sdim ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. 2747218822SdimENUM 2748218822Sdim BFD_RELOC_ARM_PCREL_JUMP 2749218822SdimENUMDOC 2750218822Sdim ARM 26-bit pc-relative branch for B or conditional BL instruction. 2751218822Sdim 2752218822SdimENUM 2753218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH7 2754218822SdimENUMX 2755218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH9 2756218822SdimENUMX 2757218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH12 2758218822SdimENUMX 2759218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH20 2760218822SdimENUMX 2761218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH23 2762218822SdimENUMX 2763218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH25 2764218822SdimENUMDOC 2765218822Sdim Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. 2766218822Sdim The lowest bit must be zero and is not stored in the instruction. 2767218822Sdim Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an 2768218822Sdim "nn" one smaller in all cases. Note further that BRANCH23 2769218822Sdim corresponds to R_ARM_THM_CALL. 2770218822Sdim 2771218822SdimENUM 2772218822Sdim BFD_RELOC_ARM_OFFSET_IMM 2773218822SdimENUMDOC 2774218822Sdim 12-bit immediate offset, used in ARM-format ldr and str instructions. 2775218822Sdim 2776218822SdimENUM 2777218822Sdim BFD_RELOC_ARM_THUMB_OFFSET 2778218822SdimENUMDOC 2779218822Sdim 5-bit immediate offset, used in Thumb-format ldr and str instructions. 2780218822Sdim 2781218822SdimENUM 2782218822Sdim BFD_RELOC_ARM_TARGET1 2783218822SdimENUMDOC 2784218822Sdim Pc-relative or absolute relocation depending on target. Used for 2785218822Sdim entries in .init_array sections. 2786218822SdimENUM 2787218822Sdim BFD_RELOC_ARM_ROSEGREL32 2788218822SdimENUMDOC 2789218822Sdim Read-only segment base relative address. 2790218822SdimENUM 2791218822Sdim BFD_RELOC_ARM_SBREL32 2792218822SdimENUMDOC 2793218822Sdim Data segment base relative address. 2794218822SdimENUM 2795218822Sdim BFD_RELOC_ARM_TARGET2 2796218822SdimENUMDOC 2797218822Sdim This reloc is used for references to RTTI data from exception handling 2798218822Sdim tables. The actual definition depends on the target. It may be a 2799218822Sdim pc-relative or some form of GOT-indirect relocation. 2800218822SdimENUM 2801218822Sdim BFD_RELOC_ARM_PREL31 2802218822SdimENUMDOC 2803218822Sdim 31-bit PC relative address. 2804218822SdimENUM 2805218822Sdim BFD_RELOC_ARM_MOVW 2806218822SdimENUMX 2807218822Sdim BFD_RELOC_ARM_MOVT 2808218822SdimENUMX 2809218822Sdim BFD_RELOC_ARM_MOVW_PCREL 2810218822SdimENUMX 2811218822Sdim BFD_RELOC_ARM_MOVT_PCREL 2812218822SdimENUMX 2813218822Sdim BFD_RELOC_ARM_THUMB_MOVW 2814218822SdimENUMX 2815218822Sdim BFD_RELOC_ARM_THUMB_MOVT 2816218822SdimENUMX 2817218822Sdim BFD_RELOC_ARM_THUMB_MOVW_PCREL 2818218822SdimENUMX 2819218822Sdim BFD_RELOC_ARM_THUMB_MOVT_PCREL 2820218822SdimENUMDOC 2821218822Sdim Low and High halfword relocations for MOVW and MOVT instructions. 2822218822Sdim 2823218822SdimENUM 2824218822Sdim BFD_RELOC_ARM_JUMP_SLOT 2825218822SdimENUMX 2826218822Sdim BFD_RELOC_ARM_GLOB_DAT 2827218822SdimENUMX 2828218822Sdim BFD_RELOC_ARM_GOT32 2829218822SdimENUMX 2830218822Sdim BFD_RELOC_ARM_PLT32 2831218822SdimENUMX 2832218822Sdim BFD_RELOC_ARM_RELATIVE 2833218822SdimENUMX 2834218822Sdim BFD_RELOC_ARM_GOTOFF 2835218822SdimENUMX 2836218822Sdim BFD_RELOC_ARM_GOTPC 2837218822SdimENUMDOC 2838218822Sdim Relocations for setting up GOTs and PLTs for shared libraries. 2839218822Sdim 2840218822SdimENUM 2841218822Sdim BFD_RELOC_ARM_TLS_GD32 2842218822SdimENUMX 2843218822Sdim BFD_RELOC_ARM_TLS_LDO32 2844218822SdimENUMX 2845218822Sdim BFD_RELOC_ARM_TLS_LDM32 2846218822SdimENUMX 2847218822Sdim BFD_RELOC_ARM_TLS_DTPOFF32 2848218822SdimENUMX 2849218822Sdim BFD_RELOC_ARM_TLS_DTPMOD32 2850218822SdimENUMX 2851218822Sdim BFD_RELOC_ARM_TLS_TPOFF32 2852218822SdimENUMX 2853218822Sdim BFD_RELOC_ARM_TLS_IE32 2854218822SdimENUMX 2855218822Sdim BFD_RELOC_ARM_TLS_LE32 2856218822SdimENUMDOC 2857218822Sdim ARM thread-local storage relocations. 2858218822Sdim 2859218822SdimENUM 2860218822Sdim BFD_RELOC_ARM_ALU_PC_G0_NC 2861218822SdimENUMX 2862218822Sdim BFD_RELOC_ARM_ALU_PC_G0 2863218822SdimENUMX 2864218822Sdim BFD_RELOC_ARM_ALU_PC_G1_NC 2865218822SdimENUMX 2866218822Sdim BFD_RELOC_ARM_ALU_PC_G1 2867218822SdimENUMX 2868218822Sdim BFD_RELOC_ARM_ALU_PC_G2 2869218822SdimENUMX 2870218822Sdim BFD_RELOC_ARM_LDR_PC_G0 2871218822SdimENUMX 2872218822Sdim BFD_RELOC_ARM_LDR_PC_G1 2873218822SdimENUMX 2874218822Sdim BFD_RELOC_ARM_LDR_PC_G2 2875218822SdimENUMX 2876218822Sdim BFD_RELOC_ARM_LDRS_PC_G0 2877218822SdimENUMX 2878218822Sdim BFD_RELOC_ARM_LDRS_PC_G1 2879218822SdimENUMX 2880218822Sdim BFD_RELOC_ARM_LDRS_PC_G2 2881218822SdimENUMX 2882218822Sdim BFD_RELOC_ARM_LDC_PC_G0 2883218822SdimENUMX 2884218822Sdim BFD_RELOC_ARM_LDC_PC_G1 2885218822SdimENUMX 2886218822Sdim BFD_RELOC_ARM_LDC_PC_G2 2887218822SdimENUMX 2888218822Sdim BFD_RELOC_ARM_ALU_SB_G0_NC 2889218822SdimENUMX 2890218822Sdim BFD_RELOC_ARM_ALU_SB_G0 2891218822SdimENUMX 2892218822Sdim BFD_RELOC_ARM_ALU_SB_G1_NC 2893218822SdimENUMX 2894218822Sdim BFD_RELOC_ARM_ALU_SB_G1 2895218822SdimENUMX 2896218822Sdim BFD_RELOC_ARM_ALU_SB_G2 2897218822SdimENUMX 2898218822Sdim BFD_RELOC_ARM_LDR_SB_G0 2899218822SdimENUMX 2900218822Sdim BFD_RELOC_ARM_LDR_SB_G1 2901218822SdimENUMX 2902218822Sdim BFD_RELOC_ARM_LDR_SB_G2 2903218822SdimENUMX 2904218822Sdim BFD_RELOC_ARM_LDRS_SB_G0 2905218822SdimENUMX 2906218822Sdim BFD_RELOC_ARM_LDRS_SB_G1 2907218822SdimENUMX 2908218822Sdim BFD_RELOC_ARM_LDRS_SB_G2 2909218822SdimENUMX 2910218822Sdim BFD_RELOC_ARM_LDC_SB_G0 2911218822SdimENUMX 2912218822Sdim BFD_RELOC_ARM_LDC_SB_G1 2913218822SdimENUMX 2914218822Sdim BFD_RELOC_ARM_LDC_SB_G2 2915218822SdimENUMDOC 2916218822Sdim ARM group relocations. 2917218822Sdim 2918218822SdimENUM 291933965Sjdp BFD_RELOC_ARM_IMMEDIATE 292033965SjdpENUMX 292160484Sobrien BFD_RELOC_ARM_ADRL_IMMEDIATE 292260484SobrienENUMX 2923218822Sdim BFD_RELOC_ARM_T32_IMMEDIATE 292433965SjdpENUMX 2925218822Sdim BFD_RELOC_ARM_T32_ADD_IMM 2926218822SdimENUMX 2927218822Sdim BFD_RELOC_ARM_T32_IMM12 2928218822SdimENUMX 2929218822Sdim BFD_RELOC_ARM_T32_ADD_PC12 2930218822SdimENUMX 293133965Sjdp BFD_RELOC_ARM_SHIFT_IMM 293233965SjdpENUMX 2933218822Sdim BFD_RELOC_ARM_SMC 2934218822SdimENUMX 293533965Sjdp BFD_RELOC_ARM_SWI 293633965SjdpENUMX 293733965Sjdp BFD_RELOC_ARM_MULTI 293833965SjdpENUMX 293933965Sjdp BFD_RELOC_ARM_CP_OFF_IMM 294033965SjdpENUMX 2941130561Sobrien BFD_RELOC_ARM_CP_OFF_IMM_S2 2942130561SobrienENUMX 2943218822Sdim BFD_RELOC_ARM_T32_CP_OFF_IMM 2944218822SdimENUMX 2945218822Sdim BFD_RELOC_ARM_T32_CP_OFF_IMM_S2 2946218822SdimENUMX 294733965Sjdp BFD_RELOC_ARM_ADR_IMM 294833965SjdpENUMX 294933965Sjdp BFD_RELOC_ARM_LDR_IMM 295033965SjdpENUMX 295133965Sjdp BFD_RELOC_ARM_LITERAL 295233965SjdpENUMX 295333965Sjdp BFD_RELOC_ARM_IN_POOL 295433965SjdpENUMX 295533965Sjdp BFD_RELOC_ARM_OFFSET_IMM8 295633965SjdpENUMX 2957218822Sdim BFD_RELOC_ARM_T32_OFFSET_U8 2958218822SdimENUMX 2959218822Sdim BFD_RELOC_ARM_T32_OFFSET_IMM 2960218822SdimENUMX 296133965Sjdp BFD_RELOC_ARM_HWLITERAL 296233965SjdpENUMX 296333965Sjdp BFD_RELOC_ARM_THUMB_ADD 296433965SjdpENUMX 296533965Sjdp BFD_RELOC_ARM_THUMB_IMM 296633965SjdpENUMX 296733965Sjdp BFD_RELOC_ARM_THUMB_SHIFT 2968218822SdimENUMDOC 2969218822Sdim These relocs are only used within the ARM assembler. They are not 2970218822Sdim (at present) written to any object files. 2971218822Sdim 2972218822SdimENUM 2973218822Sdim BFD_RELOC_SH_PCDISP8BY2 297433965SjdpENUMX 2975218822Sdim BFD_RELOC_SH_PCDISP12BY2 297660484SobrienENUMX 2977218822Sdim BFD_RELOC_SH_IMM3 297860484SobrienENUMX 2979218822Sdim BFD_RELOC_SH_IMM3U 298060484SobrienENUMX 2981218822Sdim BFD_RELOC_SH_DISP12 298260484SobrienENUMX 2983218822Sdim BFD_RELOC_SH_DISP12BY2 298460484SobrienENUMX 2985218822Sdim BFD_RELOC_SH_DISP12BY4 298660484SobrienENUMX 2987218822Sdim BFD_RELOC_SH_DISP12BY8 298860484SobrienENUMX 2989218822Sdim BFD_RELOC_SH_DISP20 299060484SobrienENUMX 2991218822Sdim BFD_RELOC_SH_DISP20BY8 299260484SobrienENUMX 299333965Sjdp BFD_RELOC_SH_IMM4 299433965SjdpENUMX 299533965Sjdp BFD_RELOC_SH_IMM4BY2 299633965SjdpENUMX 299733965Sjdp BFD_RELOC_SH_IMM4BY4 299833965SjdpENUMX 299933965Sjdp BFD_RELOC_SH_IMM8 300033965SjdpENUMX 300133965Sjdp BFD_RELOC_SH_IMM8BY2 300233965SjdpENUMX 300333965Sjdp BFD_RELOC_SH_IMM8BY4 300433965SjdpENUMX 300533965Sjdp BFD_RELOC_SH_PCRELIMM8BY2 300633965SjdpENUMX 300733965Sjdp BFD_RELOC_SH_PCRELIMM8BY4 300833965SjdpENUMX 300933965Sjdp BFD_RELOC_SH_SWITCH16 301033965SjdpENUMX 301133965Sjdp BFD_RELOC_SH_SWITCH32 301233965SjdpENUMX 301333965Sjdp BFD_RELOC_SH_USES 301433965SjdpENUMX 301533965Sjdp BFD_RELOC_SH_COUNT 301633965SjdpENUMX 301733965Sjdp BFD_RELOC_SH_ALIGN 301833965SjdpENUMX 301933965Sjdp BFD_RELOC_SH_CODE 302033965SjdpENUMX 302133965Sjdp BFD_RELOC_SH_DATA 302233965SjdpENUMX 302333965Sjdp BFD_RELOC_SH_LABEL 302477298SobrienENUMX 302577298Sobrien BFD_RELOC_SH_LOOP_START 302677298SobrienENUMX 302777298Sobrien BFD_RELOC_SH_LOOP_END 302877298SobrienENUMX 302977298Sobrien BFD_RELOC_SH_COPY 303077298SobrienENUMX 303177298Sobrien BFD_RELOC_SH_GLOB_DAT 303277298SobrienENUMX 303377298Sobrien BFD_RELOC_SH_JMP_SLOT 303477298SobrienENUMX 303577298Sobrien BFD_RELOC_SH_RELATIVE 303677298SobrienENUMX 303777298Sobrien BFD_RELOC_SH_GOTPC 303899461SobrienENUMX 303999461Sobrien BFD_RELOC_SH_GOT_LOW16 304099461SobrienENUMX 304199461Sobrien BFD_RELOC_SH_GOT_MEDLOW16 304299461SobrienENUMX 304399461Sobrien BFD_RELOC_SH_GOT_MEDHI16 304499461SobrienENUMX 304599461Sobrien BFD_RELOC_SH_GOT_HI16 304699461SobrienENUMX 304799461Sobrien BFD_RELOC_SH_GOTPLT_LOW16 304899461SobrienENUMX 304999461Sobrien BFD_RELOC_SH_GOTPLT_MEDLOW16 305099461SobrienENUMX 305199461Sobrien BFD_RELOC_SH_GOTPLT_MEDHI16 305299461SobrienENUMX 305399461Sobrien BFD_RELOC_SH_GOTPLT_HI16 305499461SobrienENUMX 305599461Sobrien BFD_RELOC_SH_PLT_LOW16 305699461SobrienENUMX 305799461Sobrien BFD_RELOC_SH_PLT_MEDLOW16 305899461SobrienENUMX 305999461Sobrien BFD_RELOC_SH_PLT_MEDHI16 306099461SobrienENUMX 306199461Sobrien BFD_RELOC_SH_PLT_HI16 306299461SobrienENUMX 306399461Sobrien BFD_RELOC_SH_GOTOFF_LOW16 306499461SobrienENUMX 306599461Sobrien BFD_RELOC_SH_GOTOFF_MEDLOW16 306699461SobrienENUMX 306799461Sobrien BFD_RELOC_SH_GOTOFF_MEDHI16 306899461SobrienENUMX 306999461Sobrien BFD_RELOC_SH_GOTOFF_HI16 307099461SobrienENUMX 307199461Sobrien BFD_RELOC_SH_GOTPC_LOW16 307299461SobrienENUMX 307399461Sobrien BFD_RELOC_SH_GOTPC_MEDLOW16 307499461SobrienENUMX 307599461Sobrien BFD_RELOC_SH_GOTPC_MEDHI16 307699461SobrienENUMX 307799461Sobrien BFD_RELOC_SH_GOTPC_HI16 307899461SobrienENUMX 307999461Sobrien BFD_RELOC_SH_COPY64 308099461SobrienENUMX 308199461Sobrien BFD_RELOC_SH_GLOB_DAT64 308299461SobrienENUMX 308399461Sobrien BFD_RELOC_SH_JMP_SLOT64 308499461SobrienENUMX 308599461Sobrien BFD_RELOC_SH_RELATIVE64 308699461SobrienENUMX 308799461Sobrien BFD_RELOC_SH_GOT10BY4 308899461SobrienENUMX 308999461Sobrien BFD_RELOC_SH_GOT10BY8 309099461SobrienENUMX 309199461Sobrien BFD_RELOC_SH_GOTPLT10BY4 309299461SobrienENUMX 309399461Sobrien BFD_RELOC_SH_GOTPLT10BY8 309499461SobrienENUMX 309599461Sobrien BFD_RELOC_SH_GOTPLT32 309699461SobrienENUMX 309799461Sobrien BFD_RELOC_SH_SHMEDIA_CODE 309899461SobrienENUMX 309999461Sobrien BFD_RELOC_SH_IMMU5 310099461SobrienENUMX 310199461Sobrien BFD_RELOC_SH_IMMS6 310299461SobrienENUMX 310399461Sobrien BFD_RELOC_SH_IMMS6BY32 310499461SobrienENUMX 310599461Sobrien BFD_RELOC_SH_IMMU6 310699461SobrienENUMX 310799461Sobrien BFD_RELOC_SH_IMMS10 310899461SobrienENUMX 310999461Sobrien BFD_RELOC_SH_IMMS10BY2 311099461SobrienENUMX 311199461Sobrien BFD_RELOC_SH_IMMS10BY4 311299461SobrienENUMX 311399461Sobrien BFD_RELOC_SH_IMMS10BY8 311499461SobrienENUMX 311599461Sobrien BFD_RELOC_SH_IMMS16 311699461SobrienENUMX 311799461Sobrien BFD_RELOC_SH_IMMU16 311899461SobrienENUMX 311999461Sobrien BFD_RELOC_SH_IMM_LOW16 312099461SobrienENUMX 312199461Sobrien BFD_RELOC_SH_IMM_LOW16_PCREL 312299461SobrienENUMX 312399461Sobrien BFD_RELOC_SH_IMM_MEDLOW16 312499461SobrienENUMX 312599461Sobrien BFD_RELOC_SH_IMM_MEDLOW16_PCREL 312699461SobrienENUMX 312799461Sobrien BFD_RELOC_SH_IMM_MEDHI16 312899461SobrienENUMX 312999461Sobrien BFD_RELOC_SH_IMM_MEDHI16_PCREL 313099461SobrienENUMX 313199461Sobrien BFD_RELOC_SH_IMM_HI16 313299461SobrienENUMX 313399461Sobrien BFD_RELOC_SH_IMM_HI16_PCREL 313499461SobrienENUMX 313599461Sobrien BFD_RELOC_SH_PT_16 3136130561SobrienENUMX 3137130561Sobrien BFD_RELOC_SH_TLS_GD_32 3138130561SobrienENUMX 3139130561Sobrien BFD_RELOC_SH_TLS_LD_32 3140130561SobrienENUMX 3141130561Sobrien BFD_RELOC_SH_TLS_LDO_32 3142130561SobrienENUMX 3143130561Sobrien BFD_RELOC_SH_TLS_IE_32 3144130561SobrienENUMX 3145130561Sobrien BFD_RELOC_SH_TLS_LE_32 3146130561SobrienENUMX 3147130561Sobrien BFD_RELOC_SH_TLS_DTPMOD32 3148130561SobrienENUMX 3149130561Sobrien BFD_RELOC_SH_TLS_DTPOFF32 3150130561SobrienENUMX 3151130561Sobrien BFD_RELOC_SH_TLS_TPOFF32 315233965SjdpENUMDOC 3153130561Sobrien Renesas / SuperH SH relocs. Not all of these appear in object files. 315433965Sjdp 315538889SjdpENUM 315638889Sjdp BFD_RELOC_ARC_B22_PCREL 315738889SjdpENUMDOC 315877298Sobrien ARC Cores relocs. 315938889Sjdp ARC 22 bit pc-relative branch. The lowest two bits must be zero and are 316038889Sjdp not stored in the instruction. The high 20 bits are installed in bits 26 316138889Sjdp through 7 of the instruction. 316238889SjdpENUM 316338889Sjdp BFD_RELOC_ARC_B26 316438889SjdpENUMDOC 316538889Sjdp ARC 26 bit absolute branch. The lowest two bits must be zero and are not 316638889Sjdp stored in the instruction. The high 24 bits are installed in bits 23 316738889Sjdp through 0. 316838889Sjdp 316933965SjdpENUM 3170218822Sdim BFD_RELOC_BFIN_16_IMM 3171218822SdimENUMDOC 3172218822Sdim ADI Blackfin 16 bit immediate absolute reloc. 3173218822SdimENUM 3174218822Sdim BFD_RELOC_BFIN_16_HIGH 3175218822SdimENUMDOC 3176218822Sdim ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. 3177218822SdimENUM 3178218822Sdim BFD_RELOC_BFIN_4_PCREL 3179218822SdimENUMDOC 3180218822Sdim ADI Blackfin 'a' part of LSETUP. 3181218822SdimENUM 3182218822Sdim BFD_RELOC_BFIN_5_PCREL 3183218822SdimENUMDOC 3184218822Sdim ADI Blackfin. 3185218822SdimENUM 3186218822Sdim BFD_RELOC_BFIN_16_LOW 3187218822SdimENUMDOC 3188218822Sdim ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. 3189218822SdimENUM 3190218822Sdim BFD_RELOC_BFIN_10_PCREL 3191218822SdimENUMDOC 3192218822Sdim ADI Blackfin. 3193218822SdimENUM 3194218822Sdim BFD_RELOC_BFIN_11_PCREL 3195218822SdimENUMDOC 3196218822Sdim ADI Blackfin 'b' part of LSETUP. 3197218822SdimENUM 3198218822Sdim BFD_RELOC_BFIN_12_PCREL_JUMP 3199218822SdimENUMDOC 3200218822Sdim ADI Blackfin. 3201218822SdimENUM 3202218822Sdim BFD_RELOC_BFIN_12_PCREL_JUMP_S 3203218822SdimENUMDOC 3204218822Sdim ADI Blackfin Short jump, pcrel. 3205218822SdimENUM 3206218822Sdim BFD_RELOC_BFIN_24_PCREL_CALL_X 3207218822SdimENUMDOC 3208218822Sdim ADI Blackfin Call.x not implemented. 3209218822SdimENUM 3210218822Sdim BFD_RELOC_BFIN_24_PCREL_JUMP_L 3211218822SdimENUMDOC 3212218822Sdim ADI Blackfin Long Jump pcrel. 3213218822SdimENUM 3214218822Sdim BFD_RELOC_BFIN_GOT17M4 3215218822SdimENUMX 3216218822Sdim BFD_RELOC_BFIN_GOTHI 3217218822SdimENUMX 3218218822Sdim BFD_RELOC_BFIN_GOTLO 3219218822SdimENUMX 3220218822Sdim BFD_RELOC_BFIN_FUNCDESC 3221218822SdimENUMX 3222218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOT17M4 3223218822SdimENUMX 3224218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTHI 3225218822SdimENUMX 3226218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTLO 3227218822SdimENUMX 3228218822Sdim BFD_RELOC_BFIN_FUNCDESC_VALUE 3229218822SdimENUMX 3230218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4 3231218822SdimENUMX 3232218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI 3233218822SdimENUMX 3234218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO 3235218822SdimENUMX 3236218822Sdim BFD_RELOC_BFIN_GOTOFF17M4 3237218822SdimENUMX 3238218822Sdim BFD_RELOC_BFIN_GOTOFFHI 3239218822SdimENUMX 3240218822Sdim BFD_RELOC_BFIN_GOTOFFLO 3241218822SdimENUMDOC 3242218822Sdim ADI Blackfin FD-PIC relocations. 3243218822SdimENUM 3244218822Sdim BFD_RELOC_BFIN_GOT 3245218822SdimENUMDOC 3246218822Sdim ADI Blackfin GOT relocation. 3247218822SdimENUM 3248218822Sdim BFD_RELOC_BFIN_PLTPC 3249218822SdimENUMDOC 3250218822Sdim ADI Blackfin PLTPC relocation. 3251218822SdimENUM 3252218822Sdim BFD_ARELOC_BFIN_PUSH 3253218822SdimENUMDOC 3254218822Sdim ADI Blackfin arithmetic relocation. 3255218822SdimENUM 3256218822Sdim BFD_ARELOC_BFIN_CONST 3257218822SdimENUMDOC 3258218822Sdim ADI Blackfin arithmetic relocation. 3259218822SdimENUM 3260218822Sdim BFD_ARELOC_BFIN_ADD 3261218822SdimENUMDOC 3262218822Sdim ADI Blackfin arithmetic relocation. 3263218822SdimENUM 3264218822Sdim BFD_ARELOC_BFIN_SUB 3265218822SdimENUMDOC 3266218822Sdim ADI Blackfin arithmetic relocation. 3267218822SdimENUM 3268218822Sdim BFD_ARELOC_BFIN_MULT 3269218822SdimENUMDOC 3270218822Sdim ADI Blackfin arithmetic relocation. 3271218822SdimENUM 3272218822Sdim BFD_ARELOC_BFIN_DIV 3273218822SdimENUMDOC 3274218822Sdim ADI Blackfin arithmetic relocation. 3275218822SdimENUM 3276218822Sdim BFD_ARELOC_BFIN_MOD 3277218822SdimENUMDOC 3278218822Sdim ADI Blackfin arithmetic relocation. 3279218822SdimENUM 3280218822Sdim BFD_ARELOC_BFIN_LSHIFT 3281218822SdimENUMDOC 3282218822Sdim ADI Blackfin arithmetic relocation. 3283218822SdimENUM 3284218822Sdim BFD_ARELOC_BFIN_RSHIFT 3285218822SdimENUMDOC 3286218822Sdim ADI Blackfin arithmetic relocation. 3287218822SdimENUM 3288218822Sdim BFD_ARELOC_BFIN_AND 3289218822SdimENUMDOC 3290218822Sdim ADI Blackfin arithmetic relocation. 3291218822SdimENUM 3292218822Sdim BFD_ARELOC_BFIN_OR 3293218822SdimENUMDOC 3294218822Sdim ADI Blackfin arithmetic relocation. 3295218822SdimENUM 3296218822Sdim BFD_ARELOC_BFIN_XOR 3297218822SdimENUMDOC 3298218822Sdim ADI Blackfin arithmetic relocation. 3299218822SdimENUM 3300218822Sdim BFD_ARELOC_BFIN_LAND 3301218822SdimENUMDOC 3302218822Sdim ADI Blackfin arithmetic relocation. 3303218822SdimENUM 3304218822Sdim BFD_ARELOC_BFIN_LOR 3305218822SdimENUMDOC 3306218822Sdim ADI Blackfin arithmetic relocation. 3307218822SdimENUM 3308218822Sdim BFD_ARELOC_BFIN_LEN 3309218822SdimENUMDOC 3310218822Sdim ADI Blackfin arithmetic relocation. 3311218822SdimENUM 3312218822Sdim BFD_ARELOC_BFIN_NEG 3313218822SdimENUMDOC 3314218822Sdim ADI Blackfin arithmetic relocation. 3315218822SdimENUM 3316218822Sdim BFD_ARELOC_BFIN_COMP 3317218822SdimENUMDOC 3318218822Sdim ADI Blackfin arithmetic relocation. 3319218822SdimENUM 3320218822Sdim BFD_ARELOC_BFIN_PAGE 3321218822SdimENUMDOC 3322218822Sdim ADI Blackfin arithmetic relocation. 3323218822SdimENUM 3324218822Sdim BFD_ARELOC_BFIN_HWPAGE 3325218822SdimENUMDOC 3326218822Sdim ADI Blackfin arithmetic relocation. 3327218822SdimENUM 3328218822Sdim BFD_ARELOC_BFIN_ADDR 3329218822SdimENUMDOC 3330218822Sdim ADI Blackfin arithmetic relocation. 3331218822Sdim 3332218822SdimENUM 333333965Sjdp BFD_RELOC_D10V_10_PCREL_R 333433965SjdpENUMDOC 333533965Sjdp Mitsubishi D10V relocs. 333633965Sjdp This is a 10-bit reloc with the right 2 bits 333733965Sjdp assumed to be 0. 333833965SjdpENUM 333933965Sjdp BFD_RELOC_D10V_10_PCREL_L 334033965SjdpENUMDOC 334133965Sjdp Mitsubishi D10V relocs. 334233965Sjdp This is a 10-bit reloc with the right 2 bits 334333965Sjdp assumed to be 0. This is the same as the previous reloc 334433965Sjdp except it is in the left container, i.e., 334533965Sjdp shifted left 15 bits. 334633965SjdpENUM 334733965Sjdp BFD_RELOC_D10V_18 334833965SjdpENUMDOC 334933965Sjdp This is an 18-bit reloc with the right 2 bits 335033965Sjdp assumed to be 0. 335133965SjdpENUM 335233965Sjdp BFD_RELOC_D10V_18_PCREL 335333965SjdpENUMDOC 335433965Sjdp This is an 18-bit reloc with the right 2 bits 335533965Sjdp assumed to be 0. 335633965Sjdp 335760484SobrienENUM 335860484Sobrien BFD_RELOC_D30V_6 335960484SobrienENUMDOC 336060484Sobrien Mitsubishi D30V relocs. 336160484Sobrien This is a 6-bit absolute reloc. 336260484SobrienENUM 336360484Sobrien BFD_RELOC_D30V_9_PCREL 336460484SobrienENUMDOC 336560484Sobrien This is a 6-bit pc-relative reloc with 336660484Sobrien the right 3 bits assumed to be 0. 336760484SobrienENUM 336860484Sobrien BFD_RELOC_D30V_9_PCREL_R 336960484SobrienENUMDOC 337060484Sobrien This is a 6-bit pc-relative reloc with 337160484Sobrien the right 3 bits assumed to be 0. Same 337260484Sobrien as the previous reloc but on the right side 337360484Sobrien of the container. 337460484SobrienENUM 337560484Sobrien BFD_RELOC_D30V_15 337660484SobrienENUMDOC 337760484Sobrien This is a 12-bit absolute reloc with the 337860484Sobrien right 3 bitsassumed to be 0. 337960484SobrienENUM 338060484Sobrien BFD_RELOC_D30V_15_PCREL 338160484SobrienENUMDOC 338260484Sobrien This is a 12-bit pc-relative reloc with 338360484Sobrien the right 3 bits assumed to be 0. 338460484SobrienENUM 338560484Sobrien BFD_RELOC_D30V_15_PCREL_R 338660484SobrienENUMDOC 338760484Sobrien This is a 12-bit pc-relative reloc with 338860484Sobrien the right 3 bits assumed to be 0. Same 338960484Sobrien as the previous reloc but on the right side 339060484Sobrien of the container. 339160484SobrienENUM 339260484Sobrien BFD_RELOC_D30V_21 339360484SobrienENUMDOC 339460484Sobrien This is an 18-bit absolute reloc with 339560484Sobrien the right 3 bits assumed to be 0. 339660484SobrienENUM 339760484Sobrien BFD_RELOC_D30V_21_PCREL 339860484SobrienENUMDOC 339960484Sobrien This is an 18-bit pc-relative reloc with 340060484Sobrien the right 3 bits assumed to be 0. 340160484SobrienENUM 340260484Sobrien BFD_RELOC_D30V_21_PCREL_R 340360484SobrienENUMDOC 340460484Sobrien This is an 18-bit pc-relative reloc with 340560484Sobrien the right 3 bits assumed to be 0. Same 340660484Sobrien as the previous reloc but on the right side 340760484Sobrien of the container. 340860484SobrienENUM 340960484Sobrien BFD_RELOC_D30V_32 341060484SobrienENUMDOC 341160484Sobrien This is a 32-bit absolute reloc. 341260484SobrienENUM 341360484Sobrien BFD_RELOC_D30V_32_PCREL 341460484SobrienENUMDOC 341560484Sobrien This is a 32-bit pc-relative reloc. 341633965Sjdp 341733965SjdpENUM 3418104834Sobrien BFD_RELOC_DLX_HI16_S 3419104834SobrienENUMDOC 3420104834Sobrien DLX relocs 3421104834SobrienENUM 3422104834Sobrien BFD_RELOC_DLX_LO16 3423104834SobrienENUMDOC 3424104834Sobrien DLX relocs 3425104834SobrienENUM 3426104834Sobrien BFD_RELOC_DLX_JMP26 3427104834SobrienENUMDOC 3428104834Sobrien DLX relocs 3429104834Sobrien 3430104834SobrienENUM 3431218822Sdim BFD_RELOC_M32C_HI8 3432218822SdimENUMX 3433218822Sdim BFD_RELOC_M32C_RL_JUMP 3434218822SdimENUMX 3435218822Sdim BFD_RELOC_M32C_RL_1ADDR 3436218822SdimENUMX 3437218822Sdim BFD_RELOC_M32C_RL_2ADDR 3438218822SdimENUMDOC 3439218822Sdim Renesas M16C/M32C Relocations. 3440218822Sdim 3441218822SdimENUM 344233965Sjdp BFD_RELOC_M32R_24 344333965SjdpENUMDOC 3444130561Sobrien Renesas M32R (formerly Mitsubishi M32R) relocs. 344533965Sjdp This is a 24 bit absolute address. 344633965SjdpENUM 344733965Sjdp BFD_RELOC_M32R_10_PCREL 344833965SjdpENUMDOC 344933965Sjdp This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. 345033965SjdpENUM 345133965Sjdp BFD_RELOC_M32R_18_PCREL 345233965SjdpENUMDOC 345333965Sjdp This is an 18-bit reloc with the right 2 bits assumed to be 0. 345433965SjdpENUM 345533965Sjdp BFD_RELOC_M32R_26_PCREL 345633965SjdpENUMDOC 345733965Sjdp This is a 26-bit reloc with the right 2 bits assumed to be 0. 345833965SjdpENUM 345933965Sjdp BFD_RELOC_M32R_HI16_ULO 346033965SjdpENUMDOC 346133965Sjdp This is a 16-bit reloc containing the high 16 bits of an address 346233965Sjdp used when the lower 16 bits are treated as unsigned. 346333965SjdpENUM 346433965Sjdp BFD_RELOC_M32R_HI16_SLO 346533965SjdpENUMDOC 346633965Sjdp This is a 16-bit reloc containing the high 16 bits of an address 346733965Sjdp used when the lower 16 bits are treated as signed. 346833965SjdpENUM 346933965Sjdp BFD_RELOC_M32R_LO16 347033965SjdpENUMDOC 347133965Sjdp This is a 16-bit reloc containing the lower 16 bits of an address. 347233965SjdpENUM 347333965Sjdp BFD_RELOC_M32R_SDA16 347433965SjdpENUMDOC 347533965Sjdp This is a 16-bit reloc containing the small data area offset for use in 347633965Sjdp add3, load, and store instructions. 3477130561SobrienENUM 3478130561Sobrien BFD_RELOC_M32R_GOT24 3479130561SobrienENUMX 3480130561Sobrien BFD_RELOC_M32R_26_PLTREL 3481130561SobrienENUMX 3482130561Sobrien BFD_RELOC_M32R_COPY 3483130561SobrienENUMX 3484130561Sobrien BFD_RELOC_M32R_GLOB_DAT 3485130561SobrienENUMX 3486130561Sobrien BFD_RELOC_M32R_JMP_SLOT 3487130561SobrienENUMX 3488130561Sobrien BFD_RELOC_M32R_RELATIVE 3489130561SobrienENUMX 3490130561Sobrien BFD_RELOC_M32R_GOTOFF 3491130561SobrienENUMX 3492218822Sdim BFD_RELOC_M32R_GOTOFF_HI_ULO 3493218822SdimENUMX 3494218822Sdim BFD_RELOC_M32R_GOTOFF_HI_SLO 3495218822SdimENUMX 3496218822Sdim BFD_RELOC_M32R_GOTOFF_LO 3497218822SdimENUMX 3498130561Sobrien BFD_RELOC_M32R_GOTPC24 3499130561SobrienENUMX 3500130561Sobrien BFD_RELOC_M32R_GOT16_HI_ULO 3501130561SobrienENUMX 3502130561Sobrien BFD_RELOC_M32R_GOT16_HI_SLO 3503130561SobrienENUMX 3504130561Sobrien BFD_RELOC_M32R_GOT16_LO 3505130561SobrienENUMX 3506130561Sobrien BFD_RELOC_M32R_GOTPC_HI_ULO 3507130561SobrienENUMX 3508130561Sobrien BFD_RELOC_M32R_GOTPC_HI_SLO 3509130561SobrienENUMX 3510130561Sobrien BFD_RELOC_M32R_GOTPC_LO 3511130561SobrienENUMDOC 3512130561Sobrien For PIC. 351333965Sjdp 3514130561Sobrien 351538889SjdpENUM 351638889Sjdp BFD_RELOC_V850_9_PCREL 351738889SjdpENUMDOC 351838889Sjdp This is a 9-bit reloc 351938889SjdpENUM 352038889Sjdp BFD_RELOC_V850_22_PCREL 352138889SjdpENUMDOC 352238889Sjdp This is a 22-bit reloc 352338889Sjdp 352438889SjdpENUM 352538889Sjdp BFD_RELOC_V850_SDA_16_16_OFFSET 352638889SjdpENUMDOC 352738889Sjdp This is a 16 bit offset from the short data area pointer. 352838889SjdpENUM 352938889Sjdp BFD_RELOC_V850_SDA_15_16_OFFSET 353038889SjdpENUMDOC 353138889Sjdp This is a 16 bit offset (of which only 15 bits are used) from the 353238889Sjdp short data area pointer. 353338889SjdpENUM 353438889Sjdp BFD_RELOC_V850_ZDA_16_16_OFFSET 353538889SjdpENUMDOC 353638889Sjdp This is a 16 bit offset from the zero data area pointer. 353738889SjdpENUM 353838889Sjdp BFD_RELOC_V850_ZDA_15_16_OFFSET 353938889SjdpENUMDOC 354038889Sjdp This is a 16 bit offset (of which only 15 bits are used) from the 354138889Sjdp zero data area pointer. 354238889SjdpENUM 354338889Sjdp BFD_RELOC_V850_TDA_6_8_OFFSET 354438889SjdpENUMDOC 354538889Sjdp This is an 8 bit offset (of which only 6 bits are used) from the 354638889Sjdp tiny data area pointer. 354738889SjdpENUM 354838889Sjdp BFD_RELOC_V850_TDA_7_8_OFFSET 354938889SjdpENUMDOC 355038889Sjdp This is an 8bit offset (of which only 7 bits are used) from the tiny 355138889Sjdp data area pointer. 355238889SjdpENUM 355338889Sjdp BFD_RELOC_V850_TDA_7_7_OFFSET 355438889SjdpENUMDOC 355538889Sjdp This is a 7 bit offset from the tiny data area pointer. 355638889SjdpENUM 355738889Sjdp BFD_RELOC_V850_TDA_16_16_OFFSET 355838889SjdpENUMDOC 355938889Sjdp This is a 16 bit offset from the tiny data area pointer. 356033965SjdpCOMMENT 356160484SobrienENUM 356260484Sobrien BFD_RELOC_V850_TDA_4_5_OFFSET 356360484SobrienENUMDOC 356460484Sobrien This is a 5 bit offset (of which only 4 bits are used) from the tiny 356560484Sobrien data area pointer. 356660484SobrienENUM 356760484Sobrien BFD_RELOC_V850_TDA_4_4_OFFSET 356860484SobrienENUMDOC 356960484Sobrien This is a 4 bit offset from the tiny data area pointer. 357060484SobrienENUM 357160484Sobrien BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET 357260484SobrienENUMDOC 357360484Sobrien This is a 16 bit offset from the short data area pointer, with the 3574130561Sobrien bits placed non-contiguously in the instruction. 357560484SobrienENUM 357660484Sobrien BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET 357760484SobrienENUMDOC 357860484Sobrien This is a 16 bit offset from the zero data area pointer, with the 3579130561Sobrien bits placed non-contiguously in the instruction. 358060484SobrienENUM 358160484Sobrien BFD_RELOC_V850_CALLT_6_7_OFFSET 358260484SobrienENUMDOC 358360484Sobrien This is a 6 bit offset from the call table base pointer. 358460484SobrienENUM 358560484Sobrien BFD_RELOC_V850_CALLT_16_16_OFFSET 358660484SobrienENUMDOC 358760484Sobrien This is a 16 bit offset from the call table base pointer. 358833965SjdpENUM 3589130561Sobrien BFD_RELOC_V850_LONGCALL 3590130561SobrienENUMDOC 3591130561Sobrien Used for relaxing indirect function calls. 3592130561SobrienENUM 3593130561Sobrien BFD_RELOC_V850_LONGJUMP 3594130561SobrienENUMDOC 3595130561Sobrien Used for relaxing indirect jumps. 3596130561SobrienENUM 3597130561Sobrien BFD_RELOC_V850_ALIGN 3598130561SobrienENUMDOC 3599130561Sobrien Used to maintain alignment whilst relaxing. 3600130561SobrienENUM 3601218822Sdim BFD_RELOC_V850_LO16_SPLIT_OFFSET 3602218822SdimENUMDOC 3603218822Sdim This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu 3604218822Sdim instructions. 3605218822SdimENUM 360633965Sjdp BFD_RELOC_MN10300_32_PCREL 360733965SjdpENUMDOC 360833965Sjdp This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the 360933965Sjdp instruction. 361033965SjdpENUM 361133965Sjdp BFD_RELOC_MN10300_16_PCREL 361233965SjdpENUMDOC 361333965Sjdp This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the 361433965Sjdp instruction. 361538889Sjdp 361638889SjdpENUM 361738889Sjdp BFD_RELOC_TIC30_LDP 361838889SjdpENUMDOC 361938889Sjdp This is a 8bit DP reloc for the tms320c30, where the most 362038889Sjdp significant 8 bits of a 24 bit word are placed into the least 362138889Sjdp significant 8 bits of the opcode. 362238889Sjdp 362360484SobrienENUM 362477298Sobrien BFD_RELOC_TIC54X_PARTLS7 362577298SobrienENUMDOC 362677298Sobrien This is a 7bit reloc for the tms320c54x, where the least 362777298Sobrien significant 7 bits of a 16 bit word are placed into the least 362877298Sobrien significant 7 bits of the opcode. 362977298Sobrien 363077298SobrienENUM 363177298Sobrien BFD_RELOC_TIC54X_PARTMS9 363277298SobrienENUMDOC 363377298Sobrien This is a 9bit DP reloc for the tms320c54x, where the most 363477298Sobrien significant 9 bits of a 16 bit word are placed into the least 363577298Sobrien significant 9 bits of the opcode. 363677298Sobrien 363777298SobrienENUM 363877298Sobrien BFD_RELOC_TIC54X_23 363977298SobrienENUMDOC 364077298Sobrien This is an extended address 23-bit reloc for the tms320c54x. 364177298Sobrien 364277298SobrienENUM 364377298Sobrien BFD_RELOC_TIC54X_16_OF_23 364477298SobrienENUMDOC 364577298Sobrien This is a 16-bit reloc for the tms320c54x, where the least 364677298Sobrien significant 16 bits of a 23-bit extended address are placed into 364777298Sobrien the opcode. 364877298Sobrien 364977298SobrienENUM 365077298Sobrien BFD_RELOC_TIC54X_MS7_OF_23 365177298SobrienENUMDOC 365277298Sobrien This is a reloc for the tms320c54x, where the most 365377298Sobrien significant 7 bits of a 23-bit extended address are placed into 365477298Sobrien the opcode. 365577298Sobrien 365677298SobrienENUM 365760484Sobrien BFD_RELOC_FR30_48 365860484SobrienENUMDOC 365960484Sobrien This is a 48 bit reloc for the FR30 that stores 32 bits. 366060484SobrienENUM 366160484Sobrien BFD_RELOC_FR30_20 366260484SobrienENUMDOC 366360484Sobrien This is a 32 bit reloc for the FR30 that stores 20 bits split up into 366460484Sobrien two sections. 366560484SobrienENUM 366660484Sobrien BFD_RELOC_FR30_6_IN_4 366760484SobrienENUMDOC 366860484Sobrien This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in 366960484Sobrien 4 bits. 367060484SobrienENUM 367160484Sobrien BFD_RELOC_FR30_8_IN_8 367260484SobrienENUMDOC 367360484Sobrien This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset 367460484Sobrien into 8 bits. 367560484SobrienENUM 367660484Sobrien BFD_RELOC_FR30_9_IN_8 367760484SobrienENUMDOC 367860484Sobrien This is a 16 bit reloc for the FR30 that stores a 9 bit short offset 367960484Sobrien into 8 bits. 368060484SobrienENUM 368160484Sobrien BFD_RELOC_FR30_10_IN_8 368260484SobrienENUMDOC 368360484Sobrien This is a 16 bit reloc for the FR30 that stores a 10 bit word offset 368460484Sobrien into 8 bits. 368560484SobrienENUM 368660484Sobrien BFD_RELOC_FR30_9_PCREL 368760484SobrienENUMDOC 368860484Sobrien This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 368960484Sobrien short offset into 8 bits. 369060484SobrienENUM 369160484Sobrien BFD_RELOC_FR30_12_PCREL 369260484SobrienENUMDOC 369360484Sobrien This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative 369460484Sobrien short offset into 11 bits. 369560484Sobrien 369660484SobrienENUM 369760484Sobrien BFD_RELOC_MCORE_PCREL_IMM8BY4 369860484SobrienENUMX 369960484Sobrien BFD_RELOC_MCORE_PCREL_IMM11BY2 370060484SobrienENUMX 370160484Sobrien BFD_RELOC_MCORE_PCREL_IMM4BY2 370260484SobrienENUMX 370360484Sobrien BFD_RELOC_MCORE_PCREL_32 370460484SobrienENUMX 370560484Sobrien BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 370660484SobrienENUMX 370760484Sobrien BFD_RELOC_MCORE_RVA 370860484SobrienENUMDOC 370960484Sobrien Motorola Mcore relocations. 371060484Sobrien 371160484SobrienENUM 3712218822Sdim BFD_RELOC_MEP_8 3713218822SdimENUMX 3714218822Sdim BFD_RELOC_MEP_16 3715218822SdimENUMX 3716218822Sdim BFD_RELOC_MEP_32 3717218822SdimENUMX 3718218822Sdim BFD_RELOC_MEP_PCREL8A2 3719218822SdimENUMX 3720218822Sdim BFD_RELOC_MEP_PCREL12A2 3721218822SdimENUMX 3722218822Sdim BFD_RELOC_MEP_PCREL17A2 3723218822SdimENUMX 3724218822Sdim BFD_RELOC_MEP_PCREL24A2 3725218822SdimENUMX 3726218822Sdim BFD_RELOC_MEP_PCABS24A2 3727218822SdimENUMX 3728218822Sdim BFD_RELOC_MEP_LOW16 3729218822SdimENUMX 3730218822Sdim BFD_RELOC_MEP_HI16U 3731218822SdimENUMX 3732218822Sdim BFD_RELOC_MEP_HI16S 3733218822SdimENUMX 3734218822Sdim BFD_RELOC_MEP_GPREL 3735218822SdimENUMX 3736218822Sdim BFD_RELOC_MEP_TPREL 3737218822SdimENUMX 3738218822Sdim BFD_RELOC_MEP_TPREL7 3739218822SdimENUMX 3740218822Sdim BFD_RELOC_MEP_TPREL7A2 3741218822SdimENUMX 3742218822Sdim BFD_RELOC_MEP_TPREL7A4 3743218822SdimENUMX 3744218822Sdim BFD_RELOC_MEP_UIMM24 3745218822SdimENUMX 3746218822Sdim BFD_RELOC_MEP_ADDR24A4 3747218822SdimENUMX 3748218822Sdim BFD_RELOC_MEP_GNU_VTINHERIT 3749218822SdimENUMX 3750218822Sdim BFD_RELOC_MEP_GNU_VTENTRY 3751218822SdimENUMDOC 3752218822Sdim Toshiba Media Processor Relocations. 3753218822SdimCOMMENT 3754218822Sdim 3755218822SdimENUM 375689857Sobrien BFD_RELOC_MMIX_GETA 375789857SobrienENUMX 375889857Sobrien BFD_RELOC_MMIX_GETA_1 375989857SobrienENUMX 376089857Sobrien BFD_RELOC_MMIX_GETA_2 376189857SobrienENUMX 376289857Sobrien BFD_RELOC_MMIX_GETA_3 376389857SobrienENUMDOC 376489857Sobrien These are relocations for the GETA instruction. 376589857SobrienENUM 376689857Sobrien BFD_RELOC_MMIX_CBRANCH 376789857SobrienENUMX 376889857Sobrien BFD_RELOC_MMIX_CBRANCH_J 376989857SobrienENUMX 377089857Sobrien BFD_RELOC_MMIX_CBRANCH_1 377189857SobrienENUMX 377289857Sobrien BFD_RELOC_MMIX_CBRANCH_2 377389857SobrienENUMX 377489857Sobrien BFD_RELOC_MMIX_CBRANCH_3 377589857SobrienENUMDOC 377689857Sobrien These are relocations for a conditional branch instruction. 377789857SobrienENUM 377889857Sobrien BFD_RELOC_MMIX_PUSHJ 377989857SobrienENUMX 378089857Sobrien BFD_RELOC_MMIX_PUSHJ_1 378189857SobrienENUMX 378289857Sobrien BFD_RELOC_MMIX_PUSHJ_2 378389857SobrienENUMX 378489857Sobrien BFD_RELOC_MMIX_PUSHJ_3 3785130561SobrienENUMX 3786130561Sobrien BFD_RELOC_MMIX_PUSHJ_STUBBABLE 378789857SobrienENUMDOC 378889857Sobrien These are relocations for the PUSHJ instruction. 378989857SobrienENUM 379089857Sobrien BFD_RELOC_MMIX_JMP 379189857SobrienENUMX 379289857Sobrien BFD_RELOC_MMIX_JMP_1 379389857SobrienENUMX 379489857Sobrien BFD_RELOC_MMIX_JMP_2 379589857SobrienENUMX 379689857Sobrien BFD_RELOC_MMIX_JMP_3 379789857SobrienENUMDOC 379889857Sobrien These are relocations for the JMP instruction. 379989857SobrienENUM 380089857Sobrien BFD_RELOC_MMIX_ADDR19 380189857SobrienENUMDOC 380289857Sobrien This is a relocation for a relative address as in a GETA instruction or 380389857Sobrien a branch. 380489857SobrienENUM 380589857Sobrien BFD_RELOC_MMIX_ADDR27 380689857SobrienENUMDOC 380789857Sobrien This is a relocation for a relative address as in a JMP instruction. 380889857SobrienENUM 380989857Sobrien BFD_RELOC_MMIX_REG_OR_BYTE 381089857SobrienENUMDOC 381189857Sobrien This is a relocation for an instruction field that may be a general 381289857Sobrien register or a value 0..255. 381389857SobrienENUM 381489857Sobrien BFD_RELOC_MMIX_REG 381589857SobrienENUMDOC 381689857Sobrien This is a relocation for an instruction field that may be a general 381789857Sobrien register. 381889857SobrienENUM 381989857Sobrien BFD_RELOC_MMIX_BASE_PLUS_OFFSET 382089857SobrienENUMDOC 382189857Sobrien This is a relocation for two instruction fields holding a register and 382289857Sobrien an offset, the equivalent of the relocation. 382389857SobrienENUM 382489857Sobrien BFD_RELOC_MMIX_LOCAL 382589857SobrienENUMDOC 382689857Sobrien This relocation is an assertion that the expression is not allocated as 382789857Sobrien a global register. It does not modify contents. 382889857Sobrien 382989857SobrienENUM 383060484Sobrien BFD_RELOC_AVR_7_PCREL 383160484SobrienENUMDOC 383260484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit pc relative 383360484Sobrien short offset into 7 bits. 383460484SobrienENUM 383560484Sobrien BFD_RELOC_AVR_13_PCREL 383660484SobrienENUMDOC 383760484Sobrien This is a 16 bit reloc for the AVR that stores 13 bit pc relative 383860484Sobrien short offset into 12 bits. 383960484SobrienENUM 384060484Sobrien BFD_RELOC_AVR_16_PM 384160484SobrienENUMDOC 384260484Sobrien This is a 16 bit reloc for the AVR that stores 17 bit value (usually 384377298Sobrien program memory address) into 16 bits. 384460484SobrienENUM 384560484Sobrien BFD_RELOC_AVR_LO8_LDI 384660484SobrienENUMDOC 384760484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (usually 384860484Sobrien data memory address) into 8 bit immediate value of LDI insn. 384960484SobrienENUM 385060484Sobrien BFD_RELOC_AVR_HI8_LDI 385160484SobrienENUMDOC 385260484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 385360484Sobrien of data memory address) into 8 bit immediate value of LDI insn. 385460484SobrienENUM 385560484Sobrien BFD_RELOC_AVR_HH8_LDI 385660484SobrienENUMDOC 385760484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 385860484Sobrien of program memory address) into 8 bit immediate value of LDI insn. 385960484SobrienENUM 3860218822Sdim BFD_RELOC_AVR_MS8_LDI 3861218822SdimENUMDOC 3862218822Sdim This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 3863218822Sdim of 32 bit value) into 8 bit immediate value of LDI insn. 3864218822SdimENUM 386560484Sobrien BFD_RELOC_AVR_LO8_LDI_NEG 386660484SobrienENUMDOC 386760484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 386860484Sobrien (usually data memory address) into 8 bit immediate value of SUBI insn. 386960484SobrienENUM 387060484Sobrien BFD_RELOC_AVR_HI8_LDI_NEG 387160484SobrienENUMDOC 387260484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 387360484Sobrien (high 8 bit of data memory address) into 8 bit immediate value of 387460484Sobrien SUBI insn. 387560484SobrienENUM 387660484Sobrien BFD_RELOC_AVR_HH8_LDI_NEG 387760484SobrienENUMDOC 387860484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 387960484Sobrien (most high 8 bit of program memory address) into 8 bit immediate value 388060484Sobrien of LDI or SUBI insn. 388160484SobrienENUM 3882218822Sdim BFD_RELOC_AVR_MS8_LDI_NEG 3883218822SdimENUMDOC 3884218822Sdim This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb 3885218822Sdim of 32 bit value) into 8 bit immediate value of LDI insn. 3886218822SdimENUM 388760484Sobrien BFD_RELOC_AVR_LO8_LDI_PM 388860484SobrienENUMDOC 388960484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (usually 389060484Sobrien command address) into 8 bit immediate value of LDI insn. 389160484SobrienENUM 3892218822Sdim BFD_RELOC_AVR_LO8_LDI_GS 3893218822SdimENUMDOC 3894218822Sdim This is a 16 bit reloc for the AVR that stores 8 bit value 3895218822Sdim (command address) into 8 bit immediate value of LDI insn. If the address 3896218822Sdim is beyond the 128k boundary, the linker inserts a jump stub for this reloc 3897218822Sdim in the lower 128k. 3898218822SdimENUM 389960484Sobrien BFD_RELOC_AVR_HI8_LDI_PM 390060484SobrienENUMDOC 390160484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 390260484Sobrien of command address) into 8 bit immediate value of LDI insn. 390360484SobrienENUM 3904218822Sdim BFD_RELOC_AVR_HI8_LDI_GS 3905218822SdimENUMDOC 3906218822Sdim This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 3907218822Sdim of command address) into 8 bit immediate value of LDI insn. If the address 3908218822Sdim is beyond the 128k boundary, the linker inserts a jump stub for this reloc 3909218822Sdim below 128k. 3910218822SdimENUM 391160484Sobrien BFD_RELOC_AVR_HH8_LDI_PM 391260484SobrienENUMDOC 391360484Sobrien This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 391460484Sobrien of command address) into 8 bit immediate value of LDI insn. 391560484SobrienENUM 391660484Sobrien BFD_RELOC_AVR_LO8_LDI_PM_NEG 391760484SobrienENUMDOC 391860484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 391960484Sobrien (usually command address) into 8 bit immediate value of SUBI insn. 392060484SobrienENUM 392160484Sobrien BFD_RELOC_AVR_HI8_LDI_PM_NEG 392260484SobrienENUMDOC 392360484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 392460484Sobrien (high 8 bit of 16 bit command address) into 8 bit immediate value 392560484Sobrien of SUBI insn. 392660484SobrienENUM 392760484Sobrien BFD_RELOC_AVR_HH8_LDI_PM_NEG 392860484SobrienENUMDOC 392960484Sobrien This is a 16 bit reloc for the AVR that stores negated 8 bit value 393060484Sobrien (high 6 bit of 22 bit command address) into 8 bit immediate 393160484Sobrien value of SUBI insn. 393260484SobrienENUM 393360484Sobrien BFD_RELOC_AVR_CALL 393460484SobrienENUMDOC 393560484Sobrien This is a 32 bit reloc for the AVR that stores 23 bit value 393660484Sobrien into 22 bits. 3937218822SdimENUM 3938218822Sdim BFD_RELOC_AVR_LDI 3939218822SdimENUMDOC 3940218822Sdim This is a 16 bit reloc for the AVR that stores all needed bits 3941218822Sdim for absolute addressing with ldi with overflow check to linktime 3942218822SdimENUM 3943218822Sdim BFD_RELOC_AVR_6 3944218822SdimENUMDOC 3945218822Sdim This is a 6 bit reloc for the AVR that stores offset for ldd/std 3946218822Sdim instructions 3947218822SdimENUM 3948218822Sdim BFD_RELOC_AVR_6_ADIW 3949218822SdimENUMDOC 3950218822Sdim This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw 3951218822Sdim instructions 395260484Sobrien 395360484SobrienENUM 395489857Sobrien BFD_RELOC_390_12 395589857SobrienENUMDOC 395689857Sobrien Direct 12 bit. 395789857SobrienENUM 395889857Sobrien BFD_RELOC_390_GOT12 395989857SobrienENUMDOC 396089857Sobrien 12 bit GOT offset. 396189857SobrienENUM 396289857Sobrien BFD_RELOC_390_PLT32 396389857SobrienENUMDOC 396489857Sobrien 32 bit PC relative PLT address. 396589857SobrienENUM 396689857Sobrien BFD_RELOC_390_COPY 396789857SobrienENUMDOC 396889857Sobrien Copy symbol at runtime. 396989857SobrienENUM 397089857Sobrien BFD_RELOC_390_GLOB_DAT 397189857SobrienENUMDOC 397289857Sobrien Create GOT entry. 397389857SobrienENUM 397489857Sobrien BFD_RELOC_390_JMP_SLOT 397589857SobrienENUMDOC 397689857Sobrien Create PLT entry. 397789857SobrienENUM 397889857Sobrien BFD_RELOC_390_RELATIVE 397989857SobrienENUMDOC 398089857Sobrien Adjust by program base. 398189857SobrienENUM 398289857Sobrien BFD_RELOC_390_GOTPC 398389857SobrienENUMDOC 398489857Sobrien 32 bit PC relative offset to GOT. 398589857SobrienENUM 398689857Sobrien BFD_RELOC_390_GOT16 398789857SobrienENUMDOC 398889857Sobrien 16 bit GOT offset. 398989857SobrienENUM 399089857Sobrien BFD_RELOC_390_PC16DBL 399189857SobrienENUMDOC 399289857Sobrien PC relative 16 bit shifted by 1. 399389857SobrienENUM 399489857Sobrien BFD_RELOC_390_PLT16DBL 399589857SobrienENUMDOC 399689857Sobrien 16 bit PC rel. PLT shifted by 1. 399789857SobrienENUM 399889857Sobrien BFD_RELOC_390_PC32DBL 399989857SobrienENUMDOC 400089857Sobrien PC relative 32 bit shifted by 1. 400189857SobrienENUM 400289857Sobrien BFD_RELOC_390_PLT32DBL 400389857SobrienENUMDOC 400489857Sobrien 32 bit PC rel. PLT shifted by 1. 400589857SobrienENUM 400689857Sobrien BFD_RELOC_390_GOTPCDBL 400789857SobrienENUMDOC 400889857Sobrien 32 bit PC rel. GOT shifted by 1. 400989857SobrienENUM 401089857Sobrien BFD_RELOC_390_GOT64 401189857SobrienENUMDOC 401289857Sobrien 64 bit GOT offset. 401389857SobrienENUM 401489857Sobrien BFD_RELOC_390_PLT64 401589857SobrienENUMDOC 401689857Sobrien 64 bit PC relative PLT address. 401789857SobrienENUM 401889857Sobrien BFD_RELOC_390_GOTENT 401989857SobrienENUMDOC 402089857Sobrien 32 bit rel. offset to GOT entry. 4021130561SobrienENUM 4022130561Sobrien BFD_RELOC_390_GOTOFF64 4023130561SobrienENUMDOC 4024130561Sobrien 64 bit offset to GOT. 4025130561SobrienENUM 4026130561Sobrien BFD_RELOC_390_GOTPLT12 4027130561SobrienENUMDOC 4028130561Sobrien 12-bit offset to symbol-entry within GOT, with PLT handling. 4029130561SobrienENUM 4030130561Sobrien BFD_RELOC_390_GOTPLT16 4031130561SobrienENUMDOC 4032130561Sobrien 16-bit offset to symbol-entry within GOT, with PLT handling. 4033130561SobrienENUM 4034130561Sobrien BFD_RELOC_390_GOTPLT32 4035130561SobrienENUMDOC 4036130561Sobrien 32-bit offset to symbol-entry within GOT, with PLT handling. 4037130561SobrienENUM 4038130561Sobrien BFD_RELOC_390_GOTPLT64 4039130561SobrienENUMDOC 4040130561Sobrien 64-bit offset to symbol-entry within GOT, with PLT handling. 4041130561SobrienENUM 4042130561Sobrien BFD_RELOC_390_GOTPLTENT 4043130561SobrienENUMDOC 4044130561Sobrien 32-bit rel. offset to symbol-entry within GOT, with PLT handling. 4045130561SobrienENUM 4046130561Sobrien BFD_RELOC_390_PLTOFF16 4047130561SobrienENUMDOC 4048130561Sobrien 16-bit rel. offset from the GOT to a PLT entry. 4049130561SobrienENUM 4050130561Sobrien BFD_RELOC_390_PLTOFF32 4051130561SobrienENUMDOC 4052130561Sobrien 32-bit rel. offset from the GOT to a PLT entry. 4053130561SobrienENUM 4054130561Sobrien BFD_RELOC_390_PLTOFF64 4055130561SobrienENUMDOC 4056130561Sobrien 64-bit rel. offset from the GOT to a PLT entry. 405789857Sobrien 405889857SobrienENUM 4059130561Sobrien BFD_RELOC_390_TLS_LOAD 4060130561SobrienENUMX 4061130561Sobrien BFD_RELOC_390_TLS_GDCALL 4062130561SobrienENUMX 4063130561Sobrien BFD_RELOC_390_TLS_LDCALL 4064130561SobrienENUMX 4065130561Sobrien BFD_RELOC_390_TLS_GD32 4066130561SobrienENUMX 4067130561Sobrien BFD_RELOC_390_TLS_GD64 4068130561SobrienENUMX 4069130561Sobrien BFD_RELOC_390_TLS_GOTIE12 4070130561SobrienENUMX 4071130561Sobrien BFD_RELOC_390_TLS_GOTIE32 4072130561SobrienENUMX 4073130561Sobrien BFD_RELOC_390_TLS_GOTIE64 4074130561SobrienENUMX 4075130561Sobrien BFD_RELOC_390_TLS_LDM32 4076130561SobrienENUMX 4077130561Sobrien BFD_RELOC_390_TLS_LDM64 4078130561SobrienENUMX 4079130561Sobrien BFD_RELOC_390_TLS_IE32 4080130561SobrienENUMX 4081130561Sobrien BFD_RELOC_390_TLS_IE64 4082130561SobrienENUMX 4083130561Sobrien BFD_RELOC_390_TLS_IEENT 4084130561SobrienENUMX 4085130561Sobrien BFD_RELOC_390_TLS_LE32 4086130561SobrienENUMX 4087130561Sobrien BFD_RELOC_390_TLS_LE64 4088130561SobrienENUMX 4089130561Sobrien BFD_RELOC_390_TLS_LDO32 4090130561SobrienENUMX 4091130561Sobrien BFD_RELOC_390_TLS_LDO64 4092130561SobrienENUMX 4093130561Sobrien BFD_RELOC_390_TLS_DTPMOD 4094130561SobrienENUMX 4095130561Sobrien BFD_RELOC_390_TLS_DTPOFF 4096130561SobrienENUMX 4097130561Sobrien BFD_RELOC_390_TLS_TPOFF 4098130561SobrienENUMDOC 4099130561Sobrien s390 tls relocations. 4100130561Sobrien 4101130561SobrienENUM 4102130561Sobrien BFD_RELOC_390_20 4103130561SobrienENUMX 4104130561Sobrien BFD_RELOC_390_GOT20 4105130561SobrienENUMX 4106130561Sobrien BFD_RELOC_390_GOTPLT20 4107130561SobrienENUMX 4108130561Sobrien BFD_RELOC_390_TLS_GOTIE20 4109130561SobrienENUMDOC 4110130561Sobrien Long displacement extension. 4111130561Sobrien 4112130561SobrienENUM 4113218822Sdim BFD_RELOC_SCORE_DUMMY1 4114218822SdimENUMDOC 4115218822Sdim Score relocations 4116218822SdimENUM 4117218822Sdim BFD_RELOC_SCORE_GPREL15 4118218822SdimENUMDOC 4119218822Sdim Low 16 bit for load/store 4120218822SdimENUM 4121218822Sdim BFD_RELOC_SCORE_DUMMY2 4122218822SdimENUMX 4123218822Sdim BFD_RELOC_SCORE_JMP 4124218822SdimENUMDOC 4125218822Sdim This is a 24-bit reloc with the right 1 bit assumed to be 0 4126218822SdimENUM 4127218822Sdim BFD_RELOC_SCORE_BRANCH 4128218822SdimENUMDOC 4129218822Sdim This is a 19-bit reloc with the right 1 bit assumed to be 0 4130218822SdimENUM 4131218822Sdim BFD_RELOC_SCORE16_JMP 4132218822SdimENUMDOC 4133218822Sdim This is a 11-bit reloc with the right 1 bit assumed to be 0 4134218822SdimENUM 4135218822Sdim BFD_RELOC_SCORE16_BRANCH 4136218822SdimENUMDOC 4137218822Sdim This is a 8-bit reloc with the right 1 bit assumed to be 0 4138218822SdimENUM 4139218822Sdim BFD_RELOC_SCORE_GOT15 4140218822SdimENUMX 4141218822Sdim BFD_RELOC_SCORE_GOT_LO16 4142218822SdimENUMX 4143218822Sdim BFD_RELOC_SCORE_CALL15 4144218822SdimENUMX 4145218822Sdim BFD_RELOC_SCORE_DUMMY_HI16 4146218822SdimENUMDOC 4147218822Sdim Undocumented Score relocs 4148218822Sdim 4149218822SdimENUM 4150130561Sobrien BFD_RELOC_IP2K_FR9 4151130561SobrienENUMDOC 4152130561Sobrien Scenix IP2K - 9-bit register number / data address 4153130561SobrienENUM 4154130561Sobrien BFD_RELOC_IP2K_BANK 4155130561SobrienENUMDOC 4156130561Sobrien Scenix IP2K - 4-bit register/data bank number 4157130561SobrienENUM 4158130561Sobrien BFD_RELOC_IP2K_ADDR16CJP 4159130561SobrienENUMDOC 4160130561Sobrien Scenix IP2K - low 13 bits of instruction word address 4161130561SobrienENUM 4162130561Sobrien BFD_RELOC_IP2K_PAGE3 4163130561SobrienENUMDOC 4164130561Sobrien Scenix IP2K - high 3 bits of instruction word address 4165130561SobrienENUM 4166130561Sobrien BFD_RELOC_IP2K_LO8DATA 4167130561SobrienENUMX 4168130561Sobrien BFD_RELOC_IP2K_HI8DATA 4169130561SobrienENUMX 4170130561Sobrien BFD_RELOC_IP2K_EX8DATA 4171130561SobrienENUMDOC 4172130561Sobrien Scenix IP2K - ext/low/high 8 bits of data address 4173130561SobrienENUM 4174130561Sobrien BFD_RELOC_IP2K_LO8INSN 4175130561SobrienENUMX 4176130561Sobrien BFD_RELOC_IP2K_HI8INSN 4177130561SobrienENUMDOC 4178130561Sobrien Scenix IP2K - low/high 8 bits of instruction word address 4179130561SobrienENUM 4180130561Sobrien BFD_RELOC_IP2K_PC_SKIP 4181130561SobrienENUMDOC 4182130561Sobrien Scenix IP2K - even/odd PC modifier to modify snb pcl.0 4183130561SobrienENUM 4184130561Sobrien BFD_RELOC_IP2K_TEXT 4185130561SobrienENUMDOC 4186130561Sobrien Scenix IP2K - 16 bit word address in text section. 4187130561SobrienENUM 4188130561Sobrien BFD_RELOC_IP2K_FR_OFFSET 4189130561SobrienENUMDOC 4190130561Sobrien Scenix IP2K - 7-bit sp or dp offset 4191130561SobrienENUM 4192130561Sobrien BFD_RELOC_VPE4KMATH_DATA 4193130561SobrienENUMX 4194130561Sobrien BFD_RELOC_VPE4KMATH_INSN 4195130561SobrienENUMDOC 4196130561Sobrien Scenix VPE4K coprocessor - data/insn-space addressing 4197130561Sobrien 4198130561SobrienENUM 419960484Sobrien BFD_RELOC_VTABLE_INHERIT 420060484SobrienENUMX 420160484Sobrien BFD_RELOC_VTABLE_ENTRY 420260484SobrienENUMDOC 420360484Sobrien These two relocations are used by the linker to determine which of 420460484Sobrien the entries in a C++ virtual function table are actually used. When 420560484Sobrien the --gc-sections option is given, the linker will zero out the entries 420660484Sobrien that are not used, so that the code for those functions need not be 420760484Sobrien included in the output. 420860484Sobrien 420960484Sobrien VTABLE_INHERIT is a zero-space relocation used to describe to the 4210130561Sobrien linker the inheritance tree of a C++ virtual function table. The 421160484Sobrien relocation's symbol should be the parent class' vtable, and the 421260484Sobrien relocation should be located at the child vtable. 421360484Sobrien 421460484Sobrien VTABLE_ENTRY is a zero-space relocation that describes the use of a 421560484Sobrien virtual function table entry. The reloc's symbol should refer to the 421660484Sobrien table of the class mentioned in the code. Off of that base, an offset 421760484Sobrien describes the entry that is being used. For Rela hosts, this offset 421860484Sobrien is stored in the reloc's addend. For Rel hosts, we are forced to put 421960484Sobrien this offset in the reloc's section offset. 422060484Sobrien 422177298SobrienENUM 422277298Sobrien BFD_RELOC_IA64_IMM14 422377298SobrienENUMX 422477298Sobrien BFD_RELOC_IA64_IMM22 422577298SobrienENUMX 422677298Sobrien BFD_RELOC_IA64_IMM64 422777298SobrienENUMX 422877298Sobrien BFD_RELOC_IA64_DIR32MSB 422977298SobrienENUMX 423077298Sobrien BFD_RELOC_IA64_DIR32LSB 423177298SobrienENUMX 423277298Sobrien BFD_RELOC_IA64_DIR64MSB 423377298SobrienENUMX 423477298Sobrien BFD_RELOC_IA64_DIR64LSB 423577298SobrienENUMX 423677298Sobrien BFD_RELOC_IA64_GPREL22 423777298SobrienENUMX 423877298Sobrien BFD_RELOC_IA64_GPREL64I 423977298SobrienENUMX 424077298Sobrien BFD_RELOC_IA64_GPREL32MSB 424177298SobrienENUMX 424277298Sobrien BFD_RELOC_IA64_GPREL32LSB 424377298SobrienENUMX 424477298Sobrien BFD_RELOC_IA64_GPREL64MSB 424577298SobrienENUMX 424677298Sobrien BFD_RELOC_IA64_GPREL64LSB 424777298SobrienENUMX 424877298Sobrien BFD_RELOC_IA64_LTOFF22 424977298SobrienENUMX 425077298Sobrien BFD_RELOC_IA64_LTOFF64I 425177298SobrienENUMX 425277298Sobrien BFD_RELOC_IA64_PLTOFF22 425377298SobrienENUMX 425477298Sobrien BFD_RELOC_IA64_PLTOFF64I 425577298SobrienENUMX 425677298Sobrien BFD_RELOC_IA64_PLTOFF64MSB 425777298SobrienENUMX 425877298Sobrien BFD_RELOC_IA64_PLTOFF64LSB 425977298SobrienENUMX 426077298Sobrien BFD_RELOC_IA64_FPTR64I 426177298SobrienENUMX 426277298Sobrien BFD_RELOC_IA64_FPTR32MSB 426377298SobrienENUMX 426477298Sobrien BFD_RELOC_IA64_FPTR32LSB 426577298SobrienENUMX 426677298Sobrien BFD_RELOC_IA64_FPTR64MSB 426777298SobrienENUMX 426877298Sobrien BFD_RELOC_IA64_FPTR64LSB 426977298SobrienENUMX 427077298Sobrien BFD_RELOC_IA64_PCREL21B 427177298SobrienENUMX 427277298Sobrien BFD_RELOC_IA64_PCREL21BI 427377298SobrienENUMX 427477298Sobrien BFD_RELOC_IA64_PCREL21M 427577298SobrienENUMX 427677298Sobrien BFD_RELOC_IA64_PCREL21F 427777298SobrienENUMX 427877298Sobrien BFD_RELOC_IA64_PCREL22 427977298SobrienENUMX 428077298Sobrien BFD_RELOC_IA64_PCREL60B 428177298SobrienENUMX 428277298Sobrien BFD_RELOC_IA64_PCREL64I 428377298SobrienENUMX 428477298Sobrien BFD_RELOC_IA64_PCREL32MSB 428577298SobrienENUMX 428677298Sobrien BFD_RELOC_IA64_PCREL32LSB 428777298SobrienENUMX 428877298Sobrien BFD_RELOC_IA64_PCREL64MSB 428977298SobrienENUMX 429077298Sobrien BFD_RELOC_IA64_PCREL64LSB 429177298SobrienENUMX 429277298Sobrien BFD_RELOC_IA64_LTOFF_FPTR22 429377298SobrienENUMX 429477298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64I 429577298SobrienENUMX 429689857Sobrien BFD_RELOC_IA64_LTOFF_FPTR32MSB 429789857SobrienENUMX 429889857Sobrien BFD_RELOC_IA64_LTOFF_FPTR32LSB 429989857SobrienENUMX 430077298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64MSB 430177298SobrienENUMX 430277298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64LSB 430377298SobrienENUMX 430477298Sobrien BFD_RELOC_IA64_SEGREL32MSB 430577298SobrienENUMX 430677298Sobrien BFD_RELOC_IA64_SEGREL32LSB 430777298SobrienENUMX 430877298Sobrien BFD_RELOC_IA64_SEGREL64MSB 430977298SobrienENUMX 431077298Sobrien BFD_RELOC_IA64_SEGREL64LSB 431177298SobrienENUMX 431277298Sobrien BFD_RELOC_IA64_SECREL32MSB 431377298SobrienENUMX 431477298Sobrien BFD_RELOC_IA64_SECREL32LSB 431577298SobrienENUMX 431677298Sobrien BFD_RELOC_IA64_SECREL64MSB 431777298SobrienENUMX 431877298Sobrien BFD_RELOC_IA64_SECREL64LSB 431977298SobrienENUMX 432077298Sobrien BFD_RELOC_IA64_REL32MSB 432177298SobrienENUMX 432277298Sobrien BFD_RELOC_IA64_REL32LSB 432377298SobrienENUMX 432477298Sobrien BFD_RELOC_IA64_REL64MSB 432577298SobrienENUMX 432677298Sobrien BFD_RELOC_IA64_REL64LSB 432777298SobrienENUMX 432877298Sobrien BFD_RELOC_IA64_LTV32MSB 432977298SobrienENUMX 433077298Sobrien BFD_RELOC_IA64_LTV32LSB 433177298SobrienENUMX 433277298Sobrien BFD_RELOC_IA64_LTV64MSB 433377298SobrienENUMX 433477298Sobrien BFD_RELOC_IA64_LTV64LSB 433577298SobrienENUMX 433677298Sobrien BFD_RELOC_IA64_IPLTMSB 433777298SobrienENUMX 433877298Sobrien BFD_RELOC_IA64_IPLTLSB 433977298SobrienENUMX 434077298Sobrien BFD_RELOC_IA64_COPY 434177298SobrienENUMX 4342104834Sobrien BFD_RELOC_IA64_LTOFF22X 4343104834SobrienENUMX 4344104834Sobrien BFD_RELOC_IA64_LDXMOV 4345104834SobrienENUMX 4346104834Sobrien BFD_RELOC_IA64_TPREL14 4347104834SobrienENUMX 434877298Sobrien BFD_RELOC_IA64_TPREL22 434977298SobrienENUMX 4350104834Sobrien BFD_RELOC_IA64_TPREL64I 4351104834SobrienENUMX 435277298Sobrien BFD_RELOC_IA64_TPREL64MSB 435377298SobrienENUMX 435477298Sobrien BFD_RELOC_IA64_TPREL64LSB 435577298SobrienENUMX 4356104834Sobrien BFD_RELOC_IA64_LTOFF_TPREL22 435777298SobrienENUMX 4358104834Sobrien BFD_RELOC_IA64_DTPMOD64MSB 435977298SobrienENUMX 4360104834Sobrien BFD_RELOC_IA64_DTPMOD64LSB 4361104834SobrienENUMX 4362104834Sobrien BFD_RELOC_IA64_LTOFF_DTPMOD22 4363104834SobrienENUMX 4364104834Sobrien BFD_RELOC_IA64_DTPREL14 4365104834SobrienENUMX 4366104834Sobrien BFD_RELOC_IA64_DTPREL22 4367104834SobrienENUMX 4368104834Sobrien BFD_RELOC_IA64_DTPREL64I 4369104834SobrienENUMX 4370104834Sobrien BFD_RELOC_IA64_DTPREL32MSB 4371104834SobrienENUMX 4372104834Sobrien BFD_RELOC_IA64_DTPREL32LSB 4373104834SobrienENUMX 4374104834Sobrien BFD_RELOC_IA64_DTPREL64MSB 4375104834SobrienENUMX 4376104834Sobrien BFD_RELOC_IA64_DTPREL64LSB 4377104834SobrienENUMX 4378104834Sobrien BFD_RELOC_IA64_LTOFF_DTPREL22 437977298SobrienENUMDOC 438077298Sobrien Intel IA64 Relocations. 438177298Sobrien 438277298SobrienENUM 438377298Sobrien BFD_RELOC_M68HC11_HI8 438477298SobrienENUMDOC 438577298Sobrien Motorola 68HC11 reloc. 4386130561Sobrien This is the 8 bit high part of an absolute address. 438777298SobrienENUM 438877298Sobrien BFD_RELOC_M68HC11_LO8 438977298SobrienENUMDOC 439077298Sobrien Motorola 68HC11 reloc. 4391130561Sobrien This is the 8 bit low part of an absolute address. 439277298SobrienENUM 439377298Sobrien BFD_RELOC_M68HC11_3B 439477298SobrienENUMDOC 439577298Sobrien Motorola 68HC11 reloc. 4396130561Sobrien This is the 3 bit of a value. 4397130561SobrienENUM 4398130561Sobrien BFD_RELOC_M68HC11_RL_JUMP 4399130561SobrienENUMDOC 4400130561Sobrien Motorola 68HC11 reloc. 4401130561Sobrien This reloc marks the beginning of a jump/call instruction. 4402130561Sobrien It is used for linker relaxation to correctly identify beginning 4403130561Sobrien of instruction and change some branches to use PC-relative 4404130561Sobrien addressing mode. 4405130561SobrienENUM 4406130561Sobrien BFD_RELOC_M68HC11_RL_GROUP 4407130561SobrienENUMDOC 4408130561Sobrien Motorola 68HC11 reloc. 4409130561Sobrien This reloc marks a group of several instructions that gcc generates 4410130561Sobrien and for which the linker relaxation pass can modify and/or remove 4411130561Sobrien some of them. 4412130561SobrienENUM 4413130561Sobrien BFD_RELOC_M68HC11_LO16 4414130561SobrienENUMDOC 4415130561Sobrien Motorola 68HC11 reloc. 4416130561Sobrien This is the 16-bit lower part of an address. It is used for 'call' 4417130561Sobrien instruction to specify the symbol address without any special 4418130561Sobrien transformation (due to memory bank window). 4419130561SobrienENUM 4420130561Sobrien BFD_RELOC_M68HC11_PAGE 4421130561SobrienENUMDOC 4422130561Sobrien Motorola 68HC11 reloc. 4423130561Sobrien This is a 8-bit reloc that specifies the page number of an address. 4424130561Sobrien It is used by 'call' instruction to specify the page number of 4425130561Sobrien the symbol. 4426130561SobrienENUM 4427130561Sobrien BFD_RELOC_M68HC11_24 4428130561SobrienENUMDOC 4429130561Sobrien Motorola 68HC11 reloc. 4430130561Sobrien This is a 24-bit reloc that represents the address with a 16-bit 4431130561Sobrien value and a 8-bit page number. The symbol address is transformed 4432130561Sobrien to follow the 16K memory bank of 68HC12 (seen as mapped in the window). 4433130561SobrienENUM 4434130561Sobrien BFD_RELOC_M68HC12_5B 4435130561SobrienENUMDOC 4436130561Sobrien Motorola 68HC12 reloc. 4437130561Sobrien This is the 5 bits of a value. 443877298Sobrien 443977298SobrienENUM 4440218822Sdim BFD_RELOC_16C_NUM08 4441218822SdimENUMX 4442218822Sdim BFD_RELOC_16C_NUM08_C 4443218822SdimENUMX 4444218822Sdim BFD_RELOC_16C_NUM16 4445218822SdimENUMX 4446218822Sdim BFD_RELOC_16C_NUM16_C 4447218822SdimENUMX 4448218822Sdim BFD_RELOC_16C_NUM32 4449218822SdimENUMX 4450218822Sdim BFD_RELOC_16C_NUM32_C 4451218822SdimENUMX 4452218822Sdim BFD_RELOC_16C_DISP04 4453218822SdimENUMX 4454218822Sdim BFD_RELOC_16C_DISP04_C 4455218822SdimENUMX 4456218822Sdim BFD_RELOC_16C_DISP08 4457218822SdimENUMX 4458218822Sdim BFD_RELOC_16C_DISP08_C 4459218822SdimENUMX 4460218822Sdim BFD_RELOC_16C_DISP16 4461218822SdimENUMX 4462218822Sdim BFD_RELOC_16C_DISP16_C 4463218822SdimENUMX 4464218822Sdim BFD_RELOC_16C_DISP24 4465218822SdimENUMX 4466218822Sdim BFD_RELOC_16C_DISP24_C 4467218822SdimENUMX 4468218822Sdim BFD_RELOC_16C_DISP24a 4469218822SdimENUMX 4470218822Sdim BFD_RELOC_16C_DISP24a_C 4471218822SdimENUMX 4472218822Sdim BFD_RELOC_16C_REG04 4473218822SdimENUMX 4474218822Sdim BFD_RELOC_16C_REG04_C 4475218822SdimENUMX 4476218822Sdim BFD_RELOC_16C_REG04a 4477218822SdimENUMX 4478218822Sdim BFD_RELOC_16C_REG04a_C 4479218822SdimENUMX 4480218822Sdim BFD_RELOC_16C_REG14 4481218822SdimENUMX 4482218822Sdim BFD_RELOC_16C_REG14_C 4483218822SdimENUMX 4484218822Sdim BFD_RELOC_16C_REG16 4485218822SdimENUMX 4486218822Sdim BFD_RELOC_16C_REG16_C 4487218822SdimENUMX 4488218822Sdim BFD_RELOC_16C_REG20 4489218822SdimENUMX 4490218822Sdim BFD_RELOC_16C_REG20_C 4491218822SdimENUMX 4492218822Sdim BFD_RELOC_16C_ABS20 4493218822SdimENUMX 4494218822Sdim BFD_RELOC_16C_ABS20_C 4495218822SdimENUMX 4496218822Sdim BFD_RELOC_16C_ABS24 4497218822SdimENUMX 4498218822Sdim BFD_RELOC_16C_ABS24_C 4499218822SdimENUMX 4500218822Sdim BFD_RELOC_16C_IMM04 4501218822SdimENUMX 4502218822Sdim BFD_RELOC_16C_IMM04_C 4503218822SdimENUMX 4504218822Sdim BFD_RELOC_16C_IMM16 4505218822SdimENUMX 4506218822Sdim BFD_RELOC_16C_IMM16_C 4507218822SdimENUMX 4508218822Sdim BFD_RELOC_16C_IMM20 4509218822SdimENUMX 4510218822Sdim BFD_RELOC_16C_IMM20_C 4511218822SdimENUMX 4512218822Sdim BFD_RELOC_16C_IMM24 4513218822SdimENUMX 4514218822Sdim BFD_RELOC_16C_IMM24_C 4515218822SdimENUMX 4516218822Sdim BFD_RELOC_16C_IMM32 4517218822SdimENUMX 4518218822Sdim BFD_RELOC_16C_IMM32_C 4519218822SdimENUMDOC 4520218822Sdim NS CR16C Relocations. 4521218822Sdim 4522218822SdimENUM 4523218822Sdim BFD_RELOC_CR16_NUM8 4524218822SdimENUMX 4525218822Sdim BFD_RELOC_CR16_NUM16 4526218822SdimENUMX 4527218822Sdim BFD_RELOC_CR16_NUM32 4528218822SdimENUMX 4529218822Sdim BFD_RELOC_CR16_NUM32a 4530218822SdimENUMX 4531218822Sdim BFD_RELOC_CR16_REGREL0 4532218822SdimENUMX 4533218822Sdim BFD_RELOC_CR16_REGREL4 4534218822SdimENUMX 4535218822Sdim BFD_RELOC_CR16_REGREL4a 4536218822SdimENUMX 4537218822Sdim BFD_RELOC_CR16_REGREL14 4538218822SdimENUMX 4539218822Sdim BFD_RELOC_CR16_REGREL14a 4540218822SdimENUMX 4541218822Sdim BFD_RELOC_CR16_REGREL16 4542218822SdimENUMX 4543218822Sdim BFD_RELOC_CR16_REGREL20 4544218822SdimENUMX 4545218822Sdim BFD_RELOC_CR16_REGREL20a 4546218822SdimENUMX 4547218822Sdim BFD_RELOC_CR16_ABS20 4548218822SdimENUMX 4549218822Sdim BFD_RELOC_CR16_ABS24 4550218822SdimENUMX 4551218822Sdim BFD_RELOC_CR16_IMM4 4552218822SdimENUMX 4553218822Sdim BFD_RELOC_CR16_IMM8 4554218822SdimENUMX 4555218822Sdim BFD_RELOC_CR16_IMM16 4556218822SdimENUMX 4557218822Sdim BFD_RELOC_CR16_IMM20 4558218822SdimENUMX 4559218822Sdim BFD_RELOC_CR16_IMM24 4560218822SdimENUMX 4561218822Sdim BFD_RELOC_CR16_IMM32 4562218822SdimENUMX 4563218822Sdim BFD_RELOC_CR16_IMM32a 4564218822SdimENUMX 4565218822Sdim BFD_RELOC_CR16_DISP4 4566218822SdimENUMX 4567218822Sdim BFD_RELOC_CR16_DISP8 4568218822SdimENUMX 4569218822Sdim BFD_RELOC_CR16_DISP16 4570218822SdimENUMX 4571218822Sdim BFD_RELOC_CR16_DISP20 4572218822SdimENUMX 4573218822Sdim BFD_RELOC_CR16_DISP24 4574218822SdimENUMX 4575218822Sdim BFD_RELOC_CR16_DISP24a 4576218822SdimENUMDOC 4577218822Sdim NS CR16 Relocations. 4578218822Sdim 4579218822SdimENUM 4580218822Sdim BFD_RELOC_CRX_REL4 4581218822SdimENUMX 4582218822Sdim BFD_RELOC_CRX_REL8 4583218822SdimENUMX 4584218822Sdim BFD_RELOC_CRX_REL8_CMP 4585218822SdimENUMX 4586218822Sdim BFD_RELOC_CRX_REL16 4587218822SdimENUMX 4588218822Sdim BFD_RELOC_CRX_REL24 4589218822SdimENUMX 4590218822Sdim BFD_RELOC_CRX_REL32 4591218822SdimENUMX 4592218822Sdim BFD_RELOC_CRX_REGREL12 4593218822SdimENUMX 4594218822Sdim BFD_RELOC_CRX_REGREL22 4595218822SdimENUMX 4596218822Sdim BFD_RELOC_CRX_REGREL28 4597218822SdimENUMX 4598218822Sdim BFD_RELOC_CRX_REGREL32 4599218822SdimENUMX 4600218822Sdim BFD_RELOC_CRX_ABS16 4601218822SdimENUMX 4602218822Sdim BFD_RELOC_CRX_ABS32 4603218822SdimENUMX 4604218822Sdim BFD_RELOC_CRX_NUM8 4605218822SdimENUMX 4606218822Sdim BFD_RELOC_CRX_NUM16 4607218822SdimENUMX 4608218822Sdim BFD_RELOC_CRX_NUM32 4609218822SdimENUMX 4610218822Sdim BFD_RELOC_CRX_IMM16 4611218822SdimENUMX 4612218822Sdim BFD_RELOC_CRX_IMM32 4613218822SdimENUMX 4614218822Sdim BFD_RELOC_CRX_SWITCH8 4615218822SdimENUMX 4616218822Sdim BFD_RELOC_CRX_SWITCH16 4617218822SdimENUMX 4618218822Sdim BFD_RELOC_CRX_SWITCH32 4619218822SdimENUMDOC 4620218822Sdim NS CRX Relocations. 4621218822Sdim 4622218822SdimENUM 462377298Sobrien BFD_RELOC_CRIS_BDISP8 462477298SobrienENUMX 462577298Sobrien BFD_RELOC_CRIS_UNSIGNED_5 462677298SobrienENUMX 462777298Sobrien BFD_RELOC_CRIS_SIGNED_6 462877298SobrienENUMX 462977298Sobrien BFD_RELOC_CRIS_UNSIGNED_6 463077298SobrienENUMX 4631218822Sdim BFD_RELOC_CRIS_SIGNED_8 4632218822SdimENUMX 4633218822Sdim BFD_RELOC_CRIS_UNSIGNED_8 4634218822SdimENUMX 4635218822Sdim BFD_RELOC_CRIS_SIGNED_16 4636218822SdimENUMX 4637218822Sdim BFD_RELOC_CRIS_UNSIGNED_16 4638218822SdimENUMX 4639218822Sdim BFD_RELOC_CRIS_LAPCQ_OFFSET 4640218822SdimENUMX 464177298Sobrien BFD_RELOC_CRIS_UNSIGNED_4 464277298SobrienENUMDOC 464377298Sobrien These relocs are only used within the CRIS assembler. They are not 464477298Sobrien (at present) written to any object files. 464589857SobrienENUM 464689857Sobrien BFD_RELOC_CRIS_COPY 464789857SobrienENUMX 464889857Sobrien BFD_RELOC_CRIS_GLOB_DAT 464989857SobrienENUMX 465089857Sobrien BFD_RELOC_CRIS_JUMP_SLOT 465189857SobrienENUMX 465289857Sobrien BFD_RELOC_CRIS_RELATIVE 465389857SobrienENUMDOC 465489857Sobrien Relocs used in ELF shared libraries for CRIS. 465589857SobrienENUM 465689857Sobrien BFD_RELOC_CRIS_32_GOT 465789857SobrienENUMDOC 465889857Sobrien 32-bit offset to symbol-entry within GOT. 465989857SobrienENUM 466089857Sobrien BFD_RELOC_CRIS_16_GOT 466189857SobrienENUMDOC 466289857Sobrien 16-bit offset to symbol-entry within GOT. 466389857SobrienENUM 466489857Sobrien BFD_RELOC_CRIS_32_GOTPLT 466589857SobrienENUMDOC 466689857Sobrien 32-bit offset to symbol-entry within GOT, with PLT handling. 466789857SobrienENUM 466889857Sobrien BFD_RELOC_CRIS_16_GOTPLT 466989857SobrienENUMDOC 467089857Sobrien 16-bit offset to symbol-entry within GOT, with PLT handling. 467189857SobrienENUM 467289857Sobrien BFD_RELOC_CRIS_32_GOTREL 467389857SobrienENUMDOC 467489857Sobrien 32-bit offset to symbol, relative to GOT. 467589857SobrienENUM 467689857Sobrien BFD_RELOC_CRIS_32_PLT_GOTREL 467789857SobrienENUMDOC 467889857Sobrien 32-bit offset to symbol with PLT entry, relative to GOT. 467989857SobrienENUM 468089857Sobrien BFD_RELOC_CRIS_32_PLT_PCREL 468189857SobrienENUMDOC 468289857Sobrien 32-bit offset to symbol with PLT entry, relative to this relocation. 468377298Sobrien 468477298SobrienENUM 468577298Sobrien BFD_RELOC_860_COPY 468677298SobrienENUMX 468777298Sobrien BFD_RELOC_860_GLOB_DAT 468877298SobrienENUMX 468977298Sobrien BFD_RELOC_860_JUMP_SLOT 469077298SobrienENUMX 469177298Sobrien BFD_RELOC_860_RELATIVE 469277298SobrienENUMX 469377298Sobrien BFD_RELOC_860_PC26 469477298SobrienENUMX 469577298Sobrien BFD_RELOC_860_PLT26 469677298SobrienENUMX 469777298Sobrien BFD_RELOC_860_PC16 469877298SobrienENUMX 469977298Sobrien BFD_RELOC_860_LOW0 470077298SobrienENUMX 470177298Sobrien BFD_RELOC_860_SPLIT0 470277298SobrienENUMX 470377298Sobrien BFD_RELOC_860_LOW1 470477298SobrienENUMX 470577298Sobrien BFD_RELOC_860_SPLIT1 470677298SobrienENUMX 470777298Sobrien BFD_RELOC_860_LOW2 470877298SobrienENUMX 470977298Sobrien BFD_RELOC_860_SPLIT2 471077298SobrienENUMX 471177298Sobrien BFD_RELOC_860_LOW3 471277298SobrienENUMX 471377298Sobrien BFD_RELOC_860_LOGOT0 471477298SobrienENUMX 471577298Sobrien BFD_RELOC_860_SPGOT0 471677298SobrienENUMX 471777298Sobrien BFD_RELOC_860_LOGOT1 471877298SobrienENUMX 471977298Sobrien BFD_RELOC_860_SPGOT1 472077298SobrienENUMX 472177298Sobrien BFD_RELOC_860_LOGOTOFF0 472277298SobrienENUMX 472377298Sobrien BFD_RELOC_860_SPGOTOFF0 472477298SobrienENUMX 472577298Sobrien BFD_RELOC_860_LOGOTOFF1 472677298SobrienENUMX 472777298Sobrien BFD_RELOC_860_SPGOTOFF1 472877298SobrienENUMX 472977298Sobrien BFD_RELOC_860_LOGOTOFF2 473077298SobrienENUMX 473177298Sobrien BFD_RELOC_860_LOGOTOFF3 473277298SobrienENUMX 473377298Sobrien BFD_RELOC_860_LOPC 473477298SobrienENUMX 473577298Sobrien BFD_RELOC_860_HIGHADJ 473677298SobrienENUMX 473777298Sobrien BFD_RELOC_860_HAGOT 473877298SobrienENUMX 473977298Sobrien BFD_RELOC_860_HAGOTOFF 474077298SobrienENUMX 474177298Sobrien BFD_RELOC_860_HAPC 474277298SobrienENUMX 474377298Sobrien BFD_RELOC_860_HIGH 474477298SobrienENUMX 474577298Sobrien BFD_RELOC_860_HIGOT 474677298SobrienENUMX 474777298Sobrien BFD_RELOC_860_HIGOTOFF 474877298SobrienENUMDOC 474977298Sobrien Intel i860 Relocations. 475077298Sobrien 475189857SobrienENUM 475289857Sobrien BFD_RELOC_OPENRISC_ABS_26 475389857SobrienENUMX 475489857Sobrien BFD_RELOC_OPENRISC_REL_26 475589857SobrienENUMDOC 475689857Sobrien OpenRISC Relocations. 475789857Sobrien 475889857SobrienENUM 475989857Sobrien BFD_RELOC_H8_DIR16A8 476089857SobrienENUMX 476189857Sobrien BFD_RELOC_H8_DIR16R8 476289857SobrienENUMX 476389857Sobrien BFD_RELOC_H8_DIR24A8 476489857SobrienENUMX 476589857Sobrien BFD_RELOC_H8_DIR24R8 476689857SobrienENUMX 476789857Sobrien BFD_RELOC_H8_DIR32A16 476889857SobrienENUMDOC 476989857Sobrien H8 elf Relocations. 477089857Sobrien 477189857SobrienENUM 477289857Sobrien BFD_RELOC_XSTORMY16_REL_12 477389857SobrienENUMX 4774130561Sobrien BFD_RELOC_XSTORMY16_12 4775130561SobrienENUMX 477689857Sobrien BFD_RELOC_XSTORMY16_24 477789857SobrienENUMX 477889857Sobrien BFD_RELOC_XSTORMY16_FPTR16 477989857SobrienENUMDOC 478089857Sobrien Sony Xstormy16 Relocations. 478189857Sobrien 4782104834SobrienENUM 4783218822Sdim BFD_RELOC_RELC 4784218822SdimENUMDOC 4785218822Sdim Self-describing complex relocations. 4786218822SdimCOMMENT 4787218822Sdim 4788218822SdimENUM 4789218822Sdim BFD_RELOC_XC16X_PAG 4790218822SdimENUMX 4791218822Sdim BFD_RELOC_XC16X_POF 4792218822SdimENUMX 4793218822Sdim BFD_RELOC_XC16X_SEG 4794218822SdimENUMX 4795218822Sdim BFD_RELOC_XC16X_SOF 4796218822SdimENUMDOC 4797218822Sdim Infineon Relocations. 4798218822Sdim 4799218822SdimENUM 4800104834Sobrien BFD_RELOC_VAX_GLOB_DAT 4801104834SobrienENUMX 4802104834Sobrien BFD_RELOC_VAX_JMP_SLOT 4803104834SobrienENUMX 4804104834Sobrien BFD_RELOC_VAX_RELATIVE 4805104834SobrienENUMDOC 4806104834Sobrien Relocations used by VAX ELF. 4807218822Sdim 4808130561SobrienENUM 4809218822Sdim BFD_RELOC_MT_PC16 4810218822SdimENUMDOC 4811218822Sdim Morpho MT - 16 bit immediate relocation. 4812218822SdimENUM 4813218822Sdim BFD_RELOC_MT_HI16 4814218822SdimENUMDOC 4815218822Sdim Morpho MT - Hi 16 bits of an address. 4816218822SdimENUM 4817218822Sdim BFD_RELOC_MT_LO16 4818218822SdimENUMDOC 4819218822Sdim Morpho MT - Low 16 bits of an address. 4820218822SdimENUM 4821218822Sdim BFD_RELOC_MT_GNU_VTINHERIT 4822218822SdimENUMDOC 4823218822Sdim Morpho MT - Used to tell the linker which vtable entries are used. 4824218822SdimENUM 4825218822Sdim BFD_RELOC_MT_GNU_VTENTRY 4826218822SdimENUMDOC 4827218822Sdim Morpho MT - Used to tell the linker which vtable entries are used. 4828218822SdimENUM 4829218822Sdim BFD_RELOC_MT_PCINSN8 4830218822SdimENUMDOC 4831218822Sdim Morpho MT - 8 bit immediate relocation. 4832218822Sdim 4833218822SdimENUM 4834130561Sobrien BFD_RELOC_MSP430_10_PCREL 4835130561SobrienENUMX 4836130561Sobrien BFD_RELOC_MSP430_16_PCREL 4837130561SobrienENUMX 4838130561Sobrien BFD_RELOC_MSP430_16 4839130561SobrienENUMX 4840130561Sobrien BFD_RELOC_MSP430_16_PCREL_BYTE 4841130561SobrienENUMX 4842130561Sobrien BFD_RELOC_MSP430_16_BYTE 4843218822SdimENUMX 4844218822Sdim BFD_RELOC_MSP430_2X_PCREL 4845218822SdimENUMX 4846218822Sdim BFD_RELOC_MSP430_RL_PCREL 4847130561SobrienENUMDOC 4848130561Sobrien msp430 specific relocation codes 4849104834Sobrien 4850130561SobrienENUM 4851130561Sobrien BFD_RELOC_IQ2000_OFFSET_16 4852130561SobrienENUMX 4853130561Sobrien BFD_RELOC_IQ2000_OFFSET_21 4854130561SobrienENUMX 4855130561Sobrien BFD_RELOC_IQ2000_UHI16 4856130561SobrienENUMDOC 4857130561Sobrien IQ2000 Relocations. 4858130561Sobrien 4859130561SobrienENUM 4860130561Sobrien BFD_RELOC_XTENSA_RTLD 4861130561SobrienENUMDOC 4862130561Sobrien Special Xtensa relocation used only by PLT entries in ELF shared 4863130561Sobrien objects to indicate that the runtime linker should set the value 4864130561Sobrien to one of its own internal functions or data structures. 4865130561SobrienENUM 4866130561Sobrien BFD_RELOC_XTENSA_GLOB_DAT 4867130561SobrienENUMX 4868130561Sobrien BFD_RELOC_XTENSA_JMP_SLOT 4869130561SobrienENUMX 4870130561Sobrien BFD_RELOC_XTENSA_RELATIVE 4871130561SobrienENUMDOC 4872130561Sobrien Xtensa relocations for ELF shared objects. 4873130561SobrienENUM 4874130561Sobrien BFD_RELOC_XTENSA_PLT 4875130561SobrienENUMDOC 4876130561Sobrien Xtensa relocation used in ELF object files for symbols that may require 4877130561Sobrien PLT entries. Otherwise, this is just a generic 32-bit relocation. 4878130561SobrienENUM 4879218822Sdim BFD_RELOC_XTENSA_DIFF8 4880218822SdimENUMX 4881218822Sdim BFD_RELOC_XTENSA_DIFF16 4882218822SdimENUMX 4883218822Sdim BFD_RELOC_XTENSA_DIFF32 4884218822SdimENUMDOC 4885218822Sdim Xtensa relocations to mark the difference of two local symbols. 4886218822Sdim These are only needed to support linker relaxation and can be ignored 4887218822Sdim when not relaxing. The field is set to the value of the difference 4888218822Sdim assuming no relaxation. The relocation encodes the position of the 4889218822Sdim first symbol so the linker can determine whether to adjust the field 4890218822Sdim value. 4891218822SdimENUM 4892218822Sdim BFD_RELOC_XTENSA_SLOT0_OP 4893218822SdimENUMX 4894218822Sdim BFD_RELOC_XTENSA_SLOT1_OP 4895218822SdimENUMX 4896218822Sdim BFD_RELOC_XTENSA_SLOT2_OP 4897218822SdimENUMX 4898218822Sdim BFD_RELOC_XTENSA_SLOT3_OP 4899218822SdimENUMX 4900218822Sdim BFD_RELOC_XTENSA_SLOT4_OP 4901218822SdimENUMX 4902218822Sdim BFD_RELOC_XTENSA_SLOT5_OP 4903218822SdimENUMX 4904218822Sdim BFD_RELOC_XTENSA_SLOT6_OP 4905218822SdimENUMX 4906218822Sdim BFD_RELOC_XTENSA_SLOT7_OP 4907218822SdimENUMX 4908218822Sdim BFD_RELOC_XTENSA_SLOT8_OP 4909218822SdimENUMX 4910218822Sdim BFD_RELOC_XTENSA_SLOT9_OP 4911218822SdimENUMX 4912218822Sdim BFD_RELOC_XTENSA_SLOT10_OP 4913218822SdimENUMX 4914218822Sdim BFD_RELOC_XTENSA_SLOT11_OP 4915218822SdimENUMX 4916218822Sdim BFD_RELOC_XTENSA_SLOT12_OP 4917218822SdimENUMX 4918218822Sdim BFD_RELOC_XTENSA_SLOT13_OP 4919218822SdimENUMX 4920218822Sdim BFD_RELOC_XTENSA_SLOT14_OP 4921218822SdimENUMDOC 4922218822Sdim Generic Xtensa relocations for instruction operands. Only the slot 4923218822Sdim number is encoded in the relocation. The relocation applies to the 4924218822Sdim last PC-relative immediate operand, or if there are no PC-relative 4925218822Sdim immediates, to the last immediate operand. 4926218822SdimENUM 4927218822Sdim BFD_RELOC_XTENSA_SLOT0_ALT 4928218822SdimENUMX 4929218822Sdim BFD_RELOC_XTENSA_SLOT1_ALT 4930218822SdimENUMX 4931218822Sdim BFD_RELOC_XTENSA_SLOT2_ALT 4932218822SdimENUMX 4933218822Sdim BFD_RELOC_XTENSA_SLOT3_ALT 4934218822SdimENUMX 4935218822Sdim BFD_RELOC_XTENSA_SLOT4_ALT 4936218822SdimENUMX 4937218822Sdim BFD_RELOC_XTENSA_SLOT5_ALT 4938218822SdimENUMX 4939218822Sdim BFD_RELOC_XTENSA_SLOT6_ALT 4940218822SdimENUMX 4941218822Sdim BFD_RELOC_XTENSA_SLOT7_ALT 4942218822SdimENUMX 4943218822Sdim BFD_RELOC_XTENSA_SLOT8_ALT 4944218822SdimENUMX 4945218822Sdim BFD_RELOC_XTENSA_SLOT9_ALT 4946218822SdimENUMX 4947218822Sdim BFD_RELOC_XTENSA_SLOT10_ALT 4948218822SdimENUMX 4949218822Sdim BFD_RELOC_XTENSA_SLOT11_ALT 4950218822SdimENUMX 4951218822Sdim BFD_RELOC_XTENSA_SLOT12_ALT 4952218822SdimENUMX 4953218822Sdim BFD_RELOC_XTENSA_SLOT13_ALT 4954218822SdimENUMX 4955218822Sdim BFD_RELOC_XTENSA_SLOT14_ALT 4956218822SdimENUMDOC 4957218822Sdim Alternate Xtensa relocations. Only the slot is encoded in the 4958218822Sdim relocation. The meaning of these relocations is opcode-specific. 4959218822SdimENUM 4960130561Sobrien BFD_RELOC_XTENSA_OP0 4961130561SobrienENUMX 4962130561Sobrien BFD_RELOC_XTENSA_OP1 4963130561SobrienENUMX 4964130561Sobrien BFD_RELOC_XTENSA_OP2 4965130561SobrienENUMDOC 4966218822Sdim Xtensa relocations for backward compatibility. These have all been 4967218822Sdim replaced by BFD_RELOC_XTENSA_SLOT0_OP. 4968130561SobrienENUM 4969130561Sobrien BFD_RELOC_XTENSA_ASM_EXPAND 4970130561SobrienENUMDOC 4971218822Sdim Xtensa relocation to mark that the assembler expanded the 4972130561Sobrien instructions from an original target. The expansion size is 4973130561Sobrien encoded in the reloc size. 4974130561SobrienENUM 4975130561Sobrien BFD_RELOC_XTENSA_ASM_SIMPLIFY 4976130561SobrienENUMDOC 4977218822Sdim Xtensa relocation to mark that the linker should simplify 4978218822Sdim assembler-expanded instructions. This is commonly used 4979218822Sdim internally by the linker after analysis of a 4980130561Sobrien BFD_RELOC_XTENSA_ASM_EXPAND. 4981130561Sobrien 4982218822SdimENUM 4983218822Sdim BFD_RELOC_Z80_DISP8 4984218822SdimENUMDOC 4985218822Sdim 8 bit signed offset in (ix+d) or (iy+d). 4986218822Sdim 4987218822SdimENUM 4988218822Sdim BFD_RELOC_Z8K_DISP7 4989218822SdimENUMDOC 4990218822Sdim DJNZ offset. 4991218822SdimENUM 4992218822Sdim BFD_RELOC_Z8K_CALLR 4993218822SdimENUMDOC 4994218822Sdim CALR offset. 4995218822SdimENUM 4996218822Sdim BFD_RELOC_Z8K_IMM4L 4997218822SdimENUMDOC 4998218822Sdim 4 bit value. 4999218822Sdim 500033965SjdpENDSENUM 500133965Sjdp BFD_RELOC_UNUSED 500233965SjdpCODE_FRAGMENT 500333965Sjdp. 500433965Sjdp.typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; 500533965Sjdp*/ 500633965Sjdp 500733965Sjdp/* 500833965SjdpFUNCTION 500933965Sjdp bfd_reloc_type_lookup 5010218822Sdim bfd_reloc_name_lookup 501133965Sjdp 501233965SjdpSYNOPSIS 5013130561Sobrien reloc_howto_type *bfd_reloc_type_lookup 5014130561Sobrien (bfd *abfd, bfd_reloc_code_real_type code); 5015218822Sdim reloc_howto_type *bfd_reloc_name_lookup 5016218822Sdim (bfd *abfd, const char *reloc_name); 501733965Sjdp 501833965SjdpDESCRIPTION 501933965Sjdp Return a pointer to a howto structure which, when 502033965Sjdp invoked, will perform the relocation @var{code} on data from the 502133965Sjdp architecture noted. 502233965Sjdp 502333965Sjdp*/ 502433965Sjdp 502533965Sjdpreloc_howto_type * 5026130561Sobrienbfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) 502733965Sjdp{ 502833965Sjdp return BFD_SEND (abfd, reloc_type_lookup, (abfd, code)); 502933965Sjdp} 503033965Sjdp 5031218822Sdimreloc_howto_type * 5032218822Sdimbfd_reloc_name_lookup (bfd *abfd, const char *reloc_name) 5033218822Sdim{ 5034218822Sdim return BFD_SEND (abfd, reloc_name_lookup, (abfd, reloc_name)); 5035218822Sdim} 5036218822Sdim 503733965Sjdpstatic reloc_howto_type bfd_howto_32 = 5038218822SdimHOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_dont, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE); 503933965Sjdp 504033965Sjdp/* 504133965SjdpINTERNAL_FUNCTION 504233965Sjdp bfd_default_reloc_type_lookup 504333965Sjdp 504433965SjdpSYNOPSIS 504533965Sjdp reloc_howto_type *bfd_default_reloc_type_lookup 5046130561Sobrien (bfd *abfd, bfd_reloc_code_real_type code); 504733965Sjdp 504833965SjdpDESCRIPTION 504933965Sjdp Provides a default relocation lookup routine for any architecture. 505033965Sjdp 505133965Sjdp*/ 505233965Sjdp 505333965Sjdpreloc_howto_type * 5054130561Sobrienbfd_default_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) 505533965Sjdp{ 505633965Sjdp switch (code) 505733965Sjdp { 505833965Sjdp case BFD_RELOC_CTOR: 505933965Sjdp /* The type of reloc used in a ctor, which will be as wide as the 506033965Sjdp address - so either a 64, 32, or 16 bitter. */ 506133965Sjdp switch (bfd_get_arch_info (abfd)->bits_per_address) 506233965Sjdp { 506333965Sjdp case 64: 506433965Sjdp BFD_FAIL (); 506533965Sjdp case 32: 506633965Sjdp return &bfd_howto_32; 506733965Sjdp case 16: 506833965Sjdp BFD_FAIL (); 506933965Sjdp default: 507033965Sjdp BFD_FAIL (); 507133965Sjdp } 507233965Sjdp default: 507333965Sjdp BFD_FAIL (); 507433965Sjdp } 5075130561Sobrien return NULL; 507633965Sjdp} 507733965Sjdp 507833965Sjdp/* 507933965SjdpFUNCTION 508033965Sjdp bfd_get_reloc_code_name 508133965Sjdp 508233965SjdpSYNOPSIS 508333965Sjdp const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); 508433965Sjdp 508533965SjdpDESCRIPTION 508633965Sjdp Provides a printable name for the supplied relocation code. 508733965Sjdp Useful mainly for printing error messages. 508833965Sjdp*/ 508933965Sjdp 509033965Sjdpconst char * 5091130561Sobrienbfd_get_reloc_code_name (bfd_reloc_code_real_type code) 509233965Sjdp{ 5093130561Sobrien if (code > BFD_RELOC_UNUSED) 509433965Sjdp return 0; 5095130561Sobrien return bfd_reloc_code_real_names[code]; 509633965Sjdp} 509733965Sjdp 509833965Sjdp/* 509933965SjdpINTERNAL_FUNCTION 510033965Sjdp bfd_generic_relax_section 510133965Sjdp 510233965SjdpSYNOPSIS 5103130561Sobrien bfd_boolean bfd_generic_relax_section 5104130561Sobrien (bfd *abfd, 5105130561Sobrien asection *section, 5106130561Sobrien struct bfd_link_info *, 5107130561Sobrien bfd_boolean *); 510833965Sjdp 510933965SjdpDESCRIPTION 511033965Sjdp Provides default handling for relaxing for back ends which 5111218822Sdim don't do relaxing. 511233965Sjdp*/ 511333965Sjdp 5114130561Sobrienbfd_boolean 5115130561Sobrienbfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, 5116130561Sobrien asection *section ATTRIBUTE_UNUSED, 5117130561Sobrien struct bfd_link_info *link_info ATTRIBUTE_UNUSED, 5118130561Sobrien bfd_boolean *again) 511933965Sjdp{ 5120130561Sobrien *again = FALSE; 5121130561Sobrien return TRUE; 512233965Sjdp} 512333965Sjdp 512433965Sjdp/* 512533965SjdpINTERNAL_FUNCTION 512660484Sobrien bfd_generic_gc_sections 512760484Sobrien 512860484SobrienSYNOPSIS 5129130561Sobrien bfd_boolean bfd_generic_gc_sections 5130130561Sobrien (bfd *, struct bfd_link_info *); 513160484Sobrien 513260484SobrienDESCRIPTION 513360484Sobrien Provides default handling for relaxing for back ends which 513460484Sobrien don't do section gc -- i.e., does nothing. 513560484Sobrien*/ 513660484Sobrien 5137130561Sobrienbfd_boolean 5138130561Sobrienbfd_generic_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, 5139218822Sdim struct bfd_link_info *info ATTRIBUTE_UNUSED) 514060484Sobrien{ 5141130561Sobrien return TRUE; 514260484Sobrien} 514360484Sobrien 514460484Sobrien/* 514560484SobrienINTERNAL_FUNCTION 514689857Sobrien bfd_generic_merge_sections 514789857Sobrien 514889857SobrienSYNOPSIS 5149130561Sobrien bfd_boolean bfd_generic_merge_sections 5150130561Sobrien (bfd *, struct bfd_link_info *); 515189857Sobrien 515289857SobrienDESCRIPTION 515389857Sobrien Provides default handling for SEC_MERGE section merging for back ends 515489857Sobrien which don't have SEC_MERGE support -- i.e., does nothing. 515589857Sobrien*/ 515689857Sobrien 5157130561Sobrienbfd_boolean 5158130561Sobrienbfd_generic_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, 5159130561Sobrien struct bfd_link_info *link_info ATTRIBUTE_UNUSED) 516089857Sobrien{ 5161130561Sobrien return TRUE; 516289857Sobrien} 516389857Sobrien 516489857Sobrien/* 516589857SobrienINTERNAL_FUNCTION 516633965Sjdp bfd_generic_get_relocated_section_contents 516733965Sjdp 516833965SjdpSYNOPSIS 5169130561Sobrien bfd_byte *bfd_generic_get_relocated_section_contents 5170130561Sobrien (bfd *abfd, 5171130561Sobrien struct bfd_link_info *link_info, 5172130561Sobrien struct bfd_link_order *link_order, 5173130561Sobrien bfd_byte *data, 5174130561Sobrien bfd_boolean relocatable, 5175130561Sobrien asymbol **symbols); 517633965Sjdp 517733965SjdpDESCRIPTION 517833965Sjdp Provides default handling of relocation effort for back ends 517933965Sjdp which can't be bothered to do it efficiently. 518033965Sjdp 518133965Sjdp*/ 518233965Sjdp 518333965Sjdpbfd_byte * 5184130561Sobrienbfd_generic_get_relocated_section_contents (bfd *abfd, 5185130561Sobrien struct bfd_link_info *link_info, 5186130561Sobrien struct bfd_link_order *link_order, 5187130561Sobrien bfd_byte *data, 5188130561Sobrien bfd_boolean relocatable, 5189130561Sobrien asymbol **symbols) 519033965Sjdp{ 519191041Sobrien /* Get enough memory to hold the stuff. */ 519233965Sjdp bfd *input_bfd = link_order->u.indirect.section->owner; 519333965Sjdp asection *input_section = link_order->u.indirect.section; 519433965Sjdp 519533965Sjdp long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); 519633965Sjdp arelent **reloc_vector = NULL; 519733965Sjdp long reloc_count; 5198218822Sdim bfd_size_type sz; 519933965Sjdp 520033965Sjdp if (reloc_size < 0) 520133965Sjdp goto error_return; 520233965Sjdp 5203130561Sobrien reloc_vector = bfd_malloc (reloc_size); 520433965Sjdp if (reloc_vector == NULL && reloc_size != 0) 520533965Sjdp goto error_return; 520633965Sjdp 520791041Sobrien /* Read in the section. */ 5208218822Sdim sz = input_section->rawsize ? input_section->rawsize : input_section->size; 5209218822Sdim if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz)) 521033965Sjdp goto error_return; 521133965Sjdp 521233965Sjdp reloc_count = bfd_canonicalize_reloc (input_bfd, 521333965Sjdp input_section, 521433965Sjdp reloc_vector, 521533965Sjdp symbols); 521633965Sjdp if (reloc_count < 0) 521733965Sjdp goto error_return; 521833965Sjdp 521933965Sjdp if (reloc_count > 0) 522033965Sjdp { 522133965Sjdp arelent **parent; 5222130561Sobrien for (parent = reloc_vector; *parent != NULL; parent++) 522333965Sjdp { 5224130561Sobrien char *error_message = NULL; 5225218822Sdim asymbol *symbol; 5226218822Sdim bfd_reloc_status_type r; 522733965Sjdp 5228218822Sdim symbol = *(*parent)->sym_ptr_ptr; 5229218822Sdim if (symbol->section && elf_discarded_section (symbol->section)) 5230218822Sdim { 5231218822Sdim bfd_byte *p; 5232218822Sdim static reloc_howto_type none_howto 5233218822Sdim = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, 5234218822Sdim "unused", FALSE, 0, 0, FALSE); 5235218822Sdim 5236218822Sdim p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); 5237218822Sdim _bfd_clear_contents ((*parent)->howto, input_bfd, p); 5238218822Sdim (*parent)->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr; 5239218822Sdim (*parent)->addend = 0; 5240218822Sdim (*parent)->howto = &none_howto; 5241218822Sdim r = bfd_reloc_ok; 5242218822Sdim } 5243218822Sdim else 5244218822Sdim r = bfd_perform_relocation (input_bfd, 5245218822Sdim *parent, 5246218822Sdim data, 5247218822Sdim input_section, 5248218822Sdim relocatable ? abfd : NULL, 5249218822Sdim &error_message); 5250218822Sdim 5251130561Sobrien if (relocatable) 525233965Sjdp { 525333965Sjdp asection *os = input_section->output_section; 525433965Sjdp 525591041Sobrien /* A partial link, so keep the relocs. */ 525633965Sjdp os->orelocation[os->reloc_count] = *parent; 525733965Sjdp os->reloc_count++; 525833965Sjdp } 525933965Sjdp 526033965Sjdp if (r != bfd_reloc_ok) 526133965Sjdp { 526233965Sjdp switch (r) 526333965Sjdp { 526433965Sjdp case bfd_reloc_undefined: 526533965Sjdp if (!((*link_info->callbacks->undefined_symbol) 526633965Sjdp (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), 526760484Sobrien input_bfd, input_section, (*parent)->address, 5268130561Sobrien TRUE))) 526933965Sjdp goto error_return; 527033965Sjdp break; 527133965Sjdp case bfd_reloc_dangerous: 5272130561Sobrien BFD_ASSERT (error_message != NULL); 527333965Sjdp if (!((*link_info->callbacks->reloc_dangerous) 527433965Sjdp (link_info, error_message, input_bfd, input_section, 527533965Sjdp (*parent)->address))) 527633965Sjdp goto error_return; 527733965Sjdp break; 527833965Sjdp case bfd_reloc_overflow: 527933965Sjdp if (!((*link_info->callbacks->reloc_overflow) 5280218822Sdim (link_info, NULL, 5281218822Sdim bfd_asymbol_name (*(*parent)->sym_ptr_ptr), 528233965Sjdp (*parent)->howto->name, (*parent)->addend, 528333965Sjdp input_bfd, input_section, (*parent)->address))) 528433965Sjdp goto error_return; 528533965Sjdp break; 528633965Sjdp case bfd_reloc_outofrange: 528733965Sjdp default: 528833965Sjdp abort (); 528933965Sjdp break; 529033965Sjdp } 529133965Sjdp 529233965Sjdp } 529333965Sjdp } 529433965Sjdp } 529533965Sjdp if (reloc_vector != NULL) 529633965Sjdp free (reloc_vector); 529733965Sjdp return data; 529833965Sjdp 529933965Sjdperror_return: 530033965Sjdp if (reloc_vector != NULL) 530133965Sjdp free (reloc_vector); 530233965Sjdp return NULL; 530333965Sjdp} 5304