Back to index

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