Back to index

cell-binutils  2.17cvs20070401
bfd-in2.h
Go to the documentation of this file.
00001 /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
00002    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 
00003    "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 
00004    "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 
00005    "linker.c" and "simple.c".
00006    Run "make headers" in your build bfd/ to regenerate.  */
00007 
00008 /* Main header file for the bfd library -- portable access to object files.
00009 
00010    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
00011    1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
00012    Free Software Foundation, Inc.
00013 
00014    Contributed by Cygnus Support.
00015 
00016    This file is part of BFD, the Binary File Descriptor library.
00017 
00018    This program is free software; you can redistribute it and/or modify
00019    it under the terms of the GNU General Public License as published by
00020    the Free Software Foundation; either version 2 of the License, or
00021    (at your option) any later version.
00022 
00023    This program is distributed in the hope that it will be useful,
00024    but WITHOUT ANY WARRANTY; without even the implied warranty of
00025    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026    GNU General Public License for more details.
00027 
00028    You should have received a copy of the GNU General Public License
00029    along with this program; if not, write to the Free Software
00030    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00031 
00032 #ifndef __BFD_H_SEEN__
00033 #define __BFD_H_SEEN__
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 #include "ansidecl.h"
00040 #include "symcat.h"
00041 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
00042 #ifndef SABER
00043 /* This hack is to avoid a problem with some strict ANSI C preprocessors.
00044    The problem is, "32_" is not a valid preprocessing token, and we don't
00045    want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
00046    cause the inner CONCAT2 macros to be evaluated first, producing
00047    still-valid pp-tokens.  Then the final concatenation can be done.  */
00048 #undef CONCAT4
00049 #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
00050 #endif
00051 #endif
00052 
00053 /* This is a utility macro to handle the situation where the code
00054    wants to place a constant string into the code, followed by a
00055    comma and then the length of the string.  Doing this by hand
00056    is error prone, so using this macro is safer.  The macro will
00057    also safely handle the case where a NULL is passed as the arg.  */
00058 #define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
00059 /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
00060    to create the arguments to another macro, since the preprocessor
00061    will mis-count the number of arguments to the outer macro (by not
00062    evaluating STRING_COMMA_LEN and so missing the comma).  This is a
00063    problem for example when trying to use STRING_COMMA_LEN to build
00064    the arguments to the strncmp() macro.  Hence this alternative
00065    definition of strncmp is provided here.
00066    
00067    Note - these macros do NOT work if STR2 is not a constant string.  */
00068 #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
00069   /* strcpy() can have a similar problem, but since we know we are
00070      copying a constant string, we can use memcpy which will be faster
00071      since there is no need to check for a NUL byte inside STR.  We
00072      can also save time if we do not need to copy the terminating NUL.  */
00073 #define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
00074 #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
00075 
00076 
00077 /* The word size used by BFD on the host.  This may be 64 with a 32
00078    bit target if the host is 64 bit, or if other 64 bit targets have
00079    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
00080 #define BFD_ARCH_SIZE @wordsize@
00081 
00082 /* The word size of the default bfd target.  */
00083 #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
00084 
00085 #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
00086 #define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
00087 #if @BFD_HOST_64_BIT_DEFINED@
00088 #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
00089 #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
00090 typedef BFD_HOST_64_BIT bfd_int64_t;
00091 typedef BFD_HOST_U_64_BIT bfd_uint64_t;
00092 #endif
00093 
00094 #if BFD_ARCH_SIZE >= 64
00095 #define BFD64
00096 #endif
00097 
00098 #ifndef INLINE
00099 #if __GNUC__ >= 2
00100 #define INLINE __inline__
00101 #else
00102 #define INLINE
00103 #endif
00104 #endif
00105 
00106 /* Forward declaration.  */
00107 typedef struct bfd bfd;
00108 
00109 /* Boolean type used in bfd.  Too many systems define their own
00110    versions of "boolean" for us to safely typedef a "boolean" of
00111    our own.  Using an enum for "bfd_boolean" has its own set of
00112    problems, with strange looking casts required to avoid warnings
00113    on some older compilers.  Thus we just use an int.
00114 
00115    General rule: Functions which are bfd_boolean return TRUE on
00116    success and FALSE on failure (unless they're a predicate).  */
00117 
00118 typedef int bfd_boolean;
00119 #undef FALSE
00120 #undef TRUE
00121 #define FALSE 0
00122 #define TRUE 1
00123 
00124 #ifdef BFD64
00125 
00126 #ifndef BFD_HOST_64_BIT
00127  #error No 64 bit integer type available
00128 #endif /* ! defined (BFD_HOST_64_BIT) */
00129 
00130 typedef BFD_HOST_U_64_BIT bfd_vma;
00131 typedef BFD_HOST_64_BIT bfd_signed_vma;
00132 typedef BFD_HOST_U_64_BIT bfd_size_type;
00133 typedef BFD_HOST_U_64_BIT symvalue;
00134 
00135 #ifndef fprintf_vma
00136 #if BFD_HOST_64BIT_LONG
00137 #define sprintf_vma(s,x) sprintf (s, "%016lx", x)
00138 #define fprintf_vma(f,x) fprintf (f, "%016lx", x)
00139 #else
00140 #define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
00141 #define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
00142 #define fprintf_vma(s,x) \
00143   fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
00144 #define sprintf_vma(s,x) \
00145   sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
00146 #endif
00147 #endif
00148 
00149 #else /* not BFD64  */
00150 
00151 /* Represent a target address.  Also used as a generic unsigned type
00152    which is guaranteed to be big enough to hold any arithmetic types
00153    we need to deal with.  */
00154 typedef unsigned long bfd_vma;
00155 
00156 /* A generic signed type which is guaranteed to be big enough to hold any
00157    arithmetic types we need to deal with.  Can be assumed to be compatible
00158    with bfd_vma in the same way that signed and unsigned ints are compatible
00159    (as parameters, in assignment, etc).  */
00160 typedef long bfd_signed_vma;
00161 
00162 typedef unsigned long symvalue;
00163 typedef unsigned long bfd_size_type;
00164 
00165 /* Print a bfd_vma x on stream s.  */
00166 #define fprintf_vma(s,x) fprintf (s, "%08lx", x)
00167 #define sprintf_vma(s,x) sprintf (s, "%08lx", x)
00168 
00169 #endif /* not BFD64  */
00170 
00171 #define HALF_BFD_SIZE_TYPE \
00172   (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
00173 
00174 #ifndef BFD_HOST_64_BIT
00175 /* Fall back on a 32 bit type.  The idea is to make these types always
00176    available for function return types, but in the case that
00177    BFD_HOST_64_BIT is undefined such a function should abort or
00178    otherwise signal an error.  */
00179 typedef bfd_signed_vma bfd_int64_t;
00180 typedef bfd_vma bfd_uint64_t;
00181 #endif
00182 
00183 /* An offset into a file.  BFD always uses the largest possible offset
00184    based on the build time availability of fseek, fseeko, or fseeko64.  */
00185 typedef @bfd_file_ptr@ file_ptr;
00186 typedef unsigned @bfd_file_ptr@ ufile_ptr;
00187 
00188 extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
00189 extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
00190 
00191 #define printf_vma(x) fprintf_vma(stdout,x)
00192 #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
00193 
00194 typedef unsigned int flagword;     /* 32 bits of flags */
00195 typedef unsigned char bfd_byte;
00196 
00197 /* File formats.  */
00198 
00199 typedef enum bfd_format
00200 {
00201   bfd_unknown = 0,   /* File format is unknown.  */
00202   bfd_object,        /* Linker/assembler/compiler output.  */
00203   bfd_archive,              /* Object archive file.  */
00204   bfd_core,          /* Core dump.  */
00205   bfd_type_end              /* Marks the end; don't use it!  */
00206 }
00207 bfd_format;
00208 
00209 /* Values that may appear in the flags field of a BFD.  These also
00210    appear in the object_flags field of the bfd_target structure, where
00211    they indicate the set of flags used by that backend (not all flags
00212    are meaningful for all object file formats) (FIXME: at the moment,
00213    the object_flags values have mostly just been copied from backend
00214    to another, and are not necessarily correct).  */
00215 
00216 /* No flags.  */
00217 #define BFD_NO_FLAGS        0x00
00218 
00219 /* BFD contains relocation entries.  */
00220 #define HAS_RELOC    0x01
00221 
00222 /* BFD is directly executable.  */
00223 #define EXEC_P       0x02
00224 
00225 /* BFD has line number information (basically used for F_LNNO in a
00226    COFF header).  */
00227 #define HAS_LINENO   0x04
00228 
00229 /* BFD has debugging information.  */
00230 #define HAS_DEBUG    0x08
00231 
00232 /* BFD has symbols.  */
00233 #define HAS_SYMS     0x10
00234 
00235 /* BFD has local symbols (basically used for F_LSYMS in a COFF
00236    header).  */
00237 #define HAS_LOCALS   0x20
00238 
00239 /* BFD is a dynamic object.  */
00240 #define DYNAMIC      0x40
00241 
00242 /* Text section is write protected (if D_PAGED is not set, this is
00243    like an a.out NMAGIC file) (the linker sets this by default, but
00244    clears it for -r or -N).  */
00245 #define WP_TEXT      0x80
00246 
00247 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
00248    linker sets this by default, but clears it for -r or -n or -N).  */
00249 #define D_PAGED      0x100
00250 
00251 /* BFD is relaxable (this means that bfd_relax_section may be able to
00252    do something) (sometimes bfd_relax_section can do something even if
00253    this is not set).  */
00254 #define BFD_IS_RELAXABLE 0x200
00255 
00256 /* This may be set before writing out a BFD to request using a
00257    traditional format.  For example, this is used to request that when
00258    writing out an a.out object the symbols not be hashed to eliminate
00259    duplicates.  */
00260 #define BFD_TRADITIONAL_FORMAT 0x400
00261 
00262 /* This flag indicates that the BFD contents are actually cached in
00263    memory.  If this is set, iostream points to a bfd_in_memory struct.  */
00264 #define BFD_IN_MEMORY 0x800
00265 
00266 /* The sections in this BFD specify a memory page.  */
00267 #define HAS_LOAD_PAGE 0x1000
00268 
00269 /* This BFD has been created by the linker and doesn't correspond
00270    to any input file.  */
00271 #define BFD_LINKER_CREATED 0x2000
00272 
00273 /* Symbols and relocation.  */
00274 
00275 /* A count of carsyms (canonical archive symbols).  */
00276 typedef unsigned long symindex;
00277 
00278 /* How to perform a relocation.  */
00279 typedef const struct reloc_howto_struct reloc_howto_type;
00280 
00281 #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
00282 
00283 /* General purpose part of a symbol X;
00284    target specific parts are in libcoff.h, libaout.h, etc.  */
00285 
00286 #define bfd_get_section(x) ((x)->section)
00287 #define bfd_get_output_section(x) ((x)->section->output_section)
00288 #define bfd_set_section(x,y) ((x)->section) = (y)
00289 #define bfd_asymbol_base(x) ((x)->section->vma)
00290 #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
00291 #define bfd_asymbol_name(x) ((x)->name)
00292 /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
00293 #define bfd_asymbol_bfd(x) ((x)->the_bfd)
00294 #define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
00295 
00296 /* A canonical archive symbol.  */
00297 /* This is a type pun with struct ranlib on purpose!  */
00298 typedef struct carsym
00299 {
00300   char *name;
00301   file_ptr file_offset;     /* Look here to find the file.  */
00302 }
00303 carsym;                     /* To make these you call a carsymogen.  */
00304 
00305 /* Used in generating armaps (archive tables of contents).
00306    Perhaps just a forward definition would do?  */
00307 struct orl                  /* Output ranlib.  */
00308 {
00309   char **name;              /* Symbol name.  */
00310   union
00311   {
00312     file_ptr pos;
00313     bfd *abfd;
00314   } u;               /* bfd* or file position.  */
00315   int namidx;        /* Index into string table.  */
00316 };
00317 
00318 /* Linenumber stuff.  */
00319 typedef struct lineno_cache_entry
00320 {
00321   unsigned int line_number; /* Linenumber from start of function.  */
00322   union
00323   {
00324     struct bfd_symbol *sym; /* Function name.  */
00325     bfd_vma offset;                /* Offset into section.  */
00326   } u;
00327 }
00328 alent;
00329 
00330 /* Object and core file sections.  */
00331 
00332 #define       align_power(addr, align)    \
00333   (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
00334 
00335 typedef struct bfd_section *sec_ptr;
00336 
00337 #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
00338 #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
00339 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
00340 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
00341 #define bfd_section_name(bfd, ptr) ((ptr)->name)
00342 #define bfd_section_size(bfd, ptr) ((ptr)->size)
00343 #define bfd_get_section_size(ptr) ((ptr)->size)
00344 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
00345 #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
00346 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
00347 #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
00348 #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
00349 
00350 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
00351 
00352 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
00353 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
00354 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
00355 /* Find the address one past the end of SEC.  */
00356 #define bfd_get_section_limit(bfd, sec) \
00357   (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
00358    / bfd_octets_per_byte (bfd))
00359 
00360 /* Return TRUE if section has been discarded.  */
00361 #define elf_discarded_section(sec)                      \
00362   (!bfd_is_abs_section (sec)                                   \
00363    && bfd_is_abs_section ((sec)->output_section)        \
00364    && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE              \
00365    && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
00366 
00367 /* Forward define.  */
00368 struct stat;
00369 
00370 typedef enum bfd_print_symbol
00371 {
00372   bfd_print_symbol_name,
00373   bfd_print_symbol_more,
00374   bfd_print_symbol_all
00375 } bfd_print_symbol_type;
00376 
00377 /* Information about a symbol that nm needs.  */
00378 
00379 typedef struct _symbol_info
00380 {
00381   symvalue value;
00382   char type;
00383   const char *name;            /* Symbol name.  */
00384   unsigned char stab_type;     /* Stab type.  */
00385   char stab_other;             /* Stab other.  */
00386   short stab_desc;             /* Stab desc.  */
00387   const char *stab_name;       /* String for stab type.  */
00388 } symbol_info;
00389 
00390 /* Get the name of a stabs type code.  */
00391 
00392 extern const char *bfd_get_stab_name (int);
00393 
00394 /* Hash table routines.  There is no way to free up a hash table.  */
00395 
00396 /* An element in the hash table.  Most uses will actually use a larger
00397    structure, and an instance of this will be the first field.  */
00398 
00399 struct bfd_hash_entry
00400 {
00401   /* Next entry for this hash code.  */
00402   struct bfd_hash_entry *next;
00403   /* String being hashed.  */
00404   const char *string;
00405   /* Hash code.  This is the full hash code, not the index into the
00406      table.  */
00407   unsigned long hash;
00408 };
00409 
00410 /* A hash table.  */
00411 
00412 struct bfd_hash_table
00413 {
00414   /* The hash array.  */
00415   struct bfd_hash_entry **table;
00416   /* A function used to create new elements in the hash table.  The
00417      first entry is itself a pointer to an element.  When this
00418      function is first invoked, this pointer will be NULL.  However,
00419      having the pointer permits a hierarchy of method functions to be
00420      built each of which calls the function in the superclass.  Thus
00421      each function should be written to allocate a new block of memory
00422      only if the argument is NULL.  */
00423   struct bfd_hash_entry *(*newfunc)
00424     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
00425    /* An objalloc for this hash table.  This is a struct objalloc *,
00426      but we use void * to avoid requiring the inclusion of objalloc.h.  */
00427   void *memory;
00428   /* The number of slots in the hash table.  */
00429   unsigned int size;
00430   /* The number of entries in the hash table.  */
00431   unsigned int count;
00432   /* The size of elements.  */
00433   unsigned int entsize;
00434   /* If non-zero, don't grow the hash table.  */
00435   unsigned int frozen:1;
00436 };
00437 
00438 /* Initialize a hash table.  */
00439 extern bfd_boolean bfd_hash_table_init
00440   (struct bfd_hash_table *,
00441    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
00442                             struct bfd_hash_table *,
00443                             const char *),
00444    unsigned int);
00445 
00446 /* Initialize a hash table specifying a size.  */
00447 extern bfd_boolean bfd_hash_table_init_n
00448   (struct bfd_hash_table *,
00449    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
00450                             struct bfd_hash_table *,
00451                             const char *),
00452    unsigned int, unsigned int);
00453 
00454 /* Free up a hash table.  */
00455 extern void bfd_hash_table_free
00456   (struct bfd_hash_table *);
00457 
00458 /* Look up a string in a hash table.  If CREATE is TRUE, a new entry
00459    will be created for this string if one does not already exist.  The
00460    COPY argument must be TRUE if this routine should copy the string
00461    into newly allocated memory when adding an entry.  */
00462 extern struct bfd_hash_entry *bfd_hash_lookup
00463   (struct bfd_hash_table *, const char *, bfd_boolean create,
00464    bfd_boolean copy);
00465 
00466 /* Replace an entry in a hash table.  */
00467 extern void bfd_hash_replace
00468   (struct bfd_hash_table *, struct bfd_hash_entry *old,
00469    struct bfd_hash_entry *nw);
00470 
00471 /* Base method for creating a hash table entry.  */
00472 extern struct bfd_hash_entry *bfd_hash_newfunc
00473   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
00474 
00475 /* Grab some space for a hash table entry.  */
00476 extern void *bfd_hash_allocate
00477   (struct bfd_hash_table *, unsigned int);
00478 
00479 /* Traverse a hash table in a random order, calling a function on each
00480    element.  If the function returns FALSE, the traversal stops.  The
00481    INFO argument is passed to the function.  */
00482 extern void bfd_hash_traverse
00483   (struct bfd_hash_table *,
00484    bfd_boolean (*) (struct bfd_hash_entry *, void *),
00485    void *info);
00486 
00487 /* Allows the default size of a hash table to be configured. New hash
00488    tables allocated using bfd_hash_table_init will be created with
00489    this size.  */
00490 extern void bfd_hash_set_default_size (bfd_size_type);
00491 
00492 /* This structure is used to keep track of stabs in sections
00493    information while linking.  */
00494 
00495 struct stab_info
00496 {
00497   /* A hash table used to hold stabs strings.  */
00498   struct bfd_strtab_hash *strings;
00499   /* The header file hash table.  */
00500   struct bfd_hash_table includes;
00501   /* The first .stabstr section.  */
00502   struct bfd_section *stabstr;
00503 };
00504 
00505 #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
00506 
00507 /* User program access to BFD facilities.  */
00508 
00509 /* Direct I/O routines, for programs which know more about the object
00510    file than BFD does.  Use higher level routines if possible.  */
00511 
00512 extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
00513 extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
00514 extern int bfd_seek (bfd *, file_ptr, int);
00515 extern file_ptr bfd_tell (bfd *);
00516 extern int bfd_flush (bfd *);
00517 extern int bfd_stat (bfd *, struct stat *);
00518 
00519 /* Deprecated old routines.  */
00520 #if __GNUC__
00521 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                          \
00522   (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),    \
00523    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
00524 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                         \
00525   (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),   \
00526    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
00527 #else
00528 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)                          \
00529   (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
00530    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
00531 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)                         \
00532   (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
00533    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
00534 #endif
00535 extern void warn_deprecated (const char *, const char *, int, const char *);
00536 
00537 /* Cast from const char * to char * so that caller can assign to
00538    a char * without a warning.  */
00539 #define bfd_get_filename(abfd) ((char *) (abfd)->filename)
00540 #define bfd_get_cacheable(abfd) ((abfd)->cacheable)
00541 #define bfd_get_format(abfd) ((abfd)->format)
00542 #define bfd_get_target(abfd) ((abfd)->xvec->name)
00543 #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
00544 #define bfd_family_coff(abfd) \
00545   (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
00546    bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
00547 #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
00548 #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
00549 #define bfd_header_big_endian(abfd) \
00550   ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
00551 #define bfd_header_little_endian(abfd) \
00552   ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
00553 #define bfd_get_file_flags(abfd) ((abfd)->flags)
00554 #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
00555 #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
00556 #define bfd_my_archive(abfd) ((abfd)->my_archive)
00557 #define bfd_has_map(abfd) ((abfd)->has_armap)
00558 
00559 #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
00560 #define bfd_usrdata(abfd) ((abfd)->usrdata)
00561 
00562 #define bfd_get_start_address(abfd) ((abfd)->start_address)
00563 #define bfd_get_symcount(abfd) ((abfd)->symcount)
00564 #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
00565 #define bfd_count_sections(abfd) ((abfd)->section_count)
00566 
00567 #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
00568 
00569 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
00570 
00571 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
00572 
00573 extern bfd_boolean bfd_cache_close
00574   (bfd *abfd);
00575 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
00576 
00577 extern bfd_boolean bfd_cache_close_all (void);
00578 
00579 extern bfd_boolean bfd_record_phdr
00580   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
00581    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
00582 
00583 /* Byte swapping routines.  */
00584 
00585 bfd_uint64_t bfd_getb64 (const void *);
00586 bfd_uint64_t bfd_getl64 (const void *);
00587 bfd_int64_t bfd_getb_signed_64 (const void *);
00588 bfd_int64_t bfd_getl_signed_64 (const void *);
00589 bfd_vma bfd_getb32 (const void *);
00590 bfd_vma bfd_getl32 (const void *);
00591 bfd_signed_vma bfd_getb_signed_32 (const void *);
00592 bfd_signed_vma bfd_getl_signed_32 (const void *);
00593 bfd_vma bfd_getb16 (const void *);
00594 bfd_vma bfd_getl16 (const void *);
00595 bfd_signed_vma bfd_getb_signed_16 (const void *);
00596 bfd_signed_vma bfd_getl_signed_16 (const void *);
00597 void bfd_putb64 (bfd_uint64_t, void *);
00598 void bfd_putl64 (bfd_uint64_t, void *);
00599 void bfd_putb32 (bfd_vma, void *);
00600 void bfd_putl32 (bfd_vma, void *);
00601 void bfd_putb16 (bfd_vma, void *);
00602 void bfd_putl16 (bfd_vma, void *);
00603 
00604 /* Byte swapping routines which take size and endiannes as arguments.  */
00605 
00606 bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
00607 void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
00608 
00609 extern bfd_boolean bfd_section_already_linked_table_init (void);
00610 extern void bfd_section_already_linked_table_free (void);
00611 
00612 /* Externally visible ECOFF routines.  */
00613 
00614 #if defined(__STDC__) || defined(ALMOST_STDC)
00615 struct ecoff_debug_info;
00616 struct ecoff_debug_swap;
00617 struct ecoff_extr;
00618 struct bfd_symbol;
00619 struct bfd_link_info;
00620 struct bfd_link_hash_entry;
00621 struct bfd_elf_version_tree;
00622 #endif
00623 extern bfd_vma bfd_ecoff_get_gp_value
00624   (bfd * abfd);
00625 extern bfd_boolean bfd_ecoff_set_gp_value
00626   (bfd *abfd, bfd_vma gp_value);
00627 extern bfd_boolean bfd_ecoff_set_regmasks
00628   (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
00629    unsigned long *cprmask);
00630 extern void *bfd_ecoff_debug_init
00631   (bfd *output_bfd, struct ecoff_debug_info *output_debug,
00632    const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
00633 extern void bfd_ecoff_debug_free
00634   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
00635    const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
00636 extern bfd_boolean bfd_ecoff_debug_accumulate
00637   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
00638    const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
00639    struct ecoff_debug_info *input_debug,
00640    const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
00641 extern bfd_boolean bfd_ecoff_debug_accumulate_other
00642   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
00643    const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
00644    struct bfd_link_info *);
00645 extern bfd_boolean bfd_ecoff_debug_externals
00646   (bfd *abfd, struct ecoff_debug_info *debug,
00647    const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
00648    bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
00649    void (*set_index) (struct bfd_symbol *, bfd_size_type));
00650 extern bfd_boolean bfd_ecoff_debug_one_external
00651   (bfd *abfd, struct ecoff_debug_info *debug,
00652    const struct ecoff_debug_swap *swap, const char *name,
00653    struct ecoff_extr *esym);
00654 extern bfd_size_type bfd_ecoff_debug_size
00655   (bfd *abfd, struct ecoff_debug_info *debug,
00656    const struct ecoff_debug_swap *swap);
00657 extern bfd_boolean bfd_ecoff_write_debug
00658   (bfd *abfd, struct ecoff_debug_info *debug,
00659    const struct ecoff_debug_swap *swap, file_ptr where);
00660 extern bfd_boolean bfd_ecoff_write_accumulated_debug
00661   (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
00662    const struct ecoff_debug_swap *swap,
00663    struct bfd_link_info *info, file_ptr where);
00664 
00665 /* Externally visible ELF routines.  */
00666 
00667 struct bfd_link_needed_list
00668 {
00669   struct bfd_link_needed_list *next;
00670   bfd *by;
00671   const char *name;
00672 };
00673 
00674 enum dynamic_lib_link_class {
00675   DYN_NORMAL = 0,
00676   DYN_AS_NEEDED = 1,
00677   DYN_DT_NEEDED = 2,
00678   DYN_NO_ADD_NEEDED = 4,
00679   DYN_NO_NEEDED = 8
00680 };
00681 
00682 enum notice_asneeded_action {
00683   notice_as_needed,
00684   notice_not_needed,
00685   notice_needed
00686 };
00687 
00688 extern bfd_boolean bfd_elf_record_link_assignment
00689   (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
00690    bfd_boolean);
00691 extern struct bfd_link_needed_list *bfd_elf_get_needed_list
00692   (bfd *, struct bfd_link_info *);
00693 extern bfd_boolean bfd_elf_get_bfd_needed_list
00694   (bfd *, struct bfd_link_needed_list **);
00695 extern bfd_boolean bfd_elf_size_dynamic_sections
00696   (bfd *, const char *, const char *, const char *, const char * const *,
00697    struct bfd_link_info *, struct bfd_section **,
00698    struct bfd_elf_version_tree *);
00699 extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
00700   (bfd *, struct bfd_link_info *);
00701 extern void bfd_elf_set_dt_needed_name
00702   (bfd *, const char *);
00703 extern const char *bfd_elf_get_dt_soname
00704   (bfd *);
00705 extern void bfd_elf_set_dyn_lib_class
00706   (bfd *, enum dynamic_lib_link_class);
00707 extern int bfd_elf_get_dyn_lib_class
00708   (bfd *);
00709 extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
00710   (bfd *, struct bfd_link_info *);
00711 extern bfd_boolean bfd_elf_discard_info
00712   (bfd *, struct bfd_link_info *);
00713 extern unsigned int _bfd_elf_default_action_discarded
00714   (struct bfd_section *);
00715 
00716 /* Return an upper bound on the number of bytes required to store a
00717    copy of ABFD's program header table entries.  Return -1 if an error
00718    occurs; bfd_get_error will return an appropriate code.  */
00719 extern long bfd_get_elf_phdr_upper_bound
00720   (bfd *abfd);
00721 
00722 /* Copy ABFD's program header table entries to *PHDRS.  The entries
00723    will be stored as an array of Elf_Internal_Phdr structures, as
00724    defined in include/elf/internal.h.  To find out how large the
00725    buffer needs to be, call bfd_get_elf_phdr_upper_bound.
00726 
00727    Return the number of program header table entries read, or -1 if an
00728    error occurs; bfd_get_error will return an appropriate code.  */
00729 extern int bfd_get_elf_phdrs
00730   (bfd *abfd, void *phdrs);
00731 
00732 /* Create a new BFD as if by bfd_openr.  Rather than opening a file,
00733    reconstruct an ELF file by reading the segments out of remote memory
00734    based on the ELF file header at EHDR_VMA and the ELF program headers it
00735    points to.  If not null, *LOADBASEP is filled in with the difference
00736    between the VMAs from which the segments were read, and the VMAs the
00737    file headers (and hence BFD's idea of each section's VMA) put them at.
00738 
00739    The function TARGET_READ_MEMORY is called to copy LEN bytes from the
00740    remote memory at target address VMA into the local buffer at MYADDR; it
00741    should return zero on success or an `errno' code on failure.  TEMPL must
00742    be a BFD for an ELF target with the word size and byte order found in
00743    the remote memory.  */
00744 extern bfd *bfd_elf_bfd_from_remote_memory
00745   (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
00746    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
00747 
00748 /* Return the arch_size field of an elf bfd, or -1 if not elf.  */
00749 extern int bfd_get_arch_size
00750   (bfd *);
00751 
00752 /* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
00753 extern int bfd_get_sign_extend_vma
00754   (bfd *);
00755 
00756 extern struct bfd_section *_bfd_elf_tls_setup
00757   (bfd *, struct bfd_link_info *);
00758 
00759 extern void _bfd_fix_excluded_sec_syms
00760   (bfd *, struct bfd_link_info *);
00761 
00762 extern unsigned bfd_m68k_mach_to_features (int);
00763 
00764 extern int bfd_m68k_features_to_mach (unsigned);
00765 
00766 extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
00767   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
00768    char **);
00769 
00770 extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
00771   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
00772    char **);
00773 
00774 /* SunOS shared library support routines for the linker.  */
00775 
00776 extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
00777   (bfd *, struct bfd_link_info *);
00778 extern bfd_boolean bfd_sunos_record_link_assignment
00779   (bfd *, struct bfd_link_info *, const char *);
00780 extern bfd_boolean bfd_sunos_size_dynamic_sections
00781   (bfd *, struct bfd_link_info *, struct bfd_section **,
00782    struct bfd_section **, struct bfd_section **);
00783 
00784 /* Linux shared library support routines for the linker.  */
00785 
00786 extern bfd_boolean bfd_i386linux_size_dynamic_sections
00787   (bfd *, struct bfd_link_info *);
00788 extern bfd_boolean bfd_m68klinux_size_dynamic_sections
00789   (bfd *, struct bfd_link_info *);
00790 extern bfd_boolean bfd_sparclinux_size_dynamic_sections
00791   (bfd *, struct bfd_link_info *);
00792 
00793 /* mmap hacks */
00794 
00795 struct _bfd_window_internal;
00796 typedef struct _bfd_window_internal bfd_window_internal;
00797 
00798 typedef struct _bfd_window
00799 {
00800   /* What the user asked for.  */
00801   void *data;
00802   bfd_size_type size;
00803   /* The actual window used by BFD.  Small user-requested read-only
00804      regions sharing a page may share a single window into the object
00805      file.  Read-write versions shouldn't until I've fixed things to
00806      keep track of which portions have been claimed by the
00807      application; don't want to give the same region back when the
00808      application wants two writable copies!  */
00809   struct _bfd_window_internal *i;
00810 }
00811 bfd_window;
00812 
00813 extern void bfd_init_window
00814   (bfd_window *);
00815 extern void bfd_free_window
00816   (bfd_window *);
00817 extern bfd_boolean bfd_get_file_window
00818   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
00819 
00820 /* XCOFF support routines for the linker.  */
00821 
00822 extern bfd_boolean bfd_xcoff_link_record_set
00823   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
00824 extern bfd_boolean bfd_xcoff_import_symbol
00825   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
00826    const char *, const char *, const char *, unsigned int);
00827 extern bfd_boolean bfd_xcoff_export_symbol
00828   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
00829 extern bfd_boolean bfd_xcoff_link_count_reloc
00830   (bfd *, struct bfd_link_info *, const char *);
00831 extern bfd_boolean bfd_xcoff_record_link_assignment
00832   (bfd *, struct bfd_link_info *, const char *);
00833 extern bfd_boolean bfd_xcoff_size_dynamic_sections
00834   (bfd *, struct bfd_link_info *, const char *, const char *,
00835    unsigned long, unsigned long, unsigned long, bfd_boolean,
00836    int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
00837 extern bfd_boolean bfd_xcoff_link_generate_rtinit
00838   (bfd *, const char *, const char *, bfd_boolean);
00839 
00840 /* XCOFF support routines for ar.  */
00841 extern bfd_boolean bfd_xcoff_ar_archive_set_magic
00842   (bfd *, char *);
00843 
00844 /* Externally visible COFF routines.  */
00845 
00846 #if defined(__STDC__) || defined(ALMOST_STDC)
00847 struct internal_syment;
00848 union internal_auxent;
00849 #endif
00850 
00851 extern bfd_boolean bfd_coff_get_syment
00852   (bfd *, struct bfd_symbol *, struct internal_syment *);
00853 
00854 extern bfd_boolean bfd_coff_get_auxent
00855   (bfd *, struct bfd_symbol *, int, union internal_auxent *);
00856 
00857 extern bfd_boolean bfd_coff_set_symbol_class
00858   (bfd *, struct bfd_symbol *, unsigned int);
00859 
00860 extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
00861   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
00862 
00863 /* ARM VFP11 erratum workaround support.  */
00864 typedef enum
00865 {
00866   BFD_ARM_VFP11_FIX_DEFAULT,
00867   BFD_ARM_VFP11_FIX_NONE,
00868   BFD_ARM_VFP11_FIX_SCALAR,
00869   BFD_ARM_VFP11_FIX_VECTOR
00870 } bfd_arm_vfp11_fix;
00871 
00872 extern void bfd_elf32_arm_init_maps
00873   (bfd *);
00874 
00875 extern void bfd_elf32_arm_set_vfp11_fix
00876   (bfd *, struct bfd_link_info *);
00877 
00878 extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
00879   (bfd *, struct bfd_link_info *);
00880 
00881 extern void bfd_elf32_arm_vfp11_fix_veneer_locations
00882   (bfd *, struct bfd_link_info *);
00883 
00884 /* ARM Interworking support.  Called from linker.  */
00885 extern bfd_boolean bfd_arm_allocate_interworking_sections
00886   (struct bfd_link_info *);
00887 
00888 extern bfd_boolean bfd_arm_process_before_allocation
00889   (bfd *, struct bfd_link_info *, int);
00890 
00891 extern bfd_boolean bfd_arm_get_bfd_for_interworking
00892   (bfd *, struct bfd_link_info *);
00893 
00894 /* PE ARM Interworking support.  Called from linker.  */
00895 extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
00896   (struct bfd_link_info *);
00897 
00898 extern bfd_boolean bfd_arm_pe_process_before_allocation
00899   (bfd *, struct bfd_link_info *, int);
00900 
00901 extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
00902   (bfd *, struct bfd_link_info *);
00903 
00904 /* ELF ARM Interworking support.  Called from linker.  */
00905 extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
00906   (struct bfd_link_info *);
00907 
00908 extern bfd_boolean bfd_elf32_arm_process_before_allocation
00909   (bfd *, struct bfd_link_info *);
00910 
00911 void bfd_elf32_arm_set_target_relocs
00912   (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
00913    int, int);
00914 
00915 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
00916   (bfd *, struct bfd_link_info *);
00917 
00918 extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
00919   (bfd *, struct bfd_link_info *);
00920 
00921 /* ELF ARM mapping symbol support */
00922 #define BFD_ARM_SPECIAL_SYM_TYPE_MAP      (1 << 0)
00923 #define BFD_ARM_SPECIAL_SYM_TYPE_TAG      (1 << 1)
00924 #define BFD_ARM_SPECIAL_SYM_TYPE_OTHER  (1 << 2)
00925 #define BFD_ARM_SPECIAL_SYM_TYPE_ANY      (~0)
00926 extern bfd_boolean bfd_is_arm_special_symbol_name
00927   (const char * name, int type);
00928 
00929 extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
00930 
00931 /* ARM Note section processing.  */
00932 extern bfd_boolean bfd_arm_merge_machines
00933   (bfd *, bfd *);
00934 
00935 extern bfd_boolean bfd_arm_update_notes
00936   (bfd *, const char *);
00937 
00938 extern unsigned int bfd_arm_get_mach_from_notes
00939   (bfd *, const char *);
00940 
00941 /* TI COFF load page support.  */
00942 extern void bfd_ticoff_set_section_load_page
00943   (struct bfd_section *, int);
00944 
00945 extern int bfd_ticoff_get_section_load_page
00946   (struct bfd_section *);
00947 
00948 /* H8/300 functions.  */
00949 extern bfd_vma bfd_h8300_pad_address
00950   (bfd *, bfd_vma);
00951 
00952 /* IA64 Itanium code generation.  Called from linker.  */
00953 extern void bfd_elf32_ia64_after_parse
00954   (int);
00955 
00956 extern void bfd_elf64_ia64_after_parse
00957   (int);
00958 
00959 /* This structure is used for a comdat section, as in PE.  A comdat
00960    section is associated with a particular symbol.  When the linker
00961    sees a comdat section, it keeps only one of the sections with a
00962    given name and associated with a given symbol.  */
00963 
00964 struct coff_comdat_info
00965 {
00966   /* The name of the symbol associated with a comdat section.  */
00967   const char *name;
00968 
00969   /* The local symbol table index of the symbol associated with a
00970      comdat section.  This is only meaningful to the object file format
00971      specific code; it is not an index into the list returned by
00972      bfd_canonicalize_symtab.  */
00973   long symbol;
00974 };
00975 
00976 extern struct coff_comdat_info *bfd_coff_get_comdat_section
00977   (bfd *, struct bfd_section *);
00978 
00979 /* Extracted from init.c.  */
00980 void bfd_init (void);
00981 
00982 /* Extracted from opncls.c.  */
00983 bfd *bfd_fopen (const char *filename, const char *target,
00984     const char *mode, int fd);
00985 
00986 bfd *bfd_openr (const char *filename, const char *target);
00987 
00988 bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
00989 
00990 bfd *bfd_openstreamr (const char *, const char *, void *);
00991 
00992 bfd *bfd_openr_iovec (const char *filename, const char *target,
00993     void *(*open) (struct bfd *nbfd,
00994     void *open_closure),
00995     void *open_closure,
00996     file_ptr (*pread) (struct bfd *nbfd,
00997     void *stream,
00998     void *buf,
00999     file_ptr nbytes,
01000     file_ptr offset),
01001     int (*close) (struct bfd *nbfd,
01002     void *stream),
01003     int (*stat) (struct bfd *abfd,
01004     void *stream,
01005     struct stat *sb));
01006 
01007 bfd *bfd_openw (const char *filename, const char *target);
01008 
01009 bfd_boolean bfd_close (bfd *abfd);
01010 
01011 bfd_boolean bfd_close_all_done (bfd *);
01012 
01013 bfd *bfd_create (const char *filename, bfd *templ);
01014 
01015 bfd_boolean bfd_make_writable (bfd *abfd);
01016 
01017 bfd_boolean bfd_make_readable (bfd *abfd);
01018 
01019 unsigned long bfd_calc_gnu_debuglink_crc32
01020    (unsigned long crc, const unsigned char *buf, bfd_size_type len);
01021 
01022 char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
01023 
01024 struct bfd_section *bfd_create_gnu_debuglink_section
01025    (bfd *abfd, const char *filename);
01026 
01027 bfd_boolean bfd_fill_in_gnu_debuglink_section
01028    (bfd *abfd, struct bfd_section *sect, const char *filename);
01029 
01030 /* Extracted from libbfd.c.  */
01031 
01032 /* Byte swapping macros for user section data.  */
01033 
01034 #define bfd_put_8(abfd, val, ptr) \
01035   ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
01036 #define bfd_put_signed_8 \
01037   bfd_put_8
01038 #define bfd_get_8(abfd, ptr) \
01039   (*(unsigned char *) (ptr) & 0xff)
01040 #define bfd_get_signed_8(abfd, ptr) \
01041   (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
01042 
01043 #define bfd_put_16(abfd, val, ptr) \
01044   BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
01045 #define bfd_put_signed_16 \
01046   bfd_put_16
01047 #define bfd_get_16(abfd, ptr) \
01048   BFD_SEND (abfd, bfd_getx16, (ptr))
01049 #define bfd_get_signed_16(abfd, ptr) \
01050   BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
01051 
01052 #define bfd_put_32(abfd, val, ptr) \
01053   BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
01054 #define bfd_put_signed_32 \
01055   bfd_put_32
01056 #define bfd_get_32(abfd, ptr) \
01057   BFD_SEND (abfd, bfd_getx32, (ptr))
01058 #define bfd_get_signed_32(abfd, ptr) \
01059   BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
01060 
01061 #define bfd_put_64(abfd, val, ptr) \
01062   BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
01063 #define bfd_put_signed_64 \
01064   bfd_put_64
01065 #define bfd_get_64(abfd, ptr) \
01066   BFD_SEND (abfd, bfd_getx64, (ptr))
01067 #define bfd_get_signed_64(abfd, ptr) \
01068   BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
01069 
01070 #define bfd_get(bits, abfd, ptr)                       \
01071   ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr)       \
01072    : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
01073    : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
01074    : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
01075    : (abort (), (bfd_vma) - 1))
01076 
01077 #define bfd_put(bits, abfd, val, ptr)                  \
01078   ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
01079    : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)                \
01080    : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)                \
01081    : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)                \
01082    : (abort (), (void) 0))
01083 
01084 
01085 /* Byte swapping macros for file header data.  */
01086 
01087 #define bfd_h_put_8(abfd, val, ptr) \
01088   bfd_put_8 (abfd, val, ptr)
01089 #define bfd_h_put_signed_8(abfd, val, ptr) \
01090   bfd_put_8 (abfd, val, ptr)
01091 #define bfd_h_get_8(abfd, ptr) \
01092   bfd_get_8 (abfd, ptr)
01093 #define bfd_h_get_signed_8(abfd, ptr) \
01094   bfd_get_signed_8 (abfd, ptr)
01095 
01096 #define bfd_h_put_16(abfd, val, ptr) \
01097   BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
01098 #define bfd_h_put_signed_16 \
01099   bfd_h_put_16
01100 #define bfd_h_get_16(abfd, ptr) \
01101   BFD_SEND (abfd, bfd_h_getx16, (ptr))
01102 #define bfd_h_get_signed_16(abfd, ptr) \
01103   BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
01104 
01105 #define bfd_h_put_32(abfd, val, ptr) \
01106   BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
01107 #define bfd_h_put_signed_32 \
01108   bfd_h_put_32
01109 #define bfd_h_get_32(abfd, ptr) \
01110   BFD_SEND (abfd, bfd_h_getx32, (ptr))
01111 #define bfd_h_get_signed_32(abfd, ptr) \
01112   BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
01113 
01114 #define bfd_h_put_64(abfd, val, ptr) \
01115   BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
01116 #define bfd_h_put_signed_64 \
01117   bfd_h_put_64
01118 #define bfd_h_get_64(abfd, ptr) \
01119   BFD_SEND (abfd, bfd_h_getx64, (ptr))
01120 #define bfd_h_get_signed_64(abfd, ptr) \
01121   BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
01122 
01123 /* Aliases for the above, which should eventually go away.  */
01124 
01125 #define H_PUT_64  bfd_h_put_64
01126 #define H_PUT_32  bfd_h_put_32
01127 #define H_PUT_16  bfd_h_put_16
01128 #define H_PUT_8   bfd_h_put_8
01129 #define H_PUT_S64 bfd_h_put_signed_64
01130 #define H_PUT_S32 bfd_h_put_signed_32
01131 #define H_PUT_S16 bfd_h_put_signed_16
01132 #define H_PUT_S8  bfd_h_put_signed_8
01133 #define H_GET_64  bfd_h_get_64
01134 #define H_GET_32  bfd_h_get_32
01135 #define H_GET_16  bfd_h_get_16
01136 #define H_GET_8   bfd_h_get_8
01137 #define H_GET_S64 bfd_h_get_signed_64
01138 #define H_GET_S32 bfd_h_get_signed_32
01139 #define H_GET_S16 bfd_h_get_signed_16
01140 #define H_GET_S8  bfd_h_get_signed_8
01141 
01142 
01143 /* Extracted from bfdio.c.  */
01144 long bfd_get_mtime (bfd *abfd);
01145 
01146 file_ptr bfd_get_size (bfd *abfd);
01147 
01148 /* Extracted from bfdwin.c.  */
01149 /* Extracted from section.c.  */
01150 typedef struct bfd_section
01151 {
01152   /* The name of the section; the name isn't a copy, the pointer is
01153      the same as that passed to bfd_make_section.  */
01154   const char *name;
01155 
01156   /* A unique sequence number.  */
01157   int id;
01158 
01159   /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
01160   int index;
01161 
01162   /* The next section in the list belonging to the BFD, or NULL.  */
01163   struct bfd_section *next;
01164 
01165   /* The previous section in the list belonging to the BFD, or NULL.  */
01166   struct bfd_section *prev;
01167 
01168   /* The field flags contains attributes of the section. Some
01169      flags are read in from the object file, and some are
01170      synthesized from other information.  */
01171   flagword flags;
01172 
01173 #define SEC_NO_FLAGS   0x000
01174 
01175   /* Tells the OS to allocate space for this section when loading.
01176      This is clear for a section containing debug information only.  */
01177 #define SEC_ALLOC      0x001
01178 
01179   /* Tells the OS to load the section from the file when loading.
01180      This is clear for a .bss section.  */
01181 #define SEC_LOAD       0x002
01182 
01183   /* The section contains data still to be relocated, so there is
01184      some relocation information too.  */
01185 #define SEC_RELOC      0x004
01186 
01187   /* A signal to the OS that the section contains read only data.  */
01188 #define SEC_READONLY   0x008
01189 
01190   /* The section contains code only.  */
01191 #define SEC_CODE       0x010
01192 
01193   /* The section contains data only.  */
01194 #define SEC_DATA       0x020
01195 
01196   /* The section will reside in ROM.  */
01197 #define SEC_ROM        0x040
01198 
01199   /* The section contains constructor information. This section
01200      type is used by the linker to create lists of constructors and
01201      destructors used by <<g++>>. When a back end sees a symbol
01202      which should be used in a constructor list, it creates a new
01203      section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
01204      the symbol to it, and builds a relocation. To build the lists
01205      of constructors, all the linker has to do is catenate all the
01206      sections called <<__CTOR_LIST__>> and relocate the data
01207      contained within - exactly the operations it would peform on
01208      standard data.  */
01209 #define SEC_CONSTRUCTOR 0x080
01210 
01211   /* The section has contents - a data section could be
01212      <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
01213      <<SEC_HAS_CONTENTS>>  */
01214 #define SEC_HAS_CONTENTS 0x100
01215 
01216   /* An instruction to the linker to not output the section
01217      even if it has information which would normally be written.  */
01218 #define SEC_NEVER_LOAD 0x200
01219 
01220   /* The section contains thread local data.  */
01221 #define SEC_THREAD_LOCAL 0x400
01222 
01223   /* The section has GOT references.  This flag is only for the
01224      linker, and is currently only used by the elf32-hppa back end.
01225      It will be set if global offset table references were detected
01226      in this section, which indicate to the linker that the section
01227      contains PIC code, and must be handled specially when doing a
01228      static link.  */
01229 #define SEC_HAS_GOT_REF 0x800
01230 
01231   /* The section contains common symbols (symbols may be defined
01232      multiple times, the value of a symbol is the amount of
01233      space it requires, and the largest symbol value is the one
01234      used).  Most targets have exactly one of these (which we
01235      translate to bfd_com_section_ptr), but ECOFF has two.  */
01236 #define SEC_IS_COMMON 0x1000
01237 
01238   /* The section contains only debugging information.  For
01239      example, this is set for ELF .debug and .stab sections.
01240      strip tests this flag to see if a section can be
01241      discarded.  */
01242 #define SEC_DEBUGGING 0x2000
01243 
01244   /* The contents of this section are held in memory pointed to
01245      by the contents field.  This is checked by bfd_get_section_contents,
01246      and the data is retrieved from memory if appropriate.  */
01247 #define SEC_IN_MEMORY 0x4000
01248 
01249   /* The contents of this section are to be excluded by the
01250      linker for executable and shared objects unless those
01251      objects are to be further relocated.  */
01252 #define SEC_EXCLUDE 0x8000
01253 
01254   /* The contents of this section are to be sorted based on the sum of
01255      the symbol and addend values specified by the associated relocation
01256      entries.  Entries without associated relocation entries will be
01257      appended to the end of the section in an unspecified order.  */
01258 #define SEC_SORT_ENTRIES 0x10000
01259 
01260   /* When linking, duplicate sections of the same name should be
01261      discarded, rather than being combined into a single section as
01262      is usually done.  This is similar to how common symbols are
01263      handled.  See SEC_LINK_DUPLICATES below.  */
01264 #define SEC_LINK_ONCE 0x20000
01265 
01266   /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
01267      should handle duplicate sections.  */
01268 #define SEC_LINK_DUPLICATES 0x40000
01269 
01270   /* This value for SEC_LINK_DUPLICATES means that duplicate
01271      sections with the same name should simply be discarded.  */
01272 #define SEC_LINK_DUPLICATES_DISCARD 0x0
01273 
01274   /* This value for SEC_LINK_DUPLICATES means that the linker
01275      should warn if there are any duplicate sections, although
01276      it should still only link one copy.  */
01277 #define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
01278 
01279   /* This value for SEC_LINK_DUPLICATES means that the linker
01280      should warn if any duplicate sections are a different size.  */
01281 #define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
01282 
01283   /* This value for SEC_LINK_DUPLICATES means that the linker
01284      should warn if any duplicate sections contain different
01285      contents.  */
01286 #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
01287   (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
01288 
01289   /* This section was created by the linker as part of dynamic
01290      relocation or other arcane processing.  It is skipped when
01291      going through the first-pass output, trusting that someone
01292      else up the line will take care of it later.  */
01293 #define SEC_LINKER_CREATED 0x200000
01294 
01295   /* This section should not be subject to garbage collection.
01296      Also set to inform the linker that this section should not be
01297      listed in the link map as discarded.  */
01298 #define SEC_KEEP 0x400000
01299 
01300   /* This section contains "short" data, and should be placed
01301      "near" the GP.  */
01302 #define SEC_SMALL_DATA 0x800000
01303 
01304   /* Attempt to merge identical entities in the section.
01305      Entity size is given in the entsize field.  */
01306 #define SEC_MERGE 0x1000000
01307 
01308   /* If given with SEC_MERGE, entities to merge are zero terminated
01309      strings where entsize specifies character size instead of fixed
01310      size entries.  */
01311 #define SEC_STRINGS 0x2000000
01312 
01313   /* This section contains data about section groups.  */
01314 #define SEC_GROUP 0x4000000
01315 
01316   /* The section is a COFF shared library section.  This flag is
01317      only for the linker.  If this type of section appears in
01318      the input file, the linker must copy it to the output file
01319      without changing the vma or size.  FIXME: Although this
01320      was originally intended to be general, it really is COFF
01321      specific (and the flag was renamed to indicate this).  It
01322      might be cleaner to have some more general mechanism to
01323      allow the back end to control what the linker does with
01324      sections.  */
01325 #define SEC_COFF_SHARED_LIBRARY 0x10000000
01326 
01327   /* This section contains data which may be shared with other
01328      executables or shared objects. This is for COFF only.  */
01329 #define SEC_COFF_SHARED 0x20000000
01330 
01331   /* When a section with this flag is being linked, then if the size of
01332      the input section is less than a page, it should not cross a page
01333      boundary.  If the size of the input section is one page or more,
01334      it should be aligned on a page boundary.  This is for TI
01335      TMS320C54X only.  */
01336 #define SEC_TIC54X_BLOCK 0x40000000
01337 
01338   /* Conditionally link this section; do not link if there are no
01339      references found to any symbol in the section.  This is for TI
01340      TMS320C54X only.  */
01341 #define SEC_TIC54X_CLINK 0x80000000
01342 
01343   /*  End of section flags.  */
01344 
01345   /* Some internal packed boolean fields.  */
01346 
01347   /* See the vma field.  */
01348   unsigned int user_set_vma : 1;
01349 
01350   /* A mark flag used by some of the linker backends.  */
01351   unsigned int linker_mark : 1;
01352 
01353   /* Another mark flag used by some of the linker backends.  Set for
01354      output sections that have an input section.  */
01355   unsigned int linker_has_input : 1;
01356 
01357   /* Mark flags used by some linker backends for garbage collection.  */
01358   unsigned int gc_mark : 1;
01359   unsigned int gc_mark_from_eh : 1;
01360 
01361   /* The following flags are used by the ELF linker. */
01362 
01363   /* Mark sections which have been allocated to segments.  */
01364   unsigned int segment_mark : 1;
01365 
01366   /* Type of sec_info information.  */
01367   unsigned int sec_info_type:3;
01368 #define ELF_INFO_TYPE_NONE      0
01369 #define ELF_INFO_TYPE_STABS     1
01370 #define ELF_INFO_TYPE_MERGE     2
01371 #define ELF_INFO_TYPE_EH_FRAME  3
01372 #define ELF_INFO_TYPE_JUST_SYMS 4
01373 
01374   /* Nonzero if this section uses RELA relocations, rather than REL.  */
01375   unsigned int use_rela_p:1;
01376 
01377   /* Bits used by various backends.  The generic code doesn't touch
01378      these fields.  */
01379 
01380   /* Nonzero if this section has TLS related relocations.  */
01381   unsigned int has_tls_reloc:1;
01382 
01383   /* Nonzero if this section has a gp reloc.  */
01384   unsigned int has_gp_reloc:1;
01385 
01386   /* Nonzero if this section needs the relax finalize pass.  */
01387   unsigned int need_finalize_relax:1;
01388 
01389   /* Whether relocations have been processed.  */
01390   unsigned int reloc_done : 1;
01391 
01392   /* End of internal packed boolean fields.  */
01393 
01394   /*  The virtual memory address of the section - where it will be
01395       at run time.  The symbols are relocated against this.  The
01396       user_set_vma flag is maintained by bfd; if it's not set, the
01397       backend can assign addresses (for example, in <<a.out>>, where
01398       the default address for <<.data>> is dependent on the specific
01399       target and various flags).  */
01400   bfd_vma vma;
01401 
01402   /*  The load address of the section - where it would be in a
01403       rom image; really only used for writing section header
01404       information.  */
01405   bfd_vma lma;
01406 
01407   /* The size of the section in octets, as it will be output.
01408      Contains a value even if the section has no contents (e.g., the
01409      size of <<.bss>>).  */
01410   bfd_size_type size;
01411 
01412   /* For input sections, the original size on disk of the section, in
01413      octets.  This field is used by the linker relaxation code.  It is
01414      currently only set for sections where the linker relaxation scheme
01415      doesn't cache altered section and reloc contents (stabs, eh_frame,
01416      SEC_MERGE, some coff relaxing targets), and thus the original size
01417      needs to be kept to read the section multiple times.
01418      For output sections, rawsize holds the section size calculated on
01419      a previous linker relaxation pass.  */
01420   bfd_size_type rawsize;
01421 
01422   /* If this section is going to be output, then this value is the
01423      offset in *bytes* into the output section of the first byte in the
01424      input section (byte ==> smallest addressable unit on the
01425      target).  In most cases, if this was going to start at the
01426      100th octet (8-bit quantity) in the output section, this value
01427      would be 100.  However, if the target byte size is 16 bits
01428      (bfd_octets_per_byte is "2"), this value would be 50.  */
01429   bfd_vma output_offset;
01430 
01431   /* The output section through which to map on output.  */
01432   struct bfd_section *output_section;
01433 
01434   /* The alignment requirement of the section, as an exponent of 2 -
01435      e.g., 3 aligns to 2^3 (or 8).  */
01436   unsigned int alignment_power;
01437 
01438   /* If an input section, a pointer to a vector of relocation
01439      records for the data in this section.  */
01440   struct reloc_cache_entry *relocation;
01441 
01442   /* If an output section, a pointer to a vector of pointers to
01443      relocation records for the data in this section.  */
01444   struct reloc_cache_entry **orelocation;
01445 
01446   /* The number of relocation records in one of the above.  */
01447   unsigned reloc_count;
01448 
01449   /* Information below is back end specific - and not always used
01450      or updated.  */
01451 
01452   /* File position of section data.  */
01453   file_ptr filepos;
01454 
01455   /* File position of relocation info.  */
01456   file_ptr rel_filepos;
01457 
01458   /* File position of line data.  */
01459   file_ptr line_filepos;
01460 
01461   /* Pointer to data for applications.  */
01462   void *userdata;
01463 
01464   /* If the SEC_IN_MEMORY flag is set, this points to the actual
01465      contents.  */
01466   unsigned char *contents;
01467 
01468   /* Attached line number information.  */
01469   alent *lineno;
01470 
01471   /* Number of line number records.  */
01472   unsigned int lineno_count;
01473 
01474   /* Entity size for merging purposes.  */
01475   unsigned int entsize;
01476 
01477   /* Points to the kept section if this section is a link-once section,
01478      and is discarded.  */
01479   struct bfd_section *kept_section;
01480 
01481   /* When a section is being output, this value changes as more
01482      linenumbers are written out.  */
01483   file_ptr moving_line_filepos;
01484 
01485   /* What the section number is in the target world.  */
01486   int target_index;
01487 
01488   void *used_by_bfd;
01489 
01490   /* If this is a constructor section then here is a list of the
01491      relocations created to relocate items within it.  */
01492   struct relent_chain *constructor_chain;
01493 
01494   /* The BFD which owns the section.  */
01495   bfd *owner;
01496 
01497   /* A symbol which points at this section only.  */
01498   struct bfd_symbol *symbol;
01499   struct bfd_symbol **symbol_ptr_ptr;
01500 
01501   /* Early in the link process, map_head and map_tail are used to build
01502      a list of input sections attached to an output section.  Later,
01503      output sections use these fields for a list of bfd_link_order
01504      structs.  */
01505   union {
01506     struct bfd_link_order *link_order;
01507     struct bfd_section *s;
01508   } map_head, map_tail;
01509 } asection;
01510 
01511 /* These sections are global, and are managed by BFD.  The application
01512    and target back end are not permitted to change the values in
01513    these sections.  New code should use the section_ptr macros rather
01514    than referring directly to the const sections.  The const sections
01515    may eventually vanish.  */
01516 #define BFD_ABS_SECTION_NAME "*ABS*"
01517 #define BFD_UND_SECTION_NAME "*UND*"
01518 #define BFD_COM_SECTION_NAME "*COM*"
01519 #define BFD_IND_SECTION_NAME "*IND*"
01520 
01521 /* The absolute section.  */
01522 extern asection bfd_abs_section;
01523 #define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
01524 #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
01525 /* Pointer to the undefined section.  */
01526 extern asection bfd_und_section;
01527 #define bfd_und_section_ptr ((asection *) &bfd_und_section)
01528 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
01529 /* Pointer to the common section.  */
01530 extern asection bfd_com_section;
01531 #define bfd_com_section_ptr ((asection *) &bfd_com_section)
01532 /* Pointer to the indirect section.  */
01533 extern asection bfd_ind_section;
01534 #define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
01535 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
01536 
01537 #define bfd_is_const_section(SEC)              \
01538  (   ((SEC) == bfd_abs_section_ptr)            \
01539   || ((SEC) == bfd_und_section_ptr)            \
01540   || ((SEC) == bfd_com_section_ptr)            \
01541   || ((SEC) == bfd_ind_section_ptr))
01542 
01543 /* Macros to handle insertion and deletion of a bfd's sections.  These
01544    only handle the list pointers, ie. do not adjust section_count,
01545    target_index etc.  */
01546 #define bfd_section_list_remove(ABFD, S) \
01547   do                                                   \
01548     {                                                  \
01549       asection *_s = S;                                \
01550       asection *_next = _s->next;                      \
01551       asection *_prev = _s->prev;                      \
01552       if (_prev)                                       \
01553         _prev->next = _next;                           \
01554       else                                             \
01555         (ABFD)->sections = _next;                      \
01556       if (_next)                                       \
01557         _next->prev = _prev;                           \
01558       else                                             \
01559         (ABFD)->section_last = _prev;                  \
01560     }                                                  \
01561   while (0)
01562 #define bfd_section_list_append(ABFD, S) \
01563   do                                                   \
01564     {                                                  \
01565       asection *_s = S;                                \
01566       bfd *_abfd = ABFD;                               \
01567       _s->next = NULL;                                 \
01568       if (_abfd->section_last)                         \
01569         {                                              \
01570           _s->prev = _abfd->section_last;              \
01571           _abfd->section_last->next = _s;              \
01572         }                                              \
01573       else                                             \
01574         {                                              \
01575           _s->prev = NULL;                             \
01576           _abfd->sections = _s;                        \
01577         }                                              \
01578       _abfd->section_last = _s;                        \
01579     }                                                  \
01580   while (0)
01581 #define bfd_section_list_prepend(ABFD, S) \
01582   do                                                   \
01583     {                                                  \
01584       asection *_s = S;                                \
01585       bfd *_abfd = ABFD;                               \
01586       _s->prev = NULL;                                 \
01587       if (_abfd->sections)                             \
01588         {                                              \
01589           _s->next = _abfd->sections;                  \
01590           _abfd->sections->prev = _s;                  \
01591         }                                              \
01592       else                                             \
01593         {                                              \
01594           _s->next = NULL;                             \
01595           _abfd->section_last = _s;                    \
01596         }                                              \
01597       _abfd->sections = _s;                            \
01598     }                                                  \
01599   while (0)
01600 #define bfd_section_list_insert_after(ABFD, A, S) \
01601   do                                                   \
01602     {                                                  \
01603       asection *_a = A;                                \
01604       asection *_s = S;                                \
01605       asection *_next = _a->next;                      \
01606       _s->next = _next;                                \
01607       _s->prev = _a;                                   \
01608       _a->next = _s;                                   \
01609       if (_next)                                       \
01610         _next->prev = _s;                              \
01611       else                                             \
01612         (ABFD)->section_last = _s;                     \
01613     }                                                  \
01614   while (0)
01615 #define bfd_section_list_insert_before(ABFD, B, S) \
01616   do                                                   \
01617     {                                                  \
01618       asection *_b = B;                                \
01619       asection *_s = S;                                \
01620       asection *_prev = _b->prev;                      \
01621       _s->prev = _prev;                                \
01622       _s->next = _b;                                   \
01623       _b->prev = _s;                                   \
01624       if (_prev)                                       \
01625         _prev->next = _s;                              \
01626       else                                             \
01627         (ABFD)->sections = _s;                         \
01628     }                                                  \
01629   while (0)
01630 #define bfd_section_removed_from_list(ABFD, S) \
01631   ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
01632 
01633 #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX)                   \
01634   /* name, id,  index, next, prev, flags, user_set_vma,            */  \
01635   { NAME,  IDX, 0,     NULL, NULL, FLAGS, 0,                           \
01636                                                                        \
01637   /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh,      */  \
01638      0,           0,                1,       0,                        \
01639                                                                        \
01640   /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc,       */  \
01641      0,            0,             0,          0,                       \
01642                                                                        \
01643   /* has_gp_reloc, need_finalize_relax, reloc_done,                */  \
01644      0,            0,                   0,                             \
01645                                                                        \
01646   /* vma, lma, size, rawsize                                       */  \
01647      0,   0,   0,    0,                                                \
01648                                                                        \
01649   /* output_offset, output_section,              alignment_power,  */  \
01650      0,             (struct bfd_section *) &SEC, 0,                    \
01651                                                                        \
01652   /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */  \
01653      NULL,       NULL,        0,           0,       0,                 \
01654                                                                        \
01655   /* line_filepos, userdata, contents, lineno, lineno_count,       */  \
01656      0,            NULL,     NULL,     NULL,   0,                      \
01657                                                                        \
01658   /* entsize, kept_section, moving_line_filepos,                    */ \
01659      0,       NULL,          0,                                        \
01660                                                                        \
01661   /* target_index, used_by_bfd, constructor_chain, owner,          */  \
01662      0,            NULL,        NULL,              NULL,               \
01663                                                                        \
01664   /* symbol,                    symbol_ptr_ptr,                    */  \
01665      (struct bfd_symbol *) SYM, &SEC.symbol,                           \
01666                                                                        \
01667   /* map_head, map_tail                                            */  \
01668      { NULL }, { NULL }                                                \
01669     }
01670 
01671 void bfd_section_list_clear (bfd *);
01672 
01673 asection *bfd_get_section_by_name (bfd *abfd, const char *name);
01674 
01675 asection *bfd_get_section_by_name_if
01676    (bfd *abfd,
01677     const char *name,
01678     bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
01679     void *obj);
01680 
01681 char *bfd_get_unique_section_name
01682    (bfd *abfd, const char *templat, int *count);
01683 
01684 asection *bfd_make_section_old_way (bfd *abfd, const char *name);
01685 
01686 asection *bfd_make_section_anyway_with_flags
01687    (bfd *abfd, const char *name, flagword flags);
01688 
01689 asection *bfd_make_section_anyway (bfd *abfd, const char *name);
01690 
01691 asection *bfd_make_section_with_flags
01692    (bfd *, const char *name, flagword flags);
01693 
01694 asection *bfd_make_section (bfd *, const char *name);
01695 
01696 bfd_boolean bfd_set_section_flags
01697    (bfd *abfd, asection *sec, flagword flags);
01698 
01699 void bfd_map_over_sections
01700    (bfd *abfd,
01701     void (*func) (bfd *abfd, asection *sect, void *obj),
01702     void *obj);
01703 
01704 asection *bfd_sections_find_if
01705    (bfd *abfd,
01706     bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
01707     void *obj);
01708 
01709 bfd_boolean bfd_set_section_size
01710    (bfd *abfd, asection *sec, bfd_size_type val);
01711 
01712 bfd_boolean bfd_set_section_contents
01713    (bfd *abfd, asection *section, const void *data,
01714     file_ptr offset, bfd_size_type count);
01715 
01716 bfd_boolean bfd_get_section_contents
01717    (bfd *abfd, asection *section, void *location, file_ptr offset,
01718     bfd_size_type count);
01719 
01720 bfd_boolean bfd_malloc_and_get_section
01721    (bfd *abfd, asection *section, bfd_byte **buf);
01722 
01723 bfd_boolean bfd_copy_private_section_data
01724    (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
01725 
01726 #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
01727      BFD_SEND (obfd, _bfd_copy_private_section_data, \
01728                (ibfd, isection, obfd, osection))
01729 bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
01730 
01731 bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
01732 
01733 /* Extracted from archures.c.  */
01734 enum bfd_architecture
01735 {
01736   bfd_arch_unknown,   /* File arch not known.  */
01737   bfd_arch_obscure,   /* Arch known, not one of these.  */
01738   bfd_arch_m68k,      /* Motorola 68xxx */
01739 #define bfd_mach_m68000 1
01740 #define bfd_mach_m68008 2
01741 #define bfd_mach_m68010 3
01742 #define bfd_mach_m68020 4
01743 #define bfd_mach_m68030 5
01744 #define bfd_mach_m68040 6
01745 #define bfd_mach_m68060 7
01746 #define bfd_mach_cpu32  8
01747 #define bfd_mach_fido   9
01748 #define bfd_mach_mcf_isa_a_nodiv 10
01749 #define bfd_mach_mcf_isa_a 11
01750 #define bfd_mach_mcf_isa_a_mac 12
01751 #define bfd_mach_mcf_isa_a_emac 13
01752 #define bfd_mach_mcf_isa_aplus 14
01753 #define bfd_mach_mcf_isa_aplus_mac 15
01754 #define bfd_mach_mcf_isa_aplus_emac 16
01755 #define bfd_mach_mcf_isa_b_nousp 17
01756 #define bfd_mach_mcf_isa_b_nousp_mac 18
01757 #define bfd_mach_mcf_isa_b_nousp_emac 19
01758 #define bfd_mach_mcf_isa_b 20
01759 #define bfd_mach_mcf_isa_b_mac 21
01760 #define bfd_mach_mcf_isa_b_emac 22
01761 #define bfd_mach_mcf_isa_b_float 23
01762 #define bfd_mach_mcf_isa_b_float_mac 24
01763 #define bfd_mach_mcf_isa_b_float_emac 25
01764   bfd_arch_vax,       /* DEC Vax */
01765   bfd_arch_i960,      /* Intel 960 */
01766     /* The order of the following is important.
01767        lower number indicates a machine type that
01768        only accepts a subset of the instructions
01769        available to machines with higher numbers.
01770        The exception is the "ca", which is
01771        incompatible with all other machines except
01772        "core".  */
01773 
01774 #define bfd_mach_i960_core      1
01775 #define bfd_mach_i960_ka_sa     2
01776 #define bfd_mach_i960_kb_sb     3
01777 #define bfd_mach_i960_mc        4
01778 #define bfd_mach_i960_xa        5
01779 #define bfd_mach_i960_ca        6
01780 #define bfd_mach_i960_jx        7
01781 #define bfd_mach_i960_hx        8
01782 
01783   bfd_arch_or32,      /* OpenRISC 32 */
01784 
01785   bfd_arch_sparc,     /* SPARC */
01786 #define bfd_mach_sparc                 1
01787 /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
01788 #define bfd_mach_sparc_sparclet        2
01789 #define bfd_mach_sparc_sparclite       3
01790 #define bfd_mach_sparc_v8plus          4
01791 #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
01792 #define bfd_mach_sparc_sparclite_le    6
01793 #define bfd_mach_sparc_v9              7
01794 #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
01795 #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
01796 #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
01797 /* Nonzero if MACH has the v9 instruction set.  */
01798 #define bfd_mach_sparc_v9_p(mach) \
01799   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
01800    && (mach) != bfd_mach_sparc_sparclite_le)
01801 /* Nonzero if MACH is a 64 bit sparc architecture.  */
01802 #define bfd_mach_sparc_64bit_p(mach) \
01803   ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
01804   bfd_arch_spu,       /* PowerPC SPU */
01805 #define bfd_mach_spu           256 
01806   bfd_arch_mips,      /* MIPS Rxxxx */
01807 #define bfd_mach_mips3000              3000
01808 #define bfd_mach_mips3900              3900
01809 #define bfd_mach_mips4000              4000
01810 #define bfd_mach_mips4010              4010
01811 #define bfd_mach_mips4100              4100
01812 #define bfd_mach_mips4111              4111
01813 #define bfd_mach_mips4120              4120
01814 #define bfd_mach_mips4300              4300
01815 #define bfd_mach_mips4400              4400
01816 #define bfd_mach_mips4600              4600
01817 #define bfd_mach_mips4650              4650
01818 #define bfd_mach_mips5000              5000
01819 #define bfd_mach_mips5400              5400
01820 #define bfd_mach_mips5500              5500
01821 #define bfd_mach_mips6000              6000
01822 #define bfd_mach_mips7000              7000
01823 #define bfd_mach_mips8000              8000
01824 #define bfd_mach_mips9000              9000
01825 #define bfd_mach_mips10000             10000
01826 #define bfd_mach_mips12000             12000
01827 #define bfd_mach_mips16                16
01828 #define bfd_mach_mips5                 5
01829 #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
01830 #define bfd_mach_mipsisa32             32
01831 #define bfd_mach_mipsisa32r2           33
01832 #define bfd_mach_mipsisa64             64
01833 #define bfd_mach_mipsisa64r2           65
01834   bfd_arch_i386,      /* Intel 386 */
01835 #define bfd_mach_i386_i386 1
01836 #define bfd_mach_i386_i8086 2
01837 #define bfd_mach_i386_i386_intel_syntax 3
01838 #define bfd_mach_x86_64 64
01839 #define bfd_mach_x86_64_intel_syntax 65
01840   bfd_arch_we32k,     /* AT&T WE32xxx */
01841   bfd_arch_tahoe,     /* CCI/Harris Tahoe */
01842   bfd_arch_i860,      /* Intel 860 */
01843   bfd_arch_i370,      /* IBM 360/370 Mainframes */
01844   bfd_arch_romp,      /* IBM ROMP PC/RT */
01845   bfd_arch_convex,    /* Convex */
01846   bfd_arch_m88k,      /* Motorola 88xxx */
01847   bfd_arch_m98k,      /* Motorola 98xxx */
01848   bfd_arch_pyramid,   /* Pyramid Technology */
01849   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
01850 #define bfd_mach_h8300    1
01851 #define bfd_mach_h8300h   2
01852 #define bfd_mach_h8300s   3
01853 #define bfd_mach_h8300hn  4
01854 #define bfd_mach_h8300sn  5
01855 #define bfd_mach_h8300sx  6
01856 #define bfd_mach_h8300sxn 7
01857   bfd_arch_pdp11,     /* DEC PDP-11 */
01858   bfd_arch_powerpc,   /* PowerPC */
01859 #define bfd_mach_ppc           32
01860 #define bfd_mach_ppc64         64
01861 #define bfd_mach_ppc_403       403
01862 #define bfd_mach_ppc_403gc     4030
01863 #define bfd_mach_ppc_505       505
01864 #define bfd_mach_ppc_601       601
01865 #define bfd_mach_ppc_602       602
01866 #define bfd_mach_ppc_603       603
01867 #define bfd_mach_ppc_ec603e    6031
01868 #define bfd_mach_ppc_604       604
01869 #define bfd_mach_ppc_620       620
01870 #define bfd_mach_ppc_630       630
01871 #define bfd_mach_ppc_750       750
01872 #define bfd_mach_ppc_860       860
01873 #define bfd_mach_ppc_a35       35
01874 #define bfd_mach_ppc_rs64ii    642
01875 #define bfd_mach_ppc_rs64iii   643
01876 #define bfd_mach_ppc_7400      7400
01877 #define bfd_mach_ppc_e500      500
01878   bfd_arch_rs6000,    /* IBM RS/6000 */
01879 #define bfd_mach_rs6k          6000
01880 #define bfd_mach_rs6k_rs1      6001
01881 #define bfd_mach_rs6k_rsc      6003
01882 #define bfd_mach_rs6k_rs2      6002
01883   bfd_arch_hppa,      /* HP PA RISC */
01884 #define bfd_mach_hppa10        10
01885 #define bfd_mach_hppa11        11
01886 #define bfd_mach_hppa20        20
01887 #define bfd_mach_hppa20w       25
01888   bfd_arch_d10v,      /* Mitsubishi D10V */
01889 #define bfd_mach_d10v          1
01890 #define bfd_mach_d10v_ts2      2
01891 #define bfd_mach_d10v_ts3      3
01892   bfd_arch_d30v,      /* Mitsubishi D30V */
01893   bfd_arch_dlx,       /* DLX */
01894   bfd_arch_m68hc11,   /* Motorola 68HC11 */
01895   bfd_arch_m68hc12,   /* Motorola 68HC12 */
01896 #define bfd_mach_m6812_default 0
01897 #define bfd_mach_m6812         1
01898 #define bfd_mach_m6812s        2
01899   bfd_arch_z8k,       /* Zilog Z8000 */
01900 #define bfd_mach_z8001         1
01901 #define bfd_mach_z8002         2
01902   bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
01903   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
01904 #define bfd_mach_sh            1
01905 #define bfd_mach_sh2        0x20
01906 #define bfd_mach_sh_dsp     0x2d
01907 #define bfd_mach_sh2a       0x2a
01908 #define bfd_mach_sh2a_nofpu 0x2b
01909 #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
01910 #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
01911 #define bfd_mach_sh2a_or_sh4  0x2a3
01912 #define bfd_mach_sh2a_or_sh3e 0x2a4
01913 #define bfd_mach_sh2e       0x2e
01914 #define bfd_mach_sh3        0x30
01915 #define bfd_mach_sh3_nommu  0x31
01916 #define bfd_mach_sh3_dsp    0x3d
01917 #define bfd_mach_sh3e       0x3e
01918 #define bfd_mach_sh4        0x40
01919 #define bfd_mach_sh4_nofpu  0x41
01920 #define bfd_mach_sh4_nommu_nofpu  0x42
01921 #define bfd_mach_sh4a       0x4a
01922 #define bfd_mach_sh4a_nofpu 0x4b
01923 #define bfd_mach_sh4al_dsp  0x4d
01924 #define bfd_mach_sh5        0x50
01925   bfd_arch_alpha,     /* Dec Alpha */
01926 #define bfd_mach_alpha_ev4  0x10
01927 #define bfd_mach_alpha_ev5  0x20
01928 #define bfd_mach_alpha_ev6  0x30
01929   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
01930 #define bfd_mach_arm_unknown   0
01931 #define bfd_mach_arm_2         1
01932 #define bfd_mach_arm_2a        2
01933 #define bfd_mach_arm_3         3
01934 #define bfd_mach_arm_3M        4
01935 #define bfd_mach_arm_4         5
01936 #define bfd_mach_arm_4T        6
01937 #define bfd_mach_arm_5         7
01938 #define bfd_mach_arm_5T        8
01939 #define bfd_mach_arm_5TE       9
01940 #define bfd_mach_arm_XScale    10
01941 #define bfd_mach_arm_ep9312    11
01942 #define bfd_mach_arm_iWMMXt    12
01943 #define bfd_mach_arm_iWMMXt2   13
01944   bfd_arch_ns32k,     /* National Semiconductors ns32000 */
01945   bfd_arch_w65,       /* WDC 65816 */
01946   bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
01947   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
01948 #define bfd_mach_tic3x         30
01949 #define bfd_mach_tic4x         40
01950   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
01951   bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
01952   bfd_arch_v850,      /* NEC V850 */
01953 #define bfd_mach_v850          1
01954 #define bfd_mach_v850e         'E'
01955 #define bfd_mach_v850e1        '1'
01956   bfd_arch_arc,       /* ARC Cores */
01957 #define bfd_mach_arc_5         5
01958 #define bfd_mach_arc_6         6
01959 #define bfd_mach_arc_7         7
01960 #define bfd_mach_arc_8         8
01961  bfd_arch_m32c,     /* Renesas M16C/M32C.  */
01962 #define bfd_mach_m16c        0x75
01963 #define bfd_mach_m32c        0x78
01964   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
01965 #define bfd_mach_m32r          1 /* For backwards compatibility.  */
01966 #define bfd_mach_m32rx         'x'
01967 #define bfd_mach_m32r2         '2'
01968   bfd_arch_mn10200,   /* Matsushita MN10200 */
01969   bfd_arch_mn10300,   /* Matsushita MN10300 */
01970 #define bfd_mach_mn10300               300
01971 #define bfd_mach_am33          330
01972 #define bfd_mach_am33_2        332
01973   bfd_arch_fr30,
01974 #define bfd_mach_fr30          0x46523330
01975   bfd_arch_frv,
01976 #define bfd_mach_frv           1
01977 #define bfd_mach_frvsimple     2
01978 #define bfd_mach_fr300         300
01979 #define bfd_mach_fr400         400
01980 #define bfd_mach_fr450         450
01981 #define bfd_mach_frvtomcat     499     /* fr500 prototype */
01982 #define bfd_mach_fr500         500
01983 #define bfd_mach_fr550         550
01984   bfd_arch_mcore,
01985   bfd_arch_mep,
01986 #define bfd_mach_mep           1
01987 #define bfd_mach_mep_h1        0x6831
01988   bfd_arch_ia64,      /* HP/Intel ia64 */
01989 #define bfd_mach_ia64_elf64    64
01990 #define bfd_mach_ia64_elf32    32
01991   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
01992 #define bfd_mach_ip2022        1
01993 #define bfd_mach_ip2022ext     2
01994  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
01995 #define bfd_mach_iq2000        1
01996 #define bfd_mach_iq10          2
01997   bfd_arch_mt,
01998 #define bfd_mach_ms1           1
01999 #define bfd_mach_mrisc2        2
02000 #define bfd_mach_ms2           3
02001   bfd_arch_pj,
02002   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
02003 #define bfd_mach_avr1          1
02004 #define bfd_mach_avr2          2
02005 #define bfd_mach_avr3          3
02006 #define bfd_mach_avr4          4
02007 #define bfd_mach_avr5          5
02008 #define bfd_mach_avr6          6
02009   bfd_arch_bfin,        /* ADI Blackfin */
02010 #define bfd_mach_bfin          1
02011   bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
02012 #define bfd_mach_cr16c         1
02013   bfd_arch_crx,       /*  National Semiconductor CRX.  */
02014 #define bfd_mach_crx           1
02015   bfd_arch_cris,      /* Axis CRIS */
02016 #define bfd_mach_cris_v0_v10   255
02017 #define bfd_mach_cris_v32      32
02018 #define bfd_mach_cris_v10_v32  1032
02019   bfd_arch_s390,      /* IBM s390 */
02020 #define bfd_mach_s390_31       31
02021 #define bfd_mach_s390_64       64
02022   bfd_arch_score,     /* Sunplus score */ 
02023   bfd_arch_openrisc,  /* OpenRISC */
02024   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
02025   bfd_arch_xstormy16,
02026 #define bfd_mach_xstormy16     1
02027   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
02028 #define bfd_mach_msp11          11
02029 #define bfd_mach_msp110         110
02030 #define bfd_mach_msp12          12
02031 #define bfd_mach_msp13          13
02032 #define bfd_mach_msp14          14
02033 #define bfd_mach_msp15          15
02034 #define bfd_mach_msp16          16
02035 #define bfd_mach_msp21          21
02036 #define bfd_mach_msp31          31
02037 #define bfd_mach_msp32          32
02038 #define bfd_mach_msp33          33
02039 #define bfd_mach_msp41          41
02040 #define bfd_mach_msp42          42
02041 #define bfd_mach_msp43          43
02042 #define bfd_mach_msp44          44
02043   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
02044 #define bfd_mach_xc16x         1
02045 #define bfd_mach_xc16xl        2
02046 #define bfd_mach_xc16xs         3
02047   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
02048 #define bfd_mach_xtensa        1
02049    bfd_arch_maxq,     /* Dallas MAXQ 10/20 */
02050 #define bfd_mach_maxq10    10
02051 #define bfd_mach_maxq20    20
02052   bfd_arch_z80,
02053 #define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
02054 #define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
02055 #define bfd_mach_z80full        7 /* All undocumented instructions.  */
02056 #define bfd_mach_r800           11 /* R800: successor with multiplication.  */
02057   bfd_arch_last
02058   };
02059 
02060 typedef struct bfd_arch_info
02061 {
02062   int bits_per_word;
02063   int bits_per_address;
02064   int bits_per_byte;
02065   enum bfd_architecture arch;
02066   unsigned long mach;
02067   const char *arch_name;
02068   const char *printable_name;
02069   unsigned int section_align_power;
02070   /* TRUE if this is the default machine for the architecture.
02071      The default arch should be the first entry for an arch so that
02072      all the entries for that arch can be accessed via <<next>>.  */
02073   bfd_boolean the_default;
02074   const struct bfd_arch_info * (*compatible)
02075     (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
02076 
02077   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
02078 
02079   const struct bfd_arch_info *next;
02080 }
02081 bfd_arch_info_type;
02082 
02083 const char *bfd_printable_name (bfd *abfd);
02084 
02085 const bfd_arch_info_type *bfd_scan_arch (const char *string);
02086 
02087 const char **bfd_arch_list (void);
02088 
02089 const bfd_arch_info_type *bfd_arch_get_compatible
02090    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
02091 
02092 void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
02093 
02094 enum bfd_architecture bfd_get_arch (bfd *abfd);
02095 
02096 unsigned long bfd_get_mach (bfd *abfd);
02097 
02098 unsigned int bfd_arch_bits_per_byte (bfd *abfd);
02099 
02100 unsigned int bfd_arch_bits_per_address (bfd *abfd);
02101 
02102 const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
02103 
02104 const bfd_arch_info_type *bfd_lookup_arch
02105    (enum bfd_architecture arch, unsigned long machine);
02106 
02107 const char *bfd_printable_arch_mach
02108    (enum bfd_architecture arch, unsigned long machine);
02109 
02110 unsigned int bfd_octets_per_byte (bfd *abfd);
02111 
02112 unsigned int bfd_arch_mach_octets_per_byte
02113    (enum bfd_architecture arch, unsigned long machine);
02114 
02115 /* Extracted from reloc.c.  */
02116 typedef enum bfd_reloc_status
02117 {
02118   /* No errors detected.  */
02119   bfd_reloc_ok,
02120 
02121   /* The relocation was performed, but there was an overflow.  */
02122   bfd_reloc_overflow,
02123 
02124   /* The address to relocate was not within the section supplied.  */
02125   bfd_reloc_outofrange,
02126 
02127   /* Used by special functions.  */
02128   bfd_reloc_continue,
02129 
02130   /* Unsupported relocation size requested.  */
02131   bfd_reloc_notsupported,
02132 
02133   /* Unused.  */
02134   bfd_reloc_other,
02135 
02136   /* The symbol to relocate against was undefined.  */
02137   bfd_reloc_undefined,
02138 
02139   /* The relocation was performed, but may not be ok - presently
02140      generated only when linking i960 coff files with i960 b.out
02141      symbols.  If this type is returned, the error_message argument
02142      to bfd_perform_relocation will be set.  */
02143   bfd_reloc_dangerous
02144  }
02145  bfd_reloc_status_type;
02146 
02147 
02148 typedef struct reloc_cache_entry
02149 {
02150   /* A pointer into the canonical table of pointers.  */
02151   struct bfd_symbol **sym_ptr_ptr;
02152 
02153   /* offset in section.  */
02154   bfd_size_type address;
02155 
02156   /* addend for relocation value.  */
02157   bfd_vma addend;
02158 
02159   /* Pointer to how to perform the required relocation.  */
02160   reloc_howto_type *howto;
02161 
02162 }
02163 arelent;
02164 
02165 enum complain_overflow
02166 {
02167   /* Do not complain on overflow.  */
02168   complain_overflow_dont,
02169 
02170   /* Complain if the value overflows when considered as a signed
02171      number one bit larger than the field.  ie. A bitfield of N bits
02172      is allowed to represent -2**n to 2**n-1.  */
02173   complain_overflow_bitfield,
02174 
02175   /* Complain if the value overflows when considered as a signed
02176      number.  */
02177   complain_overflow_signed,
02178 
02179   /* Complain if the value overflows when considered as an
02180      unsigned number.  */
02181   complain_overflow_unsigned
02182 };
02183 
02184 struct reloc_howto_struct
02185 {
02186   /*  The type field has mainly a documentary use - the back end can
02187       do what it wants with it, though normally the back end's
02188       external idea of what a reloc number is stored
02189       in this field.  For example, a PC relative word relocation
02190       in a coff environment has the type 023 - because that's
02191       what the outside world calls a R_PCRWORD reloc.  */
02192   unsigned int type;
02193 
02194   /*  The value the final relocation is shifted right by.  This drops
02195       unwanted data from the relocation.  */
02196   unsigned int rightshift;
02197 
02198   /*  The size of the item to be relocated.  This is *not* a
02199       power-of-two measure.  To get the number of bytes operated
02200       on by a type of relocation, use bfd_get_reloc_size.  */
02201   int size;
02202 
02203   /*  The number of bits in the item to be relocated.  This is used
02204       when doing overflow checking.  */
02205   unsigned int bitsize;
02206 
02207   /*  Notes that the relocation is relative to the location in the
02208       data section of the addend.  The relocation function will
02209       subtract from the relocation value the address of the location
02210       being relocated.  */
02211   bfd_boolean pc_relative;
02212 
02213   /*  The bit position of the reloc value in the destination.
02214       The relocated value is left shifted by this amount.  */
02215   unsigned int bitpos;
02216 
02217   /* What type of overflow error should be checked for when
02218      relocating.  */
02219   enum complain_overflow complain_on_overflow;
02220 
02221   /* If this field is non null, then the supplied function is
02222      called rather than the normal function.  This allows really
02223      strange relocation methods to be accommodated (e.g., i960 callj
02224      instructions).  */
02225   bfd_reloc_status_type (*special_function)
02226     (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
02227      bfd *, char **);
02228 
02229   /* The textual name of the relocation type.  */
02230   char *name;
02231 
02232   /* Some formats record a relocation addend in the section contents
02233      rather than with the relocation.  For ELF formats this is the
02234      distinction between USE_REL and USE_RELA (though the code checks
02235      for USE_REL == 1/0).  The value of this field is TRUE if the
02236      addend is recorded with the section contents; when performing a
02237      partial link (ld -r) the section contents (the data) will be
02238      modified.  The value of this field is FALSE if addends are
02239      recorded with the relocation (in arelent.addend); when performing
02240      a partial link the relocation will be modified.
02241      All relocations for all ELF USE_RELA targets should set this field
02242      to FALSE (values of TRUE should be looked on with suspicion).
02243      However, the converse is not true: not all relocations of all ELF
02244      USE_REL targets set this field to TRUE.  Why this is so is peculiar
02245      to each particular target.  For relocs that aren't used in partial
02246      links (e.g. GOT stuff) it doesn't matter what this is set to.  */
02247   bfd_boolean partial_inplace;
02248 
02249   /* src_mask selects the part of the instruction (or data) to be used
02250      in the relocation sum.  If the target relocations don't have an
02251      addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
02252      dst_mask to extract the addend from the section contents.  If
02253      relocations do have an addend in the reloc, eg. ELF USE_RELA, this
02254      field should be zero.  Non-zero values for ELF USE_RELA targets are
02255      bogus as in those cases the value in the dst_mask part of the
02256      section contents should be treated as garbage.  */
02257   bfd_vma src_mask;
02258 
02259   /* dst_mask selects which parts of the instruction (or data) are
02260      replaced with a relocated value.  */
02261   bfd_vma dst_mask;
02262 
02263   /* When some formats create PC relative instructions, they leave
02264      the value of the pc of the place being relocated in the offset
02265      slot of the instruction, so that a PC relative relocation can
02266      be made just by adding in an ordinary offset (e.g., sun3 a.out).
02267      Some formats leave the displacement part of an instruction
02268      empty (e.g., m88k bcs); this flag signals the fact.  */
02269   bfd_boolean pcrel_offset;
02270 };
02271 
02272 #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
02273   { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
02274 #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
02275   HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
02276          NAME, FALSE, 0, 0, IN)
02277 
02278 #define EMPTY_HOWTO(C) \
02279   HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
02280          NULL, FALSE, 0, 0, FALSE)
02281 
02282 #define HOWTO_PREPARE(relocation, symbol)               \
02283   {                                                     \
02284     if (symbol != NULL)                                 \
02285       {                                                 \
02286         if (bfd_is_com_section (symbol->section))       \
02287           {                                             \
02288             relocation = 0;                             \
02289           }                                             \
02290         else                                            \
02291           {                                             \
02292             relocation = symbol->value;                 \
02293           }                                             \
02294       }                                                 \
02295   }
02296 
02297 unsigned int bfd_get_reloc_size (reloc_howto_type *);
02298 
02299 typedef struct relent_chain
02300 {
02301   arelent relent;
02302   struct relent_chain *next;
02303 }
02304 arelent_chain;
02305 
02306 bfd_reloc_status_type bfd_check_overflow
02307    (enum complain_overflow how,
02308     unsigned int bitsize,
02309     unsigned int rightshift,
02310     unsigned int addrsize,
02311     bfd_vma relocation);
02312 
02313 bfd_reloc_status_type bfd_perform_relocation
02314    (bfd *abfd,
02315     arelent *reloc_entry,
02316     void *data,
02317     asection *input_section,
02318     bfd *output_bfd,
02319     char **error_message);
02320 
02321 bfd_reloc_status_type bfd_install_relocation
02322    (bfd *abfd,
02323     arelent *reloc_entry,
02324     void *data, bfd_vma data_start,
02325     asection *input_section,
02326     char **error_message);
02327 
02328 enum bfd_reloc_code_real {
02329   _dummy_first_bfd_reloc_code_real,
02330 
02331 
02332 /* Basic absolute relocations of N bits.  */
02333   BFD_RELOC_64,
02334   BFD_RELOC_32,
02335   BFD_RELOC_26,
02336   BFD_RELOC_24,
02337   BFD_RELOC_16,
02338   BFD_RELOC_14,
02339   BFD_RELOC_8,
02340 
02341 /* PC-relative relocations.  Sometimes these are relative to the address
02342 of the relocation itself; sometimes they are relative to the start of
02343 the section containing the relocation.  It depends on the specific target.
02344 
02345 The 24-bit relocation is used in some Intel 960 configurations.  */
02346   BFD_RELOC_64_PCREL,
02347   BFD_RELOC_32_PCREL,
02348   BFD_RELOC_24_PCREL,
02349   BFD_RELOC_16_PCREL,
02350   BFD_RELOC_12_PCREL,
02351   BFD_RELOC_8_PCREL,
02352 
02353 /* Section relative relocations.  Some targets need this for DWARF2.  */
02354   BFD_RELOC_32_SECREL,
02355 
02356 /* For ELF.  */
02357   BFD_RELOC_32_GOT_PCREL,
02358   BFD_RELOC_16_GOT_PCREL,
02359   BFD_RELOC_8_GOT_PCREL,
02360   BFD_RELOC_32_GOTOFF,
02361   BFD_RELOC_16_GOTOFF,
02362   BFD_RELOC_LO16_GOTOFF,
02363   BFD_RELOC_HI16_GOTOFF,
02364   BFD_RELOC_HI16_S_GOTOFF,
02365   BFD_RELOC_8_GOTOFF,
02366   BFD_RELOC_64_PLT_PCREL,
02367   BFD_RELOC_32_PLT_PCREL,
02368   BFD_RELOC_24_PLT_PCREL,
02369   BFD_RELOC_16_PLT_PCREL,
02370   BFD_RELOC_8_PLT_PCREL,
02371   BFD_RELOC_64_PLTOFF,
02372   BFD_RELOC_32_PLTOFF,
02373   BFD_RELOC_16_PLTOFF,
02374   BFD_RELOC_LO16_PLTOFF,
02375   BFD_RELOC_HI16_PLTOFF,
02376   BFD_RELOC_HI16_S_PLTOFF,
02377   BFD_RELOC_8_PLTOFF,
02378 
02379 /* Relocations used by 68K ELF.  */
02380   BFD_RELOC_68K_GLOB_DAT,
02381   BFD_RELOC_68K_JMP_SLOT,
02382   BFD_RELOC_68K_RELATIVE,
02383 
02384 /* Linkage-table relative.  */
02385   BFD_RELOC_32_BASEREL,
02386   BFD_RELOC_16_BASEREL,
02387   BFD_RELOC_LO16_BASEREL,
02388   BFD_RELOC_HI16_BASEREL,
02389   BFD_RELOC_HI16_S_BASEREL,
02390   BFD_RELOC_8_BASEREL,
02391   BFD_RELOC_RVA,
02392 
02393 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
02394   BFD_RELOC_8_FFnn,
02395 
02396 /* These PC-relative relocations are stored as word displacements --
02397 i.e., byte displacements shifted right two bits.  The 30-bit word
02398 displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
02399 SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
02400 signed 16-bit displacement is used on the MIPS, and the 23-bit
02401 displacement is used on the Alpha.  */
02402   BFD_RELOC_32_PCREL_S2,
02403   BFD_RELOC_16_PCREL_S2,
02404   BFD_RELOC_23_PCREL_S2,
02405 
02406 /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
02407 the target word.  These are used on the SPARC.  */
02408   BFD_RELOC_HI22,
02409   BFD_RELOC_LO10,
02410 
02411 /* For systems that allocate a Global Pointer register, these are
02412 displacements off that register.  These relocation types are
02413 handled specially, because the value the register will have is
02414 decided relatively late.  */
02415   BFD_RELOC_GPREL16,
02416   BFD_RELOC_GPREL32,
02417 
02418 /* Reloc types used for i960/b.out.  */
02419   BFD_RELOC_I960_CALLJ,
02420 
02421 /* SPARC ELF relocations.  There is probably some overlap with other
02422 relocation types already defined.  */
02423   BFD_RELOC_NONE,
02424   BFD_RELOC_SPARC_WDISP22,
02425   BFD_RELOC_SPARC22,
02426   BFD_RELOC_SPARC13,
02427   BFD_RELOC_SPARC_GOT10,
02428   BFD_RELOC_SPARC_GOT13,
02429   BFD_RELOC_SPARC_GOT22,
02430   BFD_RELOC_SPARC_PC10,
02431   BFD_RELOC_SPARC_PC22,
02432   BFD_RELOC_SPARC_WPLT30,
02433   BFD_RELOC_SPARC_COPY,
02434   BFD_RELOC_SPARC_GLOB_DAT,
02435   BFD_RELOC_SPARC_JMP_SLOT,
02436   BFD_RELOC_SPARC_RELATIVE,
02437   BFD_RELOC_SPARC_UA16,
02438   BFD_RELOC_SPARC_UA32,
02439   BFD_RELOC_SPARC_UA64,
02440 
02441 /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
02442   BFD_RELOC_SPARC_BASE13,
02443   BFD_RELOC_SPARC_BASE22,
02444 
02445 /* SPARC64 relocations  */
02446 #define BFD_RELOC_SPARC_64 BFD_RELOC_64
02447   BFD_RELOC_SPARC_10,
02448   BFD_RELOC_SPARC_11,
02449   BFD_RELOC_SPARC_OLO10,
02450   BFD_RELOC_SPARC_HH22,
02451   BFD_RELOC_SPARC_HM10,
02452   BFD_RELOC_SPARC_LM22,
02453   BFD_RELOC_SPARC_PC_HH22,
02454   BFD_RELOC_SPARC_PC_HM10,
02455   BFD_RELOC_SPARC_PC_LM22,
02456   BFD_RELOC_SPARC_WDISP16,
02457   BFD_RELOC_SPARC_WDISP19,
02458   BFD_RELOC_SPARC_7,
02459   BFD_RELOC_SPARC_6,
02460   BFD_RELOC_SPARC_5,
02461 #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
02462   BFD_RELOC_SPARC_PLT32,
02463   BFD_RELOC_SPARC_PLT64,
02464   BFD_RELOC_SPARC_HIX22,
02465   BFD_RELOC_SPARC_LOX10,
02466   BFD_RELOC_SPARC_H44,
02467   BFD_RELOC_SPARC_M44,
02468   BFD_RELOC_SPARC_L44,
02469   BFD_RELOC_SPARC_REGISTER,
02470 
02471 /* SPARC little endian relocation  */
02472   BFD_RELOC_SPARC_REV32,
02473 
02474 /* SPARC TLS relocations  */
02475   BFD_RELOC_SPARC_TLS_GD_HI22,
02476   BFD_RELOC_SPARC_TLS_GD_LO10,
02477   BFD_RELOC_SPARC_TLS_GD_ADD,
02478   BFD_RELOC_SPARC_TLS_GD_CALL,
02479   BFD_RELOC_SPARC_TLS_LDM_HI22,
02480   BFD_RELOC_SPARC_TLS_LDM_LO10,
02481   BFD_RELOC_SPARC_TLS_LDM_ADD,
02482   BFD_RELOC_SPARC_TLS_LDM_CALL,
02483   BFD_RELOC_SPARC_TLS_LDO_HIX22,
02484   BFD_RELOC_SPARC_TLS_LDO_LOX10,
02485   BFD_RELOC_SPARC_TLS_LDO_ADD,
02486   BFD_RELOC_SPARC_TLS_IE_HI22,
02487   BFD_RELOC_SPARC_TLS_IE_LO10,
02488   BFD_RELOC_SPARC_TLS_IE_LD,
02489   BFD_RELOC_SPARC_TLS_IE_LDX,
02490   BFD_RELOC_SPARC_TLS_IE_ADD,
02491   BFD_RELOC_SPARC_TLS_LE_HIX22,
02492   BFD_RELOC_SPARC_TLS_LE_LOX10,
02493   BFD_RELOC_SPARC_TLS_DTPMOD32,
02494   BFD_RELOC_SPARC_TLS_DTPMOD64,
02495   BFD_RELOC_SPARC_TLS_DTPOFF32,
02496   BFD_RELOC_SPARC_TLS_DTPOFF64,
02497   BFD_RELOC_SPARC_TLS_TPOFF32,
02498   BFD_RELOC_SPARC_TLS_TPOFF64,
02499 
02500 /* SPU Relocations.  */
02501   BFD_RELOC_SPU_IMM7,
02502   BFD_RELOC_SPU_IMM8,
02503   BFD_RELOC_SPU_IMM10,
02504   BFD_RELOC_SPU_IMM10W,
02505   BFD_RELOC_SPU_IMM16,
02506   BFD_RELOC_SPU_IMM16W,
02507   BFD_RELOC_SPU_IMM18,
02508   BFD_RELOC_SPU_PCREL9a,
02509   BFD_RELOC_SPU_PCREL9b,
02510   BFD_RELOC_SPU_PCREL16,
02511   BFD_RELOC_SPU_LO16,
02512   BFD_RELOC_SPU_HI16,
02513 
02514 /* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
02515 "addend" in some special way.
02516 For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
02517 writing; when reading, it will be the absolute section symbol.  The
02518 addend is the displacement in bytes of the "lda" instruction from
02519 the "ldah" instruction (which is at the address of this reloc).  */
02520   BFD_RELOC_ALPHA_GPDISP_HI16,
02521 
02522 /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
02523 with GPDISP_HI16 relocs.  The addend is ignored when writing the
02524 relocations out, and is filled in with the file's GP value on
02525 reading, for convenience.  */
02526   BFD_RELOC_ALPHA_GPDISP_LO16,
02527 
02528 /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
02529 relocation except that there is no accompanying GPDISP_LO16
02530 relocation.  */
02531   BFD_RELOC_ALPHA_GPDISP,
02532 
02533 /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
02534 the assembler turns it into a LDQ instruction to load the address of
02535 the symbol, and then fills in a register in the real instruction.
02536 
02537 The LITERAL reloc, at the LDQ instruction, refers to the .lita
02538 section symbol.  The addend is ignored when writing, but is filled
02539 in with the file's GP value on reading, for convenience, as with the
02540 GPDISP_LO16 reloc.
02541 
02542 The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
02543 It should refer to the symbol to be referenced, as with 16_GOTOFF,
02544 but it generates output not based on the position within the .got
02545 section, but relative to the GP value chosen for the file during the
02546 final link stage.
02547 
02548 The LITUSE reloc, on the instruction using the loaded address, gives
02549 information to the linker that it might be able to use to optimize
02550 away some literal section references.  The symbol is ignored (read
02551 as the absolute section symbol), and the "addend" indicates the type
02552 of instruction using the register:
02553 1 - "memory" fmt insn
02554 2 - byte-manipulation (byte offset reg)
02555 3 - jsr (target of branch)  */
02556   BFD_RELOC_ALPHA_LITERAL,
02557   BFD_RELOC_ALPHA_ELF_LITERAL,
02558   BFD_RELOC_ALPHA_LITUSE,
02559 
02560 /* The HINT relocation indicates a value that should be filled into the
02561 "hint" field of a jmp/jsr/ret instruction, for possible branch-
02562 prediction logic which may be provided on some processors.  */
02563   BFD_RELOC_ALPHA_HINT,
02564 
02565 /* The LINKAGE relocation outputs a linkage pair in the object file,
02566 which is filled by the linker.  */
02567   BFD_RELOC_ALPHA_LINKAGE,
02568 
02569 /* The CODEADDR relocation outputs a STO_CA in the object file,
02570 which is filled by the linker.  */
02571   BFD_RELOC_ALPHA_CODEADDR,
02572 
02573 /* The GPREL_HI/LO relocations together form a 32-bit offset from the
02574 GP register.  */
02575   BFD_RELOC_ALPHA_GPREL_HI16,
02576   BFD_RELOC_ALPHA_GPREL_LO16,
02577 
02578 /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
02579 share a common GP, and the target address is adjusted for
02580 STO_ALPHA_STD_GPLOAD.  */
02581   BFD_RELOC_ALPHA_BRSGP,
02582 
02583 /* Alpha thread-local storage relocations.  */
02584   BFD_RELOC_ALPHA_TLSGD,
02585   BFD_RELOC_ALPHA_TLSLDM,
02586   BFD_RELOC_ALPHA_DTPMOD64,
02587   BFD_RELOC_ALPHA_GOTDTPREL16,
02588   BFD_RELOC_ALPHA_DTPREL64,
02589   BFD_RELOC_ALPHA_DTPREL_HI16,
02590   BFD_RELOC_ALPHA_DTPREL_LO16,
02591   BFD_RELOC_ALPHA_DTPREL16,
02592   BFD_RELOC_ALPHA_GOTTPREL16,
02593   BFD_RELOC_ALPHA_TPREL64,
02594   BFD_RELOC_ALPHA_TPREL_HI16,
02595   BFD_RELOC_ALPHA_TPREL_LO16,
02596   BFD_RELOC_ALPHA_TPREL16,
02597 
02598 /* Bits 27..2 of the relocation address shifted right 2 bits;
02599 simple reloc otherwise.  */
02600   BFD_RELOC_MIPS_JMP,
02601 
02602 /* The MIPS16 jump instruction.  */
02603   BFD_RELOC_MIPS16_JMP,
02604 
02605 /* MIPS16 GP relative reloc.  */
02606   BFD_RELOC_MIPS16_GPREL,
02607 
02608 /* High 16 bits of 32-bit value; simple reloc.  */
02609   BFD_RELOC_HI16,
02610 
02611 /* High 16 bits of 32-bit value but the low 16 bits will be sign
02612 extended and added to form the final result.  If the low 16
02613 bits form a negative number, we need to add one to the high value
02614 to compensate for the borrow when the low bits are added.  */
02615   BFD_RELOC_HI16_S,
02616 
02617 /* Low 16 bits.  */
02618   BFD_RELOC_LO16,
02619 
02620 /* High 16 bits of 32-bit pc-relative value  */
02621   BFD_RELOC_HI16_PCREL,
02622 
02623 /* High 16 bits of 32-bit pc-relative value, adjusted  */
02624   BFD_RELOC_HI16_S_PCREL,
02625 
02626 /* Low 16 bits of pc-relative value  */
02627   BFD_RELOC_LO16_PCREL,
02628 
02629 /* MIPS16 high 16 bits of 32-bit value.  */
02630   BFD_RELOC_MIPS16_HI16,
02631 
02632 /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
02633 extended and added to form the final result.  If the low 16
02634 bits form a negative number, we need to add one to the high value
02635 to compensate for the borrow when the low bits are added.  */
02636   BFD_RELOC_MIPS16_HI16_S,
02637 
02638 /* MIPS16 low 16 bits.  */
02639   BFD_RELOC_MIPS16_LO16,
02640 
02641 /* Relocation against a MIPS literal section.  */
02642   BFD_RELOC_MIPS_LITERAL,
02643 
02644 /* MIPS ELF relocations.  */
02645   BFD_RELOC_MIPS_GOT16,
02646   BFD_RELOC_MIPS_CALL16,
02647   BFD_RELOC_MIPS_GOT_HI16,
02648   BFD_RELOC_MIPS_GOT_LO16,
02649   BFD_RELOC_MIPS_CALL_HI16,
02650   BFD_RELOC_MIPS_CALL_LO16,
02651   BFD_RELOC_MIPS_SUB,
02652   BFD_RELOC_MIPS_GOT_PAGE,
02653   BFD_RELOC_MIPS_GOT_OFST,
02654   BFD_RELOC_MIPS_GOT_DISP,
02655   BFD_RELOC_MIPS_SHIFT5,
02656   BFD_RELOC_MIPS_SHIFT6,
02657   BFD_RELOC_MIPS_INSERT_A,
02658   BFD_RELOC_MIPS_INSERT_B,
02659   BFD_RELOC_MIPS_DELETE,
02660   BFD_RELOC_MIPS_HIGHEST,
02661   BFD_RELOC_MIPS_HIGHER,
02662   BFD_RELOC_MIPS_SCN_DISP,
02663   BFD_RELOC_MIPS_REL16,
02664   BFD_RELOC_MIPS_RELGOT,
02665   BFD_RELOC_MIPS_JALR,
02666   BFD_RELOC_MIPS_TLS_DTPMOD32,
02667   BFD_RELOC_MIPS_TLS_DTPREL32,
02668   BFD_RELOC_MIPS_TLS_DTPMOD64,
02669   BFD_RELOC_MIPS_TLS_DTPREL64,
02670   BFD_RELOC_MIPS_TLS_GD,
02671   BFD_RELOC_MIPS_TLS_LDM,
02672   BFD_RELOC_MIPS_TLS_DTPREL_HI16,
02673   BFD_RELOC_MIPS_TLS_DTPREL_LO16,
02674   BFD_RELOC_MIPS_TLS_GOTTPREL,
02675   BFD_RELOC_MIPS_TLS_TPREL32,
02676   BFD_RELOC_MIPS_TLS_TPREL64,
02677   BFD_RELOC_MIPS_TLS_TPREL_HI16,
02678   BFD_RELOC_MIPS_TLS_TPREL_LO16,
02679 
02680 
02681 /* MIPS ELF relocations (VxWorks extensions).  */
02682   BFD_RELOC_MIPS_COPY,
02683   BFD_RELOC_MIPS_JUMP_SLOT,
02684 
02685 
02686 /* Fujitsu Frv Relocations.  */
02687   BFD_RELOC_FRV_LABEL16,
02688   BFD_RELOC_FRV_LABEL24,
02689   BFD_RELOC_FRV_LO16,
02690   BFD_RELOC_FRV_HI16,
02691   BFD_RELOC_FRV_GPREL12,
02692   BFD_RELOC_FRV_GPRELU12,
02693   BFD_RELOC_FRV_GPREL32,
02694   BFD_RELOC_FRV_GPRELHI,
02695   BFD_RELOC_FRV_GPRELLO,
02696   BFD_RELOC_FRV_GOT12,
02697   BFD_RELOC_FRV_GOTHI,
02698   BFD_RELOC_FRV_GOTLO,
02699   BFD_RELOC_FRV_FUNCDESC,
02700   BFD_RELOC_FRV_FUNCDESC_GOT12,
02701   BFD_RELOC_FRV_FUNCDESC_GOTHI,
02702   BFD_RELOC_FRV_FUNCDESC_GOTLO,
02703   BFD_RELOC_FRV_FUNCDESC_VALUE,
02704   BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
02705   BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
02706   BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
02707   BFD_RELOC_FRV_GOTOFF12,
02708   BFD_RELOC_FRV_GOTOFFHI,
02709   BFD_RELOC_FRV_GOTOFFLO,
02710   BFD_RELOC_FRV_GETTLSOFF,
02711   BFD_RELOC_FRV_TLSDESC_VALUE,
02712   BFD_RELOC_FRV_GOTTLSDESC12,
02713   BFD_RELOC_FRV_GOTTLSDESCHI,
02714   BFD_RELOC_FRV_GOTTLSDESCLO,
02715   BFD_RELOC_FRV_TLSMOFF12,
02716   BFD_RELOC_FRV_TLSMOFFHI,
02717   BFD_RELOC_FRV_TLSMOFFLO,
02718   BFD_RELOC_FRV_GOTTLSOFF12,
02719   BFD_RELOC_FRV_GOTTLSOFFHI,
02720   BFD_RELOC_FRV_GOTTLSOFFLO,
02721   BFD_RELOC_FRV_TLSOFF,
02722   BFD_RELOC_FRV_TLSDESC_RELAX,
02723   BFD_RELOC_FRV_GETTLSOFF_RELAX,
02724   BFD_RELOC_FRV_TLSOFF_RELAX,
02725   BFD_RELOC_FRV_TLSMOFF,
02726 
02727 
02728 /* This is a 24bit GOT-relative reloc for the mn10300.  */
02729   BFD_RELOC_MN10300_GOTOFF24,
02730 
02731 /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
02732 in the instruction.  */
02733   BFD_RELOC_MN10300_GOT32,
02734 
02735 /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
02736 in the instruction.  */
02737   BFD_RELOC_MN10300_GOT24,
02738 
02739 /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
02740 in the instruction.  */
02741   BFD_RELOC_MN10300_GOT16,
02742 
02743 /* Copy symbol at runtime.  */
02744   BFD_RELOC_MN10300_COPY,
02745 
02746 /* Create GOT entry.  */
02747   BFD_RELOC_MN10300_GLOB_DAT,
02748 
02749 /* Create PLT entry.  */
02750   BFD_RELOC_MN10300_JMP_SLOT,
02751 
02752 /* Adjust by program base.  */
02753   BFD_RELOC_MN10300_RELATIVE,
02754 
02755 
02756 /* i386/elf relocations  */
02757   BFD_RELOC_386_GOT32,
02758   BFD_RELOC_386_PLT32,
02759   BFD_RELOC_386_COPY,
02760   BFD_RELOC_386_GLOB_DAT,
02761   BFD_RELOC_386_JUMP_SLOT,
02762   BFD_RELOC_386_RELATIVE,
02763   BFD_RELOC_386_GOTOFF,
02764   BFD_RELOC_386_GOTPC,
02765   BFD_RELOC_386_TLS_TPOFF,
02766   BFD_RELOC_386_TLS_IE,
02767   BFD_RELOC_386_TLS_GOTIE,
02768   BFD_RELOC_386_TLS_LE,
02769   BFD_RELOC_386_TLS_GD,
02770   BFD_RELOC_386_TLS_LDM,
02771   BFD_RELOC_386_TLS_LDO_32,
02772   BFD_RELOC_386_TLS_IE_32,
02773   BFD_RELOC_386_TLS_LE_32,
02774   BFD_RELOC_386_TLS_DTPMOD32,
02775   BFD_RELOC_386_TLS_DTPOFF32,
02776   BFD_RELOC_386_TLS_TPOFF32,
02777   BFD_RELOC_386_TLS_GOTDESC,
02778   BFD_RELOC_386_TLS_DESC_CALL,
02779   BFD_RELOC_386_TLS_DESC,
02780 
02781 /* x86-64/elf relocations  */
02782   BFD_RELOC_X86_64_GOT32,
02783   BFD_RELOC_X86_64_PLT32,
02784   BFD_RELOC_X86_64_COPY,
02785   BFD_RELOC_X86_64_GLOB_DAT,
02786   BFD_RELOC_X86_64_JUMP_SLOT,
02787   BFD_RELOC_X86_64_RELATIVE,
02788   BFD_RELOC_X86_64_GOTPCREL,
02789   BFD_RELOC_X86_64_32S,
02790   BFD_RELOC_X86_64_DTPMOD64,
02791   BFD_RELOC_X86_64_DTPOFF64,
02792   BFD_RELOC_X86_64_TPOFF64,
02793   BFD_RELOC_X86_64_TLSGD,
02794   BFD_RELOC_X86_64_TLSLD,
02795   BFD_RELOC_X86_64_DTPOFF32,
02796   BFD_RELOC_X86_64_GOTTPOFF,
02797   BFD_RELOC_X86_64_TPOFF32,
02798   BFD_RELOC_X86_64_GOTOFF64,
02799   BFD_RELOC_X86_64_GOTPC32,
02800   BFD_RELOC_X86_64_GOT64,
02801   BFD_RELOC_X86_64_GOTPCREL64,
02802   BFD_RELOC_X86_64_GOTPC64,
02803   BFD_RELOC_X86_64_GOTPLT64,
02804   BFD_RELOC_X86_64_PLTOFF64,
02805   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
02806   BFD_RELOC_X86_64_TLSDESC_CALL,
02807   BFD_RELOC_X86_64_TLSDESC,
02808 
02809 /* ns32k relocations  */
02810   BFD_RELOC_NS32K_IMM_8,
02811   BFD_RELOC_NS32K_IMM_16,
02812   BFD_RELOC_NS32K_IMM_32,
02813   BFD_RELOC_NS32K_IMM_8_PCREL,
02814   BFD_RELOC_NS32K_IMM_16_PCREL,
02815   BFD_RELOC_NS32K_IMM_32_PCREL,
02816   BFD_RELOC_NS32K_DISP_8,
02817   BFD_RELOC_NS32K_DISP_16,
02818   BFD_RELOC_NS32K_DISP_32,
02819   BFD_RELOC_NS32K_DISP_8_PCREL,
02820   BFD_RELOC_NS32K_DISP_16_PCREL,
02821   BFD_RELOC_NS32K_DISP_32_PCREL,
02822 
02823 /* PDP11 relocations  */
02824   BFD_RELOC_PDP11_DISP_8_PCREL,
02825   BFD_RELOC_PDP11_DISP_6_PCREL,
02826 
02827 /* Picojava relocs.  Not all of these appear in object files.  */
02828   BFD_RELOC_PJ_CODE_HI16,
02829   BFD_RELOC_PJ_CODE_LO16,
02830   BFD_RELOC_PJ_CODE_DIR16,
02831   BFD_RELOC_PJ_CODE_DIR32,
02832   BFD_RELOC_PJ_CODE_REL16,
02833   BFD_RELOC_PJ_CODE_REL32,
02834 
02835 /* Power(rs6000) and PowerPC relocations.  */
02836   BFD_RELOC_PPC_B26,
02837   BFD_RELOC_PPC_BA26,
02838   BFD_RELOC_PPC_TOC16,
02839   BFD_RELOC_PPC_B16,
02840   BFD_RELOC_PPC_B16_BRTAKEN,
02841   BFD_RELOC_PPC_B16_BRNTAKEN,
02842   BFD_RELOC_PPC_BA16,
02843   BFD_RELOC_PPC_BA16_BRTAKEN,
02844   BFD_RELOC_PPC_BA16_BRNTAKEN,
02845   BFD_RELOC_PPC_COPY,
02846   BFD_RELOC_PPC_GLOB_DAT,
02847   BFD_RELOC_PPC_JMP_SLOT,
02848   BFD_RELOC_PPC_RELATIVE,
02849   BFD_RELOC_PPC_LOCAL24PC,
02850   BFD_RELOC_PPC_EMB_NADDR32,
02851   BFD_RELOC_PPC_EMB_NADDR16,
02852   BFD_RELOC_PPC_EMB_NADDR16_LO,
02853   BFD_RELOC_PPC_EMB_NADDR16_HI,
02854   BFD_RELOC_PPC_EMB_NADDR16_HA,
02855   BFD_RELOC_PPC_EMB_SDAI16,
02856   BFD_RELOC_PPC_EMB_SDA2I16,
02857   BFD_RELOC_PPC_EMB_SDA2REL,
02858   BFD_RELOC_PPC_EMB_SDA21,
02859   BFD_RELOC_PPC_EMB_MRKREF,
02860   BFD_RELOC_PPC_EMB_RELSEC16,
02861   BFD_RELOC_PPC_EMB_RELST_LO,
02862   BFD_RELOC_PPC_EMB_RELST_HI,
02863   BFD_RELOC_PPC_EMB_RELST_HA,
02864   BFD_RELOC_PPC_EMB_BIT_FLD,
02865   BFD_RELOC_PPC_EMB_RELSDA,
02866   BFD_RELOC_PPC64_HIGHER,
02867   BFD_RELOC_PPC64_HIGHER_S,
02868   BFD_RELOC_PPC64_HIGHEST,
02869   BFD_RELOC_PPC64_HIGHEST_S,
02870   BFD_RELOC_PPC64_TOC16_LO,
02871   BFD_RELOC_PPC64_TOC16_HI,
02872   BFD_RELOC_PPC64_TOC16_HA,
02873   BFD_RELOC_PPC64_TOC,
02874   BFD_RELOC_PPC64_PLTGOT16,
02875   BFD_RELOC_PPC64_PLTGOT16_LO,
02876   BFD_RELOC_PPC64_PLTGOT16_HI,
02877   BFD_RELOC_PPC64_PLTGOT16_HA,
02878   BFD_RELOC_PPC64_ADDR16_DS,
02879   BFD_RELOC_PPC64_ADDR16_LO_DS,
02880   BFD_RELOC_PPC64_GOT16_DS,
02881   BFD_RELOC_PPC64_GOT16_LO_DS,
02882   BFD_RELOC_PPC64_PLT16_LO_DS,
02883   BFD_RELOC_PPC64_SECTOFF_DS,
02884   BFD_RELOC_PPC64_SECTOFF_LO_DS,
02885   BFD_RELOC_PPC64_TOC16_DS,
02886   BFD_RELOC_PPC64_TOC16_LO_DS,
02887   BFD_RELOC_PPC64_PLTGOT16_DS,
02888   BFD_RELOC_PPC64_PLTGOT16_LO_DS,
02889 
02890 /* PowerPC and PowerPC64 thread-local storage relocations.  */
02891   BFD_RELOC_PPC_TLS,
02892   BFD_RELOC_PPC_DTPMOD,
02893   BFD_RELOC_PPC_TPREL16,
02894   BFD_RELOC_PPC_TPREL16_LO,
02895   BFD_RELOC_PPC_TPREL16_HI,
02896   BFD_RELOC_PPC_TPREL16_HA,
02897   BFD_RELOC_PPC_TPREL,
02898   BFD_RELOC_PPC_DTPREL16,
02899   BFD_RELOC_PPC_DTPREL16_LO,
02900   BFD_RELOC_PPC_DTPREL16_HI,
02901   BFD_RELOC_PPC_DTPREL16_HA,
02902   BFD_RELOC_PPC_DTPREL,
02903   BFD_RELOC_PPC_GOT_TLSGD16,
02904   BFD_RELOC_PPC_GOT_TLSGD16_LO,
02905   BFD_RELOC_PPC_GOT_TLSGD16_HI,
02906   BFD_RELOC_PPC_GOT_TLSGD16_HA,
02907   BFD_RELOC_PPC_GOT_TLSLD16,
02908   BFD_RELOC_PPC_GOT_TLSLD16_LO,
02909   BFD_RELOC_PPC_GOT_TLSLD16_HI,
02910   BFD_RELOC_PPC_GOT_TLSLD16_HA,
02911   BFD_RELOC_PPC_GOT_TPREL16,
02912   BFD_RELOC_PPC_GOT_TPREL16_LO,
02913   BFD_RELOC_PPC_GOT_TPREL16_HI,
02914   BFD_RELOC_PPC_GOT_TPREL16_HA,
02915   BFD_RELOC_PPC_GOT_DTPREL16,
02916   BFD_RELOC_PPC_GOT_DTPREL16_LO,
02917   BFD_RELOC_PPC_GOT_DTPREL16_HI,
02918   BFD_RELOC_PPC_GOT_DTPREL16_HA,
02919   BFD_RELOC_PPC64_TPREL16_DS,
02920   BFD_RELOC_PPC64_TPREL16_LO_DS,
02921   BFD_RELOC_PPC64_TPREL16_HIGHER,
02922   BFD_RELOC_PPC64_TPREL16_HIGHERA,
02923   BFD_RELOC_PPC64_TPREL16_HIGHEST,
02924   BFD_RELOC_PPC64_TPREL16_HIGHESTA,
02925   BFD_RELOC_PPC64_DTPREL16_DS,
02926   BFD_RELOC_PPC64_DTPREL16_LO_DS,
02927   BFD_RELOC_PPC64_DTPREL16_HIGHER,
02928   BFD_RELOC_PPC64_DTPREL16_HIGHERA,
02929   BFD_RELOC_PPC64_DTPREL16_HIGHEST,
02930   BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
02931 
02932 /* IBM 370/390 relocations  */
02933   BFD_RELOC_I370_D12,
02934 
02935 /* The type of reloc used to build a constructor table - at the moment
02936 probably a 32 bit wide absolute relocation, but the target can choose.
02937 It generally does map to one of the other relocation types.  */
02938   BFD_RELOC_CTOR,
02939 
02940 /* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
02941 not stored in the instruction.  */
02942   BFD_RELOC_ARM_PCREL_BRANCH,
02943 
02944 /* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
02945 not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
02946 field in the instruction.  */
02947   BFD_RELOC_ARM_PCREL_BLX,
02948 
02949 /* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
02950 not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
02951 field in the instruction.  */
02952   BFD_RELOC_THUMB_PCREL_BLX,
02953 
02954 /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
02955   BFD_RELOC_ARM_PCREL_CALL,
02956 
02957 /* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
02958   BFD_RELOC_ARM_PCREL_JUMP,
02959 
02960 /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
02961 The lowest bit must be zero and is not stored in the instruction.
02962 Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
02963 "nn" one smaller in all cases.  Note further that BRANCH23
02964 corresponds to R_ARM_THM_CALL.  */
02965   BFD_RELOC_THUMB_PCREL_BRANCH7,
02966   BFD_RELOC_THUMB_PCREL_BRANCH9,
02967   BFD_RELOC_THUMB_PCREL_BRANCH12,
02968   BFD_RELOC_THUMB_PCREL_BRANCH20,
02969   BFD_RELOC_THUMB_PCREL_BRANCH23,
02970   BFD_RELOC_THUMB_PCREL_BRANCH25,
02971 
02972 /* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
02973   BFD_RELOC_ARM_OFFSET_IMM,
02974 
02975 /* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
02976   BFD_RELOC_ARM_THUMB_OFFSET,
02977 
02978 /* Pc-relative or absolute relocation depending on target.  Used for
02979 entries in .init_array sections.  */
02980   BFD_RELOC_ARM_TARGET1,
02981 
02982 /* Read-only segment base relative address.  */
02983   BFD_RELOC_ARM_ROSEGREL32,
02984 
02985 /* Data segment base relative address.  */
02986   BFD_RELOC_ARM_SBREL32,
02987 
02988 /* This reloc is used for references to RTTI data from exception handling
02989 tables.  The actual definition depends on the target.  It may be a
02990 pc-relative or some form of GOT-indirect relocation.  */
02991   BFD_RELOC_ARM_TARGET2,
02992 
02993 /* 31-bit PC relative address.  */
02994   BFD_RELOC_ARM_PREL31,
02995 
02996 /* Low and High halfword relocations for MOVW and MOVT instructions.  */
02997   BFD_RELOC_ARM_MOVW,
02998   BFD_RELOC_ARM_MOVT,
02999   BFD_RELOC_ARM_MOVW_PCREL,
03000   BFD_RELOC_ARM_MOVT_PCREL,
03001   BFD_RELOC_ARM_THUMB_MOVW,
03002   BFD_RELOC_ARM_THUMB_MOVT,
03003   BFD_RELOC_ARM_THUMB_MOVW_PCREL,
03004   BFD_RELOC_ARM_THUMB_MOVT_PCREL,
03005 
03006 /* Relocations for setting up GOTs and PLTs for shared libraries.  */
03007   BFD_RELOC_ARM_JUMP_SLOT,
03008   BFD_RELOC_ARM_GLOB_DAT,
03009   BFD_RELOC_ARM_GOT32,
03010   BFD_RELOC_ARM_PLT32,
03011   BFD_RELOC_ARM_RELATIVE,
03012   BFD_RELOC_ARM_GOTOFF,
03013   BFD_RELOC_ARM_GOTPC,
03014 
03015 /* ARM thread-local storage relocations.  */
03016   BFD_RELOC_ARM_TLS_GD32,
03017   BFD_RELOC_ARM_TLS_LDO32,
03018   BFD_RELOC_ARM_TLS_LDM32,
03019   BFD_RELOC_ARM_TLS_DTPOFF32,
03020   BFD_RELOC_ARM_TLS_DTPMOD32,
03021   BFD_RELOC_ARM_TLS_TPOFF32,
03022   BFD_RELOC_ARM_TLS_IE32,
03023   BFD_RELOC_ARM_TLS_LE32,
03024 
03025 /* ARM group relocations.  */
03026   BFD_RELOC_ARM_ALU_PC_G0_NC,
03027   BFD_RELOC_ARM_ALU_PC_G0,
03028   BFD_RELOC_ARM_ALU_PC_G1_NC,
03029   BFD_RELOC_ARM_ALU_PC_G1,
03030   BFD_RELOC_ARM_ALU_PC_G2,
03031   BFD_RELOC_ARM_LDR_PC_G0,
03032   BFD_RELOC_ARM_LDR_PC_G1,
03033   BFD_RELOC_ARM_LDR_PC_G2,
03034   BFD_RELOC_ARM_LDRS_PC_G0,
03035   BFD_RELOC_ARM_LDRS_PC_G1,
03036   BFD_RELOC_ARM_LDRS_PC_G2,
03037   BFD_RELOC_ARM_LDC_PC_G0,
03038   BFD_RELOC_ARM_LDC_PC_G1,
03039   BFD_RELOC_ARM_LDC_PC_G2,
03040   BFD_RELOC_ARM_ALU_SB_G0_NC,
03041   BFD_RELOC_ARM_ALU_SB_G0,
03042   BFD_RELOC_ARM_ALU_SB_G1_NC,
03043   BFD_RELOC_ARM_ALU_SB_G1,
03044   BFD_RELOC_ARM_ALU_SB_G2,
03045   BFD_RELOC_ARM_LDR_SB_G0,
03046   BFD_RELOC_ARM_LDR_SB_G1,
03047   BFD_RELOC_ARM_LDR_SB_G2,
03048   BFD_RELOC_ARM_LDRS_SB_G0,
03049   BFD_RELOC_ARM_LDRS_SB_G1,
03050   BFD_RELOC_ARM_LDRS_SB_G2,
03051   BFD_RELOC_ARM_LDC_SB_G0,
03052   BFD_RELOC_ARM_LDC_SB_G1,
03053   BFD_RELOC_ARM_LDC_SB_G2,
03054 
03055 /* These relocs are only used within the ARM assembler.  They are not
03056 (at present) written to any object files.  */
03057   BFD_RELOC_ARM_IMMEDIATE,
03058   BFD_RELOC_ARM_ADRL_IMMEDIATE,
03059   BFD_RELOC_ARM_T32_IMMEDIATE,
03060   BFD_RELOC_ARM_T32_ADD_IMM,
03061   BFD_RELOC_ARM_T32_IMM12,
03062   BFD_RELOC_ARM_T32_ADD_PC12,
03063   BFD_RELOC_ARM_SHIFT_IMM,
03064   BFD_RELOC_ARM_SMC,
03065   BFD_RELOC_ARM_SWI,
03066   BFD_RELOC_ARM_MULTI,
03067   BFD_RELOC_ARM_CP_OFF_IMM,
03068   BFD_RELOC_ARM_CP_OFF_IMM_S2,
03069   BFD_RELOC_ARM_T32_CP_OFF_IMM,
03070   BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
03071   BFD_RELOC_ARM_ADR_IMM,
03072   BFD_RELOC_ARM_LDR_IMM,
03073   BFD_RELOC_ARM_LITERAL,
03074   BFD_RELOC_ARM_IN_POOL,
03075   BFD_RELOC_ARM_OFFSET_IMM8,
03076   BFD_RELOC_ARM_T32_OFFSET_U8,
03077   BFD_RELOC_ARM_T32_OFFSET_IMM,
03078   BFD_RELOC_ARM_HWLITERAL,
03079   BFD_RELOC_ARM_THUMB_ADD,
03080   BFD_RELOC_ARM_THUMB_IMM,
03081   BFD_RELOC_ARM_THUMB_SHIFT,
03082 
03083 /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
03084   BFD_RELOC_SH_PCDISP8BY2,
03085   BFD_RELOC_SH_PCDISP12BY2,
03086   BFD_RELOC_SH_IMM3,
03087   BFD_RELOC_SH_IMM3U,
03088   BFD_RELOC_SH_DISP12,
03089   BFD_RELOC_SH_DISP12BY2,
03090   BFD_RELOC_SH_DISP12BY4,
03091   BFD_RELOC_SH_DISP12BY8,
03092   BFD_RELOC_SH_DISP20,
03093   BFD_RELOC_SH_DISP20BY8,
03094   BFD_RELOC_SH_IMM4,
03095   BFD_RELOC_SH_IMM4BY2,
03096   BFD_RELOC_SH_IMM4BY4,
03097   BFD_RELOC_SH_IMM8,
03098   BFD_RELOC_SH_IMM8BY2,
03099   BFD_RELOC_SH_IMM8BY4,
03100   BFD_RELOC_SH_PCRELIMM8BY2,
03101   BFD_RELOC_SH_PCRELIMM8BY4,
03102   BFD_RELOC_SH_SWITCH16,
03103   BFD_RELOC_SH_SWITCH32,
03104   BFD_RELOC_SH_USES,
03105   BFD_RELOC_SH_COUNT,
03106   BFD_RELOC_SH_ALIGN,
03107   BFD_RELOC_SH_CODE,
03108   BFD_RELOC_SH_DATA,
03109   BFD_RELOC_SH_LABEL,
03110   BFD_RELOC_SH_LOOP_START,
03111   BFD_RELOC_SH_LOOP_END,
03112   BFD_RELOC_SH_COPY,
03113   BFD_RELOC_SH_GLOB_DAT,
03114   BFD_RELOC_SH_JMP_SLOT,
03115   BFD_RELOC_SH_RELATIVE,
03116   BFD_RELOC_SH_GOTPC,
03117   BFD_RELOC_SH_GOT_LOW16,
03118   BFD_RELOC_SH_GOT_MEDLOW16,
03119   BFD_RELOC_SH_GOT_MEDHI16,
03120   BFD_RELOC_SH_GOT_HI16,
03121   BFD_RELOC_SH_GOTPLT_LOW16,
03122   BFD_RELOC_SH_GOTPLT_MEDLOW16,
03123   BFD_RELOC_SH_GOTPLT_MEDHI16,
03124   BFD_RELOC_SH_GOTPLT_HI16,
03125   BFD_RELOC_SH_PLT_LOW16,
03126   BFD_RELOC_SH_PLT_MEDLOW16,
03127   BFD_RELOC_SH_PLT_MEDHI16,
03128   BFD_RELOC_SH_PLT_HI16,
03129   BFD_RELOC_SH_GOTOFF_LOW16,
03130   BFD_RELOC_SH_GOTOFF_MEDLOW16,
03131   BFD_RELOC_SH_GOTOFF_MEDHI16,
03132   BFD_RELOC_SH_GOTOFF_HI16,
03133   BFD_RELOC_SH_GOTPC_LOW16,
03134   BFD_RELOC_SH_GOTPC_MEDLOW16,
03135   BFD_RELOC_SH_GOTPC_MEDHI16,
03136   BFD_RELOC_SH_GOTPC_HI16,
03137   BFD_RELOC_SH_COPY64,
03138   BFD_RELOC_SH_GLOB_DAT64,
03139   BFD_RELOC_SH_JMP_SLOT64,
03140   BFD_RELOC_SH_RELATIVE64,
03141   BFD_RELOC_SH_GOT10BY4,
03142   BFD_RELOC_SH_GOT10BY8,
03143   BFD_RELOC_SH_GOTPLT10BY4,
03144   BFD_RELOC_SH_GOTPLT10BY8,
03145   BFD_RELOC_SH_GOTPLT32,
03146   BFD_RELOC_SH_SHMEDIA_CODE,
03147   BFD_RELOC_SH_IMMU5,
03148   BFD_RELOC_SH_IMMS6,
03149   BFD_RELOC_SH_IMMS6BY32,
03150   BFD_RELOC_SH_IMMU6,
03151   BFD_RELOC_SH_IMMS10,
03152   BFD_RELOC_SH_IMMS10BY2,
03153   BFD_RELOC_SH_IMMS10BY4,
03154   BFD_RELOC_SH_IMMS10BY8,
03155   BFD_RELOC_SH_IMMS16,
03156   BFD_RELOC_SH_IMMU16,
03157   BFD_RELOC_SH_IMM_LOW16,
03158   BFD_RELOC_SH_IMM_LOW16_PCREL,
03159   BFD_RELOC_SH_IMM_MEDLOW16,
03160   BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
03161   BFD_RELOC_SH_IMM_MEDHI16,
03162   BFD_RELOC_SH_IMM_MEDHI16_PCREL,
03163   BFD_RELOC_SH_IMM_HI16,
03164   BFD_RELOC_SH_IMM_HI16_PCREL,
03165   BFD_RELOC_SH_PT_16,
03166   BFD_RELOC_SH_TLS_GD_32,
03167   BFD_RELOC_SH_TLS_LD_32,
03168   BFD_RELOC_SH_TLS_LDO_32,
03169   BFD_RELOC_SH_TLS_IE_32,
03170   BFD_RELOC_SH_TLS_LE_32,
03171   BFD_RELOC_SH_TLS_DTPMOD32,
03172   BFD_RELOC_SH_TLS_DTPOFF32,
03173   BFD_RELOC_SH_TLS_TPOFF32,
03174 
03175 /* ARC Cores relocs.
03176 ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
03177 not stored in the instruction.  The high 20 bits are installed in bits 26
03178 through 7 of the instruction.  */
03179   BFD_RELOC_ARC_B22_PCREL,
03180 
03181 /* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
03182 stored in the instruction.  The high 24 bits are installed in bits 23
03183 through 0.  */
03184   BFD_RELOC_ARC_B26,
03185 
03186 /* ADI Blackfin 16 bit immediate absolute reloc.  */
03187   BFD_RELOC_BFIN_16_IMM,
03188 
03189 /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
03190   BFD_RELOC_BFIN_16_HIGH,
03191 
03192 /* ADI Blackfin 'a' part of LSETUP.  */
03193   BFD_RELOC_BFIN_4_PCREL,
03194 
03195 /* ADI Blackfin.  */
03196   BFD_RELOC_BFIN_5_PCREL,
03197 
03198 /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
03199   BFD_RELOC_BFIN_16_LOW,
03200 
03201 /* ADI Blackfin.  */
03202   BFD_RELOC_BFIN_10_PCREL,
03203 
03204 /* ADI Blackfin 'b' part of LSETUP.  */
03205   BFD_RELOC_BFIN_11_PCREL,
03206 
03207 /* ADI Blackfin.  */
03208   BFD_RELOC_BFIN_12_PCREL_JUMP,
03209 
03210 /* ADI Blackfin Short jump, pcrel.  */
03211   BFD_RELOC_BFIN_12_PCREL_JUMP_S,
03212 
03213 /* ADI Blackfin Call.x not implemented.  */
03214   BFD_RELOC_BFIN_24_PCREL_CALL_X,
03215 
03216 /* ADI Blackfin Long Jump pcrel.  */
03217   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
03218 
03219 /* ADI Blackfin FD-PIC relocations.  */
03220   BFD_RELOC_BFIN_GOT17M4,
03221   BFD_RELOC_BFIN_GOTHI,
03222   BFD_RELOC_BFIN_GOTLO,
03223   BFD_RELOC_BFIN_FUNCDESC,
03224   BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
03225   BFD_RELOC_BFIN_FUNCDESC_GOTHI,
03226   BFD_RELOC_BFIN_FUNCDESC_GOTLO,
03227   BFD_RELOC_BFIN_FUNCDESC_VALUE,
03228   BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
03229   BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
03230   BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
03231   BFD_RELOC_BFIN_GOTOFF17M4,
03232   BFD_RELOC_BFIN_GOTOFFHI,
03233   BFD_RELOC_BFIN_GOTOFFLO,
03234 
03235 /* ADI Blackfin GOT relocation.  */
03236   BFD_RELOC_BFIN_GOT,
03237 
03238 /* ADI Blackfin PLTPC relocation.  */
03239   BFD_RELOC_BFIN_PLTPC,
03240 
03241 /* ADI Blackfin arithmetic relocation.  */
03242   BFD_ARELOC_BFIN_PUSH,
03243 
03244 /* ADI Blackfin arithmetic relocation.  */
03245   BFD_ARELOC_BFIN_CONST,
03246 
03247 /* ADI Blackfin arithmetic relocation.  */
03248   BFD_ARELOC_BFIN_ADD,
03249 
03250 /* ADI Blackfin arithmetic relocation.  */
03251   BFD_ARELOC_BFIN_SUB,
03252 
03253 /* ADI Blackfin arithmetic relocation.  */
03254   BFD_ARELOC_BFIN_MULT,
03255 
03256 /* ADI Blackfin arithmetic relocation.  */
03257   BFD_ARELOC_BFIN_DIV,
03258 
03259 /* ADI Blackfin arithmetic relocation.  */
03260   BFD_ARELOC_BFIN_MOD,
03261 
03262 /* ADI Blackfin arithmetic relocation.  */
03263   BFD_ARELOC_BFIN_LSHIFT,
03264 
03265 /* ADI Blackfin arithmetic relocation.  */
03266   BFD_ARELOC_BFIN_RSHIFT,
03267 
03268 /* ADI Blackfin arithmetic relocation.  */
03269   BFD_ARELOC_BFIN_AND,
03270 
03271 /* ADI Blackfin arithmetic relocation.  */
03272   BFD_ARELOC_BFIN_OR,
03273 
03274 /* ADI Blackfin arithmetic relocation.  */
03275   BFD_ARELOC_BFIN_XOR,
03276 
03277 /* ADI Blackfin arithmetic relocation.  */
03278   BFD_ARELOC_BFIN_LAND,
03279 
03280 /* ADI Blackfin arithmetic relocation.  */
03281   BFD_ARELOC_BFIN_LOR,
03282 
03283 /* ADI Blackfin arithmetic relocation.  */
03284   BFD_ARELOC_BFIN_LEN,
03285 
03286 /* ADI Blackfin arithmetic relocation.  */
03287   BFD_ARELOC_BFIN_NEG,
03288 
03289 /* ADI Blackfin arithmetic relocation.  */
03290   BFD_ARELOC_BFIN_COMP,
03291 
03292 /* ADI Blackfin arithmetic relocation.  */
03293   BFD_ARELOC_BFIN_PAGE,
03294 
03295 /* ADI Blackfin arithmetic relocation.  */
03296   BFD_ARELOC_BFIN_HWPAGE,
03297 
03298 /* ADI Blackfin arithmetic relocation.  */
03299   BFD_ARELOC_BFIN_ADDR,
03300 
03301 /* Mitsubishi D10V relocs.
03302 This is a 10-bit reloc with the right 2 bits
03303 assumed to be 0.  */
03304   BFD_RELOC_D10V_10_PCREL_R,
03305 
03306 /* Mitsubishi D10V relocs.
03307 This is a 10-bit reloc with the right 2 bits
03308 assumed to be 0.  This is the same as the previous reloc
03309 except it is in the left container, i.e.,
03310 shifted left 15 bits.  */
03311   BFD_RELOC_D10V_10_PCREL_L,
03312 
03313 /* This is an 18-bit reloc with the right 2 bits
03314 assumed to be 0.  */
03315   BFD_RELOC_D10V_18,
03316 
03317 /* This is an 18-bit reloc with the right 2 bits
03318 assumed to be 0.  */
03319   BFD_RELOC_D10V_18_PCREL,
03320 
03321 /* Mitsubishi D30V relocs.
03322 This is a 6-bit absolute reloc.  */
03323   BFD_RELOC_D30V_6,
03324 
03325 /* This is a 6-bit pc-relative reloc with
03326 the right 3 bits assumed to be 0.  */
03327   BFD_RELOC_D30V_9_PCREL,
03328 
03329 /* This is a 6-bit pc-relative reloc with
03330 the right 3 bits assumed to be 0. Same
03331 as the previous reloc but on the right side
03332 of the container.  */
03333   BFD_RELOC_D30V_9_PCREL_R,
03334 
03335 /* This is a 12-bit absolute reloc with the
03336 right 3 bitsassumed to be 0.  */
03337   BFD_RELOC_D30V_15,
03338 
03339 /* This is a 12-bit pc-relative reloc with
03340 the right 3 bits assumed to be 0.  */
03341   BFD_RELOC_D30V_15_PCREL,
03342 
03343 /* This is a 12-bit pc-relative reloc with
03344 the right 3 bits assumed to be 0. Same
03345 as the previous reloc but on the right side
03346 of the container.  */
03347   BFD_RELOC_D30V_15_PCREL_R,
03348 
03349 /* This is an 18-bit absolute reloc with
03350 the right 3 bits assumed to be 0.  */
03351   BFD_RELOC_D30V_21,
03352 
03353 /* This is an 18-bit pc-relative reloc with
03354 the right 3 bits assumed to be 0.  */
03355   BFD_RELOC_D30V_21_PCREL,
03356 
03357 /* This is an 18-bit pc-relative reloc with
03358 the right 3 bits assumed to be 0. Same
03359 as the previous reloc but on the right side
03360 of the container.  */
03361   BFD_RELOC_D30V_21_PCREL_R,
03362 
03363 /* This is a 32-bit absolute reloc.  */
03364   BFD_RELOC_D30V_32,
03365 
03366 /* This is a 32-bit pc-relative reloc.  */
03367   BFD_RELOC_D30V_32_PCREL,
03368 
03369 /* DLX relocs  */
03370   BFD_RELOC_DLX_HI16_S,
03371 
03372 /* DLX relocs  */
03373   BFD_RELOC_DLX_LO16,
03374 
03375 /* DLX relocs  */
03376   BFD_RELOC_DLX_JMP26,
03377 
03378 /* Renesas M16C/M32C Relocations.  */
03379   BFD_RELOC_M32C_HI8,
03380   BFD_RELOC_M32C_RL_JUMP,
03381   BFD_RELOC_M32C_RL_1ADDR,
03382   BFD_RELOC_M32C_RL_2ADDR,
03383 
03384 /* Renesas M32R (formerly Mitsubishi M32R) relocs.
03385 This is a 24 bit absolute address.  */
03386   BFD_RELOC_M32R_24,
03387 
03388 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
03389   BFD_RELOC_M32R_10_PCREL,
03390 
03391 /* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
03392   BFD_RELOC_M32R_18_PCREL,
03393 
03394 /* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
03395   BFD_RELOC_M32R_26_PCREL,
03396 
03397 /* This is a 16-bit reloc containing the high 16 bits of an address
03398 used when the lower 16 bits are treated as unsigned.  */
03399   BFD_RELOC_M32R_HI16_ULO,
03400 
03401 /* This is a 16-bit reloc containing the high 16 bits of an address
03402 used when the lower 16 bits are treated as signed.  */
03403   BFD_RELOC_M32R_HI16_SLO,
03404 
03405 /* This is a 16-bit reloc containing the lower 16 bits of an address.  */
03406   BFD_RELOC_M32R_LO16,
03407 
03408 /* This is a 16-bit reloc containing the small data area offset for use in
03409 add3, load, and store instructions.  */
03410   BFD_RELOC_M32R_SDA16,
03411 
03412 /* For PIC.  */
03413   BFD_RELOC_M32R_GOT24,
03414   BFD_RELOC_M32R_26_PLTREL,
03415   BFD_RELOC_M32R_COPY,
03416   BFD_RELOC_M32R_GLOB_DAT,
03417   BFD_RELOC_M32R_JMP_SLOT,
03418   BFD_RELOC_M32R_RELATIVE,
03419   BFD_RELOC_M32R_GOTOFF,
03420   BFD_RELOC_M32R_GOTOFF_HI_ULO,
03421   BFD_RELOC_M32R_GOTOFF_HI_SLO,
03422   BFD_RELOC_M32R_GOTOFF_LO,
03423   BFD_RELOC_M32R_GOTPC24,
03424   BFD_RELOC_M32R_GOT16_HI_ULO,
03425   BFD_RELOC_M32R_GOT16_HI_SLO,
03426   BFD_RELOC_M32R_GOT16_LO,
03427   BFD_RELOC_M32R_GOTPC_HI_ULO,
03428   BFD_RELOC_M32R_GOTPC_HI_SLO,
03429   BFD_RELOC_M32R_GOTPC_LO,
03430 
03431 /* This is a 9-bit reloc  */
03432   BFD_RELOC_V850_9_PCREL,
03433 
03434 /* This is a 22-bit reloc  */
03435   BFD_RELOC_V850_22_PCREL,
03436 
03437 /* This is a 16 bit offset from the short data area pointer.  */
03438   BFD_RELOC_V850_SDA_16_16_OFFSET,
03439 
03440 /* This is a 16 bit offset (of which only 15 bits are used) from the
03441 short data area pointer.  */
03442   BFD_RELOC_V850_SDA_15_16_OFFSET,
03443 
03444 /* This is a 16 bit offset from the zero data area pointer.  */
03445   BFD_RELOC_V850_ZDA_16_16_OFFSET,
03446 
03447 /* This is a 16 bit offset (of which only 15 bits are used) from the
03448 zero data area pointer.  */
03449   BFD_RELOC_V850_ZDA_15_16_OFFSET,
03450 
03451 /* This is an 8 bit offset (of which only 6 bits are used) from the
03452 tiny data area pointer.  */
03453   BFD_RELOC_V850_TDA_6_8_OFFSET,
03454 
03455 /* This is an 8bit offset (of which only 7 bits are used) from the tiny
03456 data area pointer.  */
03457   BFD_RELOC_V850_TDA_7_8_OFFSET,
03458 
03459 /* This is a 7 bit offset from the tiny data area pointer.  */
03460   BFD_RELOC_V850_TDA_7_7_OFFSET,
03461 
03462 /* This is a 16 bit offset from the tiny data area pointer.  */
03463   BFD_RELOC_V850_TDA_16_16_OFFSET,
03464 
03465 /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
03466 data area pointer.  */
03467   BFD_RELOC_V850_TDA_4_5_OFFSET,
03468 
03469 /* This is a 4 bit offset from the tiny data area pointer.  */
03470   BFD_RELOC_V850_TDA_4_4_OFFSET,
03471 
03472 /* This is a 16 bit offset from the short data area pointer, with the
03473 bits placed non-contiguously in the instruction.  */
03474   BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
03475 
03476 /* This is a 16 bit offset from the zero data area pointer, with the
03477 bits placed non-contiguously in the instruction.  */
03478   BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
03479 
03480 /* This is a 6 bit offset from the call table base pointer.  */
03481   BFD_RELOC_V850_CALLT_6_7_OFFSET,
03482 
03483 /* This is a 16 bit offset from the call table base pointer.  */
03484   BFD_RELOC_V850_CALLT_16_16_OFFSET,
03485 
03486 /* Used for relaxing indirect function calls.  */
03487   BFD_RELOC_V850_LONGCALL,
03488 
03489 /* Used for relaxing indirect jumps.  */
03490   BFD_RELOC_V850_LONGJUMP,
03491 
03492 /* Used to maintain alignment whilst relaxing.  */
03493   BFD_RELOC_V850_ALIGN,
03494 
03495 /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
03496 instructions.  */
03497   BFD_RELOC_V850_LO16_SPLIT_OFFSET,
03498 
03499 /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
03500 instruction.  */
03501   BFD_RELOC_MN10300_32_PCREL,
03502 
03503 /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
03504 instruction.  */
03505   BFD_RELOC_MN10300_16_PCREL,
03506 
03507 /* This is a 8bit DP reloc for the tms320c30, where the most
03508 significant 8 bits of a 24 bit word are placed into the least
03509 significant 8 bits of the opcode.  */
03510   BFD_RELOC_TIC30_LDP,
03511 
03512 /* This is a 7bit reloc for the tms320c54x, where the least
03513 significant 7 bits of a 16 bit word are placed into the least
03514 significant 7 bits of the opcode.  */
03515   BFD_RELOC_TIC54X_PARTLS7,
03516 
03517 /* This is a 9bit DP reloc for the tms320c54x, where the most
03518 significant 9 bits of a 16 bit word are placed into the least
03519 significant 9 bits of the opcode.  */
03520   BFD_RELOC_TIC54X_PARTMS9,
03521 
03522 /* This is an extended address 23-bit reloc for the tms320c54x.  */
03523   BFD_RELOC_TIC54X_23,
03524 
03525 /* This is a 16-bit reloc for the tms320c54x, where the least
03526 significant 16 bits of a 23-bit extended address are placed into
03527 the opcode.  */
03528   BFD_RELOC_TIC54X_16_OF_23,
03529 
03530 /* This is a reloc for the tms320c54x, where the most
03531 significant 7 bits of a 23-bit extended address are placed into
03532 the opcode.  */
03533   BFD_RELOC_TIC54X_MS7_OF_23,
03534 
03535 /* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
03536   BFD_RELOC_FR30_48,
03537 
03538 /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
03539 two sections.  */
03540   BFD_RELOC_FR30_20,
03541 
03542 /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
03543 4 bits.  */
03544   BFD_RELOC_FR30_6_IN_4,
03545 
03546 /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
03547 into 8 bits.  */
03548   BFD_RELOC_FR30_8_IN_8,
03549 
03550 /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
03551 into 8 bits.  */
03552   BFD_RELOC_FR30_9_IN_8,
03553 
03554 /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
03555 into 8 bits.  */
03556   BFD_RELOC_FR30_10_IN_8,
03557 
03558 /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
03559 short offset into 8 bits.  */
03560   BFD_RELOC_FR30_9_PCREL,
03561 
03562 /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
03563 short offset into 11 bits.  */
03564   BFD_RELOC_FR30_12_PCREL,
03565 
03566 /* Motorola Mcore relocations.  */
03567   BFD_RELOC_MCORE_PCREL_IMM8BY4,
03568   BFD_RELOC_MCORE_PCREL_IMM11BY2,
03569   BFD_RELOC_MCORE_PCREL_IMM4BY2,
03570   BFD_RELOC_MCORE_PCREL_32,
03571   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
03572   BFD_RELOC_MCORE_RVA,
03573 
03574 /* Toshiba Media Processor Relocations.  */
03575   BFD_RELOC_MEP_8,
03576   BFD_RELOC_MEP_16,
03577   BFD_RELOC_MEP_32,
03578   BFD_RELOC_MEP_PCREL8A2,
03579   BFD_RELOC_MEP_PCREL12A2,
03580   BFD_RELOC_MEP_PCREL17A2,
03581   BFD_RELOC_MEP_PCREL24A2,
03582   BFD_RELOC_MEP_PCABS24A2,
03583   BFD_RELOC_MEP_LOW16,
03584   BFD_RELOC_MEP_HI16U,
03585   BFD_RELOC_MEP_HI16S,
03586   BFD_RELOC_MEP_GPREL,
03587   BFD_RELOC_MEP_TPREL,
03588   BFD_RELOC_MEP_TPREL7,
03589   BFD_RELOC_MEP_TPREL7A2,
03590   BFD_RELOC_MEP_TPREL7A4,
03591   BFD_RELOC_MEP_UIMM24,
03592   BFD_RELOC_MEP_ADDR24A4,
03593   BFD_RELOC_MEP_GNU_VTINHERIT,
03594   BFD_RELOC_MEP_GNU_VTENTRY,
03595 
03596 
03597 /* These are relocations for the GETA instruction.  */
03598   BFD_RELOC_MMIX_GETA,
03599   BFD_RELOC_MMIX_GETA_1,
03600   BFD_RELOC_MMIX_GETA_2,
03601   BFD_RELOC_MMIX_GETA_3,
03602 
03603 /* These are relocations for a conditional branch instruction.  */
03604   BFD_RELOC_MMIX_CBRANCH,
03605   BFD_RELOC_MMIX_CBRANCH_J,
03606   BFD_RELOC_MMIX_CBRANCH_1,
03607   BFD_RELOC_MMIX_CBRANCH_2,
03608   BFD_RELOC_MMIX_CBRANCH_3,
03609 
03610 /* These are relocations for the PUSHJ instruction.  */
03611   BFD_RELOC_MMIX_PUSHJ,
03612   BFD_RELOC_MMIX_PUSHJ_1,
03613   BFD_RELOC_MMIX_PUSHJ_2,
03614   BFD_RELOC_MMIX_PUSHJ_3,
03615   BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
03616 
03617 /* These are relocations for the JMP instruction.  */
03618   BFD_RELOC_MMIX_JMP,
03619   BFD_RELOC_MMIX_JMP_1,
03620   BFD_RELOC_MMIX_JMP_2,
03621   BFD_RELOC_MMIX_JMP_3,
03622 
03623 /* This is a relocation for a relative address as in a GETA instruction or
03624 a branch.  */
03625   BFD_RELOC_MMIX_ADDR19,
03626 
03627 /* This is a relocation for a relative address as in a JMP instruction.  */
03628   BFD_RELOC_MMIX_ADDR27,
03629 
03630 /* This is a relocation for an instruction field that may be a general
03631 register or a value 0..255.  */
03632   BFD_RELOC_MMIX_REG_OR_BYTE,
03633 
03634 /* This is a relocation for an instruction field that may be a general
03635 register.  */
03636   BFD_RELOC_MMIX_REG,
03637 
03638 /* This is a relocation for two instruction fields holding a register and
03639 an offset, the equivalent of the relocation.  */
03640   BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
03641 
03642 /* This relocation is an assertion that the expression is not allocated as
03643 a global register.  It does not modify contents.  */
03644   BFD_RELOC_MMIX_LOCAL,
03645 
03646 /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
03647 short offset into 7 bits.  */
03648   BFD_RELOC_AVR_7_PCREL,
03649 
03650 /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
03651 short offset into 12 bits.  */
03652   BFD_RELOC_AVR_13_PCREL,
03653 
03654 /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
03655 program memory address) into 16 bits.  */
03656   BFD_RELOC_AVR_16_PM,
03657 
03658 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
03659 data memory address) into 8 bit immediate value of LDI insn.  */
03660   BFD_RELOC_AVR_LO8_LDI,
03661 
03662 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
03663 of data memory address) into 8 bit immediate value of LDI insn.  */
03664   BFD_RELOC_AVR_HI8_LDI,
03665 
03666 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
03667 of program memory address) into 8 bit immediate value of LDI insn.  */
03668   BFD_RELOC_AVR_HH8_LDI,
03669 
03670 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
03671 of 32 bit value) into 8 bit immediate value of LDI insn.  */
03672   BFD_RELOC_AVR_MS8_LDI,
03673 
03674 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03675 (usually data memory address) into 8 bit immediate value of SUBI insn.  */
03676   BFD_RELOC_AVR_LO8_LDI_NEG,
03677 
03678 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03679 (high 8 bit of data memory address) into 8 bit immediate value of
03680 SUBI insn.  */
03681   BFD_RELOC_AVR_HI8_LDI_NEG,
03682 
03683 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03684 (most high 8 bit of program memory address) into 8 bit immediate value
03685 of LDI or SUBI insn.  */
03686   BFD_RELOC_AVR_HH8_LDI_NEG,
03687 
03688 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
03689 of 32 bit value) into 8 bit immediate value of LDI insn.  */
03690   BFD_RELOC_AVR_MS8_LDI_NEG,
03691 
03692 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
03693 command address) into 8 bit immediate value of LDI insn.  */
03694   BFD_RELOC_AVR_LO8_LDI_PM,
03695 
03696 /* This is a 16 bit reloc for the AVR that stores 8 bit value 
03697 (command address) into 8 bit immediate value of LDI insn. If the address
03698 is beyond the 128k boundary, the linker inserts a jump stub for this reloc
03699 in the lower 128k.  */
03700   BFD_RELOC_AVR_LO8_LDI_GS,
03701 
03702 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
03703 of command address) into 8 bit immediate value of LDI insn.  */
03704   BFD_RELOC_AVR_HI8_LDI_PM,
03705 
03706 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
03707 of command address) into 8 bit immediate value of LDI insn.  If the address
03708 is beyond the 128k boundary, the linker inserts a jump stub for this reloc
03709 below 128k.  */
03710   BFD_RELOC_AVR_HI8_LDI_GS,
03711 
03712 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
03713 of command address) into 8 bit immediate value of LDI insn.  */
03714   BFD_RELOC_AVR_HH8_LDI_PM,
03715 
03716 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03717 (usually command address) into 8 bit immediate value of SUBI insn.  */
03718   BFD_RELOC_AVR_LO8_LDI_PM_NEG,
03719 
03720 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03721 (high 8 bit of 16 bit command address) into 8 bit immediate value
03722 of SUBI insn.  */
03723   BFD_RELOC_AVR_HI8_LDI_PM_NEG,
03724 
03725 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
03726 (high 6 bit of 22 bit command address) into 8 bit immediate
03727 value of SUBI insn.  */
03728   BFD_RELOC_AVR_HH8_LDI_PM_NEG,
03729 
03730 /* This is a 32 bit reloc for the AVR that stores 23 bit value
03731 into 22 bits.  */
03732   BFD_RELOC_AVR_CALL,
03733 
03734 /* This is a 16 bit reloc for the AVR that stores all needed bits
03735 for absolute addressing with ldi with overflow check to linktime  */
03736   BFD_RELOC_AVR_LDI,
03737 
03738 /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
03739 instructions  */
03740   BFD_RELOC_AVR_6,
03741 
03742 /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
03743 instructions  */
03744   BFD_RELOC_AVR_6_ADIW,
03745 
03746 /* Direct 12 bit.  */
03747   BFD_RELOC_390_12,
03748 
03749 /* 12 bit GOT offset.  */
03750   BFD_RELOC_390_GOT12,
03751 
03752 /* 32 bit PC relative PLT address.  */
03753   BFD_RELOC_390_PLT32,
03754 
03755 /* Copy symbol at runtime.  */
03756   BFD_RELOC_390_COPY,
03757 
03758 /* Create GOT entry.  */
03759   BFD_RELOC_390_GLOB_DAT,
03760 
03761 /* Create PLT entry.  */
03762   BFD_RELOC_390_JMP_SLOT,
03763 
03764 /* Adjust by program base.  */
03765   BFD_RELOC_390_RELATIVE,
03766 
03767 /* 32 bit PC relative offset to GOT.  */
03768   BFD_RELOC_390_GOTPC,
03769 
03770 /* 16 bit GOT offset.  */
03771   BFD_RELOC_390_GOT16,
03772 
03773 /* PC relative 16 bit shifted by 1.  */
03774   BFD_RELOC_390_PC16DBL,
03775 
03776 /* 16 bit PC rel. PLT shifted by 1.  */
03777   BFD_RELOC_390_PLT16DBL,
03778 
03779 /* PC relative 32 bit shifted by 1.  */
03780   BFD_RELOC_390_PC32DBL,
03781 
03782 /* 32 bit PC rel. PLT shifted by 1.  */
03783   BFD_RELOC_390_PLT32DBL,
03784 
03785 /* 32 bit PC rel. GOT shifted by 1.  */
03786   BFD_RELOC_390_GOTPCDBL,
03787 
03788 /* 64 bit GOT offset.  */
03789   BFD_RELOC_390_GOT64,
03790 
03791 /* 64 bit PC relative PLT address.  */
03792   BFD_RELOC_390_PLT64,
03793 
03794 /* 32 bit rel. offset to GOT entry.  */
03795   BFD_RELOC_390_GOTENT,
03796 
03797 /* 64 bit offset to GOT.  */
03798   BFD_RELOC_390_GOTOFF64,
03799 
03800 /* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
03801   BFD_RELOC_390_GOTPLT12,
03802 
03803 /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
03804   BFD_RELOC_390_GOTPLT16,
03805 
03806 /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
03807   BFD_RELOC_390_GOTPLT32,
03808 
03809 /* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
03810   BFD_RELOC_390_GOTPLT64,
03811 
03812 /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
03813   BFD_RELOC_390_GOTPLTENT,
03814 
03815 /* 16-bit rel. offset from the GOT to a PLT entry.  */
03816   BFD_RELOC_390_PLTOFF16,
03817 
03818 /* 32-bit rel. offset from the GOT to a PLT entry.  */
03819   BFD_RELOC_390_PLTOFF32,
03820 
03821 /* 64-bit rel. offset from the GOT to a PLT entry.  */
03822   BFD_RELOC_390_PLTOFF64,
03823 
03824 /* s390 tls relocations.  */
03825   BFD_RELOC_390_TLS_LOAD,
03826   BFD_RELOC_390_TLS_GDCALL,
03827   BFD_RELOC_390_TLS_LDCALL,
03828   BFD_RELOC_390_TLS_GD32,
03829   BFD_RELOC_390_TLS_GD64,
03830   BFD_RELOC_390_TLS_GOTIE12,
03831   BFD_RELOC_390_TLS_GOTIE32,
03832   BFD_RELOC_390_TLS_GOTIE64,
03833   BFD_RELOC_390_TLS_LDM32,
03834   BFD_RELOC_390_TLS_LDM64,
03835   BFD_RELOC_390_TLS_IE32,
03836   BFD_RELOC_390_TLS_IE64,
03837   BFD_RELOC_390_TLS_IEENT,
03838   BFD_RELOC_390_TLS_LE32,
03839   BFD_RELOC_390_TLS_LE64,
03840   BFD_RELOC_390_TLS_LDO32,
03841   BFD_RELOC_390_TLS_LDO64,
03842   BFD_RELOC_390_TLS_DTPMOD,
03843   BFD_RELOC_390_TLS_DTPOFF,
03844   BFD_RELOC_390_TLS_TPOFF,
03845 
03846 /* Long displacement extension.  */
03847   BFD_RELOC_390_20,
03848   BFD_RELOC_390_GOT20,
03849   BFD_RELOC_390_GOTPLT20,
03850   BFD_RELOC_390_TLS_GOTIE20,
03851 
03852 /* Score relocations  */
03853   BFD_RELOC_SCORE_DUMMY1,
03854 
03855 /* Low 16 bit for load/store  */
03856   BFD_RELOC_SCORE_GPREL15,
03857 
03858 /* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
03859   BFD_RELOC_SCORE_DUMMY2,
03860   BFD_RELOC_SCORE_JMP,
03861 
03862 /* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
03863   BFD_RELOC_SCORE_BRANCH,
03864 
03865 /* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
03866   BFD_RELOC_SCORE16_JMP,
03867 
03868 /* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
03869   BFD_RELOC_SCORE16_BRANCH,
03870 
03871 /* Undocumented Score relocs  */
03872   BFD_RELOC_SCORE_GOT15,
03873   BFD_RELOC_SCORE_GOT_LO16,
03874   BFD_RELOC_SCORE_CALL15,
03875   BFD_RELOC_SCORE_DUMMY_HI16,
03876 
03877 /* Scenix IP2K - 9-bit register number / data address  */
03878   BFD_RELOC_IP2K_FR9,
03879 
03880 /* Scenix IP2K - 4-bit register/data bank number  */
03881   BFD_RELOC_IP2K_BANK,
03882 
03883 /* Scenix IP2K - low 13 bits of instruction word address  */
03884   BFD_RELOC_IP2K_ADDR16CJP,
03885 
03886 /* Scenix IP2K - high 3 bits of instruction word address  */
03887   BFD_RELOC_IP2K_PAGE3,
03888 
03889 /* Scenix IP2K - ext/low/high 8 bits of data address  */
03890   BFD_RELOC_IP2K_LO8DATA,
03891   BFD_RELOC_IP2K_HI8DATA,
03892   BFD_RELOC_IP2K_EX8DATA,
03893 
03894 /* Scenix IP2K - low/high 8 bits of instruction word address  */
03895   BFD_RELOC_IP2K_LO8INSN,
03896   BFD_RELOC_IP2K_HI8INSN,
03897 
03898 /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
03899   BFD_RELOC_IP2K_PC_SKIP,
03900 
03901 /* Scenix IP2K - 16 bit word address in text section.  */
03902   BFD_RELOC_IP2K_TEXT,
03903 
03904 /* Scenix IP2K - 7-bit sp or dp offset  */
03905   BFD_RELOC_IP2K_FR_OFFSET,
03906 
03907 /* Scenix VPE4K coprocessor - data/insn-space addressing  */
03908   BFD_RELOC_VPE4KMATH_DATA,
03909   BFD_RELOC_VPE4KMATH_INSN,
03910 
03911 /* These two relocations are used by the linker to determine which of
03912 the entries in a C++ virtual function table are actually used.  When
03913 the --gc-sections option is given, the linker will zero out the entries
03914 that are not used, so that the code for those functions need not be
03915 included in the output.
03916 
03917 VTABLE_INHERIT is a zero-space relocation used to describe to the
03918 linker the inheritance tree of a C++ virtual function table.  The
03919 relocation's symbol should be the parent class' vtable, and the
03920 relocation should be located at the child vtable.
03921 
03922 VTABLE_ENTRY is a zero-space relocation that describes the use of a
03923 virtual function table entry.  The reloc's symbol should refer to the
03924 table of the class mentioned in the code.  Off of that base, an offset
03925 describes the entry that is being used.  For Rela hosts, this offset
03926 is stored in the reloc's addend.  For Rel hosts, we are forced to put
03927 this offset in the reloc's section offset.  */
03928   BFD_RELOC_VTABLE_INHERIT,
03929   BFD_RELOC_VTABLE_ENTRY,
03930 
03931 /* Intel IA64 Relocations.  */
03932   BFD_RELOC_IA64_IMM14,
03933   BFD_RELOC_IA64_IMM22,
03934   BFD_RELOC_IA64_IMM64,
03935   BFD_RELOC_IA64_DIR32MSB,
03936   BFD_RELOC_IA64_DIR32LSB,
03937   BFD_RELOC_IA64_DIR64MSB,
03938   BFD_RELOC_IA64_DIR64LSB,
03939   BFD_RELOC_IA64_GPREL22,
03940   BFD_RELOC_IA64_GPREL64I,
03941   BFD_RELOC_IA64_GPREL32MSB,
03942   BFD_RELOC_IA64_GPREL32LSB,
03943   BFD_RELOC_IA64_GPREL64MSB,
03944   BFD_RELOC_IA64_GPREL64LSB,
03945   BFD_RELOC_IA64_LTOFF22,
03946   BFD_RELOC_IA64_LTOFF64I,
03947   BFD_RELOC_IA64_PLTOFF22,
03948   BFD_RELOC_IA64_PLTOFF64I,
03949   BFD_RELOC_IA64_PLTOFF64MSB,
03950   BFD_RELOC_IA64_PLTOFF64LSB,
03951   BFD_RELOC_IA64_FPTR64I,
03952   BFD_RELOC_IA64_FPTR32MSB,
03953   BFD_RELOC_IA64_FPTR32LSB,
03954   BFD_RELOC_IA64_FPTR64MSB,
03955   BFD_RELOC_IA64_FPTR64LSB,
03956   BFD_RELOC_IA64_PCREL21B,
03957   BFD_RELOC_IA64_PCREL21BI,
03958   BFD_RELOC_IA64_PCREL21M,
03959   BFD_RELOC_IA64_PCREL21F,
03960   BFD_RELOC_IA64_PCREL22,
03961   BFD_RELOC_IA64_PCREL60B,
03962   BFD_RELOC_IA64_PCREL64I,
03963   BFD_RELOC_IA64_PCREL32MSB,
03964   BFD_RELOC_IA64_PCREL32LSB,
03965   BFD_RELOC_IA64_PCREL64MSB,
03966   BFD_RELOC_IA64_PCREL64LSB,
03967   BFD_RELOC_IA64_LTOFF_FPTR22,
03968   BFD_RELOC_IA64_LTOFF_FPTR64I,
03969   BFD_RELOC_IA64_LTOFF_FPTR32MSB,
03970   BFD_RELOC_IA64_LTOFF_FPTR32LSB,
03971   BFD_RELOC_IA64_LTOFF_FPTR64MSB,
03972   BFD_RELOC_IA64_LTOFF_FPTR64LSB,
03973   BFD_RELOC_IA64_SEGREL32MSB,
03974   BFD_RELOC_IA64_SEGREL32LSB,
03975   BFD_RELOC_IA64_SEGREL64MSB,
03976   BFD_RELOC_IA64_SEGREL64LSB,
03977   BFD_RELOC_IA64_SECREL32MSB,
03978   BFD_RELOC_IA64_SECREL32LSB,
03979   BFD_RELOC_IA64_SECREL64MSB,
03980   BFD_RELOC_IA64_SECREL64LSB,
03981   BFD_RELOC_IA64_REL32MSB,
03982   BFD_RELOC_IA64_REL32LSB,
03983   BFD_RELOC_IA64_REL64MSB,
03984   BFD_RELOC_IA64_REL64LSB,
03985   BFD_RELOC_IA64_LTV32MSB,
03986   BFD_RELOC_IA64_LTV32LSB,
03987   BFD_RELOC_IA64_LTV64MSB,
03988   BFD_RELOC_IA64_LTV64LSB,
03989   BFD_RELOC_IA64_IPLTMSB,
03990   BFD_RELOC_IA64_IPLTLSB,
03991   BFD_RELOC_IA64_COPY,
03992   BFD_RELOC_IA64_LTOFF22X,
03993   BFD_RELOC_IA64_LDXMOV,
03994   BFD_RELOC_IA64_TPREL14,
03995   BFD_RELOC_IA64_TPREL22,
03996   BFD_RELOC_IA64_TPREL64I,
03997   BFD_RELOC_IA64_TPREL64MSB,
03998   BFD_RELOC_IA64_TPREL64LSB,
03999   BFD_RELOC_IA64_LTOFF_TPREL22,
04000   BFD_RELOC_IA64_DTPMOD64MSB,
04001   BFD_RELOC_IA64_DTPMOD64LSB,
04002   BFD_RELOC_IA64_LTOFF_DTPMOD22,
04003   BFD_RELOC_IA64_DTPREL14,
04004   BFD_RELOC_IA64_DTPREL22,
04005   BFD_RELOC_IA64_DTPREL64I,
04006   BFD_RELOC_IA64_DTPREL32MSB,
04007   BFD_RELOC_IA64_DTPREL32LSB,
04008   BFD_RELOC_IA64_DTPREL64MSB,
04009   BFD_RELOC_IA64_DTPREL64LSB,
04010   BFD_RELOC_IA64_LTOFF_DTPREL22,
04011 
04012 /* Motorola 68HC11 reloc.
04013 This is the 8 bit high part of an absolute address.  */
04014   BFD_RELOC_M68HC11_HI8,
04015 
04016 /* Motorola 68HC11 reloc.
04017 This is the 8 bit low part of an absolute address.  */
04018   BFD_RELOC_M68HC11_LO8,
04019 
04020 /* Motorola 68HC11 reloc.
04021 This is the 3 bit of a value.  */
04022   BFD_RELOC_M68HC11_3B,
04023 
04024 /* Motorola 68HC11 reloc.
04025 This reloc marks the beginning of a jump/call instruction.
04026 It is used for linker relaxation to correctly identify beginning
04027 of instruction and change some branches to use PC-relative
04028 addressing mode.  */
04029   BFD_RELOC_M68HC11_RL_JUMP,
04030 
04031 /* Motorola 68HC11 reloc.
04032 This reloc marks a group of several instructions that gcc generates
04033 and for which the linker relaxation pass can modify and/or remove
04034 some of them.  */
04035   BFD_RELOC_M68HC11_RL_GROUP,
04036 
04037 /* Motorola 68HC11 reloc.
04038 This is the 16-bit lower part of an address.  It is used for 'call'
04039 instruction to specify the symbol address without any special
04040 transformation (due to memory bank window).  */
04041   BFD_RELOC_M68HC11_LO16,
04042 
04043 /* Motorola 68HC11 reloc.
04044 This is a 8-bit reloc that specifies the page number of an address.
04045 It is used by 'call' instruction to specify the page number of
04046 the symbol.  */
04047   BFD_RELOC_M68HC11_PAGE,
04048 
04049 /* Motorola 68HC11 reloc.
04050 This is a 24-bit reloc that represents the address with a 16-bit
04051 value and a 8-bit page number.  The symbol address is transformed
04052 to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
04053   BFD_RELOC_M68HC11_24,
04054 
04055 /* Motorola 68HC12 reloc.
04056 This is the 5 bits of a value.  */
04057   BFD_RELOC_M68HC12_5B,
04058 
04059 /* NS CR16C Relocations.  */
04060   BFD_RELOC_16C_NUM08,
04061   BFD_RELOC_16C_NUM08_C,
04062   BFD_RELOC_16C_NUM16,
04063   BFD_RELOC_16C_NUM16_C,
04064   BFD_RELOC_16C_NUM32,
04065   BFD_RELOC_16C_NUM32_C,
04066   BFD_RELOC_16C_DISP04,
04067   BFD_RELOC_16C_DISP04_C,
04068   BFD_RELOC_16C_DISP08,
04069   BFD_RELOC_16C_DISP08_C,
04070   BFD_RELOC_16C_DISP16,
04071   BFD_RELOC_16C_DISP16_C,
04072   BFD_RELOC_16C_DISP24,
04073   BFD_RELOC_16C_DISP24_C,
04074   BFD_RELOC_16C_DISP24a,
04075   BFD_RELOC_16C_DISP24a_C,
04076   BFD_RELOC_16C_REG04,
04077   BFD_RELOC_16C_REG04_C,
04078   BFD_RELOC_16C_REG04a,
04079   BFD_RELOC_16C_REG04a_C,
04080   BFD_RELOC_16C_REG14,
04081   BFD_RELOC_16C_REG14_C,
04082   BFD_RELOC_16C_REG16,
04083   BFD_RELOC_16C_REG16_C,
04084   BFD_RELOC_16C_REG20,
04085   BFD_RELOC_16C_REG20_C,
04086   BFD_RELOC_16C_ABS20,
04087   BFD_RELOC_16C_ABS20_C,
04088   BFD_RELOC_16C_ABS24,
04089   BFD_RELOC_16C_ABS24_C,
04090   BFD_RELOC_16C_IMM04,
04091   BFD_RELOC_16C_IMM04_C,
04092   BFD_RELOC_16C_IMM16,
04093   BFD_RELOC_16C_IMM16_C,
04094   BFD_RELOC_16C_IMM20,
04095   BFD_RELOC_16C_IMM20_C,
04096   BFD_RELOC_16C_IMM24,
04097   BFD_RELOC_16C_IMM24_C,
04098   BFD_RELOC_16C_IMM32,
04099   BFD_RELOC_16C_IMM32_C,
04100 
04101 /* NS CRX Relocations.  */
04102   BFD_RELOC_CRX_REL4,
04103   BFD_RELOC_CRX_REL8,
04104   BFD_RELOC_CRX_REL8_CMP,
04105   BFD_RELOC_CRX_REL16,
04106   BFD_RELOC_CRX_REL24,
04107   BFD_RELOC_CRX_REL32,
04108   BFD_RELOC_CRX_REGREL12,
04109   BFD_RELOC_CRX_REGREL22,
04110   BFD_RELOC_CRX_REGREL28,
04111   BFD_RELOC_CRX_REGREL32,
04112   BFD_RELOC_CRX_ABS16,
04113   BFD_RELOC_CRX_ABS32,
04114   BFD_RELOC_CRX_NUM8,
04115   BFD_RELOC_CRX_NUM16,
04116   BFD_RELOC_CRX_NUM32,
04117   BFD_RELOC_CRX_IMM16,
04118   BFD_RELOC_CRX_IMM32,
04119   BFD_RELOC_CRX_SWITCH8,
04120   BFD_RELOC_CRX_SWITCH16,
04121   BFD_RELOC_CRX_SWITCH32,
04122 
04123 /* These relocs are only used within the CRIS assembler.  They are not
04124 (at present) written to any object files.  */
04125   BFD_RELOC_CRIS_BDISP8,
04126   BFD_RELOC_CRIS_UNSIGNED_5,
04127   BFD_RELOC_CRIS_SIGNED_6,
04128   BFD_RELOC_CRIS_UNSIGNED_6,
04129   BFD_RELOC_CRIS_SIGNED_8,
04130   BFD_RELOC_CRIS_UNSIGNED_8,
04131   BFD_RELOC_CRIS_SIGNED_16,
04132   BFD_RELOC_CRIS_UNSIGNED_16,
04133   BFD_RELOC_CRIS_LAPCQ_OFFSET,
04134   BFD_RELOC_CRIS_UNSIGNED_4,
04135 
04136 /* Relocs used in ELF shared libraries for CRIS.  */
04137   BFD_RELOC_CRIS_COPY,
04138   BFD_RELOC_CRIS_GLOB_DAT,
04139   BFD_RELOC_CRIS_JUMP_SLOT,
04140   BFD_RELOC_CRIS_RELATIVE,
04141 
04142 /* 32-bit offset to symbol-entry within GOT.  */
04143   BFD_RELOC_CRIS_32_GOT,
04144 
04145 /* 16-bit offset to symbol-entry within GOT.  */
04146   BFD_RELOC_CRIS_16_GOT,
04147 
04148 /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
04149   BFD_RELOC_CRIS_32_GOTPLT,
04150 
04151 /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
04152   BFD_RELOC_CRIS_16_GOTPLT,
04153 
04154 /* 32-bit offset to symbol, relative to GOT.  */
04155   BFD_RELOC_CRIS_32_GOTREL,
04156 
04157 /* 32-bit offset to symbol with PLT entry, relative to GOT.  */
04158   BFD_RELOC_CRIS_32_PLT_GOTREL,
04159 
04160 /* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
04161   BFD_RELOC_CRIS_32_PLT_PCREL,
04162 
04163 /* Intel i860 Relocations.  */
04164   BFD_RELOC_860_COPY,
04165   BFD_RELOC_860_GLOB_DAT,
04166   BFD_RELOC_860_JUMP_SLOT,
04167   BFD_RELOC_860_RELATIVE,
04168   BFD_RELOC_860_PC26,
04169   BFD_RELOC_860_PLT26,
04170   BFD_RELOC_860_PC16,
04171   BFD_RELOC_860_LOW0,
04172   BFD_RELOC_860_SPLIT0,
04173   BFD_RELOC_860_LOW1,
04174   BFD_RELOC_860_SPLIT1,
04175   BFD_RELOC_860_LOW2,
04176   BFD_RELOC_860_SPLIT2,
04177   BFD_RELOC_860_LOW3,
04178   BFD_RELOC_860_LOGOT0,
04179   BFD_RELOC_860_SPGOT0,
04180   BFD_RELOC_860_LOGOT1,
04181   BFD_RELOC_860_SPGOT1,
04182   BFD_RELOC_860_LOGOTOFF0,
04183   BFD_RELOC_860_SPGOTOFF0,
04184   BFD_RELOC_860_LOGOTOFF1,
04185   BFD_RELOC_860_SPGOTOFF1,
04186   BFD_RELOC_860_LOGOTOFF2,
04187   BFD_RELOC_860_LOGOTOFF3,
04188   BFD_RELOC_860_LOPC,
04189   BFD_RELOC_860_HIGHADJ,
04190   BFD_RELOC_860_HAGOT,
04191   BFD_RELOC_860_HAGOTOFF,
04192   BFD_RELOC_860_HAPC,
04193   BFD_RELOC_860_HIGH,
04194   BFD_RELOC_860_HIGOT,
04195   BFD_RELOC_860_HIGOTOFF,
04196 
04197 /* OpenRISC Relocations.  */
04198   BFD_RELOC_OPENRISC_ABS_26,
04199   BFD_RELOC_OPENRISC_REL_26,
04200 
04201 /* H8 elf Relocations.  */
04202   BFD_RELOC_H8_DIR16A8,
04203   BFD_RELOC_H8_DIR16R8,
04204   BFD_RELOC_H8_DIR24A8,
04205   BFD_RELOC_H8_DIR24R8,
04206   BFD_RELOC_H8_DIR32A16,
04207 
04208 /* Sony Xstormy16 Relocations.  */
04209   BFD_RELOC_XSTORMY16_REL_12,
04210   BFD_RELOC_XSTORMY16_12,
04211   BFD_RELOC_XSTORMY16_24,
04212   BFD_RELOC_XSTORMY16_FPTR16,
04213 
04214 /* Self-describing complex relocations.  */
04215   BFD_RELOC_RELC,
04216 
04217 
04218 /* Infineon Relocations.  */
04219   BFD_RELOC_XC16X_PAG,
04220   BFD_RELOC_XC16X_POF,
04221   BFD_RELOC_XC16X_SEG,
04222   BFD_RELOC_XC16X_SOF,
04223 
04224 /* Relocations used by VAX ELF.  */
04225   BFD_RELOC_VAX_GLOB_DAT,
04226   BFD_RELOC_VAX_JMP_SLOT,
04227   BFD_RELOC_VAX_RELATIVE,
04228 
04229 /* Morpho MT - 16 bit immediate relocation.  */
04230   BFD_RELOC_MT_PC16,
04231 
04232 /* Morpho MT - Hi 16 bits of an address.  */
04233   BFD_RELOC_MT_HI16,
04234 
04235 /* Morpho MT - Low 16 bits of an address.  */
04236   BFD_RELOC_MT_LO16,
04237 
04238 /* Morpho MT - Used to tell the linker which vtable entries are used.  */
04239   BFD_RELOC_MT_GNU_VTINHERIT,
04240 
04241 /* Morpho MT - Used to tell the linker which vtable entries are used.  */
04242   BFD_RELOC_MT_GNU_VTENTRY,
04243 
04244 /* Morpho MT - 8 bit immediate relocation.  */
04245   BFD_RELOC_MT_PCINSN8,
04246 
04247 /* msp430 specific relocation codes  */
04248   BFD_RELOC_MSP430_10_PCREL,
04249   BFD_RELOC_MSP430_16_PCREL,
04250   BFD_RELOC_MSP430_16,
04251   BFD_RELOC_MSP430_16_PCREL_BYTE,
04252   BFD_RELOC_MSP430_16_BYTE,
04253   BFD_RELOC_MSP430_2X_PCREL,
04254   BFD_RELOC_MSP430_RL_PCREL,
04255 
04256 /* IQ2000 Relocations.  */
04257   BFD_RELOC_IQ2000_OFFSET_16,
04258   BFD_RELOC_IQ2000_OFFSET_21,
04259   BFD_RELOC_IQ2000_UHI16,
04260 
04261 /* Special Xtensa relocation used only by PLT entries in ELF shared
04262 objects to indicate that the runtime linker should set the value
04263 to one of its own internal functions or data structures.  */
04264   BFD_RELOC_XTENSA_RTLD,
04265 
04266 /* Xtensa relocations for ELF shared objects.  */
04267   BFD_RELOC_XTENSA_GLOB_DAT,
04268   BFD_RELOC_XTENSA_JMP_SLOT,
04269   BFD_RELOC_XTENSA_RELATIVE,
04270 
04271 /* Xtensa relocation used in ELF object files for symbols that may require
04272 PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
04273   BFD_RELOC_XTENSA_PLT,
04274 
04275 /* Xtensa relocations to mark the difference of two local symbols.
04276 These are only needed to support linker relaxation and can be ignored
04277 when not relaxing.  The field is set to the value of the difference
04278 assuming no relaxation.  The relocation encodes the position of the
04279 first symbol so the linker can determine whether to adjust the field
04280 value.  */
04281   BFD_RELOC_XTENSA_DIFF8,
04282   BFD_RELOC_XTENSA_DIFF16,
04283   BFD_RELOC_XTENSA_DIFF32,
04284 
04285 /* Generic Xtensa relocations for instruction operands.  Only the slot
04286 number is encoded in the relocation.  The relocation applies to the
04287 last PC-relative immediate operand, or if there are no PC-relative
04288 immediates, to the last immediate operand.  */
04289   BFD_RELOC_XTENSA_SLOT0_OP,
04290   BFD_RELOC_XTENSA_SLOT1_OP,
04291   BFD_RELOC_XTENSA_SLOT2_OP,
04292   BFD_RELOC_XTENSA_SLOT3_OP,
04293   BFD_RELOC_XTENSA_SLOT4_OP,
04294   BFD_RELOC_XTENSA_SLOT5_OP,
04295   BFD_RELOC_XTENSA_SLOT6_OP,
04296   BFD_RELOC_XTENSA_SLOT7_OP,
04297   BFD_RELOC_XTENSA_SLOT8_OP,
04298   BFD_RELOC_XTENSA_SLOT9_OP,
04299   BFD_RELOC_XTENSA_SLOT10_OP,
04300   BFD_RELOC_XTENSA_SLOT11_OP,
04301   BFD_RELOC_XTENSA_SLOT12_OP,
04302   BFD_RELOC_XTENSA_SLOT13_OP,
04303   BFD_RELOC_XTENSA_SLOT14_OP,
04304 
04305 /* Alternate Xtensa relocations.  Only the slot is encoded in the
04306 relocation.  The meaning of these relocations is opcode-specific.  */
04307   BFD_RELOC_XTENSA_SLOT0_ALT,
04308   BFD_RELOC_XTENSA_SLOT1_ALT,
04309   BFD_RELOC_XTENSA_SLOT2_ALT,
04310   BFD_RELOC_XTENSA_SLOT3_ALT,
04311   BFD_RELOC_XTENSA_SLOT4_ALT,
04312   BFD_RELOC_XTENSA_SLOT5_ALT,
04313   BFD_RELOC_XTENSA_SLOT6_ALT,
04314   BFD_RELOC_XTENSA_SLOT7_ALT,
04315   BFD_RELOC_XTENSA_SLOT8_ALT,
04316   BFD_RELOC_XTENSA_SLOT9_ALT,
04317   BFD_RELOC_XTENSA_SLOT10_ALT,
04318   BFD_RELOC_XTENSA_SLOT11_ALT,
04319   BFD_RELOC_XTENSA_SLOT12_ALT,
04320   BFD_RELOC_XTENSA_SLOT13_ALT,
04321   BFD_RELOC_XTENSA_SLOT14_ALT,
04322 
04323 /* Xtensa relocations for backward compatibility.  These have all been
04324 replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
04325   BFD_RELOC_XTENSA_OP0,
04326   BFD_RELOC_XTENSA_OP1,
04327   BFD_RELOC_XTENSA_OP2,
04328 
04329 /* Xtensa relocation to mark that the assembler expanded the
04330 instructions from an original target.  The expansion size is
04331 encoded in the reloc size.  */
04332   BFD_RELOC_XTENSA_ASM_EXPAND,
04333 
04334 /* Xtensa relocation to mark that the linker should simplify
04335 assembler-expanded instructions.  This is commonly used
04336 internally by the linker after analysis of a
04337 BFD_RELOC_XTENSA_ASM_EXPAND.  */
04338   BFD_RELOC_XTENSA_ASM_SIMPLIFY,
04339 
04340 /* 8 bit signed offset in (ix+d) or (iy+d).  */
04341   BFD_RELOC_Z80_DISP8,
04342 
04343 /* DJNZ offset.  */
04344   BFD_RELOC_Z8K_DISP7,
04345 
04346 /* CALR offset.  */
04347   BFD_RELOC_Z8K_CALLR,
04348 
04349 /* 4 bit value.  */
04350   BFD_RELOC_Z8K_IMM4L,
04351   BFD_RELOC_UNUSED };
04352 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
04353 reloc_howto_type *bfd_reloc_type_lookup
04354    (bfd *abfd, bfd_reloc_code_real_type code);
04355 reloc_howto_type *bfd_reloc_name_lookup
04356    (bfd *abfd, const char *reloc_name);
04357 
04358 const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
04359 
04360 /* Extracted from syms.c.  */
04361 
04362 typedef struct bfd_symbol
04363 {
04364   /* A pointer to the BFD which owns the symbol. This information
04365      is necessary so that a back end can work out what additional
04366      information (invisible to the application writer) is carried
04367      with the symbol.
04368 
04369      This field is *almost* redundant, since you can use section->owner
04370      instead, except that some symbols point to the global sections
04371      bfd_{abs,com,und}_section.  This could be fixed by making
04372      these globals be per-bfd (or per-target-flavor).  FIXME.  */
04373   struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
04374 
04375   /* The text of the symbol. The name is left alone, and not copied; the
04376      application may not alter it.  */
04377   const char *name;
04378 
04379   /* The value of the symbol.  This really should be a union of a
04380      numeric value with a pointer, since some flags indicate that
04381      a pointer to another symbol is stored here.  */
04382   symvalue value;
04383 
04384   /* Attributes of a symbol.  */
04385 #define BSF_NO_FLAGS    0x00
04386 
04387   /* The symbol has local scope; <<static>> in <<C>>. The value
04388      is the offset into the section of the data.  */
04389 #define BSF_LOCAL      0x01
04390 
04391   /* The symbol has global scope; initialized data in <<C>>. The
04392      value is the offset into the section of the data.  */
04393 #define BSF_GLOBAL     0x02
04394 
04395   /* The symbol has global scope and is exported. The value is
04396      the offset into the section of the data.  */
04397 #define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
04398 
04399   /* A normal C symbol would be one of:
04400      <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
04401      <<BSF_GLOBAL>>.  */
04402 
04403   /* The symbol is a debugging record. The value has an arbitrary
04404      meaning, unless BSF_DEBUGGING_RELOC is also set.  */
04405 #define BSF_DEBUGGING  0x08
04406 
04407   /* The symbol denotes a function entry point.  Used in ELF,
04408      perhaps others someday.  */
04409 #define BSF_FUNCTION    0x10
04410 
04411   /* Used by the linker.  */
04412 #define BSF_KEEP        0x20
04413 #define BSF_KEEP_G      0x40
04414 
04415   /* A weak global symbol, overridable without warnings by
04416      a regular global symbol of the same name.  */
04417 #define BSF_WEAK        0x80
04418 
04419   /* This symbol was created to point to a section, e.g. ELF's
04420      STT_SECTION symbols.  */
04421 #define BSF_SECTION_SYM 0x100
04422 
04423   /* The symbol used to be a common symbol, but now it is
04424      allocated.  */
04425 #define BSF_OLD_COMMON  0x200
04426 
04427   /* The default value for common data.  */
04428 #define BFD_FORT_COMM_DEFAULT_VALUE 0
04429 
04430   /* In some files the type of a symbol sometimes alters its
04431      location in an output file - ie in coff a <<ISFCN>> symbol
04432      which is also <<C_EXT>> symbol appears where it was
04433      declared and not at the end of a section.  This bit is set
04434      by the target BFD part to convey this information.  */
04435 #define BSF_NOT_AT_END    0x400
04436 
04437   /* Signal that the symbol is the label of constructor section.  */
04438 #define BSF_CONSTRUCTOR   0x800
04439 
04440   /* Signal that the symbol is a warning symbol.  The name is a
04441      warning.  The name of the next symbol is the one to warn about;
04442      if a reference is made to a symbol with the same name as the next
04443      symbol, a warning is issued by the linker.  */
04444 #define BSF_WARNING       0x1000
04445 
04446   /* Signal that the symbol is indirect.  This symbol is an indirect
04447      pointer to the symbol with the same name as the next symbol.  */
04448 #define BSF_INDIRECT      0x2000
04449 
04450   /* BSF_FILE marks symbols that contain a file name.  This is used
04451      for ELF STT_FILE symbols.  */
04452 #define BSF_FILE          0x4000
04453 
04454   /* Symbol is from dynamic linking information.  */
04455 #define BSF_DYNAMIC       0x8000
04456 
04457   /* The symbol denotes a data object.  Used in ELF, and perhaps
04458      others someday.  */
04459 #define BSF_OBJECT        0x10000
04460 
04461   /* This symbol is a debugging symbol.  The value is the offset
04462      into the section of the data.  BSF_DEBUGGING should be set
04463      as well.  */
04464 #define BSF_DEBUGGING_RELOC 0x20000
04465 
04466   /* This symbol is thread local.  Used in ELF.  */
04467 #define BSF_THREAD_LOCAL  0x40000
04468 
04469   /* This symbol represents a complex relocation expression,
04470      with the expression tree serialized in the symbol name.  */
04471 #define BSF_RELC 0x80000
04472 
04473   /* This symbol represents a signed complex relocation expression,
04474      with the expression tree serialized in the symbol name.  */
04475 #define BSF_SRELC 0x100000
04476 
04477   flagword flags;
04478 
04479   /* A pointer to the section to which this symbol is
04480      relative.  This will always be non NULL, there are special
04481      sections for undefined and absolute symbols.  */
04482   struct bfd_section *section;
04483 
04484   /* Back end special data.  */
04485   union
04486     {
04487       void *p;
04488       bfd_vma i;
04489     }
04490   udata;
04491 }
04492 asymbol;
04493 
04494 #define bfd_get_symtab_upper_bound(abfd) \
04495      BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
04496 
04497 bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
04498 
04499 bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
04500 
04501 #define bfd_is_local_label_name(abfd, name) \
04502   BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
04503 
04504 bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
04505 
04506 #define bfd_is_target_special_symbol(abfd, sym) \
04507   BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
04508 
04509 #define bfd_canonicalize_symtab(abfd, location) \
04510   BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
04511 
04512 bfd_boolean bfd_set_symtab
04513    (bfd *abfd, asymbol **location, unsigned int count);
04514 
04515 void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
04516 
04517 #define bfd_make_empty_symbol(abfd) \
04518   BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
04519 
04520 asymbol *_bfd_generic_make_empty_symbol (bfd *);
04521 
04522 #define bfd_make_debug_symbol(abfd,ptr,size) \
04523   BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
04524 
04525 int bfd_decode_symclass (asymbol *symbol);
04526 
04527 bfd_boolean bfd_is_undefined_symclass (int symclass);
04528 
04529 void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
04530 
04531 bfd_boolean bfd_copy_private_symbol_data
04532    (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
04533 
04534 #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
04535   BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
04536             (ibfd, isymbol, obfd, osymbol))
04537 
04538 /* Extracted from bfd.c.  */
04539 struct bfd
04540 {
04541   /* A unique identifier of the BFD  */
04542   unsigned int id;
04543 
04544   /* The filename the application opened the BFD with.  */
04545   const char *filename;
04546 
04547   /* A pointer to the target jump table.  */
04548   const struct bfd_target *xvec;
04549 
04550   /* The IOSTREAM, and corresponding IO vector that provide access
04551      to the file backing the BFD.  */
04552   void *iostream;
04553   const struct bfd_iovec *iovec;
04554 
04555   /* Is the file descriptor being cached?  That is, can it be closed as
04556      needed, and re-opened when accessed later?  */
04557   bfd_boolean cacheable;
04558 
04559   /* Marks whether there was a default target specified when the
04560      BFD was opened. This is used to select which matching algorithm
04561      to use to choose the back end.  */
04562   bfd_boolean target_defaulted;
04563 
04564   /* The caching routines use these to maintain a
04565      least-recently-used list of BFDs.  */
04566   struct bfd *lru_prev, *lru_next;
04567 
04568   /* When a file is closed by the caching routines, BFD retains
04569      state information on the file here...  */
04570   ufile_ptr where;
04571 
04572   /* ... and here: (``once'' means at least once).  */
04573   bfd_boolean opened_once;
04574 
04575   /* Set if we have a locally maintained mtime value, rather than
04576      getting it from the file each time.  */
04577   bfd_boolean mtime_set;
04578 
04579   /* File modified time, if mtime_set is TRUE.  */
04580   long mtime;
04581 
04582   /* Reserved for an unimplemented file locking extension.  */
04583   int ifd;
04584 
04585   /* The format which belongs to the BFD. (object, core, etc.)  */
04586   bfd_format format;
04587 
04588   /* The direction with which the BFD was opened.  */
04589   enum bfd_direction
04590     {
04591       no_direction = 0,
04592       read_direction = 1,
04593       write_direction = 2,
04594       both_direction = 3
04595     }
04596   direction;
04597 
04598   /* Format_specific flags.  */
04599   flagword flags;
04600 
04601   /* Currently my_archive is tested before adding origin to
04602      anything. I believe that this can become always an add of
04603      origin, with origin set to 0 for non archive files.  */
04604   ufile_ptr origin;
04605 
04606   /* Remember when output has begun, to stop strange things
04607      from happening.  */
04608   bfd_boolean output_has_begun;
04609 
04610   /* A hash table for section names.  */
04611   struct bfd_hash_table section_htab;
04612 
04613   /* Pointer to linked list of sections.  */
04614   struct bfd_section *sections;
04615 
04616   /* The last section on the section list.  */
04617   struct bfd_section *section_last;
04618 
04619   /* The number of sections.  */
04620   unsigned int section_count;
04621 
04622   /* Stuff only useful for object files:
04623      The start address.  */
04624   bfd_vma start_address;
04625 
04626   /* Used for input and output.  */
04627   unsigned int symcount;
04628 
04629   /* Symbol table for output BFD (with symcount entries).  */
04630   struct bfd_symbol  **outsymbols;
04631 
04632   /* Used for slurped dynamic symbol tables.  */
04633   unsigned int dynsymcount;
04634 
04635   /* Pointer to structure which contains architecture information.  */
04636   const struct bfd_arch_info *arch_info;
04637 
04638   /* Flag set if symbols from this BFD should not be exported.  */
04639   bfd_boolean no_export;
04640 
04641   /* Stuff only useful for archives.  */
04642   void *arelt_data;
04643   struct bfd *my_archive;      /* The containing archive BFD.  */
04644   struct bfd *next;            /* The next BFD in the archive.  */
04645   struct bfd *archive_head;    /* The first BFD in the archive.  */
04646   bfd_boolean has_armap;
04647 
04648   /* A chain of BFD structures involved in a link.  */
04649   struct bfd *link_next;
04650 
04651   /* A field used by _bfd_generic_link_add_archive_symbols.  This will
04652      be used only for archive elements.  */
04653   int archive_pass;
04654 
04655   /* Used by the back end to hold private data.  */
04656   union
04657     {
04658       struct aout_data_struct *aout_data;
04659       struct artdata *aout_ar_data;
04660       struct _oasys_data *oasys_obj_data;
04661       struct _oasys_ar_data *oasys_ar_data;
04662       struct coff_tdata *coff_obj_data;
04663       struct pe_tdata *pe_obj_data;
04664       struct xcoff_tdata *xcoff_obj_data;
04665       struct ecoff_tdata *ecoff_obj_data;
04666       struct ieee_data_struct *ieee_data;
04667       struct ieee_ar_data_struct *ieee_ar_data;
04668       struct srec_data_struct *srec_data;
04669       struct ihex_data_struct *ihex_data;
04670       struct tekhex_data_struct *tekhex_data;
04671       struct elf_obj_tdata *elf_obj_data;
04672       struct nlm_obj_tdata *nlm_obj_data;
04673       struct bout_data_struct *bout_data;
04674       struct mmo_data_struct *mmo_data;
04675       struct sun_core_struct *sun_core_data;
04676       struct sco5_core_struct *sco5_core_data;
04677       struct trad_core_struct *trad_core_data;
04678       struct som_data_struct *som_data;
04679       struct hpux_core_struct *hpux_core_data;
04680       struct hppabsd_core_struct *hppabsd_core_data;
04681       struct sgi_core_struct *sgi_core_data;
04682       struct lynx_core_struct *lynx_core_data;
04683       struct osf_core_struct *osf_core_data;
04684       struct cisco_core_struct *cisco_core_data;
04685       struct versados_data_struct *versados_data;
04686       struct netbsd_core_struct *netbsd_core_data;
04687       struct mach_o_data_struct *mach_o_data;
04688       struct mach_o_fat_data_struct *mach_o_fat_data;
04689       struct bfd_pef_data_struct *pef_data;
04690       struct bfd_pef_xlib_data_struct *pef_xlib_data;
04691       struct bfd_sym_data_struct *sym_data;
04692       void *any;
04693     }
04694   tdata;
04695 
04696   /* Used by the application to hold private data.  */
04697   void *usrdata;
04698 
04699   /* Where all the allocated stuff under this BFD goes.  This is a
04700      struct objalloc *, but we use void * to avoid requiring the inclusion
04701      of objalloc.h.  */
04702   void *memory;
04703 };
04704 
04705 typedef enum bfd_error
04706 {
04707   bfd_error_no_error = 0,
04708   bfd_error_system_call,
04709   bfd_error_invalid_target,
04710   bfd_error_wrong_format,
04711   bfd_error_wrong_object_format,
04712   bfd_error_invalid_operation,
04713   bfd_error_no_memory,
04714   bfd_error_no_symbols,
04715   bfd_error_no_armap,
04716   bfd_error_no_more_archived_files,
04717   bfd_error_malformed_archive,
04718   bfd_error_file_not_recognized,
04719   bfd_error_file_ambiguously_recognized,
04720   bfd_error_no_contents,
04721   bfd_error_nonrepresentable_section,
04722   bfd_error_no_debug_section,
04723   bfd_error_bad_value,
04724   bfd_error_file_truncated,
04725   bfd_error_file_too_big,
04726   bfd_error_on_input,
04727   bfd_error_invalid_error_code
04728 }
04729 bfd_error_type;
04730 
04731 bfd_error_type bfd_get_error (void);
04732 
04733 void bfd_set_error (bfd_error_type error_tag, ...);
04734 
04735 const char *bfd_errmsg (bfd_error_type error_tag);
04736 
04737 void bfd_perror (const char *message);
04738 
04739 typedef void (*bfd_error_handler_type) (const char *, ...);
04740 
04741 bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
04742 
04743 void bfd_set_error_program_name (const char *);
04744 
04745 bfd_error_handler_type bfd_get_error_handler (void);
04746 
04747 long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
04748 
04749 long bfd_canonicalize_reloc
04750    (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
04751 
04752 void bfd_set_reloc
04753    (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
04754 
04755 bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
04756 
04757 int bfd_get_arch_size (bfd *abfd);
04758 
04759 int bfd_get_sign_extend_vma (bfd *abfd);
04760 
04761 bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
04762 
04763 unsigned int bfd_get_gp_size (bfd *abfd);
04764 
04765 void bfd_set_gp_size (bfd *abfd, unsigned int i);
04766 
04767 bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
04768 
04769 bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
04770 
04771 #define bfd_copy_private_header_data(ibfd, obfd) \
04772      BFD_SEND (obfd, _bfd_copy_private_header_data, \
04773                (ibfd, obfd))
04774 bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
04775 
04776 #define bfd_copy_private_bfd_data(ibfd, obfd) \
04777      BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
04778                (ibfd, obfd))
04779 bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
04780 
04781 #define bfd_merge_private_bfd_data(ibfd, obfd) \
04782      BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
04783                (ibfd, obfd))
04784 bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
04785 
04786 #define bfd_set_private_flags(abfd, flags) \
04787      BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
04788 #define bfd_sizeof_headers(abfd, info) \
04789        BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
04790 
04791 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
04792        BFD_SEND (abfd, _bfd_find_nearest_line, \
04793                  (abfd, sec, syms, off, file, func, line))
04794 
04795 #define bfd_find_line(abfd, syms, sym, file, line) \
04796        BFD_SEND (abfd, _bfd_find_line, \
04797                  (abfd, syms, sym, file, line))
04798 
04799 #define bfd_find_inliner_info(abfd, file, func, line) \
04800        BFD_SEND (abfd, _bfd_find_inliner_info, \
04801                  (abfd, file, func, line))
04802 
04803 #define bfd_debug_info_start(abfd) \
04804        BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
04805 
04806 #define bfd_debug_info_end(abfd) \
04807        BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
04808 
04809 #define bfd_debug_info_accumulate(abfd, section) \
04810        BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
04811 
04812 #define bfd_stat_arch_elt(abfd, stat) \
04813        BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
04814 
04815 #define bfd_update_armap_timestamp(abfd) \
04816        BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
04817 
04818 #define bfd_set_arch_mach(abfd, arch, mach)\
04819        BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
04820 
04821 #define bfd_relax_section(abfd, section, link_info, again) \
04822        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
04823 
04824 #define bfd_gc_sections(abfd, link_info) \
04825        BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
04826 
04827 #define bfd_merge_sections(abfd, link_info) \
04828        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
04829 
04830 #define bfd_is_group_section(abfd, sec) \
04831        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
04832 
04833 #define bfd_discard_group(abfd, sec) \
04834        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
04835 
04836 #define bfd_link_hash_table_create(abfd) \
04837        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
04838 
04839 #define bfd_link_hash_table_free(abfd, hash) \
04840        BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
04841 
04842 #define bfd_link_add_symbols(abfd, info) \
04843        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
04844 
04845 #define bfd_link_just_syms(abfd, sec, info) \
04846        BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
04847 
04848 #define bfd_final_link(abfd, info) \
04849        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
04850 
04851 #define bfd_free_cached_info(abfd) \
04852        BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
04853 
04854 #define bfd_get_dynamic_symtab_upper_bound(abfd) \
04855        BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
04856 
04857 #define bfd_print_private_bfd_data(abfd, file)\
04858        BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
04859 
04860 #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
04861        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
04862 
04863 #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
04864        BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
04865                                                    dyncount, dynsyms, ret))
04866 
04867 #define bfd_get_dynamic_reloc_upper_bound(abfd) \
04868        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
04869 
04870 #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
04871        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
04872 
04873 extern bfd_byte *bfd_get_relocated_section_contents
04874   (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
04875    bfd_boolean, asymbol **);
04876 
04877 bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
04878 
04879 struct bfd_preserve
04880 {
04881   void *marker;
04882   void *tdata;
04883   flagword flags;
04884   const struct bfd_arch_info *arch_info;
04885   struct bfd_section *sections;
04886   struct bfd_section *section_last;
04887   unsigned int section_count;
04888   struct bfd_hash_table section_htab;
04889 };
04890 
04891 bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
04892 
04893 void bfd_preserve_restore (bfd *, struct bfd_preserve *);
04894 
04895 void bfd_preserve_finish (bfd *, struct bfd_preserve *);
04896 
04897 bfd_vma bfd_emul_get_maxpagesize (const char *);
04898 
04899 void bfd_emul_set_maxpagesize (const char *, bfd_vma);
04900 
04901 bfd_vma bfd_emul_get_commonpagesize (const char *);
04902 
04903 void bfd_emul_set_commonpagesize (const char *, bfd_vma);
04904 
04905 /* Extracted from archive.c.  */
04906 symindex bfd_get_next_mapent
04907    (bfd *abfd, symindex previous, carsym **sym);
04908 
04909 bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
04910 
04911 bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
04912 
04913 /* Extracted from corefile.c.  */
04914 const char *bfd_core_file_failing_command (bfd *abfd);
04915 
04916 int bfd_core_file_failing_signal (bfd *abfd);
04917 
04918 bfd_boolean core_file_matches_executable_p
04919    (bfd *core_bfd, bfd *exec_bfd);
04920 
04921 bfd_boolean generic_core_file_matches_executable_p
04922    (bfd *core_bfd, bfd *exec_bfd);
04923 
04924 /* Extracted from targets.c.  */
04925 #define BFD_SEND(bfd, message, arglist) \
04926   ((*((bfd)->xvec->message)) arglist)
04927 
04928 #ifdef DEBUG_BFD_SEND
04929 #undef BFD_SEND
04930 #define BFD_SEND(bfd, message, arglist) \
04931   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
04932     ((*((bfd)->xvec->message)) arglist) : \
04933     (bfd_assert (__FILE__,__LINE__), NULL))
04934 #endif
04935 #define BFD_SEND_FMT(bfd, message, arglist) \
04936   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
04937 
04938 #ifdef DEBUG_BFD_SEND
04939 #undef BFD_SEND_FMT
04940 #define BFD_SEND_FMT(bfd, message, arglist) \
04941   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
04942    (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
04943    (bfd_assert (__FILE__,__LINE__), NULL))
04944 #endif
04945 
04946 enum bfd_flavour
04947 {
04948   bfd_target_unknown_flavour,
04949   bfd_target_aout_flavour,
04950   bfd_target_coff_flavour,
04951   bfd_target_ecoff_flavour,
04952   bfd_target_xcoff_flavour,
04953   bfd_target_elf_flavour,
04954   bfd_target_ieee_flavour,
04955   bfd_target_nlm_flavour,
04956   bfd_target_oasys_flavour,
04957   bfd_target_tekhex_flavour,
04958   bfd_target_srec_flavour,
04959   bfd_target_ihex_flavour,
04960   bfd_target_som_flavour,
04961   bfd_target_os9k_flavour,
04962   bfd_target_versados_flavour,
04963   bfd_target_msdos_flavour,
04964   bfd_target_ovax_flavour,
04965   bfd_target_evax_flavour,
04966   bfd_target_mmo_flavour,
04967   bfd_target_mach_o_flavour,
04968   bfd_target_pef_flavour,
04969   bfd_target_pef_xlib_flavour,
04970   bfd_target_sym_flavour
04971 };
04972 
04973 enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
04974 
04975 /* Forward declaration.  */
04976 typedef struct bfd_link_info _bfd_link_info;
04977 
04978 typedef struct bfd_target
04979 {
04980   /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
04981   char *name;
04982 
04983  /* The "flavour" of a back end is a general indication about
04984     the contents of a file.  */
04985   enum bfd_flavour flavour;
04986 
04987   /* The order of bytes within the data area of a file.  */
04988   enum bfd_endian byteorder;
04989 
04990  /* The order of bytes within the header parts of a file.  */
04991   enum bfd_endian header_byteorder;
04992 
04993   /* A mask of all the flags which an executable may have set -
04994      from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
04995   flagword object_flags;
04996 
04997  /* A mask of all the flags which a section may have set - from
04998     the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
04999   flagword section_flags;
05000 
05001  /* The character normally found at the front of a symbol.
05002     (if any), perhaps `_'.  */
05003   char symbol_leading_char;
05004 
05005  /* The pad character for file names within an archive header.  */
05006   char ar_pad_char;
05007 
05008   /* The maximum number of characters in an archive header.  */
05009   unsigned short ar_max_namelen;
05010 
05011   /* Entries for byte swapping for data. These are different from the
05012      other entry points, since they don't take a BFD as the first argument.
05013      Certain other handlers could do the same.  */
05014   bfd_uint64_t   (*bfd_getx64) (const void *);
05015   bfd_int64_t    (*bfd_getx_signed_64) (const void *);
05016   void           (*bfd_putx64) (bfd_uint64_t, void *);
05017   bfd_vma        (*bfd_getx32) (const void *);
05018   bfd_signed_vma (*bfd_getx_signed_32) (const void *);
05019   void           (*bfd_putx32) (bfd_vma, void *);
05020   bfd_vma        (*bfd_getx16) (const void *);
05021   bfd_signed_vma (*bfd_getx_signed_16) (const void *);
05022   void           (*bfd_putx16) (bfd_vma, void *);
05023 
05024   /* Byte swapping for the headers.  */
05025   bfd_uint64_t   (*bfd_h_getx64) (const void *);
05026   bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
05027   void           (*bfd_h_putx64) (bfd_uint64_t, void *);
05028   bfd_vma        (*bfd_h_getx32) (const void *);
05029   bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
05030   void           (*bfd_h_putx32) (bfd_vma, void *);
05031   bfd_vma        (*bfd_h_getx16) (const void *);
05032   bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
05033   void           (*bfd_h_putx16) (bfd_vma, void *);
05034 
05035   /* Format dependent routines: these are vectors of entry points
05036      within the target vector structure, one for each format to check.  */
05037 
05038   /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
05039   const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
05040 
05041   /* Set the format of a file being written.  */
05042   bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
05043 
05044   /* Write cached information into a file being written, at <<bfd_close>>.  */
05045   bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
05046 
05047 
05048   /* Generic entry points.  */
05049 #define BFD_JUMP_TABLE_GENERIC(NAME) \
05050   NAME##_close_and_cleanup, \
05051   NAME##_bfd_free_cached_info, \
05052   NAME##_new_section_hook, \
05053   NAME##_get_section_contents, \
05054   NAME##_get_section_contents_in_window
05055 
05056   /* Called when the BFD is being closed to do any necessary cleanup.  */
05057   bfd_boolean (*_close_and_cleanup) (bfd *);
05058   /* Ask the BFD to free all cached information.  */
05059   bfd_boolean (*_bfd_free_cached_info) (bfd *);
05060   /* Called when a new section is created.  */
05061   bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
05062   /* Read the contents of a section.  */
05063   bfd_boolean (*_bfd_get_section_contents)
05064     (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
05065   bfd_boolean (*_bfd_get_section_contents_in_window)
05066     (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
05067 
05068   /* Entry points to copy private data.  */
05069 #define BFD_JUMP_TABLE_COPY(NAME) \
05070   NAME##_bfd_copy_private_bfd_data, \
05071   NAME##_bfd_merge_private_bfd_data, \
05072   _bfd_generic_init_private_section_data, \
05073   NAME##_bfd_copy_private_section_data, \
05074   NAME##_bfd_copy_private_symbol_data, \
05075   NAME##_bfd_copy_private_header_data, \
05076   NAME##_bfd_set_private_flags, \
05077   NAME##_bfd_print_private_bfd_data
05078 
05079   /* Called to copy BFD general private data from one object file
05080      to another.  */
05081   bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
05082   /* Called to merge BFD general private data from one object file
05083      to a common output file when linking.  */
05084   bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
05085   /* Called to initialize BFD private section data from one object file
05086      to another.  */
05087 #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
05088   BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
05089   bfd_boolean (*_bfd_init_private_section_data)
05090     (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
05091   /* Called to copy BFD private section data from one object file
05092      to another.  */
05093   bfd_boolean (*_bfd_copy_private_section_data)
05094     (bfd *, sec_ptr, bfd *, sec_ptr);
05095   /* Called to copy BFD private symbol data from one symbol
05096      to another.  */
05097   bfd_boolean (*_bfd_copy_private_symbol_data)
05098     (bfd *, asymbol *, bfd *, asymbol *);
05099   /* Called to copy BFD private header data from one object file
05100      to another.  */
05101   bfd_boolean (*_bfd_copy_private_header_data)
05102     (bfd *, bfd *);
05103   /* Called to set private backend flags.  */
05104   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
05105 
05106   /* Called to print private BFD data.  */
05107   bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
05108 
05109   /* Core file entry points.  */
05110 #define BFD_JUMP_TABLE_CORE(NAME) \
05111   NAME##_core_file_failing_command, \
05112   NAME##_core_file_failing_signal, \
05113   NAME##_core_file_matches_executable_p
05114 
05115   char *      (*_core_file_failing_command) (bfd *);
05116   int         (*_core_file_failing_signal) (bfd *);
05117   bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
05118 
05119   /* Archive entry points.  */
05120 #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
05121   NAME##_slurp_armap, \
05122   NAME##_slurp_extended_name_table, \
05123   NAME##_construct_extended_name_table, \
05124   NAME##_truncate_arname, \
05125   NAME##_write_armap, \
05126   NAME##_read_ar_hdr, \
05127   NAME##_openr_next_archived_file, \
05128   NAME##_get_elt_at_index, \
05129   NAME##_generic_stat_arch_elt, \
05130   NAME##_update_armap_timestamp
05131 
05132   bfd_boolean (*_bfd_slurp_armap) (bfd *);
05133   bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
05134   bfd_boolean (*_bfd_construct_extended_name_table)
05135     (bfd *, char **, bfd_size_type *, const char **);
05136   void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
05137   bfd_boolean (*write_armap)
05138     (bfd *, unsigned int, struct orl *, unsigned int, int);
05139   void *      (*_bfd_read_ar_hdr_fn) (bfd *);
05140   bfd *       (*openr_next_archived_file) (bfd *, bfd *);
05141 #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
05142   bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
05143   int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
05144   bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
05145 
05146   /* Entry points used for symbols.  */
05147 #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
05148   NAME##_get_symtab_upper_bound, \
05149   NAME##_canonicalize_symtab, \
05150   NAME##_make_empty_symbol, \
05151   NAME##_print_symbol, \
05152   NAME##_get_symbol_info, \
05153   NAME##_bfd_is_local_label_name, \
05154   NAME##_bfd_is_target_special_symbol, \
05155   NAME##_get_lineno, \
05156   NAME##_find_nearest_line, \
05157   _bfd_generic_find_line, \
05158   NAME##_find_inliner_info, \
05159   NAME##_bfd_make_debug_symbol, \
05160   NAME##_read_minisymbols, \
05161   NAME##_minisymbol_to_symbol
05162 
05163   long        (*_bfd_get_symtab_upper_bound) (bfd *);
05164   long        (*_bfd_canonicalize_symtab)
05165     (bfd *, struct bfd_symbol **);
05166   struct bfd_symbol *
05167               (*_bfd_make_empty_symbol) (bfd *);
05168   void        (*_bfd_print_symbol)
05169     (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
05170 #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
05171   void        (*_bfd_get_symbol_info)
05172     (bfd *, struct bfd_symbol *, symbol_info *);
05173 #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
05174   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
05175   bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
05176   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
05177   bfd_boolean (*_bfd_find_nearest_line)
05178     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
05179      const char **, const char **, unsigned int *);
05180   bfd_boolean (*_bfd_find_line)
05181     (bfd *, struct bfd_symbol **, struct bfd_symbol *,
05182      const char **, unsigned int *);
05183   bfd_boolean (*_bfd_find_inliner_info)
05184     (bfd *, const char **, const char **, unsigned int *);
05185  /* Back-door to allow format-aware applications to create debug symbols
05186     while using BFD for everything else.  Currently used by the assembler
05187     when creating COFF files.  */
05188   asymbol *   (*_bfd_make_debug_symbol)
05189     (bfd *, void *, unsigned long size);
05190 #define bfd_read_minisymbols(b, d, m, s) \
05191   BFD_SEND (b, _read_minisymbols, (b, d, m, s))
05192   long        (*_read_minisymbols)
05193     (bfd *, bfd_boolean, void **, unsigned int *);
05194 #define bfd_minisymbol_to_symbol(b, d, m, f) \
05195   BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
05196   asymbol *   (*_minisymbol_to_symbol)
05197     (bfd *, bfd_boolean, const void *, asymbol *);
05198 
05199   /* Routines for relocs.  */
05200 #define BFD_JUMP_TABLE_RELOCS(NAME) \
05201   NAME##_get_reloc_upper_bound, \
05202   NAME##_canonicalize_reloc, \
05203   NAME##_bfd_reloc_type_lookup, \
05204   NAME##_bfd_reloc_name_lookup
05205 
05206   long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
05207   long        (*_bfd_canonicalize_reloc)
05208     (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
05209   /* See documentation on reloc types.  */
05210   reloc_howto_type *
05211               (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
05212   reloc_howto_type *
05213               (*reloc_name_lookup) (bfd *, const char *);
05214 
05215 
05216   /* Routines used when writing an object file.  */
05217 #define BFD_JUMP_TABLE_WRITE(NAME) \
05218   NAME##_set_arch_mach, \
05219   NAME##_set_section_contents
05220 
05221   bfd_boolean (*_bfd_set_arch_mach)
05222     (bfd *, enum bfd_architecture, unsigned long);
05223   bfd_boolean (*_bfd_set_section_contents)
05224     (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
05225 
05226   /* Routines used by the linker.  */
05227 #define BFD_JUMP_TABLE_LINK(NAME) \
05228   NAME##_sizeof_headers, \
05229   NAME##_bfd_get_relocated_section_contents, \
05230   NAME##_bfd_relax_section, \
05231   NAME##_bfd_link_hash_table_create, \
05232   NAME##_bfd_link_hash_table_free, \
05233   NAME##_bfd_link_add_symbols, \
05234   NAME##_bfd_link_just_syms, \
05235   NAME##_bfd_final_link, \
05236   NAME##_bfd_link_split_section, \
05237   NAME##_bfd_gc_sections, \
05238   NAME##_bfd_merge_sections, \
05239   NAME##_bfd_is_group_section, \
05240   NAME##_bfd_discard_group, \
05241   NAME##_section_already_linked \
05242 
05243   int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
05244   bfd_byte *  (*_bfd_get_relocated_section_contents)
05245     (bfd *, struct bfd_link_info *, struct bfd_link_order *,
05246      bfd_byte *, bfd_boolean, struct bfd_symbol **);
05247 
05248   bfd_boolean (*_bfd_relax_section)
05249     (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
05250 
05251   /* Create a hash table for the linker.  Different backends store
05252      different information in this table.  */
05253   struct bfd_link_hash_table *
05254               (*_bfd_link_hash_table_create) (bfd *);
05255 
05256   /* Release the memory associated with the linker hash table.  */
05257   void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
05258 
05259   /* Add symbols from this object file into the hash table.  */
05260   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
05261 
05262   /* Indicate that we are only retrieving symbol values from this section.  */
05263   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
05264 
05265   /* Do a link based on the link_order structures attached to each
05266      section of the BFD.  */
05267   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
05268 
05269   /* Should this section be split up into smaller pieces during linking.  */
05270   bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
05271 
05272   /* Remove sections that are not referenced from the output.  */
05273   bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
05274 
05275   /* Attempt to merge SEC_MERGE sections.  */
05276   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
05277 
05278   /* Is this section a member of a group?  */
05279   bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
05280 
05281   /* Discard members of a group.  */
05282   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
05283 
05284   /* Check if SEC has been already linked during a reloceatable or
05285      final link.  */
05286   void (*_section_already_linked) (bfd *, struct bfd_section *,
05287                                    struct bfd_link_info *);
05288 
05289   /* Routines to handle dynamic symbols and relocs.  */
05290 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
05291   NAME##_get_dynamic_symtab_upper_bound, \
05292   NAME##_canonicalize_dynamic_symtab, \
05293   NAME##_get_synthetic_symtab, \
05294   NAME##_get_dynamic_reloc_upper_bound, \
05295   NAME##_canonicalize_dynamic_reloc
05296 
05297   /* Get the amount of memory required to hold the dynamic symbols.  */
05298   long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
05299   /* Read in the dynamic symbols.  */
05300   long        (*_bfd_canonicalize_dynamic_symtab)
05301     (bfd *, struct bfd_symbol **);
05302   /* Create synthetized symbols.  */
05303   long        (*_bfd_get_synthetic_symtab)
05304     (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
05305      struct bfd_symbol **);
05306   /* Get the amount of memory required to hold the dynamic relocs.  */
05307   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
05308   /* Read in the dynamic relocs.  */
05309   long        (*_bfd_canonicalize_dynamic_reloc)
05310     (bfd *, arelent **, struct bfd_symbol **);
05311 
05312   /* Opposite endian version of this target.  */
05313   const struct bfd_target * alternative_target;
05314 
05315   /* Data for use by back-end routines, which isn't
05316      generic enough to belong in this structure.  */
05317   const void *backend_data;
05318 
05319 } bfd_target;
05320 
05321 bfd_boolean bfd_set_default_target (const char *name);
05322 
05323 const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
05324 
05325 const char ** bfd_target_list (void);
05326 
05327 const bfd_target *bfd_search_for_target
05328    (int (*search_func) (const bfd_target *, void *),
05329     void *);
05330 
05331 /* Extracted from format.c.  */
05332 bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
05333 
05334 bfd_boolean bfd_check_format_matches
05335    (bfd *abfd, bfd_format format, char ***matching);
05336 
05337 bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
05338 
05339 const char *bfd_format_string (bfd_format format);
05340 
05341 /* Extracted from linker.c.  */
05342 bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
05343 
05344 #define bfd_link_split_section(abfd, sec) \
05345        BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
05346 
05347 void bfd_section_already_linked (bfd *abfd, asection *sec,
05348     struct bfd_link_info *info);
05349 
05350 #define bfd_section_already_linked(abfd, sec, info) \
05351        BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
05352 
05353 /* Extracted from simple.c.  */
05354 bfd_byte *bfd_simple_get_relocated_section_contents
05355    (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
05356 
05357 #ifdef __cplusplus
05358 }
05359 #endif
05360 #endif