Search
lxdream.org :: lxdream/src/x86dasm/bfd.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/x86dasm/bfd.h
changeset 362:dc40e2064dc4
next755:ab873907b00e
author nkeynes
date Tue Aug 28 08:46:54 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add the i386 disassembler from binutils (why write your own if you don't
have to) to use for translator validation
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/x86dasm/bfd.h Tue Aug 28 08:46:54 2007 +0000
1.3 @@ -0,0 +1,4714 @@
1.4 +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
1.5 + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
1.6 + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
1.7 + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
1.8 + "linker.c" and "simple.c".
1.9 + Run "make headers" in your build bfd/ to regenerate. */
1.10 +
1.11 +/* Main header file for the bfd library -- portable access to object files.
1.12 +
1.13 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1.14 + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1.15 +
1.16 + Contributed by Cygnus Support.
1.17 +
1.18 + This file is part of BFD, the Binary File Descriptor library.
1.19 +
1.20 + This program is free software; you can redistribute it and/or modify
1.21 + it under the terms of the GNU General Public License as published by
1.22 + the Free Software Foundation; either version 2 of the License, or
1.23 + (at your option) any later version.
1.24 +
1.25 + This program is distributed in the hope that it will be useful,
1.26 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1.27 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.28 + GNU General Public License for more details.
1.29 +
1.30 + You should have received a copy of the GNU General Public License
1.31 + along with this program; if not, write to the Free Software
1.32 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1.33 +
1.34 +#ifndef __BFD_H_SEEN__
1.35 +#define __BFD_H_SEEN__
1.36 +
1.37 +#ifdef __cplusplus
1.38 +extern "C" {
1.39 +#endif
1.40 +
1.41 +#include "ansidecl.h"
1.42 +#include "symcat.h"
1.43 +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1.44 +#ifndef SABER
1.45 +/* This hack is to avoid a problem with some strict ANSI C preprocessors.
1.46 + The problem is, "32_" is not a valid preprocessing token, and we don't
1.47 + want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
1.48 + cause the inner CONCAT2 macros to be evaluated first, producing
1.49 + still-valid pp-tokens. Then the final concatenation can be done. */
1.50 +#undef CONCAT4
1.51 +#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
1.52 +#endif
1.53 +#endif
1.54 +
1.55 +/* The word size used by BFD on the host. This may be 64 with a 32
1.56 + bit target if the host is 64 bit, or if other 64 bit targets have
1.57 + been selected with --enable-targets, or if --enable-64-bit-bfd. */
1.58 +#define BFD_ARCH_SIZE 64
1.59 +
1.60 +/* The word size of the default bfd target. */
1.61 +#define BFD_DEFAULT_TARGET_SIZE 32
1.62 +
1.63 +#define BFD_HOST_64BIT_LONG 0
1.64 +#define BFD_HOST_LONG_LONG 1
1.65 +#if 1
1.66 +#define BFD_HOST_64_BIT long long
1.67 +#define BFD_HOST_U_64_BIT unsigned long long
1.68 +typedef BFD_HOST_64_BIT bfd_int64_t;
1.69 +typedef BFD_HOST_U_64_BIT bfd_uint64_t;
1.70 +#endif
1.71 +
1.72 +#if BFD_ARCH_SIZE >= 64
1.73 +#define BFD64
1.74 +#endif
1.75 +
1.76 +#ifndef INLINE
1.77 +#if __GNUC__ >= 2
1.78 +#define INLINE __inline__
1.79 +#else
1.80 +#define INLINE
1.81 +#endif
1.82 +#endif
1.83 +
1.84 +/* Forward declaration. */
1.85 +typedef struct bfd bfd;
1.86 +
1.87 +/* Boolean type used in bfd. Too many systems define their own
1.88 + versions of "boolean" for us to safely typedef a "boolean" of
1.89 + our own. Using an enum for "bfd_boolean" has its own set of
1.90 + problems, with strange looking casts required to avoid warnings
1.91 + on some older compilers. Thus we just use an int.
1.92 +
1.93 + General rule: Functions which are bfd_boolean return TRUE on
1.94 + success and FALSE on failure (unless they're a predicate). */
1.95 +
1.96 +typedef int bfd_boolean;
1.97 +#undef FALSE
1.98 +#undef TRUE
1.99 +#define FALSE 0
1.100 +#define TRUE 1
1.101 +
1.102 +#ifdef BFD64
1.103 +
1.104 +#ifndef BFD_HOST_64_BIT
1.105 + #error No 64 bit integer type available
1.106 +#endif /* ! defined (BFD_HOST_64_BIT) */
1.107 +
1.108 +typedef BFD_HOST_U_64_BIT bfd_vma;
1.109 +typedef BFD_HOST_64_BIT bfd_signed_vma;
1.110 +typedef BFD_HOST_U_64_BIT bfd_size_type;
1.111 +typedef BFD_HOST_U_64_BIT symvalue;
1.112 +
1.113 +#ifndef fprintf_vma
1.114 +#if BFD_HOST_64BIT_LONG
1.115 +#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
1.116 +#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
1.117 +#else
1.118 +#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
1.119 +#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
1.120 +#define fprintf_vma(s,x) \
1.121 + fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
1.122 +#define sprintf_vma(s,x) \
1.123 + sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
1.124 +#endif
1.125 +#endif
1.126 +
1.127 +#else /* not BFD64 */
1.128 +
1.129 +/* Represent a target address. Also used as a generic unsigned type
1.130 + which is guaranteed to be big enough to hold any arithmetic types
1.131 + we need to deal with. */
1.132 +typedef unsigned long bfd_vma;
1.133 +
1.134 +/* A generic signed type which is guaranteed to be big enough to hold any
1.135 + arithmetic types we need to deal with. Can be assumed to be compatible
1.136 + with bfd_vma in the same way that signed and unsigned ints are compatible
1.137 + (as parameters, in assignment, etc). */
1.138 +typedef long bfd_signed_vma;
1.139 +
1.140 +typedef unsigned long symvalue;
1.141 +typedef unsigned long bfd_size_type;
1.142 +
1.143 +/* Print a bfd_vma x on stream s. */
1.144 +#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
1.145 +#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
1.146 +
1.147 +#endif /* not BFD64 */
1.148 +
1.149 +#ifndef BFD_HOST_64_BIT
1.150 +/* Fall back on a 32 bit type. The idea is to make these types always
1.151 + available for function return types, but in the case that
1.152 + BFD_HOST_64_BIT is undefined such a function should abort or
1.153 + otherwise signal an error. */
1.154 +typedef bfd_signed_vma bfd_int64_t;
1.155 +typedef bfd_vma bfd_uint64_t;
1.156 +#endif
1.157 +
1.158 +/* An offset into a file. BFD always uses the largest possible offset
1.159 + based on the build time availability of fseek, fseeko, or fseeko64. */
1.160 +typedef BFD_HOST_64_BIT file_ptr;
1.161 +typedef unsigned BFD_HOST_64_BIT ufile_ptr;
1.162 +
1.163 +extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
1.164 +extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
1.165 +
1.166 +#define printf_vma(x) fprintf_vma(stdout,x)
1.167 +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
1.168 +
1.169 +typedef unsigned int flagword; /* 32 bits of flags */
1.170 +typedef unsigned char bfd_byte;
1.171 +
1.172 +/* File formats. */
1.173 +
1.174 +typedef enum bfd_format
1.175 +{
1.176 + bfd_unknown = 0, /* File format is unknown. */
1.177 + bfd_object, /* Linker/assembler/compiler output. */
1.178 + bfd_archive, /* Object archive file. */
1.179 + bfd_core, /* Core dump. */
1.180 + bfd_type_end /* Marks the end; don't use it! */
1.181 +}
1.182 +bfd_format;
1.183 +
1.184 +/* Values that may appear in the flags field of a BFD. These also
1.185 + appear in the object_flags field of the bfd_target structure, where
1.186 + they indicate the set of flags used by that backend (not all flags
1.187 + are meaningful for all object file formats) (FIXME: at the moment,
1.188 + the object_flags values have mostly just been copied from backend
1.189 + to another, and are not necessarily correct). */
1.190 +
1.191 +/* No flags. */
1.192 +#define BFD_NO_FLAGS 0x00
1.193 +
1.194 +/* BFD contains relocation entries. */
1.195 +#define HAS_RELOC 0x01
1.196 +
1.197 +/* BFD is directly executable. */
1.198 +#define EXEC_P 0x02
1.199 +
1.200 +/* BFD has line number information (basically used for F_LNNO in a
1.201 + COFF header). */
1.202 +#define HAS_LINENO 0x04
1.203 +
1.204 +/* BFD has debugging information. */
1.205 +#define HAS_DEBUG 0x08
1.206 +
1.207 +/* BFD has symbols. */
1.208 +#define HAS_SYMS 0x10
1.209 +
1.210 +/* BFD has local symbols (basically used for F_LSYMS in a COFF
1.211 + header). */
1.212 +#define HAS_LOCALS 0x20
1.213 +
1.214 +/* BFD is a dynamic object. */
1.215 +#define DYNAMIC 0x40
1.216 +
1.217 +/* Text section is write protected (if D_PAGED is not set, this is
1.218 + like an a.out NMAGIC file) (the linker sets this by default, but
1.219 + clears it for -r or -N). */
1.220 +#define WP_TEXT 0x80
1.221 +
1.222 +/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
1.223 + linker sets this by default, but clears it for -r or -n or -N). */
1.224 +#define D_PAGED 0x100
1.225 +
1.226 +/* BFD is relaxable (this means that bfd_relax_section may be able to
1.227 + do something) (sometimes bfd_relax_section can do something even if
1.228 + this is not set). */
1.229 +#define BFD_IS_RELAXABLE 0x200
1.230 +
1.231 +/* This may be set before writing out a BFD to request using a
1.232 + traditional format. For example, this is used to request that when
1.233 + writing out an a.out object the symbols not be hashed to eliminate
1.234 + duplicates. */
1.235 +#define BFD_TRADITIONAL_FORMAT 0x400
1.236 +
1.237 +/* This flag indicates that the BFD contents are actually cached in
1.238 + memory. If this is set, iostream points to a bfd_in_memory struct. */
1.239 +#define BFD_IN_MEMORY 0x800
1.240 +
1.241 +/* The sections in this BFD specify a memory page. */
1.242 +#define HAS_LOAD_PAGE 0x1000
1.243 +
1.244 +/* This BFD has been created by the linker and doesn't correspond
1.245 + to any input file. */
1.246 +#define BFD_LINKER_CREATED 0x2000
1.247 +
1.248 +/* Symbols and relocation. */
1.249 +
1.250 +/* A count of carsyms (canonical archive symbols). */
1.251 +typedef unsigned long symindex;
1.252 +
1.253 +/* How to perform a relocation. */
1.254 +typedef const struct reloc_howto_struct reloc_howto_type;
1.255 +
1.256 +#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
1.257 +
1.258 +/* General purpose part of a symbol X;
1.259 + target specific parts are in libcoff.h, libaout.h, etc. */
1.260 +
1.261 +#define bfd_get_section(x) ((x)->section)
1.262 +#define bfd_get_output_section(x) ((x)->section->output_section)
1.263 +#define bfd_set_section(x,y) ((x)->section) = (y)
1.264 +#define bfd_asymbol_base(x) ((x)->section->vma)
1.265 +#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
1.266 +#define bfd_asymbol_name(x) ((x)->name)
1.267 +/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
1.268 +#define bfd_asymbol_bfd(x) ((x)->the_bfd)
1.269 +#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
1.270 +
1.271 +/* A canonical archive symbol. */
1.272 +/* This is a type pun with struct ranlib on purpose! */
1.273 +typedef struct carsym
1.274 +{
1.275 + char *name;
1.276 + file_ptr file_offset; /* Look here to find the file. */
1.277 +}
1.278 +carsym; /* To make these you call a carsymogen. */
1.279 +
1.280 +/* Used in generating armaps (archive tables of contents).
1.281 + Perhaps just a forward definition would do? */
1.282 +struct orl /* Output ranlib. */
1.283 +{
1.284 + char **name; /* Symbol name. */
1.285 + union
1.286 + {
1.287 + file_ptr pos;
1.288 + bfd *abfd;
1.289 + } u; /* bfd* or file position. */
1.290 + int namidx; /* Index into string table. */
1.291 +};
1.292 +
1.293 +/* Linenumber stuff. */
1.294 +typedef struct lineno_cache_entry
1.295 +{
1.296 + unsigned int line_number; /* Linenumber from start of function. */
1.297 + union
1.298 + {
1.299 + struct bfd_symbol *sym; /* Function name. */
1.300 + bfd_vma offset; /* Offset into section. */
1.301 + } u;
1.302 +}
1.303 +alent;
1.304 +
1.305 +/* Object and core file sections. */
1.306 +
1.307 +#define align_power(addr, align) \
1.308 + (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
1.309 +
1.310 +typedef struct bfd_section *sec_ptr;
1.311 +
1.312 +#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
1.313 +#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
1.314 +#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
1.315 +#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
1.316 +#define bfd_section_name(bfd, ptr) ((ptr)->name)
1.317 +#define bfd_section_size(bfd, ptr) ((ptr)->size)
1.318 +#define bfd_get_section_size(ptr) ((ptr)->size)
1.319 +#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
1.320 +#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
1.321 +#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
1.322 +#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
1.323 +#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
1.324 +
1.325 +#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
1.326 +
1.327 +#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
1.328 +#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
1.329 +#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
1.330 +/* Find the address one past the end of SEC. */
1.331 +#define bfd_get_section_limit(bfd, sec) \
1.332 + (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
1.333 + / bfd_octets_per_byte (bfd))
1.334 +
1.335 +typedef struct stat stat_type;
1.336 +
1.337 +typedef enum bfd_print_symbol
1.338 +{
1.339 + bfd_print_symbol_name,
1.340 + bfd_print_symbol_more,
1.341 + bfd_print_symbol_all
1.342 +} bfd_print_symbol_type;
1.343 +
1.344 +/* Information about a symbol that nm needs. */
1.345 +
1.346 +typedef struct _symbol_info
1.347 +{
1.348 + symvalue value;
1.349 + char type;
1.350 + const char *name; /* Symbol name. */
1.351 + unsigned char stab_type; /* Stab type. */
1.352 + char stab_other; /* Stab other. */
1.353 + short stab_desc; /* Stab desc. */
1.354 + const char *stab_name; /* String for stab type. */
1.355 +} symbol_info;
1.356 +
1.357 +/* Get the name of a stabs type code. */
1.358 +
1.359 +extern const char *bfd_get_stab_name (int);
1.360 +
1.361 +/* Hash table routines. There is no way to free up a hash table. */
1.362 +
1.363 +/* An element in the hash table. Most uses will actually use a larger
1.364 + structure, and an instance of this will be the first field. */
1.365 +
1.366 +struct bfd_hash_entry
1.367 +{
1.368 + /* Next entry for this hash code. */
1.369 + struct bfd_hash_entry *next;
1.370 + /* String being hashed. */
1.371 + const char *string;
1.372 + /* Hash code. This is the full hash code, not the index into the
1.373 + table. */
1.374 + unsigned long hash;
1.375 +};
1.376 +
1.377 +/* A hash table. */
1.378 +
1.379 +struct bfd_hash_table
1.380 +{
1.381 + /* The hash array. */
1.382 + struct bfd_hash_entry **table;
1.383 + /* The number of slots in the hash table. */
1.384 + unsigned int size;
1.385 + /* A function used to create new elements in the hash table. The
1.386 + first entry is itself a pointer to an element. When this
1.387 + function is first invoked, this pointer will be NULL. However,
1.388 + having the pointer permits a hierarchy of method functions to be
1.389 + built each of which calls the function in the superclass. Thus
1.390 + each function should be written to allocate a new block of memory
1.391 + only if the argument is NULL. */
1.392 + struct bfd_hash_entry *(*newfunc)
1.393 + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1.394 + /* An objalloc for this hash table. This is a struct objalloc *,
1.395 + but we use void * to avoid requiring the inclusion of objalloc.h. */
1.396 + void *memory;
1.397 +};
1.398 +
1.399 +/* Initialize a hash table. */
1.400 +extern bfd_boolean bfd_hash_table_init
1.401 + (struct bfd_hash_table *,
1.402 + struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
1.403 + struct bfd_hash_table *,
1.404 + const char *));
1.405 +
1.406 +/* Initialize a hash table specifying a size. */
1.407 +extern bfd_boolean bfd_hash_table_init_n
1.408 + (struct bfd_hash_table *,
1.409 + struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
1.410 + struct bfd_hash_table *,
1.411 + const char *),
1.412 + unsigned int size);
1.413 +
1.414 +/* Free up a hash table. */
1.415 +extern void bfd_hash_table_free
1.416 + (struct bfd_hash_table *);
1.417 +
1.418 +/* Look up a string in a hash table. If CREATE is TRUE, a new entry
1.419 + will be created for this string if one does not already exist. The
1.420 + COPY argument must be TRUE if this routine should copy the string
1.421 + into newly allocated memory when adding an entry. */
1.422 +extern struct bfd_hash_entry *bfd_hash_lookup
1.423 + (struct bfd_hash_table *, const char *, bfd_boolean create,
1.424 + bfd_boolean copy);
1.425 +
1.426 +/* Replace an entry in a hash table. */
1.427 +extern void bfd_hash_replace
1.428 + (struct bfd_hash_table *, struct bfd_hash_entry *old,
1.429 + struct bfd_hash_entry *nw);
1.430 +
1.431 +/* Base method for creating a hash table entry. */
1.432 +extern struct bfd_hash_entry *bfd_hash_newfunc
1.433 + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1.434 +
1.435 +/* Grab some space for a hash table entry. */
1.436 +extern void *bfd_hash_allocate
1.437 + (struct bfd_hash_table *, unsigned int);
1.438 +
1.439 +/* Traverse a hash table in a random order, calling a function on each
1.440 + element. If the function returns FALSE, the traversal stops. The
1.441 + INFO argument is passed to the function. */
1.442 +extern void bfd_hash_traverse
1.443 + (struct bfd_hash_table *,
1.444 + bfd_boolean (*) (struct bfd_hash_entry *, void *),
1.445 + void *info);
1.446 +
1.447 +/* Allows the default size of a hash table to be configured. New hash
1.448 + tables allocated using bfd_hash_table_init will be created with
1.449 + this size. */
1.450 +extern void bfd_hash_set_default_size (bfd_size_type);
1.451 +
1.452 +/* This structure is used to keep track of stabs in sections
1.453 + information while linking. */
1.454 +
1.455 +struct stab_info
1.456 +{
1.457 + /* A hash table used to hold stabs strings. */
1.458 + struct bfd_strtab_hash *strings;
1.459 + /* The header file hash table. */
1.460 + struct bfd_hash_table includes;
1.461 + /* The first .stabstr section. */
1.462 + struct bfd_section *stabstr;
1.463 +};
1.464 +
1.465 +#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
1.466 +
1.467 +/* User program access to BFD facilities. */
1.468 +
1.469 +/* Direct I/O routines, for programs which know more about the object
1.470 + file than BFD does. Use higher level routines if possible. */
1.471 +
1.472 +extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
1.473 +extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
1.474 +extern int bfd_seek (bfd *, file_ptr, int);
1.475 +extern file_ptr bfd_tell (bfd *);
1.476 +extern int bfd_flush (bfd *);
1.477 +extern int bfd_stat (bfd *, struct stat *);
1.478 +
1.479 +/* Deprecated old routines. */
1.480 +#if __GNUC__
1.481 +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
1.482 + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
1.483 + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
1.484 +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
1.485 + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
1.486 + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
1.487 +#else
1.488 +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
1.489 + (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
1.490 + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
1.491 +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
1.492 + (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
1.493 + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
1.494 +#endif
1.495 +extern void warn_deprecated (const char *, const char *, int, const char *);
1.496 +
1.497 +/* Cast from const char * to char * so that caller can assign to
1.498 + a char * without a warning. */
1.499 +#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
1.500 +#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
1.501 +#define bfd_get_format(abfd) ((abfd)->format)
1.502 +#define bfd_get_target(abfd) ((abfd)->xvec->name)
1.503 +#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
1.504 +#define bfd_family_coff(abfd) \
1.505 + (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
1.506 + bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
1.507 +#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
1.508 +#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
1.509 +#define bfd_header_big_endian(abfd) \
1.510 + ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
1.511 +#define bfd_header_little_endian(abfd) \
1.512 + ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
1.513 +#define bfd_get_file_flags(abfd) ((abfd)->flags)
1.514 +#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
1.515 +#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
1.516 +#define bfd_my_archive(abfd) ((abfd)->my_archive)
1.517 +#define bfd_has_map(abfd) ((abfd)->has_armap)
1.518 +
1.519 +#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
1.520 +#define bfd_usrdata(abfd) ((abfd)->usrdata)
1.521 +
1.522 +#define bfd_get_start_address(abfd) ((abfd)->start_address)
1.523 +#define bfd_get_symcount(abfd) ((abfd)->symcount)
1.524 +#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
1.525 +#define bfd_count_sections(abfd) ((abfd)->section_count)
1.526 +
1.527 +#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
1.528 +
1.529 +#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
1.530 +
1.531 +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
1.532 +
1.533 +extern bfd_boolean bfd_cache_close
1.534 + (bfd *abfd);
1.535 +/* NB: This declaration should match the autogenerated one in libbfd.h. */
1.536 +
1.537 +extern bfd_boolean bfd_cache_close_all (void);
1.538 +
1.539 +extern bfd_boolean bfd_record_phdr
1.540 + (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
1.541 + bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
1.542 +
1.543 +/* Byte swapping routines. */
1.544 +
1.545 +bfd_uint64_t bfd_getb64 (const void *);
1.546 +bfd_uint64_t bfd_getl64 (const void *);
1.547 +bfd_int64_t bfd_getb_signed_64 (const void *);
1.548 +bfd_int64_t bfd_getl_signed_64 (const void *);
1.549 +bfd_vma bfd_getb32 (const void *);
1.550 +bfd_vma bfd_getl32 (const void *);
1.551 +bfd_signed_vma bfd_getb_signed_32 (const void *);
1.552 +bfd_signed_vma bfd_getl_signed_32 (const void *);
1.553 +bfd_vma bfd_getb16 (const void *);
1.554 +bfd_vma bfd_getl16 (const void *);
1.555 +bfd_signed_vma bfd_getb_signed_16 (const void *);
1.556 +bfd_signed_vma bfd_getl_signed_16 (const void *);
1.557 +void bfd_putb64 (bfd_uint64_t, void *);
1.558 +void bfd_putl64 (bfd_uint64_t, void *);
1.559 +void bfd_putb32 (bfd_vma, void *);
1.560 +void bfd_putl32 (bfd_vma, void *);
1.561 +void bfd_putb16 (bfd_vma, void *);
1.562 +void bfd_putl16 (bfd_vma, void *);
1.563 +
1.564 +/* Byte swapping routines which take size and endiannes as arguments. */
1.565 +
1.566 +bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
1.567 +void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
1.568 +
1.569 +extern bfd_boolean bfd_section_already_linked_table_init (void);
1.570 +extern void bfd_section_already_linked_table_free (void);
1.571 +
1.572 +/* Externally visible ECOFF routines. */
1.573 +
1.574 +#if defined(__STDC__) || defined(ALMOST_STDC)
1.575 +struct ecoff_debug_info;
1.576 +struct ecoff_debug_swap;
1.577 +struct ecoff_extr;
1.578 +struct bfd_symbol;
1.579 +struct bfd_link_info;
1.580 +struct bfd_link_hash_entry;
1.581 +struct bfd_elf_version_tree;
1.582 +#endif
1.583 +extern bfd_vma bfd_ecoff_get_gp_value
1.584 + (bfd * abfd);
1.585 +extern bfd_boolean bfd_ecoff_set_gp_value
1.586 + (bfd *abfd, bfd_vma gp_value);
1.587 +extern bfd_boolean bfd_ecoff_set_regmasks
1.588 + (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
1.589 + unsigned long *cprmask);
1.590 +extern void *bfd_ecoff_debug_init
1.591 + (bfd *output_bfd, struct ecoff_debug_info *output_debug,
1.592 + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
1.593 +extern void bfd_ecoff_debug_free
1.594 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
1.595 + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
1.596 +extern bfd_boolean bfd_ecoff_debug_accumulate
1.597 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
1.598 + const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
1.599 + struct ecoff_debug_info *input_debug,
1.600 + const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
1.601 +extern bfd_boolean bfd_ecoff_debug_accumulate_other
1.602 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
1.603 + const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
1.604 + struct bfd_link_info *);
1.605 +extern bfd_boolean bfd_ecoff_debug_externals
1.606 + (bfd *abfd, struct ecoff_debug_info *debug,
1.607 + const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
1.608 + bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
1.609 + void (*set_index) (struct bfd_symbol *, bfd_size_type));
1.610 +extern bfd_boolean bfd_ecoff_debug_one_external
1.611 + (bfd *abfd, struct ecoff_debug_info *debug,
1.612 + const struct ecoff_debug_swap *swap, const char *name,
1.613 + struct ecoff_extr *esym);
1.614 +extern bfd_size_type bfd_ecoff_debug_size
1.615 + (bfd *abfd, struct ecoff_debug_info *debug,
1.616 + const struct ecoff_debug_swap *swap);
1.617 +extern bfd_boolean bfd_ecoff_write_debug
1.618 + (bfd *abfd, struct ecoff_debug_info *debug,
1.619 + const struct ecoff_debug_swap *swap, file_ptr where);
1.620 +extern bfd_boolean bfd_ecoff_write_accumulated_debug
1.621 + (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
1.622 + const struct ecoff_debug_swap *swap,
1.623 + struct bfd_link_info *info, file_ptr where);
1.624 +
1.625 +/* Externally visible ELF routines. */
1.626 +
1.627 +struct bfd_link_needed_list
1.628 +{
1.629 + struct bfd_link_needed_list *next;
1.630 + bfd *by;
1.631 + const char *name;
1.632 +};
1.633 +
1.634 +enum dynamic_lib_link_class {
1.635 + DYN_NORMAL = 0,
1.636 + DYN_AS_NEEDED = 1,
1.637 + DYN_DT_NEEDED = 2,
1.638 + DYN_NO_ADD_NEEDED = 4,
1.639 + DYN_NO_NEEDED = 8
1.640 +};
1.641 +
1.642 +extern bfd_boolean bfd_elf_record_link_assignment
1.643 + (bfd *, struct bfd_link_info *, const char *, bfd_boolean);
1.644 +extern struct bfd_link_needed_list *bfd_elf_get_needed_list
1.645 + (bfd *, struct bfd_link_info *);
1.646 +extern bfd_boolean bfd_elf_get_bfd_needed_list
1.647 + (bfd *, struct bfd_link_needed_list **);
1.648 +extern bfd_boolean bfd_elf_size_dynamic_sections
1.649 + (bfd *, const char *, const char *, const char *, const char * const *,
1.650 + struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
1.651 +extern void bfd_elf_set_dt_needed_name
1.652 + (bfd *, const char *);
1.653 +extern const char *bfd_elf_get_dt_soname
1.654 + (bfd *);
1.655 +extern void bfd_elf_set_dyn_lib_class
1.656 + (bfd *, int);
1.657 +extern int bfd_elf_get_dyn_lib_class
1.658 + (bfd *);
1.659 +extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
1.660 + (bfd *, struct bfd_link_info *);
1.661 +extern bfd_boolean bfd_elf_discard_info
1.662 + (bfd *, struct bfd_link_info *);
1.663 +
1.664 +/* Return an upper bound on the number of bytes required to store a
1.665 + copy of ABFD's program header table entries. Return -1 if an error
1.666 + occurs; bfd_get_error will return an appropriate code. */
1.667 +extern long bfd_get_elf_phdr_upper_bound
1.668 + (bfd *abfd);
1.669 +
1.670 +/* Copy ABFD's program header table entries to *PHDRS. The entries
1.671 + will be stored as an array of Elf_Internal_Phdr structures, as
1.672 + defined in include/elf/internal.h. To find out how large the
1.673 + buffer needs to be, call bfd_get_elf_phdr_upper_bound.
1.674 +
1.675 + Return the number of program header table entries read, or -1 if an
1.676 + error occurs; bfd_get_error will return an appropriate code. */
1.677 +extern int bfd_get_elf_phdrs
1.678 + (bfd *abfd, void *phdrs);
1.679 +
1.680 +/* Create a new BFD as if by bfd_openr. Rather than opening a file,
1.681 + reconstruct an ELF file by reading the segments out of remote memory
1.682 + based on the ELF file header at EHDR_VMA and the ELF program headers it
1.683 + points to. If not null, *LOADBASEP is filled in with the difference
1.684 + between the VMAs from which the segments were read, and the VMAs the
1.685 + file headers (and hence BFD's idea of each section's VMA) put them at.
1.686 +
1.687 + The function TARGET_READ_MEMORY is called to copy LEN bytes from the
1.688 + remote memory at target address VMA into the local buffer at MYADDR; it
1.689 + should return zero on success or an `errno' code on failure. TEMPL must
1.690 + be a BFD for an ELF target with the word size and byte order found in
1.691 + the remote memory. */
1.692 +extern bfd *bfd_elf_bfd_from_remote_memory
1.693 + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
1.694 + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
1.695 +
1.696 +/* Return the arch_size field of an elf bfd, or -1 if not elf. */
1.697 +extern int bfd_get_arch_size
1.698 + (bfd *);
1.699 +
1.700 +/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
1.701 +extern int bfd_get_sign_extend_vma
1.702 + (bfd *);
1.703 +
1.704 +extern struct bfd_section *_bfd_elf_tls_setup
1.705 + (bfd *, struct bfd_link_info *);
1.706 +
1.707 +extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
1.708 + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
1.709 +
1.710 +/* SunOS shared library support routines for the linker. */
1.711 +
1.712 +extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
1.713 + (bfd *, struct bfd_link_info *);
1.714 +extern bfd_boolean bfd_sunos_record_link_assignment
1.715 + (bfd *, struct bfd_link_info *, const char *);
1.716 +extern bfd_boolean bfd_sunos_size_dynamic_sections
1.717 + (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **);
1.718 +
1.719 +/* Linux shared library support routines for the linker. */
1.720 +
1.721 +extern bfd_boolean bfd_i386linux_size_dynamic_sections
1.722 + (bfd *, struct bfd_link_info *);
1.723 +extern bfd_boolean bfd_m68klinux_size_dynamic_sections
1.724 + (bfd *, struct bfd_link_info *);
1.725 +extern bfd_boolean bfd_sparclinux_size_dynamic_sections
1.726 + (bfd *, struct bfd_link_info *);
1.727 +
1.728 +/* mmap hacks */
1.729 +
1.730 +struct _bfd_window_internal;
1.731 +typedef struct _bfd_window_internal bfd_window_internal;
1.732 +
1.733 +typedef struct _bfd_window
1.734 +{
1.735 + /* What the user asked for. */
1.736 + void *data;
1.737 + bfd_size_type size;
1.738 + /* The actual window used by BFD. Small user-requested read-only
1.739 + regions sharing a page may share a single window into the object
1.740 + file. Read-write versions shouldn't until I've fixed things to
1.741 + keep track of which portions have been claimed by the
1.742 + application; don't want to give the same region back when the
1.743 + application wants two writable copies! */
1.744 + struct _bfd_window_internal *i;
1.745 +}
1.746 +bfd_window;
1.747 +
1.748 +extern void bfd_init_window
1.749 + (bfd_window *);
1.750 +extern void bfd_free_window
1.751 + (bfd_window *);
1.752 +extern bfd_boolean bfd_get_file_window
1.753 + (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
1.754 +
1.755 +/* XCOFF support routines for the linker. */
1.756 +
1.757 +extern bfd_boolean bfd_xcoff_link_record_set
1.758 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
1.759 +extern bfd_boolean bfd_xcoff_import_symbol
1.760 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
1.761 + const char *, const char *, const char *, unsigned int);
1.762 +extern bfd_boolean bfd_xcoff_export_symbol
1.763 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
1.764 +extern bfd_boolean bfd_xcoff_link_count_reloc
1.765 + (bfd *, struct bfd_link_info *, const char *);
1.766 +extern bfd_boolean bfd_xcoff_record_link_assignment
1.767 + (bfd *, struct bfd_link_info *, const char *);
1.768 +extern bfd_boolean bfd_xcoff_size_dynamic_sections
1.769 + (bfd *, struct bfd_link_info *, const char *, const char *,
1.770 + unsigned long, unsigned long, unsigned long, bfd_boolean,
1.771 + int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
1.772 +extern bfd_boolean bfd_xcoff_link_generate_rtinit
1.773 + (bfd *, const char *, const char *, bfd_boolean);
1.774 +
1.775 +/* XCOFF support routines for ar. */
1.776 +extern bfd_boolean bfd_xcoff_ar_archive_set_magic
1.777 + (bfd *, char *);
1.778 +
1.779 +/* Externally visible COFF routines. */
1.780 +
1.781 +#if defined(__STDC__) || defined(ALMOST_STDC)
1.782 +struct internal_syment;
1.783 +union internal_auxent;
1.784 +#endif
1.785 +
1.786 +extern bfd_boolean bfd_coff_get_syment
1.787 + (bfd *, struct bfd_symbol *, struct internal_syment *);
1.788 +
1.789 +extern bfd_boolean bfd_coff_get_auxent
1.790 + (bfd *, struct bfd_symbol *, int, union internal_auxent *);
1.791 +
1.792 +extern bfd_boolean bfd_coff_set_symbol_class
1.793 + (bfd *, struct bfd_symbol *, unsigned int);
1.794 +
1.795 +extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
1.796 + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
1.797 +
1.798 +/* ARM Interworking support. Called from linker. */
1.799 +extern bfd_boolean bfd_arm_allocate_interworking_sections
1.800 + (struct bfd_link_info *);
1.801 +
1.802 +extern bfd_boolean bfd_arm_process_before_allocation
1.803 + (bfd *, struct bfd_link_info *, int);
1.804 +
1.805 +extern bfd_boolean bfd_arm_get_bfd_for_interworking
1.806 + (bfd *, struct bfd_link_info *);
1.807 +
1.808 +/* PE ARM Interworking support. Called from linker. */
1.809 +extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
1.810 + (struct bfd_link_info *);
1.811 +
1.812 +extern bfd_boolean bfd_arm_pe_process_before_allocation
1.813 + (bfd *, struct bfd_link_info *, int);
1.814 +
1.815 +extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
1.816 + (bfd *, struct bfd_link_info *);
1.817 +
1.818 +/* ELF ARM Interworking support. Called from linker. */
1.819 +extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
1.820 + (struct bfd_link_info *);
1.821 +
1.822 +extern bfd_boolean bfd_elf32_arm_process_before_allocation
1.823 + (bfd *, struct bfd_link_info *, int);
1.824 +
1.825 +void bfd_elf32_arm_set_target_relocs
1.826 + (struct bfd_link_info *, int, char *, int);
1.827 +
1.828 +extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
1.829 + (bfd *, struct bfd_link_info *);
1.830 +
1.831 +extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
1.832 + (bfd *, struct bfd_link_info *);
1.833 +
1.834 +/* ARM Note section processing. */
1.835 +extern bfd_boolean bfd_arm_merge_machines
1.836 + (bfd *, bfd *);
1.837 +
1.838 +extern bfd_boolean bfd_arm_update_notes
1.839 + (bfd *, const char *);
1.840 +
1.841 +extern unsigned int bfd_arm_get_mach_from_notes
1.842 + (bfd *, const char *);
1.843 +
1.844 +/* TI COFF load page support. */
1.845 +extern void bfd_ticoff_set_section_load_page
1.846 + (struct bfd_section *, int);
1.847 +
1.848 +extern int bfd_ticoff_get_section_load_page
1.849 + (struct bfd_section *);
1.850 +
1.851 +/* H8/300 functions. */
1.852 +extern bfd_vma bfd_h8300_pad_address
1.853 + (bfd *, bfd_vma);
1.854 +
1.855 +/* IA64 Itanium code generation. Called from linker. */
1.856 +extern void bfd_elf32_ia64_after_parse
1.857 + (int);
1.858 +
1.859 +extern void bfd_elf64_ia64_after_parse
1.860 + (int);
1.861 +
1.862 +/* This structure is used for a comdat section, as in PE. A comdat
1.863 + section is associated with a particular symbol. When the linker
1.864 + sees a comdat section, it keeps only one of the sections with a
1.865 + given name and associated with a given symbol. */
1.866 +
1.867 +struct coff_comdat_info
1.868 +{
1.869 + /* The name of the symbol associated with a comdat section. */
1.870 + const char *name;
1.871 +
1.872 + /* The local symbol table index of the symbol associated with a
1.873 + comdat section. This is only meaningful to the object file format
1.874 + specific code; it is not an index into the list returned by
1.875 + bfd_canonicalize_symtab. */
1.876 + long symbol;
1.877 +};
1.878 +
1.879 +extern struct coff_comdat_info *bfd_coff_get_comdat_section
1.880 + (bfd *, struct bfd_section *);
1.881 +
1.882 +/* Extracted from init.c. */
1.883 +void bfd_init (void);
1.884 +
1.885 +/* Extracted from opncls.c. */
1.886 +bfd *bfd_openr (const char *filename, const char *target);
1.887 +
1.888 +bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1.889 +
1.890 +bfd *bfd_openstreamr (const char *, const char *, void *);
1.891 +
1.892 +bfd *bfd_openr_iovec (const char *filename, const char *target,
1.893 + void *(*open) (struct bfd *nbfd,
1.894 + void *open_closure),
1.895 + void *open_closure,
1.896 + file_ptr (*pread) (struct bfd *nbfd,
1.897 + void *stream,
1.898 + void *buf,
1.899 + file_ptr nbytes,
1.900 + file_ptr offset),
1.901 + int (*close) (struct bfd *nbfd,
1.902 + void *stream));
1.903 +
1.904 +bfd *bfd_openw (const char *filename, const char *target);
1.905 +
1.906 +bfd_boolean bfd_close (bfd *abfd);
1.907 +
1.908 +bfd_boolean bfd_close_all_done (bfd *);
1.909 +
1.910 +bfd *bfd_create (const char *filename, bfd *templ);
1.911 +
1.912 +bfd_boolean bfd_make_writable (bfd *abfd);
1.913 +
1.914 +bfd_boolean bfd_make_readable (bfd *abfd);
1.915 +
1.916 +unsigned long bfd_calc_gnu_debuglink_crc32
1.917 + (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1.918 +
1.919 +char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1.920 +
1.921 +struct bfd_section *bfd_create_gnu_debuglink_section
1.922 + (bfd *abfd, const char *filename);
1.923 +
1.924 +bfd_boolean bfd_fill_in_gnu_debuglink_section
1.925 + (bfd *abfd, struct bfd_section *sect, const char *filename);
1.926 +
1.927 +/* Extracted from libbfd.c. */
1.928 +
1.929 +/* Byte swapping macros for user section data. */
1.930 +
1.931 +#define bfd_put_8(abfd, val, ptr) \
1.932 + ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1.933 +#define bfd_put_signed_8 \
1.934 + bfd_put_8
1.935 +#define bfd_get_8(abfd, ptr) \
1.936 + (*(unsigned char *) (ptr) & 0xff)
1.937 +#define bfd_get_signed_8(abfd, ptr) \
1.938 + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1.939 +
1.940 +#define bfd_put_16(abfd, val, ptr) \
1.941 + BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1.942 +#define bfd_put_signed_16 \
1.943 + bfd_put_16
1.944 +#define bfd_get_16(abfd, ptr) \
1.945 + BFD_SEND (abfd, bfd_getx16, (ptr))
1.946 +#define bfd_get_signed_16(abfd, ptr) \
1.947 + BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1.948 +
1.949 +#define bfd_put_32(abfd, val, ptr) \
1.950 + BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1.951 +#define bfd_put_signed_32 \
1.952 + bfd_put_32
1.953 +#define bfd_get_32(abfd, ptr) \
1.954 + BFD_SEND (abfd, bfd_getx32, (ptr))
1.955 +#define bfd_get_signed_32(abfd, ptr) \
1.956 + BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1.957 +
1.958 +#define bfd_put_64(abfd, val, ptr) \
1.959 + BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1.960 +#define bfd_put_signed_64 \
1.961 + bfd_put_64
1.962 +#define bfd_get_64(abfd, ptr) \
1.963 + BFD_SEND (abfd, bfd_getx64, (ptr))
1.964 +#define bfd_get_signed_64(abfd, ptr) \
1.965 + BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1.966 +
1.967 +#define bfd_get(bits, abfd, ptr) \
1.968 + ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
1.969 + : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
1.970 + : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
1.971 + : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
1.972 + : (abort (), (bfd_vma) - 1))
1.973 +
1.974 +#define bfd_put(bits, abfd, val, ptr) \
1.975 + ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
1.976 + : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
1.977 + : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
1.978 + : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
1.979 + : (abort (), (void) 0))
1.980 +
1.981 +
1.982 +/* Byte swapping macros for file header data. */
1.983 +
1.984 +#define bfd_h_put_8(abfd, val, ptr) \
1.985 + bfd_put_8 (abfd, val, ptr)
1.986 +#define bfd_h_put_signed_8(abfd, val, ptr) \
1.987 + bfd_put_8 (abfd, val, ptr)
1.988 +#define bfd_h_get_8(abfd, ptr) \
1.989 + bfd_get_8 (abfd, ptr)
1.990 +#define bfd_h_get_signed_8(abfd, ptr) \
1.991 + bfd_get_signed_8 (abfd, ptr)
1.992 +
1.993 +#define bfd_h_put_16(abfd, val, ptr) \
1.994 + BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1.995 +#define bfd_h_put_signed_16 \
1.996 + bfd_h_put_16
1.997 +#define bfd_h_get_16(abfd, ptr) \
1.998 + BFD_SEND (abfd, bfd_h_getx16, (ptr))
1.999 +#define bfd_h_get_signed_16(abfd, ptr) \
1.1000 + BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1.1001 +
1.1002 +#define bfd_h_put_32(abfd, val, ptr) \
1.1003 + BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1.1004 +#define bfd_h_put_signed_32 \
1.1005 + bfd_h_put_32
1.1006 +#define bfd_h_get_32(abfd, ptr) \
1.1007 + BFD_SEND (abfd, bfd_h_getx32, (ptr))
1.1008 +#define bfd_h_get_signed_32(abfd, ptr) \
1.1009 + BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1.1010 +
1.1011 +#define bfd_h_put_64(abfd, val, ptr) \
1.1012 + BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1.1013 +#define bfd_h_put_signed_64 \
1.1014 + bfd_h_put_64
1.1015 +#define bfd_h_get_64(abfd, ptr) \
1.1016 + BFD_SEND (abfd, bfd_h_getx64, (ptr))
1.1017 +#define bfd_h_get_signed_64(abfd, ptr) \
1.1018 + BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1.1019 +
1.1020 +/* Aliases for the above, which should eventually go away. */
1.1021 +
1.1022 +#define H_PUT_64 bfd_h_put_64
1.1023 +#define H_PUT_32 bfd_h_put_32
1.1024 +#define H_PUT_16 bfd_h_put_16
1.1025 +#define H_PUT_8 bfd_h_put_8
1.1026 +#define H_PUT_S64 bfd_h_put_signed_64
1.1027 +#define H_PUT_S32 bfd_h_put_signed_32
1.1028 +#define H_PUT_S16 bfd_h_put_signed_16
1.1029 +#define H_PUT_S8 bfd_h_put_signed_8
1.1030 +#define H_GET_64 bfd_h_get_64
1.1031 +#define H_GET_32 bfd_h_get_32
1.1032 +#define H_GET_16 bfd_h_get_16
1.1033 +#define H_GET_8 bfd_h_get_8
1.1034 +#define H_GET_S64 bfd_h_get_signed_64
1.1035 +#define H_GET_S32 bfd_h_get_signed_32
1.1036 +#define H_GET_S16 bfd_h_get_signed_16
1.1037 +#define H_GET_S8 bfd_h_get_signed_8
1.1038 +
1.1039 +
1.1040 +/* Extracted from bfdio.c. */
1.1041 +long bfd_get_mtime (bfd *abfd);
1.1042 +
1.1043 +long bfd_get_size (bfd *abfd);
1.1044 +
1.1045 +/* Extracted from bfdwin.c. */
1.1046 +/* Extracted from section.c. */
1.1047 +typedef struct bfd_section
1.1048 +{
1.1049 + /* The name of the section; the name isn't a copy, the pointer is
1.1050 + the same as that passed to bfd_make_section. */
1.1051 + const char *name;
1.1052 +
1.1053 + /* A unique sequence number. */
1.1054 + int id;
1.1055 +
1.1056 + /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1.1057 + int index;
1.1058 +
1.1059 + /* The next section in the list belonging to the BFD, or NULL. */
1.1060 + struct bfd_section *next;
1.1061 +
1.1062 + /* The field flags contains attributes of the section. Some
1.1063 + flags are read in from the object file, and some are
1.1064 + synthesized from other information. */
1.1065 + flagword flags;
1.1066 +
1.1067 +#define SEC_NO_FLAGS 0x000
1.1068 +
1.1069 + /* Tells the OS to allocate space for this section when loading.
1.1070 + This is clear for a section containing debug information only. */
1.1071 +#define SEC_ALLOC 0x001
1.1072 +
1.1073 + /* Tells the OS to load the section from the file when loading.
1.1074 + This is clear for a .bss section. */
1.1075 +#define SEC_LOAD 0x002
1.1076 +
1.1077 + /* The section contains data still to be relocated, so there is
1.1078 + some relocation information too. */
1.1079 +#define SEC_RELOC 0x004
1.1080 +
1.1081 + /* A signal to the OS that the section contains read only data. */
1.1082 +#define SEC_READONLY 0x008
1.1083 +
1.1084 + /* The section contains code only. */
1.1085 +#define SEC_CODE 0x010
1.1086 +
1.1087 + /* The section contains data only. */
1.1088 +#define SEC_DATA 0x020
1.1089 +
1.1090 + /* The section will reside in ROM. */
1.1091 +#define SEC_ROM 0x040
1.1092 +
1.1093 + /* The section contains constructor information. This section
1.1094 + type is used by the linker to create lists of constructors and
1.1095 + destructors used by <<g++>>. When a back end sees a symbol
1.1096 + which should be used in a constructor list, it creates a new
1.1097 + section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1.1098 + the symbol to it, and builds a relocation. To build the lists
1.1099 + of constructors, all the linker has to do is catenate all the
1.1100 + sections called <<__CTOR_LIST__>> and relocate the data
1.1101 + contained within - exactly the operations it would peform on
1.1102 + standard data. */
1.1103 +#define SEC_CONSTRUCTOR 0x080
1.1104 +
1.1105 + /* The section has contents - a data section could be
1.1106 + <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1.1107 + <<SEC_HAS_CONTENTS>> */
1.1108 +#define SEC_HAS_CONTENTS 0x100
1.1109 +
1.1110 + /* An instruction to the linker to not output the section
1.1111 + even if it has information which would normally be written. */
1.1112 +#define SEC_NEVER_LOAD 0x200
1.1113 +
1.1114 + /* The section contains thread local data. */
1.1115 +#define SEC_THREAD_LOCAL 0x400
1.1116 +
1.1117 + /* The section has GOT references. This flag is only for the
1.1118 + linker, and is currently only used by the elf32-hppa back end.
1.1119 + It will be set if global offset table references were detected
1.1120 + in this section, which indicate to the linker that the section
1.1121 + contains PIC code, and must be handled specially when doing a
1.1122 + static link. */
1.1123 +#define SEC_HAS_GOT_REF 0x800
1.1124 +
1.1125 + /* The section contains common symbols (symbols may be defined
1.1126 + multiple times, the value of a symbol is the amount of
1.1127 + space it requires, and the largest symbol value is the one
1.1128 + used). Most targets have exactly one of these (which we
1.1129 + translate to bfd_com_section_ptr), but ECOFF has two. */
1.1130 +#define SEC_IS_COMMON 0x1000
1.1131 +
1.1132 + /* The section contains only debugging information. For
1.1133 + example, this is set for ELF .debug and .stab sections.
1.1134 + strip tests this flag to see if a section can be
1.1135 + discarded. */
1.1136 +#define SEC_DEBUGGING 0x2000
1.1137 +
1.1138 + /* The contents of this section are held in memory pointed to
1.1139 + by the contents field. This is checked by bfd_get_section_contents,
1.1140 + and the data is retrieved from memory if appropriate. */
1.1141 +#define SEC_IN_MEMORY 0x4000
1.1142 +
1.1143 + /* The contents of this section are to be excluded by the
1.1144 + linker for executable and shared objects unless those
1.1145 + objects are to be further relocated. */
1.1146 +#define SEC_EXCLUDE 0x8000
1.1147 +
1.1148 + /* The contents of this section are to be sorted based on the sum of
1.1149 + the symbol and addend values specified by the associated relocation
1.1150 + entries. Entries without associated relocation entries will be
1.1151 + appended to the end of the section in an unspecified order. */
1.1152 +#define SEC_SORT_ENTRIES 0x10000
1.1153 +
1.1154 + /* When linking, duplicate sections of the same name should be
1.1155 + discarded, rather than being combined into a single section as
1.1156 + is usually done. This is similar to how common symbols are
1.1157 + handled. See SEC_LINK_DUPLICATES below. */
1.1158 +#define SEC_LINK_ONCE 0x20000
1.1159 +
1.1160 + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1.1161 + should handle duplicate sections. */
1.1162 +#define SEC_LINK_DUPLICATES 0x40000
1.1163 +
1.1164 + /* This value for SEC_LINK_DUPLICATES means that duplicate
1.1165 + sections with the same name should simply be discarded. */
1.1166 +#define SEC_LINK_DUPLICATES_DISCARD 0x0
1.1167 +
1.1168 + /* This value for SEC_LINK_DUPLICATES means that the linker
1.1169 + should warn if there are any duplicate sections, although
1.1170 + it should still only link one copy. */
1.1171 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
1.1172 +
1.1173 + /* This value for SEC_LINK_DUPLICATES means that the linker
1.1174 + should warn if any duplicate sections are a different size. */
1.1175 +#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
1.1176 +
1.1177 + /* This value for SEC_LINK_DUPLICATES means that the linker
1.1178 + should warn if any duplicate sections contain different
1.1179 + contents. */
1.1180 +#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1.1181 + (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1.1182 +
1.1183 + /* This section was created by the linker as part of dynamic
1.1184 + relocation or other arcane processing. It is skipped when
1.1185 + going through the first-pass output, trusting that someone
1.1186 + else up the line will take care of it later. */
1.1187 +#define SEC_LINKER_CREATED 0x200000
1.1188 +
1.1189 + /* This section should not be subject to garbage collection. */
1.1190 +#define SEC_KEEP 0x400000
1.1191 +
1.1192 + /* This section contains "short" data, and should be placed
1.1193 + "near" the GP. */
1.1194 +#define SEC_SMALL_DATA 0x800000
1.1195 +
1.1196 + /* Attempt to merge identical entities in the section.
1.1197 + Entity size is given in the entsize field. */
1.1198 +#define SEC_MERGE 0x1000000
1.1199 +
1.1200 + /* If given with SEC_MERGE, entities to merge are zero terminated
1.1201 + strings where entsize specifies character size instead of fixed
1.1202 + size entries. */
1.1203 +#define SEC_STRINGS 0x2000000
1.1204 +
1.1205 + /* This section contains data about section groups. */
1.1206 +#define SEC_GROUP 0x4000000
1.1207 +
1.1208 + /* The section is a COFF shared library section. This flag is
1.1209 + only for the linker. If this type of section appears in
1.1210 + the input file, the linker must copy it to the output file
1.1211 + without changing the vma or size. FIXME: Although this
1.1212 + was originally intended to be general, it really is COFF
1.1213 + specific (and the flag was renamed to indicate this). It
1.1214 + might be cleaner to have some more general mechanism to
1.1215 + allow the back end to control what the linker does with
1.1216 + sections. */
1.1217 +#define SEC_COFF_SHARED_LIBRARY 0x10000000
1.1218 +
1.1219 + /* This section contains data which may be shared with other
1.1220 + executables or shared objects. This is for COFF only. */
1.1221 +#define SEC_COFF_SHARED 0x20000000
1.1222 +
1.1223 + /* When a section with this flag is being linked, then if the size of
1.1224 + the input section is less than a page, it should not cross a page
1.1225 + boundary. If the size of the input section is one page or more,
1.1226 + it should be aligned on a page boundary. This is for TI
1.1227 + TMS320C54X only. */
1.1228 +#define SEC_TIC54X_BLOCK 0x40000000
1.1229 +
1.1230 + /* Conditionally link this section; do not link if there are no
1.1231 + references found to any symbol in the section. This is for TI
1.1232 + TMS320C54X only. */
1.1233 +#define SEC_TIC54X_CLINK 0x80000000
1.1234 +
1.1235 + /* End of section flags. */
1.1236 +
1.1237 + /* Some internal packed boolean fields. */
1.1238 +
1.1239 + /* See the vma field. */
1.1240 + unsigned int user_set_vma : 1;
1.1241 +
1.1242 + /* A mark flag used by some of the linker backends. */
1.1243 + unsigned int linker_mark : 1;
1.1244 +
1.1245 + /* Another mark flag used by some of the linker backends. Set for
1.1246 + output sections that have an input section. */
1.1247 + unsigned int linker_has_input : 1;
1.1248 +
1.1249 + /* A mark flag used by some linker backends for garbage collection. */
1.1250 + unsigned int gc_mark : 1;
1.1251 +
1.1252 + /* The following flags are used by the ELF linker. */
1.1253 +
1.1254 + /* Mark sections which have been allocated to segments. */
1.1255 + unsigned int segment_mark : 1;
1.1256 +
1.1257 + /* Type of sec_info information. */
1.1258 + unsigned int sec_info_type:3;
1.1259 +#define ELF_INFO_TYPE_NONE 0
1.1260 +#define ELF_INFO_TYPE_STABS 1
1.1261 +#define ELF_INFO_TYPE_MERGE 2
1.1262 +#define ELF_INFO_TYPE_EH_FRAME 3
1.1263 +#define ELF_INFO_TYPE_JUST_SYMS 4
1.1264 +
1.1265 + /* Nonzero if this section uses RELA relocations, rather than REL. */
1.1266 + unsigned int use_rela_p:1;
1.1267 +
1.1268 + /* Bits used by various backends. The generic code doesn't touch
1.1269 + these fields. */
1.1270 +
1.1271 + /* Nonzero if this section has TLS related relocations. */
1.1272 + unsigned int has_tls_reloc:1;
1.1273 +
1.1274 + /* Nonzero if this section has a gp reloc. */
1.1275 + unsigned int has_gp_reloc:1;
1.1276 +
1.1277 + /* Nonzero if this section needs the relax finalize pass. */
1.1278 + unsigned int need_finalize_relax:1;
1.1279 +
1.1280 + /* Whether relocations have been processed. */
1.1281 + unsigned int reloc_done : 1;
1.1282 +
1.1283 + /* End of internal packed boolean fields. */
1.1284 +
1.1285 + /* The virtual memory address of the section - where it will be
1.1286 + at run time. The symbols are relocated against this. The
1.1287 + user_set_vma flag is maintained by bfd; if it's not set, the
1.1288 + backend can assign addresses (for example, in <<a.out>>, where
1.1289 + the default address for <<.data>> is dependent on the specific
1.1290 + target and various flags). */
1.1291 + bfd_vma vma;
1.1292 +
1.1293 + /* The load address of the section - where it would be in a
1.1294 + rom image; really only used for writing section header
1.1295 + information. */
1.1296 + bfd_vma lma;
1.1297 +
1.1298 + /* The size of the section in octets, as it will be output.
1.1299 + Contains a value even if the section has no contents (e.g., the
1.1300 + size of <<.bss>>). */
1.1301 + bfd_size_type size;
1.1302 +
1.1303 + /* For input sections, the original size on disk of the section, in
1.1304 + octets. This field is used by the linker relaxation code. It is
1.1305 + currently only set for sections where the linker relaxation scheme
1.1306 + doesn't cache altered section and reloc contents (stabs, eh_frame,
1.1307 + SEC_MERGE, some coff relaxing targets), and thus the original size
1.1308 + needs to be kept to read the section multiple times.
1.1309 + For output sections, rawsize holds the section size calculated on
1.1310 + a previous linker relaxation pass. */
1.1311 + bfd_size_type rawsize;
1.1312 +
1.1313 + /* If this section is going to be output, then this value is the
1.1314 + offset in *bytes* into the output section of the first byte in the
1.1315 + input section (byte ==> smallest addressable unit on the
1.1316 + target). In most cases, if this was going to start at the
1.1317 + 100th octet (8-bit quantity) in the output section, this value
1.1318 + would be 100. However, if the target byte size is 16 bits
1.1319 + (bfd_octets_per_byte is "2"), this value would be 50. */
1.1320 + bfd_vma output_offset;
1.1321 +
1.1322 + /* The output section through which to map on output. */
1.1323 + struct bfd_section *output_section;
1.1324 +
1.1325 + /* The alignment requirement of the section, as an exponent of 2 -
1.1326 + e.g., 3 aligns to 2^3 (or 8). */
1.1327 + unsigned int alignment_power;
1.1328 +
1.1329 + /* If an input section, a pointer to a vector of relocation
1.1330 + records for the data in this section. */
1.1331 + struct reloc_cache_entry *relocation;
1.1332 +
1.1333 + /* If an output section, a pointer to a vector of pointers to
1.1334 + relocation records for the data in this section. */
1.1335 + struct reloc_cache_entry **orelocation;
1.1336 +
1.1337 + /* The number of relocation records in one of the above. */
1.1338 + unsigned reloc_count;
1.1339 +
1.1340 + /* Information below is back end specific - and not always used
1.1341 + or updated. */
1.1342 +
1.1343 + /* File position of section data. */
1.1344 + file_ptr filepos;
1.1345 +
1.1346 + /* File position of relocation info. */
1.1347 + file_ptr rel_filepos;
1.1348 +
1.1349 + /* File position of line data. */
1.1350 + file_ptr line_filepos;
1.1351 +
1.1352 + /* Pointer to data for applications. */
1.1353 + void *userdata;
1.1354 +
1.1355 + /* If the SEC_IN_MEMORY flag is set, this points to the actual
1.1356 + contents. */
1.1357 + unsigned char *contents;
1.1358 +
1.1359 + /* Attached line number information. */
1.1360 + alent *lineno;
1.1361 +
1.1362 + /* Number of line number records. */
1.1363 + unsigned int lineno_count;
1.1364 +
1.1365 + /* Entity size for merging purposes. */
1.1366 + unsigned int entsize;
1.1367 +
1.1368 + /* Points to the kept section if this section is a link-once section,
1.1369 + and is discarded. */
1.1370 + struct bfd_section *kept_section;
1.1371 +
1.1372 + /* When a section is being output, this value changes as more
1.1373 + linenumbers are written out. */
1.1374 + file_ptr moving_line_filepos;
1.1375 +
1.1376 + /* What the section number is in the target world. */
1.1377 + int target_index;
1.1378 +
1.1379 + void *used_by_bfd;
1.1380 +
1.1381 + /* If this is a constructor section then here is a list of the
1.1382 + relocations created to relocate items within it. */
1.1383 + struct relent_chain *constructor_chain;
1.1384 +
1.1385 + /* The BFD which owns the section. */
1.1386 + bfd *owner;
1.1387 +
1.1388 + /* A symbol which points at this section only. */
1.1389 + struct bfd_symbol *symbol;
1.1390 + struct bfd_symbol **symbol_ptr_ptr;
1.1391 +
1.1392 + struct bfd_link_order *link_order_head;
1.1393 + struct bfd_link_order *link_order_tail;
1.1394 +} asection;
1.1395 +
1.1396 +/* These sections are global, and are managed by BFD. The application
1.1397 + and target back end are not permitted to change the values in
1.1398 + these sections. New code should use the section_ptr macros rather
1.1399 + than referring directly to the const sections. The const sections
1.1400 + may eventually vanish. */
1.1401 +#define BFD_ABS_SECTION_NAME "*ABS*"
1.1402 +#define BFD_UND_SECTION_NAME "*UND*"
1.1403 +#define BFD_COM_SECTION_NAME "*COM*"
1.1404 +#define BFD_IND_SECTION_NAME "*IND*"
1.1405 +
1.1406 +/* The absolute section. */
1.1407 +extern asection bfd_abs_section;
1.1408 +#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
1.1409 +#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1.1410 +/* Pointer to the undefined section. */
1.1411 +extern asection bfd_und_section;
1.1412 +#define bfd_und_section_ptr ((asection *) &bfd_und_section)
1.1413 +#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1.1414 +/* Pointer to the common section. */
1.1415 +extern asection bfd_com_section;
1.1416 +#define bfd_com_section_ptr ((asection *) &bfd_com_section)
1.1417 +/* Pointer to the indirect section. */
1.1418 +extern asection bfd_ind_section;
1.1419 +#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
1.1420 +#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1.1421 +
1.1422 +#define bfd_is_const_section(SEC) \
1.1423 + ( ((SEC) == bfd_abs_section_ptr) \
1.1424 + || ((SEC) == bfd_und_section_ptr) \
1.1425 + || ((SEC) == bfd_com_section_ptr) \
1.1426 + || ((SEC) == bfd_ind_section_ptr))
1.1427 +
1.1428 +extern const struct bfd_symbol * const bfd_abs_symbol;
1.1429 +extern const struct bfd_symbol * const bfd_com_symbol;
1.1430 +extern const struct bfd_symbol * const bfd_und_symbol;
1.1431 +extern const struct bfd_symbol * const bfd_ind_symbol;
1.1432 +
1.1433 +/* Macros to handle insertion and deletion of a bfd's sections. These
1.1434 + only handle the list pointers, ie. do not adjust section_count,
1.1435 + target_index etc. */
1.1436 +#define bfd_section_list_remove(ABFD, PS) \
1.1437 + do \
1.1438 + { \
1.1439 + asection **_ps = PS; \
1.1440 + asection *_s = *_ps; \
1.1441 + *_ps = _s->next; \
1.1442 + if (_s->next == NULL) \
1.1443 + (ABFD)->section_tail = _ps; \
1.1444 + } \
1.1445 + while (0)
1.1446 +#define bfd_section_list_insert(ABFD, PS, S) \
1.1447 + do \
1.1448 + { \
1.1449 + asection **_ps = PS; \
1.1450 + asection *_s = S; \
1.1451 + _s->next = *_ps; \
1.1452 + *_ps = _s; \
1.1453 + if (_s->next == NULL) \
1.1454 + (ABFD)->section_tail = &_s->next; \
1.1455 + } \
1.1456 + while (0)
1.1457 +
1.1458 +void bfd_section_list_clear (bfd *);
1.1459 +
1.1460 +asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1.1461 +
1.1462 +asection *bfd_get_section_by_name_if
1.1463 + (bfd *abfd,
1.1464 + const char *name,
1.1465 + bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1.1466 + void *obj);
1.1467 +
1.1468 +char *bfd_get_unique_section_name
1.1469 + (bfd *abfd, const char *templat, int *count);
1.1470 +
1.1471 +asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1.1472 +
1.1473 +asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1.1474 +
1.1475 +asection *bfd_make_section (bfd *, const char *name);
1.1476 +
1.1477 +bfd_boolean bfd_set_section_flags
1.1478 + (bfd *abfd, asection *sec, flagword flags);
1.1479 +
1.1480 +void bfd_map_over_sections
1.1481 + (bfd *abfd,
1.1482 + void (*func) (bfd *abfd, asection *sect, void *obj),
1.1483 + void *obj);
1.1484 +
1.1485 +asection *bfd_sections_find_if
1.1486 + (bfd *abfd,
1.1487 + bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1.1488 + void *obj);
1.1489 +
1.1490 +bfd_boolean bfd_set_section_size
1.1491 + (bfd *abfd, asection *sec, bfd_size_type val);
1.1492 +
1.1493 +bfd_boolean bfd_set_section_contents
1.1494 + (bfd *abfd, asection *section, const void *data,
1.1495 + file_ptr offset, bfd_size_type count);
1.1496 +
1.1497 +bfd_boolean bfd_get_section_contents
1.1498 + (bfd *abfd, asection *section, void *location, file_ptr offset,
1.1499 + bfd_size_type count);
1.1500 +
1.1501 +bfd_boolean bfd_malloc_and_get_section
1.1502 + (bfd *abfd, asection *section, bfd_byte **buf);
1.1503 +
1.1504 +bfd_boolean bfd_copy_private_section_data
1.1505 + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1.1506 +
1.1507 +#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1.1508 + BFD_SEND (obfd, _bfd_copy_private_section_data, \
1.1509 + (ibfd, isection, obfd, osection))
1.1510 +void _bfd_strip_section_from_output
1.1511 + (struct bfd_link_info *info, asection *section);
1.1512 +
1.1513 +bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1.1514 +
1.1515 +bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1.1516 +
1.1517 +/* Extracted from archures.c. */
1.1518 +enum bfd_architecture
1.1519 +{
1.1520 + bfd_arch_unknown, /* File arch not known. */
1.1521 + bfd_arch_obscure, /* Arch known, not one of these. */
1.1522 + bfd_arch_m68k, /* Motorola 68xxx */
1.1523 +#define bfd_mach_m68000 1
1.1524 +#define bfd_mach_m68008 2
1.1525 +#define bfd_mach_m68010 3
1.1526 +#define bfd_mach_m68020 4
1.1527 +#define bfd_mach_m68030 5
1.1528 +#define bfd_mach_m68040 6
1.1529 +#define bfd_mach_m68060 7
1.1530 +#define bfd_mach_cpu32 8
1.1531 +#define bfd_mach_mcf5200 9
1.1532 +#define bfd_mach_mcf5206e 10
1.1533 +#define bfd_mach_mcf5307 11
1.1534 +#define bfd_mach_mcf5407 12
1.1535 +#define bfd_mach_mcf528x 13
1.1536 +#define bfd_mach_mcfv4e 14
1.1537 +#define bfd_mach_mcf521x 15
1.1538 +#define bfd_mach_mcf5249 16
1.1539 +#define bfd_mach_mcf547x 17
1.1540 +#define bfd_mach_mcf548x 18
1.1541 + bfd_arch_vax, /* DEC Vax */
1.1542 + bfd_arch_i960, /* Intel 960 */
1.1543 + /* The order of the following is important.
1.1544 + lower number indicates a machine type that
1.1545 + only accepts a subset of the instructions
1.1546 + available to machines with higher numbers.
1.1547 + The exception is the "ca", which is
1.1548 + incompatible with all other machines except
1.1549 + "core". */
1.1550 +
1.1551 +#define bfd_mach_i960_core 1
1.1552 +#define bfd_mach_i960_ka_sa 2
1.1553 +#define bfd_mach_i960_kb_sb 3
1.1554 +#define bfd_mach_i960_mc 4
1.1555 +#define bfd_mach_i960_xa 5
1.1556 +#define bfd_mach_i960_ca 6
1.1557 +#define bfd_mach_i960_jx 7
1.1558 +#define bfd_mach_i960_hx 8
1.1559 +
1.1560 + bfd_arch_or32, /* OpenRISC 32 */
1.1561 +
1.1562 + bfd_arch_a29k, /* AMD 29000 */
1.1563 + bfd_arch_sparc, /* SPARC */
1.1564 +#define bfd_mach_sparc 1
1.1565 +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
1.1566 +#define bfd_mach_sparc_sparclet 2
1.1567 +#define bfd_mach_sparc_sparclite 3
1.1568 +#define bfd_mach_sparc_v8plus 4
1.1569 +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
1.1570 +#define bfd_mach_sparc_sparclite_le 6
1.1571 +#define bfd_mach_sparc_v9 7
1.1572 +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
1.1573 +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
1.1574 +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
1.1575 +/* Nonzero if MACH has the v9 instruction set. */
1.1576 +#define bfd_mach_sparc_v9_p(mach) \
1.1577 + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
1.1578 + && (mach) != bfd_mach_sparc_sparclite_le)
1.1579 +/* Nonzero if MACH is a 64 bit sparc architecture. */
1.1580 +#define bfd_mach_sparc_64bit_p(mach) \
1.1581 + ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
1.1582 + bfd_arch_mips, /* MIPS Rxxxx */
1.1583 +#define bfd_mach_mips3000 3000
1.1584 +#define bfd_mach_mips3900 3900
1.1585 +#define bfd_mach_mips4000 4000
1.1586 +#define bfd_mach_mips4010 4010
1.1587 +#define bfd_mach_mips4100 4100
1.1588 +#define bfd_mach_mips4111 4111
1.1589 +#define bfd_mach_mips4120 4120
1.1590 +#define bfd_mach_mips4300 4300
1.1591 +#define bfd_mach_mips4400 4400
1.1592 +#define bfd_mach_mips4600 4600
1.1593 +#define bfd_mach_mips4650 4650
1.1594 +#define bfd_mach_mips5000 5000
1.1595 +#define bfd_mach_mips5400 5400
1.1596 +#define bfd_mach_mips5500 5500
1.1597 +#define bfd_mach_mips6000 6000
1.1598 +#define bfd_mach_mips7000 7000
1.1599 +#define bfd_mach_mips8000 8000
1.1600 +#define bfd_mach_mips9000 9000
1.1601 +#define bfd_mach_mips10000 10000
1.1602 +#define bfd_mach_mips12000 12000
1.1603 +#define bfd_mach_mips16 16
1.1604 +#define bfd_mach_mips5 5
1.1605 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
1.1606 +#define bfd_mach_mipsisa32 32
1.1607 +#define bfd_mach_mipsisa32r2 33
1.1608 +#define bfd_mach_mipsisa64 64
1.1609 +#define bfd_mach_mipsisa64r2 65
1.1610 + bfd_arch_i386, /* Intel 386 */
1.1611 +#define bfd_mach_i386_i386 1
1.1612 +#define bfd_mach_i386_i8086 2
1.1613 +#define bfd_mach_i386_i386_intel_syntax 3
1.1614 +#define bfd_mach_x86_64 64
1.1615 +#define bfd_mach_x86_64_intel_syntax 65
1.1616 + bfd_arch_we32k, /* AT&T WE32xxx */
1.1617 + bfd_arch_tahoe, /* CCI/Harris Tahoe */
1.1618 + bfd_arch_i860, /* Intel 860 */
1.1619 + bfd_arch_i370, /* IBM 360/370 Mainframes */
1.1620 + bfd_arch_romp, /* IBM ROMP PC/RT */
1.1621 + bfd_arch_alliant, /* Alliant */
1.1622 + bfd_arch_convex, /* Convex */
1.1623 + bfd_arch_m88k, /* Motorola 88xxx */
1.1624 + bfd_arch_m98k, /* Motorola 98xxx */
1.1625 + bfd_arch_pyramid, /* Pyramid Technology */
1.1626 + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
1.1627 +#define bfd_mach_h8300 1
1.1628 +#define bfd_mach_h8300h 2
1.1629 +#define bfd_mach_h8300s 3
1.1630 +#define bfd_mach_h8300hn 4
1.1631 +#define bfd_mach_h8300sn 5
1.1632 +#define bfd_mach_h8300sx 6
1.1633 +#define bfd_mach_h8300sxn 7
1.1634 + bfd_arch_pdp11, /* DEC PDP-11 */
1.1635 + bfd_arch_powerpc, /* PowerPC */
1.1636 +#define bfd_mach_ppc 32
1.1637 +#define bfd_mach_ppc64 64
1.1638 +#define bfd_mach_ppc_403 403
1.1639 +#define bfd_mach_ppc_403gc 4030
1.1640 +#define bfd_mach_ppc_505 505
1.1641 +#define bfd_mach_ppc_601 601
1.1642 +#define bfd_mach_ppc_602 602
1.1643 +#define bfd_mach_ppc_603 603
1.1644 +#define bfd_mach_ppc_ec603e 6031
1.1645 +#define bfd_mach_ppc_604 604
1.1646 +#define bfd_mach_ppc_620 620
1.1647 +#define bfd_mach_ppc_630 630
1.1648 +#define bfd_mach_ppc_750 750
1.1649 +#define bfd_mach_ppc_860 860
1.1650 +#define bfd_mach_ppc_a35 35
1.1651 +#define bfd_mach_ppc_rs64ii 642
1.1652 +#define bfd_mach_ppc_rs64iii 643
1.1653 +#define bfd_mach_ppc_7400 7400
1.1654 +#define bfd_mach_ppc_e500 500
1.1655 + bfd_arch_rs6000, /* IBM RS/6000 */
1.1656 +#define bfd_mach_rs6k 6000
1.1657 +#define bfd_mach_rs6k_rs1 6001
1.1658 +#define bfd_mach_rs6k_rsc 6003
1.1659 +#define bfd_mach_rs6k_rs2 6002
1.1660 + bfd_arch_hppa, /* HP PA RISC */
1.1661 +#define bfd_mach_hppa10 10
1.1662 +#define bfd_mach_hppa11 11
1.1663 +#define bfd_mach_hppa20 20
1.1664 +#define bfd_mach_hppa20w 25
1.1665 + bfd_arch_d10v, /* Mitsubishi D10V */
1.1666 +#define bfd_mach_d10v 1
1.1667 +#define bfd_mach_d10v_ts2 2
1.1668 +#define bfd_mach_d10v_ts3 3
1.1669 + bfd_arch_d30v, /* Mitsubishi D30V */
1.1670 + bfd_arch_dlx, /* DLX */
1.1671 + bfd_arch_m68hc11, /* Motorola 68HC11 */
1.1672 + bfd_arch_m68hc12, /* Motorola 68HC12 */
1.1673 +#define bfd_mach_m6812_default 0
1.1674 +#define bfd_mach_m6812 1
1.1675 +#define bfd_mach_m6812s 2
1.1676 + bfd_arch_z8k, /* Zilog Z8000 */
1.1677 +#define bfd_mach_z8001 1
1.1678 +#define bfd_mach_z8002 2
1.1679 + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
1.1680 + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
1.1681 +#define bfd_mach_sh 1
1.1682 +#define bfd_mach_sh2 0x20
1.1683 +#define bfd_mach_sh_dsp 0x2d
1.1684 +#define bfd_mach_sh2a 0x2a
1.1685 +#define bfd_mach_sh2a_nofpu 0x2b
1.1686 +#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
1.1687 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
1.1688 +#define bfd_mach_sh2a_or_sh4 0x2a3
1.1689 +#define bfd_mach_sh2a_or_sh3e 0x2a4
1.1690 +#define bfd_mach_sh2e 0x2e
1.1691 +#define bfd_mach_sh3 0x30
1.1692 +#define bfd_mach_sh3_nommu 0x31
1.1693 +#define bfd_mach_sh3_dsp 0x3d
1.1694 +#define bfd_mach_sh3e 0x3e
1.1695 +#define bfd_mach_sh4 0x40
1.1696 +#define bfd_mach_sh4_nofpu 0x41
1.1697 +#define bfd_mach_sh4_nommu_nofpu 0x42
1.1698 +#define bfd_mach_sh4a 0x4a
1.1699 +#define bfd_mach_sh4a_nofpu 0x4b
1.1700 +#define bfd_mach_sh4al_dsp 0x4d
1.1701 +#define bfd_mach_sh5 0x50
1.1702 + bfd_arch_alpha, /* Dec Alpha */
1.1703 +#define bfd_mach_alpha_ev4 0x10
1.1704 +#define bfd_mach_alpha_ev5 0x20
1.1705 +#define bfd_mach_alpha_ev6 0x30
1.1706 + bfd_arch_arm, /* Advanced Risc Machines ARM. */
1.1707 +#define bfd_mach_arm_unknown 0
1.1708 +#define bfd_mach_arm_2 1
1.1709 +#define bfd_mach_arm_2a 2
1.1710 +#define bfd_mach_arm_3 3
1.1711 +#define bfd_mach_arm_3M 4
1.1712 +#define bfd_mach_arm_4 5
1.1713 +#define bfd_mach_arm_4T 6
1.1714 +#define bfd_mach_arm_5 7
1.1715 +#define bfd_mach_arm_5T 8
1.1716 +#define bfd_mach_arm_5TE 9
1.1717 +#define bfd_mach_arm_XScale 10
1.1718 +#define bfd_mach_arm_ep9312 11
1.1719 +#define bfd_mach_arm_iWMMXt 12
1.1720 + bfd_arch_ns32k, /* National Semiconductors ns32000 */
1.1721 + bfd_arch_w65, /* WDC 65816 */
1.1722 + bfd_arch_tic30, /* Texas Instruments TMS320C30 */
1.1723 + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
1.1724 +#define bfd_mach_tic3x 30
1.1725 +#define bfd_mach_tic4x 40
1.1726 + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
1.1727 + bfd_arch_tic80, /* TI TMS320c80 (MVP) */
1.1728 + bfd_arch_v850, /* NEC V850 */
1.1729 +#define bfd_mach_v850 1
1.1730 +#define bfd_mach_v850e 'E'
1.1731 +#define bfd_mach_v850e1 '1'
1.1732 + bfd_arch_arc, /* ARC Cores */
1.1733 +#define bfd_mach_arc_5 5
1.1734 +#define bfd_mach_arc_6 6
1.1735 +#define bfd_mach_arc_7 7
1.1736 +#define bfd_mach_arc_8 8
1.1737 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
1.1738 +#define bfd_mach_m32r 1 /* For backwards compatibility. */
1.1739 +#define bfd_mach_m32rx 'x'
1.1740 +#define bfd_mach_m32r2 '2'
1.1741 + bfd_arch_mn10200, /* Matsushita MN10200 */
1.1742 + bfd_arch_mn10300, /* Matsushita MN10300 */
1.1743 +#define bfd_mach_mn10300 300
1.1744 +#define bfd_mach_am33 330
1.1745 +#define bfd_mach_am33_2 332
1.1746 + bfd_arch_fr30,
1.1747 +#define bfd_mach_fr30 0x46523330
1.1748 + bfd_arch_frv,
1.1749 +#define bfd_mach_frv 1
1.1750 +#define bfd_mach_frvsimple 2
1.1751 +#define bfd_mach_fr300 300
1.1752 +#define bfd_mach_fr400 400
1.1753 +#define bfd_mach_fr450 450
1.1754 +#define bfd_mach_frvtomcat 499 /* fr500 prototype */
1.1755 +#define bfd_mach_fr500 500
1.1756 +#define bfd_mach_fr550 550
1.1757 + bfd_arch_mcore,
1.1758 + bfd_arch_ia64, /* HP/Intel ia64 */
1.1759 +#define bfd_mach_ia64_elf64 64
1.1760 +#define bfd_mach_ia64_elf32 32
1.1761 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
1.1762 +#define bfd_mach_ip2022 1
1.1763 +#define bfd_mach_ip2022ext 2
1.1764 + bfd_arch_iq2000, /* Vitesse IQ2000. */
1.1765 +#define bfd_mach_iq2000 1
1.1766 +#define bfd_mach_iq10 2
1.1767 + bfd_arch_pj,
1.1768 + bfd_arch_avr, /* Atmel AVR microcontrollers. */
1.1769 +#define bfd_mach_avr1 1
1.1770 +#define bfd_mach_avr2 2
1.1771 +#define bfd_mach_avr3 3
1.1772 +#define bfd_mach_avr4 4
1.1773 +#define bfd_mach_avr5 5
1.1774 + bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
1.1775 +#define bfd_mach_cr16c 1
1.1776 + bfd_arch_crx, /* National Semiconductor CRX. */
1.1777 +#define bfd_mach_crx 1
1.1778 + bfd_arch_cris, /* Axis CRIS */
1.1779 +#define bfd_mach_cris_v0_v10 255
1.1780 +#define bfd_mach_cris_v32 32
1.1781 +#define bfd_mach_cris_v10_v32 1032
1.1782 + bfd_arch_s390, /* IBM s390 */
1.1783 +#define bfd_mach_s390_31 31
1.1784 +#define bfd_mach_s390_64 64
1.1785 + bfd_arch_openrisc, /* OpenRISC */
1.1786 + bfd_arch_mmix, /* Donald Knuth's educational processor. */
1.1787 + bfd_arch_xstormy16,
1.1788 +#define bfd_mach_xstormy16 1
1.1789 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
1.1790 +#define bfd_mach_msp11 11
1.1791 +#define bfd_mach_msp110 110
1.1792 +#define bfd_mach_msp12 12
1.1793 +#define bfd_mach_msp13 13
1.1794 +#define bfd_mach_msp14 14
1.1795 +#define bfd_mach_msp15 15
1.1796 +#define bfd_mach_msp16 16
1.1797 +#define bfd_mach_msp31 31
1.1798 +#define bfd_mach_msp32 32
1.1799 +#define bfd_mach_msp33 33
1.1800 +#define bfd_mach_msp41 41
1.1801 +#define bfd_mach_msp42 42
1.1802 +#define bfd_mach_msp43 43
1.1803 +#define bfd_mach_msp44 44
1.1804 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
1.1805 +#define bfd_mach_xtensa 1
1.1806 + bfd_arch_maxq, /* Dallas MAXQ 10/20 */
1.1807 +#define bfd_mach_maxq10 10
1.1808 +#define bfd_mach_maxq20 20
1.1809 + bfd_arch_last
1.1810 + };
1.1811 +
1.1812 +typedef struct bfd_arch_info
1.1813 +{
1.1814 + int bits_per_word;
1.1815 + int bits_per_address;
1.1816 + int bits_per_byte;
1.1817 + enum bfd_architecture arch;
1.1818 + unsigned long mach;
1.1819 + const char *arch_name;
1.1820 + const char *printable_name;
1.1821 + unsigned int section_align_power;
1.1822 + /* TRUE if this is the default machine for the architecture.
1.1823 + The default arch should be the first entry for an arch so that
1.1824 + all the entries for that arch can be accessed via <<next>>. */
1.1825 + bfd_boolean the_default;
1.1826 + const struct bfd_arch_info * (*compatible)
1.1827 + (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
1.1828 +
1.1829 + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
1.1830 +
1.1831 + const struct bfd_arch_info *next;
1.1832 +}
1.1833 +bfd_arch_info_type;
1.1834 +
1.1835 +const char *bfd_printable_name (bfd *abfd);
1.1836 +
1.1837 +const bfd_arch_info_type *bfd_scan_arch (const char *string);
1.1838 +
1.1839 +const char **bfd_arch_list (void);
1.1840 +
1.1841 +const bfd_arch_info_type *bfd_arch_get_compatible
1.1842 + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
1.1843 +
1.1844 +void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
1.1845 +
1.1846 +enum bfd_architecture bfd_get_arch (bfd *abfd);
1.1847 +
1.1848 +unsigned long bfd_get_mach (bfd *abfd);
1.1849 +
1.1850 +unsigned int bfd_arch_bits_per_byte (bfd *abfd);
1.1851 +
1.1852 +unsigned int bfd_arch_bits_per_address (bfd *abfd);
1.1853 +
1.1854 +const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
1.1855 +
1.1856 +const bfd_arch_info_type *bfd_lookup_arch
1.1857 + (enum bfd_architecture arch, unsigned long machine);
1.1858 +
1.1859 +const char *bfd_printable_arch_mach
1.1860 + (enum bfd_architecture arch, unsigned long machine);
1.1861 +
1.1862 +unsigned int bfd_octets_per_byte (bfd *abfd);
1.1863 +
1.1864 +unsigned int bfd_arch_mach_octets_per_byte
1.1865 + (enum bfd_architecture arch, unsigned long machine);
1.1866 +
1.1867 +/* Extracted from reloc.c. */
1.1868 +typedef enum bfd_reloc_status
1.1869 +{
1.1870 + /* No errors detected. */
1.1871 + bfd_reloc_ok,
1.1872 +
1.1873 + /* The relocation was performed, but there was an overflow. */
1.1874 + bfd_reloc_overflow,
1.1875 +
1.1876 + /* The address to relocate was not within the section supplied. */
1.1877 + bfd_reloc_outofrange,
1.1878 +
1.1879 + /* Used by special functions. */
1.1880 + bfd_reloc_continue,
1.1881 +
1.1882 + /* Unsupported relocation size requested. */
1.1883 + bfd_reloc_notsupported,
1.1884 +
1.1885 + /* Unused. */
1.1886 + bfd_reloc_other,
1.1887 +
1.1888 + /* The symbol to relocate against was undefined. */
1.1889 + bfd_reloc_undefined,
1.1890 +
1.1891 + /* The relocation was performed, but may not be ok - presently
1.1892 + generated only when linking i960 coff files with i960 b.out
1.1893 + symbols. If this type is returned, the error_message argument
1.1894 + to bfd_perform_relocation will be set. */
1.1895 + bfd_reloc_dangerous
1.1896 + }
1.1897 + bfd_reloc_status_type;
1.1898 +
1.1899 +
1.1900 +typedef struct reloc_cache_entry
1.1901 +{
1.1902 + /* A pointer into the canonical table of pointers. */
1.1903 + struct bfd_symbol **sym_ptr_ptr;
1.1904 +
1.1905 + /* offset in section. */
1.1906 + bfd_size_type address;
1.1907 +
1.1908 + /* addend for relocation value. */
1.1909 + bfd_vma addend;
1.1910 +
1.1911 + /* Pointer to how to perform the required relocation. */
1.1912 + reloc_howto_type *howto;
1.1913 +
1.1914 +}
1.1915 +arelent;
1.1916 +
1.1917 +enum complain_overflow
1.1918 +{
1.1919 + /* Do not complain on overflow. */
1.1920 + complain_overflow_dont,
1.1921 +
1.1922 + /* Complain if the bitfield overflows, whether it is considered
1.1923 + as signed or unsigned. */
1.1924 + complain_overflow_bitfield,
1.1925 +
1.1926 + /* Complain if the value overflows when considered as signed
1.1927 + number. */
1.1928 + complain_overflow_signed,
1.1929 +
1.1930 + /* Complain if the value overflows when considered as an
1.1931 + unsigned number. */
1.1932 + complain_overflow_unsigned
1.1933 +};
1.1934 +
1.1935 +struct reloc_howto_struct
1.1936 +{
1.1937 + /* The type field has mainly a documentary use - the back end can
1.1938 + do what it wants with it, though normally the back end's
1.1939 + external idea of what a reloc number is stored
1.1940 + in this field. For example, a PC relative word relocation
1.1941 + in a coff environment has the type 023 - because that's
1.1942 + what the outside world calls a R_PCRWORD reloc. */
1.1943 + unsigned int type;
1.1944 +
1.1945 + /* The value the final relocation is shifted right by. This drops
1.1946 + unwanted data from the relocation. */
1.1947 + unsigned int rightshift;
1.1948 +
1.1949 + /* The size of the item to be relocated. This is *not* a
1.1950 + power-of-two measure. To get the number of bytes operated
1.1951 + on by a type of relocation, use bfd_get_reloc_size. */
1.1952 + int size;
1.1953 +
1.1954 + /* The number of bits in the item to be relocated. This is used
1.1955 + when doing overflow checking. */
1.1956 + unsigned int bitsize;
1.1957 +
1.1958 + /* Notes that the relocation is relative to the location in the
1.1959 + data section of the addend. The relocation function will
1.1960 + subtract from the relocation value the address of the location
1.1961 + being relocated. */
1.1962 + bfd_boolean pc_relative;
1.1963 +
1.1964 + /* The bit position of the reloc value in the destination.
1.1965 + The relocated value is left shifted by this amount. */
1.1966 + unsigned int bitpos;
1.1967 +
1.1968 + /* What type of overflow error should be checked for when
1.1969 + relocating. */
1.1970 + enum complain_overflow complain_on_overflow;
1.1971 +
1.1972 + /* If this field is non null, then the supplied function is
1.1973 + called rather than the normal function. This allows really
1.1974 + strange relocation methods to be accommodated (e.g., i960 callj
1.1975 + instructions). */
1.1976 + bfd_reloc_status_type (*special_function)
1.1977 + (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
1.1978 + bfd *, char **);
1.1979 +
1.1980 + /* The textual name of the relocation type. */
1.1981 + char *name;
1.1982 +
1.1983 + /* Some formats record a relocation addend in the section contents
1.1984 + rather than with the relocation. For ELF formats this is the
1.1985 + distinction between USE_REL and USE_RELA (though the code checks
1.1986 + for USE_REL == 1/0). The value of this field is TRUE if the
1.1987 + addend is recorded with the section contents; when performing a
1.1988 + partial link (ld -r) the section contents (the data) will be
1.1989 + modified. The value of this field is FALSE if addends are
1.1990 + recorded with the relocation (in arelent.addend); when performing
1.1991 + a partial link the relocation will be modified.
1.1992 + All relocations for all ELF USE_RELA targets should set this field
1.1993 + to FALSE (values of TRUE should be looked on with suspicion).
1.1994 + However, the converse is not true: not all relocations of all ELF
1.1995 + USE_REL targets set this field to TRUE. Why this is so is peculiar
1.1996 + to each particular target. For relocs that aren't used in partial
1.1997 + links (e.g. GOT stuff) it doesn't matter what this is set to. */
1.1998 + bfd_boolean partial_inplace;
1.1999 +
1.2000 + /* src_mask selects the part of the instruction (or data) to be used
1.2001 + in the relocation sum. If the target relocations don't have an
1.2002 + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
1.2003 + dst_mask to extract the addend from the section contents. If
1.2004 + relocations do have an addend in the reloc, eg. ELF USE_RELA, this
1.2005 + field should be zero. Non-zero values for ELF USE_RELA targets are
1.2006 + bogus as in those cases the value in the dst_mask part of the
1.2007 + section contents should be treated as garbage. */
1.2008 + bfd_vma src_mask;
1.2009 +
1.2010 + /* dst_mask selects which parts of the instruction (or data) are
1.2011 + replaced with a relocated value. */
1.2012 + bfd_vma dst_mask;
1.2013 +
1.2014 + /* When some formats create PC relative instructions, they leave
1.2015 + the value of the pc of the place being relocated in the offset
1.2016 + slot of the instruction, so that a PC relative relocation can
1.2017 + be made just by adding in an ordinary offset (e.g., sun3 a.out).
1.2018 + Some formats leave the displacement part of an instruction
1.2019 + empty (e.g., m88k bcs); this flag signals the fact. */
1.2020 + bfd_boolean pcrel_offset;
1.2021 +};
1.2022 +
1.2023 +#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
1.2024 + { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
1.2025 +#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
1.2026 + HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
1.2027 + NAME, FALSE, 0, 0, IN)
1.2028 +
1.2029 +#define EMPTY_HOWTO(C) \
1.2030 + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
1.2031 + NULL, FALSE, 0, 0, FALSE)
1.2032 +
1.2033 +#define HOWTO_PREPARE(relocation, symbol) \
1.2034 + { \
1.2035 + if (symbol != NULL) \
1.2036 + { \
1.2037 + if (bfd_is_com_section (symbol->section)) \
1.2038 + { \
1.2039 + relocation = 0; \
1.2040 + } \
1.2041 + else \
1.2042 + { \
1.2043 + relocation = symbol->value; \
1.2044 + } \
1.2045 + } \
1.2046 + }
1.2047 +
1.2048 +unsigned int bfd_get_reloc_size (reloc_howto_type *);
1.2049 +
1.2050 +typedef struct relent_chain
1.2051 +{
1.2052 + arelent relent;
1.2053 + struct relent_chain *next;
1.2054 +}
1.2055 +arelent_chain;
1.2056 +
1.2057 +bfd_reloc_status_type bfd_check_overflow
1.2058 + (enum complain_overflow how,
1.2059 + unsigned int bitsize,
1.2060 + unsigned int rightshift,
1.2061 + unsigned int addrsize,
1.2062 + bfd_vma relocation);
1.2063 +
1.2064 +bfd_reloc_status_type bfd_perform_relocation
1.2065 + (bfd *abfd,
1.2066 + arelent *reloc_entry,
1.2067 + void *data,
1.2068 + asection *input_section,
1.2069 + bfd *output_bfd,
1.2070 + char **error_message);
1.2071 +
1.2072 +bfd_reloc_status_type bfd_install_relocation
1.2073 + (bfd *abfd,
1.2074 + arelent *reloc_entry,
1.2075 + void *data, bfd_vma data_start,
1.2076 + asection *input_section,
1.2077 + char **error_message);
1.2078 +
1.2079 +enum bfd_reloc_code_real {
1.2080 + _dummy_first_bfd_reloc_code_real,
1.2081 +
1.2082 +
1.2083 +/* Basic absolute relocations of N bits. */
1.2084 + BFD_RELOC_64,
1.2085 + BFD_RELOC_32,
1.2086 + BFD_RELOC_26,
1.2087 + BFD_RELOC_24,
1.2088 + BFD_RELOC_16,
1.2089 + BFD_RELOC_14,
1.2090 + BFD_RELOC_8,
1.2091 +
1.2092 +/* PC-relative relocations. Sometimes these are relative to the address
1.2093 +of the relocation itself; sometimes they are relative to the start of
1.2094 +the section containing the relocation. It depends on the specific target.
1.2095 +
1.2096 +The 24-bit relocation is used in some Intel 960 configurations. */
1.2097 + BFD_RELOC_64_PCREL,
1.2098 + BFD_RELOC_32_PCREL,
1.2099 + BFD_RELOC_24_PCREL,
1.2100 + BFD_RELOC_16_PCREL,
1.2101 + BFD_RELOC_12_PCREL,
1.2102 + BFD_RELOC_8_PCREL,
1.2103 +
1.2104 +/* Section relative relocations. Some targets need this for DWARF2. */
1.2105 + BFD_RELOC_32_SECREL,
1.2106 +
1.2107 +/* For ELF. */
1.2108 + BFD_RELOC_32_GOT_PCREL,
1.2109 + BFD_RELOC_16_GOT_PCREL,
1.2110 + BFD_RELOC_8_GOT_PCREL,
1.2111 + BFD_RELOC_32_GOTOFF,
1.2112 + BFD_RELOC_16_GOTOFF,
1.2113 + BFD_RELOC_LO16_GOTOFF,
1.2114 + BFD_RELOC_HI16_GOTOFF,
1.2115 + BFD_RELOC_HI16_S_GOTOFF,
1.2116 + BFD_RELOC_8_GOTOFF,
1.2117 + BFD_RELOC_64_PLT_PCREL,
1.2118 + BFD_RELOC_32_PLT_PCREL,
1.2119 + BFD_RELOC_24_PLT_PCREL,
1.2120 + BFD_RELOC_16_PLT_PCREL,
1.2121 + BFD_RELOC_8_PLT_PCREL,
1.2122 + BFD_RELOC_64_PLTOFF,
1.2123 + BFD_RELOC_32_PLTOFF,
1.2124 + BFD_RELOC_16_PLTOFF,
1.2125 + BFD_RELOC_LO16_PLTOFF,
1.2126 + BFD_RELOC_HI16_PLTOFF,
1.2127 + BFD_RELOC_HI16_S_PLTOFF,
1.2128 + BFD_RELOC_8_PLTOFF,
1.2129 +
1.2130 +/* Relocations used by 68K ELF. */
1.2131 + BFD_RELOC_68K_GLOB_DAT,
1.2132 + BFD_RELOC_68K_JMP_SLOT,
1.2133 + BFD_RELOC_68K_RELATIVE,
1.2134 +
1.2135 +/* Linkage-table relative. */
1.2136 + BFD_RELOC_32_BASEREL,
1.2137 + BFD_RELOC_16_BASEREL,
1.2138 + BFD_RELOC_LO16_BASEREL,
1.2139 + BFD_RELOC_HI16_BASEREL,
1.2140 + BFD_RELOC_HI16_S_BASEREL,
1.2141 + BFD_RELOC_8_BASEREL,
1.2142 + BFD_RELOC_RVA,
1.2143 +
1.2144 +/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
1.2145 + BFD_RELOC_8_FFnn,
1.2146 +
1.2147 +/* These PC-relative relocations are stored as word displacements --
1.2148 +i.e., byte displacements shifted right two bits. The 30-bit word
1.2149 +displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
1.2150 +SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
1.2151 +signed 16-bit displacement is used on the MIPS, and the 23-bit
1.2152 +displacement is used on the Alpha. */
1.2153 + BFD_RELOC_32_PCREL_S2,
1.2154 + BFD_RELOC_16_PCREL_S2,
1.2155 + BFD_RELOC_23_PCREL_S2,
1.2156 +
1.2157 +/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
1.2158 +the target word. These are used on the SPARC. */
1.2159 + BFD_RELOC_HI22,
1.2160 + BFD_RELOC_LO10,
1.2161 +
1.2162 +/* For systems that allocate a Global Pointer register, these are
1.2163 +displacements off that register. These relocation types are
1.2164 +handled specially, because the value the register will have is
1.2165 +decided relatively late. */
1.2166 + BFD_RELOC_GPREL16,
1.2167 + BFD_RELOC_GPREL32,
1.2168 +
1.2169 +/* Reloc types used for i960/b.out. */
1.2170 + BFD_RELOC_I960_CALLJ,
1.2171 +
1.2172 +/* SPARC ELF relocations. There is probably some overlap with other
1.2173 +relocation types already defined. */
1.2174 + BFD_RELOC_NONE,
1.2175 + BFD_RELOC_SPARC_WDISP22,
1.2176 + BFD_RELOC_SPARC22,
1.2177 + BFD_RELOC_SPARC13,
1.2178 + BFD_RELOC_SPARC_GOT10,
1.2179 + BFD_RELOC_SPARC_GOT13,
1.2180 + BFD_RELOC_SPARC_GOT22,
1.2181 + BFD_RELOC_SPARC_PC10,
1.2182 + BFD_RELOC_SPARC_PC22,
1.2183 + BFD_RELOC_SPARC_WPLT30,
1.2184 + BFD_RELOC_SPARC_COPY,
1.2185 + BFD_RELOC_SPARC_GLOB_DAT,
1.2186 + BFD_RELOC_SPARC_JMP_SLOT,
1.2187 + BFD_RELOC_SPARC_RELATIVE,
1.2188 + BFD_RELOC_SPARC_UA16,
1.2189 + BFD_RELOC_SPARC_UA32,
1.2190 + BFD_RELOC_SPARC_UA64,
1.2191 +
1.2192 +/* I think these are specific to SPARC a.out (e.g., Sun 4). */
1.2193 + BFD_RELOC_SPARC_BASE13,
1.2194 + BFD_RELOC_SPARC_BASE22,
1.2195 +
1.2196 +/* SPARC64 relocations */
1.2197 +#define BFD_RELOC_SPARC_64 BFD_RELOC_64
1.2198 + BFD_RELOC_SPARC_10,
1.2199 + BFD_RELOC_SPARC_11,
1.2200 + BFD_RELOC_SPARC_OLO10,
1.2201 + BFD_RELOC_SPARC_HH22,
1.2202 + BFD_RELOC_SPARC_HM10,
1.2203 + BFD_RELOC_SPARC_LM22,
1.2204 + BFD_RELOC_SPARC_PC_HH22,
1.2205 + BFD_RELOC_SPARC_PC_HM10,
1.2206 + BFD_RELOC_SPARC_PC_LM22,
1.2207 + BFD_RELOC_SPARC_WDISP16,
1.2208 + BFD_RELOC_SPARC_WDISP19,
1.2209 + BFD_RELOC_SPARC_7,
1.2210 + BFD_RELOC_SPARC_6,
1.2211 + BFD_RELOC_SPARC_5,
1.2212 +#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
1.2213 + BFD_RELOC_SPARC_PLT32,
1.2214 + BFD_RELOC_SPARC_PLT64,
1.2215 + BFD_RELOC_SPARC_HIX22,
1.2216 + BFD_RELOC_SPARC_LOX10,
1.2217 + BFD_RELOC_SPARC_H44,
1.2218 + BFD_RELOC_SPARC_M44,
1.2219 + BFD_RELOC_SPARC_L44,
1.2220 + BFD_RELOC_SPARC_REGISTER,
1.2221 +
1.2222 +/* SPARC little endian relocation */
1.2223 + BFD_RELOC_SPARC_REV32,
1.2224 +
1.2225 +/* SPARC TLS relocations */
1.2226 + BFD_RELOC_SPARC_TLS_GD_HI22,
1.2227 + BFD_RELOC_SPARC_TLS_GD_LO10,
1.2228 + BFD_RELOC_SPARC_TLS_GD_ADD,
1.2229 + BFD_RELOC_SPARC_TLS_GD_CALL,
1.2230 + BFD_RELOC_SPARC_TLS_LDM_HI22,
1.2231 + BFD_RELOC_SPARC_TLS_LDM_LO10,
1.2232 + BFD_RELOC_SPARC_TLS_LDM_ADD,
1.2233 + BFD_RELOC_SPARC_TLS_LDM_CALL,
1.2234 + BFD_RELOC_SPARC_TLS_LDO_HIX22,
1.2235 + BFD_RELOC_SPARC_TLS_LDO_LOX10,
1.2236 + BFD_RELOC_SPARC_TLS_LDO_ADD,
1.2237 + BFD_RELOC_SPARC_TLS_IE_HI22,
1.2238 + BFD_RELOC_SPARC_TLS_IE_LO10,
1.2239 + BFD_RELOC_SPARC_TLS_IE_LD,
1.2240 + BFD_RELOC_SPARC_TLS_IE_LDX,
1.2241 + BFD_RELOC_SPARC_TLS_IE_ADD,
1.2242 + BFD_RELOC_SPARC_TLS_LE_HIX22,
1.2243 + BFD_RELOC_SPARC_TLS_LE_LOX10,
1.2244 + BFD_RELOC_SPARC_TLS_DTPMOD32,
1.2245 + BFD_RELOC_SPARC_TLS_DTPMOD64,
1.2246 + BFD_RELOC_SPARC_TLS_DTPOFF32,
1.2247 + BFD_RELOC_SPARC_TLS_DTPOFF64,
1.2248 + BFD_RELOC_SPARC_TLS_TPOFF32,
1.2249 + BFD_RELOC_SPARC_TLS_TPOFF64,
1.2250 +
1.2251 +/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
1.2252 +"addend" in some special way.
1.2253 +For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
1.2254 +writing; when reading, it will be the absolute section symbol. The
1.2255 +addend is the displacement in bytes of the "lda" instruction from
1.2256 +the "ldah" instruction (which is at the address of this reloc). */
1.2257 + BFD_RELOC_ALPHA_GPDISP_HI16,
1.2258 +
1.2259 +/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
1.2260 +with GPDISP_HI16 relocs. The addend is ignored when writing the
1.2261 +relocations out, and is filled in with the file's GP value on
1.2262 +reading, for convenience. */
1.2263 + BFD_RELOC_ALPHA_GPDISP_LO16,
1.2264 +
1.2265 +/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
1.2266 +relocation except that there is no accompanying GPDISP_LO16
1.2267 +relocation. */
1.2268 + BFD_RELOC_ALPHA_GPDISP,
1.2269 +
1.2270 +/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
1.2271 +the assembler turns it into a LDQ instruction to load the address of
1.2272 +the symbol, and then fills in a register in the real instruction.
1.2273 +
1.2274 +The LITERAL reloc, at the LDQ instruction, refers to the .lita
1.2275 +section symbol. The addend is ignored when writing, but is filled
1.2276 +in with the file's GP value on reading, for convenience, as with the
1.2277 +GPDISP_LO16 reloc.
1.2278 +
1.2279 +The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
1.2280 +It should refer to the symbol to be referenced, as with 16_GOTOFF,
1.2281 +but it generates output not based on the position within the .got
1.2282 +section, but relative to the GP value chosen for the file during the
1.2283 +final link stage.
1.2284 +
1.2285 +The LITUSE reloc, on the instruction using the loaded address, gives
1.2286 +information to the linker that it might be able to use to optimize
1.2287 +away some literal section references. The symbol is ignored (read
1.2288 +as the absolute section symbol), and the "addend" indicates the type
1.2289 +of instruction using the register:
1.2290 +1 - "memory" fmt insn
1.2291 +2 - byte-manipulation (byte offset reg)
1.2292 +3 - jsr (target of branch) */
1.2293 + BFD_RELOC_ALPHA_LITERAL,
1.2294 + BFD_RELOC_ALPHA_ELF_LITERAL,
1.2295 + BFD_RELOC_ALPHA_LITUSE,
1.2296 +
1.2297 +/* The HINT relocation indicates a value that should be filled into the
1.2298 +"hint" field of a jmp/jsr/ret instruction, for possible branch-
1.2299 +prediction logic which may be provided on some processors. */
1.2300 + BFD_RELOC_ALPHA_HINT,
1.2301 +
1.2302 +/* The LINKAGE relocation outputs a linkage pair in the object file,
1.2303 +which is filled by the linker. */
1.2304 + BFD_RELOC_ALPHA_LINKAGE,
1.2305 +
1.2306 +/* The CODEADDR relocation outputs a STO_CA in the object file,
1.2307 +which is filled by the linker. */
1.2308 + BFD_RELOC_ALPHA_CODEADDR,
1.2309 +
1.2310 +/* The GPREL_HI/LO relocations together form a 32-bit offset from the
1.2311 +GP register. */
1.2312 + BFD_RELOC_ALPHA_GPREL_HI16,
1.2313 + BFD_RELOC_ALPHA_GPREL_LO16,
1.2314 +
1.2315 +/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
1.2316 +share a common GP, and the target address is adjusted for
1.2317 +STO_ALPHA_STD_GPLOAD. */
1.2318 + BFD_RELOC_ALPHA_BRSGP,
1.2319 +
1.2320 +/* Alpha thread-local storage relocations. */
1.2321 + BFD_RELOC_ALPHA_TLSGD,
1.2322 + BFD_RELOC_ALPHA_TLSLDM,
1.2323 + BFD_RELOC_ALPHA_DTPMOD64,
1.2324 + BFD_RELOC_ALPHA_GOTDTPREL16,
1.2325 + BFD_RELOC_ALPHA_DTPREL64,
1.2326 + BFD_RELOC_ALPHA_DTPREL_HI16,
1.2327 + BFD_RELOC_ALPHA_DTPREL_LO16,
1.2328 + BFD_RELOC_ALPHA_DTPREL16,
1.2329 + BFD_RELOC_ALPHA_GOTTPREL16,
1.2330 + BFD_RELOC_ALPHA_TPREL64,
1.2331 + BFD_RELOC_ALPHA_TPREL_HI16,
1.2332 + BFD_RELOC_ALPHA_TPREL_LO16,
1.2333 + BFD_RELOC_ALPHA_TPREL16,
1.2334 +
1.2335 +/* Bits 27..2 of the relocation address shifted right 2 bits;
1.2336 +simple reloc otherwise. */
1.2337 + BFD_RELOC_MIPS_JMP,
1.2338 +
1.2339 +/* The MIPS16 jump instruction. */
1.2340 + BFD_RELOC_MIPS16_JMP,
1.2341 +
1.2342 +/* MIPS16 GP relative reloc. */
1.2343 + BFD_RELOC_MIPS16_GPREL,
1.2344 +
1.2345 +/* High 16 bits of 32-bit value; simple reloc. */
1.2346 + BFD_RELOC_HI16,
1.2347 +
1.2348 +/* High 16 bits of 32-bit value but the low 16 bits will be sign
1.2349 +extended and added to form the final result. If the low 16
1.2350 +bits form a negative number, we need to add one to the high value
1.2351 +to compensate for the borrow when the low bits are added. */
1.2352 + BFD_RELOC_HI16_S,
1.2353 +
1.2354 +/* Low 16 bits. */
1.2355 + BFD_RELOC_LO16,
1.2356 +
1.2357 +/* MIPS16 high 16 bits of 32-bit value. */
1.2358 + BFD_RELOC_MIPS16_HI16,
1.2359 +
1.2360 +/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
1.2361 +extended and added to form the final result. If the low 16
1.2362 +bits form a negative number, we need to add one to the high value
1.2363 +to compensate for the borrow when the low bits are added. */
1.2364 + BFD_RELOC_MIPS16_HI16_S,
1.2365 +
1.2366 +/* MIPS16 low 16 bits. */
1.2367 + BFD_RELOC_MIPS16_LO16,
1.2368 +
1.2369 +/* Relocation against a MIPS literal section. */
1.2370 + BFD_RELOC_MIPS_LITERAL,
1.2371 +
1.2372 +/* MIPS ELF relocations. */
1.2373 + BFD_RELOC_MIPS_GOT16,
1.2374 + BFD_RELOC_MIPS_CALL16,
1.2375 + BFD_RELOC_MIPS_GOT_HI16,
1.2376 + BFD_RELOC_MIPS_GOT_LO16,
1.2377 + BFD_RELOC_MIPS_CALL_HI16,
1.2378 + BFD_RELOC_MIPS_CALL_LO16,
1.2379 + BFD_RELOC_MIPS_SUB,
1.2380 + BFD_RELOC_MIPS_GOT_PAGE,
1.2381 + BFD_RELOC_MIPS_GOT_OFST,
1.2382 + BFD_RELOC_MIPS_GOT_DISP,
1.2383 + BFD_RELOC_MIPS_SHIFT5,
1.2384 + BFD_RELOC_MIPS_SHIFT6,
1.2385 + BFD_RELOC_MIPS_INSERT_A,
1.2386 + BFD_RELOC_MIPS_INSERT_B,
1.2387 + BFD_RELOC_MIPS_DELETE,
1.2388 + BFD_RELOC_MIPS_HIGHEST,
1.2389 + BFD_RELOC_MIPS_HIGHER,
1.2390 + BFD_RELOC_MIPS_SCN_DISP,
1.2391 + BFD_RELOC_MIPS_REL16,
1.2392 + BFD_RELOC_MIPS_RELGOT,
1.2393 + BFD_RELOC_MIPS_JALR,
1.2394 + BFD_RELOC_MIPS_TLS_DTPMOD32,
1.2395 + BFD_RELOC_MIPS_TLS_DTPREL32,
1.2396 + BFD_RELOC_MIPS_TLS_DTPMOD64,
1.2397 + BFD_RELOC_MIPS_TLS_DTPREL64,
1.2398 + BFD_RELOC_MIPS_TLS_GD,
1.2399 + BFD_RELOC_MIPS_TLS_LDM,
1.2400 + BFD_RELOC_MIPS_TLS_DTPREL_HI16,
1.2401 + BFD_RELOC_MIPS_TLS_DTPREL_LO16,
1.2402 + BFD_RELOC_MIPS_TLS_GOTTPREL,
1.2403 + BFD_RELOC_MIPS_TLS_TPREL32,
1.2404 + BFD_RELOC_MIPS_TLS_TPREL64,
1.2405 + BFD_RELOC_MIPS_TLS_TPREL_HI16,
1.2406 + BFD_RELOC_MIPS_TLS_TPREL_LO16,
1.2407 +
1.2408 +
1.2409 +/* Fujitsu Frv Relocations. */
1.2410 + BFD_RELOC_FRV_LABEL16,
1.2411 + BFD_RELOC_FRV_LABEL24,
1.2412 + BFD_RELOC_FRV_LO16,
1.2413 + BFD_RELOC_FRV_HI16,
1.2414 + BFD_RELOC_FRV_GPREL12,
1.2415 + BFD_RELOC_FRV_GPRELU12,
1.2416 + BFD_RELOC_FRV_GPREL32,
1.2417 + BFD_RELOC_FRV_GPRELHI,
1.2418 + BFD_RELOC_FRV_GPRELLO,
1.2419 + BFD_RELOC_FRV_GOT12,
1.2420 + BFD_RELOC_FRV_GOTHI,
1.2421 + BFD_RELOC_FRV_GOTLO,
1.2422 + BFD_RELOC_FRV_FUNCDESC,
1.2423 + BFD_RELOC_FRV_FUNCDESC_GOT12,
1.2424 + BFD_RELOC_FRV_FUNCDESC_GOTHI,
1.2425 + BFD_RELOC_FRV_FUNCDESC_GOTLO,
1.2426 + BFD_RELOC_FRV_FUNCDESC_VALUE,
1.2427 + BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
1.2428 + BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
1.2429 + BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
1.2430 + BFD_RELOC_FRV_GOTOFF12,
1.2431 + BFD_RELOC_FRV_GOTOFFHI,
1.2432 + BFD_RELOC_FRV_GOTOFFLO,
1.2433 + BFD_RELOC_FRV_GETTLSOFF,
1.2434 + BFD_RELOC_FRV_TLSDESC_VALUE,
1.2435 + BFD_RELOC_FRV_GOTTLSDESC12,
1.2436 + BFD_RELOC_FRV_GOTTLSDESCHI,
1.2437 + BFD_RELOC_FRV_GOTTLSDESCLO,
1.2438 + BFD_RELOC_FRV_TLSMOFF12,
1.2439 + BFD_RELOC_FRV_TLSMOFFHI,
1.2440 + BFD_RELOC_FRV_TLSMOFFLO,
1.2441 + BFD_RELOC_FRV_GOTTLSOFF12,
1.2442 + BFD_RELOC_FRV_GOTTLSOFFHI,
1.2443 + BFD_RELOC_FRV_GOTTLSOFFLO,
1.2444 + BFD_RELOC_FRV_TLSOFF,
1.2445 + BFD_RELOC_FRV_TLSDESC_RELAX,
1.2446 + BFD_RELOC_FRV_GETTLSOFF_RELAX,
1.2447 + BFD_RELOC_FRV_TLSOFF_RELAX,
1.2448 + BFD_RELOC_FRV_TLSMOFF,
1.2449 +
1.2450 +
1.2451 +/* This is a 24bit GOT-relative reloc for the mn10300. */
1.2452 + BFD_RELOC_MN10300_GOTOFF24,
1.2453 +
1.2454 +/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
1.2455 +in the instruction. */
1.2456 + BFD_RELOC_MN10300_GOT32,
1.2457 +
1.2458 +/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
1.2459 +in the instruction. */
1.2460 + BFD_RELOC_MN10300_GOT24,
1.2461 +
1.2462 +/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
1.2463 +in the instruction. */
1.2464 + BFD_RELOC_MN10300_GOT16,
1.2465 +
1.2466 +/* Copy symbol at runtime. */
1.2467 + BFD_RELOC_MN10300_COPY,
1.2468 +
1.2469 +/* Create GOT entry. */
1.2470 + BFD_RELOC_MN10300_GLOB_DAT,
1.2471 +
1.2472 +/* Create PLT entry. */
1.2473 + BFD_RELOC_MN10300_JMP_SLOT,
1.2474 +
1.2475 +/* Adjust by program base. */
1.2476 + BFD_RELOC_MN10300_RELATIVE,
1.2477 +
1.2478 +
1.2479 +/* i386/elf relocations */
1.2480 + BFD_RELOC_386_GOT32,
1.2481 + BFD_RELOC_386_PLT32,
1.2482 + BFD_RELOC_386_COPY,
1.2483 + BFD_RELOC_386_GLOB_DAT,
1.2484 + BFD_RELOC_386_JUMP_SLOT,
1.2485 + BFD_RELOC_386_RELATIVE,
1.2486 + BFD_RELOC_386_GOTOFF,
1.2487 + BFD_RELOC_386_GOTPC,
1.2488 + BFD_RELOC_386_TLS_TPOFF,
1.2489 + BFD_RELOC_386_TLS_IE,
1.2490 + BFD_RELOC_386_TLS_GOTIE,
1.2491 + BFD_RELOC_386_TLS_LE,
1.2492 + BFD_RELOC_386_TLS_GD,
1.2493 + BFD_RELOC_386_TLS_LDM,
1.2494 + BFD_RELOC_386_TLS_LDO_32,
1.2495 + BFD_RELOC_386_TLS_IE_32,
1.2496 + BFD_RELOC_386_TLS_LE_32,
1.2497 + BFD_RELOC_386_TLS_DTPMOD32,
1.2498 + BFD_RELOC_386_TLS_DTPOFF32,
1.2499 + BFD_RELOC_386_TLS_TPOFF32,
1.2500 +
1.2501 +/* x86-64/elf relocations */
1.2502 + BFD_RELOC_X86_64_GOT32,
1.2503 + BFD_RELOC_X86_64_PLT32,
1.2504 + BFD_RELOC_X86_64_COPY,
1.2505 + BFD_RELOC_X86_64_GLOB_DAT,
1.2506 + BFD_RELOC_X86_64_JUMP_SLOT,
1.2507 + BFD_RELOC_X86_64_RELATIVE,
1.2508 + BFD_RELOC_X86_64_GOTPCREL,
1.2509 + BFD_RELOC_X86_64_32S,
1.2510 + BFD_RELOC_X86_64_DTPMOD64,
1.2511 + BFD_RELOC_X86_64_DTPOFF64,
1.2512 + BFD_RELOC_X86_64_TPOFF64,
1.2513 + BFD_RELOC_X86_64_TLSGD,
1.2514 + BFD_RELOC_X86_64_TLSLD,
1.2515 + BFD_RELOC_X86_64_DTPOFF32,
1.2516 + BFD_RELOC_X86_64_GOTTPOFF,
1.2517 + BFD_RELOC_X86_64_TPOFF32,
1.2518 +
1.2519 +/* ns32k relocations */
1.2520 + BFD_RELOC_NS32K_IMM_8,
1.2521 + BFD_RELOC_NS32K_IMM_16,
1.2522 + BFD_RELOC_NS32K_IMM_32,
1.2523 + BFD_RELOC_NS32K_IMM_8_PCREL,
1.2524 + BFD_RELOC_NS32K_IMM_16_PCREL,
1.2525 + BFD_RELOC_NS32K_IMM_32_PCREL,
1.2526 + BFD_RELOC_NS32K_DISP_8,
1.2527 + BFD_RELOC_NS32K_DISP_16,
1.2528 + BFD_RELOC_NS32K_DISP_32,
1.2529 + BFD_RELOC_NS32K_DISP_8_PCREL,
1.2530 + BFD_RELOC_NS32K_DISP_16_PCREL,
1.2531 + BFD_RELOC_NS32K_DISP_32_PCREL,
1.2532 +
1.2533 +/* PDP11 relocations */
1.2534 + BFD_RELOC_PDP11_DISP_8_PCREL,
1.2535 + BFD_RELOC_PDP11_DISP_6_PCREL,
1.2536 +
1.2537 +/* Picojava relocs. Not all of these appear in object files. */
1.2538 + BFD_RELOC_PJ_CODE_HI16,
1.2539 + BFD_RELOC_PJ_CODE_LO16,
1.2540 + BFD_RELOC_PJ_CODE_DIR16,
1.2541 + BFD_RELOC_PJ_CODE_DIR32,
1.2542 + BFD_RELOC_PJ_CODE_REL16,
1.2543 + BFD_RELOC_PJ_CODE_REL32,
1.2544 +
1.2545 +/* Power(rs6000) and PowerPC relocations. */
1.2546 + BFD_RELOC_PPC_B26,
1.2547 + BFD_RELOC_PPC_BA26,
1.2548 + BFD_RELOC_PPC_TOC16,
1.2549 + BFD_RELOC_PPC_B16,
1.2550 + BFD_RELOC_PPC_B16_BRTAKEN,
1.2551 + BFD_RELOC_PPC_B16_BRNTAKEN,
1.2552 + BFD_RELOC_PPC_BA16,
1.2553 + BFD_RELOC_PPC_BA16_BRTAKEN,
1.2554 + BFD_RELOC_PPC_BA16_BRNTAKEN,
1.2555 + BFD_RELOC_PPC_COPY,
1.2556 + BFD_RELOC_PPC_GLOB_DAT,
1.2557 + BFD_RELOC_PPC_JMP_SLOT,
1.2558 + BFD_RELOC_PPC_RELATIVE,
1.2559 + BFD_RELOC_PPC_LOCAL24PC,
1.2560 + BFD_RELOC_PPC_EMB_NADDR32,
1.2561 + BFD_RELOC_PPC_EMB_NADDR16,
1.2562 + BFD_RELOC_PPC_EMB_NADDR16_LO,
1.2563 + BFD_RELOC_PPC_EMB_NADDR16_HI,
1.2564 + BFD_RELOC_PPC_EMB_NADDR16_HA,
1.2565 + BFD_RELOC_PPC_EMB_SDAI16,
1.2566 + BFD_RELOC_PPC_EMB_SDA2I16,
1.2567 + BFD_RELOC_PPC_EMB_SDA2REL,
1.2568 + BFD_RELOC_PPC_EMB_SDA21,
1.2569 + BFD_RELOC_PPC_EMB_MRKREF,
1.2570 + BFD_RELOC_PPC_EMB_RELSEC16,
1.2571 + BFD_RELOC_PPC_EMB_RELST_LO,
1.2572 + BFD_RELOC_PPC_EMB_RELST_HI,
1.2573 + BFD_RELOC_PPC_EMB_RELST_HA,
1.2574 + BFD_RELOC_PPC_EMB_BIT_FLD,
1.2575 + BFD_RELOC_PPC_EMB_RELSDA,
1.2576 + BFD_RELOC_PPC64_HIGHER,
1.2577 + BFD_RELOC_PPC64_HIGHER_S,
1.2578 + BFD_RELOC_PPC64_HIGHEST,
1.2579 + BFD_RELOC_PPC64_HIGHEST_S,
1.2580 + BFD_RELOC_PPC64_TOC16_LO,
1.2581 + BFD_RELOC_PPC64_TOC16_HI,
1.2582 + BFD_RELOC_PPC64_TOC16_HA,
1.2583 + BFD_RELOC_PPC64_TOC,
1.2584 + BFD_RELOC_PPC64_PLTGOT16,
1.2585 + BFD_RELOC_PPC64_PLTGOT16_LO,
1.2586 + BFD_RELOC_PPC64_PLTGOT16_HI,
1.2587 + BFD_RELOC_PPC64_PLTGOT16_HA,
1.2588 + BFD_RELOC_PPC64_ADDR16_DS,
1.2589 + BFD_RELOC_PPC64_ADDR16_LO_DS,
1.2590 + BFD_RELOC_PPC64_GOT16_DS,
1.2591 + BFD_RELOC_PPC64_GOT16_LO_DS,
1.2592 + BFD_RELOC_PPC64_PLT16_LO_DS,
1.2593 + BFD_RELOC_PPC64_SECTOFF_DS,
1.2594 + BFD_RELOC_PPC64_SECTOFF_LO_DS,
1.2595 + BFD_RELOC_PPC64_TOC16_DS,
1.2596 + BFD_RELOC_PPC64_TOC16_LO_DS,
1.2597 + BFD_RELOC_PPC64_PLTGOT16_DS,
1.2598 + BFD_RELOC_PPC64_PLTGOT16_LO_DS,
1.2599 +
1.2600 +/* PowerPC and PowerPC64 thread-local storage relocations. */
1.2601 + BFD_RELOC_PPC_TLS,
1.2602 + BFD_RELOC_PPC_DTPMOD,
1.2603 + BFD_RELOC_PPC_TPREL16,
1.2604 + BFD_RELOC_PPC_TPREL16_LO,
1.2605 + BFD_RELOC_PPC_TPREL16_HI,
1.2606 + BFD_RELOC_PPC_TPREL16_HA,
1.2607 + BFD_RELOC_PPC_TPREL,
1.2608 + BFD_RELOC_PPC_DTPREL16,
1.2609 + BFD_RELOC_PPC_DTPREL16_LO,
1.2610 + BFD_RELOC_PPC_DTPREL16_HI,
1.2611 + BFD_RELOC_PPC_DTPREL16_HA,
1.2612 + BFD_RELOC_PPC_DTPREL,
1.2613 + BFD_RELOC_PPC_GOT_TLSGD16,
1.2614 + BFD_RELOC_PPC_GOT_TLSGD16_LO,
1.2615 + BFD_RELOC_PPC_GOT_TLSGD16_HI,
1.2616 + BFD_RELOC_PPC_GOT_TLSGD16_HA,
1.2617 + BFD_RELOC_PPC_GOT_TLSLD16,
1.2618 + BFD_RELOC_PPC_GOT_TLSLD16_LO,
1.2619 + BFD_RELOC_PPC_GOT_TLSLD16_HI,
1.2620 + BFD_RELOC_PPC_GOT_TLSLD16_HA,
1.2621 + BFD_RELOC_PPC_GOT_TPREL16,
1.2622 + BFD_RELOC_PPC_GOT_TPREL16_LO,
1.2623 + BFD_RELOC_PPC_GOT_TPREL16_HI,
1.2624 + BFD_RELOC_PPC_GOT_TPREL16_HA,
1.2625 + BFD_RELOC_PPC_GOT_DTPREL16,
1.2626 + BFD_RELOC_PPC_GOT_DTPREL16_LO,
1.2627 + BFD_RELOC_PPC_GOT_DTPREL16_HI,
1.2628 + BFD_RELOC_PPC_GOT_DTPREL16_HA,
1.2629 + BFD_RELOC_PPC64_TPREL16_DS,
1.2630 + BFD_RELOC_PPC64_TPREL16_LO_DS,
1.2631 + BFD_RELOC_PPC64_TPREL16_HIGHER,
1.2632 + BFD_RELOC_PPC64_TPREL16_HIGHERA,
1.2633 + BFD_RELOC_PPC64_TPREL16_HIGHEST,
1.2634 + BFD_RELOC_PPC64_TPREL16_HIGHESTA,
1.2635 + BFD_RELOC_PPC64_DTPREL16_DS,
1.2636 + BFD_RELOC_PPC64_DTPREL16_LO_DS,
1.2637 + BFD_RELOC_PPC64_DTPREL16_HIGHER,
1.2638 + BFD_RELOC_PPC64_DTPREL16_HIGHERA,
1.2639 + BFD_RELOC_PPC64_DTPREL16_HIGHEST,
1.2640 + BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
1.2641 +
1.2642 +/* IBM 370/390 relocations */
1.2643 + BFD_RELOC_I370_D12,
1.2644 +
1.2645 +/* The type of reloc used to build a constructor table - at the moment
1.2646 +probably a 32 bit wide absolute relocation, but the target can choose.
1.2647 +It generally does map to one of the other relocation types. */
1.2648 + BFD_RELOC_CTOR,
1.2649 +
1.2650 +/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
1.2651 +not stored in the instruction. */
1.2652 + BFD_RELOC_ARM_PCREL_BRANCH,
1.2653 +
1.2654 +/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
1.2655 +not stored in the instruction. The 2nd lowest bit comes from a 1 bit
1.2656 +field in the instruction. */
1.2657 + BFD_RELOC_ARM_PCREL_BLX,
1.2658 +
1.2659 +/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
1.2660 +not stored in the instruction. The 2nd lowest bit comes from a 1 bit
1.2661 +field in the instruction. */
1.2662 + BFD_RELOC_THUMB_PCREL_BLX,
1.2663 +
1.2664 +/* These relocs are only used within the ARM assembler. They are not
1.2665 +(at present) written to any object files. */
1.2666 + BFD_RELOC_ARM_IMMEDIATE,
1.2667 + BFD_RELOC_ARM_ADRL_IMMEDIATE,
1.2668 + BFD_RELOC_ARM_OFFSET_IMM,
1.2669 + BFD_RELOC_ARM_SHIFT_IMM,
1.2670 + BFD_RELOC_ARM_SMI,
1.2671 + BFD_RELOC_ARM_SWI,
1.2672 + BFD_RELOC_ARM_MULTI,
1.2673 + BFD_RELOC_ARM_CP_OFF_IMM,
1.2674 + BFD_RELOC_ARM_CP_OFF_IMM_S2,
1.2675 + BFD_RELOC_ARM_ADR_IMM,
1.2676 + BFD_RELOC_ARM_LDR_IMM,
1.2677 + BFD_RELOC_ARM_LITERAL,
1.2678 + BFD_RELOC_ARM_IN_POOL,
1.2679 + BFD_RELOC_ARM_OFFSET_IMM8,
1.2680 + BFD_RELOC_ARM_HWLITERAL,
1.2681 + BFD_RELOC_ARM_THUMB_ADD,
1.2682 + BFD_RELOC_ARM_THUMB_IMM,
1.2683 + BFD_RELOC_ARM_THUMB_SHIFT,
1.2684 + BFD_RELOC_ARM_THUMB_OFFSET,
1.2685 + BFD_RELOC_ARM_GOT12,
1.2686 + BFD_RELOC_ARM_GOT32,
1.2687 + BFD_RELOC_ARM_JUMP_SLOT,
1.2688 + BFD_RELOC_ARM_COPY,
1.2689 + BFD_RELOC_ARM_GLOB_DAT,
1.2690 + BFD_RELOC_ARM_PLT32,
1.2691 + BFD_RELOC_ARM_RELATIVE,
1.2692 + BFD_RELOC_ARM_GOTOFF,
1.2693 + BFD_RELOC_ARM_GOTPC,
1.2694 +
1.2695 +/* Pc-relative or absolute relocation depending on target. Used for
1.2696 +entries in .init_array sections. */
1.2697 + BFD_RELOC_ARM_TARGET1,
1.2698 +
1.2699 +/* Read-only segment base relative address. */
1.2700 + BFD_RELOC_ARM_ROSEGREL32,
1.2701 +
1.2702 +/* Data segment base relative address. */
1.2703 + BFD_RELOC_ARM_SBREL32,
1.2704 +
1.2705 +/* This reloc is used for References to RTTI dta from exception handling
1.2706 +tables. The actual definition depends on the target. It may be a
1.2707 +pc-relative or some form of GOT-indirect relocation. */
1.2708 + BFD_RELOC_ARM_TARGET2,
1.2709 +
1.2710 +/* 31-bit PC relative address. */
1.2711 + BFD_RELOC_ARM_PREL31,
1.2712 +
1.2713 +/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
1.2714 + BFD_RELOC_SH_PCDISP8BY2,
1.2715 + BFD_RELOC_SH_PCDISP12BY2,
1.2716 + BFD_RELOC_SH_IMM3,
1.2717 + BFD_RELOC_SH_IMM3U,
1.2718 + BFD_RELOC_SH_DISP12,
1.2719 + BFD_RELOC_SH_DISP12BY2,
1.2720 + BFD_RELOC_SH_DISP12BY4,
1.2721 + BFD_RELOC_SH_DISP12BY8,
1.2722 + BFD_RELOC_SH_DISP20,
1.2723 + BFD_RELOC_SH_DISP20BY8,
1.2724 + BFD_RELOC_SH_IMM4,
1.2725 + BFD_RELOC_SH_IMM4BY2,
1.2726 + BFD_RELOC_SH_IMM4BY4,
1.2727 + BFD_RELOC_SH_IMM8,
1.2728 + BFD_RELOC_SH_IMM8BY2,
1.2729 + BFD_RELOC_SH_IMM8BY4,
1.2730 + BFD_RELOC_SH_PCRELIMM8BY2,
1.2731 + BFD_RELOC_SH_PCRELIMM8BY4,
1.2732 + BFD_RELOC_SH_SWITCH16,
1.2733 + BFD_RELOC_SH_SWITCH32,
1.2734 + BFD_RELOC_SH_USES,
1.2735 + BFD_RELOC_SH_COUNT,
1.2736 + BFD_RELOC_SH_ALIGN,
1.2737 + BFD_RELOC_SH_CODE,
1.2738 + BFD_RELOC_SH_DATA,
1.2739 + BFD_RELOC_SH_LABEL,
1.2740 + BFD_RELOC_SH_LOOP_START,
1.2741 + BFD_RELOC_SH_LOOP_END,
1.2742 + BFD_RELOC_SH_COPY,
1.2743 + BFD_RELOC_SH_GLOB_DAT,
1.2744 + BFD_RELOC_SH_JMP_SLOT,
1.2745 + BFD_RELOC_SH_RELATIVE,
1.2746 + BFD_RELOC_SH_GOTPC,
1.2747 + BFD_RELOC_SH_GOT_LOW16,
1.2748 + BFD_RELOC_SH_GOT_MEDLOW16,
1.2749 + BFD_RELOC_SH_GOT_MEDHI16,
1.2750 + BFD_RELOC_SH_GOT_HI16,
1.2751 + BFD_RELOC_SH_GOTPLT_LOW16,
1.2752 + BFD_RELOC_SH_GOTPLT_MEDLOW16,
1.2753 + BFD_RELOC_SH_GOTPLT_MEDHI16,
1.2754 + BFD_RELOC_SH_GOTPLT_HI16,
1.2755 + BFD_RELOC_SH_PLT_LOW16,
1.2756 + BFD_RELOC_SH_PLT_MEDLOW16,
1.2757 + BFD_RELOC_SH_PLT_MEDHI16,
1.2758 + BFD_RELOC_SH_PLT_HI16,
1.2759 + BFD_RELOC_SH_GOTOFF_LOW16,
1.2760 + BFD_RELOC_SH_GOTOFF_MEDLOW16,
1.2761 + BFD_RELOC_SH_GOTOFF_MEDHI16,
1.2762 + BFD_RELOC_SH_GOTOFF_HI16,
1.2763 + BFD_RELOC_SH_GOTPC_LOW16,
1.2764 + BFD_RELOC_SH_GOTPC_MEDLOW16,
1.2765 + BFD_RELOC_SH_GOTPC_MEDHI16,
1.2766 + BFD_RELOC_SH_GOTPC_HI16,
1.2767 + BFD_RELOC_SH_COPY64,
1.2768 + BFD_RELOC_SH_GLOB_DAT64,
1.2769 + BFD_RELOC_SH_JMP_SLOT64,
1.2770 + BFD_RELOC_SH_RELATIVE64,
1.2771 + BFD_RELOC_SH_GOT10BY4,
1.2772 + BFD_RELOC_SH_GOT10BY8,
1.2773 + BFD_RELOC_SH_GOTPLT10BY4,
1.2774 + BFD_RELOC_SH_GOTPLT10BY8,
1.2775 + BFD_RELOC_SH_GOTPLT32,
1.2776 + BFD_RELOC_SH_SHMEDIA_CODE,
1.2777 + BFD_RELOC_SH_IMMU5,
1.2778 + BFD_RELOC_SH_IMMS6,
1.2779 + BFD_RELOC_SH_IMMS6BY32,
1.2780 + BFD_RELOC_SH_IMMU6,
1.2781 + BFD_RELOC_SH_IMMS10,
1.2782 + BFD_RELOC_SH_IMMS10BY2,
1.2783 + BFD_RELOC_SH_IMMS10BY4,
1.2784 + BFD_RELOC_SH_IMMS10BY8,
1.2785 + BFD_RELOC_SH_IMMS16,
1.2786 + BFD_RELOC_SH_IMMU16,
1.2787 + BFD_RELOC_SH_IMM_LOW16,
1.2788 + BFD_RELOC_SH_IMM_LOW16_PCREL,
1.2789 + BFD_RELOC_SH_IMM_MEDLOW16,
1.2790 + BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
1.2791 + BFD_RELOC_SH_IMM_MEDHI16,
1.2792 + BFD_RELOC_SH_IMM_MEDHI16_PCREL,
1.2793 + BFD_RELOC_SH_IMM_HI16,
1.2794 + BFD_RELOC_SH_IMM_HI16_PCREL,
1.2795 + BFD_RELOC_SH_PT_16,
1.2796 + BFD_RELOC_SH_TLS_GD_32,
1.2797 + BFD_RELOC_SH_TLS_LD_32,
1.2798 + BFD_RELOC_SH_TLS_LDO_32,
1.2799 + BFD_RELOC_SH_TLS_IE_32,
1.2800 + BFD_RELOC_SH_TLS_LE_32,
1.2801 + BFD_RELOC_SH_TLS_DTPMOD32,
1.2802 + BFD_RELOC_SH_TLS_DTPOFF32,
1.2803 + BFD_RELOC_SH_TLS_TPOFF32,
1.2804 +
1.2805 +/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
1.2806 +be zero and is not stored in the instruction. */
1.2807 + BFD_RELOC_THUMB_PCREL_BRANCH9,
1.2808 + BFD_RELOC_THUMB_PCREL_BRANCH12,
1.2809 + BFD_RELOC_THUMB_PCREL_BRANCH23,
1.2810 +
1.2811 +/* ARC Cores relocs.
1.2812 +ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
1.2813 +not stored in the instruction. The high 20 bits are installed in bits 26
1.2814 +through 7 of the instruction. */
1.2815 + BFD_RELOC_ARC_B22_PCREL,
1.2816 +
1.2817 +/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
1.2818 +stored in the instruction. The high 24 bits are installed in bits 23
1.2819 +through 0. */
1.2820 + BFD_RELOC_ARC_B26,
1.2821 +
1.2822 +/* Mitsubishi D10V relocs.
1.2823 +This is a 10-bit reloc with the right 2 bits
1.2824 +assumed to be 0. */
1.2825 + BFD_RELOC_D10V_10_PCREL_R,
1.2826 +
1.2827 +/* Mitsubishi D10V relocs.
1.2828 +This is a 10-bit reloc with the right 2 bits
1.2829 +assumed to be 0. This is the same as the previous reloc
1.2830 +except it is in the left container, i.e.,
1.2831 +shifted left 15 bits. */
1.2832 + BFD_RELOC_D10V_10_PCREL_L,
1.2833 +
1.2834 +/* This is an 18-bit reloc with the right 2 bits
1.2835 +assumed to be 0. */
1.2836 + BFD_RELOC_D10V_18,
1.2837 +
1.2838 +/* This is an 18-bit reloc with the right 2 bits
1.2839 +assumed to be 0. */
1.2840 + BFD_RELOC_D10V_18_PCREL,
1.2841 +
1.2842 +/* Mitsubishi D30V relocs.
1.2843 +This is a 6-bit absolute reloc. */
1.2844 + BFD_RELOC_D30V_6,
1.2845 +
1.2846 +/* This is a 6-bit pc-relative reloc with
1.2847 +the right 3 bits assumed to be 0. */
1.2848 + BFD_RELOC_D30V_9_PCREL,
1.2849 +
1.2850 +/* This is a 6-bit pc-relative reloc with
1.2851 +the right 3 bits assumed to be 0. Same
1.2852 +as the previous reloc but on the right side
1.2853 +of the container. */
1.2854 + BFD_RELOC_D30V_9_PCREL_R,
1.2855 +
1.2856 +/* This is a 12-bit absolute reloc with the
1.2857 +right 3 bitsassumed to be 0. */
1.2858 + BFD_RELOC_D30V_15,
1.2859 +
1.2860 +/* This is a 12-bit pc-relative reloc with
1.2861 +the right 3 bits assumed to be 0. */
1.2862 + BFD_RELOC_D30V_15_PCREL,
1.2863 +
1.2864 +/* This is a 12-bit pc-relative reloc with
1.2865 +the right 3 bits assumed to be 0. Same
1.2866 +as the previous reloc but on the right side
1.2867 +of the container. */
1.2868 + BFD_RELOC_D30V_15_PCREL_R,
1.2869 +
1.2870 +/* This is an 18-bit absolute reloc with
1.2871 +the right 3 bits assumed to be 0. */
1.2872 + BFD_RELOC_D30V_21,
1.2873 +
1.2874 +/* This is an 18-bit pc-relative reloc with
1.2875 +the right 3 bits assumed to be 0. */
1.2876 + BFD_RELOC_D30V_21_PCREL,
1.2877 +
1.2878 +/* This is an 18-bit pc-relative reloc with
1.2879 +the right 3 bits assumed to be 0. Same
1.2880 +as the previous reloc but on the right side
1.2881 +of the container. */
1.2882 + BFD_RELOC_D30V_21_PCREL_R,
1.2883 +
1.2884 +/* This is a 32-bit absolute reloc. */
1.2885 + BFD_RELOC_D30V_32,
1.2886 +
1.2887 +/* This is a 32-bit pc-relative reloc. */
1.2888 + BFD_RELOC_D30V_32_PCREL,
1.2889 +
1.2890 +/* DLX relocs */
1.2891 + BFD_RELOC_DLX_HI16_S,
1.2892 +
1.2893 +/* DLX relocs */
1.2894 + BFD_RELOC_DLX_LO16,
1.2895 +
1.2896 +/* DLX relocs */
1.2897 + BFD_RELOC_DLX_JMP26,
1.2898 +
1.2899 +/* Renesas M32R (formerly Mitsubishi M32R) relocs.
1.2900 +This is a 24 bit absolute address. */
1.2901 + BFD_RELOC_M32R_24,
1.2902 +
1.2903 +/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
1.2904 + BFD_RELOC_M32R_10_PCREL,
1.2905 +
1.2906 +/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
1.2907 + BFD_RELOC_M32R_18_PCREL,
1.2908 +
1.2909 +/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
1.2910 + BFD_RELOC_M32R_26_PCREL,
1.2911 +
1.2912 +/* This is a 16-bit reloc containing the high 16 bits of an address
1.2913 +used when the lower 16 bits are treated as unsigned. */
1.2914 + BFD_RELOC_M32R_HI16_ULO,
1.2915 +
1.2916 +/* This is a 16-bit reloc containing the high 16 bits of an address
1.2917 +used when the lower 16 bits are treated as signed. */
1.2918 + BFD_RELOC_M32R_HI16_SLO,
1.2919 +
1.2920 +/* This is a 16-bit reloc containing the lower 16 bits of an address. */
1.2921 + BFD_RELOC_M32R_LO16,
1.2922 +
1.2923 +/* This is a 16-bit reloc containing the small data area offset for use in
1.2924 +add3, load, and store instructions. */
1.2925 + BFD_RELOC_M32R_SDA16,
1.2926 +
1.2927 +/* For PIC. */
1.2928 + BFD_RELOC_M32R_GOT24,
1.2929 + BFD_RELOC_M32R_26_PLTREL,
1.2930 + BFD_RELOC_M32R_COPY,
1.2931 + BFD_RELOC_M32R_GLOB_DAT,
1.2932 + BFD_RELOC_M32R_JMP_SLOT,
1.2933 + BFD_RELOC_M32R_RELATIVE,
1.2934 + BFD_RELOC_M32R_GOTOFF,
1.2935 + BFD_RELOC_M32R_GOTOFF_HI_ULO,
1.2936 + BFD_RELOC_M32R_GOTOFF_HI_SLO,
1.2937 + BFD_RELOC_M32R_GOTOFF_LO,
1.2938 + BFD_RELOC_M32R_GOTPC24,
1.2939 + BFD_RELOC_M32R_GOT16_HI_ULO,
1.2940 + BFD_RELOC_M32R_GOT16_HI_SLO,
1.2941 + BFD_RELOC_M32R_GOT16_LO,
1.2942 + BFD_RELOC_M32R_GOTPC_HI_ULO,
1.2943 + BFD_RELOC_M32R_GOTPC_HI_SLO,
1.2944 + BFD_RELOC_M32R_GOTPC_LO,
1.2945 +
1.2946 +/* This is a 9-bit reloc */
1.2947 + BFD_RELOC_V850_9_PCREL,
1.2948 +
1.2949 +/* This is a 22-bit reloc */
1.2950 + BFD_RELOC_V850_22_PCREL,
1.2951 +
1.2952 +/* This is a 16 bit offset from the short data area pointer. */
1.2953 + BFD_RELOC_V850_SDA_16_16_OFFSET,
1.2954 +
1.2955 +/* This is a 16 bit offset (of which only 15 bits are used) from the
1.2956 +short data area pointer. */
1.2957 + BFD_RELOC_V850_SDA_15_16_OFFSET,
1.2958 +
1.2959 +/* This is a 16 bit offset from the zero data area pointer. */
1.2960 + BFD_RELOC_V850_ZDA_16_16_OFFSET,
1.2961 +
1.2962 +/* This is a 16 bit offset (of which only 15 bits are used) from the
1.2963 +zero data area pointer. */
1.2964 + BFD_RELOC_V850_ZDA_15_16_OFFSET,
1.2965 +
1.2966 +/* This is an 8 bit offset (of which only 6 bits are used) from the
1.2967 +tiny data area pointer. */
1.2968 + BFD_RELOC_V850_TDA_6_8_OFFSET,
1.2969 +
1.2970 +/* This is an 8bit offset (of which only 7 bits are used) from the tiny
1.2971 +data area pointer. */
1.2972 + BFD_RELOC_V850_TDA_7_8_OFFSET,
1.2973 +
1.2974 +/* This is a 7 bit offset from the tiny data area pointer. */
1.2975 + BFD_RELOC_V850_TDA_7_7_OFFSET,
1.2976 +
1.2977 +/* This is a 16 bit offset from the tiny data area pointer. */
1.2978 + BFD_RELOC_V850_TDA_16_16_OFFSET,
1.2979 +
1.2980 +/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
1.2981 +data area pointer. */
1.2982 + BFD_RELOC_V850_TDA_4_5_OFFSET,
1.2983 +
1.2984 +/* This is a 4 bit offset from the tiny data area pointer. */
1.2985 + BFD_RELOC_V850_TDA_4_4_OFFSET,
1.2986 +
1.2987 +/* This is a 16 bit offset from the short data area pointer, with the
1.2988 +bits placed non-contiguously in the instruction. */
1.2989 + BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
1.2990 +
1.2991 +/* This is a 16 bit offset from the zero data area pointer, with the
1.2992 +bits placed non-contiguously in the instruction. */
1.2993 + BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
1.2994 +
1.2995 +/* This is a 6 bit offset from the call table base pointer. */
1.2996 + BFD_RELOC_V850_CALLT_6_7_OFFSET,
1.2997 +
1.2998 +/* This is a 16 bit offset from the call table base pointer. */
1.2999 + BFD_RELOC_V850_CALLT_16_16_OFFSET,
1.3000 +
1.3001 +/* Used for relaxing indirect function calls. */
1.3002 + BFD_RELOC_V850_LONGCALL,
1.3003 +
1.3004 +/* Used for relaxing indirect jumps. */
1.3005 + BFD_RELOC_V850_LONGJUMP,
1.3006 +
1.3007 +/* Used to maintain alignment whilst relaxing. */
1.3008 + BFD_RELOC_V850_ALIGN,
1.3009 +
1.3010 +/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
1.3011 +instructions. */
1.3012 + BFD_RELOC_V850_LO16_SPLIT_OFFSET,
1.3013 +
1.3014 +/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
1.3015 +instruction. */
1.3016 + BFD_RELOC_MN10300_32_PCREL,
1.3017 +
1.3018 +/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
1.3019 +instruction. */
1.3020 + BFD_RELOC_MN10300_16_PCREL,
1.3021 +
1.3022 +/* This is a 8bit DP reloc for the tms320c30, where the most
1.3023 +significant 8 bits of a 24 bit word are placed into the least
1.3024 +significant 8 bits of the opcode. */
1.3025 + BFD_RELOC_TIC30_LDP,
1.3026 +
1.3027 +/* This is a 7bit reloc for the tms320c54x, where the least
1.3028 +significant 7 bits of a 16 bit word are placed into the least
1.3029 +significant 7 bits of the opcode. */
1.3030 + BFD_RELOC_TIC54X_PARTLS7,
1.3031 +
1.3032 +/* This is a 9bit DP reloc for the tms320c54x, where the most
1.3033 +significant 9 bits of a 16 bit word are placed into the least
1.3034 +significant 9 bits of the opcode. */
1.3035 + BFD_RELOC_TIC54X_PARTMS9,
1.3036 +
1.3037 +/* This is an extended address 23-bit reloc for the tms320c54x. */
1.3038 + BFD_RELOC_TIC54X_23,
1.3039 +
1.3040 +/* This is a 16-bit reloc for the tms320c54x, where the least
1.3041 +significant 16 bits of a 23-bit extended address are placed into
1.3042 +the opcode. */
1.3043 + BFD_RELOC_TIC54X_16_OF_23,
1.3044 +
1.3045 +/* This is a reloc for the tms320c54x, where the most
1.3046 +significant 7 bits of a 23-bit extended address are placed into
1.3047 +the opcode. */
1.3048 + BFD_RELOC_TIC54X_MS7_OF_23,
1.3049 +
1.3050 +/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
1.3051 + BFD_RELOC_FR30_48,
1.3052 +
1.3053 +/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
1.3054 +two sections. */
1.3055 + BFD_RELOC_FR30_20,
1.3056 +
1.3057 +/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
1.3058 +4 bits. */
1.3059 + BFD_RELOC_FR30_6_IN_4,
1.3060 +
1.3061 +/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
1.3062 +into 8 bits. */
1.3063 + BFD_RELOC_FR30_8_IN_8,
1.3064 +
1.3065 +/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
1.3066 +into 8 bits. */
1.3067 + BFD_RELOC_FR30_9_IN_8,
1.3068 +
1.3069 +/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
1.3070 +into 8 bits. */
1.3071 + BFD_RELOC_FR30_10_IN_8,
1.3072 +
1.3073 +/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
1.3074 +short offset into 8 bits. */
1.3075 + BFD_RELOC_FR30_9_PCREL,
1.3076 +
1.3077 +/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
1.3078 +short offset into 11 bits. */
1.3079 + BFD_RELOC_FR30_12_PCREL,
1.3080 +
1.3081 +/* Motorola Mcore relocations. */
1.3082 + BFD_RELOC_MCORE_PCREL_IMM8BY4,
1.3083 + BFD_RELOC_MCORE_PCREL_IMM11BY2,
1.3084 + BFD_RELOC_MCORE_PCREL_IMM4BY2,
1.3085 + BFD_RELOC_MCORE_PCREL_32,
1.3086 + BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
1.3087 + BFD_RELOC_MCORE_RVA,
1.3088 +
1.3089 +/* These are relocations for the GETA instruction. */
1.3090 + BFD_RELOC_MMIX_GETA,
1.3091 + BFD_RELOC_MMIX_GETA_1,
1.3092 + BFD_RELOC_MMIX_GETA_2,
1.3093 + BFD_RELOC_MMIX_GETA_3,
1.3094 +
1.3095 +/* These are relocations for a conditional branch instruction. */
1.3096 + BFD_RELOC_MMIX_CBRANCH,
1.3097 + BFD_RELOC_MMIX_CBRANCH_J,
1.3098 + BFD_RELOC_MMIX_CBRANCH_1,
1.3099 + BFD_RELOC_MMIX_CBRANCH_2,
1.3100 + BFD_RELOC_MMIX_CBRANCH_3,
1.3101 +
1.3102 +/* These are relocations for the PUSHJ instruction. */
1.3103 + BFD_RELOC_MMIX_PUSHJ,
1.3104 + BFD_RELOC_MMIX_PUSHJ_1,
1.3105 + BFD_RELOC_MMIX_PUSHJ_2,
1.3106 + BFD_RELOC_MMIX_PUSHJ_3,
1.3107 + BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
1.3108 +
1.3109 +/* These are relocations for the JMP instruction. */
1.3110 + BFD_RELOC_MMIX_JMP,
1.3111 + BFD_RELOC_MMIX_JMP_1,
1.3112 + BFD_RELOC_MMIX_JMP_2,
1.3113 + BFD_RELOC_MMIX_JMP_3,
1.3114 +
1.3115 +/* This is a relocation for a relative address as in a GETA instruction or
1.3116 +a branch. */
1.3117 + BFD_RELOC_MMIX_ADDR19,
1.3118 +
1.3119 +/* This is a relocation for a relative address as in a JMP instruction. */
1.3120 + BFD_RELOC_MMIX_ADDR27,
1.3121 +
1.3122 +/* This is a relocation for an instruction field that may be a general
1.3123 +register or a value 0..255. */
1.3124 + BFD_RELOC_MMIX_REG_OR_BYTE,
1.3125 +
1.3126 +/* This is a relocation for an instruction field that may be a general
1.3127 +register. */
1.3128 + BFD_RELOC_MMIX_REG,
1.3129 +
1.3130 +/* This is a relocation for two instruction fields holding a register and
1.3131 +an offset, the equivalent of the relocation. */
1.3132 + BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
1.3133 +
1.3134 +/* This relocation is an assertion that the expression is not allocated as
1.3135 +a global register. It does not modify contents. */
1.3136 + BFD_RELOC_MMIX_LOCAL,
1.3137 +
1.3138 +/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
1.3139 +short offset into 7 bits. */
1.3140 + BFD_RELOC_AVR_7_PCREL,
1.3141 +
1.3142 +/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
1.3143 +short offset into 12 bits. */
1.3144 + BFD_RELOC_AVR_13_PCREL,
1.3145 +
1.3146 +/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
1.3147 +program memory address) into 16 bits. */
1.3148 + BFD_RELOC_AVR_16_PM,
1.3149 +
1.3150 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
1.3151 +data memory address) into 8 bit immediate value of LDI insn. */
1.3152 + BFD_RELOC_AVR_LO8_LDI,
1.3153 +
1.3154 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
1.3155 +of data memory address) into 8 bit immediate value of LDI insn. */
1.3156 + BFD_RELOC_AVR_HI8_LDI,
1.3157 +
1.3158 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
1.3159 +of program memory address) into 8 bit immediate value of LDI insn. */
1.3160 + BFD_RELOC_AVR_HH8_LDI,
1.3161 +
1.3162 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3163 +(usually data memory address) into 8 bit immediate value of SUBI insn. */
1.3164 + BFD_RELOC_AVR_LO8_LDI_NEG,
1.3165 +
1.3166 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3167 +(high 8 bit of data memory address) into 8 bit immediate value of
1.3168 +SUBI insn. */
1.3169 + BFD_RELOC_AVR_HI8_LDI_NEG,
1.3170 +
1.3171 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3172 +(most high 8 bit of program memory address) into 8 bit immediate value
1.3173 +of LDI or SUBI insn. */
1.3174 + BFD_RELOC_AVR_HH8_LDI_NEG,
1.3175 +
1.3176 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
1.3177 +command address) into 8 bit immediate value of LDI insn. */
1.3178 + BFD_RELOC_AVR_LO8_LDI_PM,
1.3179 +
1.3180 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
1.3181 +of command address) into 8 bit immediate value of LDI insn. */
1.3182 + BFD_RELOC_AVR_HI8_LDI_PM,
1.3183 +
1.3184 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
1.3185 +of command address) into 8 bit immediate value of LDI insn. */
1.3186 + BFD_RELOC_AVR_HH8_LDI_PM,
1.3187 +
1.3188 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3189 +(usually command address) into 8 bit immediate value of SUBI insn. */
1.3190 + BFD_RELOC_AVR_LO8_LDI_PM_NEG,
1.3191 +
1.3192 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3193 +(high 8 bit of 16 bit command address) into 8 bit immediate value
1.3194 +of SUBI insn. */
1.3195 + BFD_RELOC_AVR_HI8_LDI_PM_NEG,
1.3196 +
1.3197 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
1.3198 +(high 6 bit of 22 bit command address) into 8 bit immediate
1.3199 +value of SUBI insn. */
1.3200 + BFD_RELOC_AVR_HH8_LDI_PM_NEG,
1.3201 +
1.3202 +/* This is a 32 bit reloc for the AVR that stores 23 bit value
1.3203 +into 22 bits. */
1.3204 + BFD_RELOC_AVR_CALL,
1.3205 +
1.3206 +/* This is a 16 bit reloc for the AVR that stores all needed bits
1.3207 +for absolute addressing with ldi with overflow check to linktime */
1.3208 + BFD_RELOC_AVR_LDI,
1.3209 +
1.3210 +/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
1.3211 +instructions */
1.3212 + BFD_RELOC_AVR_6,
1.3213 +
1.3214 +/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
1.3215 +instructions */
1.3216 + BFD_RELOC_AVR_6_ADIW,
1.3217 +
1.3218 +/* Direct 12 bit. */
1.3219 + BFD_RELOC_390_12,
1.3220 +
1.3221 +/* 12 bit GOT offset. */
1.3222 + BFD_RELOC_390_GOT12,
1.3223 +
1.3224 +/* 32 bit PC relative PLT address. */
1.3225 + BFD_RELOC_390_PLT32,
1.3226 +
1.3227 +/* Copy symbol at runtime. */
1.3228 + BFD_RELOC_390_COPY,
1.3229 +
1.3230 +/* Create GOT entry. */
1.3231 + BFD_RELOC_390_GLOB_DAT,
1.3232 +
1.3233 +/* Create PLT entry. */
1.3234 + BFD_RELOC_390_JMP_SLOT,
1.3235 +
1.3236 +/* Adjust by program base. */
1.3237 + BFD_RELOC_390_RELATIVE,
1.3238 +
1.3239 +/* 32 bit PC relative offset to GOT. */
1.3240 + BFD_RELOC_390_GOTPC,
1.3241 +
1.3242 +/* 16 bit GOT offset. */
1.3243 + BFD_RELOC_390_GOT16,
1.3244 +
1.3245 +/* PC relative 16 bit shifted by 1. */
1.3246 + BFD_RELOC_390_PC16DBL,
1.3247 +
1.3248 +/* 16 bit PC rel. PLT shifted by 1. */
1.3249 + BFD_RELOC_390_PLT16DBL,
1.3250 +
1.3251 +/* PC relative 32 bit shifted by 1. */
1.3252 + BFD_RELOC_390_PC32DBL,
1.3253 +
1.3254 +/* 32 bit PC rel. PLT shifted by 1. */
1.3255 + BFD_RELOC_390_PLT32DBL,
1.3256 +
1.3257 +/* 32 bit PC rel. GOT shifted by 1. */
1.3258 + BFD_RELOC_390_GOTPCDBL,
1.3259 +
1.3260 +/* 64 bit GOT offset. */
1.3261 + BFD_RELOC_390_GOT64,
1.3262 +
1.3263 +/* 64 bit PC relative PLT address. */
1.3264 + BFD_RELOC_390_PLT64,
1.3265 +
1.3266 +/* 32 bit rel. offset to GOT entry. */
1.3267 + BFD_RELOC_390_GOTENT,
1.3268 +
1.3269 +/* 64 bit offset to GOT. */
1.3270 + BFD_RELOC_390_GOTOFF64,
1.3271 +
1.3272 +/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
1.3273 + BFD_RELOC_390_GOTPLT12,
1.3274 +
1.3275 +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
1.3276 + BFD_RELOC_390_GOTPLT16,
1.3277 +
1.3278 +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
1.3279 + BFD_RELOC_390_GOTPLT32,
1.3280 +
1.3281 +/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
1.3282 + BFD_RELOC_390_GOTPLT64,
1.3283 +
1.3284 +/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
1.3285 + BFD_RELOC_390_GOTPLTENT,
1.3286 +
1.3287 +/* 16-bit rel. offset from the GOT to a PLT entry. */
1.3288 + BFD_RELOC_390_PLTOFF16,
1.3289 +
1.3290 +/* 32-bit rel. offset from the GOT to a PLT entry. */
1.3291 + BFD_RELOC_390_PLTOFF32,
1.3292 +
1.3293 +/* 64-bit rel. offset from the GOT to a PLT entry. */
1.3294 + BFD_RELOC_390_PLTOFF64,
1.3295 +
1.3296 +/* s390 tls relocations. */
1.3297 + BFD_RELOC_390_TLS_LOAD,
1.3298 + BFD_RELOC_390_TLS_GDCALL,
1.3299 + BFD_RELOC_390_TLS_LDCALL,
1.3300 + BFD_RELOC_390_TLS_GD32,
1.3301 + BFD_RELOC_390_TLS_GD64,
1.3302 + BFD_RELOC_390_TLS_GOTIE12,
1.3303 + BFD_RELOC_390_TLS_GOTIE32,
1.3304 + BFD_RELOC_390_TLS_GOTIE64,
1.3305 + BFD_RELOC_390_TLS_LDM32,
1.3306 + BFD_RELOC_390_TLS_LDM64,
1.3307 + BFD_RELOC_390_TLS_IE32,
1.3308 + BFD_RELOC_390_TLS_IE64,
1.3309 + BFD_RELOC_390_TLS_IEENT,
1.3310 + BFD_RELOC_390_TLS_LE32,
1.3311 + BFD_RELOC_390_TLS_LE64,
1.3312 + BFD_RELOC_390_TLS_LDO32,
1.3313 + BFD_RELOC_390_TLS_LDO64,
1.3314 + BFD_RELOC_390_TLS_DTPMOD,
1.3315 + BFD_RELOC_390_TLS_DTPOFF,
1.3316 + BFD_RELOC_390_TLS_TPOFF,
1.3317 +
1.3318 +/* Long displacement extension. */
1.3319 + BFD_RELOC_390_20,
1.3320 + BFD_RELOC_390_GOT20,
1.3321 + BFD_RELOC_390_GOTPLT20,
1.3322 + BFD_RELOC_390_TLS_GOTIE20,
1.3323 +
1.3324 +/* Scenix IP2K - 9-bit register number / data address */
1.3325 + BFD_RELOC_IP2K_FR9,
1.3326 +
1.3327 +/* Scenix IP2K - 4-bit register/data bank number */
1.3328 + BFD_RELOC_IP2K_BANK,
1.3329 +
1.3330 +/* Scenix IP2K - low 13 bits of instruction word address */
1.3331 + BFD_RELOC_IP2K_ADDR16CJP,
1.3332 +
1.3333 +/* Scenix IP2K - high 3 bits of instruction word address */
1.3334 + BFD_RELOC_IP2K_PAGE3,
1.3335 +
1.3336 +/* Scenix IP2K - ext/low/high 8 bits of data address */
1.3337 + BFD_RELOC_IP2K_LO8DATA,
1.3338 + BFD_RELOC_IP2K_HI8DATA,
1.3339 + BFD_RELOC_IP2K_EX8DATA,
1.3340 +
1.3341 +/* Scenix IP2K - low/high 8 bits of instruction word address */
1.3342 + BFD_RELOC_IP2K_LO8INSN,
1.3343 + BFD_RELOC_IP2K_HI8INSN,
1.3344 +
1.3345 +/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
1.3346 + BFD_RELOC_IP2K_PC_SKIP,
1.3347 +
1.3348 +/* Scenix IP2K - 16 bit word address in text section. */
1.3349 + BFD_RELOC_IP2K_TEXT,
1.3350 +
1.3351 +/* Scenix IP2K - 7-bit sp or dp offset */
1.3352 + BFD_RELOC_IP2K_FR_OFFSET,
1.3353 +
1.3354 +/* Scenix VPE4K coprocessor - data/insn-space addressing */
1.3355 + BFD_RELOC_VPE4KMATH_DATA,
1.3356 + BFD_RELOC_VPE4KMATH_INSN,
1.3357 +
1.3358 +/* These two relocations are used by the linker to determine which of
1.3359 +the entries in a C++ virtual function table are actually used. When
1.3360 +the --gc-sections option is given, the linker will zero out the entries
1.3361 +that are not used, so that the code for those functions need not be
1.3362 +included in the output.
1.3363 +
1.3364 +VTABLE_INHERIT is a zero-space relocation used to describe to the
1.3365 +linker the inheritance tree of a C++ virtual function table. The
1.3366 +relocation's symbol should be the parent class' vtable, and the
1.3367 +relocation should be located at the child vtable.
1.3368 +
1.3369 +VTABLE_ENTRY is a zero-space relocation that describes the use of a
1.3370 +virtual function table entry. The reloc's symbol should refer to the
1.3371 +table of the class mentioned in the code. Off of that base, an offset
1.3372 +describes the entry that is being used. For Rela hosts, this offset
1.3373 +is stored in the reloc's addend. For Rel hosts, we are forced to put
1.3374 +this offset in the reloc's section offset. */
1.3375 + BFD_RELOC_VTABLE_INHERIT,
1.3376 + BFD_RELOC_VTABLE_ENTRY,
1.3377 +
1.3378 +/* Intel IA64 Relocations. */
1.3379 + BFD_RELOC_IA64_IMM14,
1.3380 + BFD_RELOC_IA64_IMM22,
1.3381 + BFD_RELOC_IA64_IMM64,
1.3382 + BFD_RELOC_IA64_DIR32MSB,
1.3383 + BFD_RELOC_IA64_DIR32LSB,
1.3384 + BFD_RELOC_IA64_DIR64MSB,
1.3385 + BFD_RELOC_IA64_DIR64LSB,
1.3386 + BFD_RELOC_IA64_GPREL22,
1.3387 + BFD_RELOC_IA64_GPREL64I,
1.3388 + BFD_RELOC_IA64_GPREL32MSB,
1.3389 + BFD_RELOC_IA64_GPREL32LSB,
1.3390 + BFD_RELOC_IA64_GPREL64MSB,
1.3391 + BFD_RELOC_IA64_GPREL64LSB,
1.3392 + BFD_RELOC_IA64_LTOFF22,
1.3393 + BFD_RELOC_IA64_LTOFF64I,
1.3394 + BFD_RELOC_IA64_PLTOFF22,
1.3395 + BFD_RELOC_IA64_PLTOFF64I,
1.3396 + BFD_RELOC_IA64_PLTOFF64MSB,
1.3397 + BFD_RELOC_IA64_PLTOFF64LSB,
1.3398 + BFD_RELOC_IA64_FPTR64I,
1.3399 + BFD_RELOC_IA64_FPTR32MSB,
1.3400 + BFD_RELOC_IA64_FPTR32LSB,
1.3401 + BFD_RELOC_IA64_FPTR64MSB,
1.3402 + BFD_RELOC_IA64_FPTR64LSB,
1.3403 + BFD_RELOC_IA64_PCREL21B,
1.3404 + BFD_RELOC_IA64_PCREL21BI,
1.3405 + BFD_RELOC_IA64_PCREL21M,
1.3406 + BFD_RELOC_IA64_PCREL21F,
1.3407 + BFD_RELOC_IA64_PCREL22,
1.3408 + BFD_RELOC_IA64_PCREL60B,
1.3409 + BFD_RELOC_IA64_PCREL64I,
1.3410 + BFD_RELOC_IA64_PCREL32MSB,
1.3411 + BFD_RELOC_IA64_PCREL32LSB,
1.3412 + BFD_RELOC_IA64_PCREL64MSB,
1.3413 + BFD_RELOC_IA64_PCREL64LSB,
1.3414 + BFD_RELOC_IA64_LTOFF_FPTR22,
1.3415 + BFD_RELOC_IA64_LTOFF_FPTR64I,
1.3416 + BFD_RELOC_IA64_LTOFF_FPTR32MSB,
1.3417 + BFD_RELOC_IA64_LTOFF_FPTR32LSB,
1.3418 + BFD_RELOC_IA64_LTOFF_FPTR64MSB,
1.3419 + BFD_RELOC_IA64_LTOFF_FPTR64LSB,
1.3420 + BFD_RELOC_IA64_SEGREL32MSB,
1.3421 + BFD_RELOC_IA64_SEGREL32LSB,
1.3422 + BFD_RELOC_IA64_SEGREL64MSB,
1.3423 + BFD_RELOC_IA64_SEGREL64LSB,
1.3424 + BFD_RELOC_IA64_SECREL32MSB,
1.3425 + BFD_RELOC_IA64_SECREL32LSB,
1.3426 + BFD_RELOC_IA64_SECREL64MSB,
1.3427 + BFD_RELOC_IA64_SECREL64LSB,
1.3428 + BFD_RELOC_IA64_REL32MSB,
1.3429 + BFD_RELOC_IA64_REL32LSB,
1.3430 + BFD_RELOC_IA64_REL64MSB,
1.3431 + BFD_RELOC_IA64_REL64LSB,
1.3432 + BFD_RELOC_IA64_LTV32MSB,
1.3433 + BFD_RELOC_IA64_LTV32LSB,
1.3434 + BFD_RELOC_IA64_LTV64MSB,
1.3435 + BFD_RELOC_IA64_LTV64LSB,
1.3436 + BFD_RELOC_IA64_IPLTMSB,
1.3437 + BFD_RELOC_IA64_IPLTLSB,
1.3438 + BFD_RELOC_IA64_COPY,
1.3439 + BFD_RELOC_IA64_LTOFF22X,
1.3440 + BFD_RELOC_IA64_LDXMOV,
1.3441 + BFD_RELOC_IA64_TPREL14,
1.3442 + BFD_RELOC_IA64_TPREL22,
1.3443 + BFD_RELOC_IA64_TPREL64I,
1.3444 + BFD_RELOC_IA64_TPREL64MSB,
1.3445 + BFD_RELOC_IA64_TPREL64LSB,
1.3446 + BFD_RELOC_IA64_LTOFF_TPREL22,
1.3447 + BFD_RELOC_IA64_DTPMOD64MSB,
1.3448 + BFD_RELOC_IA64_DTPMOD64LSB,
1.3449 + BFD_RELOC_IA64_LTOFF_DTPMOD22,
1.3450 + BFD_RELOC_IA64_DTPREL14,
1.3451 + BFD_RELOC_IA64_DTPREL22,
1.3452 + BFD_RELOC_IA64_DTPREL64I,
1.3453 + BFD_RELOC_IA64_DTPREL32MSB,
1.3454 + BFD_RELOC_IA64_DTPREL32LSB,
1.3455 + BFD_RELOC_IA64_DTPREL64MSB,
1.3456 + BFD_RELOC_IA64_DTPREL64LSB,
1.3457 + BFD_RELOC_IA64_LTOFF_DTPREL22,
1.3458 +
1.3459 +/* Motorola 68HC11 reloc.
1.3460 +This is the 8 bit high part of an absolute address. */
1.3461 + BFD_RELOC_M68HC11_HI8,
1.3462 +
1.3463 +/* Motorola 68HC11 reloc.
1.3464 +This is the 8 bit low part of an absolute address. */
1.3465 + BFD_RELOC_M68HC11_LO8,
1.3466 +
1.3467 +/* Motorola 68HC11 reloc.
1.3468 +This is the 3 bit of a value. */
1.3469 + BFD_RELOC_M68HC11_3B,
1.3470 +
1.3471 +/* Motorola 68HC11 reloc.
1.3472 +This reloc marks the beginning of a jump/call instruction.
1.3473 +It is used for linker relaxation to correctly identify beginning
1.3474 +of instruction and change some branches to use PC-relative
1.3475 +addressing mode. */
1.3476 + BFD_RELOC_M68HC11_RL_JUMP,
1.3477 +
1.3478 +/* Motorola 68HC11 reloc.
1.3479 +This reloc marks a group of several instructions that gcc generates
1.3480 +and for which the linker relaxation pass can modify and/or remove
1.3481 +some of them. */
1.3482 + BFD_RELOC_M68HC11_RL_GROUP,
1.3483 +
1.3484 +/* Motorola 68HC11 reloc.
1.3485 +This is the 16-bit lower part of an address. It is used for 'call'
1.3486 +instruction to specify the symbol address without any special
1.3487 +transformation (due to memory bank window). */
1.3488 + BFD_RELOC_M68HC11_LO16,
1.3489 +
1.3490 +/* Motorola 68HC11 reloc.
1.3491 +This is a 8-bit reloc that specifies the page number of an address.
1.3492 +It is used by 'call' instruction to specify the page number of
1.3493 +the symbol. */
1.3494 + BFD_RELOC_M68HC11_PAGE,
1.3495 +
1.3496 +/* Motorola 68HC11 reloc.
1.3497 +This is a 24-bit reloc that represents the address with a 16-bit
1.3498 +value and a 8-bit page number. The symbol address is transformed
1.3499 +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
1.3500 + BFD_RELOC_M68HC11_24,
1.3501 +
1.3502 +/* Motorola 68HC12 reloc.
1.3503 +This is the 5 bits of a value. */
1.3504 + BFD_RELOC_M68HC12_5B,
1.3505 +
1.3506 +/* NS CR16C Relocations. */
1.3507 + BFD_RELOC_16C_NUM08,
1.3508 + BFD_RELOC_16C_NUM08_C,
1.3509 + BFD_RELOC_16C_NUM16,
1.3510 + BFD_RELOC_16C_NUM16_C,
1.3511 + BFD_RELOC_16C_NUM32,
1.3512 + BFD_RELOC_16C_NUM32_C,
1.3513 + BFD_RELOC_16C_DISP04,
1.3514 + BFD_RELOC_16C_DISP04_C,
1.3515 + BFD_RELOC_16C_DISP08,
1.3516 + BFD_RELOC_16C_DISP08_C,
1.3517 + BFD_RELOC_16C_DISP16,
1.3518 + BFD_RELOC_16C_DISP16_C,
1.3519 + BFD_RELOC_16C_DISP24,
1.3520 + BFD_RELOC_16C_DISP24_C,
1.3521 + BFD_RELOC_16C_DISP24a,
1.3522 + BFD_RELOC_16C_DISP24a_C,
1.3523 + BFD_RELOC_16C_REG04,
1.3524 + BFD_RELOC_16C_REG04_C,
1.3525 + BFD_RELOC_16C_REG04a,
1.3526 + BFD_RELOC_16C_REG04a_C,
1.3527 + BFD_RELOC_16C_REG14,
1.3528 + BFD_RELOC_16C_REG14_C,
1.3529 + BFD_RELOC_16C_REG16,
1.3530 + BFD_RELOC_16C_REG16_C,
1.3531 + BFD_RELOC_16C_REG20,
1.3532 + BFD_RELOC_16C_REG20_C,
1.3533 + BFD_RELOC_16C_ABS20,
1.3534 + BFD_RELOC_16C_ABS20_C,
1.3535 + BFD_RELOC_16C_ABS24,
1.3536 + BFD_RELOC_16C_ABS24_C,
1.3537 + BFD_RELOC_16C_IMM04,
1.3538 + BFD_RELOC_16C_IMM04_C,
1.3539 + BFD_RELOC_16C_IMM16,
1.3540 + BFD_RELOC_16C_IMM16_C,
1.3541 + BFD_RELOC_16C_IMM20,
1.3542 + BFD_RELOC_16C_IMM20_C,
1.3543 + BFD_RELOC_16C_IMM24,
1.3544 + BFD_RELOC_16C_IMM24_C,
1.3545 + BFD_RELOC_16C_IMM32,
1.3546 + BFD_RELOC_16C_IMM32_C,
1.3547 +
1.3548 +/* NS CRX Relocations. */
1.3549 + BFD_RELOC_CRX_REL4,
1.3550 + BFD_RELOC_CRX_REL8,
1.3551 + BFD_RELOC_CRX_REL8_CMP,
1.3552 + BFD_RELOC_CRX_REL16,
1.3553 + BFD_RELOC_CRX_REL24,
1.3554 + BFD_RELOC_CRX_REL32,
1.3555 + BFD_RELOC_CRX_REGREL12,
1.3556 + BFD_RELOC_CRX_REGREL22,
1.3557 + BFD_RELOC_CRX_REGREL28,
1.3558 + BFD_RELOC_CRX_REGREL32,
1.3559 + BFD_RELOC_CRX_ABS16,
1.3560 + BFD_RELOC_CRX_ABS32,
1.3561 + BFD_RELOC_CRX_NUM8,
1.3562 + BFD_RELOC_CRX_NUM16,
1.3563 + BFD_RELOC_CRX_NUM32,
1.3564 + BFD_RELOC_CRX_IMM16,
1.3565 + BFD_RELOC_CRX_IMM32,
1.3566 + BFD_RELOC_CRX_SWITCH8,
1.3567 + BFD_RELOC_CRX_SWITCH16,
1.3568 + BFD_RELOC_CRX_SWITCH32,
1.3569 +
1.3570 +/* These relocs are only used within the CRIS assembler. They are not
1.3571 +(at present) written to any object files. */
1.3572 + BFD_RELOC_CRIS_BDISP8,
1.3573 + BFD_RELOC_CRIS_UNSIGNED_5,
1.3574 + BFD_RELOC_CRIS_SIGNED_6,
1.3575 + BFD_RELOC_CRIS_UNSIGNED_6,
1.3576 + BFD_RELOC_CRIS_SIGNED_8,
1.3577 + BFD_RELOC_CRIS_UNSIGNED_8,
1.3578 + BFD_RELOC_CRIS_SIGNED_16,
1.3579 + BFD_RELOC_CRIS_UNSIGNED_16,
1.3580 + BFD_RELOC_CRIS_LAPCQ_OFFSET,
1.3581 + BFD_RELOC_CRIS_UNSIGNED_4,
1.3582 +
1.3583 +/* Relocs used in ELF shared libraries for CRIS. */
1.3584 + BFD_RELOC_CRIS_COPY,
1.3585 + BFD_RELOC_CRIS_GLOB_DAT,
1.3586 + BFD_RELOC_CRIS_JUMP_SLOT,
1.3587 + BFD_RELOC_CRIS_RELATIVE,
1.3588 +
1.3589 +/* 32-bit offset to symbol-entry within GOT. */
1.3590 + BFD_RELOC_CRIS_32_GOT,
1.3591 +
1.3592 +/* 16-bit offset to symbol-entry within GOT. */
1.3593 + BFD_RELOC_CRIS_16_GOT,
1.3594 +
1.3595 +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
1.3596 + BFD_RELOC_CRIS_32_GOTPLT,
1.3597 +
1.3598 +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
1.3599 + BFD_RELOC_CRIS_16_GOTPLT,
1.3600 +
1.3601 +/* 32-bit offset to symbol, relative to GOT. */
1.3602 + BFD_RELOC_CRIS_32_GOTREL,
1.3603 +
1.3604 +/* 32-bit offset to symbol with PLT entry, relative to GOT. */
1.3605 + BFD_RELOC_CRIS_32_PLT_GOTREL,
1.3606 +
1.3607 +/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
1.3608 + BFD_RELOC_CRIS_32_PLT_PCREL,
1.3609 +
1.3610 +/* Intel i860 Relocations. */
1.3611 + BFD_RELOC_860_COPY,
1.3612 + BFD_RELOC_860_GLOB_DAT,
1.3613 + BFD_RELOC_860_JUMP_SLOT,
1.3614 + BFD_RELOC_860_RELATIVE,
1.3615 + BFD_RELOC_860_PC26,
1.3616 + BFD_RELOC_860_PLT26,
1.3617 + BFD_RELOC_860_PC16,
1.3618 + BFD_RELOC_860_LOW0,
1.3619 + BFD_RELOC_860_SPLIT0,
1.3620 + BFD_RELOC_860_LOW1,
1.3621 + BFD_RELOC_860_SPLIT1,
1.3622 + BFD_RELOC_860_LOW2,
1.3623 + BFD_RELOC_860_SPLIT2,
1.3624 + BFD_RELOC_860_LOW3,
1.3625 + BFD_RELOC_860_LOGOT0,
1.3626 + BFD_RELOC_860_SPGOT0,
1.3627 + BFD_RELOC_860_LOGOT1,
1.3628 + BFD_RELOC_860_SPGOT1,
1.3629 + BFD_RELOC_860_LOGOTOFF0,
1.3630 + BFD_RELOC_860_SPGOTOFF0,
1.3631 + BFD_RELOC_860_LOGOTOFF1,
1.3632 + BFD_RELOC_860_SPGOTOFF1,
1.3633 + BFD_RELOC_860_LOGOTOFF2,
1.3634 + BFD_RELOC_860_LOGOTOFF3,
1.3635 + BFD_RELOC_860_LOPC,
1.3636 + BFD_RELOC_860_HIGHADJ,
1.3637 + BFD_RELOC_860_HAGOT,
1.3638 + BFD_RELOC_860_HAGOTOFF,
1.3639 + BFD_RELOC_860_HAPC,
1.3640 + BFD_RELOC_860_HIGH,
1.3641 + BFD_RELOC_860_HIGOT,
1.3642 + BFD_RELOC_860_HIGOTOFF,
1.3643 +
1.3644 +/* OpenRISC Relocations. */
1.3645 + BFD_RELOC_OPENRISC_ABS_26,
1.3646 + BFD_RELOC_OPENRISC_REL_26,
1.3647 +
1.3648 +/* H8 elf Relocations. */
1.3649 + BFD_RELOC_H8_DIR16A8,
1.3650 + BFD_RELOC_H8_DIR16R8,
1.3651 + BFD_RELOC_H8_DIR24A8,
1.3652 + BFD_RELOC_H8_DIR24R8,
1.3653 + BFD_RELOC_H8_DIR32A16,
1.3654 +
1.3655 +/* Sony Xstormy16 Relocations. */
1.3656 + BFD_RELOC_XSTORMY16_REL_12,
1.3657 + BFD_RELOC_XSTORMY16_12,
1.3658 + BFD_RELOC_XSTORMY16_24,
1.3659 + BFD_RELOC_XSTORMY16_FPTR16,
1.3660 +
1.3661 +/* Relocations used by VAX ELF. */
1.3662 + BFD_RELOC_VAX_GLOB_DAT,
1.3663 + BFD_RELOC_VAX_JMP_SLOT,
1.3664 + BFD_RELOC_VAX_RELATIVE,
1.3665 +
1.3666 +/* msp430 specific relocation codes */
1.3667 + BFD_RELOC_MSP430_10_PCREL,
1.3668 + BFD_RELOC_MSP430_16_PCREL,
1.3669 + BFD_RELOC_MSP430_16,
1.3670 + BFD_RELOC_MSP430_16_PCREL_BYTE,
1.3671 + BFD_RELOC_MSP430_16_BYTE,
1.3672 + BFD_RELOC_MSP430_2X_PCREL,
1.3673 + BFD_RELOC_MSP430_RL_PCREL,
1.3674 +
1.3675 +/* IQ2000 Relocations. */
1.3676 + BFD_RELOC_IQ2000_OFFSET_16,
1.3677 + BFD_RELOC_IQ2000_OFFSET_21,
1.3678 + BFD_RELOC_IQ2000_UHI16,
1.3679 +
1.3680 +/* Special Xtensa relocation used only by PLT entries in ELF shared
1.3681 +objects to indicate that the runtime linker should set the value
1.3682 +to one of its own internal functions or data structures. */
1.3683 + BFD_RELOC_XTENSA_RTLD,
1.3684 +
1.3685 +/* Xtensa relocations for ELF shared objects. */
1.3686 + BFD_RELOC_XTENSA_GLOB_DAT,
1.3687 + BFD_RELOC_XTENSA_JMP_SLOT,
1.3688 + BFD_RELOC_XTENSA_RELATIVE,
1.3689 +
1.3690 +/* Xtensa relocation used in ELF object files for symbols that may require
1.3691 +PLT entries. Otherwise, this is just a generic 32-bit relocation. */
1.3692 + BFD_RELOC_XTENSA_PLT,
1.3693 +
1.3694 +/* Xtensa relocations to mark the difference of two local symbols.
1.3695 +These are only needed to support linker relaxation and can be ignored
1.3696 +when not relaxing. The field is set to the value of the difference
1.3697 +assuming no relaxation. The relocation encodes the position of the
1.3698 +first symbol so the linker can determine whether to adjust the field
1.3699 +value. */
1.3700 + BFD_RELOC_XTENSA_DIFF8,
1.3701 + BFD_RELOC_XTENSA_DIFF16,
1.3702 + BFD_RELOC_XTENSA_DIFF32,
1.3703 +
1.3704 +/* Generic Xtensa relocations for instruction operands. Only the slot
1.3705 +number is encoded in the relocation. The relocation applies to the
1.3706 +last PC-relative immediate operand, or if there are no PC-relative
1.3707 +immediates, to the last immediate operand. */
1.3708 + BFD_RELOC_XTENSA_SLOT0_OP,
1.3709 + BFD_RELOC_XTENSA_SLOT1_OP,
1.3710 + BFD_RELOC_XTENSA_SLOT2_OP,
1.3711 + BFD_RELOC_XTENSA_SLOT3_OP,
1.3712 + BFD_RELOC_XTENSA_SLOT4_OP,
1.3713 + BFD_RELOC_XTENSA_SLOT5_OP,
1.3714 + BFD_RELOC_XTENSA_SLOT6_OP,
1.3715 + BFD_RELOC_XTENSA_SLOT7_OP,
1.3716 + BFD_RELOC_XTENSA_SLOT8_OP,
1.3717 + BFD_RELOC_XTENSA_SLOT9_OP,
1.3718 + BFD_RELOC_XTENSA_SLOT10_OP,
1.3719 + BFD_RELOC_XTENSA_SLOT11_OP,
1.3720 + BFD_RELOC_XTENSA_SLOT12_OP,
1.3721 + BFD_RELOC_XTENSA_SLOT13_OP,
1.3722 + BFD_RELOC_XTENSA_SLOT14_OP,
1.3723 +
1.3724 +/* Alternate Xtensa relocations. Only the slot is encoded in the
1.3725 +relocation. The meaning of these relocations is opcode-specific. */
1.3726 + BFD_RELOC_XTENSA_SLOT0_ALT,
1.3727 + BFD_RELOC_XTENSA_SLOT1_ALT,
1.3728 + BFD_RELOC_XTENSA_SLOT2_ALT,
1.3729 + BFD_RELOC_XTENSA_SLOT3_ALT,
1.3730 + BFD_RELOC_XTENSA_SLOT4_ALT,
1.3731 + BFD_RELOC_XTENSA_SLOT5_ALT,
1.3732 + BFD_RELOC_XTENSA_SLOT6_ALT,
1.3733 + BFD_RELOC_XTENSA_SLOT7_ALT,
1.3734 + BFD_RELOC_XTENSA_SLOT8_ALT,
1.3735 + BFD_RELOC_XTENSA_SLOT9_ALT,
1.3736 + BFD_RELOC_XTENSA_SLOT10_ALT,
1.3737 + BFD_RELOC_XTENSA_SLOT11_ALT,
1.3738 + BFD_RELOC_XTENSA_SLOT12_ALT,
1.3739 + BFD_RELOC_XTENSA_SLOT13_ALT,
1.3740 + BFD_RELOC_XTENSA_SLOT14_ALT,
1.3741 +
1.3742 +/* Xtensa relocations for backward compatibility. These have all been
1.3743 +replaced by BFD_RELOC_XTENSA_SLOT0_OP. */
1.3744 + BFD_RELOC_XTENSA_OP0,
1.3745 + BFD_RELOC_XTENSA_OP1,
1.3746 + BFD_RELOC_XTENSA_OP2,
1.3747 +
1.3748 +/* Xtensa relocation to mark that the assembler expanded the
1.3749 +instructions from an original target. The expansion size is
1.3750 +encoded in the reloc size. */
1.3751 + BFD_RELOC_XTENSA_ASM_EXPAND,
1.3752 +
1.3753 +/* Xtensa relocation to mark that the linker should simplify
1.3754 +assembler-expanded instructions. This is commonly used
1.3755 +internally by the linker after analysis of a
1.3756 +BFD_RELOC_XTENSA_ASM_EXPAND. */
1.3757 + BFD_RELOC_XTENSA_ASM_SIMPLIFY,
1.3758 + BFD_RELOC_UNUSED };
1.3759 +typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
1.3760 +reloc_howto_type *bfd_reloc_type_lookup
1.3761 + (bfd *abfd, bfd_reloc_code_real_type code);
1.3762 +
1.3763 +const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
1.3764 +
1.3765 +/* Extracted from syms.c. */
1.3766 +
1.3767 +typedef struct bfd_symbol
1.3768 +{
1.3769 + /* A pointer to the BFD which owns the symbol. This information
1.3770 + is necessary so that a back end can work out what additional
1.3771 + information (invisible to the application writer) is carried
1.3772 + with the symbol.
1.3773 +
1.3774 + This field is *almost* redundant, since you can use section->owner
1.3775 + instead, except that some symbols point to the global sections
1.3776 + bfd_{abs,com,und}_section. This could be fixed by making
1.3777 + these globals be per-bfd (or per-target-flavor). FIXME. */
1.3778 + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
1.3779 +
1.3780 + /* The text of the symbol. The name is left alone, and not copied; the
1.3781 + application may not alter it. */
1.3782 + const char *name;
1.3783 +
1.3784 + /* The value of the symbol. This really should be a union of a
1.3785 + numeric value with a pointer, since some flags indicate that
1.3786 + a pointer to another symbol is stored here. */
1.3787 + symvalue value;
1.3788 +
1.3789 + /* Attributes of a symbol. */
1.3790 +#define BSF_NO_FLAGS 0x00
1.3791 +
1.3792 + /* The symbol has local scope; <<static>> in <<C>>. The value
1.3793 + is the offset into the section of the data. */
1.3794 +#define BSF_LOCAL 0x01
1.3795 +
1.3796 + /* The symbol has global scope; initialized data in <<C>>. The
1.3797 + value is the offset into the section of the data. */
1.3798 +#define BSF_GLOBAL 0x02
1.3799 +
1.3800 + /* The symbol has global scope and is exported. The value is
1.3801 + the offset into the section of the data. */
1.3802 +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
1.3803 +
1.3804 + /* A normal C symbol would be one of:
1.3805 + <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
1.3806 + <<BSF_GLOBAL>>. */
1.3807 +
1.3808 + /* The symbol is a debugging record. The value has an arbitrary
1.3809 + meaning, unless BSF_DEBUGGING_RELOC is also set. */
1.3810 +#define BSF_DEBUGGING 0x08
1.3811 +
1.3812 + /* The symbol denotes a function entry point. Used in ELF,
1.3813 + perhaps others someday. */
1.3814 +#define BSF_FUNCTION 0x10
1.3815 +
1.3816 + /* Used by the linker. */
1.3817 +#define BSF_KEEP 0x20
1.3818 +#define BSF_KEEP_G 0x40
1.3819 +
1.3820 + /* A weak global symbol, overridable without warnings by
1.3821 + a regular global symbol of the same name. */
1.3822 +#define BSF_WEAK 0x80
1.3823 +
1.3824 + /* This symbol was created to point to a section, e.g. ELF's
1.3825 + STT_SECTION symbols. */
1.3826 +#define BSF_SECTION_SYM 0x100
1.3827 +
1.3828 + /* The symbol used to be a common symbol, but now it is
1.3829 + allocated. */
1.3830 +#define BSF_OLD_COMMON 0x200
1.3831 +
1.3832 + /* The default value for common data. */
1.3833 +#define BFD_FORT_COMM_DEFAULT_VALUE 0
1.3834 +
1.3835 + /* In some files the type of a symbol sometimes alters its
1.3836 + location in an output file - ie in coff a <<ISFCN>> symbol
1.3837 + which is also <<C_EXT>> symbol appears where it was
1.3838 + declared and not at the end of a section. This bit is set
1.3839 + by the target BFD part to convey this information. */
1.3840 +#define BSF_NOT_AT_END 0x400
1.3841 +
1.3842 + /* Signal that the symbol is the label of constructor section. */
1.3843 +#define BSF_CONSTRUCTOR 0x800
1.3844 +
1.3845 + /* Signal that the symbol is a warning symbol. The name is a
1.3846 + warning. The name of the next symbol is the one to warn about;
1.3847 + if a reference is made to a symbol with the same name as the next
1.3848 + symbol, a warning is issued by the linker. */
1.3849 +#define BSF_WARNING 0x1000
1.3850 +
1.3851 + /* Signal that the symbol is indirect. This symbol is an indirect
1.3852 + pointer to the symbol with the same name as the next symbol. */
1.3853 +#define BSF_INDIRECT 0x2000
1.3854 +
1.3855 + /* BSF_FILE marks symbols that contain a file name. This is used
1.3856 + for ELF STT_FILE symbols. */
1.3857 +#define BSF_FILE 0x4000
1.3858 +
1.3859 + /* Symbol is from dynamic linking information. */
1.3860 +#define BSF_DYNAMIC 0x8000
1.3861 +
1.3862 + /* The symbol denotes a data object. Used in ELF, and perhaps
1.3863 + others someday. */
1.3864 +#define BSF_OBJECT 0x10000
1.3865 +
1.3866 + /* This symbol is a debugging symbol. The value is the offset
1.3867 + into the section of the data. BSF_DEBUGGING should be set
1.3868 + as well. */
1.3869 +#define BSF_DEBUGGING_RELOC 0x20000
1.3870 +
1.3871 + /* This symbol is thread local. Used in ELF. */
1.3872 +#define BSF_THREAD_LOCAL 0x40000
1.3873 +
1.3874 + flagword flags;
1.3875 +
1.3876 + /* A pointer to the section to which this symbol is
1.3877 + relative. This will always be non NULL, there are special
1.3878 + sections for undefined and absolute symbols. */
1.3879 + struct bfd_section *section;
1.3880 +
1.3881 + /* Back end special data. */
1.3882 + union
1.3883 + {
1.3884 + void *p;
1.3885 + bfd_vma i;
1.3886 + }
1.3887 + udata;
1.3888 +}
1.3889 +asymbol;
1.3890 +
1.3891 +#define bfd_get_symtab_upper_bound(abfd) \
1.3892 + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
1.3893 +
1.3894 +bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
1.3895 +
1.3896 +bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
1.3897 +
1.3898 +#define bfd_is_local_label_name(abfd, name) \
1.3899 + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
1.3900 +
1.3901 +bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
1.3902 +
1.3903 +#define bfd_is_target_special_symbol(abfd, sym) \
1.3904 + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
1.3905 +
1.3906 +#define bfd_canonicalize_symtab(abfd, location) \
1.3907 + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
1.3908 +
1.3909 +bfd_boolean bfd_set_symtab
1.3910 + (bfd *abfd, asymbol **location, unsigned int count);
1.3911 +
1.3912 +void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
1.3913 +
1.3914 +#define bfd_make_empty_symbol(abfd) \
1.3915 + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
1.3916 +
1.3917 +asymbol *_bfd_generic_make_empty_symbol (bfd *);
1.3918 +
1.3919 +#define bfd_make_debug_symbol(abfd,ptr,size) \
1.3920 + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
1.3921 +
1.3922 +int bfd_decode_symclass (asymbol *symbol);
1.3923 +
1.3924 +bfd_boolean bfd_is_undefined_symclass (int symclass);
1.3925 +
1.3926 +void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
1.3927 +
1.3928 +bfd_boolean bfd_copy_private_symbol_data
1.3929 + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
1.3930 +
1.3931 +#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
1.3932 + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
1.3933 + (ibfd, isymbol, obfd, osymbol))
1.3934 +
1.3935 +/* Extracted from bfd.c. */
1.3936 +struct bfd
1.3937 +{
1.3938 + /* A unique identifier of the BFD */
1.3939 + unsigned int id;
1.3940 +
1.3941 + /* The filename the application opened the BFD with. */
1.3942 + const char *filename;
1.3943 +
1.3944 + /* A pointer to the target jump table. */
1.3945 + const struct bfd_target *xvec;
1.3946 +
1.3947 + /* The IOSTREAM, and corresponding IO vector that provide access
1.3948 + to the file backing the BFD. */
1.3949 + void *iostream;
1.3950 + const struct bfd_iovec *iovec;
1.3951 +
1.3952 + /* Is the file descriptor being cached? That is, can it be closed as
1.3953 + needed, and re-opened when accessed later? */
1.3954 + bfd_boolean cacheable;
1.3955 +
1.3956 + /* Marks whether there was a default target specified when the
1.3957 + BFD was opened. This is used to select which matching algorithm
1.3958 + to use to choose the back end. */
1.3959 + bfd_boolean target_defaulted;
1.3960 +
1.3961 + /* The caching routines use these to maintain a
1.3962 + least-recently-used list of BFDs. */
1.3963 + struct bfd *lru_prev, *lru_next;
1.3964 +
1.3965 + /* When a file is closed by the caching routines, BFD retains
1.3966 + state information on the file here... */
1.3967 + ufile_ptr where;
1.3968 +
1.3969 + /* ... and here: (``once'' means at least once). */
1.3970 + bfd_boolean opened_once;
1.3971 +
1.3972 + /* Set if we have a locally maintained mtime value, rather than
1.3973 + getting it from the file each time. */
1.3974 + bfd_boolean mtime_set;
1.3975 +
1.3976 + /* File modified time, if mtime_set is TRUE. */
1.3977 + long mtime;
1.3978 +
1.3979 + /* Reserved for an unimplemented file locking extension. */
1.3980 + int ifd;
1.3981 +
1.3982 + /* The format which belongs to the BFD. (object, core, etc.) */
1.3983 + bfd_format format;
1.3984 +
1.3985 + /* The direction with which the BFD was opened. */
1.3986 + enum bfd_direction
1.3987 + {
1.3988 + no_direction = 0,
1.3989 + read_direction = 1,
1.3990 + write_direction = 2,
1.3991 + both_direction = 3
1.3992 + }
1.3993 + direction;
1.3994 +
1.3995 + /* Format_specific flags. */
1.3996 + flagword flags;
1.3997 +
1.3998 + /* Currently my_archive is tested before adding origin to
1.3999 + anything. I believe that this can become always an add of
1.4000 + origin, with origin set to 0 for non archive files. */
1.4001 + ufile_ptr origin;
1.4002 +
1.4003 + /* Remember when output has begun, to stop strange things
1.4004 + from happening. */
1.4005 + bfd_boolean output_has_begun;
1.4006 +
1.4007 + /* A hash table for section names. */
1.4008 + struct bfd_hash_table section_htab;
1.4009 +
1.4010 + /* Pointer to linked list of sections. */
1.4011 + struct bfd_section *sections;
1.4012 +
1.4013 + /* The place where we add to the section list. */
1.4014 + struct bfd_section **section_tail;
1.4015 +
1.4016 + /* The number of sections. */
1.4017 + unsigned int section_count;
1.4018 +
1.4019 + /* Stuff only useful for object files:
1.4020 + The start address. */
1.4021 + bfd_vma start_address;
1.4022 +
1.4023 + /* Used for input and output. */
1.4024 + unsigned int symcount;
1.4025 +
1.4026 + /* Symbol table for output BFD (with symcount entries). */
1.4027 + struct bfd_symbol **outsymbols;
1.4028 +
1.4029 + /* Used for slurped dynamic symbol tables. */
1.4030 + unsigned int dynsymcount;
1.4031 +
1.4032 + /* Pointer to structure which contains architecture information. */
1.4033 + const struct bfd_arch_info *arch_info;
1.4034 +
1.4035 + /* Flag set if symbols from this BFD should not be exported. */
1.4036 + bfd_boolean no_export;
1.4037 +
1.4038 + /* Stuff only useful for archives. */
1.4039 + void *arelt_data;
1.4040 + struct bfd *my_archive; /* The containing archive BFD. */
1.4041 + struct bfd *next; /* The next BFD in the archive. */
1.4042 + struct bfd *archive_head; /* The first BFD in the archive. */
1.4043 + bfd_boolean has_armap;
1.4044 +
1.4045 + /* A chain of BFD structures involved in a link. */
1.4046 + struct bfd *link_next;
1.4047 +
1.4048 + /* A field used by _bfd_generic_link_add_archive_symbols. This will
1.4049 + be used only for archive elements. */
1.4050 + int archive_pass;
1.4051 +
1.4052 + /* Used by the back end to hold private data. */
1.4053 + union
1.4054 + {
1.4055 + struct aout_data_struct *aout_data;
1.4056 + struct artdata *aout_ar_data;
1.4057 + struct _oasys_data *oasys_obj_data;
1.4058 + struct _oasys_ar_data *oasys_ar_data;
1.4059 + struct coff_tdata *coff_obj_data;
1.4060 + struct pe_tdata *pe_obj_data;
1.4061 + struct xcoff_tdata *xcoff_obj_data;
1.4062 + struct ecoff_tdata *ecoff_obj_data;
1.4063 + struct ieee_data_struct *ieee_data;
1.4064 + struct ieee_ar_data_struct *ieee_ar_data;
1.4065 + struct srec_data_struct *srec_data;
1.4066 + struct ihex_data_struct *ihex_data;
1.4067 + struct tekhex_data_struct *tekhex_data;
1.4068 + struct elf_obj_tdata *elf_obj_data;
1.4069 + struct nlm_obj_tdata *nlm_obj_data;
1.4070 + struct bout_data_struct *bout_data;
1.4071 + struct mmo_data_struct *mmo_data;
1.4072 + struct sun_core_struct *sun_core_data;
1.4073 + struct sco5_core_struct *sco5_core_data;
1.4074 + struct trad_core_struct *trad_core_data;
1.4075 + struct som_data_struct *som_data;
1.4076 + struct hpux_core_struct *hpux_core_data;
1.4077 + struct hppabsd_core_struct *hppabsd_core_data;
1.4078 + struct sgi_core_struct *sgi_core_data;
1.4079 + struct lynx_core_struct *lynx_core_data;
1.4080 + struct osf_core_struct *osf_core_data;
1.4081 + struct cisco_core_struct *cisco_core_data;
1.4082 + struct versados_data_struct *versados_data;
1.4083 + struct netbsd_core_struct *netbsd_core_data;
1.4084 + struct mach_o_data_struct *mach_o_data;
1.4085 + struct mach_o_fat_data_struct *mach_o_fat_data;
1.4086 + struct bfd_pef_data_struct *pef_data;
1.4087 + struct bfd_pef_xlib_data_struct *pef_xlib_data;
1.4088 + struct bfd_sym_data_struct *sym_data;
1.4089 + void *any;
1.4090 + }
1.4091 + tdata;
1.4092 +
1.4093 + /* Used by the application to hold private data. */
1.4094 + void *usrdata;
1.4095 +
1.4096 + /* Where all the allocated stuff under this BFD goes. This is a
1.4097 + struct objalloc *, but we use void * to avoid requiring the inclusion
1.4098 + of objalloc.h. */
1.4099 + void *memory;
1.4100 +};
1.4101 +
1.4102 +typedef enum bfd_error
1.4103 +{
1.4104 + bfd_error_no_error = 0,
1.4105 + bfd_error_system_call,
1.4106 + bfd_error_invalid_target,
1.4107 + bfd_error_wrong_format,
1.4108 + bfd_error_wrong_object_format,
1.4109 + bfd_error_invalid_operation,
1.4110 + bfd_error_no_memory,
1.4111 + bfd_error_no_symbols,
1.4112 + bfd_error_no_armap,
1.4113 + bfd_error_no_more_archived_files,
1.4114 + bfd_error_malformed_archive,
1.4115 + bfd_error_file_not_recognized,
1.4116 + bfd_error_file_ambiguously_recognized,
1.4117 + bfd_error_no_contents,
1.4118 + bfd_error_nonrepresentable_section,
1.4119 + bfd_error_no_debug_section,
1.4120 + bfd_error_bad_value,
1.4121 + bfd_error_file_truncated,
1.4122 + bfd_error_file_too_big,
1.4123 + bfd_error_invalid_error_code
1.4124 +}
1.4125 +bfd_error_type;
1.4126 +
1.4127 +bfd_error_type bfd_get_error (void);
1.4128 +
1.4129 +void bfd_set_error (bfd_error_type error_tag);
1.4130 +
1.4131 +const char *bfd_errmsg (bfd_error_type error_tag);
1.4132 +
1.4133 +void bfd_perror (const char *message);
1.4134 +
1.4135 +typedef void (*bfd_error_handler_type) (const char *, ...);
1.4136 +
1.4137 +bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
1.4138 +
1.4139 +void bfd_set_error_program_name (const char *);
1.4140 +
1.4141 +bfd_error_handler_type bfd_get_error_handler (void);
1.4142 +
1.4143 +long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
1.4144 +
1.4145 +long bfd_canonicalize_reloc
1.4146 + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
1.4147 +
1.4148 +void bfd_set_reloc
1.4149 + (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
1.4150 +
1.4151 +bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
1.4152 +
1.4153 +int bfd_get_arch_size (bfd *abfd);
1.4154 +
1.4155 +int bfd_get_sign_extend_vma (bfd *abfd);
1.4156 +
1.4157 +bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
1.4158 +
1.4159 +unsigned int bfd_get_gp_size (bfd *abfd);
1.4160 +
1.4161 +void bfd_set_gp_size (bfd *abfd, unsigned int i);
1.4162 +
1.4163 +bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
1.4164 +
1.4165 +bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
1.4166 +
1.4167 +#define bfd_copy_private_header_data(ibfd, obfd) \
1.4168 + BFD_SEND (obfd, _bfd_copy_private_header_data, \
1.4169 + (ibfd, obfd))
1.4170 +bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
1.4171 +
1.4172 +#define bfd_copy_private_bfd_data(ibfd, obfd) \
1.4173 + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
1.4174 + (ibfd, obfd))
1.4175 +bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
1.4176 +
1.4177 +#define bfd_merge_private_bfd_data(ibfd, obfd) \
1.4178 + BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
1.4179 + (ibfd, obfd))
1.4180 +bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
1.4181 +
1.4182 +#define bfd_set_private_flags(abfd, flags) \
1.4183 + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
1.4184 +#define bfd_sizeof_headers(abfd, reloc) \
1.4185 + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
1.4186 +
1.4187 +#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
1.4188 + BFD_SEND (abfd, _bfd_find_nearest_line, \
1.4189 + (abfd, sec, syms, off, file, func, line))
1.4190 +
1.4191 +#define bfd_debug_info_start(abfd) \
1.4192 + BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
1.4193 +
1.4194 +#define bfd_debug_info_end(abfd) \
1.4195 + BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
1.4196 +
1.4197 +#define bfd_debug_info_accumulate(abfd, section) \
1.4198 + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
1.4199 +
1.4200 +#define bfd_stat_arch_elt(abfd, stat) \
1.4201 + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
1.4202 +
1.4203 +#define bfd_update_armap_timestamp(abfd) \
1.4204 + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
1.4205 +
1.4206 +#define bfd_set_arch_mach(abfd, arch, mach)\
1.4207 + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
1.4208 +
1.4209 +#define bfd_relax_section(abfd, section, link_info, again) \
1.4210 + BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
1.4211 +
1.4212 +#define bfd_gc_sections(abfd, link_info) \
1.4213 + BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
1.4214 +
1.4215 +#define bfd_merge_sections(abfd, link_info) \
1.4216 + BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
1.4217 +
1.4218 +#define bfd_is_group_section(abfd, sec) \
1.4219 + BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
1.4220 +
1.4221 +#define bfd_discard_group(abfd, sec) \
1.4222 + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
1.4223 +
1.4224 +#define bfd_link_hash_table_create(abfd) \
1.4225 + BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
1.4226 +
1.4227 +#define bfd_link_hash_table_free(abfd, hash) \
1.4228 + BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
1.4229 +
1.4230 +#define bfd_link_add_symbols(abfd, info) \
1.4231 + BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
1.4232 +
1.4233 +#define bfd_link_just_syms(abfd, sec, info) \
1.4234 + BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
1.4235 +
1.4236 +#define bfd_final_link(abfd, info) \
1.4237 + BFD_SEND (abfd, _bfd_final_link, (abfd, info))
1.4238 +
1.4239 +#define bfd_free_cached_info(abfd) \
1.4240 + BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
1.4241 +
1.4242 +#define bfd_get_dynamic_symtab_upper_bound(abfd) \
1.4243 + BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
1.4244 +
1.4245 +#define bfd_print_private_bfd_data(abfd, file)\
1.4246 + BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
1.4247 +
1.4248 +#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
1.4249 + BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
1.4250 +
1.4251 +#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
1.4252 + BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
1.4253 + dyncount, dynsyms, ret))
1.4254 +
1.4255 +#define bfd_get_dynamic_reloc_upper_bound(abfd) \
1.4256 + BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
1.4257 +
1.4258 +#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
1.4259 + BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
1.4260 +
1.4261 +extern bfd_byte *bfd_get_relocated_section_contents
1.4262 + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
1.4263 + bfd_boolean, asymbol **);
1.4264 +
1.4265 +bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
1.4266 +
1.4267 +struct bfd_preserve
1.4268 +{
1.4269 + void *marker;
1.4270 + void *tdata;
1.4271 + flagword flags;
1.4272 + const struct bfd_arch_info *arch_info;
1.4273 + struct bfd_section *sections;
1.4274 + struct bfd_section **section_tail;
1.4275 + unsigned int section_count;
1.4276 + struct bfd_hash_table section_htab;
1.4277 +};
1.4278 +
1.4279 +bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
1.4280 +
1.4281 +void bfd_preserve_restore (bfd *, struct bfd_preserve *);
1.4282 +
1.4283 +void bfd_preserve_finish (bfd *, struct bfd_preserve *);
1.4284 +
1.4285 +/* Extracted from archive.c. */
1.4286 +symindex bfd_get_next_mapent
1.4287 + (bfd *abfd, symindex previous, carsym **sym);
1.4288 +
1.4289 +bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
1.4290 +
1.4291 +bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
1.4292 +
1.4293 +/* Extracted from corefile.c. */
1.4294 +const char *bfd_core_file_failing_command (bfd *abfd);
1.4295 +
1.4296 +int bfd_core_file_failing_signal (bfd *abfd);
1.4297 +
1.4298 +bfd_boolean core_file_matches_executable_p
1.4299 + (bfd *core_bfd, bfd *exec_bfd);
1.4300 +
1.4301 +/* Extracted from targets.c. */
1.4302 +#define BFD_SEND(bfd, message, arglist) \
1.4303 + ((*((bfd)->xvec->message)) arglist)
1.4304 +
1.4305 +#ifdef DEBUG_BFD_SEND
1.4306 +#undef BFD_SEND
1.4307 +#define BFD_SEND(bfd, message, arglist) \
1.4308 + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
1.4309 + ((*((bfd)->xvec->message)) arglist) : \
1.4310 + (bfd_assert (__FILE__,__LINE__), NULL))
1.4311 +#endif
1.4312 +#define BFD_SEND_FMT(bfd, message, arglist) \
1.4313 + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
1.4314 +
1.4315 +#ifdef DEBUG_BFD_SEND
1.4316 +#undef BFD_SEND_FMT
1.4317 +#define BFD_SEND_FMT(bfd, message, arglist) \
1.4318 + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
1.4319 + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
1.4320 + (bfd_assert (__FILE__,__LINE__), NULL))
1.4321 +#endif
1.4322 +
1.4323 +enum bfd_flavour
1.4324 +{
1.4325 + bfd_target_unknown_flavour,
1.4326 + bfd_target_aout_flavour,
1.4327 + bfd_target_coff_flavour,
1.4328 + bfd_target_ecoff_flavour,
1.4329 + bfd_target_xcoff_flavour,
1.4330 + bfd_target_elf_flavour,
1.4331 + bfd_target_ieee_flavour,
1.4332 + bfd_target_nlm_flavour,
1.4333 + bfd_target_oasys_flavour,
1.4334 + bfd_target_tekhex_flavour,
1.4335 + bfd_target_srec_flavour,
1.4336 + bfd_target_ihex_flavour,
1.4337 + bfd_target_som_flavour,
1.4338 + bfd_target_os9k_flavour,
1.4339 + bfd_target_versados_flavour,
1.4340 + bfd_target_msdos_flavour,
1.4341 + bfd_target_ovax_flavour,
1.4342 + bfd_target_evax_flavour,
1.4343 + bfd_target_mmo_flavour,
1.4344 + bfd_target_mach_o_flavour,
1.4345 + bfd_target_pef_flavour,
1.4346 + bfd_target_pef_xlib_flavour,
1.4347 + bfd_target_sym_flavour
1.4348 +};
1.4349 +
1.4350 +enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
1.4351 +
1.4352 +/* Forward declaration. */
1.4353 +typedef struct bfd_link_info _bfd_link_info;
1.4354 +
1.4355 +typedef struct bfd_target
1.4356 +{
1.4357 + /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
1.4358 + char *name;
1.4359 +
1.4360 + /* The "flavour" of a back end is a general indication about
1.4361 + the contents of a file. */
1.4362 + enum bfd_flavour flavour;
1.4363 +
1.4364 + /* The order of bytes within the data area of a file. */
1.4365 + enum bfd_endian byteorder;
1.4366 +
1.4367 + /* The order of bytes within the header parts of a file. */
1.4368 + enum bfd_endian header_byteorder;
1.4369 +
1.4370 + /* A mask of all the flags which an executable may have set -
1.4371 + from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
1.4372 + flagword object_flags;
1.4373 +
1.4374 + /* A mask of all the flags which a section may have set - from
1.4375 + the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
1.4376 + flagword section_flags;
1.4377 +
1.4378 + /* The character normally found at the front of a symbol.
1.4379 + (if any), perhaps `_'. */
1.4380 + char symbol_leading_char;
1.4381 +
1.4382 + /* The pad character for file names within an archive header. */
1.4383 + char ar_pad_char;
1.4384 +
1.4385 + /* The maximum number of characters in an archive header. */
1.4386 + unsigned short ar_max_namelen;
1.4387 +
1.4388 + /* Entries for byte swapping for data. These are different from the
1.4389 + other entry points, since they don't take a BFD as the first argument.
1.4390 + Certain other handlers could do the same. */
1.4391 + bfd_uint64_t (*bfd_getx64) (const void *);
1.4392 + bfd_int64_t (*bfd_getx_signed_64) (const void *);
1.4393 + void (*bfd_putx64) (bfd_uint64_t, void *);
1.4394 + bfd_vma (*bfd_getx32) (const void *);
1.4395 + bfd_signed_vma (*bfd_getx_signed_32) (const void *);
1.4396 + void (*bfd_putx32) (bfd_vma, void *);
1.4397 + bfd_vma (*bfd_getx16) (const void *);
1.4398 + bfd_signed_vma (*bfd_getx_signed_16) (const void *);
1.4399 + void (*bfd_putx16) (bfd_vma, void *);
1.4400 +
1.4401 + /* Byte swapping for the headers. */
1.4402 + bfd_uint64_t (*bfd_h_getx64) (const void *);
1.4403 + bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
1.4404 + void (*bfd_h_putx64) (bfd_uint64_t, void *);
1.4405 + bfd_vma (*bfd_h_getx32) (const void *);
1.4406 + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
1.4407 + void (*bfd_h_putx32) (bfd_vma, void *);
1.4408 + bfd_vma (*bfd_h_getx16) (const void *);
1.4409 + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
1.4410 + void (*bfd_h_putx16) (bfd_vma, void *);
1.4411 +
1.4412 + /* Format dependent routines: these are vectors of entry points
1.4413 + within the target vector structure, one for each format to check. */
1.4414 +
1.4415 + /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
1.4416 + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
1.4417 +
1.4418 + /* Set the format of a file being written. */
1.4419 + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
1.4420 +
1.4421 + /* Write cached information into a file being written, at <<bfd_close>>. */
1.4422 + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
1.4423 +
1.4424 +
1.4425 + /* Generic entry points. */
1.4426 +#define BFD_JUMP_TABLE_GENERIC(NAME) \
1.4427 + NAME##_close_and_cleanup, \
1.4428 + NAME##_bfd_free_cached_info, \
1.4429 + NAME##_new_section_hook, \
1.4430 + NAME##_get_section_contents, \
1.4431 + NAME##_get_section_contents_in_window
1.4432 +
1.4433 + /* Called when the BFD is being closed to do any necessary cleanup. */
1.4434 + bfd_boolean (*_close_and_cleanup) (bfd *);
1.4435 + /* Ask the BFD to free all cached information. */
1.4436 + bfd_boolean (*_bfd_free_cached_info) (bfd *);
1.4437 + /* Called when a new section is created. */
1.4438 + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
1.4439 + /* Read the contents of a section. */
1.4440 + bfd_boolean (*_bfd_get_section_contents)
1.4441 + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
1.4442 + bfd_boolean (*_bfd_get_section_contents_in_window)
1.4443 + (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
1.4444 +
1.4445 + /* Entry points to copy private data. */
1.4446 +#define BFD_JUMP_TABLE_COPY(NAME) \
1.4447 + NAME##_bfd_copy_private_bfd_data, \
1.4448 + NAME##_bfd_merge_private_bfd_data, \
1.4449 + NAME##_bfd_copy_private_section_data, \
1.4450 + NAME##_bfd_copy_private_symbol_data, \
1.4451 + NAME##_bfd_copy_private_header_data, \
1.4452 + NAME##_bfd_set_private_flags, \
1.4453 + NAME##_bfd_print_private_bfd_data
1.4454 +
1.4455 + /* Called to copy BFD general private data from one object file
1.4456 + to another. */
1.4457 + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
1.4458 + /* Called to merge BFD general private data from one object file
1.4459 + to a common output file when linking. */
1.4460 + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
1.4461 + /* Called to copy BFD private section data from one object file
1.4462 + to another. */
1.4463 + bfd_boolean (*_bfd_copy_private_section_data)
1.4464 + (bfd *, sec_ptr, bfd *, sec_ptr);
1.4465 + /* Called to copy BFD private symbol data from one symbol
1.4466 + to another. */
1.4467 + bfd_boolean (*_bfd_copy_private_symbol_data)
1.4468 + (bfd *, asymbol *, bfd *, asymbol *);
1.4469 + /* Called to copy BFD private header data from one object file
1.4470 + to another. */
1.4471 + bfd_boolean (*_bfd_copy_private_header_data)
1.4472 + (bfd *, bfd *);
1.4473 + /* Called to set private backend flags. */
1.4474 + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
1.4475 +
1.4476 + /* Called to print private BFD data. */
1.4477 + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
1.4478 +
1.4479 + /* Core file entry points. */
1.4480 +#define BFD_JUMP_TABLE_CORE(NAME) \
1.4481 + NAME##_core_file_failing_command, \
1.4482 + NAME##_core_file_failing_signal, \
1.4483 + NAME##_core_file_matches_executable_p
1.4484 +
1.4485 + char * (*_core_file_failing_command) (bfd *);
1.4486 + int (*_core_file_failing_signal) (bfd *);
1.4487 + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
1.4488 +
1.4489 + /* Archive entry points. */
1.4490 +#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
1.4491 + NAME##_slurp_armap, \
1.4492 + NAME##_slurp_extended_name_table, \
1.4493 + NAME##_construct_extended_name_table, \
1.4494 + NAME##_truncate_arname, \
1.4495 + NAME##_write_armap, \
1.4496 + NAME##_read_ar_hdr, \
1.4497 + NAME##_openr_next_archived_file, \
1.4498 + NAME##_get_elt_at_index, \
1.4499 + NAME##_generic_stat_arch_elt, \
1.4500 + NAME##_update_armap_timestamp
1.4501 +
1.4502 + bfd_boolean (*_bfd_slurp_armap) (bfd *);
1.4503 + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
1.4504 + bfd_boolean (*_bfd_construct_extended_name_table)
1.4505 + (bfd *, char **, bfd_size_type *, const char **);
1.4506 + void (*_bfd_truncate_arname) (bfd *, const char *, char *);
1.4507 + bfd_boolean (*write_armap)
1.4508 + (bfd *, unsigned int, struct orl *, unsigned int, int);
1.4509 + void * (*_bfd_read_ar_hdr_fn) (bfd *);
1.4510 + bfd * (*openr_next_archived_file) (bfd *, bfd *);
1.4511 +#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
1.4512 + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
1.4513 + int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
1.4514 + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
1.4515 +
1.4516 + /* Entry points used for symbols. */
1.4517 +#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
1.4518 + NAME##_get_symtab_upper_bound, \
1.4519 + NAME##_canonicalize_symtab, \
1.4520 + NAME##_make_empty_symbol, \
1.4521 + NAME##_print_symbol, \
1.4522 + NAME##_get_symbol_info, \
1.4523 + NAME##_bfd_is_local_label_name, \
1.4524 + NAME##_bfd_is_target_special_symbol, \
1.4525 + NAME##_get_lineno, \
1.4526 + NAME##_find_nearest_line, \
1.4527 + NAME##_bfd_make_debug_symbol, \
1.4528 + NAME##_read_minisymbols, \
1.4529 + NAME##_minisymbol_to_symbol
1.4530 +
1.4531 + long (*_bfd_get_symtab_upper_bound) (bfd *);
1.4532 + long (*_bfd_canonicalize_symtab)
1.4533 + (bfd *, struct bfd_symbol **);
1.4534 + struct bfd_symbol *
1.4535 + (*_bfd_make_empty_symbol) (bfd *);
1.4536 + void (*_bfd_print_symbol)
1.4537 + (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
1.4538 +#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
1.4539 + void (*_bfd_get_symbol_info)
1.4540 + (bfd *, struct bfd_symbol *, symbol_info *);
1.4541 +#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
1.4542 + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
1.4543 + bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
1.4544 + alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
1.4545 + bfd_boolean (*_bfd_find_nearest_line)
1.4546 + (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
1.4547 + const char **, const char **, unsigned int *);
1.4548 + /* Back-door to allow format-aware applications to create debug symbols
1.4549 + while using BFD for everything else. Currently used by the assembler
1.4550 + when creating COFF files. */
1.4551 + asymbol * (*_bfd_make_debug_symbol)
1.4552 + (bfd *, void *, unsigned long size);
1.4553 +#define bfd_read_minisymbols(b, d, m, s) \
1.4554 + BFD_SEND (b, _read_minisymbols, (b, d, m, s))
1.4555 + long (*_read_minisymbols)
1.4556 + (bfd *, bfd_boolean, void **, unsigned int *);
1.4557 +#define bfd_minisymbol_to_symbol(b, d, m, f) \
1.4558 + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
1.4559 + asymbol * (*_minisymbol_to_symbol)
1.4560 + (bfd *, bfd_boolean, const void *, asymbol *);
1.4561 +
1.4562 + /* Routines for relocs. */
1.4563 +#define BFD_JUMP_TABLE_RELOCS(NAME) \
1.4564 + NAME##_get_reloc_upper_bound, \
1.4565 + NAME##_canonicalize_reloc, \
1.4566 + NAME##_bfd_reloc_type_lookup
1.4567 +
1.4568 + long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
1.4569 + long (*_bfd_canonicalize_reloc)
1.4570 + (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
1.4571 + /* See documentation on reloc types. */
1.4572 + reloc_howto_type *
1.4573 + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
1.4574 +
1.4575 + /* Routines used when writing an object file. */
1.4576 +#define BFD_JUMP_TABLE_WRITE(NAME) \
1.4577 + NAME##_set_arch_mach, \
1.4578 + NAME##_set_section_contents
1.4579 +
1.4580 + bfd_boolean (*_bfd_set_arch_mach)
1.4581 + (bfd *, enum bfd_architecture, unsigned long);
1.4582 + bfd_boolean (*_bfd_set_section_contents)
1.4583 + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
1.4584 +
1.4585 + /* Routines used by the linker. */
1.4586 +#define BFD_JUMP_TABLE_LINK(NAME) \
1.4587 + NAME##_sizeof_headers, \
1.4588 + NAME##_bfd_get_relocated_section_contents, \
1.4589 + NAME##_bfd_relax_section, \
1.4590 + NAME##_bfd_link_hash_table_create, \
1.4591 + NAME##_bfd_link_hash_table_free, \
1.4592 + NAME##_bfd_link_add_symbols, \
1.4593 + NAME##_bfd_link_just_syms, \
1.4594 + NAME##_bfd_final_link, \
1.4595 + NAME##_bfd_link_split_section, \
1.4596 + NAME##_bfd_gc_sections, \
1.4597 + NAME##_bfd_merge_sections, \
1.4598 + NAME##_bfd_is_group_section, \
1.4599 + NAME##_bfd_discard_group, \
1.4600 + NAME##_section_already_linked \
1.4601 +
1.4602 + int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
1.4603 + bfd_byte * (*_bfd_get_relocated_section_contents)
1.4604 + (bfd *, struct bfd_link_info *, struct bfd_link_order *,
1.4605 + bfd_byte *, bfd_boolean, struct bfd_symbol **);
1.4606 +
1.4607 + bfd_boolean (*_bfd_relax_section)
1.4608 + (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
1.4609 +
1.4610 + /* Create a hash table for the linker. Different backends store
1.4611 + different information in this table. */
1.4612 + struct bfd_link_hash_table *
1.4613 + (*_bfd_link_hash_table_create) (bfd *);
1.4614 +
1.4615 + /* Release the memory associated with the linker hash table. */
1.4616 + void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
1.4617 +
1.4618 + /* Add symbols from this object file into the hash table. */
1.4619 + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
1.4620 +
1.4621 + /* Indicate that we are only retrieving symbol values from this section. */
1.4622 + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
1.4623 +
1.4624 + /* Do a link based on the link_order structures attached to each
1.4625 + section of the BFD. */
1.4626 + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
1.4627 +
1.4628 + /* Should this section be split up into smaller pieces during linking. */
1.4629 + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
1.4630 +
1.4631 + /* Remove sections that are not referenced from the output. */
1.4632 + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
1.4633 +
1.4634 + /* Attempt to merge SEC_MERGE sections. */
1.4635 + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
1.4636 +
1.4637 + /* Is this section a member of a group? */
1.4638 + bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
1.4639 +
1.4640 + /* Discard members of a group. */
1.4641 + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
1.4642 +
1.4643 + /* Check if SEC has been already linked during a reloceatable or
1.4644 + final link. */
1.4645 + void (*_section_already_linked) (bfd *, struct bfd_section *);
1.4646 +
1.4647 + /* Routines to handle dynamic symbols and relocs. */
1.4648 +#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
1.4649 + NAME##_get_dynamic_symtab_upper_bound, \
1.4650 + NAME##_canonicalize_dynamic_symtab, \
1.4651 + NAME##_get_synthetic_symtab, \
1.4652 + NAME##_get_dynamic_reloc_upper_bound, \
1.4653 + NAME##_canonicalize_dynamic_reloc
1.4654 +
1.4655 + /* Get the amount of memory required to hold the dynamic symbols. */
1.4656 + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
1.4657 + /* Read in the dynamic symbols. */
1.4658 + long (*_bfd_canonicalize_dynamic_symtab)
1.4659 + (bfd *, struct bfd_symbol **);
1.4660 + /* Create synthetized symbols. */
1.4661 + long (*_bfd_get_synthetic_symtab)
1.4662 + (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
1.4663 + struct bfd_symbol **);
1.4664 + /* Get the amount of memory required to hold the dynamic relocs. */
1.4665 + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
1.4666 + /* Read in the dynamic relocs. */
1.4667 + long (*_bfd_canonicalize_dynamic_reloc)
1.4668 + (bfd *, arelent **, struct bfd_symbol **);
1.4669 +
1.4670 + /* Opposite endian version of this target. */
1.4671 + const struct bfd_target * alternative_target;
1.4672 +
1.4673 + /* Data for use by back-end routines, which isn't
1.4674 + generic enough to belong in this structure. */
1.4675 + const void *backend_data;
1.4676 +
1.4677 +} bfd_target;
1.4678 +
1.4679 +bfd_boolean bfd_set_default_target (const char *name);
1.4680 +
1.4681 +const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
1.4682 +
1.4683 +const char ** bfd_target_list (void);
1.4684 +
1.4685 +const bfd_target *bfd_search_for_target
1.4686 + (int (*search_func) (const bfd_target *, void *),
1.4687 + void *);
1.4688 +
1.4689 +/* Extracted from format.c. */
1.4690 +bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
1.4691 +
1.4692 +bfd_boolean bfd_check_format_matches
1.4693 + (bfd *abfd, bfd_format format, char ***matching);
1.4694 +
1.4695 +bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
1.4696 +
1.4697 +const char *bfd_format_string (bfd_format format);
1.4698 +
1.4699 +/* Extracted from linker.c. */
1.4700 +bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
1.4701 +
1.4702 +#define bfd_link_split_section(abfd, sec) \
1.4703 + BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
1.4704 +
1.4705 +void bfd_section_already_linked (bfd *abfd, asection *sec);
1.4706 +
1.4707 +#define bfd_section_already_linked(abfd, sec) \
1.4708 + BFD_SEND (abfd, _section_already_linked, (abfd, sec))
1.4709 +
1.4710 +/* Extracted from simple.c. */
1.4711 +bfd_byte *bfd_simple_get_relocated_section_contents
1.4712 + (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
1.4713 +
1.4714 +#ifdef __cplusplus
1.4715 +}
1.4716 +#endif
1.4717 +#endif
.