171671b9obrien/* BFD support for handling relocation entries.
271671b9obrien   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3d0f678fdim   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
471671b9obrien   Free Software Foundation, Inc.
571671b9obrien   Written by Cygnus Support.
671671b9obrien
771671b9obrien   This file is part of BFD, the Binary File Descriptor library.
871671b9obrien
971671b9obrien   This program is free software; you can redistribute it and/or modify
1071671b9obrien   it under the terms of the GNU General Public License as published by
1171671b9obrien   the Free Software Foundation; either version 2 of the License, or
1271671b9obrien   (at your option) any later version.
1371671b9obrien
1471671b9obrien   This program is distributed in the hope that it will be useful,
1571671b9obrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
1671671b9obrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1771671b9obrien   GNU General Public License for more details.
1871671b9obrien
1971671b9obrien   You should have received a copy of the GNU General Public License
2071671b9obrien   along with this program; if not, write to the Free Software
210acbbeedim   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2271671b9obrien
2371671b9obrien/*
2471671b9obrienSECTION
2571671b9obrien	Relocations
2671671b9obrien
2771671b9obrien	BFD maintains relocations in much the same way it maintains
2871671b9obrien	symbols: they are left alone until required, then read in
2971671b9obrien	en-masse and translated into an internal form.  A common
3071671b9obrien	routine <<bfd_perform_relocation>> acts upon the
3171671b9obrien	canonical form to do the fixup.
3271671b9obrien
3371671b9obrien	Relocations are maintained on a per section basis,
3471671b9obrien	while symbols are maintained on a per BFD basis.
3571671b9obrien
3671671b9obrien	All that a back end has to do to fit the BFD interface is to create
3771671b9obrien	a <<struct reloc_cache_entry>> for each relocation
3871671b9obrien	in a particular section, and fill in the right bits of the structures.
3971671b9obrien
4071671b9obrien@menu
4171671b9obrien@* typedef arelent::
4271671b9obrien@* howto manager::
4371671b9obrien@end menu
4471671b9obrien
4571671b9obrien*/
4671671b9obrien
4771671b9obrien/* DO compile in the reloc_code name table from libbfd.h.  */
4871671b9obrien#define _BFD_MAKE_TABLE_bfd_reloc_code_real
4971671b9obrien
5071671b9obrien#include "sysdep.h"
51d0f678fdim#include "bfd.h"
5271671b9obrien#include "bfdlink.h"
5371671b9obrien#include "libbfd.h"
5471671b9obrien/*
5571671b9obrienDOCDD
5671671b9obrienINODE
5771671b9obrien	typedef arelent, howto manager, Relocations, Relocations
5871671b9obrien
5971671b9obrienSUBSECTION
6071671b9obrien	typedef arelent
6171671b9obrien
6271671b9obrien	This is the structure of a relocation entry:
6371671b9obrien
6471671b9obrienCODE_FRAGMENT
6571671b9obrien.
6671671b9obrien.typedef enum bfd_reloc_status
6771671b9obrien.{
6871671b9obrien.  {* No errors detected.  *}
6971671b9obrien.  bfd_reloc_ok,
7071671b9obrien.
7171671b9obrien.  {* The relocation was performed, but there was an overflow.  *}
7271671b9obrien.  bfd_reloc_overflow,
7371671b9obrien.
7471671b9obrien.  {* The address to relocate was not within the section supplied.  *}
7571671b9obrien.  bfd_reloc_outofrange,
7671671b9obrien.
7771671b9obrien.  {* Used by special functions.  *}
7871671b9obrien.  bfd_reloc_continue,
7971671b9obrien.
8071671b9obrien.  {* Unsupported relocation size requested.  *}
8171671b9obrien.  bfd_reloc_notsupported,
8271671b9obrien.
8371671b9obrien.  {* Unused.  *}
8471671b9obrien.  bfd_reloc_other,
8571671b9obrien.
8671671b9obrien.  {* The symbol to relocate against was undefined.  *}
8771671b9obrien.  bfd_reloc_undefined,
8871671b9obrien.
8971671b9obrien.  {* The relocation was performed, but may not be ok - presently
9071671b9obrien.     generated only when linking i960 coff files with i960 b.out
9171671b9obrien.     symbols.  If this type is returned, the error_message argument
9271671b9obrien.     to bfd_perform_relocation will be set.  *}
9371671b9obrien.  bfd_reloc_dangerous
9471671b9obrien. }
9571671b9obrien. bfd_reloc_status_type;
9671671b9obrien.
9771671b9obrien.
9871671b9obrien.typedef struct reloc_cache_entry
9971671b9obrien.{
10071671b9obrien.  {* A pointer into the canonical table of pointers.  *}
10171671b9obrien.  struct bfd_symbol **sym_ptr_ptr;
10271671b9obrien.
10371671b9obrien.  {* offset in section.  *}
10471671b9obrien.  bfd_size_type address;
10571671b9obrien.
10671671b9obrien.  {* addend for relocation value.  *}
10771671b9obrien.  bfd_vma addend;
10871671b9obrien.
10971671b9obrien.  {* Pointer to how to perform the required relocation.  *}
11071671b9obrien.  reloc_howto_type *howto;
11171671b9obrien.
11271671b9obrien.}
11371671b9obrien.arelent;
11471671b9obrien.
11571671b9obrien*/
11671671b9obrien
11771671b9obrien/*
11871671b9obrienDESCRIPTION
11971671b9obrien
12071671b9obrien        Here is a description of each of the fields within an <<arelent>>:
12171671b9obrien
12271671b9obrien        o <<sym_ptr_ptr>>
12371671b9obrien
12471671b9obrien        The symbol table pointer points to a pointer to the symbol
12571671b9obrien        associated with the relocation request.  It is the pointer
12671671b9obrien        into the table returned by the back end's
12771671b9obrien        <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is
12871671b9obrien        referenced through a pointer to a pointer so that tools like
12971671b9obrien        the linker can fix up all the symbols of the same name by
13071671b9obrien        modifying only one pointer. The relocation routine looks in
13171671b9obrien        the symbol and uses the base of the section the symbol is
13271671b9obrien        attached to and the value of the symbol as the initial
13371671b9obrien        relocation offset. If the symbol pointer is zero, then the
13471671b9obrien        section provided is looked up.
13571671b9obrien
13671671b9obrien        o <<address>>
13771671b9obrien
13871671b9obrien        The <<address>> field gives the offset in bytes from the base of
13971671b9obrien        the section data which owns the relocation record to the first
14071671b9obrien        byte of relocatable information. The actual data relocated
14171671b9obrien        will be relative to this point; for example, a relocation
14271671b9obrien        type which modifies the bottom two bytes of a four byte word
14371671b9obrien        would not touch the first byte pointed to in a big endian
14471671b9obrien        world.
14571671b9obrien
14671671b9obrien	o <<addend>>
14771671b9obrien
14871671b9obrien	The <<addend>> is a value provided by the back end to be added (!)
14971671b9obrien	to the relocation offset. Its interpretation is dependent upon
15071671b9obrien	the howto. For example, on the 68k the code:
15171671b9obrien
15271671b9obrien|        char foo[];
15371671b9obrien|        main()
15471671b9obrien|                {
15571671b9obrien|                return foo[0x12345678];
15671671b9obrien|                }
15771671b9obrien
15871671b9obrien        Could be compiled into:
15971671b9obrien
16071671b9obrien|        linkw fp,#-4
16171671b9obrien|        moveb @@#12345678,d0
16271671b9obrien|        extbl d0
16371671b9obrien|        unlk fp
16471671b9obrien|        rts
16571671b9obrien
16671671b9obrien        This could create a reloc pointing to <<foo>>, but leave the
16771671b9obrien        offset in the data, something like:
16871671b9obrien
16971671b9obrien|RELOCATION RECORDS FOR [.text]:
17071671b9obrien|offset   type      value
17171671b9obrien|00000006 32        _foo
17271671b9obrien|
17371671b9obrien|00000000 4e56 fffc          ; linkw fp,#-4
17471671b9obrien|00000004 1039 1234 5678     ; moveb @@#12345678,d0
17571671b9obrien|0000000a 49c0               ; extbl d0
17671671b9obrien|0000000c 4e5e               ; unlk fp
17771671b9obrien|0000000e 4e75               ; rts
17871671b9obrien
17971671b9obrien        Using coff and an 88k, some instructions don't have enough
18071671b9obrien        space in them to represent the full address range, and
18171671b9obrien        pointers have to be loaded in two parts. So you'd get something like:
18271671b9obrien
18371671b9obrien|        or.u     r13,r0,hi16(_foo+0x12345678)
18471671b9obrien|        ld.b     r2,r13,lo16(_foo+0x12345678)
18571671b9obrien|        jmp      r1
18671671b9obrien
18771671b9obrien        This should create two relocs, both pointing to <<_foo>>, and with
18871671b9obrien        0x12340000 in their addend field. The data would consist of:
18971671b9obrien
19071671b9obrien|RELOCATION RECORDS FOR [.text]:
19171671b9obrien|offset   type      value
19271671b9obrien|00000002 HVRT16    _foo+0x12340000
19371671b9obrien|00000006 LVRT16    _foo+0x12340000
19471671b9obrien|
19571671b9obrien|00000000 5da05678           ; or.u r13,r0,0x5678
19671671b9obrien|00000004 1c4d5678           ; ld.b r2,r13,0x5678
19771671b9obrien|00000008 f400c001           ; jmp r1
19871671b9obrien
19971671b9obrien        The relocation routine digs out the value from the data, adds
20071671b9obrien        it to the addend to get the original offset, and then adds the
20171671b9obrien        value of <<_foo>>. Note that all 32 bits have to be kept around
20271671b9obrien        somewhere, to cope with carry from bit 15 to bit 16.
20371671b9obrien
20471671b9obrien        One further example is the sparc and the a.out format. The
20571671b9obrien        sparc has a similar problem to the 88k, in that some
20671671b9obrien        instructions don't have room for an entire offset, but on the
20771671b9obrien        sparc the parts are created in odd sized lumps. The designers of
20871671b9obrien        the a.out format chose to not use the data within the section
20971671b9obrien        for storing part of the offset; all the offset is kept within
21071671b9obrien        the reloc. Anything in the data should be ignored.
21171671b9obrien
21271671b9obrien|        save %sp,-112,%sp
21371671b9obrien|        sethi %hi(_foo+0x12345678),%g2
21471671b9obrien|        ldsb [%g2+%lo(_foo+0x12345678)],%i0
21571671b9obrien|        ret
21671671b9obrien|        restore
21771671b9obrien
21871671b9obrien        Both relocs contain a pointer to <<foo>>, and the offsets
21971671b9obrien        contain junk.
22071671b9obrien
22171671b9obrien|RELOCATION RECORDS FOR [.text]:
22271671b9obrien|offset   type      value
22371671b9obrien|00000004 HI22      _foo+0x12345678
22471671b9obrien|00000008 LO10      _foo+0x12345678
22571671b9obrien|
22671671b9obrien|00000000 9de3bf90     ; save %sp,-112,%sp
22771671b9obrien|00000004 05000000     ; sethi %hi(_foo+0),%g2
22871671b9obrien|00000008 f048a000     ; ldsb [%g2+%lo(_foo+0)],%i0
22971671b9obrien|0000000c 81c7e008     ; ret
23071671b9obrien|00000010 81e80000     ; restore
23171671b9obrien
23271671b9obrien        o <<howto>>
23371671b9obrien
23471671b9obrien        The <<howto>> field can be imagined as a
23571671b9obrien        relocation instruction. It is a pointer to a structure which
23671671b9obrien        contains information on what to do with all of the other
23771671b9obrien        information in the reloc record and data section. A back end
23871671b9obrien        would normally have a relocation instruction set and turn
23971671b9obrien        relocations into pointers to the correct structure on input -
24071671b9obrien        but it would be possible to create each howto field on demand.
24171671b9obrien
24271671b9obrien*/
24371671b9obrien
24471671b9obrien/*
24571671b9obrienSUBSUBSECTION
24671671b9obrien	<<enum complain_overflow>>
24771671b9obrien
24871671b9obrien	Indicates what sort of overflow checking should be done when
24971671b9obrien	performing a relocation.
25071671b9obrien
25171671b9obrienCODE_FRAGMENT
25271671b9obrien.
25371671b9obrien.enum complain_overflow
25471671b9obrien.{
25571671b9obrien.  {* Do not complain on overflow.  *}
25671671b9obrien.  complain_overflow_dont,
25771671b9obrien.
2580acbbeedim.  {* Complain if the value overflows when considered as a signed
2590acbbeedim.     number one bit larger than the field.  ie. A bitfield of N bits
2600acbbeedim.     is allowed to represent -2**n to 2**n-1.  *}
26171671b9obrien.  complain_overflow_bitfield,
26271671b9obrien.
2630acbbeedim.  {* Complain if the value overflows when considered as a signed
26471671b9obrien.     number.  *}
26571671b9obrien.  complain_overflow_signed,
26671671b9obrien.
26771671b9obrien.  {* Complain if the value overflows when considered as an
26871671b9obrien.     unsigned number.  *}
26971671b9obrien.  complain_overflow_unsigned
27071671b9obrien.};
27171671b9obrien
27271671b9obrien*/
27371671b9obrien
27471671b9obrien/*
27571671b9obrienSUBSUBSECTION
27671671b9obrien        <<reloc_howto_type>>
27771671b9obrien
27871671b9obrien        The <<reloc_howto_type>> is a structure which contains all the
27971671b9obrien        information that libbfd needs to know to tie up a back end's data.
28071671b9obrien
28171671b9obrienCODE_FRAGMENT
28271671b9obrien.struct bfd_symbol;		{* Forward declaration.  *}
28371671b9obrien.
28471671b9obrien.struct reloc_howto_struct
28571671b9obrien.{
28671671b9obrien.  {*  The type field has mainly a documentary use - the back end can
28771671b9obrien.      do what it wants with it, though normally the back end's
28871671b9obrien.      external idea of what a reloc number is stored
28971671b9obrien.      in this field.  For example, a PC relative word relocation
29071671b9obrien.      in a coff environment has the type 023 - because that's
29171671b9obrien.      what the outside world calls a R_PCRWORD reloc.  *}
29271671b9obrien.  unsigned int type;
29371671b9obrien.
29471671b9obrien.  {*  The value the final relocation is shifted right by.  This drops
29571671b9obrien.      unwanted data from the relocation.  *}
29671671b9obrien.  unsigned int rightshift;
29771671b9obrien.
29871671b9obrien.  {*  The size of the item to be relocated.  This is *not* a
29971671b9obrien.      power-of-two measure.  To get the number of bytes operated
30071671b9obrien.      on by a type of relocation, use bfd_get_reloc_size.  *}
30171671b9obrien.  int size;
30271671b9obrien.
30371671b9obrien.  {*  The number of bits in the item to be relocated.  This is used
30471671b9obrien.      when doing overflow checking.  *}
30571671b9obrien.  unsigned int bitsize;
30671671b9obrien.
30771671b9obrien.  {*  Notes that the relocation is relative to the location in the
30871671b9obrien.      data section of the addend.  The relocation function will
30971671b9obrien.      subtract from the relocation value the address of the location
31071671b9obrien.      being relocated.  *}
31171671b9obrien.  bfd_boolean pc_relative;
31271671b9obrien.
31371671b9obrien.  {*  The bit position of the reloc value in the destination.
31471671b9obrien.      The relocated value is left shifted by this amount.  *}
31571671b9obrien.  unsigned int bitpos;
31671671b9obrien.
31771671b9obrien.  {* What type of overflow error should be checked for when
31871671b9obrien.     relocating.  *}
31971671b9obrien.  enum complain_overflow complain_on_overflow;
32071671b9obrien.
32171671b9obrien.  {* If this field is non null, then the supplied function is
32271671b9obrien.     called rather than the normal function.  This allows really
32371671b9obrien.     strange relocation methods to be accommodated (e.g., i960 callj
32471671b9obrien.     instructions).  *}
32571671b9obrien.  bfd_reloc_status_type (*special_function)
32671671b9obrien.    (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
32771671b9obrien.     bfd *, char **);
32871671b9obrien.
32971671b9obrien.  {* The textual name of the relocation type.  *}
33071671b9obrien.  char *name;
33171671b9obrien.
33271671b9obrien.  {* Some formats record a relocation addend in the section contents
33371671b9obrien.     rather than with the relocation.  For ELF formats this is the
33471671b9obrien.     distinction between USE_REL and USE_RELA (though the code checks
33571671b9obrien.     for USE_REL == 1/0).  The value of this field is TRUE if the
33671671b9obrien.     addend is recorded with the section contents; when performing a
33771671b9obrien.     partial link (ld -r) the section contents (the data) will be
33871671b9obrien.     modified.  The value of this field is FALSE if addends are
33971671b9obrien.     recorded with the relocation (in arelent.addend); when performing
34071671b9obrien.     a partial link the relocation will be modified.
34171671b9obrien.     All relocations for all ELF USE_RELA targets should set this field
34271671b9obrien.     to FALSE (values of TRUE should be looked on with suspicion).
34371671b9obrien.     However, the converse is not true: not all relocations of all ELF
34471671b9obrien.     USE_REL targets set this field to TRUE.  Why this is so is peculiar
34571671b9obrien.     to each particular target.  For relocs that aren't used in partial
34671671b9obrien.     links (e.g. GOT stuff) it doesn't matter what this is set to.  *}
34771671b9obrien.  bfd_boolean partial_inplace;
34871671b9obrien.
34971671b9obrien.  {* src_mask selects the part of the instruction (or data) to be used
35071671b9obrien.     in the relocation sum.  If the target relocations don't have an
35171671b9obrien.     addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
35271671b9obrien.     dst_mask to extract the addend from the section contents.  If
35371671b9obrien.     relocations do have an addend in the reloc, eg. ELF USE_RELA, this
35471671b9obrien.     field should be zero.  Non-zero values for ELF USE_RELA targets are
35571671b9obrien.     bogus as in those cases the value in the dst_mask part of the
35671671b9obrien.     section contents should be treated as garbage.  *}
35771671b9obrien.  bfd_vma src_mask;
35871671b9obrien.
35971671b9obrien.  {* dst_mask selects which parts of the instruction (or data) are
36071671b9obrien.     replaced with a relocated value.  *}
36171671b9obrien.  bfd_vma dst_mask;
36271671b9obrien.
36371671b9obrien.  {* When some formats create PC relative instructions, they leave
36471671b9obrien.     the value of the pc of the place being relocated in the offset
36571671b9obrien.     slot of the instruction, so that a PC relative relocation can
36671671b9obrien.     be made just by adding in an ordinary offset (e.g., sun3 a.out).
36771671b9obrien.     Some formats leave the displacement part of an instruction
36871671b9obrien.     empty (e.g., m88k bcs); this flag signals the fact.  *}
36971671b9obrien.  bfd_boolean pcrel_offset;
37071671b9obrien.};
37171671b9obrien.
37271671b9obrien*/
37371671b9obrien
37471671b9obrien/*
37571671b9obrienFUNCTION
37671671b9obrien	The HOWTO Macro
37771671b9obrien
37871671b9obrienDESCRIPTION
37971671b9obrien	The HOWTO define is horrible and will go away.
38071671b9obrien
38171671b9obrien.#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
38271671b9obrien.  { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
38371671b9obrien
38471671b9obrienDESCRIPTION
38571671b9obrien	And will be replaced with the totally magic way. But for the
38671671b9obrien	moment, we are compatible, so do it this way.
38771671b9obrien
38871671b9obrien.#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
38971671b9obrien.  HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
39071671b9obrien.         NAME, FALSE, 0, 0, IN)
39171671b9obrien.
39271671b9obrien
39371671b9obrienDESCRIPTION
39471671b9obrien	This is used to fill in an empty howto entry in an array.
39571671b9obrien
39671671b9obrien.#define EMPTY_HOWTO(C) \
39771671b9obrien.  HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
39871671b9obrien.         NULL, FALSE, 0, 0, FALSE)
39971671b9obrien.
40071671b9obrien
40171671b9obrienDESCRIPTION
40271671b9obrien	Helper routine to turn a symbol into a relocation value.
40371671b9obrien
40471671b9obrien.#define HOWTO_PREPARE(relocation, symbol)               \
40571671b9obrien.  {                                                     \
40671671b9obrien.    if (symbol != NULL)                                 \
40771671b9obrien.      {                                                 \
40871671b9obrien.        if (bfd_is_com_section (symbol->section))       \
40971671b9obrien.          {                                             \
41071671b9obrien.            relocation = 0;                             \
41171671b9obrien.          }                                             \
41271671b9obrien.        else                                            \
41371671b9obrien.          {                                             \
41471671b9obrien.            relocation = symbol->value;                 \
41571671b9obrien.          }                                             \
41671671b9obrien.      }                                                 \
41771671b9obrien.  }
41871671b9obrien.
41971671b9obrien*/
42071671b9obrien
42171671b9obrien/*
42271671b9obrienFUNCTION
42371671b9obrien	bfd_get_reloc_size
42471671b9obrien
42571671b9obrienSYNOPSIS
42671671b9obrien	unsigned int bfd_get_reloc_size (reloc_howto_type *);
42771671b9obrien
42871671b9obrienDESCRIPTION
42971671b9obrien	For a reloc_howto_type that operates on a fixed number of bytes,
43071671b9obrien	this returns the number of bytes operated on.
43171671b9obrien */
43271671b9obrien
43371671b9obrienunsigned int
43471671b9obrienbfd_get_reloc_size (reloc_howto_type *howto)
43571671b9obrien{
43671671b9obrien  switch (howto->size)
43771671b9obrien    {
43871671b9obrien    case 0: return 1;
43971671b9obrien    case 1: return 2;
44071671b9obrien    case 2: return 4;
44171671b9obrien    case 3: return 0;
44271671b9obrien    case 4: return 8;
44371671b9obrien    case 8: return 16;
44471671b9obrien    case -2: return 4;
44571671b9obrien    default: abort ();
44671671b9obrien    }
44771671b9obrien}
44871671b9obrien
44971671b9obrien/*
45071671b9obrienTYPEDEF
45171671b9obrien	arelent_chain
45271671b9obrien
45371671b9obrienDESCRIPTION
45471671b9obrien
45571671b9obrien	How relocs are tied together in an <<asection>>:
45671671b9obrien
45771671b9obrien.typedef struct relent_chain
45871671b9obrien.{
45971671b9obrien.  arelent relent;
46071671b9obrien.  struct relent_chain *next;
46171671b9obrien.}
46271671b9obrien.arelent_chain;
46371671b9obrien.
46471671b9obrien*/
46571671b9obrien
46671671b9obrien/* N_ONES produces N one bits, without overflowing machine arithmetic.  */
46771671b9obrien#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
46871671b9obrien
46971671b9obrien/*
47071671b9obrienFUNCTION
47171671b9obrien	bfd_check_overflow
47271671b9obrien
47371671b9obrienSYNOPSIS
47471671b9obrien	bfd_reloc_status_type bfd_check_overflow
47571671b9obrien	  (enum complain_overflow how,
47671671b9obrien	   unsigned int bitsize,
47771671b9obrien	   unsigned int rightshift,
47871671b9obrien	   unsigned int addrsize,
47971671b9obrien	   bfd_vma relocation);
48071671b9obrien
48171671b9obrienDESCRIPTION
48271671b9obrien	Perform overflow checking on @var{relocation} which has
48371671b9obrien	@var{bitsize} significant bits and will be shifted right by
48471671b9obrien	@var{rightshift} bits, on a machine with addresses containing
48571671b9obrien	@var{addrsize} significant bits.  The result is either of
48671671b9obrien	@code{bfd_reloc_ok} or @code{bfd_reloc_overflow}.
48771671b9obrien
48871671b9obrien*/
48971671b9obrien
49071671b9obrienbfd_reloc_status_type
49171671b9obrienbfd_check_overflow (enum complain_overflow how,
49271671b9obrien		    unsigned int bitsize,
49371671b9obrien		    unsigned int rightshift,
49471671b9obrien		    unsigned int addrsize,
49571671b9obrien		    bfd_vma relocation)
49671671b9obrien{
49771671b9obrien  bfd_vma fieldmask, addrmask, signmask, ss, a;
49871671b9obrien  bfd_reloc_status_type flag = bfd_reloc_ok;
49971671b9obrien
50071671b9obrien  /* Note: BITSIZE should always be <= ADDRSIZE, but in case it's not,
50171671b9obrien     we'll be permissive: extra bits in the field mask will
50271671b9obrien     automatically extend the address mask for purposes of the
50371671b9obrien     overflow check.  */
50471671b9obrien  fieldmask = N_ONES (bitsize);
5050acbbeedim  signmask = ~fieldmask;
50671671b9obrien  addrmask = N_ONES (addrsize) | fieldmask;
5070acbbeedim  a = (relocation & addrmask) >> rightshift;;
50871671b9obrien
50971671b9obrien  switch (how)
51071671b9obrien    {
51171671b9obrien    case complain_overflow_dont:
51271671b9obrien      break;
51371671b9obrien
51471671b9obrien    case complain_overflow_signed:
51571671b9obrien      /* If any sign bits are set, all sign bits must be set.  That
51671671b9obrien         is, A must be a valid negative address after shifting.  */
51771671b9obrien      signmask = ~ (fieldmask >> 1);
5180acbbeedim      /* Fall thru */
51971671b9obrien
52071671b9obrien    case complain_overflow_bitfield:
52171671b9obrien      /* Bitfields are sometimes signed, sometimes unsigned.  We
52271671b9obrien	 explicitly allow an address wrap too, which means a bitfield
52371671b9obrien	 of n bits is allowed to store -2**n to 2**n-1.  Thus overflow
52471671b9obrien	 if the value has some, but not all, bits set outside the
52571671b9obrien	 field.  */
5260acbbeedim      ss = a & signmask;
5270acbbeedim      if (ss != 0 && ss != ((addrmask >> rightshift) & signmask))
5280acbbeedim	flag = bfd_reloc_overflow;
5290acbbeedim      break;
5300acbbeedim
5310acbbeedim    case complain_overflow_unsigned:
5320acbbeedim      /* We have an overflow if the address does not fit in the field.  */
5330acbbeedim      if ((a & signmask) != 0)
53471671b9obrien	flag = bfd_reloc_overflow;
53571671b9obrien      break;
53671671b9obrien
53771671b9obrien    default:
53871671b9obrien      abort ();
53971671b9obrien    }
54071671b9obrien
54171671b9obrien  return flag;
54271671b9obrien}
54371671b9obrien
54471671b9obrien/*
54571671b9obrienFUNCTION
54671671b9obrien	bfd_perform_relocation
54771671b9obrien
54871671b9obrienSYNOPSIS
54971671b9obrien	bfd_reloc_status_type bfd_perform_relocation
55071671b9obrien          (bfd *abfd,
55171671b9obrien           arelent *reloc_entry,
55271671b9obrien           void *data,
55371671b9obrien           asection *input_section,
55471671b9obrien           bfd *output_bfd,
55571671b9obrien	   char **error_message);
55671671b9obrien
55771671b9obrienDESCRIPTION
55871671b9obrien	If @var{output_bfd} is supplied to this function, the
55971671b9obrien	generated image will be relocatable; the relocations are
56071671b9obrien	copied to the output file after they have been changed to
56171671b9obrien	reflect the new state of the world. There are two ways of
56271671b9obrien	reflecting the results of partial linkage in an output file:
56371671b9obrien	by modifying the output data in place, and by modifying the
56471671b9obrien	relocation record.  Some native formats (e.g., basic a.out and
56571671b9obrien	basic coff) have no way of specifying an addend in the
56671671b9obrien	relocation type, so the addend has to go in the output data.
56771671b9obrien	This is no big deal since in these formats the output data
56871671b9obrien	slot will always be big enough for the addend. Complex reloc
56971671b9obrien	types with addends were invented to solve just this problem.
57071671b9obrien	The @var{error_message} argument is set to an error message if
57171671b9obrien	this return @code{bfd_reloc_dangerous}.
57271671b9obrien
57371671b9obrien*/
57471671b9obrien
57571671b9obrienbfd_reloc_status_type
57671671b9obrienbfd_perform_relocation (bfd *abfd,
57771671b9obrien			arelent *reloc_entry,
57871671b9obrien			void *data,
57971671b9obrien			asection *input_section,
58071671b9obrien			bfd *output_bfd,
58171671b9obrien			char **error_message)
58271671b9obrien{
58371671b9obrien  bfd_vma relocation;
58471671b9obrien  bfd_reloc_status_type flag = bfd_reloc_ok;
58571671b9obrien  bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
58671671b9obrien  bfd_vma output_base = 0;
58771671b9obrien  reloc_howto_type *howto = reloc_entry->howto;
58871671b9obrien  asection *reloc_target_output_section;
58971671b9obrien  asymbol *symbol;
59071671b9obrien
59171671b9obrien  symbol = *(reloc_entry->sym_ptr_ptr);
59271671b9obrien  if (bfd_is_abs_section (symbol->section)
59371671b9obrien      && output_bfd != NULL)
59471671b9obrien    {
59571671b9obrien      reloc_entry->address += input_section->output_offset;
59671671b9obrien      return bfd_reloc_ok;
59771671b9obrien    }
59871671b9obrien
59971671b9obrien  /* If we are not producing relocatable output, return an error if
60071671b9obrien     the symbol is not defined.  An undefined weak symbol is
60171671b9obrien     considered to have a value of zero (SVR4 ABI, p. 4-27).  */
60271671b9obrien  if (bfd_is_und_section (symbol->section)
60371671b9obrien      && (symbol->flags & BSF_WEAK) == 0
60471671b9obrien      && output_bfd == NULL)
60571671b9obrien    flag = bfd_reloc_undefined;
60671671b9obrien
60771671b9obrien  /* If there is a function supplied to handle this relocation type,
60871671b9obrien     call it.  It'll return `bfd_reloc_continue' if further processing
60971671b9obrien     can be done.  */
61071671b9obrien  if (howto->special_function)
61171671b9obrien    {
61271671b9obrien      bfd_reloc_status_type cont;
61371671b9obrien      cont = howto->special_function (abfd, reloc_entry, symbol, data,
61471671b9obrien				      input_section, output_bfd,
61571671b9obrien				      error_message);
61671671b9obrien      if (cont != bfd_reloc_continue)
61771671b9obrien	return cont;
61871671b9obrien    }
61971671b9obrien
62071671b9obrien  /* Is the address of the relocation really within the section?  */
6210acbbeedim  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
62271671b9obrien    return bfd_reloc_outofrange;
62371671b9obrien
62471671b9obrien  /* Work out which section the relocation is targeted at and the
62571671b9obrien     initial relocation command value.  */
62671671b9obrien
62771671b9obrien  /* Get symbol value.  (Common symbols are special.)  */
62871671b9obrien  if (bfd_is_com_section (symbol->section))
62971671b9obrien    relocation = 0;
63071671b9obrien  else
63171671b9obrien    relocation = symbol->value;
63271671b9obrien
63371671b9obrien  reloc_target_output_section = symbol->section->output_section;
63471671b9obrien
63571671b9obrien  /* Convert input-section-relative symbol value to absolute.  */
63671671b9obrien  if ((output_bfd && ! howto->partial_inplace)
63771671b9obrien      || reloc_target_output_section == NULL)
63871671b9obrien    output_base = 0;
63971671b9obrien  else
64071671b9obrien    output_base = reloc_target_output_section->vma;
64171671b9obrien
64271671b9obrien  relocation += output_base + symbol->section->output_offset;
64371671b9obrien
64471671b9obrien  /* Add in supplied addend.  */
64571671b9obrien  relocation += reloc_entry->addend;
64671671b9obrien
64771671b9obrien  /* Here the variable relocation holds the final address of the
64871671b9obrien     symbol we are relocating against, plus any addend.  */
64971671b9obrien
65071671b9obrien  if (howto->pc_relative)
65171671b9obrien    {
65271671b9obrien      /* This is a PC relative relocation.  We want to set RELOCATION
65371671b9obrien	 to the distance between the address of the symbol and the
65471671b9obrien	 location.  RELOCATION is already the address of the symbol.
65571671b9obrien
65671671b9obrien	 We start by subtracting the address of the section containing
65771671b9obrien	 the location.
65871671b9obrien
65971671b9obrien	 If pcrel_offset is set, we must further subtract the position
66071671b9obrien	 of the location within the section.  Some targets arrange for
66171671b9obrien	 the addend to be the negative of the position of the location
66271671b9obrien	 within the section; for example, i386-aout does this.  For
66371671b9obrien	 i386-aout, pcrel_offset is FALSE.  Some other targets do not
66471671b9obrien	 include the position of the location; for example, m88kbcs,
66571671b9obrien	 or ELF.  For those targets, pcrel_offset is TRUE.
66671671b9obrien
66771671b9obrien	 If we are producing relocatable output, then we must ensure
66871671b9obrien	 that this reloc will be correctly computed when the final
66971671b9obrien	 relocation is done.  If pcrel_offset is FALSE we want to wind
67071671b9obrien	 up with the negative of the location within the section,
67171671b9obrien	 which means we must adjust the existing addend by the change
67271671b9obrien	 in the location within the section.  If pcrel_offset is TRUE
67371671b9obrien	 we do not want to adjust the existing addend at all.
67471671b9obrien
67571671b9obrien	 FIXME: This seems logical to me, but for the case of
67671671b9obrien	 producing relocatable output it is not what the code
67771671b9obrien	 actually does.  I don't want to change it, because it seems
67871671b9obrien	 far too likely that something will break.  */
67971671b9obrien
68071671b9obrien      relocation -=
68171671b9obrien	input_section->output_section->vma + input_section->output_offset;
68271671b9obrien
68371671b9obrien      if (howto->pcrel_offset)
68471671b9obrien	relocation -= reloc_entry->address;
68571671b9obrien    }
68671671b9obrien
68771671b9obrien  if (output_bfd != NULL)
68871671b9obrien    {
68971671b9obrien      if (! howto->partial_inplace)
69071671b9obrien	{
69171671b9obrien	  /* This is a partial relocation, and we want to apply the relocation
69271671b9obrien	     to the reloc entry rather than the raw data. Modify the reloc
69371671b9obrien	     inplace to reflect what we now know.  */
69471671b9obrien	  reloc_entry->addend = relocation;
69571671b9obrien	  reloc_entry->address += input_section->output_offset;
69671671b9obrien	  return flag;
69771671b9obrien	}
69871671b9obrien      else
69971671b9obrien	{
70071671b9obrien	  /* This is a partial relocation, but inplace, so modify the
70171671b9obrien	     reloc record a bit.
70271671b9obrien
70371671b9obrien	     If we've relocated with a symbol with a section, change
70471671b9obrien	     into a ref to the section belonging to the symbol.  */
70571671b9obrien
70671671b9obrien	  reloc_entry->address += input_section->output_offset;
70771671b9obrien
70871671b9obrien	  /* WTF?? */
70971671b9obrien	  if (abfd->xvec->flavour == bfd_target_coff_flavour
71071671b9obrien	      && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
71171671b9obrien	      && strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
71271671b9obrien	    {
71371671b9obrien	      /* For m68k-coff, the addend was being subtracted twice during
71471671b9obrien		 relocation with -r.  Removing the line below this comment
71571671b9obrien		 fixes that problem; see PR 2953.
71671671b9obrien
71771671b9obrienHowever, Ian wrote the following, regarding removing the line below,
71871671b9obrienwhich explains why it is still enabled:  --djm
71971671b9obrien
72071671b9obrienIf you put a patch like that into BFD you need to check all the COFF
72171671b9obrienlinkers.  I am fairly certain that patch will break coff-i386 (e.g.,
72271671b9obrienSCO); see coff_i386_reloc in coff-i386.c where I worked around the
72371671b9obrienproblem in a different way.  There may very well be a reason that the
72471671b9obriencode works as it does.
72571671b9obrien
72671671b9obrienHmmm.  The first obvious point is that bfd_perform_relocation should
72771671b9obriennot have any tests that depend upon the flavour.  It's seem like
72871671b9obrienentirely the wrong place for such a thing.  The second obvious point
72971671b9obrienis that the current code ignores the reloc addend when producing
73071671b9obrienrelocatable output for COFF.  That's peculiar.  In fact, I really
73171671b9obrienhave no idea what the point of the line you want to remove is.
73271671b9obrien
73371671b9obrienA typical COFF reloc subtracts the old value of the symbol and adds in
73471671b9obrienthe new value to the location in the object file (if it's a pc
73571671b9obrienrelative reloc it adds the difference between the symbol value and the
73671671b9obrienlocation).  When relocating we need to preserve that property.
73771671b9obrien
73871671b9obrienBFD handles this by setting the addend to the negative of the old
73971671b9obrienvalue of the symbol.  Unfortunately it handles common symbols in a
74071671b9obriennon-standard way (it doesn't subtract the old value) but that's a
74171671b9obriendifferent story (we can't change it without losing backward
74271671b9obriencompatibility with old object files) (coff-i386 does subtract the old
74371671b9obrienvalue, to be compatible with existing coff-i386 targets, like SCO).
74471671b9obrien
74571671b9obrienSo everything works fine when not producing relocatable output.  When
74671671b9obrienwe are producing relocatable output, logically we should do exactly
74771671b9obrienwhat we do when not producing relocatable output.  Therefore, your
74871671b9obrienpatch is correct.  In fact, it should probably always just set
74971671b9obrienreloc_entry->addend to 0 for all cases, since it is, in fact, going to
75071671b9obrienadd the value into the object file.  This won't hurt the COFF code,
75171671b9obrienwhich doesn't use the addend; I'm not sure what it will do to other
75271671b9obrienformats (the thing to check for would be whether any formats both use
75371671b9obrienthe addend and set partial_inplace).
75471671b9obrien
75571671b9obrienWhen I wanted to make coff-i386 produce relocatable output, I ran
75671671b9obrieninto the problem that you are running into: I wanted to remove that
75771671b9obrienline.  Rather than risk it, I made the coff-i386 relocs use a special
75871671b9obrienfunction; it's coff_i386_reloc in coff-i386.c.  The function
75971671b9obrienspecifically adds the addend field into the object file, knowing that
76071671b9obrienbfd_perform_relocation is not going to.  If you remove that line, then
76171671b9obriencoff-i386.c will wind up adding the addend field in twice.  It's
76271671b9obrientrivial to fix; it just needs to be done.
76371671b9obrien
76471671b9obrienThe problem with removing the line is just that it may break some
76571671b9obrienworking code.  With BFD it's hard to be sure of anything.  The right
76671671b9obrienway to deal with this is simply to build and test at least all the
76771671b9obriensupported COFF targets.  It should be straightforward if time and disk
76871671b9obrienspace consuming.  For each target:
76971671b9obrien    1) build the linker
77071671b9obrien    2) generate some executable, and link it using -r (I would
77171671b9obrien       probably use paranoia.o and link against newlib/libc.a, which
77271671b9obrien       for all the supported targets would be available in
77371671b9obrien       /usr/cygnus/progressive/H-host/target/lib/libc.a).
77471671b9obrien    3) make the change to reloc.c
77571671b9obrien    4) rebuild the linker
77671671b9obrien    5) repeat step 2
77771671b9obrien    6) if the resulting object files are the same, you have at least
77871671b9obrien       made it no worse
77971671b9obrien    7) if they are different you have to figure out which version is
78071671b9obrien       right
78171671b9obrien*/
78271671b9obrien	      relocation -= reloc_entry->addend;
78371671b9obrien	      reloc_entry->addend = 0;
78471671b9obrien	    }
78571671b9obrien	  else
78671671b9obrien	    {
78771671b9obrien	      reloc_entry->addend = relocation;
78871671b9obrien	    }
78971671b9obrien	}
79071671b9obrien    }
79171671b9obrien  else
79271671b9obrien    {
79371671b9obrien      reloc_entry->addend = 0;
79471671b9obrien    }
79571671b9obrien
79671671b9obrien  /* FIXME: This overflow checking is incomplete, because the value
79771671b9obrien     might have overflowed before we get here.  For a correct check we
79871671b9obrien     need to compute the value in a size larger than bitsize, but we
79971671b9obrien     can't reasonably do that for a reloc the same size as a host
80071671b9obrien     machine word.
80171671b9obrien     FIXME: We should also do overflow checking on the result after
80271671b9obrien     adding in the value contained in the object file.  */
80371671b9obrien  if (howto->complain_on_overflow != complain_overflow_dont
80471671b9obrien      && flag == bfd_reloc_ok)
80571671b9obrien    flag = bfd_check_overflow (howto->complain_on_overflow,
80671671b9obrien			       howto->bitsize,
80771671b9obrien			       howto->rightshift,
80871671b9obrien			       bfd_arch_bits_per_address (abfd),
80971671b9obrien			       relocation);
81071671b9obrien
81171671b9obrien  /* Either we are relocating all the way, or we don't want to apply
81271671b9obrien     the relocation to the reloc entry (probably because there isn't
81371671b9obrien     any room in the output format to describe addends to relocs).  */
81471671b9obrien
81571671b9obrien  /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
81671671b9obrien     (OSF version 1.3, compiler version 3.11).  It miscompiles the
81771671b9obrien     following program:
81871671b9obrien
81971671b9obrien     struct str
82071671b9obrien     {
82171671b9obrien       unsigned int i0;
82271671b9obrien     } s = { 0 };
82371671b9obrien
82471671b9obrien     int
82571671b9obrien     main ()
82671671b9obrien     {
82771671b9obrien       unsigned long x;
82871671b9obrien
82971671b9obrien       x = 0x100000000;
83071671b9obrien       x <<= (unsigned long) s.i0;
83171671b9obrien       if (x == 0)
83271671b9obrien	 printf ("failed\n");
83371671b9obrien       else
83471671b9obrien	 printf ("succeeded (%lx)\n", x);
83571671b9obrien     }
83671671b9obrien     */
83771671b9obrien
83871671b9obrien  relocation >>= (bfd_vma) howto->rightshift;
83971671b9obrien
84071671b9obrien  /* Shift everything up to where it's going to be used.  */
84171671b9obrien  relocation <<= (bfd_vma) howto->bitpos;
84271671b9obrien
84371671b9obrien  /* Wait for the day when all have the mask in them.  */
84471671b9obrien
84571671b9obrien  /* What we do:
84671671b9obrien     i instruction to be left alone
84771671b9obrien     o offset within instruction
84871671b9obrien     r relocation offset to apply
84971671b9obrien     S src mask
85071671b9obrien     D dst mask
85171671b9obrien     N ~dst mask
85271671b9obrien     A part 1
85371671b9obrien     B part 2
85471671b9obrien     R result
85571671b9obrien
85671671b9obrien     Do this:
85771671b9obrien     ((  i i i i i o o o o o  from bfd_get<size>
85871671b9obrien     and           S S S S S) to get the size offset we want
85971671b9obrien     +   r r r r r r r r r r) to get the final value to place
86071671b9obrien     and           D D D D D  to chop to right size
86171671b9obrien     -----------------------
86271671b9obrien     =             A A A A A
86371671b9obrien     And this:
86471671b9obrien     (   i i i i i o o o o o  from bfd_get<size>
86571671b9obrien     and N N N N N          ) get instruction
86671671b9obrien     -----------------------
86771671b9obrien     =   B B B B B
86871671b9obrien
86971671b9obrien     And then:
87071671b9obrien     (   B B B B B
87171671b9obrien     or            A A A A A)
87271671b9obrien     -----------------------
87371671b9obrien     =   R R R R R R R R R R  put into bfd_put<size>
87471671b9obrien     */
87571671b9obrien
87671671b9obrien#define DOIT(x) \
87771671b9obrien  x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) +  relocation) & howto->dst_mask))
87871671b9obrien
87971671b9obrien  switch (howto->size)
88071671b9obrien    {
88171671b9obrien    case 0:
88271671b9obrien      {
88371671b9obrien	char x = bfd_get_8 (abfd, (char *) data + octets);
88471671b9obrien	DOIT (x);
88571671b9obrien	bfd_put_8 (abfd, x, (unsigned char *) data + octets);
88671671b9obrien      }
88771671b9obrien      break;
88871671b9obrien
88971671b9obrien    case 1:
89071671b9obrien      {
89171671b9obrien	short x = bfd_get_16 (abfd, (bfd_byte *) data + octets);
89271671b9obrien	DOIT (x);
89371671b9obrien	bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + octets);
89471671b9obrien      }
89571671b9obrien      break;
89671671b9obrien    case 2:
89771671b9obrien      {
89871671b9obrien	long x = bfd_get_32 (abfd, (bfd_byte *) data + octets);
89971671b9obrien	DOIT (x);
90071671b9obrien	bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets);
90171671b9obrien      }
90271671b9obrien      break;
90371671b9obrien    case -2:
90471671b9obrien      {
90571671b9obrien	long x = bfd_get_32 (abfd, (bfd_byte *) data + octets);
90671671b9obrien	relocation = -relocation;
90771671b9obrien	DOIT (x);
90871671b9obrien	bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data + octets);
90971671b9obrien      }
91071671b9obrien      break;
91171671b9obrien
91271671b9obrien    case -1:
91371671b9obrien      {
91471671b9obrien	long x = bfd_get_16 (abfd, (bfd_byte *) data + octets);
91571671b9obrien	relocation = -relocation;
91671671b9obrien	DOIT (x);
91771671b9obrien	bfd_put_16 (abfd, (bfd_vma) x, (bfd_byte *) data + octets);
91871671b9obrien      }
91971671b9obrien      break;
92071671b9obrien
92171671b9obrien    case 3:
92271671b9obrien      /* Do nothing */
92371671b9obrien      break;
92471671b9obrien
92571671b9obrien    case 4:
92671671b9obrien#ifdef BFD64
92771671b9obrien      {
92871671b9obrien	bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + octets);
92971671b9obrien	DOIT (x);
93071671b9obrien	bfd_put_64 (abfd, x, (bfd_byte *) data + octets);
93171671b9obrien      }
93271671b9obrien#else
93371671b9obrien      abort ();
93471671b9obrien#endif
93571671b9obrien      break;
93671671b9obrien    default:
93771671b9obrien      return bfd_reloc_other;
93871671b9obrien    }
93971671b9obrien
94071671b9obrien  return flag;
94171671b9obrien}
94271671b9obrien
94371671b9obrien/*
94471671b9obrienFUNCTION
94571671b9obrien	bfd_install_relocation
94671671b9obrien
94771671b9obrienSYNOPSIS
94871671b9obrien	bfd_reloc_status_type bfd_install_relocation
94971671b9obrien          (bfd *abfd,
95071671b9obrien           arelent *reloc_entry,
95171671b9obrien           void *data, bfd_vma data_start,
95271671b9obrien           asection *input_section,
95371671b9obrien	   char **error_message);
95471671b9obrien
95571671b9obrienDESCRIPTION
95671671b9obrien	This looks remarkably like <<bfd_perform_relocation>>, except it
95771671b9obrien	does not expect that the section contents have been filled in.
95871671b9obrien	I.e., it's suitable for use when creating, rather than applying
95971671b9obrien	a relocation.
96071671b9obrien
96171671b9obrien	For now, this function should be considered reserved for the
96271671b9obrien	assembler.
96371671b9obrien*/
96471671b9obrien
96571671b9obrienbfd_reloc_status_type
96671671b9obrienbfd_install_relocation (bfd *abfd,
96771671b9obrien			arelent *reloc_entry,
96871671b9obrien			void *data_start,
96971671b9obrien			bfd_vma data_start_offset,
97071671b9obrien			asection *input_section,
97171671b9obrien			char **error_message)
97271671b9obrien{
97371671b9obrien  bfd_vma relocation;
97471671b9obrien  bfd_reloc_status_type flag = bfd_reloc_ok;
97571671b9obrien  bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
97671671b9obrien  bfd_vma output_base = 0;
97771671b9obrien  reloc_howto_type *howto = reloc_entry->howto;
97871671b9obrien  asection *reloc_target_output_section;
97971671b9obrien  asymbol *symbol;
98071671b9obrien  bfd_byte *data;
98171671b9obrien
98271671b9obrien  symbol = *(reloc_entry->sym_ptr_ptr);
98371671b9obrien  if (bfd_is_abs_section (symbol->section))
98471671b9obrien    {
98571671b9obrien      reloc_entry->address += input_section->output_offset;
98671671b9obrien      return bfd_reloc_ok;
98771671b9obrien    }
98871671b9obrien
98971671b9obrien  /* If there is a function supplied to handle this relocation type,
99071671b9obrien     call it.  It'll return `bfd_reloc_continue' if further processing
99171671b9obrien     can be done.  */
99271671b9obrien  if (howto->special_function)
99371671b9obrien    {
99471671b9obrien      bfd_reloc_status_type cont;
99571671b9obrien
99671671b9obrien      /* XXX - The special_function calls haven't been fixed up to deal
99771671b9obrien	 with creating new relocations and section contents.  */
99871671b9obrien      cont = howto->special_function (abfd, reloc_entry, symbol,
99971671b9obrien				      /* XXX - Non-portable! */
100071671b9obrien				      ((bfd_byte *) data_start
100171671b9obrien				       - data_start_offset),
100271671b9obrien				      input_section, abfd, error_message);
100371671b9obrien      if (cont != bfd_reloc_continue)
100471671b9obrien	return cont;
100571671b9obrien    }
100671671b9obrien
100771671b9obrien  /* Is the address of the relocation really within the section?  */
10080acbbeedim  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
100971671b9obrien    return bfd_reloc_outofrange;
101071671b9obrien
101171671b9obrien  /* Work out which section the relocation is targeted at and the
101271671b9obrien     initial relocation command value.  */
101371671b9obrien
101471671b9obrien  /* Get symbol value.  (Common symbols are special.)  */
101571671b9obrien  if (bfd_is_com_section (symbol->section))
101671671b9obrien    relocation = 0;
101771671b9obrien  else
101871671b9obrien    relocation = symbol->value;
101971671b9obrien
102071671b9obrien  reloc_target_output_section = symbol->section->output_section;
102171671b9obrien
102271671b9obrien  /* Convert input-section-relative symbol value to absolute.  */
102371671b9obrien  if (! howto->partial_inplace)
102471671b9obrien    output_base = 0;
102571671b9obrien  else
102671671b9obrien    output_base = reloc_target_output_section->vma;
102771671b9obrien
102871671b9obrien  relocation += output_base + symbol->section->output_offset;
102971671b9obrien
103071671b9obrien  /* Add in supplied addend.  */
103171671b9obrien  relocation += reloc_entry->addend;
103271671b9obrien
103371671b9obrien  /* Here the variable relocation holds the final address of the
103471671b9obrien     symbol we are relocating against, plus any addend.  */
103571671b9obrien
103671671b9obrien  if (howto->pc_relative)
103771671b9obrien    {
103871671b9obrien      /* This is a PC relative relocation.  We want to set RELOCATION
103971671b9obrien	 to the distance between the address of the symbol and the
104071671b9obrien	 location.  RELOCATION is already the address of the symbol.
104171671b9obrien
104271671b9obrien	 We start by subtracting the address of the section containing
104371671b9obrien	 the location.
104471671b9obrien
104571671b9obrien	 If pcrel_offset is set, we must further subtract the position
104671671b9obrien	 of the location within the section.  Some targets arrange for
104771671b9obrien	 the addend to be the negative of the position of the location
104871671b9obrien	 within the section; for example, i386-aout does this.  For
104971671b9obrien	 i386-aout, pcrel_offset is FALSE.  Some other targets do not
105071671b9obrien	 include the position of the location; for example, m88kbcs,
105171671b9obrien	 or ELF.  For those targets, pcrel_offset is TRUE.
105271671b9obrien
105371671b9obrien	 If we are producing relocatable output, then we must ensure
105471671b9obrien	 that this reloc will be correctly computed when the final
105571671b9obrien	 relocation is done.  If pcrel_offset is FALSE we want to wind
105671671b9obrien	 up with the negative of the location within the section,
105771671b9obrien	 which means we must adjust the existing addend by the change
105871671b9obrien	 in the location within the section.  If pcrel_offset is TRUE
105971671b9obrien	 we do not want to adjust the existing addend at all.
106071671b9obrien
106171671b9obrien	 FIXME: This seems logical to me, but for the case of
106271671b9obrien	 producing relocatable output it is not what the code
106371671b9obrien	 actually does.  I don't want to change it, because it seems
106471671b9obrien	 far too likely that something will break.  */
106571671b9obrien
106671671b9obrien      relocation -=
106771671b9obrien	input_section->output_section->vma + input_section->output_offset;
106871671b9obrien
106971671b9obrien      if (howto->pcrel_offset && howto->partial_inplace)
107071671b9obrien	relocation -= reloc_entry->address;
107171671b9obrien    }
107271671b9obrien
107371671b9obrien  if (! howto->partial_inplace)
107471671b9obrien    {
107571671b9obrien      /* This is a partial relocation, and we want to apply the relocation
107671671b9obrien	 to the reloc entry rather than the raw data. Modify the reloc
107771671b9obrien	 inplace to reflect what we now know.  */
107871671b9obrien      reloc_entry->addend = relocation;
107971671b9obrien      reloc_entry->address += input_section->output_offset;
108071671b9obrien      return flag;
108171671b9obrien    }
108271671b9obrien  else
108371671b9obrien    {
108471671b9obrien      /* This is a partial relocation, but inplace, so modify the
108571671b9obrien	 reloc record a bit.
108671671b9obrien
108771671b9obrien	 If we've relocated with a symbol with a section, change
108871671b9obrien	 into a ref to the section belonging to the symbol.  */
108971671b9obrien      reloc_entry->address += input_section->output_offset;
109071671b9obrien
109171671b9obrien      /* WTF?? */
109271671b9obrien      if (abfd->xvec->flavour == bfd_target_coff_flavour
109371671b9obrien	  && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
109471671b9obrien	  && strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
109571671b9obrien	{
10960acbbeedim
10970acbbeedim	  /* For m68k-coff, the addend was being subtracted twice during
10980acbbeedim	     relocation with -r.  Removing the line below this comment
10990acbbeedim	     fixes that problem; see PR 2953.
110071671b9obrien
110171671b9obrienHowever, Ian wrote the following, regarding removing the line below,
110271671b9obrienwhich explains why it is still enabled:  --djm
110371671b9obrien
110471671b9obrienIf you put a patch like that into BFD you need to check all the COFF
110571671b9obrienlinkers.  I am fairly certain that patch will break coff-i386 (e.g.,
110671671b9obrienSCO); see coff_i386_reloc in coff-i386.c where I worked around the
110771671b9obrienproblem in a different way.  There may very well be a reason that the
110871671b9obriencode works as it does.
110971671b9obrien
111071671b9obrienHmmm.  The first obvious point is that bfd_install_relocation should
111171671b9obriennot have any tests that depend upon the flavour.  It's seem like
111271671b9obrienentirely the wrong place for such a thing.  The second obvious point
111371671b9obrienis that the current code ignores the reloc addend when producing
111471671b9obrienrelocatable output for COFF.  That's peculiar.  In fact, I really
111571671b9obrienhave no idea what the point of the line you want to remove is.
111671671b9obrien
111771671b9obrienA typical COFF reloc subtracts the old value of the symbol and adds in
111871671b9obrienthe new value to the location in the object file (if it's a pc
111971671b9obrienrelative reloc it adds the difference between the symbol value and the
112071671b9obrienlocation).  When relocating we need to preserve that property.
112171671b9obrien
112271671b9obrienBFD handles this by setting the addend to the negative of the old
112371671b9obrienvalue of the symbol.  Unfortunately it handles common symbols in a
112471671b9obriennon-standard way (it doesn't subtract the old value) but that's a
112571671b9obriendifferent story (we can't change it without losing backward
112671671b9obriencompatibility with old object files) (coff-i386 does subtract the old
112771671b9obrienvalue, to be compatible with existing coff-i386 targets, like SCO).
112871671b9obrien
112971671b9obrienSo everything works fine when not producing relocatable output.  When
113071671b9obrienwe are producing relocatable output, logically we should do exactly
113171671b9obrienwhat we do when not producing relocatable output.  Therefore, your
113271671b9obrienpatch is correct.  In fact, it should probably always just set
113371671b9obrienreloc_entry->addend to 0 for all cases, since it is, in fact, going to
113471671b9obrienadd the value into the object file.  This won't hurt the COFF code,
113571671b9obrienwhich doesn't use the addend; I'm not sure what it will do to other
113671671b9obrienformats (the thing to check for would be whether any formats both use
113771671b9obrienthe addend and set partial_inplace).
113871671b9obrien
113971671b9obrienWhen I wanted to make coff-i386 produce relocatable output, I ran
114071671b9obrieninto the problem that you are running into: I wanted to remove that
114171671b9obrienline.  Rather than risk it, I made the coff-i386 relocs use a special
114271671b9obrienfunction; it's coff_i386_reloc in coff-i386.c.  The function
114371671b9obrienspecifically adds the addend field into the object file, knowing that
114471671b9obrienbfd_install_relocation is not going to.  If you remove that line, then
114571671b9obriencoff-i386.c will wind up adding the addend field in twice.  It's
114671671b9obrientrivial to fix; it just needs to be done.
114771671b9obrien
114871671b9obrienThe problem with removing the line is just that it may break some
114971671b9obrienworking code.  With BFD it's hard to be sure of anything.  The right
115071671b9obrienway to deal with this is simply to build and test at least all the
115171671b9obriensupported COFF targets.  It should be straightforward if time and disk
115271671b9obrienspace consuming.  For each target:
115371671b9obrien    1) build the linker
115471671b9obrien    2) generate some executable, and link it using -r (I would
115571671b9obrien       probably use paranoia.o and link against newlib/libc.a, which
115671671b9obrien       for all the supported targets would be available in
115771671b9obrien       /usr/cygnus/progressive/H-host/target/lib/libc.a).
115871671b9obrien    3) make the change to reloc.c
115971671b9obrien    4) rebuild the linker
116071671b9obrien    5) repeat step 2
116171671b9obrien    6) if the resulting object files are the same, you have at least
116271671b9obrien       made it no worse
116371671b9obrien    7) if they are different you have to figure out which version is
116471671b9obrien       right.  */
116571671b9obrien	  relocation -= reloc_entry->addend;
11660acbbeedim	  /* FIXME: There should be no target specific code here...  */
11670acbbeedim	  if (strcmp (abfd->xvec->name, "coff-z8k") != 0)
11680acbbeedim	    reloc_entry->addend = 0;
116971671b9obrien	}
117071671b9obrien      else
117171671b9obrien	{
117271671b9obrien	  reloc_entry->addend = relocation;
117371671b9obrien	}
117471671b9obrien    }
117571671b9obrien
117671671b9obrien  /* FIXME: This overflow checking is incomplete, because the value
117771671b9obrien     might have overflowed before we get here.  For a correct check we
117871671b9obrien     need to compute the value in a size larger than bitsize, but we
117971671b9obrien     can't reasonably do that for a reloc the same size as a host
118071671b9obrien     machine word.
118171671b9obrien     FIXME: We should also do overflow checking on the result after
118271671b9obrien     adding in the value contained in the object file.  */
118371671b9obrien  if (howto->complain_on_overflow != complain_overflow_dont)
118471671b9obrien    flag = bfd_check_overflow (howto->complain_on_overflow,
118571671b9obrien			       howto->bitsize,
118671671b9obrien			       howto->rightshift,
118771671b9obrien			       bfd_arch_bits_per_address (abfd),
118871671b9obrien			       relocation);
118971671b9obrien
119071671b9obrien  /* Either we are relocating all the way, or we don't want to apply
119171671b9obrien     the relocation to the reloc entry (probably because there isn't
119271671b9obrien     any room in the output format to describe addends to relocs).  */
119371671b9obrien
119471671b9obrien  /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
119571671b9obrien     (OSF version 1.3, compiler version 3.11).  It miscompiles the
119671671b9obrien     following program:
119771671b9obrien
119871671b9obrien     struct str
119971671b9obrien     {
120071671b9obrien       unsigned int i0;
120171671b9obrien     } s = { 0 };
120271671b9obrien
120371671b9obrien     int
120471671b9obrien     main ()
120571671b9obrien     {
120671671b9obrien       unsigned long x;
120771671b9obrien
120871671b9obrien       x = 0x100000000;
120971671b9obrien       x <<= (unsigned long) s.i0;
121071671b9obrien       if (x == 0)
121171671b9obrien	 printf ("failed\n");
121271671b9obrien       else
121371671b9obrien	 printf ("succeeded (%lx)\n", x);
121471671b9obrien     }
121571671b9obrien     */
121671671b9obrien
121771671b9obrien  relocation >>= (bfd_vma) howto->rightshift;
121871671b9obrien
121971671b9obrien  /* Shift everything up to where it's going to be used.  */
122071671b9obrien  relocation <<= (bfd_vma) howto->bitpos;
122171671b9obrien
122271671b9obrien  /* Wait for the day when all have the mask in them.  */
122371671b9obrien
122471671b9obrien  /* What we do:
122571671b9obrien     i instruction to be left alone
122671671b9obrien     o offset within instruction
122771671b9obrien     r relocation offset to apply
122871671b9obrien     S src mask
122971671b9obrien     D dst mask
123071671b9obrien     N ~dst mask
123171671b9obrien     A part 1
123271671b9obrien     B part 2
123371671b9obrien     R result
123471671b9obrien
123571671b9obrien     Do this:
123671671b9obrien     ((  i i i i i o o o o o  from bfd_get<size>
123771671b9obrien     and           S S S S S) to get the size offset we want
123871671b9obrien     +   r r r r r r r r r r) to get the final value to place
123971671b9obrien     and           D D D D D  to chop to right size
124071671b9obrien     -----------------------
124171671b9obrien     =             A A A A A
124271671b9obrien     And this:
124371671b9obrien     (   i i i i i o o o o o  from bfd_get<size>
124471671b9obrien     and N N N N N          ) get instruction
124571671b9obrien     -----------------------
124671671b9obrien     =   B B B B B
124771671b9obrien
124871671b9obrien     And then:
124971671b9obrien     (   B B B B B
125071671b9obrien     or            A A A A A)
125171671b9obrien     -----------------------
125271671b9obrien     =   R R R R R R R R R R  put into bfd_put<size>
125371671b9obrien     */
125471671b9obrien
125571671b9obrien#define DOIT(x) \
125671671b9obrien  x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) +  relocation) & howto->dst_mask))
125771671b9obrien
125871671b9obrien  data = (bfd_byte *) data_start + (octets - data_start_offset);
125971671b9obrien
126071671b9obrien  switch (howto->size)
126171671b9obrien    {
126271671b9obrien    case 0:
126371671b9obrien      {
126471671b9obrien	char x = bfd_get_8 (abfd, data);
126571671b9obrien	DOIT (x);
126671671b9obrien	bfd_put_8 (abfd, x, data);
126771671b9obrien      }
126871671b9obrien      break;
126971671b9obrien
127071671b9obrien    case 1:
127171671b9obrien      {
127271671b9obrien	short x = bfd_get_16 (abfd, data);
127371671b9obrien	DOIT (x);
127471671b9obrien	bfd_put_16 (abfd, (bfd_vma) x, data);
127571671b9obrien      }
127671671b9obrien      break;
127771671b9obrien    case 2:
127871671b9obrien      {
127971671b9obrien	long x = bfd_get_32 (abfd, data);
128071671b9obrien	DOIT (x);
128171671b9obrien	bfd_put_32 (abfd, (bfd_vma) x, data);
128271671b9obrien      }
128371671b9obrien      break;
128471671b9obrien    case -2:
128571671b9obrien      {
128671671b9obrien	long x = bfd_get_32 (abfd, data);
128771671b9obrien	relocation = -relocation;
128871671b9obrien	DOIT (x);
128971671b9obrien	bfd_put_32 (abfd, (bfd_vma) x, data);
129071671b9obrien      }
129171671b9obrien      break;
129271671b9obrien
129371671b9obrien    case 3:
129471671b9obrien      /* Do nothing */
129571671b9obrien      break;
129671671b9obrien
129771671b9obrien    case 4:
129871671b9obrien      {
129971671b9obrien	bfd_vma x = bfd_get_64 (abfd, data);
130071671b9obrien	DOIT (x);
130171671b9obrien	bfd_put_64 (abfd, x, data);
130271671b9obrien      }
130371671b9obrien      break;
130471671b9obrien    default:
130571671b9obrien      return bfd_reloc_other;
130671671b9obrien    }
130771671b9obrien
130871671b9obrien  return flag;
130971671b9obrien}
131071671b9obrien
131171671b9obrien/* This relocation routine is used by some of the backend linkers.
131271671b9obrien   They do not construct asymbol or arelent structures, so there is no
131371671b9obrien   reason for them to use bfd_perform_relocation.  Also,
131471671b9obrien   bfd_perform_relocation is so hacked up it is easier to write a new
131571671b9obrien   function than to try to deal with it.
131671671b9obrien
131771671b9obrien   This routine does a final relocation.  Whether it is useful for a
131871671b9obrien   relocatable link depends upon how the object format defines
131971671b9obrien   relocations.
132071671b9obrien
132171671b9obrien   FIXME: This routine ignores any special_function in the HOWTO,
132271671b9obrien   since the existing special_function values have been written for
132371671b9obrien   bfd_perform_relocation.
132471671b9obrien
132571671b9obrien   HOWTO is the reloc howto information.
132671671b9obrien   INPUT_BFD is the BFD which the reloc applies to.
132771671b9obrien   INPUT_SECTION is the section which the reloc applies to.
132871671b9obrien   CONTENTS is the contents of the section.
132971671b9obrien   ADDRESS is the address of the reloc within INPUT_SECTION.
133071671b9obrien   VALUE is the value of the symbol the reloc refers to.
133171671b9obrien   ADDEND is the addend of the reloc.  */
133271671b9obrien
133371671b9obrienbfd_reloc_status_type
133471671b9obrien_bfd_final_link_relocate (reloc_howto_type *howto,
133571671b9obrien			  bfd *input_bfd,
133671671b9obrien			  asection *input_section,
133771671b9obrien			  bfd_byte *contents,
133871671b9obrien			  bfd_vma address,
133971671b9obrien			  bfd_vma value,
134071671b9obrien			  bfd_vma addend)
134171671b9obrien{
134271671b9obrien  bfd_vma relocation;
134371671b9obrien
134471671b9obrien  /* Sanity check the address.  */
13450acbbeedim  if (address > bfd_get_section_limit (input_bfd, input_section))
134671671b9obrien    return bfd_reloc_outofrange;
134771671b9obrien
134871671b9obrien  /* This function assumes that we are dealing with a basic relocation
134971671b9obrien     against a symbol.  We want to compute the value of the symbol to
135071671b9obrien     relocate to.  This is just VALUE, the value of the symbol, plus
135171671b9obrien     ADDEND, any addend associated with the reloc.  */
135271671b9obrien  relocation = value + addend;
135371671b9obrien
135471671b9obrien  /* If the relocation is PC relative, we want to set RELOCATION to
135571671b9obrien     the distance between the symbol (currently in RELOCATION) and the
135671671b9obrien     location we are relocating.  Some targets (e.g., i386-aout)
135771671b9obrien     arrange for the contents of the section to be the negative of the
135871671b9obrien     offset of the location within the section; for such targets
135971671b9obrien     pcrel_offset is FALSE.  Other targets (e.g., m88kbcs or ELF)
136071671b9obrien     simply leave the contents of the section as zero; for such
136171671b9obrien     targets pcrel_offset is TRUE.  If pcrel_offset is FALSE we do not
136271671b9obrien     need to subtract out the offset of the location within the
136371671b9obrien     section (which is just ADDRESS).  */
136471671b9obrien  if (howto->pc_relative)
136571671b9obrien    {
136671671b9obrien      relocation -= (input_section->output_section->vma
136771671b9obrien		     + input_section->output_offset);
136871671b9obrien      if (howto->pcrel_offset)
136971671b9obrien	relocation -= address;
137071671b9obrien    }
137171671b9obrien
137271671b9obrien  return _bfd_relocate_contents (howto, input_bfd, relocation,
137371671b9obrien				 contents + address);
137471671b9obrien}
137571671b9obrien
137671671b9obrien/* Relocate a given location using a given value and howto.  */
137771671b9obrien
137871671b9obrienbfd_reloc_status_type
137971671b9obrien_bfd_relocate_contents (reloc_howto_type *howto,
138071671b9obrien			bfd *input_bfd,
138171671b9obrien			bfd_vma relocation,
138271671b9obrien			bfd_byte *location)
138371671b9obrien{
138471671b9obrien  int size;
138571671b9obrien  bfd_vma x = 0;
138671671b9obrien  bfd_reloc_status_type flag;
138771671b9obrien  unsigned int rightshift = howto->rightshift;
138871671b9obrien  unsigned int bitpos = howto->bitpos;
138971671b9obrien
139071671b9obrien  /* If the size is negative, negate RELOCATION.  This isn't very
139171671b9obrien     general.  */
139271671b9obrien  if (howto->size < 0)
139371671b9obrien    relocation = -relocation;
139471671b9obrien
139571671b9obrien  /* Get the value we are going to relocate.  */
139671671b9obrien  size = bfd_get_reloc_size (howto);
139771671b9obrien  switch (size)
139871671b9obrien    {
139971671b9obrien    default:
140071671b9obrien    case 0:
140171671b9obrien      abort ();
140271671b9obrien    case 1:
140371671b9obrien      x = bfd_get_8 (input_bfd, location);
140471671b9obrien      break;
140571671b9obrien    case 2:
140671671b9obrien      x = bfd_get_16 (input_bfd, location);
140771671b9obrien      break;
140871671b9obrien    case 4:
140971671b9obrien      x = bfd_get_32 (input_bfd, location);
141071671b9obrien      break;
141171671b9obrien    case 8:
141271671b9obrien#ifdef BFD64
141371671b9obrien      x = bfd_get_64 (input_bfd, location);
141471671b9obrien#else
141571671b9obrien      abort ();
141671671b9obrien#endif
141771671b9obrien      break;
141871671b9obrien    }
141971671b9obrien
142071671b9obrien  /* Check for overflow.  FIXME: We may drop bits during the addition
142171671b9obrien     which we don't check for.  We must either check at every single
142271671b9obrien     operation, which would be tedious, or we must do the computations
142371671b9obrien     in a type larger than bfd_vma, which would be inefficient.  */
142471671b9obrien  flag = bfd_reloc_ok;
142571671b9obrien  if (howto->complain_on_overflow != complain_overflow_dont)
142671671b9obrien    {
142771671b9obrien      bfd_vma addrmask, fieldmask, signmask, ss;
142871671b9obrien      bfd_vma a, b, sum;
142971671b9obrien
143071671b9obrien      /* Get the values to be added together.  For signed and unsigned
143171671b9obrien         relocations, we assume that all values should be truncated to
143271671b9obrien         the size of an address.  For bitfields, all the bits matter.
143371671b9obrien         See also bfd_check_overflow.  */
143471671b9obrien      fieldmask = N_ONES (howto->bitsize);
14350acbbeedim      signmask = ~fieldmask;
143671671b9obrien      addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask;
14370acbbeedim      a = (relocation & addrmask) >> rightshift;
14380acbbeedim      b = (x & howto->src_mask & addrmask) >> bitpos;
143971671b9obrien
144071671b9obrien      switch (howto->complain_on_overflow)
144171671b9obrien	{
144271671b9obrien	case complain_overflow_signed:
144371671b9obrien	  /* If any sign bits are set, all sign bits must be set.
144471671b9obrien	     That is, A must be a valid negative address after
144571671b9obrien	     shifting.  */
14460acbbeedim	  signmask = ~(fieldmask >> 1);
14470acbbeedim	  /* Fall thru */
14480acbbeedim
14490acbbeedim	case complain_overflow_bitfield:
14500acbbeedim	  /* Much like the signed check, but for a field one bit
14510acbbeedim	     wider.  We allow a bitfield to represent numbers in the
14520acbbeedim	     range -2**n to 2**n-1, where n is the number of bits in the
14530acbbeedim	     field.  Note that when bfd_vma is 32 bits, a 32-bit reloc
14540acbbeedim	     can't overflow, which is exactly what we want.  */
145571671b9obrien	  ss = a & signmask;
145671671b9obrien	  if (ss != 0 && ss != ((addrmask >> rightshift) & signmask))
145771671b9obrien	    flag = bfd_reloc_overflow;
145871671b9obrien
145971671b9obrien	  /* We only need this next bit of code if the sign bit of B
146071671b9obrien             is below the sign bit of A.  This would only happen if
146171671b9obrien             SRC_MASK had fewer bits than BITSIZE.  Note that if
146271671b9obrien             SRC_MASK has more bits than BITSIZE, we can get into
146371671b9obrien             trouble; we would need to verify that B is in range, as
146471671b9obrien             we do for A above.  */
14650acbbeedim	  ss = ((~howto->src_mask) >> 1) & howto->src_mask;
14660acbbeedim	  ss >>= bitpos;
146771671b9obrien
146871671b9obrien	  /* Set all the bits above the sign bit.  */
14690acbbeedim	  b = (b ^ ss) - ss;
147071671b9obrien
147171671b9obrien	  /* Now we can do the addition.  */
147271671b9obrien	  sum = a + b;
147371671b9obrien
147471671b9obrien	  /* See if the result has the correct sign.  Bits above the
147571671b9obrien             sign bit are junk now; ignore them.  If the sum is
147671671b9obrien             positive, make sure we did not have all negative inputs;
147771671b9obrien             if the sum is negative, make sure we did not have all
147871671b9obrien             positive inputs.  The test below looks only at the sign
147971671b9obrien             bits, and it really just
148071671b9obrien	         SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM)
148171671b9obrien
14820acbbeedim	     We mask with addrmask here to explicitly allow an address
14830acbbeedim	     wrap-around.  The Linux kernel relies on it, and it is
14840acbbeedim	     the only way to write assembler code which can run when
14850acbbeedim	     loaded at a location 0x80000000 away from the location at
14860acbbeedim	     which it is linked.  */
14870acbbeedim	  if (((~(a ^ b)) & (a ^ sum)) & signmask & addrmask)
14880acbbeedim	    flag = bfd_reloc_overflow;
148971671b9obrien	  break;
149071671b9obrien
149171671b9obrien	case complain_overflow_unsigned:
149271671b9obrien	  /* Checking for an unsigned overflow is relatively easy:
149371671b9obrien             trim the addresses and add, and trim the result as well.
149471671b9obrien             Overflow is normally indicated when the result does not
149571671b9obrien             fit in the field.  However, we also need to consider the
149671671b9obrien             case when, e.g., fieldmask is 0x7fffffff or smaller, an
149771671b9obrien             input is 0x80000000, and bfd_vma is only 32 bits; then we
149871671b9obrien             will get sum == 0, but there is an overflow, since the
149971671b9obrien             inputs did not fit in the field.  Instead of doing a
150071671b9obrien             separate test, we can check for this by or-ing in the
150171671b9obrien             operands when testing for the sum overflowing its final
150271671b9obrien             field.  */
150371671b9obrien	  sum = (a + b) & addrmask;
15040acbbeedim	  if ((a | b | sum) & signmask)
150571671b9obrien	    flag = bfd_reloc_overflow;
150671671b9obrien	  break;
150771671b9obrien
150871671b9obrien	default:
150971671b9obrien	  abort ();
151071671b9obrien	}
151171671b9obrien    }
151271671b9obrien
151371671b9obrien  /* Put RELOCATION in the right bits.  */
151471671b9obrien  relocation >>= (bfd_vma) rightshift;
151571671b9obrien  relocation <<= (bfd_vma) bitpos;
151671671b9obrien
151771671b9obrien  /* Add RELOCATION to the right bits of X.  */
151871671b9obrien  x = ((x & ~howto->dst_mask)
151971671b9obrien       | (((x & howto->src_mask) + relocation) & howto->dst_mask));
152071671b9obrien
152171671b9obrien  /* Put the relocated value back in the object file.  */
152271671b9obrien  switch (size)
152371671b9obrien    {
152471671b9obrien    default:
152571671b9obrien      abort ();
152671671b9obrien    case 1:
152771671b9obrien      bfd_put_8 (input_bfd, x, location);
152871671b9obrien      break;
152971671b9obrien    case 2:
153071671b9obrien      bfd_put_16 (input_bfd, x, location);
153171671b9obrien      break;
153271671b9obrien    case 4:
153371671b9obrien      bfd_put_32 (input_bfd, x, location);
153471671b9obrien      break;
153571671b9obrien    case 8:
153671671b9obrien#ifdef BFD64
153771671b9obrien      bfd_put_64 (input_bfd, x, location);
153871671b9obrien#else
153971671b9obrien      abort ();
154071671b9obrien#endif
154171671b9obrien      break;
154271671b9obrien    }
154371671b9obrien
154471671b9obrien  return flag;
154571671b9obrien}
154671671b9obrien
1547d0f678fdim/* Clear a given location using a given howto, by applying a relocation value
1548d0f678fdim   of zero and discarding any in-place addend.  This is used for fixed-up
1549d0f678fdim   relocations against discarded symbols, to make ignorable debug or unwind
1550d0f678fdim   information more obvious.  */
1551d0f678fdim
1552d0f678fdimvoid
1553d0f678fdim_bfd_clear_contents (reloc_howto_type *howto,
1554d0f678fdim		     bfd *input_bfd,
1555d0f678fdim		     bfd_byte *location)
1556d0f678fdim{
1557d0f678fdim  int size;
1558d0f678fdim  bfd_vma x = 0;
1559d0f678fdim
1560d0f678fdim  /* Get the value we are going to relocate.  */
1561d0f678fdim  size = bfd_get_reloc_size (howto);
1562d0f678fdim  switch (size)
1563d0f678fdim    {
1564d0f678fdim    default:
1565d0f678fdim    case 0:
1566d0f678fdim      abort ();
1567d0f678fdim    case 1:
1568d0f678fdim      x = bfd_get_8 (input_bfd, location);
1569d0f678fdim      break;
1570d0f678fdim    case 2:
1571d0f678fdim      x = bfd_get_16 (input_bfd, location);
1572d0f678fdim      break;
1573d0f678fdim    case 4:
1574d0f678fdim      x = bfd_get_32 (input_bfd, location);
1575d0f678fdim      break;
1576d0f678fdim    case 8:
1577d0f678fdim#ifdef BFD64
1578d0f678fdim      x = bfd_get_64 (input_bfd, location);
1579d0f678fdim#else
1580d0f678fdim      abort ();
1581d0f678fdim#endif
1582d0f678fdim      break;
1583d0f678fdim    }
1584d0f678fdim
1585d0f678fdim  /* Zero out the unwanted bits of X.  */
1586d0f678fdim  x &= ~howto->dst_mask;
1587d0f678fdim
1588d0f678fdim  /* Put the relocated value back in the object file.  */
1589d0f678fdim  switch (size)
1590d0f678fdim    {
1591d0f678fdim    default:
1592d0f678fdim    case 0:
1593d0f678fdim      abort ();
1594d0f678fdim    case 1:
1595d0f678fdim      bfd_put_8 (input_bfd, x, location);
1596d0f678fdim      break;
1597d0f678fdim    case 2:
1598d0f678fdim      bfd_put_16 (input_bfd, x, location);
1599d0f678fdim      break;
1600d0f678fdim    case 4:
1601d0f678fdim      bfd_put_32 (input_bfd, x, location);
1602d0f678fdim      break;
1603d0f678fdim    case 8:
1604d0f678fdim#ifdef BFD64
1605d0f678fdim      bfd_put_64 (input_bfd, x, location);
1606d0f678fdim#else
1607d0f678fdim      abort ();
1608d0f678fdim#endif
1609d0f678fdim      break;
1610d0f678fdim    }
1611d0f678fdim}
1612d0f678fdim
161371671b9obrien/*
161471671b9obrienDOCDD
161571671b9obrienINODE
161671671b9obrien	howto manager,  , typedef arelent, Relocations
161771671b9obrien
16180acbbeedimSUBSECTION
161971671b9obrien	The howto manager
162071671b9obrien
162171671b9obrien	When an application wants to create a relocation, but doesn't
162271671b9obrien	know what the target machine might call it, it can find out by
162371671b9obrien	using this bit of code.
162471671b9obrien
162571671b9obrien*/
162671671b9obrien
162771671b9obrien/*
162871671b9obrienTYPEDEF
162971671b9obrien	bfd_reloc_code_type
163071671b9obrien
163171671b9obrienDESCRIPTION
163271671b9obrien	The insides of a reloc code.  The idea is that, eventually, there
163371671b9obrien	will be one enumerator for every type of relocation we ever do.
163471671b9obrien	Pass one of these values to <<bfd_reloc_type_lookup>>, and it'll
163571671b9obrien	return a howto pointer.
163671671b9obrien
163771671b9obrien	This does mean that the application must determine the correct
163871671b9obrien	enumerator value; you can't get a howto pointer from a random set
163971671b9obrien	of attributes.
164071671b9obrien
164171671b9obrienSENUM
164271671b9obrien   bfd_reloc_code_real
164371671b9obrien
164471671b9obrienENUM
164571671b9obrien  BFD_RELOC_64
164671671b9obrienENUMX
164771671b9obrien  BFD_RELOC_32
164871671b9obrienENUMX
164971671b9obrien  BFD_RELOC_26
165071671b9obrienENUMX
165171671b9obrien  BFD_RELOC_24
165271671b9obrienENUMX
165371671b9obrien  BFD_RELOC_16
165471671b9obrienENUMX
165571671b9obrien  BFD_RELOC_14
165671671b9obrienENUMX
165771671b9obrien  BFD_RELOC_8
165871671b9obrienENUMDOC
165971671b9obrien  Basic absolute relocations of N bits.
166071671b9obrien
166171671b9obrienENUM
166271671b9obrien  BFD_RELOC_64_PCREL
166371671b9obrienENUMX
166471671b9obrien  BFD_RELOC_32_PCREL
166571671b9obrienENUMX
166671671b9obrien  BFD_RELOC_24_PCREL
166771671b9obrienENUMX
166871671b9obrien  BFD_RELOC_16_PCREL
166971671b9obrienENUMX
167071671b9obrien  BFD_RELOC_12_PCREL
167171671b9obrienENUMX
167271671b9obrien  BFD_RELOC_8_PCREL
167371671b9obrienENUMDOC
167471671b9obrien  PC-relative relocations.  Sometimes these are relative to the address
167571671b9obrienof the relocation itself; sometimes they are relative to the start of
167671671b9obrienthe section containing the relocation.  It depends on the specific target.
167771671b9obrien
167871671b9obrienThe 24-bit relocation is used in some Intel 960 configurations.
167971671b9obrien
168071671b9obrienENUM
16810acbbeedim  BFD_RELOC_32_SECREL
16820acbbeedimENUMDOC
16830acbbeedim  Section relative relocations.  Some targets need this for DWARF2.
16840acbbeedim
16850acbbeedimENUM
168671671b9obrien  BFD_RELOC_32_GOT_PCREL
168771671b9obrienENUMX
168871671b9obrien  BFD_RELOC_16_GOT_PCREL
168971671b9obrienENUMX
169071671b9obrien  BFD_RELOC_8_GOT_PCREL
169171671b9obrienENUMX
169271671b9obrien  BFD_RELOC_32_GOTOFF
169371671b9obrienENUMX
169471671b9obrien  BFD_RELOC_16_GOTOFF
169571671b9obrienENUMX
169671671b9obrien  BFD_RELOC_LO16_GOTOFF
169771671b9obrienENUMX
169871671b9obrien  BFD_RELOC_HI16_GOTOFF
169971671b9obrienENUMX
170071671b9obrien  BFD_RELOC_HI16_S_GOTOFF
170171671b9obrienENUMX
170271671b9obrien  BFD_RELOC_8_GOTOFF
170371671b9obrienENUMX
170471671b9obrien  BFD_RELOC_64_PLT_PCREL
170571671b9obrienENUMX
170671671b9obrien  BFD_RELOC_32_PLT_PCREL
170771671b9obrienENUMX
170871671b9obrien  BFD_RELOC_24_PLT_PCREL
170971671b9obrienENUMX
171071671b9obrien  BFD_RELOC_16_PLT_PCREL
171171671b9obrienENUMX
171271671b9obrien  BFD_RELOC_8_PLT_PCREL
171371671b9obrienENUMX
171471671b9obrien  BFD_RELOC_64_PLTOFF
171571671b9obrienENUMX
171671671b9obrien  BFD_RELOC_32_PLTOFF
171771671b9obrienENUMX
171871671b9obrien  BFD_RELOC_16_PLTOFF
171971671b9obrienENUMX
172071671b9obrien  BFD_RELOC_LO16_PLTOFF
172171671b9obrienENUMX
172271671b9obrien  BFD_RELOC_HI16_PLTOFF
172371671b9obrienENUMX
172471671b9obrien  BFD_RELOC_HI16_S_PLTOFF
172571671b9obrienENUMX
172671671b9obrien  BFD_RELOC_8_PLTOFF
172771671b9obrienENUMDOC
172871671b9obrien  For ELF.
172971671b9obrien
173071671b9obrienENUM
173171671b9obrien  BFD_RELOC_68K_GLOB_DAT
173271671b9obrienENUMX
173371671b9obrien  BFD_RELOC_68K_JMP_SLOT
173471671b9obrienENUMX
173571671b9obrien  BFD_RELOC_68K_RELATIVE
173671671b9obrienENUMDOC
173771671b9obrien  Relocations used by 68K ELF.
173871671b9obrien
173971671b9obrienENUM
174071671b9obrien  BFD_RELOC_32_BASEREL
174171671b9obrienENUMX
174271671b9obrien  BFD_RELOC_16_BASEREL
174371671b9obrienENUMX
174471671b9obrien  BFD_RELOC_LO16_BASEREL
174571671b9obrienENUMX
174671671b9obrien  BFD_RELOC_HI16_BASEREL
174771671b9obrienENUMX
174871671b9obrien  BFD_RELOC_HI16_S_BASEREL
174971671b9obrienENUMX
175071671b9obrien  BFD_RELOC_8_BASEREL
175171671b9obrienENUMX
175271671b9obrien  BFD_RELOC_RVA
175371671b9obrienENUMDOC
175471671b9obrien  Linkage-table relative.
175571671b9obrien
175671671b9obrienENUM
175771671b9obrien  BFD_RELOC_8_FFnn
175871671b9obrienENUMDOC
175971671b9obrien  Absolute 8-bit relocation, but used to form an address like 0xFFnn.
176071671b9obrien
176171671b9obrienENUM
176271671b9obrien  BFD_RELOC_32_PCREL_S2
176371671b9obrienENUMX
176471671b9obrien  BFD_RELOC_16_PCREL_S2
176571671b9obrienENUMX
176671671b9obrien  BFD_RELOC_23_PCREL_S2
176771671b9obrienENUMDOC
176871671b9obrien  These PC-relative relocations are stored as word displacements --
176971671b9obrieni.e., byte displacements shifted right two bits.  The 30-bit word
177071671b9obriendisplacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
177171671b9obrienSPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
177271671b9obriensigned 16-bit displacement is used on the MIPS, and the 23-bit
177371671b9obriendisplacement is used on the Alpha.
177471671b9obrien
177571671b9obrienENUM
177671671b9obrien  BFD_RELOC_HI22
177771671b9obrienENUMX
177871671b9obrien  BFD_RELOC_LO10
177971671b9obrienENUMDOC
178071671b9obrien  High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
178171671b9obrienthe target word.  These are used on the SPARC.
178271671b9obrien
178371671b9obrienENUM
178471671b9obrien  BFD_RELOC_GPREL16
178571671b9obrienENUMX
178671671b9obrien  BFD_RELOC_GPREL32
178771671b9obrienENUMDOC
178871671b9obrien  For systems that allocate a Global Pointer register, these are
178971671b9obriendisplacements off that register.  These relocation types are
179071671b9obrienhandled specially, because the value the register will have is
179171671b9obriendecided relatively late.
179271671b9obrien
179371671b9obrienENUM
179471671b9obrien  BFD_RELOC_I960_CALLJ
179571671b9obrienENUMDOC
179671671b9obrien  Reloc types used for i960/b.out.
179771671b9obrien
179871671b9obrienENUM
179971671b9obrien  BFD_RELOC_NONE
180071671b9obrienENUMX
180171671b9obrien  BFD_RELOC_SPARC_WDISP22
180271671b9obrienENUMX
180371671b9obrien  BFD_RELOC_SPARC22
180471671b9obrienENUMX
180571671b9obrien  BFD_RELOC_SPARC13
180671671b9obrienENUMX
180771671b9obrien  BFD_RELOC_SPARC_GOT10
180871671b9obrienENUMX
180971671b9obrien  BFD_RELOC_SPARC_GOT13
181071671b9obrienENUMX
181171671b9obrien  BFD_RELOC_SPARC_GOT22
181271671b9obrienENUMX
181371671b9obrien  BFD_RELOC_SPARC_PC10
181471671b9obrienENUMX
181571671b9obrien  BFD_RELOC_SPARC_PC22
181671671b9obrienENUMX
181771671b9obrien  BFD_RELOC_SPARC_WPLT30
181871671b9obrienENUMX
181971671b9obrien  BFD_RELOC_SPARC_COPY
182071671b9obrienENUMX
182171671b9obrien  BFD_RELOC_SPARC_GLOB_DAT
182271671b9obrienENUMX
182371671b9obrien  BFD_RELOC_SPARC_JMP_SLOT
182471671b9obrienENUMX
182571671b9obrien  BFD_RELOC_SPARC_RELATIVE
182671671b9obrienENUMX
182771671b9obrien  BFD_RELOC_SPARC_UA16
182871671b9obrienENUMX
182971671b9obrien  BFD_RELOC_SPARC_UA32
183071671b9obrienENUMX
183171671b9obrien  BFD_RELOC_SPARC_UA64
183271671b9obrienENUMDOC
183371671b9obrien  SPARC ELF relocations.  There is probably some overlap with other
183471671b9obrien  relocation types already defined.
183571671b9obrien
183671671b9obrienENUM
183771671b9obrien  BFD_RELOC_SPARC_BASE13
183871671b9obrienENUMX
183971671b9obrien  BFD_RELOC_SPARC_BASE22
184071671b9obrienENUMDOC
184171671b9obrien  I think these are specific to SPARC a.out (e.g., Sun 4).
184271671b9obrien
184371671b9obrienENUMEQ
184471671b9obrien  BFD_RELOC_SPARC_64
184571671b9obrien  BFD_RELOC_64
184671671b9obrienENUMX
184771671b9obrien  BFD_RELOC_SPARC_10
184871671b9obrienENUMX
184971671b9obrien  BFD_RELOC_SPARC_11
185071671b9obrienENUMX
185171671b9obrien  BFD_RELOC_SPARC_OLO10
185271671b9obrienENUMX
185371671b9obrien  BFD_RELOC_SPARC_HH22
185471671b9obrienENUMX
185571671b9obrien  BFD_RELOC_SPARC_HM10
185671671b9obrienENUMX
185771671b9obrien  BFD_RELOC_SPARC_LM22
185871671b9obrienENUMX
185971671b9obrien  BFD_RELOC_SPARC_PC_HH22
186071671b9obrienENUMX
186171671b9obrien  BFD_RELOC_SPARC_PC_HM10
186271671b9obrienENUMX
186371671b9obrien  BFD_RELOC_SPARC_PC_LM22
186471671b9obrienENUMX
186571671b9obrien  BFD_RELOC_SPARC_WDISP16
186671671b9obrienENUMX
186771671b9obrien  BFD_RELOC_SPARC_WDISP19
186871671b9obrienENUMX
186971671b9obrien  BFD_RELOC_SPARC_7
187071671b9obrienENUMX
187171671b9obrien  BFD_RELOC_SPARC_6
187271671b9obrienENUMX
187371671b9obrien  BFD_RELOC_SPARC_5
187471671b9obrienENUMEQX
187571671b9obrien  BFD_RELOC_SPARC_DISP64
187671671b9obrien  BFD_RELOC_64_PCREL
187771671b9obrienENUMX
187871671b9obrien  BFD_RELOC_SPARC_PLT32
187971671b9obrienENUMX
188071671b9obrien  BFD_RELOC_SPARC_PLT64
188171671b9obrienENUMX
188271671b9obrien  BFD_RELOC_SPARC_HIX22
188371671b9obrienENUMX
188471671b9obrien  BFD_RELOC_SPARC_LOX10
188571671b9obrienENUMX
188671671b9obrien  BFD_RELOC_SPARC_H44
188771671b9obrienENUMX
188871671b9obrien  BFD_RELOC_SPARC_M44
188971671b9obrienENUMX
189071671b9obrien  BFD_RELOC_SPARC_L44
189171671b9obrienENUMX
189271671b9obrien  BFD_RELOC_SPARC_REGISTER
189371671b9obrienENUMDOC
189471671b9obrien  SPARC64 relocations
189571671b9obrien
189671671b9obrienENUM
189771671b9obrien  BFD_RELOC_SPARC_REV32
189871671b9obrienENUMDOC
189971671b9obrien  SPARC little endian relocation
190071671b9obrienENUM
190171671b9obrien  BFD_RELOC_SPARC_TLS_GD_HI22
190271671b9obrienENUMX
190371671b9obrien  BFD_RELOC_SPARC_TLS_GD_LO10
190471671b9obrienENUMX
190571671b9obrien  BFD_RELOC_SPARC_TLS_GD_ADD
190671671b9obrienENUMX
190771671b9obrien  BFD_RELOC_SPARC_TLS_GD_CALL
190871671b9obrienENUMX
190971671b9obrien  BFD_RELOC_SPARC_TLS_LDM_HI22
191071671b9obrienENUMX
191171671b9obrien  BFD_RELOC_SPARC_TLS_LDM_LO10
191271671b9obrienENUMX
191371671b9obrien  BFD_RELOC_SPARC_TLS_LDM_ADD
191471671b9obrienENUMX
191571671b9obrien  BFD_RELOC_SPARC_TLS_LDM_CALL
191671671b9obrienENUMX
191771671b9obrien  BFD_RELOC_SPARC_TLS_LDO_HIX22
191871671b9obrienENUMX
191971671b9obrien  BFD_RELOC_SPARC_TLS_LDO_LOX10
192071671b9obrienENUMX
192171671b9obrien  BFD_RELOC_SPARC_TLS_LDO_ADD
192271671b9obrienENUMX
192371671b9obrien  BFD_RELOC_SPARC_TLS_IE_HI22
192471671b9obrienENUMX
192571671b9obrien  BFD_RELOC_SPARC_TLS_IE_LO10
192671671b9obrienENUMX
192771671b9obrien  BFD_RELOC_SPARC_TLS_IE_LD
192871671b9obrienENUMX
192971671b9obrien  BFD_RELOC_SPARC_TLS_IE_LDX
193071671b9obrienENUMX
193171671b9obrien  BFD_RELOC_SPARC_TLS_IE_ADD
193271671b9obrienENUMX
193371671b9obrien  BFD_RELOC_SPARC_TLS_LE_HIX22
193471671b9obrienENUMX
193571671b9obrien  BFD_RELOC_SPARC_TLS_LE_LOX10
193671671b9obrienENUMX
193771671b9obrien  BFD_RELOC_SPARC_TLS_DTPMOD32
193871671b9obrienENUMX
193971671b9obrien  BFD_RELOC_SPARC_TLS_DTPMOD64
194071671b9obrienENUMX
194171671b9obrien  BFD_RELOC_SPARC_TLS_DTPOFF32
194271671b9obrienENUMX
194371671b9obrien  BFD_RELOC_SPARC_TLS_DTPOFF64
194471671b9obrienENUMX
194571671b9obrien  BFD_RELOC_SPARC_TLS_TPOFF32
194671671b9obrienENUMX
194771671b9obrien  BFD_RELOC_SPARC_TLS_TPOFF64
194871671b9obrienENUMDOC
194971671b9obrien  SPARC TLS relocations
195071671b9obrien
195171671b9obrienENUM
1952d0f678fdim  BFD_RELOC_SPU_IMM7
1953d0f678fdimENUMX
1954d0f678fdim  BFD_RELOC_SPU_IMM8
1955d0f678fdimENUMX
1956d0f678fdim  BFD_RELOC_SPU_IMM10
1957d0f678fdimENUMX
1958d0f678fdim  BFD_RELOC_SPU_IMM10W
1959d0f678fdimENUMX
1960d0f678fdim  BFD_RELOC_SPU_IMM16
1961d0f678fdimENUMX
1962d0f678fdim  BFD_RELOC_SPU_IMM16W
1963d0f678fdimENUMX
1964d0f678fdim  BFD_RELOC_SPU_IMM18
1965d0f678fdimENUMX
1966d0f678fdim  BFD_RELOC_SPU_PCREL9a
1967d0f678fdimENUMX
1968d0f678fdim  BFD_RELOC_SPU_PCREL9b
1969d0f678fdimENUMX
1970d0f678fdim  BFD_RELOC_SPU_PCREL16
1971d0f678fdimENUMX
1972d0f678fdim  BFD_RELOC_SPU_LO16
1973d0f678fdimENUMX
1974d0f678fdim  BFD_RELOC_SPU_HI16
1975d0f678fdimENUMX
1976d0f678fdim  BFD_RELOC_SPU_PPU32
1977d0f678fdimENUMX
1978d0f678fdim  BFD_RELOC_SPU_PPU64
1979d0f678fdimENUMDOC
1980d0f678fdim  SPU Relocations.
1981d0f678fdim
1982d0f678fdimENUM
198371671b9obrien  BFD_RELOC_ALPHA_GPDISP_HI16
198471671b9obrienENUMDOC
198571671b9obrien  Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
198671671b9obrien     "addend" in some special way.
198771671b9obrien  For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
198871671b9obrien     writing; when reading, it will be the absolute section symbol.  The
198971671b9obrien     addend is the displacement in bytes of the "lda" instruction from
199071671b9obrien     the "ldah" instruction (which is at the address of this reloc).
199171671b9obrienENUM
199271671b9obrien  BFD_RELOC_ALPHA_GPDISP_LO16
199371671b9obrienENUMDOC
199471671b9obrien  For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
199571671b9obrien     with GPDISP_HI16 relocs.  The addend is ignored when writing the
199671671b9obrien     relocations out, and is filled in with the file's GP value on
199771671b9obrien     reading, for convenience.
199871671b9obrien
199971671b9obrienENUM
200071671b9obrien  BFD_RELOC_ALPHA_GPDISP
200171671b9obrienENUMDOC
200271671b9obrien  The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
200371671b9obrien     relocation except that there is no accompanying GPDISP_LO16
200471671b9obrien     relocation.
200571671b9obrien
200671671b9obrienENUM
200771671b9obrien  BFD_RELOC_ALPHA_LITERAL
200871671b9obrienENUMX
200971671b9obrien  BFD_RELOC_ALPHA_ELF_LITERAL
201071671b9obrienENUMX
201171671b9obrien  BFD_RELOC_ALPHA_LITUSE
201271671b9obrienENUMDOC
201371671b9obrien  The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
201471671b9obrien     the assembler turns it into a LDQ instruction to load the address of
201571671b9obrien     the symbol, and then fills in a register in the real instruction.
201671671b9obrien
201771671b9obrien     The LITERAL reloc, at the LDQ instruction, refers to the .lita
201871671b9obrien     section symbol.  The addend is ignored when writing, but is filled
201971671b9obrien     in with the file's GP value on reading, for convenience, as with the
202071671b9obrien     GPDISP_LO16 reloc.
202171671b9obrien
202271671b9obrien     The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
202371671b9obrien     It should refer to the symbol to be referenced, as with 16_GOTOFF,
202471671b9obrien     but it generates output not based on the position within the .got
202571671b9obrien     section, but relative to the GP value chosen for the file during the
202671671b9obrien     final link stage.
202771671b9obrien
202871671b9obrien     The LITUSE reloc, on the instruction using the loaded address, gives
202971671b9obrien     information to the linker that it might be able to use to optimize
203071671b9obrien     away some literal section references.  The symbol is ignored (read
203171671b9obrien     as the absolute section symbol), and the "addend" indicates the type
203271671b9obrien     of instruction using the register:
203371671b9obrien              1 - "memory" fmt insn
203471671b9obrien              2 - byte-manipulation (byte offset reg)
203571671b9obrien              3 - jsr (target of branch)
203671671b9obrien
203771671b9obrienENUM
203871671b9obrien  BFD_RELOC_ALPHA_HINT
203971671b9obrienENUMDOC
204071671b9obrien  The HINT relocation indicates a value that should be filled into the
204171671b9obrien     "hint" field of a jmp/jsr/ret instruction, for possible branch-
204271671b9obrien     prediction logic which may be provided on some processors.
204371671b9obrien
204471671b9obrienENUM
204571671b9obrien  BFD_RELOC_ALPHA_LINKAGE
204671671b9obrienENUMDOC
204771671b9obrien  The LINKAGE relocation outputs a linkage pair in the object file,
204871671b9obrien     which is filled by the linker.
204971671b9obrien
205071671b9obrienENUM
205171671b9obrien  BFD_RELOC_ALPHA_CODEADDR
205271671b9obrienENUMDOC
205371671b9obrien  The CODEADDR relocation outputs a STO_CA in the object file,
205471671b9obrien     which is filled by the linker.
205571671b9obrien
205671671b9obrienENUM
205771671b9obrien  BFD_RELOC_ALPHA_GPREL_HI16
205871671b9obrienENUMX
205971671b9obrien  BFD_RELOC_ALPHA_GPREL_LO16
206071671b9obrienENUMDOC
206171671b9obrien  The GPREL_HI/LO relocations together form a 32-bit offset from the
206271671b9obrien     GP register.
206371671b9obrien
206471671b9obrienENUM
206571671b9obrien  BFD_RELOC_ALPHA_BRSGP
206671671b9obrienENUMDOC
206771671b9obrien  Like BFD_RELOC_23_PCREL_S2, except that the source and target must
206871671b9obrien  share a common GP, and the target address is adjusted for
206971671b9obrien  STO_ALPHA_STD_GPLOAD.
207071671b9obrien
207171671b9obrienENUM
207271671b9obrien  BFD_RELOC_ALPHA_TLSGD
207371671b9obrienENUMX
207471671b9obrien  BFD_RELOC_ALPHA_TLSLDM
207571671b9obrienENUMX
207671671b9obrien  BFD_RELOC_ALPHA_DTPMOD64
207771671b9obrienENUMX
207871671b9obrien  BFD_RELOC_ALPHA_GOTDTPREL16
207971671b9obrienENUMX
208071671b9obrien  BFD_RELOC_ALPHA_DTPREL64
208171671b9obrienENUMX
208271671b9obrien  BFD_RELOC_ALPHA_DTPREL_HI16
208371671b9obrienENUMX
208471671b9obrien  BFD_RELOC_ALPHA_DTPREL_LO16
208571671b9obrienENUMX
208671671b9obrien  BFD_RELOC_ALPHA_DTPREL16
208771671b9obrienENUMX
208871671b9obrien  BFD_RELOC_ALPHA_GOTTPREL16
208971671b9obrienENUMX
209071671b9obrien  BFD_RELOC_ALPHA_TPREL64
209171671b9obrienENUMX
209271671b9obrien  BFD_RELOC_ALPHA_TPREL_HI16
209371671b9obrienENUMX
209471671b9obrien  BFD_RELOC_ALPHA_TPREL_LO16
209571671b9obrienENUMX
209671671b9obrien  BFD_RELOC_ALPHA_TPREL16
209771671b9obrienENUMDOC
209871671b9obrien  Alpha thread-local storage relocations.
209971671b9obrien
210071671b9obrienENUM
210171671b9obrien  BFD_RELOC_MIPS_JMP
210271671b9obrienENUMDOC
210371671b9obrien  Bits 27..2 of the relocation address shifted right 2 bits;
210471671b9obrien     simple reloc otherwise.
210571671b9obrien
210671671b9obrienENUM
210771671b9obrien  BFD_RELOC_MIPS16_JMP
210871671b9obrienENUMDOC
210971671b9obrien  The MIPS16 jump instruction.
211071671b9obrien
211171671b9obrienENUM
211271671b9obrien  BFD_RELOC_MIPS16_GPREL
211371671b9obrienENUMDOC
211471671b9obrien  MIPS16 GP relative reloc.
211571671b9obrien
211671671b9obrienENUM
211771671b9obrien  BFD_RELOC_HI16
211871671b9obrienENUMDOC
211971671b9obrien  High 16 bits of 32-bit value; simple reloc.
212071671b9obrienENUM
212171671b9obrien  BFD_RELOC_HI16_S
212271671b9obrienENUMDOC
212371671b9obrien  High 16 bits of 32-bit value but the low 16 bits will be sign
212471671b9obrien     extended and added to form the final result.  If the low 16
212571671b9obrien     bits form a negative number, we need to add one to the high value
212671671b9obrien     to compensate for the borrow when the low bits are added.
212771671b9obrienENUM
212871671b9obrien  BFD_RELOC_LO16
212971671b9obrienENUMDOC
213071671b9obrien  Low 16 bits.
21310acbbeedim
213271671b9obrienENUM
21330acbbeedim  BFD_RELOC_HI16_PCREL
213471671b9obrienENUMDOC
21350acbbeedim  High 16 bits of 32-bit pc-relative value
213671671b9obrienENUM
21370acbbeedim  BFD_RELOC_HI16_S_PCREL
213871671b9obrienENUMDOC
21390acbbeedim  High 16 bits of 32-bit pc-relative value, adjusted
21400acbbeedimENUM
21410acbbeedim  BFD_RELOC_LO16_PCREL
21420acbbeedimENUMDOC
21430acbbeedim  Low 16 bits of pc-relative value
21440acbbeedim
21450acbbeedimENUM
21460acbbeedim  BFD_RELOC_MIPS16_HI16
21470acbbeedimENUMDOC
21480acbbeedim  MIPS16 high 16 bits of 32-bit value.
21490acbbeedimENUM
21500acbbeedim  BFD_RELOC_MIPS16_HI16_S
21510acbbeedimENUMDOC
21520acbbeedim  MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
21530acbbeedim     extended and added to form the final result.  If the low 16
21540acbbeedim     bits form a negative number, we need to add one to the high value
21550acbbeedim     to compensate for the borrow when the low bits are added.
21560acbbeedimENUM
21570acbbeedim  BFD_RELOC_MIPS16_LO16
21580acbbeedimENUMDOC
21590acbbeedim  MIPS16 low 16 bits.
216071671b9obrien
216171671b9obrienENUM
216271671b9obrien  BFD_RELOC_MIPS_LITERAL
216371671b9obrienENUMDOC
216471671b9obrien  Relocation against a MIPS literal section.
216571671b9obrien
216671671b9obrienENUM
216771671b9obrien  BFD_RELOC_MIPS_GOT16
216871671b9obrienENUMX
216971671b9obrien  BFD_RELOC_MIPS_CALL16
217071671b9obrienENUMX
217171671b9obrien  BFD_RELOC_MIPS_GOT_HI16
217271671b9obrienENUMX
217371671b9obrien  BFD_RELOC_MIPS_GOT_LO16
217471671b9obrienENUMX
217571671b9obrien  BFD_RELOC_MIPS_CALL_HI16
217671671b9obrienENUMX
217771671b9obrien  BFD_RELOC_MIPS_CALL_LO16
217871671b9obrienENUMX
217971671b9obrien  BFD_RELOC_MIPS_SUB
218071671b9obrienENUMX
218171671b9obrien  BFD_RELOC_MIPS_GOT_PAGE
218271671b9obrienENUMX
218371671b9obrien  BFD_RELOC_MIPS_GOT_OFST
218471671b9obrienENUMX
218571671b9obrien  BFD_RELOC_MIPS_GOT_DISP
218671671b9obrienENUMX
218771671b9obrien  BFD_RELOC_MIPS_SHIFT5
218871671b9obrienENUMX
218971671b9obrien  BFD_RELOC_MIPS_SHIFT6
219071671b9obrienENUMX
219171671b9obrien  BFD_RELOC_MIPS_INSERT_A
219271671b9obrienENUMX
219371671b9obrien  BFD_RELOC_MIPS_INSERT_B
219471671b9obrienENUMX
219571671b9obrien  BFD_RELOC_MIPS_DELETE
219671671b9obrienENUMX
219771671b9obrien  BFD_RELOC_MIPS_HIGHEST
219871671b9obrienENUMX
219971671b9obrien  BFD_RELOC_MIPS_HIGHER
220071671b9obrienENUMX
220171671b9obrien  BFD_RELOC_MIPS_SCN_DISP
220271671b9obrienENUMX
220371671b9obrien  BFD_RELOC_MIPS_REL16
220471671b9obrienENUMX
220571671b9obrien  BFD_RELOC_MIPS_RELGOT
220671671b9obrienENUMX
220771671b9obrien  BFD_RELOC_MIPS_JALR
22080acbbeedimENUMX
22090acbbeedim  BFD_RELOC_MIPS_TLS_DTPMOD32
22100acbbeedimENUMX
22110acbbeedim  BFD_RELOC_MIPS_TLS_DTPREL32
22120acbbeedimENUMX
22130acbbeedim  BFD_RELOC_MIPS_TLS_DTPMOD64
22140acbbeedimENUMX
22150acbbeedim  BFD_RELOC_MIPS_TLS_DTPREL64
22160acbbeedimENUMX
22170acbbeedim  BFD_RELOC_MIPS_TLS_GD
22180acbbeedimENUMX
22190acbbeedim  BFD_RELOC_MIPS_TLS_LDM
22200acbbeedimENUMX
22210acbbeedim  BFD_RELOC_MIPS_TLS_DTPREL_HI16
22220acbbeedimENUMX
22230acbbeedim  BFD_RELOC_MIPS_TLS_DTPREL_LO16
22240acbbeedimENUMX
22250acbbeedim  BFD_RELOC_MIPS_TLS_GOTTPREL
22260acbbeedimENUMX
22270acbbeedim  BFD_RELOC_MIPS_TLS_TPREL32
22280acbbeedimENUMX
22290acbbeedim  BFD_RELOC_MIPS_TLS_TPREL64
22300acbbeedimENUMX
22310acbbeedim  BFD_RELOC_MIPS_TLS_TPREL_HI16
22320acbbeedimENUMX
22330acbbeedim  BFD_RELOC_MIPS_TLS_TPREL_LO16
223471671b9obrienENUMDOC
223571671b9obrien  MIPS ELF relocations.
223671671b9obrienCOMMENT
223771671b9obrien
223871671b9obrienENUM
22390acbbeedim  BFD_RELOC_MIPS_COPY
22400acbbeedimENUMX
22410acbbeedim  BFD_RELOC_MIPS_JUMP_SLOT
22420acbbeedimENUMDOC
22430acbbeedim  MIPS ELF relocations (VxWorks extensions).
22440acbbeedimCOMMENT
22450acbbeedim
22460acbbeedimENUM
224771671b9obrien  BFD_RELOC_FRV_LABEL16
224871671b9obrienENUMX
224971671b9obrien  BFD_RELOC_FRV_LABEL24
225071671b9obrienENUMX
225171671b9obrien  BFD_RELOC_FRV_LO16
225271671b9obrienENUMX
225371671b9obrien  BFD_RELOC_FRV_HI16
225471671b9obrienENUMX
225571671b9obrien  BFD_RELOC_FRV_GPREL12
225671671b9obrienENUMX
225771671b9obrien  BFD_RELOC_FRV_GPRELU12
225871671b9obrienENUMX
225971671b9obrien  BFD_RELOC_FRV_GPREL32
226071671b9obrienENUMX
226171671b9obrien  BFD_RELOC_FRV_GPRELHI
226271671b9obrienENUMX
226371671b9obrien  BFD_RELOC_FRV_GPRELLO
226471671b9obrienENUMX
226571671b9obrien  BFD_RELOC_FRV_GOT12
226671671b9obrienENUMX
226771671b9obrien  BFD_RELOC_FRV_GOTHI
226871671b9obrienENUMX
226971671b9obrien  BFD_RELOC_FRV_GOTLO
227071671b9obrienENUMX
227171671b9obrien  BFD_RELOC_FRV_FUNCDESC
227271671b9obrienENUMX
227371671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOT12
227471671b9obrienENUMX
227571671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOTHI
227671671b9obrienENUMX
227771671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOTLO
227871671b9obrienENUMX
227971671b9obrien  BFD_RELOC_FRV_FUNCDESC_VALUE
228071671b9obrienENUMX
228171671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOTOFF12
228271671b9obrienENUMX
228371671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOTOFFHI
228471671b9obrienENUMX
228571671b9obrien  BFD_RELOC_FRV_FUNCDESC_GOTOFFLO
228671671b9obrienENUMX
228771671b9obrien  BFD_RELOC_FRV_GOTOFF12
228871671b9obrienENUMX
228971671b9obrien  BFD_RELOC_FRV_GOTOFFHI
229071671b9obrienENUMX
229171671b9obrien  BFD_RELOC_FRV_GOTOFFLO
22920acbbeedimENUMX
22930acbbeedim  BFD_RELOC_FRV_GETTLSOFF
22940acbbeedimENUMX
22950acbbeedim  BFD_RELOC_FRV_TLSDESC_VALUE
22960acbbeedimENUMX
22970acbbeedim  BFD_RELOC_FRV_GOTTLSDESC12
22980acbbeedimENUMX
22990acbbeedim  BFD_RELOC_FRV_GOTTLSDESCHI
23000acbbeedimENUMX
23010acbbeedim  BFD_RELOC_FRV_GOTTLSDESCLO
23020acbbeedimENUMX
23030acbbeedim  BFD_RELOC_FRV_TLSMOFF12
23040acbbeedimENUMX
23050acbbeedim  BFD_RELOC_FRV_TLSMOFFHI
23060acbbeedimENUMX
23070acbbeedim  BFD_RELOC_FRV_TLSMOFFLO
23080acbbeedimENUMX
23090acbbeedim  BFD_RELOC_FRV_GOTTLSOFF12
23100acbbeedimENUMX
23110acbbeedim  BFD_RELOC_FRV_GOTTLSOFFHI
23120acbbeedimENUMX
23130acbbeedim  BFD_RELOC_FRV_GOTTLSOFFLO
23140acbbeedimENUMX
23150acbbeedim  BFD_RELOC_FRV_TLSOFF
23160acbbeedimENUMX
23170acbbeedim  BFD_RELOC_FRV_TLSDESC_RELAX
23180acbbeedimENUMX
23190acbbeedim  BFD_RELOC_FRV_GETTLSOFF_RELAX
23200acbbeedimENUMX
23210acbbeedim  BFD_RELOC_FRV_TLSOFF_RELAX
23220acbbeedimENUMX
23230acbbeedim  BFD_RELOC_FRV_TLSMOFF
232471671b9obrienENUMDOC
232571671b9obrien  Fujitsu Frv Relocations.
232671671b9obrienCOMMENT
232771671b9obrien
232871671b9obrienENUM
232971671b9obrien  BFD_RELOC_MN10300_GOTOFF24
233071671b9obrienENUMDOC
233171671b9obrien  This is a 24bit GOT-relative reloc for the mn10300.
233271671b9obrienENUM
233371671b9obrien  BFD_RELOC_MN10300_GOT32
233471671b9obrienENUMDOC
233571671b9obrien  This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
233671671b9obrien  in the instruction.
233771671b9obrienENUM
233871671b9obrien  BFD_RELOC_MN10300_GOT24
233971671b9obrienENUMDOC
234071671b9obrien  This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
234171671b9obrien  in the instruction.
234271671b9obrienENUM
234371671b9obrien  BFD_RELOC_MN10300_GOT16
234471671b9obrienENUMDOC
234571671b9obrien  This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
234671671b9obrien  in the instruction.
234771671b9obrienENUM
234871671b9obrien  BFD_RELOC_MN10300_COPY
234971671b9obrienENUMDOC
235071671b9obrien  Copy symbol at runtime.
235171671b9obrienENUM
235271671b9obrien  BFD_RELOC_MN10300_GLOB_DAT
235371671b9obrienENUMDOC
235471671b9obrien  Create GOT entry.
235571671b9obrienENUM
235671671b9obrien  BFD_RELOC_MN10300_JMP_SLOT
235771671b9obrienENUMDOC
235871671b9obrien  Create PLT entry.
235971671b9obrienENUM
236071671b9obrien  BFD_RELOC_MN10300_RELATIVE
236171671b9obrienENUMDOC
236271671b9obrien  Adjust by program base.
236371671b9obrienCOMMENT
236471671b9obrien
236571671b9obrienENUM
236671671b9obrien  BFD_RELOC_386_GOT32
236771671b9obrienENUMX
236871671b9obrien  BFD_RELOC_386_PLT32
236971671b9obrienENUMX
237071671b9obrien  BFD_RELOC_386_COPY
237171671b9obrienENUMX
237271671b9obrien  BFD_RELOC_386_GLOB_DAT
237371671b9obrienENUMX
237471671b9obrien  BFD_RELOC_386_JUMP_SLOT
237571671b9obrienENUMX
237671671b9obrien  BFD_RELOC_386_RELATIVE
237771671b9obrienENUMX
237871671b9obrien  BFD_RELOC_386_GOTOFF
237971671b9obrienENUMX
238071671b9obrien  BFD_RELOC_386_GOTPC
238171671b9obrienENUMX
238271671b9obrien  BFD_RELOC_386_TLS_TPOFF
238371671b9obrienENUMX
238471671b9obrien  BFD_RELOC_386_TLS_IE
238571671b9obrienENUMX
238671671b9obrien  BFD_RELOC_386_TLS_GOTIE
238771671b9obrienENUMX
238871671b9obrien  BFD_RELOC_386_TLS_LE
238971671b9obrienENUMX
239071671b9obrien  BFD_RELOC_386_TLS_GD
239171671b9obrienENUMX
239271671b9obrien  BFD_RELOC_386_TLS_LDM
239371671b9obrienENUMX
239471671b9obrien  BFD_RELOC_386_TLS_LDO_32
239571671b9obrienENUMX
239671671b9obrien  BFD_RELOC_386_TLS_IE_32
239771671b9obrienENUMX
239871671b9obrien  BFD_RELOC_386_TLS_LE_32
239971671b9obrienENUMX
240071671b9obrien  BFD_RELOC_386_TLS_DTPMOD32
240171671b9obrienENUMX
240271671b9obrien  BFD_RELOC_386_TLS_DTPOFF32
240371671b9obrienENUMX
240471671b9obrien  BFD_RELOC_386_TLS_TPOFF32
24050acbbeedimENUMX
24060acbbeedim  BFD_RELOC_386_TLS_GOTDESC
24070acbbeedimENUMX
24080acbbeedim  BFD_RELOC_386_TLS_DESC_CALL
24090acbbeedimENUMX
24100acbbeedim  BFD_RELOC_386_TLS_DESC
241171671b9obrienENUMDOC
241271671b9obrien  i386/elf relocations
241371671b9obrien
241471671b9obrienENUM
241571671b9obrien  BFD_RELOC_X86_64_GOT32
241671671b9obrienENUMX
241771671b9obrien  BFD_RELOC_X86_64_PLT32
241871671b9obrienENUMX
241971671b9obrien  BFD_RELOC_X86_64_COPY
242071671b9obrienENUMX
242171671b9obrien  BFD_RELOC_X86_64_GLOB_DAT
242271671b9obrienENUMX
242371671b9obrien  BFD_RELOC_X86_64_JUMP_SLOT
242471671b9obrienENUMX
242571671b9obrien  BFD_RELOC_X86_64_RELATIVE
242671671b9obrienENUMX
242771671b9obrien  BFD_RELOC_X86_64_GOTPCREL
242871671b9obrienENUMX
242971671b9obrien  BFD_RELOC_X86_64_32S
243071671b9obrienENUMX
243171671b9obrien  BFD_RELOC_X86_64_DTPMOD64
243271671b9obrienENUMX
243371671b9obrien  BFD_RELOC_X86_64_DTPOFF64
243471671b9obrienENUMX
243571671b9obrien  BFD_RELOC_X86_64_TPOFF64
243671671b9obrienENUMX
243771671b9obrien  BFD_RELOC_X86_64_TLSGD
243871671b9obrienENUMX
243971671b9obrien  BFD_RELOC_X86_64_TLSLD
244071671b9obrienENUMX
244171671b9obrien  BFD_RELOC_X86_64_DTPOFF32
244271671b9obrienENUMX
244371671b9obrien  BFD_RELOC_X86_64_GOTTPOFF
244471671b9obrienENUMX
244571671b9obrien  BFD_RELOC_X86_64_TPOFF32
24460acbbeedimENUMX
24470acbbeedim  BFD_RELOC_X86_64_GOTOFF64
24480acbbeedimENUMX
24490acbbeedim  BFD_RELOC_X86_64_GOTPC32
24500acbbeedimENUMX
24510acbbeedim  BFD_RELOC_X86_64_GOT64
24520acbbeedimENUMX
24530acbbeedim  BFD_RELOC_X86_64_GOTPCREL64
24540acbbeedimENUMX
24550acbbeedim  BFD_RELOC_X86_64_GOTPC64
24560acbbeedimENUMX
24570acbbeedim  BFD_RELOC_X86_64_GOTPLT64
24580acbbeedimENUMX
24590acbbeedim  BFD_RELOC_X86_64_PLTOFF64
24600acbbeedimENUMX
24610acbbeedim  BFD_RELOC_X86_64_GOTPC32_TLSDESC
24620acbbeedimENUMX
24630acbbeedim  BFD_RELOC_X86_64_TLSDESC_CALL
24640acbbeedimENUMX
24650acbbeedim  BFD_RELOC_X86_64_TLSDESC
246671671b9obrienENUMDOC
246771671b9obrien  x86-64/elf relocations
246871671b9obrien
246971671b9obrienENUM
247071671b9obrien  BFD_RELOC_NS32K_IMM_8
247171671b9obrienENUMX
247271671b9obrien  BFD_RELOC_NS32K_IMM_16
247371671b9obrienENUMX
247471671b9obrien  BFD_RELOC_NS32K_IMM_32
247571671b9obrienENUMX
247671671b9obrien  BFD_RELOC_NS32K_IMM_8_PCREL
247771671b9obrienENUMX
247871671b9obrien  BFD_RELOC_NS32K_IMM_16_PCREL
247971671b9obrienENUMX
248071671b9obrien  BFD_RELOC_NS32K_IMM_32_PCREL
248171671b9obrienENUMX
248271671b9obrien  BFD_RELOC_NS32K_DISP_8
248371671b9obrienENUMX
248471671b9obrien  BFD_RELOC_NS32K_DISP_16
248571671b9obrienENUMX
248671671b9obrien  BFD_RELOC_NS32K_DISP_32
248771671b9obrienENUMX
248871671b9obrien  BFD_RELOC_NS32K_DISP_8_PCREL
248971671b9obrienENUMX
249071671b9obrien  BFD_RELOC_NS32K_DISP_16_PCREL
249171671b9obrienENUMX
249271671b9obrien  BFD_RELOC_NS32K_DISP_32_PCREL
249371671b9obrienENUMDOC
249471671b9obrien  ns32k relocations
249571671b9obrien
249671671b9obrienENUM
249771671b9obrien  BFD_RELOC_PDP11_DISP_8_PCREL
249871671b9obrienENUMX
249971671b9obrien  BFD_RELOC_PDP11_DISP_6_PCREL
250071671b9obrienENUMDOC
250171671b9obrien  PDP11 relocations
250271671b9obrien
250371671b9obrienENUM
250471671b9obrien  BFD_RELOC_PJ_CODE_HI16
250571671b9obrienENUMX
250671671b9obrien  BFD_RELOC_PJ_CODE_LO16
250771671b9obrienENUMX
250871671b9obrien  BFD_RELOC_PJ_CODE_DIR16
250971671b9obrienENUMX
251071671b9obrien  BFD_RELOC_PJ_CODE_DIR32
251171671b9obrienENUMX
251271671b9obrien  BFD_RELOC_PJ_CODE_REL16
251371671b9obrienENUMX
251471671b9obrien  BFD_RELOC_PJ_CODE_REL32
251571671b9obrienENUMDOC
251671671b9obrien  Picojava relocs.  Not all of these appear in object files.
251771671b9obrien
251871671b9obrienENUM
251971671b9obrien  BFD_RELOC_PPC_B26
252071671b9obrienENUMX
252171671b9obrien  BFD_RELOC_PPC_BA26
252271671b9obrienENUMX
252371671b9obrien  BFD_RELOC_PPC_TOC16
252471671b9obrienENUMX
252571671b9obrien  BFD_RELOC_PPC_B16
252671671b9obrienENUMX
252771671b9obrien  BFD_RELOC_PPC_B16_BRTAKEN
252871671b9obrienENUMX
252971671b9obrien  BFD_RELOC_PPC_B16_BRNTAKEN
253071671b9obrienENUMX
253171671b9obrien  BFD_RELOC_PPC_BA16
253271671b9obrienENUMX
253371671b9obrien  BFD_RELOC_PPC_BA16_BRTAKEN
253471671b9obrienENUMX
253571671b9obrien  BFD_RELOC_PPC_BA16_BRNTAKEN
253671671b9obrienENUMX
253771671b9obrien  BFD_RELOC_PPC_COPY
253871671b9obrienENUMX
253971671b9obrien  BFD_RELOC_PPC_GLOB_DAT
254071671b9obrienENUMX
254171671b9obrien  BFD_RELOC_PPC_JMP_SLOT
254271671b9obrienENUMX
254371671b9obrien  BFD_RELOC_PPC_RELATIVE
254471671b9obrienENUMX
254571671b9obrien  BFD_RELOC_PPC_LOCAL24PC
254671671b9obrienENUMX
254771671b9obrien  BFD_RELOC_PPC_EMB_NADDR32
254871671b9obrienENUMX
254971671b9obrien  BFD_RELOC_PPC_EMB_NADDR16
255071671b9obrienENUMX
255171671b9obrien  BFD_RELOC_PPC_EMB_NADDR16_LO
255271671b9obrienENUMX
255371671b9obrien  BFD_RELOC_PPC_EMB_NADDR16_HI
255471671b9obrienENUMX
255571671b9obrien  BFD_RELOC_PPC_EMB_NADDR16_HA
255671671b9obrienENUMX
255771671b9obrien  BFD_RELOC_PPC_EMB_SDAI16
255871671b9obrienENUMX
255971671b9obrien  BFD_RELOC_PPC_EMB_SDA2I16
256071671b9obrienENUMX
256171671b9obrien  BFD_RELOC_PPC_EMB_SDA2REL
256271671b9obrienENUMX
256371671b9obrien  BFD_RELOC_PPC_EMB_SDA21
256471671b9obrienENUMX
256571671b9obrien  BFD_RELOC_PPC_EMB_MRKREF
256671671b9obrienENUMX
256771671b9obrien  BFD_RELOC_PPC_EMB_RELSEC16
256871671b9obrienENUMX
256971671b9obrien  BFD_RELOC_PPC_EMB_RELST_LO
257071671b9obrienENUMX
257171671b9obrien  BFD_RELOC_PPC_EMB_RELST_HI
257271671b9obrienENUMX
257371671b9obrien  BFD_RELOC_PPC_EMB_RELST_HA
257471671b9obrienENUMX
257571671b9obrien  BFD_RELOC_PPC_EMB_BIT_FLD
257671671b9obrienENUMX
257771671b9obrien  BFD_RELOC_PPC_EMB_RELSDA
257871671b9obrienENUMX
257971671b9obrien  BFD_RELOC_PPC64_HIGHER
258071671b9obrienENUMX
258171671b9obrien  BFD_RELOC_PPC64_HIGHER_S
258271671b9obrienENUMX
258371671b9obrien  BFD_RELOC_PPC64_HIGHEST
258471671b9obrienENUMX
258571671b9obrien  BFD_RELOC_PPC64_HIGHEST_S
258671671b9obrienENUMX
258771671b9obrien  BFD_RELOC_PPC64_TOC16_LO
258871671b9obrienENUMX
258971671b9obrien  BFD_RELOC_PPC64_TOC16_HI
259071671b9obrienENUMX
259171671b9obrien  BFD_RELOC_PPC64_TOC16_HA
259271671b9obrienENUMX
259371671b9obrien  BFD_RELOC_PPC64_TOC
259471671b9obrienENUMX
259571671b9obrien  BFD_RELOC_PPC64_PLTGOT16
259671671b9obrienENUMX
259771671b9obrien  BFD_RELOC_PPC64_PLTGOT16_LO
259871671b9obrienENUMX
259971671b9obrien  BFD_RELOC_PPC64_PLTGOT16_HI
260071671b9obrienENUMX
260171671b9obrien  BFD_RELOC_PPC64_PLTGOT16_HA
260271671b9obrienENUMX
260371671b9obrien  BFD_RELOC_PPC64_ADDR16_DS
260471671b9obrienENUMX
260571671b9obrien  BFD_RELOC_PPC64_ADDR16_LO_DS
260671671b9obrienENUMX
260771671b9obrien  BFD_RELOC_PPC64_GOT16_DS
260871671b9obrienENUMX
260971671b9obrien  BFD_RELOC_PPC64_GOT16_LO_DS
261071671b9obrienENUMX
261171671b9obrien  BFD_RELOC_PPC64_PLT16_LO_DS
261271671b9obrienENUMX
261371671b9obrien  BFD_RELOC_PPC64_SECTOFF_DS
261471671b9obrienENUMX
261571671b9obrien  BFD_RELOC_PPC64_SECTOFF_LO_DS
261671671b9obrienENUMX
261771671b9obrien  BFD_RELOC_PPC64_TOC16_DS
261871671b9obrienENUMX
261971671b9obrien  BFD_RELOC_PPC64_TOC16_LO_DS
262071671b9obrienENUMX
262171671b9obrien  BFD_RELOC_PPC64_PLTGOT16_DS
262271671b9obrienENUMX
262371671b9obrien  BFD_RELOC_PPC64_PLTGOT16_LO_DS
262471671b9obrienENUMDOC
262571671b9obrien  Power(rs6000) and PowerPC relocations.
262671671b9obrien
262771671b9obrienENUM
262871671b9obrien  BFD_RELOC_PPC_TLS
262971671b9obrienENUMX
263096e9bafjhibbits  BFD_RELOC_PPC_TLSGD
263196e9bafjhibbitsENUMX
263296e9bafjhibbits  BFD_RELOC_PPC_TLSLD
263396e9bafjhibbitsENUMX
263471671b9obrien  BFD_RELOC_PPC_DTPMOD
263571671b9obrienENUMX
263671671b9obrien  BFD_RELOC_PPC_TPREL16
263771671b9obrienENUMX
263871671b9obrien  BFD_RELOC_PPC_TPREL16_LO
263971671b9obrienENUMX
264071671b9obrien  BFD_RELOC_PPC_TPREL16_HI
264171671b9obrienENUMX
264271671b9obrien  BFD_RELOC_PPC_TPREL16_HA
264371671b9obrienENUMX
264471671b9obrien  BFD_RELOC_PPC_TPREL
264571671b9obrienENUMX
264671671b9obrien  BFD_RELOC_PPC_DTPREL16
264771671b9obrienENUMX
264871671b9obrien  BFD_RELOC_PPC_DTPREL16_LO
264971671b9obrienENUMX
265071671b9obrien  BFD_RELOC_PPC_DTPREL16_HI
265171671b9obrienENUMX
265271671b9obrien  BFD_RELOC_PPC_DTPREL16_HA
265371671b9obrienENUMX
265471671b9obrien  BFD_RELOC_PPC_DTPREL
265571671b9obrienENUMX
265671671b9obrien  BFD_RELOC_PPC_GOT_TLSGD16
265771671b9obrienENUMX
265871671b9obrien  BFD_RELOC_PPC_GOT_TLSGD16_LO
265971671b9obrienENUMX
266071671b9obrien  BFD_RELOC_PPC_GOT_TLSGD16_HI
266171671b9obrienENUMX
266271671b9obrien  BFD_RELOC_PPC_GOT_TLSGD16_HA
266371671b9obrienENUMX
266471671b9obrien  BFD_RELOC_PPC_GOT_TLSLD16
266571671b9obrienENUMX
266671671b9obrien  BFD_RELOC_PPC_GOT_TLSLD16_LO
266771671b9obrienENUMX
266871671b9obrien  BFD_RELOC_PPC_GOT_TLSLD16_HI
266971671b9obrienENUMX
267071671b9obrien  BFD_RELOC_PPC_GOT_TLSLD16_HA
267171671b9obrienENUMX
267271671b9obrien  BFD_RELOC_PPC_GOT_TPREL16
267371671b9obrienENUMX
267471671b9obrien  BFD_RELOC_PPC_GOT_TPREL16_LO
267571671b9obrienENUMX
267671671b9obrien  BFD_RELOC_PPC_GOT_TPREL16_HI
267771671b9obrienENUMX
267871671b9obrien  BFD_RELOC_PPC_GOT_TPREL16_HA
267971671b9obrienENUMX
268071671b9obrien  BFD_RELOC_PPC_GOT_DTPREL16
268171671b9obrienENUMX
268271671b9obrien  BFD_RELOC_PPC_GOT_DTPREL16_LO
268371671b9obrienENUMX
268471671b9obrien  BFD_RELOC_PPC_GOT_DTPREL16_HI
268571671b9obrienENUMX
268671671b9obrien  BFD_RELOC_PPC_GOT_DTPREL16_HA
268771671b9obrienENUMX
268871671b9obrien  BFD_RELOC_PPC64_TPREL16_DS
268971671b9obrienENUMX
269071671b9obrien  BFD_RELOC_PPC64_TPREL16_LO_DS
269171671b9obrienENUMX
269271671b9obrien  BFD_RELOC_PPC64_TPREL16_HIGHER
269371671b9obrienENUMX
269471671b9obrien  BFD_RELOC_PPC64_TPREL16_HIGHERA
269571671b9obrienENUMX
269671671b9obrien  BFD_RELOC_PPC64_TPREL16_HIGHEST
269771671b9obrienENUMX
269871671b9obrien  BFD_RELOC_PPC64_TPREL16_HIGHESTA
269971671b9obrienENUMX
270071671b9obrien  BFD_RELOC_PPC64_DTPREL16_DS
270171671b9obrienENUMX
270271671b9obrien  BFD_RELOC_PPC64_DTPREL16_LO_DS
270371671b9obrienENUMX
270471671b9obrien  BFD_RELOC_PPC64_DTPREL16_HIGHER
270571671b9obrienENUMX
270671671b9obrien  BFD_RELOC_PPC64_DTPREL16_HIGHERA
270771671b9obrienENUMX
270871671b9obrien  BFD_RELOC_PPC64_DTPREL16_HIGHEST
270971671b9obrienENUMX
271071671b9obrien  BFD_RELOC_PPC64_DTPREL16_HIGHESTA
271171671b9obrienENUMDOC
271271671b9obrien  PowerPC and PowerPC64 thread-local storage relocations.
271371671b9obrien
271471671b9obrienENUM
271571671b9obrien  BFD_RELOC_I370_D12
271671671b9obrienENUMDOC
271771671b9obrien  IBM 370/390 relocations
271871671b9obrien
271971671b9obrienENUM
272071671b9obrien  BFD_RELOC_CTOR
272171671b9obrienENUMDOC
272271671b9obrien  The type of reloc used to build a constructor table - at the moment
272371671b9obrien  probably a 32 bit wide absolute relocation, but the target can choose.
272471671b9obrien  It generally does map to one of the other relocation types.
272571671b9obrien
272671671b9obrienENUM
272771671b9obrien  BFD_RELOC_ARM_PCREL_BRANCH
272871671b9obrienENUMDOC
272971671b9obrien  ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
273071671b9obrien  not stored in the instruction.
273171671b9obrienENUM
273271671b9obrien  BFD_RELOC_ARM_PCREL_BLX
273371671b9obrienENUMDOC
273471671b9obrien  ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
273571671b9obrien  not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
273671671b9obrien  field in the instruction.
273771671b9obrienENUM
273871671b9obrien  BFD_RELOC_THUMB_PCREL_BLX
273971671b9obrienENUMDOC
274071671b9obrien  Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
274171671b9obrien  not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
274271671b9obrien  field in the instruction.
274371671b9obrienENUM
27440acbbeedim  BFD_RELOC_ARM_PCREL_CALL
27450acbbeedimENUMDOC
27460acbbeedim  ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.
27470acbbeedimENUM
27480acbbeedim  BFD_RELOC_ARM_PCREL_JUMP
27490acbbeedimENUMDOC
27500acbbeedim  ARM 26-bit pc-relative branch for B or conditional BL instruction.
27510acbbeedim
27520acbbeedimENUM
27530acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH7
27540acbbeedimENUMX
27550acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH9
27560acbbeedimENUMX
27570acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH12
27580acbbeedimENUMX
27590acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH20
27600acbbeedimENUMX
27610acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH23
27620acbbeedimENUMX
27630acbbeedim  BFD_RELOC_THUMB_PCREL_BRANCH25
27640acbbeedimENUMDOC
27650acbbeedim  Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
27660acbbeedim  The lowest bit must be zero and is not stored in the instruction.
27670acbbeedim  Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
27680acbbeedim  "nn" one smaller in all cases.  Note further that BRANCH23
27690acbbeedim  corresponds to R_ARM_THM_CALL.
27700acbbeedim
27710acbbeedimENUM
27720acbbeedim  BFD_RELOC_ARM_OFFSET_IMM
27730acbbeedimENUMDOC
27740acbbeedim  12-bit immediate offset, used in ARM-format ldr and str instructions.
27750acbbeedim
27760acbbeedimENUM
27770acbbeedim  BFD_RELOC_ARM_THUMB_OFFSET
27780acbbeedimENUMDOC
27790acbbeedim  5-bit immediate offset, used in Thumb-format ldr and str instructions.
27800acbbeedim
27810acbbeedimENUM
27820acbbeedim  BFD_RELOC_ARM_TARGET1
27830acbbeedimENUMDOC
27840acbbeedim  Pc-relative or absolute relocation depending on target.  Used for
27850acbbeedim  entries in .init_array sections.
27860acbbeedimENUM
27870acbbeedim  BFD_RELOC_ARM_ROSEGREL32
27880acbbeedimENUMDOC
27890acbbeedim  Read-only segment base relative address.
27900acbbeedimENUM
27910acbbeedim  BFD_RELOC_ARM_SBREL32
27920acbbeedimENUMDOC
27930acbbeedim  Data segment base relative address.
27940acbbeedimENUM
27950acbbeedim  BFD_RELOC_ARM_TARGET2
27960acbbeedimENUMDOC
27970acbbeedim  This reloc is used for references to RTTI data from exception handling
27980acbbeedim  tables.  The actual definition depends on the target.  It may be a
27990acbbeedim  pc-relative or some form of GOT-indirect relocation.
28000acbbeedimENUM
28010acbbeedim  BFD_RELOC_ARM_PREL31
28020acbbeedimENUMDOC
28030acbbeedim  31-bit PC relative address.
2804d0f678fdimENUM
2805d0f678fdim  BFD_RELOC_ARM_MOVW
2806d0f678fdimENUMX
2807d0f678fdim  BFD_RELOC_ARM_MOVT
2808d0f678fdimENUMX
2809d0f678fdim  BFD_RELOC_ARM_MOVW_PCREL
2810d0f678fdimENUMX
2811d0f678fdim  BFD_RELOC_ARM_MOVT_PCREL
2812d0f678fdimENUMX
2813d0f678fdim  BFD_RELOC_ARM_THUMB_MOVW
2814d0f678fdimENUMX
2815d0f678fdim  BFD_RELOC_ARM_THUMB_MOVT
2816d0f678fdimENUMX
2817d0f678fdim  BFD_RELOC_ARM_THUMB_MOVW_PCREL
2818d0f678fdimENUMX
2819d0f678fdim  BFD_RELOC_ARM_THUMB_MOVT_PCREL
2820d0f678fdimENUMDOC
2821d0f678fdim  Low and High halfword relocations for MOVW and MOVT instructions.
28220acbbeedim
28230acbbeedimENUM
28240acbbeedim  BFD_RELOC_ARM_JUMP_SLOT
28250acbbeedimENUMX
28260acbbeedim  BFD_RELOC_ARM_GLOB_DAT
28270acbbeedimENUMX
28280acbbeedim  BFD_RELOC_ARM_GOT32
28290acbbeedimENUMX
28300acbbeedim  BFD_RELOC_ARM_PLT32
28310acbbeedimENUMX
28320acbbeedim  BFD_RELOC_ARM_RELATIVE
28330acbbeedimENUMX
28340acbbeedim  BFD_RELOC_ARM_GOTOFF
28350acbbeedimENUMX
28360acbbeedim  BFD_RELOC_ARM_GOTPC
28370acbbeedimENUMDOC
28380acbbeedim  Relocations for setting up GOTs and PLTs for shared libraries.
28390acbbeedim
28400acbbeedimENUM
28410acbbeedim  BFD_RELOC_ARM_TLS_GD32
28420acbbeedimENUMX
28430acbbeedim  BFD_RELOC_ARM_TLS_LDO32
28440acbbeedimENUMX
28450acbbeedim  BFD_RELOC_ARM_TLS_LDM32
28460acbbeedimENUMX
28470acbbeedim  BFD_RELOC_ARM_TLS_DTPOFF32
28480acbbeedimENUMX
28490acbbeedim  BFD_RELOC_ARM_TLS_DTPMOD32
28500acbbeedimENUMX
28510acbbeedim  BFD_RELOC_ARM_TLS_TPOFF32
28520acbbeedimENUMX
28530acbbeedim  BFD_RELOC_ARM_TLS_IE32
28540acbbeedimENUMX
28550acbbeedim  BFD_RELOC_ARM_TLS_LE32
28560acbbeedimENUMDOC
28570acbbeedim  ARM thread-local storage relocations.
28580acbbeedim
28590acbbeedimENUM
2860d0f678fdim  BFD_RELOC_ARM_ALU_PC_G0_NC
2861d0f678fdimENUMX
2862d0f678fdim  BFD_RELOC_ARM_ALU_PC_G0
2863d0f678fdimENUMX
2864d0f678fdim  BFD_RELOC_ARM_ALU_PC_G1_NC
2865d0f678fdimENUMX
2866d0f678fdim  BFD_RELOC_ARM_ALU_PC_G1
2867d0f678fdimENUMX
2868d0f678fdim  BFD_RELOC_ARM_ALU_PC_G2
2869d0f678fdimENUMX
2870d0f678fdim  BFD_RELOC_ARM_LDR_PC_G0
2871d0f678fdimENUMX
2872d0f678fdim  BFD_RELOC_ARM_LDR_PC_G1
2873d0f678fdimENUMX
2874d0f678fdim  BFD_RELOC_ARM_LDR_PC_G2
2875d0f678fdimENUMX
2876d0f678fdim  BFD_RELOC_ARM_LDRS_PC_G0
2877d0f678fdimENUMX
2878d0f678fdim  BFD_RELOC_ARM_LDRS_PC_G1
2879d0f678fdimENUMX
2880d0f678fdim  BFD_RELOC_ARM_LDRS_PC_G2
2881d0f678fdimENUMX
2882d0f678fdim  BFD_RELOC_ARM_LDC_PC_G0
2883d0f678fdimENUMX
2884d0f678fdim  BFD_RELOC_ARM_LDC_PC_G1
2885d0f678fdimENUMX
2886d0f678fdim  BFD_RELOC_ARM_LDC_PC_G2
2887d0f678fdimENUMX
2888d0f678fdim  BFD_RELOC_ARM_ALU_SB_G0_NC
2889d0f678fdimENUMX
2890d0f678fdim  BFD_RELOC_ARM_ALU_SB_G0
2891d0f678fdimENUMX
2892d0f678fdim  BFD_RELOC_ARM_ALU_SB_G1_NC
2893d0f678fdimENUMX
2894d0f678fdim  BFD_RELOC_ARM_ALU_SB_G1
2895d0f678fdimENUMX
2896d0f678fdim  BFD_RELOC_ARM_ALU_SB_G2
2897d0f678fdimENUMX
2898d0f678fdim  BFD_RELOC_ARM_LDR_SB_G0
2899d0f678fdimENUMX
2900d0f678fdim  BFD_RELOC_ARM_LDR_SB_G1
2901d0f678fdimENUMX
2902d0f678fdim  BFD_RELOC_ARM_LDR_SB_G2
2903d0f678fdimENUMX
2904d0f678fdim  BFD_RELOC_ARM_LDRS_SB_G0
2905d0f678fdimENUMX
2906d0f678fdim  BFD_RELOC_ARM_LDRS_SB_G1
2907d0f678fdimENUMX
2908d0f678fdim  BFD_RELOC_ARM_LDRS_SB_G2
2909d0f678fdimENUMX
2910d0f678fdim  BFD_RELOC_ARM_LDC_SB_G0
2911d0f678fdimENUMX
2912d0f678fdim  BFD_RELOC_ARM_LDC_SB_G1
2913d0f678fdimENUMX
2914d0f678fdim  BFD_RELOC_ARM_LDC_SB_G2
2915d0f678fdimENUMDOC
2916d0f678fdim  ARM group relocations.
2917d0f678fdim
2918d0f678fdimENUM
291971671b9obrien  BFD_RELOC_ARM_IMMEDIATE
292071671b9obrienENUMX
292171671b9obrien  BFD_RELOC_ARM_ADRL_IMMEDIATE
292271671b9obrienENUMX
29230acbbeedim  BFD_RELOC_ARM_T32_IMMEDIATE
29240acbbeedimENUMX
2925d0f678fdim  BFD_RELOC_ARM_T32_ADD_IMM
2926d0f678fdimENUMX
29270acbbeedim  BFD_RELOC_ARM_T32_IMM12
29280acbbeedimENUMX
29290acbbeedim  BFD_RELOC_ARM_T32_ADD_PC12
293071671b9obrienENUMX
293171671b9obrien  BFD_RELOC_ARM_SHIFT_IMM
293271671b9obrienENUMX
29330acbbeedim  BFD_RELOC_ARM_SMC
29340acbbeedimENUMX
293571671b9obrien  BFD_RELOC_ARM_SWI
293671671b9obrienENUMX
293771671b9obrien  BFD_RELOC_ARM_MULTI
293871671b9obrienENUMX
293971671b9obrien  BFD_RELOC_ARM_CP_OFF_IMM
294071671b9obrienENUMX
294171671b9obrien  BFD_RELOC_ARM_CP_OFF_IMM_S2
294271671b9obrienENUMX
29430acbbeedim  BFD_RELOC_ARM_T32_CP_OFF_IMM
29440acbbeedimENUMX
29450acbbeedim  BFD_RELOC_ARM_T32_CP_OFF_IMM_S2
29460acbbeedimENUMX
294771671b9obrien  BFD_RELOC_ARM_ADR_IMM
294871671b9obrienENUMX
294971671b9obrien  BFD_RELOC_ARM_LDR_IMM
295071671b9obrienENUMX
295171671b9obrien  BFD_RELOC_ARM_LITERAL
295271671b9obrienENUMX
295371671b9obrien  BFD_RELOC_ARM_IN_POOL
295471671b9obrienENUMX
295571671b9obrien  BFD_RELOC_ARM_OFFSET_IMM8
295671671b9obrienENUMX
29570acbbeedim  BFD_RELOC_ARM_T32_OFFSET_U8
29580acbbeedimENUMX
29590acbbeedim  BFD_RELOC_ARM_T32_OFFSET_IMM
29600acbbeedimENUMX
296171671b9obrien  BFD_RELOC_ARM_HWLITERAL
296271671b9obrienENUMX
296371671b9obrien  BFD_RELOC_ARM_THUMB_ADD
296471671b9obrienENUMX
296571671b9obrien  BFD_RELOC_ARM_THUMB_IMM
296671671b9obrienENUMX
296771671b9obrien  BFD_RELOC_ARM_THUMB_SHIFT
29680acbbeedimENUMDOC
29690acbbeedim  These relocs are only used within the ARM assembler.  They are not
29700acbbeedim  (at present) written to any object files.
29710acbbeedim
29720acbbeedimENUM
29730acbbeedim  BFD_RELOC_SH_PCDISP8BY2
297471671b9obrienENUMX
29750acbbeedim  BFD_RELOC_SH_PCDISP12BY2
297671671b9obrienENUMX
29770acbbeedim  BFD_RELOC_SH_IMM3
297871671b9obrienENUMX
29790acbbeedim  BFD_RELOC_SH_IMM3U
298071671b9obrienENUMX
29810acbbeedim  BFD_RELOC_SH_DISP12
298271671b9obrienENUMX
29830acbbeedim  BFD_RELOC_SH_DISP12BY2
298471671b9obrienENUMX
29850acbbeedim  BFD_RELOC_SH_DISP12BY4
298671671b9obrienENUMX
29870acbbeedim  BFD_RELOC_SH_DISP12BY8
298871671b9obrienENUMX
29890acbbeedim  BFD_RELOC_SH_DISP20
299071671b9obrienENUMX
29910acbbeedim  BFD_RELOC_SH_DISP20BY8
299271671b9obrienENUMX
299371671b9obrien  BFD_RELOC_SH_IMM4
299471671b9obrienENUMX
299571671b9obrien  BFD_RELOC_SH_IMM4BY2
299671671b9obrienENUMX
299771671b9obrien  BFD_RELOC_SH_IMM4BY4
299871671b9obrienENUMX
299971671b9obrien  BFD_RELOC_SH_IMM8
300071671b9obrienENUMX
300171671b9obrien  BFD_RELOC_SH_IMM8BY2
300271671b9obrienENUMX
300371671b9obrien  BFD_RELOC_SH_IMM8BY4
300471671b9obrienENUMX
300571671b9obrien  BFD_RELOC_SH_PCRELIMM8BY2
300671671b9obrienENUMX
300771671b9obrien  BFD_RELOC_SH_PCRELIMM8BY4
300871671b9obrienENUMX
300971671b9obrien  BFD_RELOC_SH_SWITCH16
301071671b9obrienENUMX
301171671b9obrien  BFD_RELOC_SH_SWITCH32
301271671b9obrienENUMX
301371671b9obrien  BFD_RELOC_SH_USES
301471671b9obrienENUMX
301571671b9obrien  BFD_RELOC_SH_COUNT
301671671b9obrienENUMX
301771671b9obrien  BFD_RELOC_SH_ALIGN
301871671b9obrienENUMX
301971671b9obrien  BFD_RELOC_SH_CODE
302071671b9obrienENUMX
302171671b9obrien  BFD_RELOC_SH_DATA
302271671b9obrienENUMX
302371671b9obrien  BFD_RELOC_SH_LABEL
302471671b9obrienENUMX
302571671b9obrien  BFD_RELOC_SH_LOOP_START
302671671b9obrienENUMX
302771671b9obrien  BFD_RELOC_SH_LOOP_END
302871671b9obrienENUMX
302971671b9obrien  BFD_RELOC_SH_COPY
303071671b9obrienENUMX
303171671b9obrien  BFD_RELOC_SH_GLOB_DAT
303271671b9obrienENUMX
303371671b9obrien  BFD_RELOC_SH_JMP_SLOT
303471671b9obrienENUMX
303571671b9obrien  BFD_RELOC_SH_RELATIVE
303671671b9obrienENUMX
303771671b9obrien  BFD_RELOC_SH_GOTPC
303871671b9obrienENUMX
303971671b9obrien  BFD_RELOC_SH_GOT_LOW16
304071671b9obrienENUMX
304171671b9obrien  BFD_RELOC_SH_GOT_MEDLOW16
304271671b9obrienENUMX
304371671b9obrien  BFD_RELOC_SH_GOT_MEDHI16
304471671b9obrienENUMX
304571671b9obrien  BFD_RELOC_SH_GOT_HI16
304671671b9obrienENUMX
304771671b9obrien  BFD_RELOC_SH_GOTPLT_LOW16
304871671b9obrienENUMX
304971671b9obrien  BFD_RELOC_SH_GOTPLT_MEDLOW16
305071671b9obrienENUMX
305171671b9obrien  BFD_RELOC_SH_GOTPLT_MEDHI16
305271671b9obrienENUMX
305371671b9obrien  BFD_RELOC_SH_GOTPLT_HI16
305471671b9obrienENUMX
305571671b9obrien  BFD_RELOC_SH_PLT_LOW16
305671671b9obrienENUMX
305771671b9obrien  BFD_RELOC_SH_PLT_MEDLOW16
305871671b9obrienENUMX
305971671b9obrien  BFD_RELOC_SH_PLT_MEDHI16
306071671b9obrienENUMX
306171671b9obrien  BFD_RELOC_SH_PLT_HI16
306271671b9obrienENUMX
306371671b9obrien  BFD_RELOC_SH_GOTOFF_LOW16
306471671b9obrienENUMX
306571671b9obrien  BFD_RELOC_SH_GOTOFF_MEDLOW16
306671671b9obrienENUMX
306771671b9obrien  BFD_RELOC_SH_GOTOFF_MEDHI16
306871671b9obrienENUMX
306971671b9obrien  BFD_RELOC_SH_GOTOFF_HI16
307071671b9obrienENUMX
307171671b9obrien  BFD_RELOC_SH_GOTPC_LOW16
307271671b9obrienENUMX
307371671b9obrien  BFD_RELOC_SH_GOTPC_MEDLOW16
307471671b9obrienENUMX
307571671b9obrien  BFD_RELOC_SH_GOTPC_MEDHI16
307671671b9obrienENUMX
307771671b9obrien  BFD_RELOC_SH_GOTPC_HI16
307871671b9obrienENUMX
307971671b9obrien  BFD_RELOC_SH_COPY64
308071671b9obrienENUMX
308171671b9obrien  BFD_RELOC_SH_GLOB_DAT64
308271671b9obrienENUMX
308371671b9obrien  BFD_RELOC_SH_JMP_SLOT64
308471671b9obrienENUMX
308571671b9obrien  BFD_RELOC_SH_RELATIVE64
308671671b9obrienENUMX
308771671b9obrien  BFD_RELOC_SH_GOT10BY4
308871671b9obrienENUMX
308971671b9obrien  BFD_RELOC_SH_GOT10BY8
309071671b9obrienENUMX
309171671b9obrien  BFD_RELOC_SH_GOTPLT10BY4
309271671b9obrienENUMX
309371671b9obrien  BFD_RELOC_SH_GOTPLT10BY8
309471671b9obrienENUMX
309571671b9obrien  BFD_RELOC_SH_GOTPLT32
309671671b9obrienENUMX
309771671b9obrien  BFD_RELOC_SH_SHMEDIA_CODE
309871671b9obrienENUMX
309971671b9obrien  BFD_RELOC_SH_IMMU5
310071671b9obrienENUMX
310171671b9obrien  BFD_RELOC_SH_IMMS6
310271671b9obrienENUMX
310371671b9obrien  BFD_RELOC_SH_IMMS6BY32
310471671b9obrienENUMX
310571671b9obrien  BFD_RELOC_SH_IMMU6
310671671b9obrienENUMX
310771671b9obrien  BFD_RELOC_SH_IMMS10
310871671b9obrienENUMX
310971671b9obrien  BFD_RELOC_SH_IMMS10BY2
311071671b9obrienENUMX
311171671b9obrien  BFD_RELOC_SH_IMMS10BY4
311271671b9obrienENUMX
311371671b9obrien  BFD_RELOC_SH_IMMS10BY8
311471671b9obrienENUMX
311571671b9obrien  BFD_RELOC_SH_IMMS16
311671671b9obrienENUMX
311771671b9obrien  BFD_RELOC_SH_IMMU16
311871671b9obrienENUMX
311971671b9obrien  BFD_RELOC_SH_IMM_LOW16
312071671b9obrienENUMX
312171671b9obrien  BFD_RELOC_SH_IMM_LOW16_PCREL
312271671b9obrienENUMX
312371671b9obrien  BFD_RELOC_SH_IMM_MEDLOW16
312471671b9obrienENUMX
312571671b9obrien  BFD_RELOC_SH_IMM_MEDLOW16_PCREL
312671671b9obrienENUMX
312771671b9obrien  BFD_RELOC_SH_IMM_MEDHI16
312871671b9obrienENUMX
312971671b9obrien  BFD_RELOC_SH_IMM_MEDHI16_PCREL
313071671b9obrienENUMX
313171671b9obrien  BFD_RELOC_SH_IMM_HI16
313271671b9obrienENUMX
313371671b9obrien  BFD_RELOC_SH_IMM_HI16_PCREL
313471671b9obrienENUMX
313571671b9obrien  BFD_RELOC_SH_PT_16
313671671b9obrienENUMX
313771671b9obrien  BFD_RELOC_SH_TLS_GD_32
313871671b9obrienENUMX
313971671b9obrien  BFD_RELOC_SH_TLS_LD_32
314071671b9obrienENUMX
314171671b9obrien  BFD_RELOC_SH_TLS_LDO_32
314271671b9obrienENUMX
314371671b9obrien  BFD_RELOC_SH_TLS_IE_32
314471671b9obrienENUMX
314571671b9obrien  BFD_RELOC_SH_TLS_LE_32
314671671b9obrienENUMX
314771671b9obrien  BFD_RELOC_SH_TLS_DTPMOD32
314871671b9obrienENUMX
314971671b9obrien  BFD_RELOC_SH_TLS_DTPOFF32
315071671b9obrienENUMX
315171671b9obrien  BFD_RELOC_SH_TLS_TPOFF32
315271671b9obrienENUMDOC
315371671b9obrien  Renesas / SuperH SH relocs.  Not all of these appear in object files.
315471671b9obrien
315571671b9obrienENUM
315671671b9obrien  BFD_RELOC_ARC_B22_PCREL
315771671b9obrienENUMDOC
315871671b9obrien  ARC Cores relocs.
315971671b9obrien  ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
316071671b9obrien  not stored in the instruction.  The high 20 bits are installed in bits 26
316171671b9obrien  through 7 of the instruction.
316271671b9obrienENUM
316371671b9obrien  BFD_RELOC_ARC_B26
316471671b9obrienENUMDOC
316571671b9obrien  ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
316671671b9obrien  stored in the instruction.  The high 24 bits are installed in bits 23
316771671b9obrien  through 0.
316871671b9obrien
316971671b9obrienENUM
31700acbbeedim  BFD_RELOC_BFIN_16_IMM
31710acbbeedimENUMDOC
31720acbbeedim  ADI Blackfin 16 bit immediate absolute reloc.
31730acbbeedimENUM
31740acbbeedim  BFD_RELOC_BFIN_16_HIGH
31750acbbeedimENUMDOC
31760acbbeedim  ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.
31770acbbeedimENUM
31780acbbeedim  BFD_RELOC_BFIN_4_PCREL
31790acbbeedimENUMDOC
31800acbbeedim  ADI Blackfin 'a' part of LSETUP.
31810acbbeedimENUM
31820acbbeedim  BFD_RELOC_BFIN_5_PCREL
31830acbbeedimENUMDOC
31840acbbeedim  ADI Blackfin.
31850acbbeedimENUM
31860acbbeedim  BFD_RELOC_BFIN_16_LOW
31870acbbeedimENUMDOC
31880acbbeedim  ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.
31890acbbeedimENUM
31900acbbeedim  BFD_RELOC_BFIN_10_PCREL
31910acbbeedimENUMDOC
31920acbbeedim  ADI Blackfin.
31930acbbeedimENUM
31940acbbeedim  BFD_RELOC_BFIN_11_PCREL
31950acbbeedimENUMDOC
31960acbbeedim  ADI Blackfin 'b' part of LSETUP.
31970acbbeedimENUM
31980acbbeedim  BFD_RELOC_BFIN_12_PCREL_JUMP
31990acbbeedimENUMDOC
32000acbbeedim  ADI Blackfin.
32010acbbeedimENUM
32020acbbeedim  BFD_RELOC_BFIN_12_PCREL_JUMP_S
32030acbbeedimENUMDOC
32040acbbeedim  ADI Blackfin Short jump, pcrel.
32050acbbeedimENUM
32060acbbeedim  BFD_RELOC_BFIN_24_PCREL_CALL_X
32070acbbeedimENUMDOC
32080acbbeedim  ADI Blackfin Call.x not implemented.
32090acbbeedimENUM
32100acbbeedim  BFD_RELOC_BFIN_24_PCREL_JUMP_L
32110acbbeedimENUMDOC
32120acbbeedim  ADI Blackfin Long Jump pcrel.
32130acbbeedimENUM
32140acbbeedim  BFD_RELOC_BFIN_GOT17M4
32150acbbeedimENUMX
32160acbbeedim  BFD_RELOC_BFIN_GOTHI
32170acbbeedimENUMX
32180acbbeedim  BFD_RELOC_BFIN_GOTLO
32190acbbeedimENUMX
32200acbbeedim  BFD_RELOC_BFIN_FUNCDESC
32210acbbeedimENUMX
32220acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOT17M4
32230acbbeedimENUMX
32240acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOTHI
32250acbbeedimENUMX
32260acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOTLO
32270acbbeedimENUMX
32280acbbeedim  BFD_RELOC_BFIN_FUNCDESC_VALUE
32290acbbeedimENUMX
32300acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
32310acbbeedimENUMX
32320acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
32330acbbeedimENUMX
32340acbbeedim  BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
32350acbbeedimENUMX
32360acbbeedim  BFD_RELOC_BFIN_GOTOFF17M4
32370acbbeedimENUMX
32380acbbeedim  BFD_RELOC_BFIN_GOTOFFHI
32390acbbeedimENUMX
32400acbbeedim  BFD_RELOC_BFIN_GOTOFFLO
32410acbbeedimENUMDOC
32420acbbeedim  ADI Blackfin FD-PIC relocations.
32430acbbeedimENUM
32440acbbeedim  BFD_RELOC_BFIN_GOT
32450acbbeedimENUMDOC
32460acbbeedim  ADI Blackfin GOT relocation.
32470acbbeedimENUM
32480acbbeedim  BFD_RELOC_BFIN_PLTPC
32490acbbeedimENUMDOC
32500acbbeedim  ADI Blackfin PLTPC relocation.
32510acbbeedimENUM
32520acbbeedim  BFD_ARELOC_BFIN_PUSH
32530acbbeedimENUMDOC
32540acbbeedim  ADI Blackfin arithmetic relocation.
32550acbbeedimENUM
32560acbbeedim  BFD_ARELOC_BFIN_CONST
32570acbbeedimENUMDOC
32580acbbeedim  ADI Blackfin arithmetic relocation.
32590acbbeedimENUM
32600acbbeedim  BFD_ARELOC_BFIN_ADD
32610acbbeedimENUMDOC
32620acbbeedim  ADI Blackfin arithmetic relocation.
32630acbbeedimENUM
32640acbbeedim  BFD_ARELOC_BFIN_SUB
32650acbbeedimENUMDOC
32660acbbeedim  ADI Blackfin arithmetic relocation.
32670acbbeedimENUM
32680acbbeedim  BFD_ARELOC_BFIN_MULT
32690acbbeedimENUMDOC
32700acbbeedim  ADI Blackfin arithmetic relocation.
32710acbbeedimENUM
32720acbbeedim  BFD_ARELOC_BFIN_DIV
32730acbbeedimENUMDOC
32740acbbeedim  ADI Blackfin arithmetic relocation.
32750acbbeedimENUM
32760acbbeedim  BFD_ARELOC_BFIN_MOD
32770acbbeedimENUMDOC
32780acbbeedim  ADI Blackfin arithmetic relocation.
32790acbbeedimENUM
32800acbbeedim  BFD_ARELOC_BFIN_LSHIFT
32810acbbeedimENUMDOC
32820acbbeedim  ADI Blackfin arithmetic relocation.
32830acbbeedimENUM
32840acbbeedim  BFD_ARELOC_BFIN_RSHIFT
32850acbbeedimENUMDOC
32860acbbeedim  ADI Blackfin arithmetic relocation.
32870acbbeedimENUM
32880acbbeedim  BFD_ARELOC_BFIN_AND
32890acbbeedimENUMDOC
32900acbbeedim  ADI Blackfin arithmetic relocation.
32910acbbeedimENUM
32920acbbeedim  BFD_ARELOC_BFIN_OR
32930acbbeedimENUMDOC
32940acbbeedim  ADI Blackfin arithmetic relocation.
32950acbbeedimENUM
32960acbbeedim  BFD_ARELOC_BFIN_XOR
32970acbbeedimENUMDOC
32980acbbeedim  ADI Blackfin arithmetic relocation.
32990acbbeedimENUM
33000acbbeedim  BFD_ARELOC_BFIN_LAND
33010acbbeedimENUMDOC
33020acbbeedim  ADI Blackfin arithmetic relocation.
33030acbbeedimENUM
33040acbbeedim  BFD_ARELOC_BFIN_LOR
33050acbbeedimENUMDOC
33060acbbeedim  ADI Blackfin arithmetic relocation.
33070acbbeedimENUM
33080acbbeedim  BFD_ARELOC_BFIN_LEN
33090acbbeedimENUMDOC
33100acbbeedim  ADI Blackfin arithmetic relocation.
33110acbbeedimENUM
33120acbbeedim  BFD_ARELOC_BFIN_NEG
33130acbbeedimENUMDOC
33140acbbeedim  ADI Blackfin arithmetic relocation.
33150acbbeedimENUM
33160acbbeedim  BFD_ARELOC_BFIN_COMP
33170acbbeedimENUMDOC
33180acbbeedim  ADI Blackfin arithmetic relocation.
33190acbbeedimENUM
33200acbbeedim  BFD_ARELOC_BFIN_PAGE
33210acbbeedimENUMDOC
33220acbbeedim  ADI Blackfin arithmetic relocation.
33230acbbeedimENUM
33240acbbeedim  BFD_ARELOC_BFIN_HWPAGE
33250acbbeedimENUMDOC
33260acbbeedim  ADI Blackfin arithmetic relocation.
33270acbbeedimENUM
33280acbbeedim  BFD_ARELOC_BFIN_ADDR
33290acbbeedimENUMDOC
33300acbbeedim  ADI Blackfin arithmetic relocation.
33310acbbeedim
33320acbbeedimENUM
333371671b9obrien  BFD_RELOC_D10V_10_PCREL_R
333471671b9obrienENUMDOC
333571671b9obrien  Mitsubishi D10V relocs.
333671671b9obrien  This is a 10-bit reloc with the right 2 bits
333771671b9obrien  assumed to be 0.
333871671b9obrienENUM
333971671b9obrien  BFD_RELOC_D10V_10_PCREL_L
334071671b9obrienENUMDOC
334171671b9obrien  Mitsubishi D10V relocs.
334271671b9obrien  This is a 10-bit reloc with the right 2 bits
334371671b9obrien  assumed to be 0.  This is the same as the previous reloc
334471671b9obrien  except it is in the left container, i.e.,
334571671b9obrien  shifted left 15 bits.
334671671b9obrienENUM
334771671b9obrien  BFD_RELOC_D10V_18
334871671b9obrienENUMDOC
334971671b9obrien  This is an 18-bit reloc with the right 2 bits
335071671b9obrien  assumed to be 0.
335171671b9obrienENUM
335271671b9obrien  BFD_RELOC_D10V_18_PCREL
335371671b9obrienENUMDOC
335471671b9obrien  This is an 18-bit reloc with the right 2 bits
335571671b9obrien  assumed to be 0.
335671671b9obrien
335771671b9obrienENUM
335871671b9obrien  BFD_RELOC_D30V_6
335971671b9obrienENUMDOC
336071671b9obrien  Mitsubishi D30V relocs.
336171671b9obrien  This is a 6-bit absolute reloc.
336271671b9obrienENUM
336371671b9obrien  BFD_RELOC_D30V_9_PCREL
336471671b9obrienENUMDOC
336571671b9obrien  This is a 6-bit pc-relative reloc with
336671671b9obrien  the right 3 bits assumed to be 0.
336771671b9obrienENUM
336871671b9obrien  BFD_RELOC_D30V_9_PCREL_R
336971671b9obrienENUMDOC
337071671b9obrien  This is a 6-bit pc-relative reloc with
337171671b9obrien  the right 3 bits assumed to be 0. Same
337271671b9obrien  as the previous reloc but on the right side
337371671b9obrien  of the container.
337471671b9obrienENUM
337571671b9obrien  BFD_RELOC_D30V_15
337671671b9obrienENUMDOC
337771671b9obrien  This is a 12-bit absolute reloc with the
337871671b9obrien  right 3 bitsassumed to be 0.
337971671b9obrienENUM
338071671b9obrien  BFD_RELOC_D30V_15_PCREL
338171671b9obrienENUMDOC
338271671b9obrien  This is a 12-bit pc-relative reloc with
338371671b9obrien  the right 3 bits assumed to be 0.
338471671b9obrienENUM
338571671b9obrien  BFD_RELOC_D30V_15_PCREL_R
338671671b9obrienENUMDOC
338771671b9obrien  This is a 12-bit pc-relative reloc with
338871671b9obrien  the right 3 bits assumed to be 0. Same
338971671b9obrien  as the previous reloc but on the right side
339071671b9obrien  of the container.
339171671b9obrienENUM
339271671b9obrien  BFD_RELOC_D30V_21
339371671b9obrienENUMDOC
339471671b9obrien  This is an 18-bit absolute reloc with
339571671b9obrien  the right 3 bits assumed to be 0.
339671671b9obrienENUM
339771671b9obrien  BFD_RELOC_D30V_21_PCREL
339871671b9obrienENUMDOC
339971671b9obrien  This is an 18-bit pc-relative reloc with
340071671b9obrien  the right 3 bits assumed to be 0.
340171671b9obrienENUM
340271671b9obrien  BFD_RELOC_D30V_21_PCREL_R
340371671b9obrienENUMDOC
340471671b9obrien  This is an 18-bit pc-relative reloc with
340571671b9obrien  the right 3 bits assumed to be 0. Same
340671671b9obrien  as the previous reloc but on the right side
340771671b9obrien  of the container.
340871671b9obrienENUM
340971671b9obrien  BFD_RELOC_D30V_32
341071671b9obrienENUMDOC
341171671b9obrien  This is a 32-bit absolute reloc.
341271671b9obrienENUM
341371671b9obrien  BFD_RELOC_D30V_32_PCREL
341471671b9obrienENUMDOC
341571671b9obrien  This is a 32-bit pc-relative reloc.
341671671b9obrien
341771671b9obrienENUM
341871671b9obrien  BFD_RELOC_DLX_HI16_S
341971671b9obrienENUMDOC
342071671b9obrien  DLX relocs
342171671b9obrienENUM
342271671b9obrien  BFD_RELOC_DLX_LO16
342371671b9obrienENUMDOC
342471671b9obrien  DLX relocs
342571671b9obrienENUM
342671671b9obrien  BFD_RELOC_DLX_JMP26
342771671b9obrienENUMDOC
342871671b9obrien  DLX relocs
342971671b9obrien
343071671b9obrienENUM
34310acbbeedim  BFD_RELOC_M32C_HI8
34320acbbeedimENUMX
34330acbbeedim  BFD_RELOC_M32C_RL_JUMP
34340acbbeedimENUMX
34350acbbeedim  BFD_RELOC_M32C_RL_1ADDR
34360acbbeedimENUMX
34370acbbeedim  BFD_RELOC_M32C_RL_2ADDR
34380acbbeedimENUMDOC
34390acbbeedim  Renesas M16C/M32C Relocations.
34400acbbeedim
34410acbbeedimENUM
344271671b9obrien  BFD_RELOC_M32R_24
344371671b9obrienENUMDOC
344471671b9obrien  Renesas M32R (formerly Mitsubishi M32R) relocs.
344571671b9obrien  This is a 24 bit absolute address.
344671671b9obrienENUM
344771671b9obrien  BFD_RELOC_M32R_10_PCREL
344871671b9obrienENUMDOC
344971671b9obrien  This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.
345071671b9obrienENUM
345171671b9obrien  BFD_RELOC_M32R_18_PCREL
345271671b9obrienENUMDOC
345371671b9obrien  This is an 18-bit reloc with the right 2 bits assumed to be 0.
345471671b9obrienENUM
345571671b9obrien  BFD_RELOC_M32R_26_PCREL
345671671b9obrienENUMDOC
345771671b9obrien  This is a 26-bit reloc with the right 2 bits assumed to be 0.
345871671b9obrienENUM
345971671b9obrien  BFD_RELOC_M32R_HI16_ULO
346071671b9obrienENUMDOC
346171671b9obrien  This is a 16-bit reloc containing the high 16 bits of an address
346271671b9obrien  used when the lower 16 bits are treated as unsigned.
346371671b9obrienENUM
346471671b9obrien  BFD_RELOC_M32R_HI16_SLO
346571671b9obrienENUMDOC
346671671b9obrien  This is a 16-bit reloc containing the high 16 bits of an address
346771671b9obrien  used when the lower 16 bits are treated as signed.
346871671b9obrienENUM
346971671b9obrien  BFD_RELOC_M32R_LO16
347071671b9obrienENUMDOC
347171671b9obrien  This is a 16-bit reloc containing the lower 16 bits of an address.
347271671b9obrienENUM
347371671b9obrien  BFD_RELOC_M32R_SDA16
347471671b9obrienENUMDOC
347571671b9obrien  This is a 16-bit reloc containing the small data area offset for use in
347671671b9obrien  add3, load, and store instructions.
347771671b9obrienENUM
347871671b9obrien  BFD_RELOC_M32R_GOT24
347971671b9obrienENUMX
348071671b9obrien  BFD_RELOC_M32R_26_PLTREL
348171671b9obrienENUMX
348271671b9obrien  BFD_RELOC_M32R_COPY
348371671b9obrienENUMX
348471671b9obrien