00001 /* 00002 * Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* BFD support for handling relocation entries. 00006 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 00007 2000, 2001, 2002, 2003, 2004, 2005 00008 Free Software Foundation, Inc. 00009 Written by Cygnus Support. 00010 00011 This file is part of BFD, the Binary File Descriptor library. 00012 00013 This program is free software; you can redistribute it and/or modify 00014 it under the terms of the GNU General Public License as published by 00015 the Free Software Foundation; either version 2 of the License, or 00016 (at your option) any later version. 00017 00018 This program is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with this program; if not, write to the Free Software 00025 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00026 00027 /* 00028 SECTION 00029 Relocations 00030 00031 BFD maintains relocations in much the same way it maintains 00032 symbols: they are left alone until required, then read in 00033 en-masse and translated into an internal form. A common 00034 routine <<bfd_perform_relocation>> acts upon the 00035 canonical form to do the fixup. 00036 00037 Relocations are maintained on a per section basis, 00038 while symbols are maintained on a per BFD basis. 00039 00040 All that a back end has to do to fit the BFD interface is to create 00041 a <<struct reloc_cache_entry>> for each relocation 00042 in a particular section, and fill in the right bits of the structures. 00043 00044 @menu 00045 @* typedef arelent:: 00046 @* howto manager:: 00047 @end menu 00048 00049 */ 00050 00051 /* DO compile in the reloc_code name table from libbfd.h. */ 00052 #define _BFD_MAKE_TABLE_bfd_reloc_code_real 00053 00054 #include "bfd.h" 00055 #include "sysdep.h" 00056 #include "bfdlink.h" 00057 #include "libbfd.h" 00058 /* 00059 DOCDD 00060 INODE 00061 typedef arelent, howto manager, Relocations, Relocations 00062 00063 SUBSECTION 00064 typedef arelent 00065 00066 This is the structure of a relocation entry: 00067 00068 CODE_FRAGMENT 00069 . 00070 .typedef enum bfd_reloc_status 00071 .{ 00072 . {* No errors detected. *} 00073 . bfd_reloc_ok, 00074 . 00075 . {* The relocation was performed, but there was an overflow. *} 00076 . bfd_reloc_overflow, 00077 . 00078 . {* The address to relocate was not within the section supplied. *} 00079 . bfd_reloc_outofrange, 00080 . 00081 . {* Used by special functions. *} 00082 . bfd_reloc_continue, 00083 . 00084 . {* Unsupported relocation size requested. *} 00085 . bfd_reloc_notsupported, 00086 . 00087 . {* Unused. *} 00088 . bfd_reloc_other, 00089 . 00090 . {* The symbol to relocate against was undefined. *} 00091 . bfd_reloc_undefined, 00092 . 00093 . {* The relocation was performed, but may not be ok - presently 00094 . generated only when linking i960 coff files with i960 b.out 00095 . symbols. If this type is returned, the error_message argument 00096 . to bfd_perform_relocation will be set. *} 00097 . bfd_reloc_dangerous 00098 . } 00099 . bfd_reloc_status_type; 00100 . 00101 . 00102 .typedef struct reloc_cache_entry 00103 .{ 00104 . {* A pointer into the canonical table of pointers. *} 00105 . struct bfd_symbol **sym_ptr_ptr; 00106 . 00107 . {* offset in section. *} 00108 . bfd_size_type address; 00109 . 00110 . {* addend for relocation value. *} 00111 . bfd_vma addend; 00112 . 00113 . {* Pointer to how to perform the required relocation. *} 00114 . reloc_howto_type *howto; 00115 . 00116 .} 00117 .arelent; 00118 . 00119 */ 00120 00121 /* 00122 DESCRIPTION 00123 00124 Here is a description of each of the fields within an <<arelent>>: 00125 00126 o <<sym_ptr_ptr>> 00127 00128 The symbol table pointer points to a pointer to the symbol 00129 associated with the relocation request. It is the pointer 00130 into the table returned by the back end's 00131 <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is 00132 referenced through a pointer to a pointer so that tools like 00133 the linker can fix up all the symbols of the same name by 00134 modifying only one pointer. The relocation routine looks in 00135 the symbol and uses the base of the section the symbol is 00136 attached to and the value of the symbol as the initial 00137 relocation offset. If the symbol pointer is zero, then the 00138 section provided is looked up. 00139 00140 o <<address>> 00141 00142 The <<address>> field gives the offset in bytes from the base of 00143 the section data which owns the relocation record to the first 00144 byte of relocatable information. The actual data relocated 00145 will be relative to this point; for example, a relocation 00146 type which modifies the bottom two bytes of a four byte word 00147 would not touch the first byte pointed to in a big endian 00148 world. 00149 00150 o <<addend>> 00151 00152 The <<addend>> is a value provided by the back end to be added (!) 00153 to the relocation offset. Its interpretation is dependent upon 00154 the howto. For example, on the 68k the code: 00155 00156 | char foo[]; 00157 | main() 00158 | { 00159 | return foo[0x12345678]; 00160 | } 00161 00162 Could be compiled into: 00163 00164 | linkw fp,#-4 00165 | moveb @@#12345678,d0 00166 | extbl d0 00167 | unlk fp 00168 | rts 00169 00170 This could create a reloc pointing to <<foo>>, but leave the 00171 offset in the data, something like: 00172 00173 |RELOCATION RECORDS FOR [.text]: 00174 |offset type value 00175 |00000006 32 _foo 00176 | 00177 |00000000 4e56 fffc ; linkw fp,#-4 00178 |00000004 1039 1234 5678 ; moveb @@#12345678,d0 00179 |0000000a 49c0 ; extbl d0 00180 |0000000c 4e5e ; unlk fp 00181 |0000000e 4e75 ; rts 00182 00183 Using coff and an 88k, some instructions don't have enough 00184 space in them to represent the full address range, and 00185 pointers have to be loaded in two parts. So you'd get something like: 00186 00187 | or.u r13,r0,hi16(_foo+0x12345678) 00188 | ld.b r2,r13,lo16(_foo+0x12345678) 00189 | jmp r1 00190 00191 This should create two relocs, both pointing to <<_foo>>, and with 00192 0x12340000 in their addend field. The data would consist of: 00193 00194 |RELOCATION RECORDS FOR [.text]: 00195 |offset type value 00196 |00000002 HVRT16 _foo+0x12340000 00197 |00000006 LVRT16 _foo+0x12340000 00198 | 00199 |00000000 5da05678 ; or.u r13,r0,0x5678 00200 |00000004 1c4d5678 ; ld.b r2,r13,0x5678 00201 |00000008 f400c001 ; jmp r1 00202 00203 The relocation routine digs out the value from the data, adds 00204 it to the addend to get the original offset, and then adds the 00205 value of <<_foo>>. Note that all 32 bits have to be kept around 00206 somewhere, to cope with carry from bit 15 to bit 16. 00207 00208 One further example is the sparc and the a.out format. The 00209 sparc has a similar problem to the 88k, in that some 00210 instructions don't have room for an entire offset, but on the 00211 sparc the parts are created in odd sized lumps. The designers of 00212 the a.out format chose to not use the data within the section 00213 for storing part of the offset; all the offset is kept within 00214 the reloc. Anything in the data should be ignored. 00215 00216 | save %sp,-112,%sp 00217 | sethi %hi(_foo+0x12345678),%g2 00218 | ldsb [%g2+%lo(_foo+0x12345678)],%i0 00219 | ret 00220 | restore 00221 00222 Both relocs contain a pointer to <<foo>>, and the offsets 00223 contain junk. 00224 00225 |RELOCATION RECORDS FOR [.text]: 00226 |offset type value 00227 |00000004 HI22 _foo+0x12345678 00228 |00000008 LO10 _foo+0x12345678 00229 | 00230 |00000000 9de3bf90 ; save %sp,-112,%sp 00231 |00000004 05000000 ; sethi %hi(_foo+0),%g2 00232 |00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 00233 |0000000c 81c7e008 ; ret 00234 |00000010 81e80000 ; restore 00235 00236 o <<howto>> 00237 00238 The <<howto>> field can be imagined as a 00239 relocation instruction. It is a pointer to a structure which 00240 contains information on what to do with all of the other 00241 information in the reloc record and data section. A back end 00242 would normally have a relocation instruction set and turn 00243 relocations into pointers to the correct structure on input - 00244 but it would be possible to create each howto field on demand. 00245 00246 */ 00247 00248 /* 00249 SUBSUBSECTION 00250 <<enum complain_overflow>> 00251 00252 Indicates what sort of overflow checking should be done when 00253 performing a relocation. 00254 00255 CODE_FRAGMENT 00256 . 00257 .enum complain_overflow 00258 .{ 00259 . {* Do not complain on overflow. *} 00260 . complain_overflow_dont, 00261 . 00262 . {* Complain if the bitfield overflows, whether it is considered 00263 . as signed or unsigned. *} 00264 . complain_overflow_bitfield, 00265 . 00266 . {* Complain if the value overflows when considered as signed 00267 . number. *} 00268 . complain_overflow_signed, 00269 . 00270 . {* Complain if the value overflows when considered as an 00271 . unsigned number. *} 00272 . complain_overflow_unsigned 00273 .}; 00274 00275 */ 00276 00277 /* 00278 SUBSUBSECTION 00279 <<reloc_howto_type>> 00280 00281 The <<reloc_howto_type>> is a structure which contains all the 00282 information that libbfd needs to know to tie up a back end's data. 00283 00284 CODE_FRAGMENT 00285 .struct bfd_symbol; {* Forward declaration. *} 00286 . 00287 .struct reloc_howto_struct 00288 .{ 00289 . {* The type field has mainly a documentary use - the back end can 00290 . do what it wants with it, though normally the back end's 00291 . external idea of what a reloc number is stored 00292 . in this field. For example, a PC relative word relocation 00293 . in a coff environment has the type 023 - because that's 00294 . what the outside world calls a R_PCRWORD reloc. *} 00295 . unsigned int type; 00296 . 00297 . {* The value the final relocation is shifted right by. This drops 00298 . unwanted data from the relocation. *} 00299 . unsigned int rightshift; 00300 . 00301 . {* The size of the item to be relocated. This is *not* a 00302 . power-of-two measure. To get the number of bytes operated 00303 . on by a type of relocation, use bfd_get_reloc_size. *} 00304 . int size; 00305 . 00306 . {* The number of bits in the item to be relocated. This is used 00307 . when doing overflow checking. *} 00308 . unsigned int bitsize; 00309 . 00310 . {* Notes that the relocation is relative to the location in the 00311 . data section of the addend. The relocation function will 00312 . subtract from the relocation value the address of the location 00313 . being relocated. *} 00314 . bfd_boolean pc_relative; 00315 . 00316 . {* The bit position of the reloc value in the destination. 00317 . The relocated value is left shifted by this amount. *} 00318 . unsigned int bitpos; 00319 . 00320 . {* What type of overflow error should be checked for when 00321 . relocating. *} 00322 . enum complain_overflow complain_on_overflow; 00323 . 00324 . {* If this field is non null, then the supplied function is 00325 . called rather than the normal function. This allows really 00326 . strange relocation methods to be accommodated (e.g., i960 callj 00327 . instructions). *} 00328 . bfd_reloc_status_type (*special_function) 00329 . (bfd *, arelent *, struct bfd_symbol *, void *, asection *, 00330 . bfd *, char **); 00331 . 00332 . {* The textual name of the relocation type. *} 00333 . char *name; 00334 . 00335 . {* Some formats record a relocation addend in the section contents 00336 . rather than with the relocation. For ELF formats this is the 00337 . distinction between USE_REL and USE_RELA (though the code checks 00338 . for USE_REL == 1/0). The value of this field is TRUE if the 00339 . addend is recorded with the section contents; when performing a 00340 . partial link (ld -r) the section contents (the data) will be 00341 . modified. The value of this field is FALSE if addends are 00342 . recorded with the relocation (in arelent.addend); when performing 00343 . a partial link the relocation will be modified. 00344 . All relocations for all ELF USE_RELA targets should set this field 00345 . to FALSE (values of TRUE should be looked on with suspicion). 00346 . However, the converse is not true: not all relocations of all ELF 00347 . USE_REL targets set this field to TRUE. Why this is so is peculiar 00348 . to each particular target. For relocs that aren't used in partial 00349 . links (e.g. GOT stuff) it doesn't matter what this is set to. *} 00350 . bfd_boolean partial_inplace; 00351 . 00352 . {* src_mask selects the part of the instruction (or data) to be used 00353 . in the relocation sum. If the target relocations don't have an 00354 . addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 00355 . dst_mask to extract the addend from the section contents. If 00356 . relocations do have an addend in the reloc, eg. ELF USE_RELA, this 00357 . field should be zero. Non-zero values for ELF USE_RELA targets are 00358 . bogus as in those cases the value in the dst_mask part of the 00359 . section contents should be treated as garbage. *} 00360 . bfd_vma src_mask; 00361 . 00362 . {* dst_mask selects which parts of the instruction (or data) are 00363 . replaced with a relocated value. *} 00364 . bfd_vma dst_mask; 00365 . 00366 . {* When some formats create PC relative instructions, they leave 00367 . the value of the pc of the place being relocated in the offset 00368 . slot of the instruction, so that a PC relative relocation can 00369 . be made just by adding in an ordinary offset (e.g., sun3 a.out). 00370 . Some formats leave the displacement part of an instruction 00371 . empty (e.g., m88k bcs); this flag signals the fact. *} 00372 . bfd_boolean pcrel_offset; 00373 .}; 00374 . 00375 */ 00376 00377 /* 00378 FUNCTION 00379 The HOWTO Macro 00380 00381 DESCRIPTION 00382 The HOWTO define is horrible and will go away. 00383 00384 .#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 00385 . { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 00386 00387 DESCRIPTION 00388 And will be replaced with the totally magic way. But for the 00389 moment, we are compatible, so do it this way. 00390 00391 .#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 00392 . HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 00393 . NAME, FALSE, 0, 0, IN) 00394 . 00395 00396 DESCRIPTION 00397 This is used to fill in an empty howto entry in an array. 00398 00399 .#define EMPTY_HOWTO(C) \ 00400 . HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 00401 . NULL, FALSE, 0, 0, FALSE) 00402 . 00403 00404 DESCRIPTION 00405 Helper routine to turn a symbol into a relocation value. 00406 00407 .#define HOWTO_PREPARE(relocation, symbol) \ 00408 . { \ 00409 . if (symbol != NULL) \ 00410 . { \ 00411 . if (bfd_is_com_section (symbol->section)) \ 00412 . { \ 00413 . relocation = 0; \ 00414 . } \ 00415 . else \ 00416 . { \ 00417 . relocation = symbol->value; \ 00418 . } \ 00419 . } \ 00420 . } 00421 . 00422 */ 00423 00424 /* 00425 FUNCTION 00426 bfd_get_reloc_size 00427 00428 SYNOPSIS 00429 unsigned int bfd_get_reloc_size (reloc_howto_type *); 00430 00431 DESCRIPTION 00432 For a reloc_howto_type that operates on a fixed number of bytes, 00433 this returns the number of bytes operated on. 00434 */ 00435 00436 unsigned int 00437 bfd_get_reloc_size (reloc_howto_type *howto) 00438 { 00439 switch (howto->size) 00440 { 00441 case 0: return 1; 00442 case 1: return 2; 00443 case 2: return 4; 00444 case 3: return 0; 00445 case 4: return 8; 00446 case 8: return 16; 00447 case -2: return 4; 00448 default: abort (); 00449 } 00450 } 00451 00452 /* 00453 TYPEDEF 00454 arelent_chain 00455 00456 DESCRIPTION 00457 00458 How relocs are tied together in an <<asection>>: 00459 00460 .typedef struct relent_chain 00461 .{ 00462 . arelent relent; 00463 . struct relent_chain *next; 00464 .} 00465 .arelent_chain; 00466 . 00467 */ 00468 00469 /* N_ONES produces N one bits, without overflowing machine arithmetic. */ 00470 #define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1) 00471 00472 /* 00473 FUNCTION 00474 bfd_check_overflow 00475 00476 SYNOPSIS 00477 bfd_reloc_status_type bfd_check_overflow 00478 (enum complain_overflow how, 00479 unsigned int bitsize, 00480 unsigned int rightshift, 00481 unsigned int addrsize, 00482 bfd_vma relocation); 00483 00484 DESCRIPTION 00485 Perform overflow checking on @var{relocation} which has 00486 @var{bitsize} significant bits and will be shifted right by 00487 @var{rightshift} bits, on a machine with addresses containing 00488 @var{addrsize} significant bits. The result is either of 00489 @code{bfd_reloc_ok} or @code{bfd_reloc_overflow}. 00490 00491 */ 00492 00493 bfd_reloc_status_type 00494 bfd_check_overflow (enum complain_overflow how, 00495 unsigned int bitsize, 00496 unsigned int rightshift, 00497 unsigned int addrsize, 00498 bfd_vma relocation) 00499 { 00500 bfd_vma fieldmask, addrmask, signmask, ss, a; 00501 bfd_reloc_status_type flag = bfd_reloc_ok; 00502 00503 a = relocation; 00504 00505 /* Note: BITSIZE should always be <= ADDRSIZE, but in case it's not, 00506 we'll be permissive: extra bits in the field mask will 00507 automatically extend the address mask for purposes of the 00508 overflow check. */ 00509 fieldmask = N_ONES (bitsize); 00510 addrmask = N_ONES (addrsize) | fieldmask; 00511 00512 switch (how) 00513 { 00514 case complain_overflow_dont: 00515 break; 00516 00517 case complain_overflow_signed: 00518 /* If any sign bits are set, all sign bits must be set. That 00519 is, A must be a valid negative address after shifting. */ 00520 a = (a & addrmask) >> rightshift; 00521 signmask = ~ (fieldmask >> 1); 00522 ss = a & signmask; 00523 if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) 00524 flag = bfd_reloc_overflow; 00525 break; 00526 00527 case complain_overflow_unsigned: 00528 /* We have an overflow if the address does not fit in the field. */ 00529 a = (a & addrmask) >> rightshift; 00530 if ((a & ~ fieldmask) != 0) 00531 flag = bfd_reloc_overflow; 00532 break; 00533 00534 case complain_overflow_bitfield: 00535 /* Bitfields are sometimes signed, sometimes unsigned. We 00536 explicitly allow an address wrap too, which means a bitfield 00537 of n bits is allowed to store -2**n to 2**n-1. Thus overflow 00538 if the value has some, but not all, bits set outside the 00539 field. */ 00540 a >>= rightshift; 00541 ss = a & ~ fieldmask; 00542 if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & ~ fieldmask)) 00543 flag = bfd_reloc_overflow; 00544 break; 00545 00546 default: 00547 abort (); 00548 } 00549 00550 return flag; 00551 } 00552 00553 /* 00554 FUNCTION 00555 bfd_perform_relocation 00556 00557 SYNOPSIS 00558 bfd_reloc_status_type bfd_perform_relocation 00559 (bfd *abfd, 00560 arelent *reloc_entry, 00561 void *data, 00562 asection *input_section, 00563 bfd *output_bfd, 00564 char **error_message); 00565 00566 DESCRIPTION 00567 If @var{output_bfd} is supplied to this function, the 00568 generated image will be relocatable; the relocations are 00569 copied to the output file after they have been changed to 00570 reflect the new state of the world. There are two ways of 00571 reflecting the results of partial linkage in an output file: 00572 by modifying the output data in place, and by modifying the 00573 relocation record. Some native formats (e.g., basic a.out and 00574 basic coff) have no way of specifying an addend in the 00575 relocation type, so the addend has to go in the output data. 00576 This is no big deal since in these formats the output data 00577 slot will always be big enough for the addend. Complex reloc 00578 types with addends were invented to solve just this problem. 00579 The @var{error_message} argument is set to an error message if 00580 this return @code{bfd_reloc_dangerous}. 00581 00582 */ 00583 00584 bfd_reloc_status_type 00585 bfd_perform_relocation (bfd *abfd, 00586 arelent *reloc_entry, 00587 void *data, 00588 asection *input_section, 00589 bfd *output_bfd, 00590 char **error_message) 00591 { 00592 bfd_vma relocation; 00593 bfd_reloc_status_type flag = bfd_reloc_ok; 00594 bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd); 00595 bfd_vma output_base = 0; 00596 reloc_howto_type *howto = reloc_entry->howto; 00597 asection *reloc_target_output_section; 00598 asymbol *symbol; 00599 00600 symbol = *(reloc_entry->sym_ptr_ptr); 00601 if (bfd_is_abs_section (symbol->section) 00602 && output_bfd != NULL) 00603 { 00604 reloc_entry->address += input_section->output_offset; 00605 return bfd_reloc_ok; 00606 } 00607 00608 /* If we are not producing relocatable output, return an error if 00609 the symbol is not defined. An undefined weak symbol is 00610 considered to have a value of zero (SVR4 ABI, p. 4-27). */ 00611 if (bfd_is_und_section (symbol->section) 00612 && (symbol->flags & BSF_WEAK) == 0 00613 && output_bfd == NULL) 00614 flag = bfd_reloc_undefined; 00615 00616 /* If there is a function supplied to handle this relocation type, 00617 call it. It'll return `bfd_reloc_continue' if further processing 00618 can be done. */ 00619 if (howto->special_function) 00620 { 00621 bfd_reloc_status_type cont; 00622 cont = howto->special_function (abfd, reloc_entry, symbol, data, 00623 input_section, output_bfd, 00624 error_message); 00625 if (cont != bfd_reloc_continue) 00626 return cont; 00627 } 00628 00629 /* Is the address of the relocation really within the section? */ 00630 if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) 00631 return bfd_reloc_outofrange; 00632 00633 /* Work out which section the relocation is targeted at and the 00634 initial relocation command value. */ 00635 00636 /* Get symbol value. (Common symbols are special.) */ 00637 if (bfd_is_com_section (symbol->section)) 00638 relocation = 0; 00639 else 00640 relocation = symbol->value; 00641 00642 reloc_target_output_section = symbol->section->output_section; 00643 00644 /* Convert input-section-relative symbol value to absolute. */ 00645 if ((output_bfd && ! howto->partial_inplace) 00646 || reloc_target_output_section == NULL) 00647 output_base = 0; 00648 else 00649 output_base = reloc_target_output_section->vma; 00650 00651 relocation += output_base + symbol->section->output_offset; 00652 00653 /* Add in supplied addend. */ 00654 relocation += reloc_entry->addend; 00655 00656 /* Here the variable relocation holds the final address of the 00657 symbol we are relocating against, plus any addend. */ 00658 00659 if (howto->pc_relative) 00660 { 00661 /* This is a PC relative relocation. We want to set RELOCATION 00662 to the distance between the address of the symbol and the 00663 location. RELOCATION is already the address of the symbol. 00664 00665 We start by subtracting the address of the section containing 00666 the location. 00667 00668 If pcrel_offset is set, we must further subtract the position 00669 of the location within the section. Some targets arrange for 00670 the addend to be the negative of the position of the location 00671 within the section; for example, i386-aout does this. For 00672 i386-aout, pcrel_offset is FALSE. Some other targets do not 00673 include the position of the location; for example, m88kbcs, 00674 or ELF. For those targets, pcrel_offset is TRUE. 00675 00676 If we are producing relocatable output, then we must ensure 00677 that this reloc will be correctly computed when the final 00678 relocation is done. If pcrel_offset is FALSE we want to wind 00679 up with the negative of the location within the section, 00680 which means we must adjust the existing addend by the change 00681 in the location within the section. If pcrel_offset is TRUE 00682 we do not want to adjust the existing addend at all. 00683 00684 FIXME: This seems logical to me, but for the case of 00685 producing relocatable output it is not what the code 00686 actually does. I don't want to change it, because it seems 00687 far too likely that something will break. */ 00688 00689 relocation -= 00690 input_section->output_section->vma + input_section->output_offset; 00691 00692 if (howto->pcrel_offset) 00693 relocation -= reloc_entry->address; 00694 } 00695 00696 if (output_bfd != NULL) 00697 { 00698 if (! howto->partial_inplace) 00699 { 00700 /* This is a partial relocation, and we want to apply the relocation 00701 to the reloc entry rather than the raw data. Modify the reloc 00702 inplace to reflect what we now know. */ 00703 reloc_entry->addend = relocation; 00704 reloc_entry->address += input_section->output_offset; 00705 return flag; 00706 } 00707 else 00708 { 00709 /* This is a partial relocation, but inplace, so modify the 00710 reloc record a bit. 00711 00712 If we've relocated with a symbol with a section, change 00713 into a ref to the section belonging to the symbol. */ 00714 00715 reloc_entry->address += input_section->output_offset; 00716 00717 /* WTF?? */ 00718 if (abfd->xvec->flavour == bfd_target_coff_flavour 00719 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 00720 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) 00721 { 00722 /* For m68k-coff, the addend was being subtracted twice during 00723 relocation with -r. Removing the line below this comment 00724 fixes that problem; see PR 2953. 00725 00726 However, Ian wrote the following, regarding removing the line below, 00727 which explains why it is still enabled: --djm 00728 00729 If you put a patch like that into BFD you need to check all the COFF 00730 linkers. I am fairly certain that patch will break coff-i386 (e.g., 00731 SCO); see coff_i386_reloc in coff-i386.c where I worked around the 00732 problem in a different way. There may very well be a reason that the 00733 code works as it does. 00734 00735 Hmmm. The first obvious point is that bfd_perform_relocation should 00736 not have any tests that depend upon the flavour. It's seem like 00737 entirely the wrong place for such a thing. The second obvious point 00738 is that the current code ignores the reloc addend when producing 00739 relocatable output for COFF. That's peculiar. In fact, I really 00740 have no idea what the point of the line you want to remove is. 00741 00742 A typical COFF reloc subtracts the old value of the symbol and adds in 00743 the new value to the location in the object file (if it's a pc 00744 relative reloc it adds the difference between the symbol value and the 00745 location). When relocating we need to preserve that property. 00746 00747 BFD handles this by setting the addend to the negative of the old 00748 value of the symbol. Unfortunately it handles common symbols in a 00749 non-standard way (it doesn't subtract the old value) but that's a 00750 different story (we can't change it without losing backward 00751 compatibility with old object files) (coff-i386 does subtract the old 00752 value, to be compatible with existing coff-i386 targets, like SCO). 00753 00754 So everything works fine when not producing relocatable output. When 00755 we are producing relocatable output, logically we should do exactly 00756 what we do when not producing relocatable output. Therefore, your 00757 patch is correct. In fact, it should probably always just set 00758 reloc_entry->addend to 0 for all cases, since it is, in fact, going to 00759 add the value into the object file. This won't hurt the COFF code, 00760 which doesn't use the addend; I'm not sure what it will do to other 00761 formats (the thing to check for would be whether any formats both use 00762 the addend and set partial_inplace). 00763 00764 When I wanted to make coff-i386 produce relocatable output, I ran 00765 into the problem that you are running into: I wanted to remove that 00766 line. Rather than risk it, I made the coff-i386 relocs use a special 00767 function; it's coff_i386_reloc in coff-i386.c. The function 00768 specifically adds the addend field into the object file, knowing that 00769 bfd_perform_relocation is not going to. If you remove that line, then 00770 coff-i386.c will wind up adding the addend field in twice. It's 00771 trivial to fix; it just needs to be done. 00772 00773 The problem with removing the line is just that it may break some 00774 working code. With BFD it's hard to be sure of anything. The right 00775 way to deal with this is simply to build and test at least all the 00776 supported COFF targets. It should be straightforward if time and disk 00777 space consuming. For each target: 00778 1) build the linker 00779 2) generate some executable, and link it using -r (I would 00780 probably use paranoia.o and link against newlib/libc.a, which 00781 for all the supported targets would be available in 00782 /usr/cygnus/progressive/H-host/target/lib/libc.a). 00783 3) make the change to reloc.c 00784 4) rebuild the linker 00785 5) repeat step 2 00786 6) if the resulting object files are the same, you have at least 00787 made it no worse 00788 7) if they are different you have to figure out which version is 00789 right 00790 */ 00791 relocation -= reloc_entry->addend; 00792 reloc_entry->addend = 0; 00793 } 00794 else 00795 { 00796 reloc_entry->addend = relocation; 00797 } 00798 } 00799 } 00800 else 00801 { 00802 reloc_entry->addend = 0; 00803 } 00804 00805 /* FIXME: This overflow checking is incomplete, because the value 00806 might have overflowed before we get here. For a correct check we 00807 need to compute the value in a size larger than bitsize, but we 00808 can't reasonably do that for a reloc the same size as a host 00809 machine word. 00810 FIXME: We should also do overflow checking on the result after 00811 adding in the value contained in the object file. */ 00812 if (howto->complain_on_overflow != complain_overflow_dont 00813 && flag == bfd_reloc_ok) 00814 flag = bfd_check_overflow (howto->complain_on_overflow, 00815 howto->bitsize, 00816 howto->rightshift, 00817 bfd_arch_bits_per_address (abfd), 00818 relocation); 00819 00820 /* Either we are relocating all the way, or we don't want to apply 00821 the relocation to the reloc entry (probably because there isn't 00822 any room in the output format to describe addends to relocs). */ 00823 00824 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler 00825 (OSF version 1.3, compiler version 3.11). It miscompiles the 00826 following program: 00827 00828 struct str 00829 { 00830 unsigned int i0; 00831 } s = { 0 }; 00832 00833 int 00834 main () 00835 { 00836 unsigned long x; 00837 00838 x = 0x100000000; 00839 x <<= (unsigned long) s.i0; 00840 if (x == 0) 00841 printf ("failed\n"); 00842 else 00843 printf ("succeeded (%lx)\n", x); 00844 } 00845 */ 00846 00847 relocation >>= (bfd_vma) howto->rightshift; 00848 00849 /* Shift everything up to where it's going to be used. */ 00850 relocation <<= (bfd_vma) howto->bitpos; 00851 00852 /* Wait for the day when all have the mask in them. */ 00853 00854 /* What we do: 00855 i instruction to be left alone 00856 o offset within instruction 00857 r relocation offset to apply 00858 S src mask 00859 D dst mask 00860 N ~dst mask 00861 A part 1 00862 B part 2 00863 R result 00864 00865 Do this: 00866 (( i i i i i o o o o o from bfd_get<size> 00867 and S S S S S) to get the size offset we want 00868 + r r r r r r r r r r) to get the final value to place 00869 and D D D D D to chop to right size 00870 ----------------------- 00871 = A A A A A 00872 And this: 00873 ( i i i i i o o o o o from bfd_get<size> 00874 and N N N N N ) get instruction 00875 ----------------------- 00876 = B B B B B 00877 00878 And then: 00879 ( B B B B B 00880 or A A A A A) 00881 ----------------------- 00882 = R R R R R R R R R R put into bfd_put<size> 00883 */ 00884 00885 #define DOIT(x) \ 00886 x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) 00887 00888 switch (howto->size) 00889 { 00890 case 0: 00891 { 00892 char x = bfd_get_8 (abfd, (char *) data + octets); 00893 DOIT (x); 00894 bfd_put_8 (abfd, x, (unsigned char *) data + octets); 00895 } 00896 break; 00897 00898 case 1: 00899 { 00900 short x = bfd_get_16 (abfd, (bfd_byte *) data + octets); 00901 DOIT (x); 00902 bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + octets); 00903 } 00904 break; 00905 case 2: 00906 { 00907 long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); 00908 DOIT (x); 00909 bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 00910 } 00911 break; 00912 case -2: 00913 { 00914 long x = bfd_get_32 (abfd, (bfd_byte *) data + octets); 00915 relocation = -relocation; 00916 DOIT (x); 00917 bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 00918 } 00919 break; 00920 00921 case -1: 00922 { 00923 long x = bfd_get_16 (abfd, (bfd_byte *) data + octets); 00924 relocation = -relocation; 00925 DOIT (x); 00926 bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets); 00927 } 00928 break; 00929 00930 case 3: 00931 /* Do nothing */ 00932 break; 00933 00934 case 4: 00935 #ifdef BFD64 00936 { 00937 bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + octets); 00938 DOIT (x); 00939 bfd_put_64 (abfd, x, (bfd_byte *) data + octets); 00940 } 00941 #else 00942 abort (); 00943 #endif 00944 break; 00945 default: 00946 return bfd_reloc_other; 00947 } 00948 00949 return flag; 00950 } 00951 00952 /* 00953 FUNCTION 00954 bfd_install_relocation 00955 00956 SYNOPSIS 00957 bfd_reloc_status_type bfd_install_relocation 00958 (bfd *abfd, 00959 arelent *reloc_entry, 00960 void *data, bfd_vma data_start, 00961 asection *input_section, 00962 char **error_message); 00963 00964 DESCRIPTION 00965 This looks remarkably like <<bfd_perform_relocation>>, except it 00966 does not expect that the section contents have been filled in. 00967 I.e., it's suitable for use when creating, rather than applying 00968 a relocation. 00969 00970 For now, this function should be considered reserved for the 00971 assembler. 00972 */ 00973 00974 bfd_reloc_status_type 00975 bfd_install_relocation (bfd *abfd, 00976 arelent *reloc_entry, 00977 void *data_start, 00978 bfd_vma data_start_offset, 00979 asection *input_section, 00980 char **error_message) 00981 { 00982 bfd_vma relocation; 00983 bfd_reloc_status_type flag = bfd_reloc_ok; 00984 bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd); 00985 bfd_vma output_base = 0; 00986 reloc_howto_type *howto = reloc_entry->howto; 00987 asection *reloc_target_output_section; 00988 asymbol *symbol; 00989 bfd_byte *data; 00990 00991 symbol = *(reloc_entry->sym_ptr_ptr); 00992 if (bfd_is_abs_section (symbol->section)) 00993 { 00994 reloc_entry->address += input_section->output_offset; 00995 return bfd_reloc_ok; 00996 } 00997 00998 /* If there is a function supplied to handle this relocation type, 00999 call it. It'll return `bfd_reloc_continue' if further processing 01000 can be done. */ 01001 if (howto->special_function) 01002 { 01003 bfd_reloc_status_type cont; 01004 01005 /* XXX - The special_function calls haven't been fixed up to deal 01006 with creating new relocations and section contents. */ 01007 cont = howto->special_function (abfd, reloc_entry, symbol, 01008 /* XXX - Non-portable! */ 01009 ((bfd_byte *) data_start 01010 - data_start_offset), 01011 input_section, abfd, error_message); 01012 if (cont != bfd_reloc_continue) 01013 return cont; 01014 } 01015 01016 /* Is the address of the relocation really within the section? */ 01017 if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) 01018 return bfd_reloc_outofrange; 01019 01020 /* Work out which section the relocation is targeted at and the 01021 initial relocation command value. */ 01022 01023 /* Get symbol value. (Common symbols are special.) */ 01024 if (bfd_is_com_section (symbol->section)) 01025 relocation = 0; 01026 else 01027 relocation = symbol->value; 01028 01029 reloc_target_output_section = symbol->section->output_section; 01030 01031 /* Convert input-section-relative symbol value to absolute. */ 01032 if (! howto->partial_inplace) 01033 output_base = 0; 01034 else 01035 output_base = reloc_target_output_section->vma; 01036 01037 relocation += output_base + symbol->section->output_offset; 01038 01039 /* Add in supplied addend. */ 01040 relocation += reloc_entry->addend; 01041 01042 /* Here the variable relocation holds the final address of the 01043 symbol we are relocating against, plus any addend. */ 01044 01045 if (howto->pc_relative) 01046 { 01047 /* This is a PC relative relocation. We want to set RELOCATION 01048 to the distance between the address of the symbol and the 01049 location. RELOCATION is already the address of the symbol. 01050 01051 We start by subtracting the address of the section containing 01052 the location. 01053 01054 If pcrel_offset is set, we must further subtract the position 01055 of the location within the section. Some targets arrange for 01056 the addend to be the negative of the position of the location 01057 within the section; for example, i386-aout does this. For 01058 i386-aout, pcrel_offset is FALSE. Some other targets do not 01059 include the position of the location; for example, m88kbcs, 01060 or ELF. For those targets, pcrel_offset is TRUE. 01061 01062 If we are producing relocatable output, then we must ensure 01063 that this reloc will be correctly computed when the final 01064 relocation is done. If pcrel_offset is FALSE we want to wind 01065 up with the negative of the location within the section, 01066 which means we must adjust the existing addend by the change 01067 in the location within the section. If pcrel_offset is TRUE 01068 we do not want to adjust the existing addend at all. 01069 01070 FIXME: This seems logical to me, but for the case of 01071 producing relocatable output it is not what the code 01072 actually does. I don't want to change it, because it seems 01073 far too likely that something will break. */ 01074 01075 relocation -= 01076 input_section->output_section->vma + input_section->output_offset; 01077 01078 if (howto->pcrel_offset && howto->partial_inplace) 01079 relocation -= reloc_entry->address; 01080 } 01081 01082 if (! howto->partial_inplace) 01083 { 01084 /* This is a partial relocation, and we want to apply the relocation 01085 to the reloc entry rather than the raw data. Modify the reloc 01086 inplace to reflect what we now know. */ 01087 reloc_entry->addend = relocation; 01088 reloc_entry->address += input_section->output_offset; 01089 return flag; 01090 } 01091 else 01092 { 01093 /* This is a partial relocation, but inplace, so modify the 01094 reloc record a bit. 01095 01096 If we've relocated with a symbol with a section, change 01097 into a ref to the section belonging to the symbol. */ 01098 reloc_entry->address += input_section->output_offset; 01099 01100 /* WTF?? */ 01101 if (abfd->xvec->flavour == bfd_target_coff_flavour 01102 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 01103 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) 01104 { 01105 01106 /* For m68k-coff, the addend was being subtracted twice during 01107 relocation with -r. Removing the line below this comment 01108 fixes that problem; see PR 2953. 01109 01110 However, Ian wrote the following, regarding removing the line below, 01111 which explains why it is still enabled: --djm 01112 01113 If you put a patch like that into BFD you need to check all the COFF 01114 linkers. I am fairly certain that patch will break coff-i386 (e.g., 01115 SCO); see coff_i386_reloc in coff-i386.c where I worked around the 01116 problem in a different way. There may very well be a reason that the 01117 code works as it does. 01118 01119 Hmmm. The first obvious point is that bfd_install_relocation should 01120 not have any tests that depend upon the flavour. It's seem like 01121 entirely the wrong place for such a thing. The second obvious point 01122 is that the current code ignores the reloc addend when producing 01123 relocatable output for COFF. That's peculiar. In fact, I really 01124 have no idea what the point of the line you want to remove is. 01125 01126 A typical COFF reloc subtracts the old value of the symbol and adds in 01127 the new value to the location in the object file (if it's a pc 01128 relative reloc it adds the difference between the symbol value and the 01129 location). When relocating we need to preserve that property. 01130 01131 BFD handles this by setting the addend to the negative of the old 01132 value of the symbol. Unfortunately it handles common symbols in a 01133 non-standard way (it doesn't subtract the old value) but that's a 01134 different story (we can't change it without losing backward 01135 compatibility with old object files) (coff-i386 does subtract the old 01136 value, to be compatible with existing coff-i386 targets, like SCO). 01137 01138 So everything works fine when not producing relocatable output. When 01139 we are producing relocatable output, logically we should do exactly 01140 what we do when not producing relocatable output. Therefore, your 01141 patch is correct. In fact, it should probably always just set 01142 reloc_entry->addend to 0 for all cases, since it is, in fact, going to 01143 add the value into the object file. This won't hurt the COFF code, 01144 which doesn't use the addend; I'm not sure what it will do to other 01145 formats (the thing to check for would be whether any formats both use 01146 the addend and set partial_inplace). 01147 01148 When I wanted to make coff-i386 produce relocatable output, I ran 01149 into the problem that you are running into: I wanted to remove that 01150 line. Rather than risk it, I made the coff-i386 relocs use a special 01151 function; it's coff_i386_reloc in coff-i386.c. The function 01152 specifically adds the addend field into the object file, knowing that 01153 bfd_install_relocation is not going to. If you remove that line, then 01154 coff-i386.c will wind up adding the addend field in twice. It's 01155 trivial to fix; it just needs to be done. 01156 01157 The problem with removing the line is just that it may break some 01158 working code. With BFD it's hard to be sure of anything. The right 01159 way to deal with this is simply to build and test at least all the 01160 supported COFF targets. It should be straightforward if time and disk 01161 space consuming. For each target: 01162 1) build the linker 01163 2) generate some executable, and link it using -r (I would 01164 probably use paranoia.o and link against newlib/libc.a, which 01165 for all the supported targets would be available in 01166 /usr/cygnus/progressive/H-host/target/lib/libc.a). 01167 3) make the change to reloc.c 01168 4) rebuild the linker 01169 5) repeat step 2 01170 6) if the resulting object files are the same, you have at least 01171 made it no worse 01172 7) if they are different you have to figure out which version is 01173 right. */ 01174 relocation -= reloc_entry->addend; 01175 reloc_entry->addend = 0; 01176 } 01177 else 01178 { 01179 reloc_entry->addend = relocation; 01180 } 01181 } 01182 01183 /* FIXME: This overflow checking is incomplete, because the value 01184 might have overflowed before we get here. For a correct check we 01185 need to compute the value in a size larger than bitsize, but we 01186 can't reasonably do that for a reloc the same size as a host 01187 machine word. 01188 FIXME: We should also do overflow checking on the result after 01189 adding in the value contained in the object file. */ 01190 if (howto->complain_on_overflow != complain_overflow_dont) 01191 flag = bfd_check_overflow (howto->complain_on_overflow, 01192 howto->bitsize, 01193 howto->rightshift, 01194 bfd_arch_bits_per_address (abfd), 01195 relocation); 01196 01197 /* Either we are relocating all the way, or we don't want to apply 01198 the relocation to the reloc entry (probably because there isn't 01199 any room in the output format to describe addends to relocs). */ 01200 01201 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler 01202 (OSF version 1.3, compiler version 3.11). It miscompiles the 01203 following program: 01204 01205 struct str 01206 { 01207 unsigned int i0; 01208 } s = { 0 }; 01209 01210 int 01211 main () 01212 { 01213 unsigned long x; 01214 01215 x = 0x100000000; 01216 x <<= (unsigned long) s.i0; 01217 if (x == 0) 01218 printf ("failed\n"); 01219 else 01220 printf ("succeeded (%lx)\n", x); 01221 } 01222 */ 01223 01224 relocation >>= (bfd_vma) howto->rightshift; 01225 01226 /* Shift everything up to where it's going to be used. */ 01227 relocation <<= (bfd_vma) howto->bitpos; 01228 01229 /* Wait for the day when all have the mask in them. */ 01230 01231 /* What we do: 01232 i instruction to be left alone 01233 o offset within instruction 01234 r relocation offset to apply 01235 S src mask 01236 D dst mask 01237 N ~dst mask 01238 A part 1 01239 B part 2 01240 R result 01241 01242 Do this: 01243 (( i i i i i o o o o o from bfd_get<size> 01244 and S S S S S) to get the size offset we want 01245 + r r r r r r r r r r) to get the final value to place 01246 and D D D D D to chop to right size 01247 ----------------------- 01248 = A A A A A 01249 And this: 01250 ( i i i i i o o o o o from bfd_get<size> 01251 and N N N N N ) get instruction 01252 ----------------------- 01253 = B B B B B 01254 01255 And then: 01256 ( B B B B B 01257 or A A A A A) 01258 ----------------------- 01259 = R R R R R R R R R R put into bfd_put<size> 01260 */ 01261 01262 #define DOIT(x) \ 01263 x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) 01264 01265 data = (bfd_byte *) data_start + (octets - data_start_offset); 01266 01267 switch (howto->size) 01268 { 01269 case 0: 01270 { 01271 char x = bfd_get_8 (abfd, data); 01272 DOIT (x); 01273 bfd_put_8 (abfd, x, data); 01274 } 01275 break; 01276 01277 case 1: 01278 { 01279 short x = bfd_get_16 (abfd, data); 01280 DOIT (x); 01281 bfd_put_16 (abfd, (bfd_vma) x, data); 01282 } 01283 break; 01284 case 2: 01285 { 01286 long x = bfd_get_32 (abfd, data); 01287 DOIT (x); 01288 bfd_put_32 (abfd, (bfd_vma) x, data); 01289 } 01290 break; 01291 case -2: 01292 { 01293 long x = bfd_get_32 (abfd, data); 01294 relocation = -relocation; 01295 DOIT (x); 01296 bfd_put_32 (abfd, (bfd_vma) x, data); 01297 } 01298 break; 01299 01300 case 3: 01301 /* Do nothing */ 01302 break; 01303 01304 case 4: 01305 { 01306 bfd_vma x = bfd_get_64 (abfd, data); 01307 DOIT (x); 01308 bfd_put_64 (abfd, x, data); 01309 } 01310 break; 01311 default: 01312 return bfd_reloc_other; 01313 } 01314 01315 return flag; 01316 } 01317 01318 /* This relocation routine is used by some of the backend linkers. 01319 They do not construct asymbol or arelent structures, so there is no 01320 reason for them to use bfd_perform_relocation. Also, 01321 bfd_perform_relocation is so hacked up it is easier to write a new 01322 function than to try to deal with it. 01323 01324 This routine does a final relocation. Whether it is useful for a 01325 relocatable link depends upon how the object format defines 01326 relocations. 01327 01328 FIXME: This routine ignores any special_function in the HOWTO, 01329 since the existing special_function values have been written for 01330 bfd_perform_relocation. 01331 01332 HOWTO is the reloc howto information. 01333 INPUT_BFD is the BFD which the reloc applies to. 01334 INPUT_SECTION is the section which the reloc applies to. 01335 CONTENTS is the contents of the section. 01336 ADDRESS is the address of the reloc within INPUT_SECTION. 01337 VALUE is the value of the symbol the reloc refers to. 01338 ADDEND is the addend of the reloc. */ 01339 01340 bfd_reloc_status_type 01341 _bfd_final_link_relocate (reloc_howto_type *howto, 01342 bfd *input_bfd, 01343 asection *input_section, 01344 bfd_byte *contents, 01345 bfd_vma address, 01346 bfd_vma value, 01347 bfd_vma addend) 01348 { 01349 bfd_vma relocation; 01350 01351 /* Sanity check the address. */ 01352 if (address > bfd_get_section_limit (input_bfd, input_section)) 01353 return bfd_reloc_outofrange; 01354 01355 /* This function assumes that we are dealing with a basic relocation 01356 against a symbol. We want to compute the value of the symbol to 01357 relocate to. This is just VALUE, the value of the symbol, plus 01358 ADDEND, any addend associated with the reloc. */ 01359 relocation = value + addend; 01360 01361 /* If the relocation is PC relative, we want to set RELOCATION to 01362 the distance between the symbol (currently in RELOCATION) and the 01363 location we are relocating. Some targets (e.g., i386-aout) 01364 arrange for the contents of the section to be the negative of the 01365 offset of the location within the section; for such targets 01366 pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF) 01367 simply leave the contents of the section as zero; for such 01368 targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not 01369 need to subtract out the offset of the location within the 01370 section (which is just ADDRESS). */ 01371 if (howto->pc_relative) 01372 { 01373 relocation -= (input_section->output_section->vma 01374 + input_section->output_offset); 01375 if (howto->pcrel_offset) 01376 relocation -= address; 01377 } 01378 01379 return _bfd_relocate_contents (howto, input_bfd, relocation, 01380 contents + address); 01381 } 01382 01383 /* Relocate a given location using a given value and howto. */ 01384 01385 bfd_reloc_status_type 01386 _bfd_relocate_contents (reloc_howto_type *howto, 01387 bfd *input_bfd, 01388 bfd_vma relocation, 01389 bfd_byte *location) 01390 { 01391 int size; 01392 bfd_vma x = 0; 01393 bfd_reloc_status_type flag; 01394 unsigned int rightshift = howto->rightshift; 01395 unsigned int bitpos = howto->bitpos; 01396 01397 /* If the size is negative, negate RELOCATION. This isn't very 01398 general. */ 01399 if (howto->size < 0) 01400 relocation = -relocation; 01401 01402 /* Get the value we are going to relocate. */ 01403 size = bfd_get_reloc_size (howto); 01404 switch (size) 01405 { 01406 default: 01407 case 0: 01408 abort (); 01409 case 1: 01410 x = bfd_get_8 (input_bfd, location); 01411 break; 01412 case 2: 01413 x = bfd_get_16 (input_bfd, location); 01414 break; 01415 case 4: 01416 x = bfd_get_32 (input_bfd, location); 01417 break; 01418 case 8: 01419 #ifdef BFD64 01420 x = bfd_get_64 (input_bfd, location); 01421 #else 01422 abort (); 01423 #endif 01424 break; 01425 } 01426 01427 /* Check for overflow. FIXME: We may drop bits during the addition 01428 which we don't check for. We must either check at every single 01429 operation, which would be tedious, or we must do the computations 01430 in a type larger than bfd_vma, which would be inefficient. */ 01431 flag = bfd_reloc_ok; 01432 if (howto->complain_on_overflow != complain_overflow_dont) 01433 { 01434 bfd_vma addrmask, fieldmask, signmask, ss; 01435 bfd_vma a, b, sum; 01436 01437 /* Get the values to be added together. For signed and unsigned 01438 relocations, we assume that all values should be truncated to 01439 the size of an address. For bitfields, all the bits matter. 01440 See also bfd_check_overflow. */ 01441 fieldmask = N_ONES (howto->bitsize); 01442 addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask; 01443 a = relocation; 01444 b = x & howto->src_mask; 01445 01446 switch (howto->complain_on_overflow) 01447 { 01448 case complain_overflow_signed: 01449 a = (a & addrmask) >> rightshift; 01450 01451 /* If any sign bits are set, all sign bits must be set. 01452 That is, A must be a valid negative address after 01453 shifting. */ 01454 signmask = ~ (fieldmask >> 1); 01455 ss = a & signmask; 01456 if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) 01457 flag = bfd_reloc_overflow; 01458 01459 /* We only need this next bit of code if the sign bit of B 01460 is below the sign bit of A. This would only happen if 01461 SRC_MASK had fewer bits than BITSIZE. Note that if 01462 SRC_MASK has more bits than BITSIZE, we can get into 01463 trouble; we would need to verify that B is in range, as 01464 we do for A above. */ 01465 signmask = ((~ howto->src_mask) >> 1) & howto->src_mask; 01466 01467 /* Set all the bits above the sign bit. */ 01468 b = (b ^ signmask) - signmask; 01469 01470 b = (b & addrmask) >> bitpos; 01471 01472 /* Now we can do the addition. */ 01473 sum = a + b; 01474 01475 /* See if the result has the correct sign. Bits above the 01476 sign bit are junk now; ignore them. If the sum is 01477 positive, make sure we did not have all negative inputs; 01478 if the sum is negative, make sure we did not have all 01479 positive inputs. The test below looks only at the sign 01480 bits, and it really just 01481 SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM) 01482 */ 01483 signmask = (fieldmask >> 1) + 1; 01484 if (((~ (a ^ b)) & (a ^ sum)) & signmask) 01485 flag = bfd_reloc_overflow; 01486 01487 break; 01488 01489 case complain_overflow_unsigned: 01490 /* Checking for an unsigned overflow is relatively easy: 01491 trim the addresses and add, and trim the result as well. 01492 Overflow is normally indicated when the result does not 01493 fit in the field. However, we also need to consider the 01494 case when, e.g., fieldmask is 0x7fffffff or smaller, an 01495 input is 0x80000000, and bfd_vma is only 32 bits; then we 01496 will get sum == 0, but there is an overflow, since the 01497 inputs did not fit in the field. Instead of doing a 01498 separate test, we can check for this by or-ing in the 01499 operands when testing for the sum overflowing its final 01500 field. */ 01501 a = (a & addrmask) >> rightshift; 01502 b = (b & addrmask) >> bitpos; 01503 sum = (a + b) & addrmask; 01504 if ((a | b | sum) & ~ fieldmask) 01505 flag = bfd_reloc_overflow; 01506 01507 break; 01508 01509 case complain_overflow_bitfield: 01510 /* Much like the signed check, but for a field one bit 01511 wider, and no trimming inputs with addrmask. We allow a 01512 bitfield to represent numbers in the range -2**n to 01513 2**n-1, where n is the number of bits in the field. 01514 Note that when bfd_vma is 32 bits, a 32-bit reloc can't 01515 overflow, which is exactly what we want. */ 01516 a >>= rightshift; 01517 01518 signmask = ~ fieldmask; 01519 ss = a & signmask; 01520 if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & signmask)) 01521 flag = bfd_reloc_overflow; 01522 01523 signmask = ((~ howto->src_mask) >> 1) & howto->src_mask; 01524 b = (b ^ signmask) - signmask; 01525 01526 b >>= bitpos; 01527 01528 sum = a + b; 01529 01530 /* We mask with addrmask here to explicitly allow an address 01531 wrap-around. The Linux kernel relies on it, and it is 01532 the only way to write assembler code which can run when 01533 loaded at a location 0x80000000 away from the location at 01534 which it is linked. */ 01535 signmask = fieldmask + 1; 01536 if (((~ (a ^ b)) & (a ^ sum)) & signmask & addrmask) 01537 flag = bfd_reloc_overflow; 01538 01539 break; 01540 01541 default: 01542 abort (); 01543 } 01544 } 01545 01546 /* Put RELOCATION in the right bits. */ 01547 relocation >>= (bfd_vma) rightshift; 01548 relocation <<= (bfd_vma) bitpos; 01549 01550 /* Add RELOCATION to the right bits of X. */ 01551 x = ((x & ~howto->dst_mask) 01552 | (((x & howto->src_mask) + relocation) & howto->dst_mask)); 01553 01554 /* Put the relocated value back in the object file. */ 01555 switch (size) 01556 { 01557 default: 01558 case 0: 01559 abort (); 01560 case 1: 01561 bfd_put_8 (input_bfd, x, location); 01562 break; 01563 case 2: 01564 bfd_put_16 (input_bfd, x, location); 01565 break; 01566 case 4: 01567 bfd_put_32 (input_bfd, x, location); 01568 break; 01569 case 8: 01570 #ifdef BFD64 01571 bfd_put_64 (input_bfd, x, location); 01572 #else 01573 abort (); 01574 #endif 01575 break; 01576 } 01577 01578 return flag; 01579 } 01580 01581 /* 01582 DOCDD 01583 INODE 01584 howto manager, , typedef arelent, Relocations 01585 01586 SECTION 01587 The howto manager 01588 01589 When an application wants to create a relocation, but doesn't 01590 know what the target machine might call it, it can find out by 01591 using this bit of code. 01592 01593 */ 01594 01595 /* 01596 TYPEDEF 01597 bfd_reloc_code_type 01598 01599 DESCRIPTION 01600 The insides of a reloc code. The idea is that, eventually, there 01601 will be one enumerator for every type of relocation we ever do. 01602 Pass one of these values to <<bfd_reloc_type_lookup>>, and it'll 01603 return a howto pointer. 01604 01605 This does mean that the application must determine the correct 01606 enumerator value; you can't get a howto pointer from a random set 01607 of attributes. 01608 01609 SENUM 01610 bfd_reloc_code_real 01611 01612 ENUM 01613 BFD_RELOC_64 01614 ENUMX 01615 BFD_RELOC_32 01616 ENUMX 01617 BFD_RELOC_26 01618 ENUMX 01619 BFD_RELOC_24 01620 ENUMX 01621 BFD_RELOC_16 01622 ENUMX 01623 BFD_RELOC_14 01624 ENUMX 01625 BFD_RELOC_8 01626 ENUMDOC 01627 Basic absolute relocations of N bits. 01628 01629 ENUM 01630 BFD_RELOC_64_PCREL 01631 ENUMX 01632 BFD_RELOC_32_PCREL 01633 ENUMX 01634 BFD_RELOC_24_PCREL 01635 ENUMX 01636 BFD_RELOC_16_PCREL 01637 ENUMX 01638 BFD_RELOC_12_PCREL 01639 ENUMX 01640 BFD_RELOC_8_PCREL 01641 ENUMDOC 01642 PC-relative relocations. Sometimes these are relative to the address 01643 of the relocation itself; sometimes they are relative to the start of 01644 the section containing the relocation. It depends on the specific target. 01645 01646 The 24-bit relocation is used in some Intel 960 configurations. 01647 01648 ENUM 01649 BFD_RELOC_32_SECREL 01650 ENUMDOC 01651 Section relative relocations. Some targets need this for DWARF2. 01652 01653 ENUM 01654 BFD_RELOC_32_GOT_PCREL 01655 ENUMX 01656 BFD_RELOC_16_GOT_PCREL 01657 ENUMX 01658 BFD_RELOC_8_GOT_PCREL 01659 ENUMX 01660 BFD_RELOC_32_GOTOFF 01661 ENUMX 01662 BFD_RELOC_16_GOTOFF 01663 ENUMX 01664 BFD_RELOC_LO16_GOTOFF 01665 ENUMX 01666 BFD_RELOC_HI16_GOTOFF 01667 ENUMX 01668 BFD_RELOC_HI16_S_GOTOFF 01669 ENUMX 01670 BFD_RELOC_8_GOTOFF 01671 ENUMX 01672 BFD_RELOC_64_PLT_PCREL 01673 ENUMX 01674 BFD_RELOC_32_PLT_PCREL 01675 ENUMX 01676 BFD_RELOC_24_PLT_PCREL 01677 ENUMX 01678 BFD_RELOC_16_PLT_PCREL 01679 ENUMX 01680 BFD_RELOC_8_PLT_PCREL 01681 ENUMX 01682 BFD_RELOC_64_PLTOFF 01683 ENUMX 01684 BFD_RELOC_32_PLTOFF 01685 ENUMX 01686 BFD_RELOC_16_PLTOFF 01687 ENUMX 01688 BFD_RELOC_LO16_PLTOFF 01689 ENUMX 01690 BFD_RELOC_HI16_PLTOFF 01691 ENUMX 01692 BFD_RELOC_HI16_S_PLTOFF 01693 ENUMX 01694 BFD_RELOC_8_PLTOFF 01695 ENUMDOC 01696 For ELF. 01697 01698 ENUM 01699 BFD_RELOC_68K_GLOB_DAT 01700 ENUMX 01701 BFD_RELOC_68K_JMP_SLOT 01702 ENUMX 01703 BFD_RELOC_68K_RELATIVE 01704 ENUMDOC 01705 Relocations used by 68K ELF. 01706 01707 ENUM 01708 BFD_RELOC_32_BASEREL 01709 ENUMX 01710 BFD_RELOC_16_BASEREL 01711 ENUMX 01712 BFD_RELOC_LO16_BASEREL 01713 ENUMX 01714 BFD_RELOC_HI16_BASEREL 01715 ENUMX 01716 BFD_RELOC_HI16_S_BASEREL 01717 ENUMX 01718 BFD_RELOC_8_BASEREL 01719 ENUMX 01720 BFD_RELOC_RVA 01721 ENUMDOC 01722 Linkage-table relative. 01723 01724 ENUM 01725 BFD_RELOC_8_FFnn 01726 ENUMDOC 01727 Absolute 8-bit relocation, but used to form an address like 0xFFnn. 01728 01729 ENUM 01730 BFD_RELOC_32_PCREL_S2 01731 ENUMX 01732 BFD_RELOC_16_PCREL_S2 01733 ENUMX 01734 BFD_RELOC_23_PCREL_S2 01735 ENUMDOC 01736 These PC-relative relocations are stored as word displacements -- 01737 i.e., byte displacements shifted right two bits. The 30-bit word 01738 displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the 01739 SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 01740 signed 16-bit displacement is used on the MIPS, and the 23-bit 01741 displacement is used on the Alpha. 01742 01743 ENUM 01744 BFD_RELOC_HI22 01745 ENUMX 01746 BFD_RELOC_LO10 01747 ENUMDOC 01748 High 22 bits and low 10 bits of 32-bit value, placed into lower bits of 01749 the target word. These are used on the SPARC. 01750 01751 ENUM 01752 BFD_RELOC_GPREL16 01753 ENUMX 01754 BFD_RELOC_GPREL32 01755 ENUMDOC 01756 For systems that allocate a Global Pointer register, these are 01757 displacements off that register. These relocation types are 01758 handled specially, because the value the register will have is 01759 decided relatively late. 01760 01761 ENUM 01762 BFD_RELOC_I960_CALLJ 01763 ENUMDOC 01764 Reloc types used for i960/b.out. 01765 01766 ENUM 01767 BFD_RELOC_NONE 01768 ENUMX 01769 BFD_RELOC_SPARC_WDISP22 01770 ENUMX 01771 BFD_RELOC_SPARC22 01772 ENUMX 01773 BFD_RELOC_SPARC13 01774 ENUMX 01775 BFD_RELOC_SPARC_GOT10 01776 ENUMX 01777 BFD_RELOC_SPARC_GOT13 01778 ENUMX 01779 BFD_RELOC_SPARC_GOT22 01780 ENUMX 01781 BFD_RELOC_SPARC_PC10 01782 ENUMX 01783 BFD_RELOC_SPARC_PC22 01784 ENUMX 01785 BFD_RELOC_SPARC_WPLT30 01786 ENUMX 01787 BFD_RELOC_SPARC_COPY 01788 ENUMX 01789 BFD_RELOC_SPARC_GLOB_DAT 01790 ENUMX 01791 BFD_RELOC_SPARC_JMP_SLOT 01792 ENUMX 01793 BFD_RELOC_SPARC_RELATIVE 01794 ENUMX 01795 BFD_RELOC_SPARC_UA16 01796 ENUMX 01797 BFD_RELOC_SPARC_UA32 01798 ENUMX 01799 BFD_RELOC_SPARC_UA64 01800 ENUMDOC 01801 SPARC ELF relocations. There is probably some overlap with other 01802 relocation types already defined. 01803 01804 ENUM 01805 BFD_RELOC_SPARC_BASE13 01806 ENUMX 01807 BFD_RELOC_SPARC_BASE22 01808 ENUMDOC 01809 I think these are specific to SPARC a.out (e.g., Sun 4). 01810 01811 ENUMEQ 01812 BFD_RELOC_SPARC_64 01813 BFD_RELOC_64 01814 ENUMX 01815 BFD_RELOC_SPARC_10 01816 ENUMX 01817 BFD_RELOC_SPARC_11 01818 ENUMX 01819 BFD_RELOC_SPARC_OLO10 01820 ENUMX 01821 BFD_RELOC_SPARC_HH22 01822 ENUMX 01823 BFD_RELOC_SPARC_HM10 01824 ENUMX 01825 BFD_RELOC_SPARC_LM22 01826 ENUMX 01827 BFD_RELOC_SPARC_PC_HH22 01828 ENUMX 01829 BFD_RELOC_SPARC_PC_HM10 01830 ENUMX 01831 BFD_RELOC_SPARC_PC_LM22 01832 ENUMX 01833 BFD_RELOC_SPARC_WDISP16 01834 ENUMX 01835 BFD_RELOC_SPARC_WDISP19 01836 ENUMX 01837 BFD_RELOC_SPARC_7 01838 ENUMX 01839 BFD_RELOC_SPARC_6 01840 ENUMX 01841 BFD_RELOC_SPARC_5 01842 ENUMEQX 01843 BFD_RELOC_SPARC_DISP64 01844 BFD_RELOC_64_PCREL 01845 ENUMX 01846 BFD_RELOC_SPARC_PLT32 01847 ENUMX 01848 BFD_RELOC_SPARC_PLT64 01849 ENUMX 01850 BFD_RELOC_SPARC_HIX22 01851 ENUMX 01852 BFD_RELOC_SPARC_LOX10 01853 ENUMX 01854 BFD_RELOC_SPARC_H44 01855 ENUMX 01856 BFD_RELOC_SPARC_M44 01857 ENUMX 01858 BFD_RELOC_SPARC_L44 01859 ENUMX 01860 BFD_RELOC_SPARC_REGISTER 01861 ENUMDOC 01862 SPARC64 relocations 01863 01864 ENUM 01865 BFD_RELOC_SPARC_REV32 01866 ENUMDOC 01867 SPARC little endian relocation 01868 ENUM 01869 BFD_RELOC_SPARC_TLS_GD_HI22 01870 ENUMX 01871 BFD_RELOC_SPARC_TLS_GD_LO10 01872 ENUMX 01873 BFD_RELOC_SPARC_TLS_GD_ADD 01874 ENUMX 01875 BFD_RELOC_SPARC_TLS_GD_CALL 01876 ENUMX 01877 BFD_RELOC_SPARC_TLS_LDM_HI22 01878 ENUMX 01879 BFD_RELOC_SPARC_TLS_LDM_LO10 01880 ENUMX 01881 BFD_RELOC_SPARC_TLS_LDM_ADD 01882 ENUMX 01883 BFD_RELOC_SPARC_TLS_LDM_CALL 01884 ENUMX 01885 BFD_RELOC_SPARC_TLS_LDO_HIX22 01886 ENUMX 01887 BFD_RELOC_SPARC_TLS_LDO_LOX10 01888 ENUMX 01889 BFD_RELOC_SPARC_TLS_LDO_ADD 01890 ENUMX 01891 BFD_RELOC_SPARC_TLS_IE_HI22 01892 ENUMX 01893 BFD_RELOC_SPARC_TLS_IE_LO10 01894 ENUMX 01895 BFD_RELOC_SPARC_TLS_IE_LD 01896 ENUMX 01897 BFD_RELOC_SPARC_TLS_IE_LDX 01898 ENUMX 01899 BFD_RELOC_SPARC_TLS_IE_ADD 01900 ENUMX 01901 BFD_RELOC_SPARC_TLS_LE_HIX22 01902 ENUMX 01903 BFD_RELOC_SPARC_TLS_LE_LOX10 01904 ENUMX 01905 BFD_RELOC_SPARC_TLS_DTPMOD32 01906 ENUMX 01907 BFD_RELOC_SPARC_TLS_DTPMOD64 01908 ENUMX 01909 BFD_RELOC_SPARC_TLS_DTPOFF32 01910 ENUMX 01911 BFD_RELOC_SPARC_TLS_DTPOFF64 01912 ENUMX 01913 BFD_RELOC_SPARC_TLS_TPOFF32 01914 ENUMX 01915 BFD_RELOC_SPARC_TLS_TPOFF64 01916 ENUMDOC 01917 SPARC TLS relocations 01918 01919 ENUM 01920 BFD_RELOC_ALPHA_GPDISP_HI16 01921 ENUMDOC 01922 Alpha ECOFF and ELF relocations. Some of these treat the symbol or 01923 "addend" in some special way. 01924 For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when 01925 writing; when reading, it will be the absolute section symbol. The 01926 addend is the displacement in bytes of the "lda" instruction from 01927 the "ldah" instruction (which is at the address of this reloc). 01928 ENUM 01929 BFD_RELOC_ALPHA_GPDISP_LO16 01930 ENUMDOC 01931 For GPDISP_LO16 ("ignore") relocations, the symbol is handled as 01932 with GPDISP_HI16 relocs. The addend is ignored when writing the 01933 relocations out, and is filled in with the file's GP value on 01934 reading, for convenience. 01935 01936 ENUM 01937 BFD_RELOC_ALPHA_GPDISP 01938 ENUMDOC 01939 The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 01940 relocation except that there is no accompanying GPDISP_LO16 01941 relocation. 01942 01943 ENUM 01944 BFD_RELOC_ALPHA_LITERAL 01945 ENUMX 01946 BFD_RELOC_ALPHA_ELF_LITERAL 01947 ENUMX 01948 BFD_RELOC_ALPHA_LITUSE 01949 ENUMDOC 01950 The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; 01951 the assembler turns it into a LDQ instruction to load the address of 01952 the symbol, and then fills in a register in the real instruction. 01953 01954 The LITERAL reloc, at the LDQ instruction, refers to the .lita 01955 section symbol. The addend is ignored when writing, but is filled 01956 in with the file's GP value on reading, for convenience, as with the 01957 GPDISP_LO16 reloc. 01958 01959 The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. 01960 It should refer to the symbol to be referenced, as with 16_GOTOFF, 01961 but it generates output not based on the position within the .got 01962 section, but relative to the GP value chosen for the file during the 01963 final link stage. 01964 01965 The LITUSE reloc, on the instruction using the loaded address, gives 01966 information to the linker that it might be able to use to optimize 01967 away some literal section references. The symbol is ignored (read 01968 as the absolute section symbol), and the "addend" indicates the type 01969 of instruction using the register: 01970 1 - "memory" fmt insn 01971 2 - byte-manipulation (byte offset reg) 01972 3 - jsr (target of branch) 01973 01974 ENUM 01975 BFD_RELOC_ALPHA_HINT 01976 ENUMDOC 01977 The HINT relocation indicates a value that should be filled into the 01978 "hint" field of a jmp/jsr/ret instruction, for possible branch- 01979 prediction logic which may be provided on some processors. 01980 01981 ENUM 01982 BFD_RELOC_ALPHA_LINKAGE 01983 ENUMDOC 01984 The LINKAGE relocation outputs a linkage pair in the object file, 01985 which is filled by the linker. 01986 01987 ENUM 01988 BFD_RELOC_ALPHA_CODEADDR 01989 ENUMDOC 01990 The CODEADDR relocation outputs a STO_CA in the object file, 01991 which is filled by the linker. 01992 01993 ENUM 01994 BFD_RELOC_ALPHA_GPREL_HI16 01995 ENUMX 01996 BFD_RELOC_ALPHA_GPREL_LO16 01997 ENUMDOC 01998 The GPREL_HI/LO relocations together form a 32-bit offset from the 01999 GP register. 02000 02001 ENUM 02002 BFD_RELOC_ALPHA_BRSGP 02003 ENUMDOC 02004 Like BFD_RELOC_23_PCREL_S2, except that the source and target must 02005 share a common GP, and the target address is adjusted for 02006 STO_ALPHA_STD_GPLOAD. 02007 02008 ENUM 02009 BFD_RELOC_ALPHA_TLSGD 02010 ENUMX 02011 BFD_RELOC_ALPHA_TLSLDM 02012 ENUMX 02013 BFD_RELOC_ALPHA_DTPMOD64 02014 ENUMX 02015 BFD_RELOC_ALPHA_GOTDTPREL16 02016 ENUMX 02017 BFD_RELOC_ALPHA_DTPREL64 02018 ENUMX 02019 BFD_RELOC_ALPHA_DTPREL_HI16 02020 ENUMX 02021 BFD_RELOC_ALPHA_DTPREL_LO16 02022 ENUMX 02023 BFD_RELOC_ALPHA_DTPREL16 02024 ENUMX 02025 BFD_RELOC_ALPHA_GOTTPREL16 02026 ENUMX 02027 BFD_RELOC_ALPHA_TPREL64 02028 ENUMX 02029 BFD_RELOC_ALPHA_TPREL_HI16 02030 ENUMX 02031 BFD_RELOC_ALPHA_TPREL_LO16 02032 ENUMX 02033 BFD_RELOC_ALPHA_TPREL16 02034 ENUMDOC 02035 Alpha thread-local storage relocations. 02036 02037 ENUM 02038 BFD_RELOC_MIPS_JMP 02039 ENUMDOC 02040 Bits 27..2 of the relocation address shifted right 2 bits; 02041 simple reloc otherwise. 02042 02043 ENUM 02044 BFD_RELOC_MIPS16_JMP 02045 ENUMDOC 02046 The MIPS16 jump instruction. 02047 02048 ENUM 02049 BFD_RELOC_MIPS16_GPREL 02050 ENUMDOC 02051 MIPS16 GP relative reloc. 02052 02053 ENUM 02054 BFD_RELOC_HI16 02055 ENUMDOC 02056 High 16 bits of 32-bit value; simple reloc. 02057 ENUM 02058 BFD_RELOC_HI16_S 02059 ENUMDOC 02060 High 16 bits of 32-bit value but the low 16 bits will be sign 02061 extended and added to form the final result. If the low 16 02062 bits form a negative number, we need to add one to the high value 02063 to compensate for the borrow when the low bits are added. 02064 ENUM 02065 BFD_RELOC_LO16 02066 ENUMDOC 02067 Low 16 bits. 02068 02069 ENUM 02070 BFD_RELOC_MIPS16_HI16 02071 ENUMDOC 02072 MIPS16 high 16 bits of 32-bit value. 02073 ENUM 02074 BFD_RELOC_MIPS16_HI16_S 02075 ENUMDOC 02076 MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign 02077 extended and added to form the final result. If the low 16 02078 bits form a negative number, we need to add one to the high value 02079 to compensate for the borrow when the low bits are added. 02080 ENUM 02081 BFD_RELOC_MIPS16_LO16 02082 ENUMDOC 02083 MIPS16 low 16 bits. 02084 02085 ENUM 02086 BFD_RELOC_MIPS_LITERAL 02087 ENUMDOC 02088 Relocation against a MIPS literal section. 02089 02090 ENUM 02091 BFD_RELOC_MIPS_GOT16 02092 ENUMX 02093 BFD_RELOC_MIPS_CALL16 02094 ENUMX 02095 BFD_RELOC_MIPS_GOT_HI16 02096 ENUMX 02097 BFD_RELOC_MIPS_GOT_LO16 02098 ENUMX 02099 BFD_RELOC_MIPS_CALL_HI16 02100 ENUMX 02101 BFD_RELOC_MIPS_CALL_LO16 02102 ENUMX 02103 BFD_RELOC_MIPS_SUB 02104 ENUMX 02105 BFD_RELOC_MIPS_GOT_PAGE 02106 ENUMX 02107 BFD_RELOC_MIPS_GOT_OFST 02108 ENUMX 02109 BFD_RELOC_MIPS_GOT_DISP 02110 ENUMX 02111 BFD_RELOC_MIPS_SHIFT5 02112 ENUMX 02113 BFD_RELOC_MIPS_SHIFT6 02114 ENUMX 02115 BFD_RELOC_MIPS_INSERT_A 02116 ENUMX 02117 BFD_RELOC_MIPS_INSERT_B 02118 ENUMX 02119 BFD_RELOC_MIPS_DELETE 02120 ENUMX 02121 BFD_RELOC_MIPS_HIGHEST 02122 ENUMX 02123 BFD_RELOC_MIPS_HIGHER 02124 ENUMX 02125 BFD_RELOC_MIPS_SCN_DISP 02126 ENUMX 02127 BFD_RELOC_MIPS_REL16 02128 ENUMX 02129 BFD_RELOC_MIPS_RELGOT 02130 ENUMX 02131 BFD_RELOC_MIPS_JALR 02132 ENUMX 02133 BFD_RELOC_MIPS_TLS_DTPMOD32 02134 ENUMX 02135 BFD_RELOC_MIPS_TLS_DTPREL32 02136 ENUMX 02137 BFD_RELOC_MIPS_TLS_DTPMOD64 02138 ENUMX 02139 BFD_RELOC_MIPS_TLS_DTPREL64 02140 ENUMX 02141 BFD_RELOC_MIPS_TLS_GD 02142 ENUMX 02143 BFD_RELOC_MIPS_TLS_LDM 02144 ENUMX 02145 BFD_RELOC_MIPS_TLS_DTPREL_HI16 02146 ENUMX 02147 BFD_RELOC_MIPS_TLS_DTPREL_LO16 02148 ENUMX 02149 BFD_RELOC_MIPS_TLS_GOTTPREL 02150 ENUMX 02151 BFD_RELOC_MIPS_TLS_TPREL32 02152 ENUMX 02153 BFD_RELOC_MIPS_TLS_TPREL64 02154 ENUMX 02155 BFD_RELOC_MIPS_TLS_TPREL_HI16 02156 ENUMX 02157 BFD_RELOC_MIPS_TLS_TPREL_LO16 02158 ENUMDOC 02159 MIPS ELF relocations. 02160 COMMENT 02161 02162 ENUM 02163 BFD_RELOC_FRV_LABEL16 02164 ENUMX 02165 BFD_RELOC_FRV_LABEL24 02166 ENUMX 02167 BFD_RELOC_FRV_LO16 02168 ENUMX 02169 BFD_RELOC_FRV_HI16 02170 ENUMX 02171 BFD_RELOC_FRV_GPREL12 02172 ENUMX 02173 BFD_RELOC_FRV_GPRELU12 02174 ENUMX 02175 BFD_RELOC_FRV_GPREL32 02176 ENUMX 02177 BFD_RELOC_FRV_GPRELHI 02178 ENUMX 02179 BFD_RELOC_FRV_GPRELLO 02180 ENUMX 02181 BFD_RELOC_FRV_GOT12 02182 ENUMX 02183 BFD_RELOC_FRV_GOTHI 02184 ENUMX 02185 BFD_RELOC_FRV_GOTLO 02186 ENUMX 02187 BFD_RELOC_FRV_FUNCDESC 02188 ENUMX 02189 BFD_RELOC_FRV_FUNCDESC_GOT12 02190 ENUMX 02191 BFD_RELOC_FRV_FUNCDESC_GOTHI 02192 ENUMX 02193 BFD_RELOC_FRV_FUNCDESC_GOTLO 02194 ENUMX 02195 BFD_RELOC_FRV_FUNCDESC_VALUE 02196 ENUMX 02197 BFD_RELOC_FRV_FUNCDESC_GOTOFF12 02198 ENUMX 02199 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI 02200 ENUMX 02201 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO 02202 ENUMX 02203 BFD_RELOC_FRV_GOTOFF12 02204 ENUMX 02205 BFD_RELOC_FRV_GOTOFFHI 02206 ENUMX 02207 BFD_RELOC_FRV_GOTOFFLO 02208 ENUMX 02209 BFD_RELOC_FRV_GETTLSOFF 02210 ENUMX 02211 BFD_RELOC_FRV_TLSDESC_VALUE 02212 ENUMX 02213 BFD_RELOC_FRV_GOTTLSDESC12 02214 ENUMX 02215 BFD_RELOC_FRV_GOTTLSDESCHI 02216 ENUMX 02217 BFD_RELOC_FRV_GOTTLSDESCLO 02218 ENUMX 02219 BFD_RELOC_FRV_TLSMOFF12 02220 ENUMX 02221 BFD_RELOC_FRV_TLSMOFFHI 02222 ENUMX 02223 BFD_RELOC_FRV_TLSMOFFLO 02224 ENUMX 02225 BFD_RELOC_FRV_GOTTLSOFF12 02226 ENUMX 02227 BFD_RELOC_FRV_GOTTLSOFFHI 02228 ENUMX 02229 BFD_RELOC_FRV_GOTTLSOFFLO 02230 ENUMX 02231 BFD_RELOC_FRV_TLSOFF 02232 ENUMX 02233 BFD_RELOC_FRV_TLSDESC_RELAX 02234 ENUMX 02235 BFD_RELOC_FRV_GETTLSOFF_RELAX 02236 ENUMX 02237 BFD_RELOC_FRV_TLSOFF_RELAX 02238 ENUMX 02239 BFD_RELOC_FRV_TLSMOFF 02240 ENUMDOC 02241 Fujitsu Frv Relocations. 02242 COMMENT 02243 02244 ENUM 02245 BFD_RELOC_MN10300_GOTOFF24 02246 ENUMDOC 02247 This is a 24bit GOT-relative reloc for the mn10300. 02248 ENUM 02249 BFD_RELOC_MN10300_GOT32 02250 ENUMDOC 02251 This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes 02252 in the instruction. 02253 ENUM 02254 BFD_RELOC_MN10300_GOT24 02255 ENUMDOC 02256 This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes 02257 in the instruction. 02258 ENUM 02259 BFD_RELOC_MN10300_GOT16 02260 ENUMDOC 02261 This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes 02262 in the instruction. 02263 ENUM 02264 BFD_RELOC_MN10300_COPY 02265 ENUMDOC 02266 Copy symbol at runtime. 02267 ENUM 02268 BFD_RELOC_MN10300_GLOB_DAT 02269 ENUMDOC 02270 Create GOT entry. 02271 ENUM 02272 BFD_RELOC_MN10300_JMP_SLOT 02273 ENUMDOC 02274 Create PLT entry. 02275 ENUM 02276 BFD_RELOC_MN10300_RELATIVE 02277 ENUMDOC 02278 Adjust by program base. 02279 COMMENT 02280 02281 ENUM 02282 BFD_RELOC_386_GOT32 02283 ENUMX 02284 BFD_RELOC_386_PLT32 02285 ENUMX 02286 BFD_RELOC_386_COPY 02287 ENUMX 02288 BFD_RELOC_386_GLOB_DAT 02289 ENUMX 02290 BFD_RELOC_386_JUMP_SLOT 02291 ENUMX 02292 BFD_RELOC_386_RELATIVE 02293 ENUMX 02294 BFD_RELOC_386_GOTOFF 02295 ENUMX 02296 BFD_RELOC_386_GOTPC 02297 ENUMX 02298 BFD_RELOC_386_TLS_TPOFF 02299 ENUMX 02300 BFD_RELOC_386_TLS_IE 02301 ENUMX 02302 BFD_RELOC_386_TLS_GOTIE 02303 ENUMX 02304 BFD_RELOC_386_TLS_LE 02305 ENUMX 02306 BFD_RELOC_386_TLS_GD 02307 ENUMX 02308 BFD_RELOC_386_TLS_LDM 02309 ENUMX 02310 BFD_RELOC_386_TLS_LDO_32 02311 ENUMX 02312 BFD_RELOC_386_TLS_IE_32 02313 ENUMX 02314 BFD_RELOC_386_TLS_LE_32 02315 ENUMX 02316 BFD_RELOC_386_TLS_DTPMOD32 02317 ENUMX 02318 BFD_RELOC_386_TLS_DTPOFF32 02319 ENUMX 02320 BFD_RELOC_386_TLS_TPOFF32 02321 ENUMDOC 02322 i386/elf relocations 02323 02324 ENUM 02325 BFD_RELOC_X86_64_GOT32 02326 ENUMX 02327 BFD_RELOC_X86_64_PLT32 02328 ENUMX 02329 BFD_RELOC_X86_64_COPY 02330 ENUMX 02331 BFD_RELOC_X86_64_GLOB_DAT 02332 ENUMX 02333 BFD_RELOC_X86_64_JUMP_SLOT 02334 ENUMX 02335 BFD_RELOC_X86_64_RELATIVE 02336 ENUMX 02337 BFD_RELOC_X86_64_GOTPCREL 02338 ENUMX 02339 BFD_RELOC_X86_64_32S 02340 ENUMX 02341 BFD_RELOC_X86_64_DTPMOD64 02342 ENUMX 02343 BFD_RELOC_X86_64_DTPOFF64 02344 ENUMX 02345 BFD_RELOC_X86_64_TPOFF64 02346 ENUMX 02347 BFD_RELOC_X86_64_TLSGD 02348 ENUMX 02349 BFD_RELOC_X86_64_TLSLD 02350 ENUMX 02351 BFD_RELOC_X86_64_DTPOFF32 02352 ENUMX 02353 BFD_RELOC_X86_64_GOTTPOFF 02354 ENUMX 02355 BFD_RELOC_X86_64_TPOFF32 02356 ENUMDOC 02357 x86-64/elf relocations 02358 02359 ENUM 02360 BFD_RELOC_NS32K_IMM_8 02361 ENUMX 02362 BFD_RELOC_NS32K_IMM_16 02363 ENUMX 02364 BFD_RELOC_NS32K_IMM_32 02365 ENUMX 02366 BFD_RELOC_NS32K_IMM_8_PCREL 02367 ENUMX 02368 BFD_RELOC_NS32K_IMM_16_PCREL 02369 ENUMX 02370 BFD_RELOC_NS32K_IMM_32_PCREL 02371 ENUMX 02372 BFD_RELOC_NS32K_DISP_8 02373 ENUMX 02374 BFD_RELOC_NS32K_DISP_16 02375 ENUMX 02376 BFD_RELOC_NS32K_DISP_32 02377 ENUMX 02378 BFD_RELOC_NS32K_DISP_8_PCREL 02379 ENUMX 02380 BFD_RELOC_NS32K_DISP_16_PCREL 02381 ENUMX 02382 BFD_RELOC_NS32K_DISP_32_PCREL 02383 ENUMDOC 02384 ns32k relocations 02385 02386 ENUM 02387 BFD_RELOC_PDP11_DISP_8_PCREL 02388 ENUMX 02389 BFD_RELOC_PDP11_DISP_6_PCREL 02390 ENUMDOC 02391 PDP11 relocations 02392 02393 ENUM 02394 BFD_RELOC_PJ_CODE_HI16 02395 ENUMX 02396 BFD_RELOC_PJ_CODE_LO16 02397 ENUMX 02398 BFD_RELOC_PJ_CODE_DIR16 02399 ENUMX 02400 BFD_RELOC_PJ_CODE_DIR32 02401 ENUMX 02402 BFD_RELOC_PJ_CODE_REL16 02403 ENUMX 02404 BFD_RELOC_PJ_CODE_REL32 02405 ENUMDOC 02406 Picojava relocs. Not all of these appear in object files. 02407 02408 ENUM 02409 BFD_RELOC_PPC_B26 02410 ENUMX 02411 BFD_RELOC_PPC_BA26 02412 ENUMX 02413 BFD_RELOC_PPC_TOC16 02414 ENUMX 02415 BFD_RELOC_PPC_B16 02416 ENUMX 02417 BFD_RELOC_PPC_B16_BRTAKEN 02418 ENUMX 02419 BFD_RELOC_PPC_B16_BRNTAKEN 02420 ENUMX 02421 BFD_RELOC_PPC_BA16 02422 ENUMX 02423 BFD_RELOC_PPC_BA16_BRTAKEN 02424 ENUMX 02425 BFD_RELOC_PPC_BA16_BRNTAKEN 02426 ENUMX 02427 BFD_RELOC_PPC_COPY 02428 ENUMX 02429 BFD_RELOC_PPC_GLOB_DAT 02430 ENUMX 02431 BFD_RELOC_PPC_JMP_SLOT 02432 ENUMX 02433 BFD_RELOC_PPC_RELATIVE 02434 ENUMX 02435 BFD_RELOC_PPC_LOCAL24PC 02436 ENUMX 02437 BFD_RELOC_PPC_EMB_NADDR32 02438 ENUMX 02439 BFD_RELOC_PPC_EMB_NADDR16 02440 ENUMX 02441 BFD_RELOC_PPC_EMB_NADDR16_LO 02442 ENUMX 02443 BFD_RELOC_PPC_EMB_NADDR16_HI 02444 ENUMX 02445 BFD_RELOC_PPC_EMB_NADDR16_HA 02446 ENUMX 02447 BFD_RELOC_PPC_EMB_SDAI16 02448 ENUMX 02449 BFD_RELOC_PPC_EMB_SDA2I16 02450 ENUMX 02451 BFD_RELOC_PPC_EMB_SDA2REL 02452 ENUMX 02453 BFD_RELOC_PPC_EMB_SDA21 02454 ENUMX 02455 BFD_RELOC_PPC_EMB_MRKREF 02456 ENUMX 02457 BFD_RELOC_PPC_EMB_RELSEC16 02458 ENUMX 02459 BFD_RELOC_PPC_EMB_RELST_LO 02460 ENUMX 02461 BFD_RELOC_PPC_EMB_RELST_HI 02462 ENUMX 02463 BFD_RELOC_PPC_EMB_RELST_HA 02464 ENUMX 02465 BFD_RELOC_PPC_EMB_BIT_FLD 02466 ENUMX 02467 BFD_RELOC_PPC_EMB_RELSDA 02468 ENUMX 02469 BFD_RELOC_PPC64_HIGHER 02470 ENUMX 02471 BFD_RELOC_PPC64_HIGHER_S 02472 ENUMX 02473 BFD_RELOC_PPC64_HIGHEST 02474 ENUMX 02475 BFD_RELOC_PPC64_HIGHEST_S 02476 ENUMX 02477 BFD_RELOC_PPC64_TOC16_LO 02478 ENUMX 02479 BFD_RELOC_PPC64_TOC16_HI 02480 ENUMX 02481 BFD_RELOC_PPC64_TOC16_HA 02482 ENUMX 02483 BFD_RELOC_PPC64_TOC 02484 ENUMX 02485 BFD_RELOC_PPC64_PLTGOT16 02486 ENUMX 02487 BFD_RELOC_PPC64_PLTGOT16_LO 02488 ENUMX 02489 BFD_RELOC_PPC64_PLTGOT16_HI 02490 ENUMX 02491 BFD_RELOC_PPC64_PLTGOT16_HA 02492 ENUMX 02493 BFD_RELOC_PPC64_ADDR16_DS 02494 ENUMX 02495 BFD_RELOC_PPC64_ADDR16_LO_DS 02496 ENUMX 02497 BFD_RELOC_PPC64_GOT16_DS 02498 ENUMX 02499 BFD_RELOC_PPC64_GOT16_LO_DS 02500 ENUMX 02501 BFD_RELOC_PPC64_PLT16_LO_DS 02502 ENUMX 02503 BFD_RELOC_PPC64_SECTOFF_DS 02504 ENUMX 02505 BFD_RELOC_PPC64_SECTOFF_LO_DS 02506 ENUMX 02507 BFD_RELOC_PPC64_TOC16_DS 02508 ENUMX 02509 BFD_RELOC_PPC64_TOC16_LO_DS 02510 ENUMX 02511 BFD_RELOC_PPC64_PLTGOT16_DS 02512 ENUMX 02513 BFD_RELOC_PPC64_PLTGOT16_LO_DS 02514 ENUMDOC 02515 Power(rs6000) and PowerPC relocations. 02516 02517 ENUM 02518 BFD_RELOC_PPC_TLS 02519 ENUMX 02520 BFD_RELOC_PPC_DTPMOD 02521 ENUMX 02522 BFD_RELOC_PPC_TPREL16 02523 ENUMX 02524 BFD_RELOC_PPC_TPREL16_LO 02525 ENUMX 02526 BFD_RELOC_PPC_TPREL16_HI 02527 ENUMX 02528 BFD_RELOC_PPC_TPREL16_HA 02529 ENUMX 02530 BFD_RELOC_PPC_TPREL 02531 ENUMX 02532 BFD_RELOC_PPC_DTPREL16 02533 ENUMX 02534 BFD_RELOC_PPC_DTPREL16_LO 02535 ENUMX 02536 BFD_RELOC_PPC_DTPREL16_HI 02537 ENUMX 02538 BFD_RELOC_PPC_DTPREL16_HA 02539 ENUMX 02540 BFD_RELOC_PPC_DTPREL 02541 ENUMX 02542 BFD_RELOC_PPC_GOT_TLSGD16 02543 ENUMX 02544 BFD_RELOC_PPC_GOT_TLSGD16_LO 02545 ENUMX 02546 BFD_RELOC_PPC_GOT_TLSGD16_HI 02547 ENUMX 02548 BFD_RELOC_PPC_GOT_TLSGD16_HA 02549 ENUMX 02550 BFD_RELOC_PPC_GOT_TLSLD16 02551 ENUMX 02552 BFD_RELOC_PPC_GOT_TLSLD16_LO 02553 ENUMX 02554 BFD_RELOC_PPC_GOT_TLSLD16_HI 02555 ENUMX 02556 BFD_RELOC_PPC_GOT_TLSLD16_HA 02557 ENUMX 02558 BFD_RELOC_PPC_GOT_TPREL16 02559 ENUMX 02560 BFD_RELOC_PPC_GOT_TPREL16_LO 02561 ENUMX 02562 BFD_RELOC_PPC_GOT_TPREL16_HI 02563 ENUMX 02564 BFD_RELOC_PPC_GOT_TPREL16_HA 02565 ENUMX 02566 BFD_RELOC_PPC_GOT_DTPREL16 02567 ENUMX 02568 BFD_RELOC_PPC_GOT_DTPREL16_LO 02569 ENUMX 02570 BFD_RELOC_PPC_GOT_DTPREL16_HI 02571 ENUMX 02572 BFD_RELOC_PPC_GOT_DTPREL16_HA 02573 ENUMX 02574 BFD_RELOC_PPC64_TPREL16_DS 02575 ENUMX 02576 BFD_RELOC_PPC64_TPREL16_LO_DS 02577 ENUMX 02578 BFD_RELOC_PPC64_TPREL16_HIGHER 02579 ENUMX 02580 BFD_RELOC_PPC64_TPREL16_HIGHERA 02581 ENUMX 02582 BFD_RELOC_PPC64_TPREL16_HIGHEST 02583 ENUMX 02584 BFD_RELOC_PPC64_TPREL16_HIGHESTA 02585 ENUMX 02586 BFD_RELOC_PPC64_DTPREL16_DS 02587 ENUMX 02588 BFD_RELOC_PPC64_DTPREL16_LO_DS 02589 ENUMX 02590 BFD_RELOC_PPC64_DTPREL16_HIGHER 02591 ENUMX 02592 BFD_RELOC_PPC64_DTPREL16_HIGHERA 02593 ENUMX 02594 BFD_RELOC_PPC64_DTPREL16_HIGHEST 02595 ENUMX 02596 BFD_RELOC_PPC64_DTPREL16_HIGHESTA 02597 ENUMDOC 02598 PowerPC and PowerPC64 thread-local storage relocations. 02599 02600 ENUM 02601 BFD_RELOC_I370_D12 02602 ENUMDOC 02603 IBM 370/390 relocations 02604 02605 ENUM 02606 BFD_RELOC_CTOR 02607 ENUMDOC 02608 The type of reloc used to build a constructor table - at the moment 02609 probably a 32 bit wide absolute relocation, but the target can choose. 02610 It generally does map to one of the other relocation types. 02611 02612 ENUM 02613 BFD_RELOC_ARM_PCREL_BRANCH 02614 ENUMDOC 02615 ARM 26 bit pc-relative branch. The lowest two bits must be zero and are 02616 not stored in the instruction. 02617 ENUM 02618 BFD_RELOC_ARM_PCREL_BLX 02619 ENUMDOC 02620 ARM 26 bit pc-relative branch. The lowest bit must be zero and is 02621 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 02622 field in the instruction. 02623 ENUM 02624 BFD_RELOC_THUMB_PCREL_BLX 02625 ENUMDOC 02626 Thumb 22 bit pc-relative branch. The lowest bit must be zero and is 02627 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 02628 field in the instruction. 02629 ENUM 02630 BFD_RELOC_ARM_IMMEDIATE 02631 ENUMX 02632 BFD_RELOC_ARM_ADRL_IMMEDIATE 02633 ENUMX 02634 BFD_RELOC_ARM_OFFSET_IMM 02635 ENUMX 02636 BFD_RELOC_ARM_SHIFT_IMM 02637 ENUMX 02638 BFD_RELOC_ARM_SMI 02639 ENUMX 02640 BFD_RELOC_ARM_SWI 02641 ENUMX 02642 BFD_RELOC_ARM_MULTI 02643 ENUMX 02644 BFD_RELOC_ARM_CP_OFF_IMM 02645 ENUMX 02646 BFD_RELOC_ARM_CP_OFF_IMM_S2 02647 ENUMX 02648 BFD_RELOC_ARM_ADR_IMM 02649 ENUMX 02650 BFD_RELOC_ARM_LDR_IMM 02651 ENUMX 02652 BFD_RELOC_ARM_LITERAL 02653 ENUMX 02654 BFD_RELOC_ARM_IN_POOL 02655 ENUMX 02656 BFD_RELOC_ARM_OFFSET_IMM8 02657 ENUMX 02658 BFD_RELOC_ARM_HWLITERAL 02659 ENUMX 02660 BFD_RELOC_ARM_THUMB_ADD 02661 ENUMX 02662 BFD_RELOC_ARM_THUMB_IMM 02663 ENUMX 02664 BFD_RELOC_ARM_THUMB_SHIFT 02665 ENUMX 02666 BFD_RELOC_ARM_THUMB_OFFSET 02667 ENUMX 02668 BFD_RELOC_ARM_GOT12 02669 ENUMX 02670 BFD_RELOC_ARM_GOT32 02671 ENUMX 02672 BFD_RELOC_ARM_JUMP_SLOT 02673 ENUMX 02674 BFD_RELOC_ARM_COPY 02675 ENUMX 02676 BFD_RELOC_ARM_GLOB_DAT 02677 ENUMX 02678 BFD_RELOC_ARM_PLT32 02679 ENUMX 02680 BFD_RELOC_ARM_RELATIVE 02681 ENUMX 02682 BFD_RELOC_ARM_GOTOFF 02683 ENUMX 02684 BFD_RELOC_ARM_GOTPC 02685 ENUMDOC 02686 These relocs are only used within the ARM assembler. They are not 02687 (at present) written to any object files. 02688 ENUM 02689 BFD_RELOC_ARM_TARGET1 02690 ENUMDOC 02691 Pc-relative or absolute relocation depending on target. Used for 02692 entries in .init_array sections. 02693 ENUM 02694 BFD_RELOC_ARM_ROSEGREL32 02695 ENUMDOC 02696 Read-only segment base relative address. 02697 ENUM 02698 BFD_RELOC_ARM_SBREL32 02699 ENUMDOC 02700 Data segment base relative address. 02701 ENUM 02702 BFD_RELOC_ARM_TARGET2 02703 ENUMDOC 02704 This reloc is used for References to RTTI dta from exception handling 02705 tables. The actual definition depends on the target. It may be a 02706 pc-relative or some form of GOT-indirect relocation. 02707 ENUM 02708 BFD_RELOC_ARM_PREL31 02709 ENUMDOC 02710 31-bit PC relative address. 02711 02712 ENUM 02713 BFD_RELOC_SH_PCDISP8BY2 02714 ENUMX 02715 BFD_RELOC_SH_PCDISP12BY2 02716 ENUMX 02717 BFD_RELOC_SH_IMM3 02718 ENUMX 02719 BFD_RELOC_SH_IMM3U 02720 ENUMX 02721 BFD_RELOC_SH_DISP12 02722 ENUMX 02723 BFD_RELOC_SH_DISP12BY2 02724 ENUMX 02725 BFD_RELOC_SH_DISP12BY4 02726 ENUMX 02727 BFD_RELOC_SH_DISP12BY8 02728 ENUMX 02729 BFD_RELOC_SH_DISP20 02730 ENUMX 02731 BFD_RELOC_SH_DISP20BY8 02732 ENUMX 02733 BFD_RELOC_SH_IMM4 02734 ENUMX 02735 BFD_RELOC_SH_IMM4BY2 02736 ENUMX 02737 BFD_RELOC_SH_IMM4BY4 02738 ENUMX 02739 BFD_RELOC_SH_IMM8 02740 ENUMX 02741 BFD_RELOC_SH_IMM8BY2 02742 ENUMX 02743 BFD_RELOC_SH_IMM8BY4 02744 ENUMX 02745 BFD_RELOC_SH_PCRELIMM8BY2 02746 ENUMX 02747 BFD_RELOC_SH_PCRELIMM8BY4 02748 ENUMX 02749 BFD_RELOC_SH_SWITCH16 02750 ENUMX 02751 BFD_RELOC_SH_SWITCH32 02752 ENUMX 02753 BFD_RELOC_SH_USES 02754 ENUMX 02755 BFD_RELOC_SH_COUNT 02756 ENUMX 02757 BFD_RELOC_SH_ALIGN 02758 ENUMX 02759 BFD_RELOC_SH_CODE 02760 ENUMX 02761 BFD_RELOC_SH_DATA 02762 ENUMX 02763 BFD_RELOC_SH_LABEL 02764 ENUMX 02765 BFD_RELOC_SH_LOOP_START 02766 ENUMX 02767 BFD_RELOC_SH_LOOP_END 02768 ENUMX 02769 BFD_RELOC_SH_COPY 02770 ENUMX 02771 BFD_RELOC_SH_GLOB_DAT 02772 ENUMX 02773 BFD_RELOC_SH_JMP_SLOT 02774 ENUMX 02775 BFD_RELOC_SH_RELATIVE 02776 ENUMX 02777 BFD_RELOC_SH_GOTPC 02778 ENUMX 02779 BFD_RELOC_SH_GOT_LOW16 02780 ENUMX 02781 BFD_RELOC_SH_GOT_MEDLOW16 02782 ENUMX 02783 BFD_RELOC_SH_GOT_MEDHI16 02784 ENUMX 02785 BFD_RELOC_SH_GOT_HI16 02786 ENUMX 02787 BFD_RELOC_SH_GOTPLT_LOW16 02788 ENUMX 02789 BFD_RELOC_SH_GOTPLT_MEDLOW16 02790 ENUMX 02791 BFD_RELOC_SH_GOTPLT_MEDHI16 02792 ENUMX 02793 BFD_RELOC_SH_GOTPLT_HI16 02794 ENUMX 02795 BFD_RELOC_SH_PLT_LOW16 02796 ENUMX 02797 BFD_RELOC_SH_PLT_MEDLOW16 02798 ENUMX 02799 BFD_RELOC_SH_PLT_MEDHI16 02800 ENUMX 02801 BFD_RELOC_SH_PLT_HI16 02802 ENUMX 02803 BFD_RELOC_SH_GOTOFF_LOW16 02804 ENUMX 02805 BFD_RELOC_SH_GOTOFF_MEDLOW16 02806 ENUMX 02807 BFD_RELOC_SH_GOTOFF_MEDHI16 02808 ENUMX 02809 BFD_RELOC_SH_GOTOFF_HI16 02810 ENUMX 02811 BFD_RELOC_SH_GOTPC_LOW16 02812 ENUMX 02813 BFD_RELOC_SH_GOTPC_MEDLOW16 02814 ENUMX 02815 BFD_RELOC_SH_GOTPC_MEDHI16 02816 ENUMX 02817 BFD_RELOC_SH_GOTPC_HI16 02818 ENUMX 02819 BFD_RELOC_SH_COPY64 02820 ENUMX 02821 BFD_RELOC_SH_GLOB_DAT64 02822 ENUMX 02823 BFD_RELOC_SH_JMP_SLOT64 02824 ENUMX 02825 BFD_RELOC_SH_RELATIVE64 02826 ENUMX 02827 BFD_RELOC_SH_GOT10BY4 02828 ENUMX 02829 BFD_RELOC_SH_GOT10BY8 02830 ENUMX 02831 BFD_RELOC_SH_GOTPLT10BY4 02832 ENUMX 02833 BFD_RELOC_SH_GOTPLT10BY8 02834 ENUMX 02835 BFD_RELOC_SH_GOTPLT32 02836 ENUMX 02837 BFD_RELOC_SH_SHMEDIA_CODE 02838 ENUMX 02839 BFD_RELOC_SH_IMMU5 02840 ENUMX 02841 BFD_RELOC_SH_IMMS6 02842 ENUMX 02843 BFD_RELOC_SH_IMMS6BY32 02844 ENUMX 02845 BFD_RELOC_SH_IMMU6 02846 ENUMX 02847 BFD_RELOC_SH_IMMS10 02848 ENUMX 02849 BFD_RELOC_SH_IMMS10BY2 02850 ENUMX 02851 BFD_RELOC_SH_IMMS10BY4 02852 ENUMX 02853 BFD_RELOC_SH_IMMS10BY8 02854 ENUMX 02855 BFD_RELOC_SH_IMMS16 02856 ENUMX 02857 BFD_RELOC_SH_IMMU16 02858 ENUMX 02859 BFD_RELOC_SH_IMM_LOW16 02860 ENUMX 02861 BFD_RELOC_SH_IMM_LOW16_PCREL 02862 ENUMX 02863 BFD_RELOC_SH_IMM_MEDLOW16 02864 ENUMX 02865 BFD_RELOC_SH_IMM_MEDLOW16_PCREL 02866 ENUMX 02867 BFD_RELOC_SH_IMM_MEDHI16 02868 ENUMX 02869 BFD_RELOC_SH_IMM_MEDHI16_PCREL 02870 ENUMX 02871 BFD_RELOC_SH_IMM_HI16 02872 ENUMX 02873 BFD_RELOC_SH_IMM_HI16_PCREL 02874 ENUMX 02875 BFD_RELOC_SH_PT_16 02876 ENUMX 02877 BFD_RELOC_SH_TLS_GD_32 02878 ENUMX 02879 BFD_RELOC_SH_TLS_LD_32 02880 ENUMX 02881 BFD_RELOC_SH_TLS_LDO_32 02882 ENUMX 02883 BFD_RELOC_SH_TLS_IE_32 02884 ENUMX 02885 BFD_RELOC_SH_TLS_LE_32 02886 ENUMX 02887 BFD_RELOC_SH_TLS_DTPMOD32 02888 ENUMX 02889 BFD_RELOC_SH_TLS_DTPOFF32 02890 ENUMX 02891 BFD_RELOC_SH_TLS_TPOFF32 02892 ENUMDOC 02893 Renesas / SuperH SH relocs. Not all of these appear in object files. 02894 02895 ENUM 02896 BFD_RELOC_THUMB_PCREL_BRANCH9 02897 ENUMX 02898 BFD_RELOC_THUMB_PCREL_BRANCH12 02899 ENUMX 02900 BFD_RELOC_THUMB_PCREL_BRANCH23 02901 ENUMDOC 02902 Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must 02903 be zero and is not stored in the instruction. 02904 02905 ENUM 02906 BFD_RELOC_ARC_B22_PCREL 02907 ENUMDOC 02908 ARC Cores relocs. 02909 ARC 22 bit pc-relative branch. The lowest two bits must be zero and are 02910 not stored in the instruction. The high 20 bits are installed in bits 26 02911 through 7 of the instruction. 02912 ENUM 02913 BFD_RELOC_ARC_B26 02914 ENUMDOC 02915 ARC 26 bit absolute branch. The lowest two bits must be zero and are not 02916 stored in the instruction. The high 24 bits are installed in bits 23 02917 through 0. 02918 02919 ENUM 02920 BFD_RELOC_D10V_10_PCREL_R 02921 ENUMDOC 02922 Mitsubishi D10V relocs. 02923 This is a 10-bit reloc with the right 2 bits 02924 assumed to be 0. 02925 ENUM 02926 BFD_RELOC_D10V_10_PCREL_L 02927 ENUMDOC 02928 Mitsubishi D10V relocs. 02929 This is a 10-bit reloc with the right 2 bits 02930 assumed to be 0. This is the same as the previous reloc 02931 except it is in the left container, i.e., 02932 shifted left 15 bits. 02933 ENUM 02934 BFD_RELOC_D10V_18 02935 ENUMDOC 02936 This is an 18-bit reloc with the right 2 bits 02937 assumed to be 0. 02938 ENUM 02939 BFD_RELOC_D10V_18_PCREL 02940 ENUMDOC 02941 This is an 18-bit reloc with the right 2 bits 02942 assumed to be 0. 02943 02944 ENUM 02945 BFD_RELOC_D30V_6 02946 ENUMDOC 02947 Mitsubishi D30V relocs. 02948 This is a 6-bit absolute reloc. 02949 ENUM 02950 BFD_RELOC_D30V_9_PCREL 02951 ENUMDOC 02952 This is a 6-bit pc-relative reloc with 02953 the right 3 bits assumed to be 0. 02954 ENUM 02955 BFD_RELOC_D30V_9_PCREL_R 02956 ENUMDOC 02957 This is a 6-bit pc-relative reloc with 02958 the right 3 bits assumed to be 0. Same 02959 as the previous reloc but on the right side 02960 of the container. 02961 ENUM 02962 BFD_RELOC_D30V_15 02963 ENUMDOC 02964 This is a 12-bit absolute reloc with the 02965 right 3 bitsassumed to be 0. 02966 ENUM 02967 BFD_RELOC_D30V_15_PCREL 02968 ENUMDOC 02969 This is a 12-bit pc-relative reloc with 02970 the right 3 bits assumed to be 0. 02971 ENUM 02972 BFD_RELOC_D30V_15_PCREL_R 02973 ENUMDOC 02974 This is a 12-bit pc-relative reloc with 02975 the right 3 bits assumed to be 0. Same 02976 as the previous reloc but on the right side 02977 of the container. 02978 ENUM 02979 BFD_RELOC_D30V_21 02980 ENUMDOC 02981 This is an 18-bit absolute reloc with 02982 the right 3 bits assumed to be 0. 02983 ENUM 02984 BFD_RELOC_D30V_21_PCREL 02985 ENUMDOC 02986 This is an 18-bit pc-relative reloc with 02987 the right 3 bits assumed to be 0. 02988 ENUM 02989 BFD_RELOC_D30V_21_PCREL_R 02990 ENUMDOC 02991 This is an 18-bit pc-relative reloc with 02992 the right 3 bits assumed to be 0. Same 02993 as the previous reloc but on the right side 02994 of the container. 02995 ENUM 02996 BFD_RELOC_D30V_32 02997 ENUMDOC 02998 This is a 32-bit absolute reloc. 02999 ENUM 03000 BFD_RELOC_D30V_32_PCREL 03001 ENUMDOC 03002 This is a 32-bit pc-relative reloc. 03003 03004 ENUM 03005 BFD_RELOC_DLX_HI16_S 03006 ENUMDOC 03007 DLX relocs 03008 ENUM 03009 BFD_RELOC_DLX_LO16 03010 ENUMDOC 03011 DLX relocs 03012 ENUM 03013 BFD_RELOC_DLX_JMP26 03014 ENUMDOC 03015 DLX relocs 03016 03017 ENUM 03018 BFD_RELOC_M32R_24 03019 ENUMDOC 03020 Renesas M32R (formerly Mitsubishi M32R) relocs. 03021 This is a 24 bit absolute address. 03022 ENUM 03023 BFD_RELOC_M32R_10_PCREL 03024 ENUMDOC 03025 This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. 03026 ENUM 03027 BFD_RELOC_M32R_18_PCREL 03028 ENUMDOC 03029 This is an 18-bit reloc with the right 2 bits assumed to be 0. 03030 ENUM 03031 BFD_RELOC_M32R_26_PCREL 03032 ENUMDOC 03033 This is a 26-bit reloc with the right 2 bits assumed to be 0. 03034 ENUM 03035 BFD_RELOC_M32R_HI16_ULO 03036 ENUMDOC 03037 This is a 16-bit reloc containing the high 16 bits of an address 03038 used when the lower 16 bits are treated as unsigned. 03039 ENUM 03040 BFD_RELOC_M32R_HI16_SLO 03041 ENUMDOC 03042 This is a 16-bit reloc containing the high 16 bits of an address 03043 used when the lower 16 bits are treated as signed. 03044 ENUM 03045 BFD_RELOC_M32R_LO16 03046 ENUMDOC 03047 This is a 16-bit reloc containing the lower 16 bits of an address. 03048 ENUM 03049 BFD_RELOC_M32R_SDA16 03050 ENUMDOC 03051 This is a 16-bit reloc containing the small data area offset for use in 03052 add3, load, and store instructions. 03053 ENUM 03054 BFD_RELOC_M32R_GOT24 03055 ENUMX 03056 BFD_RELOC_M32R_26_PLTREL 03057 ENUMX 03058 BFD_RELOC_M32R_COPY 03059 ENUMX 03060 BFD_RELOC_M32R_GLOB_DAT 03061 ENUMX 03062 BFD_RELOC_M32R_JMP_SLOT 03063 ENUMX 03064 BFD_RELOC_M32R_RELATIVE 03065 ENUMX 03066 BFD_RELOC_M32R_GOTOFF 03067 ENUMX 03068 BFD_RELOC_M32R_GOTOFF_HI_ULO 03069 ENUMX 03070 BFD_RELOC_M32R_GOTOFF_HI_SLO 03071 ENUMX 03072 BFD_RELOC_M32R_GOTOFF_LO 03073 ENUMX 03074 BFD_RELOC_M32R_GOTPC24 03075 ENUMX 03076 BFD_RELOC_M32R_GOT16_HI_ULO 03077 ENUMX 03078 BFD_RELOC_M32R_GOT16_HI_SLO 03079 ENUMX 03080 BFD_RELOC_M32R_GOT16_LO 03081 ENUMX 03082 BFD_RELOC_M32R_GOTPC_HI_ULO 03083 ENUMX 03084 BFD_RELOC_M32R_GOTPC_HI_SLO 03085 ENUMX 03086 BFD_RELOC_M32R_GOTPC_LO 03087 ENUMDOC 03088 For PIC. 03089 03090 03091 ENUM 03092 BFD_RELOC_V850_9_PCREL 03093 ENUMDOC 03094 This is a 9-bit reloc 03095 ENUM 03096 BFD_RELOC_V850_22_PCREL 03097 ENUMDOC 03098 This is a 22-bit reloc 03099 03100 ENUM 03101 BFD_RELOC_V850_SDA_16_16_OFFSET 03102 ENUMDOC 03103 This is a 16 bit offset from the short data area pointer. 03104 ENUM 03105 BFD_RELOC_V850_SDA_15_16_OFFSET 03106 ENUMDOC 03107 This is a 16 bit offset (of which only 15 bits are used) from the 03108 short data area pointer. 03109 ENUM 03110 BFD_RELOC_V850_ZDA_16_16_OFFSET 03111 ENUMDOC 03112 This is a 16 bit offset from the zero data area pointer. 03113 ENUM 03114 BFD_RELOC_V850_ZDA_15_16_OFFSET 03115 ENUMDOC 03116 This is a 16 bit offset (of which only 15 bits are used) from the 03117 zero data area pointer. 03118 ENUM 03119 BFD_RELOC_V850_TDA_6_8_OFFSET 03120 ENUMDOC 03121 This is an 8 bit offset (of which only 6 bits are used) from the 03122 tiny data area pointer. 03123 ENUM 03124 BFD_RELOC_V850_TDA_7_8_OFFSET 03125 ENUMDOC 03126 This is an 8bit offset (of which only 7 bits are used) from the tiny 03127 data area pointer. 03128 ENUM 03129 BFD_RELOC_V850_TDA_7_7_OFFSET 03130 ENUMDOC 03131 This is a 7 bit offset from the tiny data area pointer. 03132 ENUM 03133 BFD_RELOC_V850_TDA_16_16_OFFSET 03134 ENUMDOC 03135 This is a 16 bit offset from the tiny data area pointer. 03136 COMMENT 03137 ENUM 03138 BFD_RELOC_V850_TDA_4_5_OFFSET 03139 ENUMDOC 03140 This is a 5 bit offset (of which only 4 bits are used) from the tiny 03141 data area pointer. 03142 ENUM 03143 BFD_RELOC_V850_TDA_4_4_OFFSET 03144 ENUMDOC 03145 This is a 4 bit offset from the tiny data area pointer. 03146 ENUM 03147 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET 03148 ENUMDOC 03149 This is a 16 bit offset from the short data area pointer, with the 03150 bits placed non-contiguously in the instruction. 03151 ENUM 03152 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET 03153 ENUMDOC 03154 This is a 16 bit offset from the zero data area pointer, with the 03155 bits placed non-contiguously in the instruction. 03156 ENUM 03157 BFD_RELOC_V850_CALLT_6_7_OFFSET 03158 ENUMDOC 03159 This is a 6 bit offset from the call table base pointer. 03160 ENUM 03161 BFD_RELOC_V850_CALLT_16_16_OFFSET 03162 ENUMDOC 03163 This is a 16 bit offset from the call table base pointer. 03164 ENUM 03165 BFD_RELOC_V850_LONGCALL 03166 ENUMDOC 03167 Used for relaxing indirect function calls. 03168 ENUM 03169 BFD_RELOC_V850_LONGJUMP 03170 ENUMDOC 03171 Used for relaxing indirect jumps. 03172 ENUM 03173 BFD_RELOC_V850_ALIGN 03174 ENUMDOC 03175 Used to maintain alignment whilst relaxing. 03176 ENUM 03177 BFD_RELOC_V850_LO16_SPLIT_OFFSET 03178 ENUMDOC 03179 This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu 03180 instructions. 03181 ENUM 03182 BFD_RELOC_MN10300_32_PCREL 03183 ENUMDOC 03184 This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the 03185 instruction. 03186 ENUM 03187 BFD_RELOC_MN10300_16_PCREL 03188 ENUMDOC 03189 This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the 03190 instruction. 03191 03192 ENUM 03193 BFD_RELOC_TIC30_LDP 03194 ENUMDOC 03195 This is a 8bit DP reloc for the tms320c30, where the most 03196 significant 8 bits of a 24 bit word are placed into the least 03197 significant 8 bits of the opcode. 03198 03199 ENUM 03200 BFD_RELOC_TIC54X_PARTLS7 03201 ENUMDOC 03202 This is a 7bit reloc for the tms320c54x, where the least 03203 significant 7 bits of a 16 bit word are placed into the least 03204 significant 7 bits of the opcode. 03205 03206 ENUM 03207 BFD_RELOC_TIC54X_PARTMS9 03208 ENUMDOC 03209 This is a 9bit DP reloc for the tms320c54x, where the most 03210 significant 9 bits of a 16 bit word are placed into the least 03211 significant 9 bits of the opcode. 03212 03213 ENUM 03214 BFD_RELOC_TIC54X_23 03215 ENUMDOC 03216 This is an extended address 23-bit reloc for the tms320c54x. 03217 03218 ENUM 03219 BFD_RELOC_TIC54X_16_OF_23 03220 ENUMDOC 03221 This is a 16-bit reloc for the tms320c54x, where the least 03222 significant 16 bits of a 23-bit extended address are placed into 03223 the opcode. 03224 03225 ENUM 03226 BFD_RELOC_TIC54X_MS7_OF_23 03227 ENUMDOC 03228 This is a reloc for the tms320c54x, where the most 03229 significant 7 bits of a 23-bit extended address are placed into 03230 the opcode. 03231 03232 ENUM 03233 BFD_RELOC_FR30_48 03234 ENUMDOC 03235 This is a 48 bit reloc for the FR30 that stores 32 bits. 03236 ENUM 03237 BFD_RELOC_FR30_20 03238 ENUMDOC 03239 This is a 32 bit reloc for the FR30 that stores 20 bits split up into 03240 two sections. 03241 ENUM 03242 BFD_RELOC_FR30_6_IN_4 03243 ENUMDOC 03244 This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in 03245 4 bits. 03246 ENUM 03247 BFD_RELOC_FR30_8_IN_8 03248 ENUMDOC 03249 This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset 03250 into 8 bits. 03251 ENUM 03252 BFD_RELOC_FR30_9_IN_8 03253 ENUMDOC 03254 This is a 16 bit reloc for the FR30 that stores a 9 bit short offset 03255 into 8 bits. 03256 ENUM 03257 BFD_RELOC_FR30_10_IN_8 03258 ENUMDOC 03259 This is a 16 bit reloc for the FR30 that stores a 10 bit word offset 03260 into 8 bits. 03261 ENUM 03262 BFD_RELOC_FR30_9_PCREL 03263 ENUMDOC 03264 This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 03265 short offset into 8 bits. 03266 ENUM 03267 BFD_RELOC_FR30_12_PCREL 03268 ENUMDOC 03269 This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative 03270 short offset into 11 bits. 03271 03272 ENUM 03273 BFD_RELOC_MCORE_PCREL_IMM8BY4 03274 ENUMX 03275 BFD_RELOC_MCORE_PCREL_IMM11BY2 03276 ENUMX 03277 BFD_RELOC_MCORE_PCREL_IMM4BY2 03278 ENUMX 03279 BFD_RELOC_MCORE_PCREL_32 03280 ENUMX 03281 BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 03282 ENUMX 03283 BFD_RELOC_MCORE_RVA 03284 ENUMDOC 03285 Motorola Mcore relocations. 03286 03287 ENUM 03288 BFD_RELOC_MMIX_GETA 03289 ENUMX 03290 BFD_RELOC_MMIX_GETA_1 03291 ENUMX 03292 BFD_RELOC_MMIX_GETA_2 03293 ENUMX 03294 BFD_RELOC_MMIX_GETA_3 03295 ENUMDOC 03296 These are relocations for the GETA instruction. 03297 ENUM 03298 BFD_RELOC_MMIX_CBRANCH 03299 ENUMX 03300 BFD_RELOC_MMIX_CBRANCH_J 03301 ENUMX 03302 BFD_RELOC_MMIX_CBRANCH_1 03303 ENUMX 03304 BFD_RELOC_MMIX_CBRANCH_2 03305 ENUMX 03306 BFD_RELOC_MMIX_CBRANCH_3 03307 ENUMDOC 03308 These are relocations for a conditional branch instruction. 03309 ENUM 03310 BFD_RELOC_MMIX_PUSHJ 03311 ENUMX 03312 BFD_RELOC_MMIX_PUSHJ_1 03313 ENUMX 03314 BFD_RELOC_MMIX_PUSHJ_2 03315 ENUMX 03316 BFD_RELOC_MMIX_PUSHJ_3 03317 ENUMX 03318 BFD_RELOC_MMIX_PUSHJ_STUBBABLE 03319 ENUMDOC 03320 These are relocations for the PUSHJ instruction. 03321 ENUM 03322 BFD_RELOC_MMIX_JMP 03323 ENUMX 03324 BFD_RELOC_MMIX_JMP_1 03325 ENUMX 03326 BFD_RELOC_MMIX_JMP_2 03327 ENUMX 03328 BFD_RELOC_MMIX_JMP_3 03329 ENUMDOC 03330 These are relocations for the JMP instruction. 03331 ENUM 03332 BFD_RELOC_MMIX_ADDR19 03333 ENUMDOC 03334 This is a relocation for a relative address as in a GETA instruction or 03335 a branch. 03336 ENUM 03337 BFD_RELOC_MMIX_ADDR27 03338 ENUMDOC 03339 This is a relocation for a relative address as in a JMP instruction. 03340 ENUM 03341 BFD_RELOC_MMIX_REG_OR_BYTE 03342 ENUMDOC 03343 This is a relocation for an instruction field that may be a general 03344 register or a value 0..255. 03345 ENUM 03346 BFD_RELOC_MMIX_REG 03347 ENUMDOC 03348 This is a relocation for an instruction field that may be a general 03349 register. 03350 ENUM 03351 BFD_RELOC_MMIX_BASE_PLUS_OFFSET 03352 ENUMDOC 03353 This is a relocation for two instruction fields holding a register and 03354 an offset, the equivalent of the relocation. 03355 ENUM 03356 BFD_RELOC_MMIX_LOCAL 03357 ENUMDOC 03358 This relocation is an assertion that the expression is not allocated as 03359 a global register. It does not modify contents. 03360 03361 ENUM 03362 BFD_RELOC_AVR_7_PCREL 03363 ENUMDOC 03364 This is a 16 bit reloc for the AVR that stores 8 bit pc relative 03365 short offset into 7 bits. 03366 ENUM 03367 BFD_RELOC_AVR_13_PCREL 03368 ENUMDOC 03369 This is a 16 bit reloc for the AVR that stores 13 bit pc relative 03370 short offset into 12 bits. 03371 ENUM 03372 BFD_RELOC_AVR_16_PM 03373 ENUMDOC 03374 This is a 16 bit reloc for the AVR that stores 17 bit value (usually 03375 program memory address) into 16 bits. 03376 ENUM 03377 BFD_RELOC_AVR_LO8_LDI 03378 ENUMDOC 03379 This is a 16 bit reloc for the AVR that stores 8 bit value (usually 03380 data memory address) into 8 bit immediate value of LDI insn. 03381 ENUM 03382 BFD_RELOC_AVR_HI8_LDI 03383 ENUMDOC 03384 This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 03385 of data memory address) into 8 bit immediate value of LDI insn. 03386 ENUM 03387 BFD_RELOC_AVR_HH8_LDI 03388 ENUMDOC 03389 This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 03390 of program memory address) into 8 bit immediate value of LDI insn. 03391 ENUM 03392 BFD_RELOC_AVR_LO8_LDI_NEG 03393 ENUMDOC 03394 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03395 (usually data memory address) into 8 bit immediate value of SUBI insn. 03396 ENUM 03397 BFD_RELOC_AVR_HI8_LDI_NEG 03398 ENUMDOC 03399 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03400 (high 8 bit of data memory address) into 8 bit immediate value of 03401 SUBI insn. 03402 ENUM 03403 BFD_RELOC_AVR_HH8_LDI_NEG 03404 ENUMDOC 03405 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03406 (most high 8 bit of program memory address) into 8 bit immediate value 03407 of LDI or SUBI insn. 03408 ENUM 03409 BFD_RELOC_AVR_LO8_LDI_PM 03410 ENUMDOC 03411 This is a 16 bit reloc for the AVR that stores 8 bit value (usually 03412 command address) into 8 bit immediate value of LDI insn. 03413 ENUM 03414 BFD_RELOC_AVR_HI8_LDI_PM 03415 ENUMDOC 03416 This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 03417 of command address) into 8 bit immediate value of LDI insn. 03418 ENUM 03419 BFD_RELOC_AVR_HH8_LDI_PM 03420 ENUMDOC 03421 This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 03422 of command address) into 8 bit immediate value of LDI insn. 03423 ENUM 03424 BFD_RELOC_AVR_LO8_LDI_PM_NEG 03425 ENUMDOC 03426 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03427 (usually command address) into 8 bit immediate value of SUBI insn. 03428 ENUM 03429 BFD_RELOC_AVR_HI8_LDI_PM_NEG 03430 ENUMDOC 03431 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03432 (high 8 bit of 16 bit command address) into 8 bit immediate value 03433 of SUBI insn. 03434 ENUM 03435 BFD_RELOC_AVR_HH8_LDI_PM_NEG 03436 ENUMDOC 03437 This is a 16 bit reloc for the AVR that stores negated 8 bit value 03438 (high 6 bit of 22 bit command address) into 8 bit immediate 03439 value of SUBI insn. 03440 ENUM 03441 BFD_RELOC_AVR_CALL 03442 ENUMDOC 03443 This is a 32 bit reloc for the AVR that stores 23 bit value 03444 into 22 bits. 03445 ENUM 03446 BFD_RELOC_AVR_LDI 03447 ENUMDOC 03448 This is a 16 bit reloc for the AVR that stores all needed bits 03449 for absolute addressing with ldi with overflow check to linktime 03450 ENUM 03451 BFD_RELOC_AVR_6 03452 ENUMDOC 03453 This is a 6 bit reloc for the AVR that stores offset for ldd/std 03454 instructions 03455 ENUM 03456 BFD_RELOC_AVR_6_ADIW 03457 ENUMDOC 03458 This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw 03459 instructions 03460 03461 ENUM 03462 BFD_RELOC_390_12 03463 ENUMDOC 03464 Direct 12 bit. 03465 ENUM 03466 BFD_RELOC_390_GOT12 03467 ENUMDOC 03468 12 bit GOT offset. 03469 ENUM 03470 BFD_RELOC_390_PLT32 03471 ENUMDOC 03472 32 bit PC relative PLT address. 03473 ENUM 03474 BFD_RELOC_390_COPY 03475 ENUMDOC 03476 Copy symbol at runtime. 03477 ENUM 03478 BFD_RELOC_390_GLOB_DAT 03479 ENUMDOC 03480 Create GOT entry. 03481 ENUM 03482 BFD_RELOC_390_JMP_SLOT 03483 ENUMDOC 03484 Create PLT entry. 03485 ENUM 03486 BFD_RELOC_390_RELATIVE 03487 ENUMDOC 03488 Adjust by program base. 03489 ENUM 03490 BFD_RELOC_390_GOTPC 03491 ENUMDOC 03492 32 bit PC relative offset to GOT. 03493 ENUM 03494 BFD_RELOC_390_GOT16 03495 ENUMDOC 03496 16 bit GOT offset. 03497 ENUM 03498 BFD_RELOC_390_PC16DBL 03499 ENUMDOC 03500 PC relative 16 bit shifted by 1. 03501 ENUM 03502 BFD_RELOC_390_PLT16DBL 03503 ENUMDOC 03504 16 bit PC rel. PLT shifted by 1. 03505 ENUM 03506 BFD_RELOC_390_PC32DBL 03507 ENUMDOC 03508 PC relative 32 bit shifted by 1. 03509 ENUM 03510 BFD_RELOC_390_PLT32DBL 03511 ENUMDOC 03512 32 bit PC rel. PLT shifted by 1. 03513 ENUM 03514 BFD_RELOC_390_GOTPCDBL 03515 ENUMDOC 03516 32 bit PC rel. GOT shifted by 1. 03517 ENUM 03518 BFD_RELOC_390_GOT64 03519 ENUMDOC 03520 64 bit GOT offset. 03521 ENUM 03522 BFD_RELOC_390_PLT64 03523 ENUMDOC 03524 64 bit PC relative PLT address. 03525 ENUM 03526 BFD_RELOC_390_GOTENT 03527 ENUMDOC 03528 32 bit rel. offset to GOT entry. 03529 ENUM 03530 BFD_RELOC_390_GOTOFF64 03531 ENUMDOC 03532 64 bit offset to GOT. 03533 ENUM 03534 BFD_RELOC_390_GOTPLT12 03535 ENUMDOC 03536 12-bit offset to symbol-entry within GOT, with PLT handling. 03537 ENUM 03538 BFD_RELOC_390_GOTPLT16 03539 ENUMDOC 03540 16-bit offset to symbol-entry within GOT, with PLT handling. 03541 ENUM 03542 BFD_RELOC_390_GOTPLT32 03543 ENUMDOC 03544 32-bit offset to symbol-entry within GOT, with PLT handling. 03545 ENUM 03546 BFD_RELOC_390_GOTPLT64 03547 ENUMDOC 03548 64-bit offset to symbol-entry within GOT, with PLT handling. 03549 ENUM 03550 BFD_RELOC_390_GOTPLTENT 03551 ENUMDOC 03552 32-bit rel. offset to symbol-entry within GOT, with PLT handling. 03553 ENUM 03554 BFD_RELOC_390_PLTOFF16 03555 ENUMDOC 03556 16-bit rel. offset from the GOT to a PLT entry. 03557 ENUM 03558 BFD_RELOC_390_PLTOFF32 03559 ENUMDOC 03560 32-bit rel. offset from the GOT to a PLT entry. 03561 ENUM 03562 BFD_RELOC_390_PLTOFF64 03563 ENUMDOC 03564 64-bit rel. offset from the GOT to a PLT entry. 03565 03566 ENUM 03567 BFD_RELOC_390_TLS_LOAD 03568 ENUMX 03569 BFD_RELOC_390_TLS_GDCALL 03570 ENUMX 03571 BFD_RELOC_390_TLS_LDCALL 03572 ENUMX 03573 BFD_RELOC_390_TLS_GD32 03574 ENUMX 03575 BFD_RELOC_390_TLS_GD64 03576 ENUMX 03577 BFD_RELOC_390_TLS_GOTIE12 03578 ENUMX 03579 BFD_RELOC_390_TLS_GOTIE32 03580 ENUMX 03581 BFD_RELOC_390_TLS_GOTIE64 03582 ENUMX 03583 BFD_RELOC_390_TLS_LDM32 03584 ENUMX 03585 BFD_RELOC_390_TLS_LDM64 03586 ENUMX 03587 BFD_RELOC_390_TLS_IE32 03588 ENUMX 03589 BFD_RELOC_390_TLS_IE64 03590 ENUMX 03591 BFD_RELOC_390_TLS_IEENT 03592 ENUMX 03593 BFD_RELOC_390_TLS_LE32 03594 ENUMX 03595 BFD_RELOC_390_TLS_LE64 03596 ENUMX 03597 BFD_RELOC_390_TLS_LDO32 03598 ENUMX 03599 BFD_RELOC_390_TLS_LDO64 03600 ENUMX 03601 BFD_RELOC_390_TLS_DTPMOD 03602 ENUMX 03603 BFD_RELOC_390_TLS_DTPOFF 03604 ENUMX 03605 BFD_RELOC_390_TLS_TPOFF 03606 ENUMDOC 03607 s390 tls relocations. 03608 03609 ENUM 03610 BFD_RELOC_390_20 03611 ENUMX 03612 BFD_RELOC_390_GOT20 03613 ENUMX 03614 BFD_RELOC_390_GOTPLT20 03615 ENUMX 03616 BFD_RELOC_390_TLS_GOTIE20 03617 ENUMDOC 03618 Long displacement extension. 03619 03620 ENUM 03621 BFD_RELOC_IP2K_FR9 03622 ENUMDOC 03623 Scenix IP2K - 9-bit register number / data address 03624 ENUM 03625 BFD_RELOC_IP2K_BANK 03626 ENUMDOC 03627 Scenix IP2K - 4-bit register/data bank number 03628 ENUM 03629 BFD_RELOC_IP2K_ADDR16CJP 03630 ENUMDOC 03631 Scenix IP2K - low 13 bits of instruction word address 03632 ENUM 03633 BFD_RELOC_IP2K_PAGE3 03634 ENUMDOC 03635 Scenix IP2K - high 3 bits of instruction word address 03636 ENUM 03637 BFD_RELOC_IP2K_LO8DATA 03638 ENUMX 03639 BFD_RELOC_IP2K_HI8DATA 03640 ENUMX 03641 BFD_RELOC_IP2K_EX8DATA 03642 ENUMDOC 03643 Scenix IP2K - ext/low/high 8 bits of data address 03644 ENUM 03645 BFD_RELOC_IP2K_LO8INSN 03646 ENUMX 03647 BFD_RELOC_IP2K_HI8INSN 03648 ENUMDOC 03649 Scenix IP2K - low/high 8 bits of instruction word address 03650 ENUM 03651 BFD_RELOC_IP2K_PC_SKIP 03652 ENUMDOC 03653 Scenix IP2K - even/odd PC modifier to modify snb pcl.0 03654 ENUM 03655 BFD_RELOC_IP2K_TEXT 03656 ENUMDOC 03657 Scenix IP2K - 16 bit word address in text section. 03658 ENUM 03659 BFD_RELOC_IP2K_FR_OFFSET 03660 ENUMDOC 03661 Scenix IP2K - 7-bit sp or dp offset 03662 ENUM 03663 BFD_RELOC_VPE4KMATH_DATA 03664 ENUMX 03665 BFD_RELOC_VPE4KMATH_INSN 03666 ENUMDOC 03667 Scenix VPE4K coprocessor - data/insn-space addressing 03668 03669 ENUM 03670 BFD_RELOC_VTABLE_INHERIT 03671 ENUMX 03672 BFD_RELOC_VTABLE_ENTRY 03673 ENUMDOC 03674 These two relocations are used by the linker to determine which of 03675 the entries in a C++ virtual function table are actually used. When 03676 the --gc-sections option is given, the linker will zero out the entries 03677 that are not used, so that the code for those functions need not be 03678 included in the output. 03679 03680 VTABLE_INHERIT is a zero-space relocation used to describe to the 03681 linker the inheritance tree of a C++ virtual function table. The 03682 relocation's symbol should be the parent class' vtable, and the 03683 relocation should be located at the child vtable. 03684 03685 VTABLE_ENTRY is a zero-space relocation that describes the use of a 03686 virtual function table entry. The reloc's symbol should refer to the 03687 table of the class mentioned in the code. Off of that base, an offset 03688 describes the entry that is being used. For Rela hosts, this offset 03689 is stored in the reloc's addend. For Rel hosts, we are forced to put 03690 this offset in the reloc's section offset. 03691 03692 ENUM 03693 BFD_RELOC_IA64_IMM14 03694 ENUMX 03695 BFD_RELOC_IA64_IMM22 03696 ENUMX 03697 BFD_RELOC_IA64_IMM64 03698 ENUMX 03699 BFD_RELOC_IA64_DIR32MSB 03700 ENUMX 03701 BFD_RELOC_IA64_DIR32LSB 03702 ENUMX 03703 BFD_RELOC_IA64_DIR64MSB 03704 ENUMX 03705 BFD_RELOC_IA64_DIR64LSB 03706 ENUMX 03707 BFD_RELOC_IA64_GPREL22 03708 ENUMX 03709 BFD_RELOC_IA64_GPREL64I 03710 ENUMX 03711 BFD_RELOC_IA64_GPREL32MSB 03712 ENUMX 03713 BFD_RELOC_IA64_GPREL32LSB 03714 ENUMX 03715 BFD_RELOC_IA64_GPREL64MSB 03716 ENUMX 03717 BFD_RELOC_IA64_GPREL64LSB 03718 ENUMX 03719 BFD_RELOC_IA64_LTOFF22 03720 ENUMX 03721 BFD_RELOC_IA64_LTOFF64I 03722 ENUMX 03723 BFD_RELOC_IA64_PLTOFF22 03724 ENUMX 03725 BFD_RELOC_IA64_PLTOFF64I 03726 ENUMX 03727 BFD_RELOC_IA64_PLTOFF64MSB 03728 ENUMX 03729 BFD_RELOC_IA64_PLTOFF64LSB 03730 ENUMX 03731 BFD_RELOC_IA64_FPTR64I 03732 ENUMX 03733 BFD_RELOC_IA64_FPTR32MSB 03734 ENUMX 03735 BFD_RELOC_IA64_FPTR32LSB 03736 ENUMX 03737 BFD_RELOC_IA64_FPTR64MSB 03738 ENUMX 03739 BFD_RELOC_IA64_FPTR64LSB 03740 ENUMX 03741 BFD_RELOC_IA64_PCREL21B 03742 ENUMX 03743 BFD_RELOC_IA64_PCREL21BI 03744 ENUMX 03745 BFD_RELOC_IA64_PCREL21M 03746 ENUMX 03747 BFD_RELOC_IA64_PCREL21F 03748 ENUMX 03749 BFD_RELOC_IA64_PCREL22 03750 ENUMX 03751 BFD_RELOC_IA64_PCREL60B 03752 ENUMX 03753 BFD_RELOC_IA64_PCREL64I 03754 ENUMX 03755 BFD_RELOC_IA64_PCREL32MSB 03756 ENUMX 03757 BFD_RELOC_IA64_PCREL32LSB 03758 ENUMX 03759 BFD_RELOC_IA64_PCREL64MSB 03760 ENUMX 03761 BFD_RELOC_IA64_PCREL64LSB 03762 ENUMX 03763 BFD_RELOC_IA64_LTOFF_FPTR22 03764 ENUMX 03765 BFD_RELOC_IA64_LTOFF_FPTR64I 03766 ENUMX 03767 BFD_RELOC_IA64_LTOFF_FPTR32MSB 03768 ENUMX 03769 BFD_RELOC_IA64_LTOFF_FPTR32LSB 03770 ENUMX 03771 BFD_RELOC_IA64_LTOFF_FPTR64MSB 03772 ENUMX 03773 BFD_RELOC_IA64_LTOFF_FPTR64LSB 03774 ENUMX 03775 BFD_RELOC_IA64_SEGREL32MSB 03776 ENUMX 03777 BFD_RELOC_IA64_SEGREL32LSB 03778 ENUMX 03779 BFD_RELOC_IA64_SEGREL64MSB 03780 ENUMX 03781 BFD_RELOC_IA64_SEGREL64LSB 03782 ENUMX 03783 BFD_RELOC_IA64_SECREL32MSB 03784 ENUMX 03785 BFD_RELOC_IA64_SECREL32LSB 03786 ENUMX 03787 BFD_RELOC_IA64_SECREL64MSB 03788 ENUMX 03789 BFD_RELOC_IA64_SECREL64LSB 03790 ENUMX 03791 BFD_RELOC_IA64_REL32MSB 03792 ENUMX 03793 BFD_RELOC_IA64_REL32LSB 03794 ENUMX 03795 BFD_RELOC_IA64_REL64MSB 03796 ENUMX 03797 BFD_RELOC_IA64_REL64LSB 03798 ENUMX 03799 BFD_RELOC_IA64_LTV32MSB 03800 ENUMX 03801 BFD_RELOC_IA64_LTV32LSB 03802 ENUMX 03803 BFD_RELOC_IA64_LTV64MSB 03804 ENUMX 03805 BFD_RELOC_IA64_LTV64LSB 03806 ENUMX 03807 BFD_RELOC_IA64_IPLTMSB 03808 ENUMX 03809 BFD_RELOC_IA64_IPLTLSB 03810 ENUMX 03811 BFD_RELOC_IA64_COPY 03812 ENUMX 03813 BFD_RELOC_IA64_LTOFF22X 03814 ENUMX 03815 BFD_RELOC_IA64_LDXMOV 03816 ENUMX 03817 BFD_RELOC_IA64_TPREL14 03818 ENUMX 03819 BFD_RELOC_IA64_TPREL22 03820 ENUMX 03821 BFD_RELOC_IA64_TPREL64I 03822 ENUMX 03823 BFD_RELOC_IA64_TPREL64MSB 03824 ENUMX 03825 BFD_RELOC_IA64_TPREL64LSB 03826 ENUMX 03827 BFD_RELOC_IA64_LTOFF_TPREL22 03828 ENUMX 03829 BFD_RELOC_IA64_DTPMOD64MSB 03830 ENUMX 03831 BFD_RELOC_IA64_DTPMOD64LSB 03832 ENUMX 03833 BFD_RELOC_IA64_LTOFF_DTPMOD22 03834 ENUMX 03835 BFD_RELOC_IA64_DTPREL14 03836 ENUMX 03837 BFD_RELOC_IA64_DTPREL22 03838 ENUMX 03839 BFD_RELOC_IA64_DTPREL64I 03840 ENUMX 03841 BFD_RELOC_IA64_DTPREL32MSB 03842 ENUMX 03843 BFD_RELOC_IA64_DTPREL32LSB 03844 ENUMX 03845 BFD_RELOC_IA64_DTPREL64MSB 03846 ENUMX 03847 BFD_RELOC_IA64_DTPREL64LSB 03848 ENUMX 03849 BFD_RELOC_IA64_LTOFF_DTPREL22 03850 ENUMDOC 03851 Intel IA64 Relocations. 03852 03853 ENUM 03854 BFD_RELOC_M68HC11_HI8 03855 ENUMDOC 03856 Motorola 68HC11 reloc. 03857 This is the 8 bit high part of an absolute address. 03858 ENUM 03859 BFD_RELOC_M68HC11_LO8 03860 ENUMDOC 03861 Motorola 68HC11 reloc. 03862 This is the 8 bit low part of an absolute address. 03863 ENUM 03864 BFD_RELOC_M68HC11_3B 03865 ENUMDOC 03866 Motorola 68HC11 reloc. 03867 This is the 3 bit of a value. 03868 ENUM 03869 BFD_RELOC_M68HC11_RL_JUMP 03870 ENUMDOC 03871 Motorola 68HC11 reloc. 03872 This reloc marks the beginning of a jump/call instruction. 03873 It is used for linker relaxation to correctly identify beginning 03874 of instruction and change some branches to use PC-relative 03875 addressing mode. 03876 ENUM 03877 BFD_RELOC_M68HC11_RL_GROUP 03878 ENUMDOC 03879 Motorola 68HC11 reloc. 03880 This reloc marks a group of several instructions that gcc generates 03881 and for which the linker relaxation pass can modify and/or remove 03882 some of them. 03883 ENUM 03884 BFD_RELOC_M68HC11_LO16 03885 ENUMDOC 03886 Motorola 68HC11 reloc. 03887 This is the 16-bit lower part of an address. It is used for 'call' 03888 instruction to specify the symbol address without any special 03889 transformation (due to memory bank window). 03890 ENUM 03891 BFD_RELOC_M68HC11_PAGE 03892 ENUMDOC 03893 Motorola 68HC11 reloc. 03894 This is a 8-bit reloc that specifies the page number of an address. 03895 It is used by 'call' instruction to specify the page number of 03896 the symbol. 03897 ENUM 03898 BFD_RELOC_M68HC11_24 03899 ENUMDOC 03900 Motorola 68HC11 reloc. 03901 This is a 24-bit reloc that represents the address with a 16-bit 03902 value and a 8-bit page number. The symbol address is transformed 03903 to follow the 16K memory bank of 68HC12 (seen as mapped in the window). 03904 ENUM 03905 BFD_RELOC_M68HC12_5B 03906 ENUMDOC 03907 Motorola 68HC12 reloc. 03908 This is the 5 bits of a value. 03909 03910 ENUM 03911 BFD_RELOC_16C_NUM08 03912 ENUMX 03913 BFD_RELOC_16C_NUM08_C 03914 ENUMX 03915 BFD_RELOC_16C_NUM16 03916 ENUMX 03917 BFD_RELOC_16C_NUM16_C 03918 ENUMX 03919 BFD_RELOC_16C_NUM32 03920 ENUMX 03921 BFD_RELOC_16C_NUM32_C 03922 ENUMX 03923 BFD_RELOC_16C_DISP04 03924 ENUMX 03925 BFD_RELOC_16C_DISP04_C 03926 ENUMX 03927 BFD_RELOC_16C_DISP08 03928 ENUMX 03929 BFD_RELOC_16C_DISP08_C 03930 ENUMX 03931 BFD_RELOC_16C_DISP16 03932 ENUMX 03933 BFD_RELOC_16C_DISP16_C 03934 ENUMX 03935 BFD_RELOC_16C_DISP24 03936 ENUMX 03937 BFD_RELOC_16C_DISP24_C 03938 ENUMX 03939 BFD_RELOC_16C_DISP24a 03940 ENUMX 03941 BFD_RELOC_16C_DISP24a_C 03942 ENUMX 03943 BFD_RELOC_16C_REG04 03944 ENUMX 03945 BFD_RELOC_16C_REG04_C 03946 ENUMX 03947 BFD_RELOC_16C_REG04a 03948 ENUMX 03949 BFD_RELOC_16C_REG04a_C 03950 ENUMX 03951 BFD_RELOC_16C_REG14 03952 ENUMX 03953 BFD_RELOC_16C_REG14_C 03954 ENUMX 03955 BFD_RELOC_16C_REG16 03956 ENUMX 03957 BFD_RELOC_16C_REG16_C 03958 ENUMX 03959 BFD_RELOC_16C_REG20 03960 ENUMX 03961 BFD_RELOC_16C_REG20_C 03962 ENUMX 03963 BFD_RELOC_16C_ABS20 03964 ENUMX 03965 BFD_RELOC_16C_ABS20_C 03966 ENUMX 03967 BFD_RELOC_16C_ABS24 03968 ENUMX 03969 BFD_RELOC_16C_ABS24_C 03970 ENUMX 03971 BFD_RELOC_16C_IMM04 03972 ENUMX 03973 BFD_RELOC_16C_IMM04_C 03974 ENUMX 03975 BFD_RELOC_16C_IMM16 03976 ENUMX 03977 BFD_RELOC_16C_IMM16_C 03978 ENUMX 03979 BFD_RELOC_16C_IMM20 03980 ENUMX 03981 BFD_RELOC_16C_IMM20_C 03982 ENUMX 03983 BFD_RELOC_16C_IMM24 03984 ENUMX 03985 BFD_RELOC_16C_IMM24_C 03986 ENUMX 03987 BFD_RELOC_16C_IMM32 03988 ENUMX 03989 BFD_RELOC_16C_IMM32_C 03990 ENUMDOC 03991 NS CR16C Relocations. 03992 03993 ENUM 03994 BFD_RELOC_CRX_REL4 03995 ENUMX 03996 BFD_RELOC_CRX_REL8 03997 ENUMX 03998 BFD_RELOC_CRX_REL8_CMP 03999 ENUMX 04000 BFD_RELOC_CRX_REL16 04001 ENUMX 04002 BFD_RELOC_CRX_REL24 04003 ENUMX 04004 BFD_RELOC_CRX_REL32 04005 ENUMX 04006 BFD_RELOC_CRX_REGREL12 04007 ENUMX 04008 BFD_RELOC_CRX_REGREL22 04009 ENUMX 04010 BFD_RELOC_CRX_REGREL28 04011 ENUMX 04012 BFD_RELOC_CRX_REGREL32 04013 ENUMX 04014 BFD_RELOC_CRX_ABS16 04015 ENUMX 04016 BFD_RELOC_CRX_ABS32 04017 ENUMX 04018 BFD_RELOC_CRX_NUM8 04019 ENUMX 04020 BFD_RELOC_CRX_NUM16 04021 ENUMX 04022 BFD_RELOC_CRX_NUM32 04023 ENUMX 04024 BFD_RELOC_CRX_IMM16 04025 ENUMX 04026 BFD_RELOC_CRX_IMM32 04027 ENUMX 04028 BFD_RELOC_CRX_SWITCH8 04029 ENUMX 04030 BFD_RELOC_CRX_SWITCH16 04031 ENUMX 04032 BFD_RELOC_CRX_SWITCH32 04033 ENUMDOC 04034 NS CRX Relocations. 04035 04036 ENUM 04037 BFD_RELOC_CRIS_BDISP8 04038 ENUMX 04039 BFD_RELOC_CRIS_UNSIGNED_5 04040 ENUMX 04041 BFD_RELOC_CRIS_SIGNED_6 04042 ENUMX 04043 BFD_RELOC_CRIS_UNSIGNED_6 04044 ENUMX 04045 BFD_RELOC_CRIS_SIGNED_8 04046 ENUMX 04047 BFD_RELOC_CRIS_UNSIGNED_8 04048 ENUMX 04049 BFD_RELOC_CRIS_SIGNED_16 04050 ENUMX 04051 BFD_RELOC_CRIS_UNSIGNED_16 04052 ENUMX 04053 BFD_RELOC_CRIS_LAPCQ_OFFSET 04054 ENUMX 04055 BFD_RELOC_CRIS_UNSIGNED_4 04056 ENUMDOC 04057 These relocs are only used within the CRIS assembler. They are not 04058 (at present) written to any object files. 04059 ENUM 04060 BFD_RELOC_CRIS_COPY 04061 ENUMX 04062 BFD_RELOC_CRIS_GLOB_DAT 04063 ENUMX 04064 BFD_RELOC_CRIS_JUMP_SLOT 04065 ENUMX 04066 BFD_RELOC_CRIS_RELATIVE 04067 ENUMDOC 04068 Relocs used in ELF shared libraries for CRIS. 04069 ENUM 04070 BFD_RELOC_CRIS_32_GOT 04071 ENUMDOC 04072 32-bit offset to symbol-entry within GOT. 04073 ENUM 04074 BFD_RELOC_CRIS_16_GOT 04075 ENUMDOC 04076 16-bit offset to symbol-entry within GOT. 04077 ENUM 04078 BFD_RELOC_CRIS_32_GOTPLT 04079 ENUMDOC 04080 32-bit offset to symbol-entry within GOT, with PLT handling. 04081 ENUM 04082 BFD_RELOC_CRIS_16_GOTPLT 04083 ENUMDOC 04084 16-bit offset to symbol-entry within GOT, with PLT handling. 04085 ENUM 04086 BFD_RELOC_CRIS_32_GOTREL 04087 ENUMDOC 04088 32-bit offset to symbol, relative to GOT. 04089 ENUM 04090 BFD_RELOC_CRIS_32_PLT_GOTREL 04091 ENUMDOC 04092 32-bit offset to symbol with PLT entry, relative to GOT. 04093 ENUM 04094 BFD_RELOC_CRIS_32_PLT_PCREL 04095 ENUMDOC 04096 32-bit offset to symbol with PLT entry, relative to this relocation. 04097 04098 ENUM 04099 BFD_RELOC_860_COPY 04100 ENUMX 04101 BFD_RELOC_860_GLOB_DAT 04102 ENUMX 04103 BFD_RELOC_860_JUMP_SLOT 04104 ENUMX 04105 BFD_RELOC_860_RELATIVE 04106 ENUMX 04107 BFD_RELOC_860_PC26 04108 ENUMX 04109 BFD_RELOC_860_PLT26 04110 ENUMX 04111 BFD_RELOC_860_PC16 04112 ENUMX 04113 BFD_RELOC_860_LOW0 04114 ENUMX 04115 BFD_RELOC_860_SPLIT0 04116 ENUMX 04117 BFD_RELOC_860_LOW1 04118 ENUMX 04119 BFD_RELOC_860_SPLIT1 04120 ENUMX 04121 BFD_RELOC_860_LOW2 04122 ENUMX 04123 BFD_RELOC_860_SPLIT2 04124 ENUMX 04125 BFD_RELOC_860_LOW3 04126 ENUMX 04127 BFD_RELOC_860_LOGOT0 04128 ENUMX 04129 BFD_RELOC_860_SPGOT0 04130 ENUMX 04131 BFD_RELOC_860_LOGOT1 04132 ENUMX 04133 BFD_RELOC_860_SPGOT1 04134 ENUMX 04135 BFD_RELOC_860_LOGOTOFF0 04136 ENUMX 04137 BFD_RELOC_860_SPGOTOFF0 04138 ENUMX 04139 BFD_RELOC_860_LOGOTOFF1 04140 ENUMX 04141 BFD_RELOC_860_SPGOTOFF1 04142 ENUMX 04143 BFD_RELOC_860_LOGOTOFF2 04144 ENUMX 04145 BFD_RELOC_860_LOGOTOFF3 04146 ENUMX 04147 BFD_RELOC_860_LOPC 04148 ENUMX 04149 BFD_RELOC_860_HIGHADJ 04150 ENUMX 04151 BFD_RELOC_860_HAGOT 04152 ENUMX 04153 BFD_RELOC_860_HAGOTOFF 04154 ENUMX 04155 BFD_RELOC_860_HAPC 04156 ENUMX 04157 BFD_RELOC_860_HIGH 04158 ENUMX 04159 BFD_RELOC_860_HIGOT 04160 ENUMX 04161 BFD_RELOC_860_HIGOTOFF 04162 ENUMDOC 04163 Intel i860 Relocations. 04164 04165 ENUM 04166 BFD_RELOC_OPENRISC_ABS_26 04167 ENUMX 04168 BFD_RELOC_OPENRISC_REL_26 04169 ENUMDOC 04170 OpenRISC Relocations. 04171 04172 ENUM 04173 BFD_RELOC_H8_DIR16A8 04174 ENUMX 04175 BFD_RELOC_H8_DIR16R8 04176 ENUMX 04177 BFD_RELOC_H8_DIR24A8 04178 ENUMX 04179 BFD_RELOC_H8_DIR24R8 04180 ENUMX 04181 BFD_RELOC_H8_DIR32A16 04182 ENUMDOC 04183 H8 elf Relocations. 04184 04185 ENUM 04186 BFD_RELOC_XSTORMY16_REL_12 04187 ENUMX 04188 BFD_RELOC_XSTORMY16_12 04189 ENUMX 04190 BFD_RELOC_XSTORMY16_24 04191 ENUMX 04192 BFD_RELOC_XSTORMY16_FPTR16 04193 ENUMDOC 04194 Sony Xstormy16 Relocations. 04195 04196 ENUM 04197 BFD_RELOC_VAX_GLOB_DAT 04198 ENUMX 04199 BFD_RELOC_VAX_JMP_SLOT 04200 ENUMX 04201 BFD_RELOC_VAX_RELATIVE 04202 ENUMDOC 04203 Relocations used by VAX ELF. 04204 04205 ENUM 04206 BFD_RELOC_MSP430_10_PCREL 04207 ENUMX 04208 BFD_RELOC_MSP430_16_PCREL 04209 ENUMX 04210 BFD_RELOC_MSP430_16 04211 ENUMX 04212 BFD_RELOC_MSP430_16_PCREL_BYTE 04213 ENUMX 04214 BFD_RELOC_MSP430_16_BYTE 04215 ENUMX 04216 BFD_RELOC_MSP430_2X_PCREL 04217 ENUMX 04218 BFD_RELOC_MSP430_RL_PCREL 04219 ENUMDOC 04220 msp430 specific relocation codes 04221 04222 ENUM 04223 BFD_RELOC_IQ2000_OFFSET_16 04224 ENUMX 04225 BFD_RELOC_IQ2000_OFFSET_21 04226 ENUMX 04227 BFD_RELOC_IQ2000_UHI16 04228 ENUMDOC 04229 IQ2000 Relocations. 04230 04231 ENUM 04232 BFD_RELOC_XTENSA_RTLD 04233 ENUMDOC 04234 Special Xtensa relocation used only by PLT entries in ELF shared 04235 objects to indicate that the runtime linker should set the value 04236 to one of its own internal functions or data structures. 04237 ENUM 04238 BFD_RELOC_XTENSA_GLOB_DAT 04239 ENUMX 04240 BFD_RELOC_XTENSA_JMP_SLOT 04241 ENUMX 04242 BFD_RELOC_XTENSA_RELATIVE 04243 ENUMDOC 04244 Xtensa relocations for ELF shared objects. 04245 ENUM 04246 BFD_RELOC_XTENSA_PLT 04247 ENUMDOC 04248 Xtensa relocation used in ELF object files for symbols that may require 04249 PLT entries. Otherwise, this is just a generic 32-bit relocation. 04250 ENUM 04251 BFD_RELOC_XTENSA_DIFF8 04252 ENUMX 04253 BFD_RELOC_XTENSA_DIFF16 04254 ENUMX 04255 BFD_RELOC_XTENSA_DIFF32 04256 ENUMDOC 04257 Xtensa relocations to mark the difference of two local symbols. 04258 These are only needed to support linker relaxation and can be ignored 04259 when not relaxing. The field is set to the value of the difference 04260 assuming no relaxation. The relocation encodes the position of the 04261 first symbol so the linker can determine whether to adjust the field 04262 value. 04263 ENUM 04264 BFD_RELOC_XTENSA_SLOT0_OP 04265 ENUMX 04266 BFD_RELOC_XTENSA_SLOT1_OP 04267 ENUMX 04268 BFD_RELOC_XTENSA_SLOT2_OP 04269 ENUMX 04270 BFD_RELOC_XTENSA_SLOT3_OP 04271 ENUMX 04272 BFD_RELOC_XTENSA_SLOT4_OP 04273 ENUMX 04274 BFD_RELOC_XTENSA_SLOT5_OP 04275 ENUMX 04276 BFD_RELOC_XTENSA_SLOT6_OP 04277 ENUMX 04278 BFD_RELOC_XTENSA_SLOT7_OP 04279 ENUMX 04280 BFD_RELOC_XTENSA_SLOT8_OP 04281 ENUMX 04282 BFD_RELOC_XTENSA_SLOT9_OP 04283 ENUMX 04284 BFD_RELOC_XTENSA_SLOT10_OP 04285 ENUMX 04286 BFD_RELOC_XTENSA_SLOT11_OP 04287 ENUMX 04288 BFD_RELOC_XTENSA_SLOT12_OP 04289 ENUMX 04290 BFD_RELOC_XTENSA_SLOT13_OP 04291 ENUMX 04292 BFD_RELOC_XTENSA_SLOT14_OP 04293 ENUMDOC 04294 Generic Xtensa relocations for instruction operands. Only the slot 04295 number is encoded in the relocation. The relocation applies to the 04296 last PC-relative immediate operand, or if there are no PC-relative 04297 immediates, to the last immediate operand. 04298 ENUM 04299 BFD_RELOC_XTENSA_SLOT0_ALT 04300 ENUMX 04301 BFD_RELOC_XTENSA_SLOT1_ALT 04302 ENUMX 04303 BFD_RELOC_XTENSA_SLOT2_ALT 04304 ENUMX 04305 BFD_RELOC_XTENSA_SLOT3_ALT 04306 ENUMX 04307 BFD_RELOC_XTENSA_SLOT4_ALT 04308 ENUMX 04309 BFD_RELOC_XTENSA_SLOT5_ALT 04310 ENUMX 04311 BFD_RELOC_XTENSA_SLOT6_ALT 04312 ENUMX 04313 BFD_RELOC_XTENSA_SLOT7_ALT 04314 ENUMX 04315 BFD_RELOC_XTENSA_SLOT8_ALT 04316 ENUMX 04317 BFD_RELOC_XTENSA_SLOT9_ALT 04318 ENUMX 04319 BFD_RELOC_XTENSA_SLOT10_ALT 04320 ENUMX 04321 BFD_RELOC_XTENSA_SLOT11_ALT 04322 ENUMX 04323 BFD_RELOC_XTENSA_SLOT12_ALT 04324 ENUMX 04325 BFD_RELOC_XTENSA_SLOT13_ALT 04326 ENUMX 04327 BFD_RELOC_XTENSA_SLOT14_ALT 04328 ENUMDOC 04329 Alternate Xtensa relocations. Only the slot is encoded in the 04330 relocation. The meaning of these relocations is opcode-specific. 04331 ENUM 04332 BFD_RELOC_XTENSA_OP0 04333 ENUMX 04334 BFD_RELOC_XTENSA_OP1 04335 ENUMX 04336 BFD_RELOC_XTENSA_OP2 04337 ENUMDOC 04338 Xtensa relocations for backward compatibility. These have all been 04339 replaced by BFD_RELOC_XTENSA_SLOT0_OP. 04340 ENUM 04341 BFD_RELOC_XTENSA_ASM_EXPAND 04342 ENUMDOC 04343 Xtensa relocation to mark that the assembler expanded the 04344 instructions from an original target. The expansion size is 04345 encoded in the reloc size. 04346 ENUM 04347 BFD_RELOC_XTENSA_ASM_SIMPLIFY 04348 ENUMDOC 04349 Xtensa relocation to mark that the linker should simplify 04350 assembler-expanded instructions. This is commonly used 04351 internally by the linker after analysis of a 04352 BFD_RELOC_XTENSA_ASM_EXPAND. 04353 04354 ENDSENUM 04355 BFD_RELOC_UNUSED 04356 CODE_FRAGMENT 04357 . 04358 .typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; 04359 */ 04360 04361 /* 04362 FUNCTION 04363 bfd_reloc_type_lookup 04364 04365 SYNOPSIS 04366 reloc_howto_type *bfd_reloc_type_lookup 04367 (bfd *abfd, bfd_reloc_code_real_type code); 04368 04369 DESCRIPTION 04370 Return a pointer to a howto structure which, when 04371 invoked, will perform the relocation @var{code} on data from the 04372 architecture noted. 04373 04374 */ 04375 04376 reloc_howto_type * 04377 bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) 04378 { 04379 return BFD_SEND (abfd, reloc_type_lookup, (abfd, code)); 04380 } 04381 04382 static reloc_howto_type bfd_howto_32 = 04383 HOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE); 04384 04385 /* 04386 INTERNAL_FUNCTION 04387 bfd_default_reloc_type_lookup 04388 04389 SYNOPSIS 04390 reloc_howto_type *bfd_default_reloc_type_lookup 04391 (bfd *abfd, bfd_reloc_code_real_type code); 04392 04393 DESCRIPTION 04394 Provides a default relocation lookup routine for any architecture. 04395 04396 */ 04397 04398 reloc_howto_type * 04399 bfd_default_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) 04400 { 04401 switch (code) 04402 { 04403 case BFD_RELOC_CTOR: 04404 /* The type of reloc used in a ctor, which will be as wide as the 04405 address - so either a 64, 32, or 16 bitter. */ 04406 switch (bfd_get_arch_info (abfd)->bits_per_address) 04407 { 04408 case 64: 04409 BFD_FAIL (); 04410 case 32: 04411 return &bfd_howto_32; 04412 case 16: 04413 BFD_FAIL (); 04414 default: 04415 BFD_FAIL (); 04416 } 04417 default: 04418 BFD_FAIL (); 04419 } 04420 return NULL; 04421 } 04422 04423 /* 04424 FUNCTION 04425 bfd_get_reloc_code_name 04426 04427 SYNOPSIS 04428 const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); 04429 04430 DESCRIPTION 04431 Provides a printable name for the supplied relocation code. 04432 Useful mainly for printing error messages. 04433 */ 04434 04435 const char * 04436 bfd_get_reloc_code_name (bfd_reloc_code_real_type code) 04437 { 04438 if (code > BFD_RELOC_UNUSED) 04439 return 0; 04440 return bfd_reloc_code_real_names[code]; 04441 } 04442 04443 /* 04444 INTERNAL_FUNCTION 04445 bfd_generic_relax_section 04446 04447 SYNOPSIS 04448 bfd_boolean bfd_generic_relax_section 04449 (bfd *abfd, 04450 asection *section, 04451 struct bfd_link_info *, 04452 bfd_boolean *); 04453 04454 DESCRIPTION 04455 Provides default handling for relaxing for back ends which 04456 don't do relaxing. 04457 */ 04458 04459 bfd_boolean 04460 bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, 04461 asection *section ATTRIBUTE_UNUSED, 04462 struct bfd_link_info *link_info ATTRIBUTE_UNUSED, 04463 bfd_boolean *again) 04464 { 04465 *again = FALSE; 04466 return TRUE; 04467 } 04468 04469 /* 04470 INTERNAL_FUNCTION 04471 bfd_generic_gc_sections 04472 04473 SYNOPSIS 04474 bfd_boolean bfd_generic_gc_sections 04475 (bfd *, struct bfd_link_info *); 04476 04477 DESCRIPTION 04478 Provides default handling for relaxing for back ends which 04479 don't do section gc -- i.e., does nothing. 04480 */ 04481 04482 bfd_boolean 04483 bfd_generic_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, 04484 struct bfd_link_info *link_info ATTRIBUTE_UNUSED) 04485 { 04486 return TRUE; 04487 } 04488 04489 /* 04490 INTERNAL_FUNCTION 04491 bfd_generic_merge_sections 04492 04493 SYNOPSIS 04494 bfd_boolean bfd_generic_merge_sections 04495 (bfd *, struct bfd_link_info *); 04496 04497 DESCRIPTION 04498 Provides default handling for SEC_MERGE section merging for back ends 04499 which don't have SEC_MERGE support -- i.e., does nothing. 04500 */ 04501 04502 bfd_boolean 04503 bfd_generic_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, 04504 struct bfd_link_info *link_info ATTRIBUTE_UNUSED) 04505 { 04506 return TRUE; 04507 } 04508 04509 /* 04510 INTERNAL_FUNCTION 04511 bfd_generic_get_relocated_section_contents 04512 04513 SYNOPSIS 04514 bfd_byte *bfd_generic_get_relocated_section_contents 04515 (bfd *abfd, 04516 struct bfd_link_info *link_info, 04517 struct bfd_link_order *link_order, 04518 bfd_byte *data, 04519 bfd_boolean relocatable, 04520 asymbol **symbols); 04521 04522 DESCRIPTION 04523 Provides default handling of relocation effort for back ends 04524 which can't be bothered to do it efficiently. 04525 04526 */ 04527 04528 bfd_byte * 04529 bfd_generic_get_relocated_section_contents (bfd *abfd, 04530 struct bfd_link_info *link_info, 04531 struct bfd_link_order *link_order, 04532 bfd_byte *data, 04533 bfd_boolean relocatable, 04534 asymbol **symbols) 04535 { 04536 /* Get enough memory to hold the stuff. */ 04537 bfd *input_bfd = link_order->u.indirect.section->owner; 04538 asection *input_section = link_order->u.indirect.section; 04539 04540 long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); 04541 arelent **reloc_vector = NULL; 04542 long reloc_count; 04543 bfd_size_type sz; 04544 04545 if (reloc_size < 0) 04546 goto error_return; 04547 04548 reloc_vector = bfd_malloc (reloc_size); 04549 if (reloc_vector == NULL && reloc_size != 0) 04550 goto error_return; 04551 04552 /* Read in the section. */ 04553 sz = input_section->rawsize ? input_section->rawsize : input_section->size; 04554 if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz)) 04555 goto error_return; 04556 04557 reloc_count = bfd_canonicalize_reloc (input_bfd, 04558 input_section, 04559 reloc_vector, 04560 symbols); 04561 if (reloc_count < 0) 04562 goto error_return; 04563 04564 if (reloc_count > 0) 04565 { 04566 arelent **parent; 04567 for (parent = reloc_vector; *parent != NULL; parent++) 04568 { 04569 char *error_message = NULL; 04570 bfd_reloc_status_type r = 04571 bfd_perform_relocation (input_bfd, 04572 *parent, 04573 data, 04574 input_section, 04575 relocatable ? abfd : NULL, 04576 &error_message); 04577 04578 if (relocatable) 04579 { 04580 asection *os = input_section->output_section; 04581 04582 /* A partial link, so keep the relocs. */ 04583 os->orelocation[os->reloc_count] = *parent; 04584 os->reloc_count++; 04585 } 04586 04587 if (r != bfd_reloc_ok) 04588 { 04589 switch (r) 04590 { 04591 case bfd_reloc_undefined: 04592 if (!((*link_info->callbacks->undefined_symbol) 04593 (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), 04594 input_bfd, input_section, (*parent)->address, 04595 TRUE))) 04596 goto error_return; 04597 break; 04598 case bfd_reloc_dangerous: 04599 BFD_ASSERT (error_message != NULL); 04600 if (!((*link_info->callbacks->reloc_dangerous) 04601 (link_info, error_message, input_bfd, input_section, 04602 (*parent)->address))) 04603 goto error_return; 04604 break; 04605 case bfd_reloc_overflow: 04606 if (!((*link_info->callbacks->reloc_overflow) 04607 (link_info, NULL, 04608 bfd_asymbol_name (*(*parent)->sym_ptr_ptr), 04609 (*parent)->howto->name, (*parent)->addend, 04610 input_bfd, input_section, (*parent)->address))) 04611 goto error_return; 04612 break; 04613 case bfd_reloc_outofrange: 04614 default: 04615 abort (); 04616 break; 04617 } 04618 04619 } 04620 } 04621 } 04622 if (reloc_vector != NULL) 04623 free (reloc_vector); 04624 return data; 04625 04626 error_return: 04627 if (reloc_vector != NULL) 04628 free (reloc_vector); 04629 return NULL; 04630 }
1.5.6