1131832Sobrien/* $FreeBSD$ */
2131832Sobrien
3131832Sobrien/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
4131832Sobrien   generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
5131832Sobrien   "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
6131832Sobrien   "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
7131832Sobrien   "linker.c" and "simple.c".
8131832Sobrien   Run "make headers" in your build bfd/ to regenerate.  */
9131832Sobrien
10131832Sobrien/* Main header file for the bfd library -- portable access to object files.
11131832Sobrien
12131832Sobrien   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13218822Sdim   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
14218822Sdim   Free Software Foundation, Inc.
15131832Sobrien
16131832Sobrien   Contributed by Cygnus Support.
17131832Sobrien
18131832Sobrien   This file is part of BFD, the Binary File Descriptor library.
19131832Sobrien
20131832Sobrien   This program is free software; you can redistribute it and/or modify
21131832Sobrien   it under the terms of the GNU General Public License as published by
22131832Sobrien   the Free Software Foundation; either version 2 of the License, or
23131832Sobrien   (at your option) any later version.
24131832Sobrien
25131832Sobrien   This program is distributed in the hope that it will be useful,
26131832Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
27131832Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28131832Sobrien   GNU General Public License for more details.
29131832Sobrien
30131832Sobrien   You should have received a copy of the GNU General Public License
31131832Sobrien   along with this program; if not, write to the Free Software
32218822Sdim   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
33131832Sobrien
34131832Sobrien#ifndef __BFD_H_SEEN__
35131832Sobrien#define __BFD_H_SEEN__
36131832Sobrien
37131832Sobrien#ifdef __cplusplus
38131832Sobrienextern "C" {
39131832Sobrien#endif
40131832Sobrien
41131832Sobrien#include "ansidecl.h"
42131832Sobrien#include "symcat.h"
43131832Sobrien#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
44131832Sobrien#ifndef SABER
45131832Sobrien/* This hack is to avoid a problem with some strict ANSI C preprocessors.
46131832Sobrien   The problem is, "32_" is not a valid preprocessing token, and we don't
47131832Sobrien   want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
48131832Sobrien   cause the inner CONCAT2 macros to be evaluated first, producing
49131832Sobrien   still-valid pp-tokens.  Then the final concatenation can be done.  */
50131832Sobrien#undef CONCAT4
51131832Sobrien#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
52131832Sobrien#endif
53131832Sobrien#endif
54131832Sobrien
55218822Sdim/* This is a utility macro to handle the situation where the code
56218822Sdim   wants to place a constant string into the code, followed by a
57218822Sdim   comma and then the length of the string.  Doing this by hand
58218822Sdim   is error prone, so using this macro is safer.  The macro will
59218822Sdim   also safely handle the case where a NULL is passed as the arg.  */
60218822Sdim#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
61218822Sdim/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
62218822Sdim   to create the arguments to another macro, since the preprocessor
63218822Sdim   will mis-count the number of arguments to the outer macro (by not
64218822Sdim   evaluating STRING_COMMA_LEN and so missing the comma).  This is a
65218822Sdim   problem for example when trying to use STRING_COMMA_LEN to build
66218822Sdim   the arguments to the strncmp() macro.  Hence this alternative
67218822Sdim   definition of strncmp is provided here.
68218822Sdim
69218822Sdim   Note - these macros do NOT work if STR2 is not a constant string.  */
70218822Sdim#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
71218822Sdim  /* strcpy() can have a similar problem, but since we know we are
72218822Sdim     copying a constant string, we can use memcpy which will be faster
73218822Sdim     since there is no need to check for a NUL byte inside STR.  We
74218822Sdim     can also save time if we do not need to copy the terminating NUL.  */
75218822Sdim#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
76218822Sdim#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
77218822Sdim
78218822Sdim
79131832Sobrien/* The word size used by BFD on the host.  This may be 64 with a 32
80131832Sobrien   bit target if the host is 64 bit, or if other 64 bit targets have
81131832Sobrien   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
82131832Sobrien#define BFD_ARCH_SIZE 64
83131832Sobrien
84185924Simp#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__)
85131832Sobrien#define BFD_HOST_64BIT_LONG 0
86131832Sobrien#define BFD_HOST_64_BIT long long
87131832Sobrien#define BFD_HOST_U_64_BIT unsigned long long
88131832Sobrien#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__ia64__)
89131832Sobrien#define BFD_HOST_64BIT_LONG 1
90131832Sobrien#define BFD_HOST_64_BIT long
91131832Sobrien#define BFD_HOST_U_64_BIT unsigned long
92131832Sobrien#else
93131832Sobrien#error Unsupported architecture/platform.
94131832Sobrien#endif /* 64-bit host */
95131832Sobrien
96131832Sobrien#define BFD_HOST_LONG_LONG 1
97131832Sobrientypedef BFD_HOST_64_BIT bfd_int64_t;
98131832Sobrientypedef BFD_HOST_U_64_BIT bfd_uint64_t;
99131832Sobrien
100131832Sobrien#if BFD_ARCH_SIZE >= 64
101131832Sobrien#define BFD64
102131832Sobrien#endif
103131832Sobrien
104131832Sobrien#ifndef INLINE
105131832Sobrien#if __GNUC__ >= 2
106131832Sobrien#define INLINE __inline__
107131832Sobrien#else
108131832Sobrien#define INLINE
109131832Sobrien#endif
110131832Sobrien#endif
111131832Sobrien
112131832Sobrien/* Forward declaration.  */
113131832Sobrientypedef struct bfd bfd;
114131832Sobrien
115131832Sobrien/* Boolean type used in bfd.  Too many systems define their own
116131832Sobrien   versions of "boolean" for us to safely typedef a "boolean" of
117131832Sobrien   our own.  Using an enum for "bfd_boolean" has its own set of
118131832Sobrien   problems, with strange looking casts required to avoid warnings
119131832Sobrien   on some older compilers.  Thus we just use an int.
120131832Sobrien
121131832Sobrien   General rule: Functions which are bfd_boolean return TRUE on
122131832Sobrien   success and FALSE on failure (unless they're a predicate).  */
123131832Sobrien
124131832Sobrientypedef int bfd_boolean;
125131832Sobrien#undef FALSE
126131832Sobrien#undef TRUE
127131832Sobrien#define FALSE 0
128131832Sobrien#define TRUE 1
129131832Sobrien
130131832Sobrien#ifdef BFD64
131131832Sobrien
132131832Sobrien#ifndef BFD_HOST_64_BIT
133131832Sobrien #error No 64 bit integer type available
134131832Sobrien#endif /* ! defined (BFD_HOST_64_BIT) */
135131832Sobrien
136131832Sobrientypedef BFD_HOST_U_64_BIT bfd_vma;
137131832Sobrientypedef BFD_HOST_64_BIT bfd_signed_vma;
138131832Sobrientypedef BFD_HOST_U_64_BIT bfd_size_type;
139131832Sobrientypedef BFD_HOST_U_64_BIT symvalue;
140131832Sobrien
141131832Sobrien#ifndef fprintf_vma
142131832Sobrien#if BFD_HOST_64BIT_LONG
143131832Sobrien#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
144131832Sobrien#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
145131832Sobrien#else
146131832Sobrien#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
147131832Sobrien#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
148131832Sobrien#define fprintf_vma(s,x) \
149131832Sobrien  fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
150131832Sobrien#define sprintf_vma(s,x) \
151131832Sobrien  sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
152131832Sobrien#endif
153131832Sobrien#endif
154131832Sobrien
155131832Sobrien#else /* not BFD64  */
156131832Sobrien
157131832Sobrien/* Represent a target address.  Also used as a generic unsigned type
158131832Sobrien   which is guaranteed to be big enough to hold any arithmetic types
159131832Sobrien   we need to deal with.  */
160131832Sobrientypedef unsigned long bfd_vma;
161131832Sobrien
162131832Sobrien/* A generic signed type which is guaranteed to be big enough to hold any
163131832Sobrien   arithmetic types we need to deal with.  Can be assumed to be compatible
164131832Sobrien   with bfd_vma in the same way that signed and unsigned ints are compatible
165131832Sobrien   (as parameters, in assignment, etc).  */
166131832Sobrientypedef long bfd_signed_vma;
167131832Sobrien
168131832Sobrientypedef unsigned long symvalue;
169131832Sobrientypedef unsigned long bfd_size_type;
170131832Sobrien
171131832Sobrien/* Print a bfd_vma x on stream s.  */
172131832Sobrien#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
173131832Sobrien#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
174131832Sobrien
175131832Sobrien#endif /* not BFD64  */
176131832Sobrien
177218822Sdim#define HALF_BFD_SIZE_TYPE \
178218822Sdim  (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
179218822Sdim
180131832Sobrien#ifndef BFD_HOST_64_BIT
181131832Sobrien/* Fall back on a 32 bit type.  The idea is to make these types always
182131832Sobrien   available for function return types, but in the case that
183131832Sobrien   BFD_HOST_64_BIT is undefined such a function should abort or
184131832Sobrien   otherwise signal an error.  */
185131832Sobrientypedef bfd_signed_vma bfd_int64_t;
186131832Sobrientypedef bfd_vma bfd_uint64_t;
187131832Sobrien#endif
188131832Sobrien
189131832Sobrien/* An offset into a file.  BFD always uses the largest possible offset
190131832Sobrien   based on the build time availability of fseek, fseeko, or fseeko64.  */
191131832Sobrientypedef BFD_HOST_64_BIT file_ptr;
192131832Sobrientypedef unsigned BFD_HOST_64_BIT ufile_ptr;
193131832Sobrien
194131832Sobrienextern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
195131832Sobrienextern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
196131832Sobrien
197131832Sobrien#define printf_vma(x) fprintf_vma(stdout,x)
198131832Sobrien#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
199131832Sobrien
200131832Sobrientypedef unsigned int flagword;	/* 32 bits of flags */
201131832Sobrientypedef unsigned char bfd_byte;
202131832Sobrien
203131832Sobrien/* File formats.  */
204131832Sobrien
205131832Sobrientypedef enum bfd_format
206131832Sobrien{
207131832Sobrien  bfd_unknown = 0,	/* File format is unknown.  */
208131832Sobrien  bfd_object,		/* Linker/assembler/compiler output.  */
209131832Sobrien  bfd_archive,		/* Object archive file.  */
210131832Sobrien  bfd_core,		/* Core dump.  */
211131832Sobrien  bfd_type_end		/* Marks the end; don't use it!  */
212131832Sobrien}
213131832Sobrienbfd_format;
214131832Sobrien
215131832Sobrien/* Values that may appear in the flags field of a BFD.  These also
216131832Sobrien   appear in the object_flags field of the bfd_target structure, where
217131832Sobrien   they indicate the set of flags used by that backend (not all flags
218131832Sobrien   are meaningful for all object file formats) (FIXME: at the moment,
219131832Sobrien   the object_flags values have mostly just been copied from backend
220131832Sobrien   to another, and are not necessarily correct).  */
221131832Sobrien
222131832Sobrien/* No flags.  */
223131832Sobrien#define BFD_NO_FLAGS   	0x00
224131832Sobrien
225131832Sobrien/* BFD contains relocation entries.  */
226131832Sobrien#define HAS_RELOC   	0x01
227131832Sobrien
228131832Sobrien/* BFD is directly executable.  */
229131832Sobrien#define EXEC_P      	0x02
230131832Sobrien
231131832Sobrien/* BFD has line number information (basically used for F_LNNO in a
232131832Sobrien   COFF header).  */
233131832Sobrien#define HAS_LINENO  	0x04
234131832Sobrien
235131832Sobrien/* BFD has debugging information.  */
236131832Sobrien#define HAS_DEBUG   	0x08
237131832Sobrien
238131832Sobrien/* BFD has symbols.  */
239131832Sobrien#define HAS_SYMS    	0x10
240131832Sobrien
241131832Sobrien/* BFD has local symbols (basically used for F_LSYMS in a COFF
242131832Sobrien   header).  */
243131832Sobrien#define HAS_LOCALS  	0x20
244131832Sobrien
245131832Sobrien/* BFD is a dynamic object.  */
246131832Sobrien#define DYNAMIC     	0x40
247131832Sobrien
248131832Sobrien/* Text section is write protected (if D_PAGED is not set, this is
249131832Sobrien   like an a.out NMAGIC file) (the linker sets this by default, but
250131832Sobrien   clears it for -r or -N).  */
251131832Sobrien#define WP_TEXT     	0x80
252131832Sobrien
253131832Sobrien/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
254131832Sobrien   linker sets this by default, but clears it for -r or -n or -N).  */
255131832Sobrien#define D_PAGED     	0x100
256131832Sobrien
257131832Sobrien/* BFD is relaxable (this means that bfd_relax_section may be able to
258131832Sobrien   do something) (sometimes bfd_relax_section can do something even if
259131832Sobrien   this is not set).  */
260131832Sobrien#define BFD_IS_RELAXABLE 0x200
261131832Sobrien
262131832Sobrien/* This may be set before writing out a BFD to request using a
263131832Sobrien   traditional format.  For example, this is used to request that when
264131832Sobrien   writing out an a.out object the symbols not be hashed to eliminate
265131832Sobrien   duplicates.  */
266131832Sobrien#define BFD_TRADITIONAL_FORMAT 0x400
267131832Sobrien
268131832Sobrien/* This flag indicates that the BFD contents are actually cached in
269131832Sobrien   memory.  If this is set, iostream points to a bfd_in_memory struct.  */
270131832Sobrien#define BFD_IN_MEMORY 0x800
271131832Sobrien
272131832Sobrien/* The sections in this BFD specify a memory page.  */
273131832Sobrien#define HAS_LOAD_PAGE 0x1000
274218822Sdim
275218822Sdim/* This BFD has been created by the linker and doesn't correspond
276218822Sdim   to any input file.  */
277218822Sdim#define BFD_LINKER_CREATED 0x2000
278131832Sobrien
279131832Sobrien/* Symbols and relocation.  */
280131832Sobrien
281131832Sobrien/* A count of carsyms (canonical archive symbols).  */
282131832Sobrientypedef unsigned long symindex;
283131832Sobrien
284131832Sobrien/* How to perform a relocation.  */
285131832Sobrientypedef const struct reloc_howto_struct reloc_howto_type;
286131832Sobrien
287131832Sobrien#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
288131832Sobrien
289131832Sobrien/* General purpose part of a symbol X;
290131832Sobrien   target specific parts are in libcoff.h, libaout.h, etc.  */
291131832Sobrien
292131832Sobrien#define bfd_get_section(x) ((x)->section)
293131832Sobrien#define bfd_get_output_section(x) ((x)->section->output_section)
294131832Sobrien#define bfd_set_section(x,y) ((x)->section) = (y)
295131832Sobrien#define bfd_asymbol_base(x) ((x)->section->vma)
296131832Sobrien#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
297131832Sobrien#define bfd_asymbol_name(x) ((x)->name)
298131832Sobrien/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
299131832Sobrien#define bfd_asymbol_bfd(x) ((x)->the_bfd)
300131832Sobrien#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
301131832Sobrien
302131832Sobrien/* A canonical archive symbol.  */
303131832Sobrien/* This is a type pun with struct ranlib on purpose!  */
304131832Sobrientypedef struct carsym
305131832Sobrien{
306131832Sobrien  char *name;
307131832Sobrien  file_ptr file_offset;	/* Look here to find the file.  */
308131832Sobrien}
309131832Sobriencarsym;			/* To make these you call a carsymogen.  */
310131832Sobrien
311131832Sobrien/* Used in generating armaps (archive tables of contents).
312131832Sobrien   Perhaps just a forward definition would do?  */
313131832Sobrienstruct orl 			/* Output ranlib.  */
314131832Sobrien{
315131832Sobrien  char **name;		/* Symbol name.  */
316131832Sobrien  union
317131832Sobrien  {
318131832Sobrien    file_ptr pos;
319131832Sobrien    bfd *abfd;
320131832Sobrien  } u;			/* bfd* or file position.  */
321131832Sobrien  int namidx;		/* Index into string table.  */
322131832Sobrien};
323131832Sobrien
324131832Sobrien/* Linenumber stuff.  */
325131832Sobrientypedef struct lineno_cache_entry
326131832Sobrien{
327131832Sobrien  unsigned int line_number;	/* Linenumber from start of function.  */
328131832Sobrien  union
329131832Sobrien  {
330131832Sobrien    struct bfd_symbol *sym;	/* Function name.  */
331131832Sobrien    bfd_vma offset;	    		/* Offset into section.  */
332131832Sobrien  } u;
333131832Sobrien}
334131832Sobrienalent;
335131832Sobrien
336131832Sobrien/* Object and core file sections.  */
337131832Sobrien
338131832Sobrien#define	align_power(addr, align)	\
339131832Sobrien  (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
340131832Sobrien
341131832Sobrientypedef struct bfd_section *sec_ptr;
342131832Sobrien
343131832Sobrien#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
344131832Sobrien#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
345131832Sobrien#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
346131832Sobrien#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
347131832Sobrien#define bfd_section_name(bfd, ptr) ((ptr)->name)
348218822Sdim#define bfd_section_size(bfd, ptr) ((ptr)->size)
349218822Sdim#define bfd_get_section_size(ptr) ((ptr)->size)
350131832Sobrien#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
351131832Sobrien#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
352131832Sobrien#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
353131832Sobrien#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
354131832Sobrien#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
355131832Sobrien
356131832Sobrien#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
357131832Sobrien
358131832Sobrien#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
359131832Sobrien#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
360131832Sobrien#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
361218822Sdim/* Find the address one past the end of SEC.  */
362218822Sdim#define bfd_get_section_limit(bfd, sec) \
363218822Sdim  (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
364218822Sdim   / bfd_octets_per_byte (bfd))
365131832Sobrien
366218822Sdim/* Return TRUE if section has been discarded.  */
367218822Sdim#define elf_discarded_section(sec)				\
368218822Sdim  (!bfd_is_abs_section (sec)					\
369218822Sdim   && bfd_is_abs_section ((sec)->output_section)		\
370218822Sdim   && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE		\
371218822Sdim   && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
372218822Sdim
373218822Sdim/* Forward define.  */
374218822Sdimstruct stat;
375131832Sobrien
376131832Sobrientypedef enum bfd_print_symbol
377131832Sobrien{
378131832Sobrien  bfd_print_symbol_name,
379131832Sobrien  bfd_print_symbol_more,
380131832Sobrien  bfd_print_symbol_all
381131832Sobrien} bfd_print_symbol_type;
382131832Sobrien
383131832Sobrien/* Information about a symbol that nm needs.  */
384131832Sobrien
385131832Sobrientypedef struct _symbol_info
386131832Sobrien{
387131832Sobrien  symvalue value;
388131832Sobrien  char type;
389131832Sobrien  const char *name;            /* Symbol name.  */
390131832Sobrien  unsigned char stab_type;     /* Stab type.  */
391131832Sobrien  char stab_other;             /* Stab other.  */
392131832Sobrien  short stab_desc;             /* Stab desc.  */
393131832Sobrien  const char *stab_name;       /* String for stab type.  */
394131832Sobrien} symbol_info;
395131832Sobrien
396131832Sobrien/* Get the name of a stabs type code.  */
397131832Sobrien
398131832Sobrienextern const char *bfd_get_stab_name (int);
399131832Sobrien
400131832Sobrien/* Hash table routines.  There is no way to free up a hash table.  */
401131832Sobrien
402131832Sobrien/* An element in the hash table.  Most uses will actually use a larger
403131832Sobrien   structure, and an instance of this will be the first field.  */
404131832Sobrien
405131832Sobrienstruct bfd_hash_entry
406131832Sobrien{
407131832Sobrien  /* Next entry for this hash code.  */
408131832Sobrien  struct bfd_hash_entry *next;
409131832Sobrien  /* String being hashed.  */
410131832Sobrien  const char *string;
411131832Sobrien  /* Hash code.  This is the full hash code, not the index into the
412131832Sobrien     table.  */
413131832Sobrien  unsigned long hash;
414131832Sobrien};
415131832Sobrien
416131832Sobrien/* A hash table.  */
417131832Sobrien
418131832Sobrienstruct bfd_hash_table
419131832Sobrien{
420131832Sobrien  /* The hash array.  */
421131832Sobrien  struct bfd_hash_entry **table;
422131832Sobrien  /* A function used to create new elements in the hash table.  The
423131832Sobrien     first entry is itself a pointer to an element.  When this
424131832Sobrien     function is first invoked, this pointer will be NULL.  However,
425131832Sobrien     having the pointer permits a hierarchy of method functions to be
426131832Sobrien     built each of which calls the function in the superclass.  Thus
427131832Sobrien     each function should be written to allocate a new block of memory
428131832Sobrien     only if the argument is NULL.  */
429131832Sobrien  struct bfd_hash_entry *(*newfunc)
430131832Sobrien    (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
431131832Sobrien   /* An objalloc for this hash table.  This is a struct objalloc *,
432131832Sobrien     but we use void * to avoid requiring the inclusion of objalloc.h.  */
433131832Sobrien  void *memory;
434218822Sdim  /* The number of slots in the hash table.  */
435218822Sdim  unsigned int size;
436218822Sdim  /* The number of entries in the hash table.  */
437218822Sdim  unsigned int count;
438218822Sdim  /* The size of elements.  */
439218822Sdim  unsigned int entsize;
440218822Sdim  /* If non-zero, don't grow the hash table.  */
441218822Sdim  unsigned int frozen:1;
442131832Sobrien};
443131832Sobrien
444131832Sobrien/* Initialize a hash table.  */
445131832Sobrienextern bfd_boolean bfd_hash_table_init
446131832Sobrien  (struct bfd_hash_table *,
447131832Sobrien   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
448131832Sobrien			       struct bfd_hash_table *,
449218822Sdim			       const char *),
450218822Sdim   unsigned int);
451131832Sobrien
452131832Sobrien/* Initialize a hash table specifying a size.  */
453131832Sobrienextern bfd_boolean bfd_hash_table_init_n
454131832Sobrien  (struct bfd_hash_table *,
455131832Sobrien   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
456131832Sobrien			       struct bfd_hash_table *,
457131832Sobrien			       const char *),
458218822Sdim   unsigned int, unsigned int);
459131832Sobrien
460131832Sobrien/* Free up a hash table.  */
461131832Sobrienextern void bfd_hash_table_free
462131832Sobrien  (struct bfd_hash_table *);
463131832Sobrien
464131832Sobrien/* Look up a string in a hash table.  If CREATE is TRUE, a new entry
465131832Sobrien   will be created for this string if one does not already exist.  The
466131832Sobrien   COPY argument must be TRUE if this routine should copy the string
467131832Sobrien   into newly allocated memory when adding an entry.  */
468131832Sobrienextern struct bfd_hash_entry *bfd_hash_lookup
469131832Sobrien  (struct bfd_hash_table *, const char *, bfd_boolean create,
470131832Sobrien   bfd_boolean copy);
471131832Sobrien
472131832Sobrien/* Replace an entry in a hash table.  */
473131832Sobrienextern void bfd_hash_replace
474131832Sobrien  (struct bfd_hash_table *, struct bfd_hash_entry *old,
475131832Sobrien   struct bfd_hash_entry *nw);
476131832Sobrien
477131832Sobrien/* Base method for creating a hash table entry.  */
478131832Sobrienextern struct bfd_hash_entry *bfd_hash_newfunc
479131832Sobrien  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
480131832Sobrien
481131832Sobrien/* Grab some space for a hash table entry.  */
482131832Sobrienextern void *bfd_hash_allocate
483131832Sobrien  (struct bfd_hash_table *, unsigned int);
484131832Sobrien
485131832Sobrien/* Traverse a hash table in a random order, calling a function on each
486131832Sobrien   element.  If the function returns FALSE, the traversal stops.  The
487131832Sobrien   INFO argument is passed to the function.  */
488131832Sobrienextern void bfd_hash_traverse
489131832Sobrien  (struct bfd_hash_table *,
490131832Sobrien   bfd_boolean (*) (struct bfd_hash_entry *, void *),
491131832Sobrien   void *info);
492131832Sobrien
493218822Sdim/* Allows the default size of a hash table to be configured. New hash
494218822Sdim   tables allocated using bfd_hash_table_init will be created with
495218822Sdim   this size.  */
496218822Sdimextern void bfd_hash_set_default_size (bfd_size_type);
497218822Sdim
498218822Sdim/* This structure is used to keep track of stabs in sections
499218822Sdim   information while linking.  */
500218822Sdim
501218822Sdimstruct stab_info
502218822Sdim{
503218822Sdim  /* A hash table used to hold stabs strings.  */
504218822Sdim  struct bfd_strtab_hash *strings;
505218822Sdim  /* The header file hash table.  */
506218822Sdim  struct bfd_hash_table includes;
507218822Sdim  /* The first .stabstr section.  */
508218822Sdim  struct bfd_section *stabstr;
509218822Sdim};
510218822Sdim
511131832Sobrien#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
512131832Sobrien
513131832Sobrien/* User program access to BFD facilities.  */
514131832Sobrien
515131832Sobrien/* Direct I/O routines, for programs which know more about the object
516131832Sobrien   file than BFD does.  Use higher level routines if possible.  */
517131832Sobrien
518131832Sobrienextern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
519131832Sobrienextern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
520131832Sobrienextern int bfd_seek (bfd *, file_ptr, int);
521131832Sobrienextern file_ptr bfd_tell (bfd *);
522131832Sobrienextern int bfd_flush (bfd *);
523131832Sobrienextern int bfd_stat (bfd *, struct stat *);
524131832Sobrien
525131832Sobrien/* Deprecated old routines.  */
526131832Sobrien#if __GNUC__
527131832Sobrien#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
528131832Sobrien  (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),	\
529131832Sobrien   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
530131832Sobrien#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
531131832Sobrien  (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),	\
532131832Sobrien   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
533131832Sobrien#else
534131832Sobrien#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
535131832Sobrien  (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
536131832Sobrien   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
537131832Sobrien#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
538131832Sobrien  (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
539131832Sobrien   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
540131832Sobrien#endif
541131832Sobrienextern void warn_deprecated (const char *, const char *, int, const char *);
542131832Sobrien
543131832Sobrien/* Cast from const char * to char * so that caller can assign to
544131832Sobrien   a char * without a warning.  */
545131832Sobrien#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
546131832Sobrien#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
547131832Sobrien#define bfd_get_format(abfd) ((abfd)->format)
548131832Sobrien#define bfd_get_target(abfd) ((abfd)->xvec->name)
549131832Sobrien#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
550131832Sobrien#define bfd_family_coff(abfd) \
551131832Sobrien  (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
552131832Sobrien   bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
553131832Sobrien#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
554131832Sobrien#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
555131832Sobrien#define bfd_header_big_endian(abfd) \
556131832Sobrien  ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
557131832Sobrien#define bfd_header_little_endian(abfd) \
558131832Sobrien  ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
559131832Sobrien#define bfd_get_file_flags(abfd) ((abfd)->flags)
560131832Sobrien#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
561131832Sobrien#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
562131832Sobrien#define bfd_my_archive(abfd) ((abfd)->my_archive)
563131832Sobrien#define bfd_has_map(abfd) ((abfd)->has_armap)
564131832Sobrien
565131832Sobrien#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
566131832Sobrien#define bfd_usrdata(abfd) ((abfd)->usrdata)
567131832Sobrien
568131832Sobrien#define bfd_get_start_address(abfd) ((abfd)->start_address)
569131832Sobrien#define bfd_get_symcount(abfd) ((abfd)->symcount)
570131832Sobrien#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
571131832Sobrien#define bfd_count_sections(abfd) ((abfd)->section_count)
572131832Sobrien
573131832Sobrien#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
574131832Sobrien
575131832Sobrien#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
576131832Sobrien
577131832Sobrien#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
578131832Sobrien
579131832Sobrienextern bfd_boolean bfd_cache_close
580131832Sobrien  (bfd *abfd);
581131832Sobrien/* NB: This declaration should match the autogenerated one in libbfd.h.  */
582131832Sobrien
583218822Sdimextern bfd_boolean bfd_cache_close_all (void);
584218822Sdim
585131832Sobrienextern bfd_boolean bfd_record_phdr
586131832Sobrien  (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
587131832Sobrien   bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
588131832Sobrien
589131832Sobrien/* Byte swapping routines.  */
590131832Sobrien
591131832Sobrienbfd_uint64_t bfd_getb64 (const void *);
592131832Sobrienbfd_uint64_t bfd_getl64 (const void *);
593131832Sobrienbfd_int64_t bfd_getb_signed_64 (const void *);
594131832Sobrienbfd_int64_t bfd_getl_signed_64 (const void *);
595131832Sobrienbfd_vma bfd_getb32 (const void *);
596131832Sobrienbfd_vma bfd_getl32 (const void *);
597131832Sobrienbfd_signed_vma bfd_getb_signed_32 (const void *);
598131832Sobrienbfd_signed_vma bfd_getl_signed_32 (const void *);
599131832Sobrienbfd_vma bfd_getb16 (const void *);
600131832Sobrienbfd_vma bfd_getl16 (const void *);
601131832Sobrienbfd_signed_vma bfd_getb_signed_16 (const void *);
602131832Sobrienbfd_signed_vma bfd_getl_signed_16 (const void *);
603131832Sobrienvoid bfd_putb64 (bfd_uint64_t, void *);
604131832Sobrienvoid bfd_putl64 (bfd_uint64_t, void *);
605131832Sobrienvoid bfd_putb32 (bfd_vma, void *);
606131832Sobrienvoid bfd_putl32 (bfd_vma, void *);
607131832Sobrienvoid bfd_putb16 (bfd_vma, void *);
608131832Sobrienvoid bfd_putl16 (bfd_vma, void *);
609131832Sobrien
610131832Sobrien/* Byte swapping routines which take size and endiannes as arguments.  */
611131832Sobrien
612131832Sobrienbfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
613131832Sobrienvoid bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
614218822Sdim
615218822Sdimextern bfd_boolean bfd_section_already_linked_table_init (void);
616218822Sdimextern void bfd_section_already_linked_table_free (void);
617131832Sobrien
618131832Sobrien/* Externally visible ECOFF routines.  */
619131832Sobrien
620131832Sobrien#if defined(__STDC__) || defined(ALMOST_STDC)
621131832Sobrienstruct ecoff_debug_info;
622131832Sobrienstruct ecoff_debug_swap;
623131832Sobrienstruct ecoff_extr;
624131832Sobrienstruct bfd_symbol;
625131832Sobrienstruct bfd_link_info;
626131832Sobrienstruct bfd_link_hash_entry;
627131832Sobrienstruct bfd_elf_version_tree;
628131832Sobrien#endif
629131832Sobrienextern bfd_vma bfd_ecoff_get_gp_value
630131832Sobrien  (bfd * abfd);
631131832Sobrienextern bfd_boolean bfd_ecoff_set_gp_value
632131832Sobrien  (bfd *abfd, bfd_vma gp_value);
633131832Sobrienextern bfd_boolean bfd_ecoff_set_regmasks
634131832Sobrien  (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
635131832Sobrien   unsigned long *cprmask);
636131832Sobrienextern void *bfd_ecoff_debug_init
637131832Sobrien  (bfd *output_bfd, struct ecoff_debug_info *output_debug,
638131832Sobrien   const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
639131832Sobrienextern void bfd_ecoff_debug_free
640131832Sobrien  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
641131832Sobrien   const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
642131832Sobrienextern bfd_boolean bfd_ecoff_debug_accumulate
643131832Sobrien  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
644131832Sobrien   const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
645131832Sobrien   struct ecoff_debug_info *input_debug,
646131832Sobrien   const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
647131832Sobrienextern bfd_boolean bfd_ecoff_debug_accumulate_other
648131832Sobrien  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
649131832Sobrien   const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
650131832Sobrien   struct bfd_link_info *);
651131832Sobrienextern bfd_boolean bfd_ecoff_debug_externals
652131832Sobrien  (bfd *abfd, struct ecoff_debug_info *debug,
653131832Sobrien   const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
654131832Sobrien   bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
655131832Sobrien   void (*set_index) (struct bfd_symbol *, bfd_size_type));
656131832Sobrienextern bfd_boolean bfd_ecoff_debug_one_external
657131832Sobrien  (bfd *abfd, struct ecoff_debug_info *debug,
658131832Sobrien   const struct ecoff_debug_swap *swap, const char *name,
659131832Sobrien   struct ecoff_extr *esym);
660131832Sobrienextern bfd_size_type bfd_ecoff_debug_size
661131832Sobrien  (bfd *abfd, struct ecoff_debug_info *debug,
662131832Sobrien   const struct ecoff_debug_swap *swap);
663131832Sobrienextern bfd_boolean bfd_ecoff_write_debug
664131832Sobrien  (bfd *abfd, struct ecoff_debug_info *debug,
665131832Sobrien   const struct ecoff_debug_swap *swap, file_ptr where);
666131832Sobrienextern bfd_boolean bfd_ecoff_write_accumulated_debug
667131832Sobrien  (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
668131832Sobrien   const struct ecoff_debug_swap *swap,
669131832Sobrien   struct bfd_link_info *info, file_ptr where);
670131832Sobrien
671131832Sobrien/* Externally visible ELF routines.  */
672131832Sobrien
673131832Sobrienstruct bfd_link_needed_list
674131832Sobrien{
675131832Sobrien  struct bfd_link_needed_list *next;
676131832Sobrien  bfd *by;
677131832Sobrien  const char *name;
678131832Sobrien};
679131832Sobrien
680131832Sobrienenum dynamic_lib_link_class {
681131832Sobrien  DYN_NORMAL = 0,
682131832Sobrien  DYN_AS_NEEDED = 1,
683218822Sdim  DYN_DT_NEEDED = 2,
684218822Sdim  DYN_NO_ADD_NEEDED = 4,
685218822Sdim  DYN_NO_NEEDED = 8
686131832Sobrien};
687131832Sobrien
688218822Sdimenum notice_asneeded_action {
689218822Sdim  notice_as_needed,
690218822Sdim  notice_not_needed,
691218822Sdim  notice_needed
692218822Sdim};
693218822Sdim
694131832Sobrienextern bfd_boolean bfd_elf_record_link_assignment
695218822Sdim  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
696218822Sdim   bfd_boolean);
697131832Sobrienextern struct bfd_link_needed_list *bfd_elf_get_needed_list
698131832Sobrien  (bfd *, struct bfd_link_info *);
699131832Sobrienextern bfd_boolean bfd_elf_get_bfd_needed_list
700131832Sobrien  (bfd *, struct bfd_link_needed_list **);
701131832Sobrienextern bfd_boolean bfd_elf_size_dynamic_sections
702131832Sobrien  (bfd *, const char *, const char *, const char *, const char * const *,
703218822Sdim   struct bfd_link_info *, struct bfd_section **,
704218822Sdim   struct bfd_elf_version_tree *);
705218822Sdimextern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
706218822Sdim  (bfd *, struct bfd_link_info *);
707131832Sobrienextern void bfd_elf_set_dt_needed_name
708131832Sobrien  (bfd *, const char *);
709131832Sobrienextern const char *bfd_elf_get_dt_soname
710131832Sobrien  (bfd *);
711131832Sobrienextern void bfd_elf_set_dyn_lib_class
712218822Sdim  (bfd *, enum dynamic_lib_link_class);
713218822Sdimextern int bfd_elf_get_dyn_lib_class
714218822Sdim  (bfd *);
715131832Sobrienextern struct bfd_link_needed_list *bfd_elf_get_runpath_list
716131832Sobrien  (bfd *, struct bfd_link_info *);
717131832Sobrienextern bfd_boolean bfd_elf_discard_info
718131832Sobrien  (bfd *, struct bfd_link_info *);
719218822Sdimextern unsigned int _bfd_elf_default_action_discarded
720218822Sdim  (struct bfd_section *);
721131832Sobrien
722131832Sobrien/* Return an upper bound on the number of bytes required to store a
723131832Sobrien   copy of ABFD's program header table entries.  Return -1 if an error
724131832Sobrien   occurs; bfd_get_error will return an appropriate code.  */
725131832Sobrienextern long bfd_get_elf_phdr_upper_bound
726131832Sobrien  (bfd *abfd);
727131832Sobrien
728131832Sobrien/* Copy ABFD's program header table entries to *PHDRS.  The entries
729131832Sobrien   will be stored as an array of Elf_Internal_Phdr structures, as
730131832Sobrien   defined in include/elf/internal.h.  To find out how large the
731131832Sobrien   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
732131832Sobrien
733131832Sobrien   Return the number of program header table entries read, or -1 if an
734131832Sobrien   error occurs; bfd_get_error will return an appropriate code.  */
735131832Sobrienextern int bfd_get_elf_phdrs
736131832Sobrien  (bfd *abfd, void *phdrs);
737131832Sobrien
738131832Sobrien/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
739131832Sobrien   reconstruct an ELF file by reading the segments out of remote memory
740131832Sobrien   based on the ELF file header at EHDR_VMA and the ELF program headers it
741131832Sobrien   points to.  If not null, *LOADBASEP is filled in with the difference
742131832Sobrien   between the VMAs from which the segments were read, and the VMAs the
743131832Sobrien   file headers (and hence BFD's idea of each section's VMA) put them at.
744131832Sobrien
745131832Sobrien   The function TARGET_READ_MEMORY is called to copy LEN bytes from the
746131832Sobrien   remote memory at target address VMA into the local buffer at MYADDR; it
747131832Sobrien   should return zero on success or an `errno' code on failure.  TEMPL must
748131832Sobrien   be a BFD for an ELF target with the word size and byte order found in
749131832Sobrien   the remote memory.  */
750131832Sobrienextern bfd *bfd_elf_bfd_from_remote_memory
751131832Sobrien  (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
752218822Sdim   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
753131832Sobrien
754131832Sobrien/* Return the arch_size field of an elf bfd, or -1 if not elf.  */
755131832Sobrienextern int bfd_get_arch_size
756131832Sobrien  (bfd *);
757131832Sobrien
758131832Sobrien/* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
759131832Sobrienextern int bfd_get_sign_extend_vma
760131832Sobrien  (bfd *);
761131832Sobrien
762131832Sobrienextern struct bfd_section *_bfd_elf_tls_setup
763131832Sobrien  (bfd *, struct bfd_link_info *);
764131832Sobrien
765218822Sdimextern void _bfd_fix_excluded_sec_syms
766218822Sdim  (bfd *, struct bfd_link_info *);
767218822Sdim
768218822Sdimextern unsigned bfd_m68k_mach_to_features (int);
769218822Sdim
770218822Sdimextern int bfd_m68k_features_to_mach (unsigned);
771218822Sdim
772131832Sobrienextern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
773218822Sdim  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
774218822Sdim   char **);
775131832Sobrien
776218822Sdimextern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
777218822Sdim  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
778218822Sdim   char **);
779218822Sdim
780131832Sobrien/* SunOS shared library support routines for the linker.  */
781131832Sobrien
782131832Sobrienextern struct bfd_link_needed_list *bfd_sunos_get_needed_list
783131832Sobrien  (bfd *, struct bfd_link_info *);
784131832Sobrienextern bfd_boolean bfd_sunos_record_link_assignment
785131832Sobrien  (bfd *, struct bfd_link_info *, const char *);
786131832Sobrienextern bfd_boolean bfd_sunos_size_dynamic_sections
787218822Sdim  (bfd *, struct bfd_link_info *, struct bfd_section **,
788218822Sdim   struct bfd_section **, struct bfd_section **);
789131832Sobrien
790131832Sobrien/* Linux shared library support routines for the linker.  */
791131832Sobrien
792131832Sobrienextern bfd_boolean bfd_i386linux_size_dynamic_sections
793131832Sobrien  (bfd *, struct bfd_link_info *);
794131832Sobrienextern bfd_boolean bfd_m68klinux_size_dynamic_sections
795131832Sobrien  (bfd *, struct bfd_link_info *);
796131832Sobrienextern bfd_boolean bfd_sparclinux_size_dynamic_sections
797131832Sobrien  (bfd *, struct bfd_link_info *);
798131832Sobrien
799131832Sobrien/* mmap hacks */
800131832Sobrien
801131832Sobrienstruct _bfd_window_internal;
802131832Sobrientypedef struct _bfd_window_internal bfd_window_internal;
803131832Sobrien
804131832Sobrientypedef struct _bfd_window
805131832Sobrien{
806131832Sobrien  /* What the user asked for.  */
807131832Sobrien  void *data;
808131832Sobrien  bfd_size_type size;
809131832Sobrien  /* The actual window used by BFD.  Small user-requested read-only
810131832Sobrien     regions sharing a page may share a single window into the object
811131832Sobrien     file.  Read-write versions shouldn't until I've fixed things to
812131832Sobrien     keep track of which portions have been claimed by the
813131832Sobrien     application; don't want to give the same region back when the
814131832Sobrien     application wants two writable copies!  */
815131832Sobrien  struct _bfd_window_internal *i;
816131832Sobrien}
817131832Sobrienbfd_window;
818131832Sobrien
819131832Sobrienextern void bfd_init_window
820131832Sobrien  (bfd_window *);
821131832Sobrienextern void bfd_free_window
822131832Sobrien  (bfd_window *);
823131832Sobrienextern bfd_boolean bfd_get_file_window
824131832Sobrien  (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
825131832Sobrien
826131832Sobrien/* XCOFF support routines for the linker.  */
827131832Sobrien
828131832Sobrienextern bfd_boolean bfd_xcoff_link_record_set
829131832Sobrien  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
830131832Sobrienextern bfd_boolean bfd_xcoff_import_symbol
831131832Sobrien  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
832131832Sobrien   const char *, const char *, const char *, unsigned int);
833131832Sobrienextern bfd_boolean bfd_xcoff_export_symbol
834131832Sobrien  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
835131832Sobrienextern bfd_boolean bfd_xcoff_link_count_reloc
836131832Sobrien  (bfd *, struct bfd_link_info *, const char *);
837131832Sobrienextern bfd_boolean bfd_xcoff_record_link_assignment
838131832Sobrien  (bfd *, struct bfd_link_info *, const char *);
839131832Sobrienextern bfd_boolean bfd_xcoff_size_dynamic_sections
840131832Sobrien  (bfd *, struct bfd_link_info *, const char *, const char *,
841131832Sobrien   unsigned long, unsigned long, unsigned long, bfd_boolean,
842131832Sobrien   int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
843131832Sobrienextern bfd_boolean bfd_xcoff_link_generate_rtinit
844131832Sobrien  (bfd *, const char *, const char *, bfd_boolean);
845131832Sobrien
846131832Sobrien/* XCOFF support routines for ar.  */
847131832Sobrienextern bfd_boolean bfd_xcoff_ar_archive_set_magic
848131832Sobrien  (bfd *, char *);
849131832Sobrien
850131832Sobrien/* Externally visible COFF routines.  */
851131832Sobrien
852131832Sobrien#if defined(__STDC__) || defined(ALMOST_STDC)
853131832Sobrienstruct internal_syment;
854131832Sobrienunion internal_auxent;
855131832Sobrien#endif
856131832Sobrien
857131832Sobrienextern bfd_boolean bfd_coff_get_syment
858131832Sobrien  (bfd *, struct bfd_symbol *, struct internal_syment *);
859131832Sobrien
860131832Sobrienextern bfd_boolean bfd_coff_get_auxent
861131832Sobrien  (bfd *, struct bfd_symbol *, int, union internal_auxent *);
862131832Sobrien
863131832Sobrienextern bfd_boolean bfd_coff_set_symbol_class
864131832Sobrien  (bfd *, struct bfd_symbol *, unsigned int);
865131832Sobrien
866131832Sobrienextern bfd_boolean bfd_m68k_coff_create_embedded_relocs
867131832Sobrien  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
868131832Sobrien
869218822Sdim/* ARM VFP11 erratum workaround support.  */
870218822Sdimtypedef enum
871218822Sdim{
872218822Sdim  BFD_ARM_VFP11_FIX_DEFAULT,
873218822Sdim  BFD_ARM_VFP11_FIX_NONE,
874218822Sdim  BFD_ARM_VFP11_FIX_SCALAR,
875218822Sdim  BFD_ARM_VFP11_FIX_VECTOR
876218822Sdim} bfd_arm_vfp11_fix;
877218822Sdim
878218822Sdimextern void bfd_elf32_arm_init_maps
879218822Sdim  (bfd *);
880218822Sdim
881218822Sdimextern void bfd_elf32_arm_set_vfp11_fix
882218822Sdim  (bfd *, struct bfd_link_info *);
883218822Sdim
884218822Sdimextern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
885218822Sdim  (bfd *, struct bfd_link_info *);
886218822Sdim
887218822Sdimextern void bfd_elf32_arm_vfp11_fix_veneer_locations
888218822Sdim  (bfd *, struct bfd_link_info *);
889218822Sdim
890131832Sobrien/* ARM Interworking support.  Called from linker.  */
891131832Sobrienextern bfd_boolean bfd_arm_allocate_interworking_sections
892131832Sobrien  (struct bfd_link_info *);
893131832Sobrien
894131832Sobrienextern bfd_boolean bfd_arm_process_before_allocation
895131832Sobrien  (bfd *, struct bfd_link_info *, int);
896131832Sobrien
897131832Sobrienextern bfd_boolean bfd_arm_get_bfd_for_interworking
898131832Sobrien  (bfd *, struct bfd_link_info *);
899131832Sobrien
900131832Sobrien/* PE ARM Interworking support.  Called from linker.  */
901131832Sobrienextern bfd_boolean bfd_arm_pe_allocate_interworking_sections
902131832Sobrien  (struct bfd_link_info *);
903131832Sobrien
904131832Sobrienextern bfd_boolean bfd_arm_pe_process_before_allocation
905131832Sobrien  (bfd *, struct bfd_link_info *, int);
906131832Sobrien
907131832Sobrienextern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
908131832Sobrien  (bfd *, struct bfd_link_info *);
909131832Sobrien
910131832Sobrien/* ELF ARM Interworking support.  Called from linker.  */
911131832Sobrienextern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
912131832Sobrien  (struct bfd_link_info *);
913131832Sobrien
914131832Sobrienextern bfd_boolean bfd_elf32_arm_process_before_allocation
915218822Sdim  (bfd *, struct bfd_link_info *);
916131832Sobrien
917218822Sdimvoid bfd_elf32_arm_set_target_relocs
918218822Sdim  (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
919218822Sdim   int, int);
920218822Sdim
921131832Sobrienextern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
922131832Sobrien  (bfd *, struct bfd_link_info *);
923131832Sobrien
924131832Sobrienextern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
925131832Sobrien  (bfd *, struct bfd_link_info *);
926131832Sobrien
927218822Sdim/* ELF ARM mapping symbol support */
928218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_MAP	(1 << 0)
929218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_TAG	(1 << 1)
930218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER  (1 << 2)
931218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_ANY	(~0)
932218822Sdimextern bfd_boolean bfd_is_arm_special_symbol_name
933218822Sdim  (const char * name, int type);
934218822Sdim
935218822Sdimextern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
936218822Sdim
937131832Sobrien/* ARM Note section processing.  */
938131832Sobrienextern bfd_boolean bfd_arm_merge_machines
939131832Sobrien  (bfd *, bfd *);
940131832Sobrien
941131832Sobrienextern bfd_boolean bfd_arm_update_notes
942131832Sobrien  (bfd *, const char *);
943131832Sobrien
944131832Sobrienextern unsigned int bfd_arm_get_mach_from_notes
945131832Sobrien  (bfd *, const char *);
946131832Sobrien
947131832Sobrien/* TI COFF load page support.  */
948131832Sobrienextern void bfd_ticoff_set_section_load_page
949131832Sobrien  (struct bfd_section *, int);
950131832Sobrien
951131832Sobrienextern int bfd_ticoff_get_section_load_page
952131832Sobrien  (struct bfd_section *);
953131832Sobrien
954131832Sobrien/* H8/300 functions.  */
955131832Sobrienextern bfd_vma bfd_h8300_pad_address
956131832Sobrien  (bfd *, bfd_vma);
957131832Sobrien
958131832Sobrien/* IA64 Itanium code generation.  Called from linker.  */
959131832Sobrienextern void bfd_elf32_ia64_after_parse
960131832Sobrien  (int);
961131832Sobrien
962131832Sobrienextern void bfd_elf64_ia64_after_parse
963131832Sobrien  (int);
964131832Sobrien
965218822Sdim/* This structure is used for a comdat section, as in PE.  A comdat
966218822Sdim   section is associated with a particular symbol.  When the linker
967218822Sdim   sees a comdat section, it keeps only one of the sections with a
968218822Sdim   given name and associated with a given symbol.  */
969218822Sdim
970218822Sdimstruct coff_comdat_info
971218822Sdim{
972218822Sdim  /* The name of the symbol associated with a comdat section.  */
973218822Sdim  const char *name;
974218822Sdim
975218822Sdim  /* The local symbol table index of the symbol associated with a
976218822Sdim     comdat section.  This is only meaningful to the object file format
977218822Sdim     specific code; it is not an index into the list returned by
978218822Sdim     bfd_canonicalize_symtab.  */
979218822Sdim  long symbol;
980218822Sdim};
981218822Sdim
982218822Sdimextern struct coff_comdat_info *bfd_coff_get_comdat_section
983218822Sdim  (bfd *, struct bfd_section *);
984218822Sdim
985131832Sobrien/* Extracted from init.c.  */
986131832Sobrienvoid bfd_init (void);
987131832Sobrien
988131832Sobrien/* Extracted from opncls.c.  */
989218822Sdimbfd *bfd_fopen (const char *filename, const char *target,
990218822Sdim    const char *mode, int fd);
991218822Sdim
992131832Sobrienbfd *bfd_openr (const char *filename, const char *target);
993131832Sobrien
994131832Sobrienbfd *bfd_fdopenr (const char *filename, const char *target, int fd);
995131832Sobrien
996131832Sobrienbfd *bfd_openstreamr (const char *, const char *, void *);
997131832Sobrien
998218822Sdimbfd *bfd_openr_iovec (const char *filename, const char *target,
999218822Sdim    void *(*open) (struct bfd *nbfd,
1000218822Sdim    void *open_closure),
1001218822Sdim    void *open_closure,
1002218822Sdim    file_ptr (*pread) (struct bfd *nbfd,
1003218822Sdim    void *stream,
1004218822Sdim    void *buf,
1005218822Sdim    file_ptr nbytes,
1006218822Sdim    file_ptr offset),
1007218822Sdim    int (*close) (struct bfd *nbfd,
1008218822Sdim    void *stream),
1009218822Sdim    int (*stat) (struct bfd *abfd,
1010218822Sdim    void *stream,
1011218822Sdim    struct stat *sb));
1012218822Sdim
1013131832Sobrienbfd *bfd_openw (const char *filename, const char *target);
1014131832Sobrien
1015131832Sobrienbfd_boolean bfd_close (bfd *abfd);
1016131832Sobrien
1017131832Sobrienbfd_boolean bfd_close_all_done (bfd *);
1018131832Sobrien
1019131832Sobrienbfd *bfd_create (const char *filename, bfd *templ);
1020131832Sobrien
1021131832Sobrienbfd_boolean bfd_make_writable (bfd *abfd);
1022131832Sobrien
1023131832Sobrienbfd_boolean bfd_make_readable (bfd *abfd);
1024131832Sobrien
1025131832Sobrienunsigned long bfd_calc_gnu_debuglink_crc32
1026131832Sobrien   (unsigned long crc, const unsigned char *buf, bfd_size_type len);
1027131832Sobrien
1028131832Sobrienchar *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
1029131832Sobrien
1030131832Sobrienstruct bfd_section *bfd_create_gnu_debuglink_section
1031131832Sobrien   (bfd *abfd, const char *filename);
1032131832Sobrien
1033131832Sobrienbfd_boolean bfd_fill_in_gnu_debuglink_section
1034131832Sobrien   (bfd *abfd, struct bfd_section *sect, const char *filename);
1035131832Sobrien
1036131832Sobrien/* Extracted from libbfd.c.  */
1037131832Sobrien
1038131832Sobrien/* Byte swapping macros for user section data.  */
1039131832Sobrien
1040131832Sobrien#define bfd_put_8(abfd, val, ptr) \
1041131832Sobrien  ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
1042131832Sobrien#define bfd_put_signed_8 \
1043131832Sobrien  bfd_put_8
1044131832Sobrien#define bfd_get_8(abfd, ptr) \
1045131832Sobrien  (*(unsigned char *) (ptr) & 0xff)
1046131832Sobrien#define bfd_get_signed_8(abfd, ptr) \
1047131832Sobrien  (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1048131832Sobrien
1049131832Sobrien#define bfd_put_16(abfd, val, ptr) \
1050131832Sobrien  BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1051131832Sobrien#define bfd_put_signed_16 \
1052131832Sobrien  bfd_put_16
1053131832Sobrien#define bfd_get_16(abfd, ptr) \
1054131832Sobrien  BFD_SEND (abfd, bfd_getx16, (ptr))
1055131832Sobrien#define bfd_get_signed_16(abfd, ptr) \
1056131832Sobrien  BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1057131832Sobrien
1058131832Sobrien#define bfd_put_32(abfd, val, ptr) \
1059131832Sobrien  BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1060131832Sobrien#define bfd_put_signed_32 \
1061131832Sobrien  bfd_put_32
1062131832Sobrien#define bfd_get_32(abfd, ptr) \
1063131832Sobrien  BFD_SEND (abfd, bfd_getx32, (ptr))
1064131832Sobrien#define bfd_get_signed_32(abfd, ptr) \
1065131832Sobrien  BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1066131832Sobrien
1067131832Sobrien#define bfd_put_64(abfd, val, ptr) \
1068131832Sobrien  BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1069131832Sobrien#define bfd_put_signed_64 \
1070131832Sobrien  bfd_put_64
1071131832Sobrien#define bfd_get_64(abfd, ptr) \
1072131832Sobrien  BFD_SEND (abfd, bfd_getx64, (ptr))
1073131832Sobrien#define bfd_get_signed_64(abfd, ptr) \
1074131832Sobrien  BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1075131832Sobrien
1076131832Sobrien#define bfd_get(bits, abfd, ptr)                       \
1077131832Sobrien  ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr)       \
1078131832Sobrien   : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
1079131832Sobrien   : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
1080131832Sobrien   : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
1081131832Sobrien   : (abort (), (bfd_vma) - 1))
1082131832Sobrien
1083131832Sobrien#define bfd_put(bits, abfd, val, ptr)                  \
1084131832Sobrien  ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
1085131832Sobrien   : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)                \
1086131832Sobrien   : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)                \
1087131832Sobrien   : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)                \
1088131832Sobrien   : (abort (), (void) 0))
1089131832Sobrien
1090131832Sobrien
1091131832Sobrien/* Byte swapping macros for file header data.  */
1092131832Sobrien
1093131832Sobrien#define bfd_h_put_8(abfd, val, ptr) \
1094131832Sobrien  bfd_put_8 (abfd, val, ptr)
1095131832Sobrien#define bfd_h_put_signed_8(abfd, val, ptr) \
1096131832Sobrien  bfd_put_8 (abfd, val, ptr)
1097131832Sobrien#define bfd_h_get_8(abfd, ptr) \
1098131832Sobrien  bfd_get_8 (abfd, ptr)
1099131832Sobrien#define bfd_h_get_signed_8(abfd, ptr) \
1100131832Sobrien  bfd_get_signed_8 (abfd, ptr)
1101131832Sobrien
1102131832Sobrien#define bfd_h_put_16(abfd, val, ptr) \
1103131832Sobrien  BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1104131832Sobrien#define bfd_h_put_signed_16 \
1105131832Sobrien  bfd_h_put_16
1106131832Sobrien#define bfd_h_get_16(abfd, ptr) \
1107131832Sobrien  BFD_SEND (abfd, bfd_h_getx16, (ptr))
1108131832Sobrien#define bfd_h_get_signed_16(abfd, ptr) \
1109131832Sobrien  BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1110131832Sobrien
1111131832Sobrien#define bfd_h_put_32(abfd, val, ptr) \
1112131832Sobrien  BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1113131832Sobrien#define bfd_h_put_signed_32 \
1114131832Sobrien  bfd_h_put_32
1115131832Sobrien#define bfd_h_get_32(abfd, ptr) \
1116131832Sobrien  BFD_SEND (abfd, bfd_h_getx32, (ptr))
1117131832Sobrien#define bfd_h_get_signed_32(abfd, ptr) \
1118131832Sobrien  BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1119131832Sobrien
1120131832Sobrien#define bfd_h_put_64(abfd, val, ptr) \
1121131832Sobrien  BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1122131832Sobrien#define bfd_h_put_signed_64 \
1123131832Sobrien  bfd_h_put_64
1124131832Sobrien#define bfd_h_get_64(abfd, ptr) \
1125131832Sobrien  BFD_SEND (abfd, bfd_h_getx64, (ptr))
1126131832Sobrien#define bfd_h_get_signed_64(abfd, ptr) \
1127131832Sobrien  BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
1128131832Sobrien
1129131832Sobrien/* Aliases for the above, which should eventually go away.  */
1130131832Sobrien
1131131832Sobrien#define H_PUT_64  bfd_h_put_64
1132131832Sobrien#define H_PUT_32  bfd_h_put_32
1133131832Sobrien#define H_PUT_16  bfd_h_put_16
1134131832Sobrien#define H_PUT_8   bfd_h_put_8
1135131832Sobrien#define H_PUT_S64 bfd_h_put_signed_64
1136131832Sobrien#define H_PUT_S32 bfd_h_put_signed_32
1137131832Sobrien#define H_PUT_S16 bfd_h_put_signed_16
1138131832Sobrien#define H_PUT_S8  bfd_h_put_signed_8
1139131832Sobrien#define H_GET_64  bfd_h_get_64
1140131832Sobrien#define H_GET_32  bfd_h_get_32
1141131832Sobrien#define H_GET_16  bfd_h_get_16
1142131832Sobrien#define H_GET_8   bfd_h_get_8
1143131832Sobrien#define H_GET_S64 bfd_h_get_signed_64
1144131832Sobrien#define H_GET_S32 bfd_h_get_signed_32
1145131832Sobrien#define H_GET_S16 bfd_h_get_signed_16
1146131832Sobrien#define H_GET_S8  bfd_h_get_signed_8
1147131832Sobrien
1148131832Sobrien
1149131832Sobrien/* Extracted from bfdio.c.  */
1150131832Sobrienlong bfd_get_mtime (bfd *abfd);
1151131832Sobrien
1152218822Sdimfile_ptr bfd_get_size (bfd *abfd);
1153131832Sobrien
1154131832Sobrien/* Extracted from bfdwin.c.  */
1155131832Sobrien/* Extracted from section.c.  */
1156131832Sobrientypedef struct bfd_section
1157131832Sobrien{
1158131832Sobrien  /* The name of the section; the name isn't a copy, the pointer is
1159131832Sobrien     the same as that passed to bfd_make_section.  */
1160131832Sobrien  const char *name;
1161131832Sobrien
1162131832Sobrien  /* A unique sequence number.  */
1163131832Sobrien  int id;
1164131832Sobrien
1165131832Sobrien  /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
1166131832Sobrien  int index;
1167131832Sobrien
1168131832Sobrien  /* The next section in the list belonging to the BFD, or NULL.  */
1169131832Sobrien  struct bfd_section *next;
1170131832Sobrien
1171218822Sdim  /* The previous section in the list belonging to the BFD, or NULL.  */
1172218822Sdim  struct bfd_section *prev;
1173218822Sdim
1174131832Sobrien  /* The field flags contains attributes of the section. Some
1175131832Sobrien     flags are read in from the object file, and some are
1176131832Sobrien     synthesized from other information.  */
1177131832Sobrien  flagword flags;
1178131832Sobrien
1179131832Sobrien#define SEC_NO_FLAGS   0x000
1180131832Sobrien
1181131832Sobrien  /* Tells the OS to allocate space for this section when loading.
1182131832Sobrien     This is clear for a section containing debug information only.  */
1183131832Sobrien#define SEC_ALLOC      0x001
1184131832Sobrien
1185131832Sobrien  /* Tells the OS to load the section from the file when loading.
1186131832Sobrien     This is clear for a .bss section.  */
1187131832Sobrien#define SEC_LOAD       0x002
1188131832Sobrien
1189131832Sobrien  /* The section contains data still to be relocated, so there is
1190131832Sobrien     some relocation information too.  */
1191131832Sobrien#define SEC_RELOC      0x004
1192131832Sobrien
1193131832Sobrien  /* A signal to the OS that the section contains read only data.  */
1194218822Sdim#define SEC_READONLY   0x008
1195131832Sobrien
1196131832Sobrien  /* The section contains code only.  */
1197218822Sdim#define SEC_CODE       0x010
1198131832Sobrien
1199131832Sobrien  /* The section contains data only.  */
1200218822Sdim#define SEC_DATA       0x020
1201131832Sobrien
1202131832Sobrien  /* The section will reside in ROM.  */
1203218822Sdim#define SEC_ROM        0x040
1204131832Sobrien
1205131832Sobrien  /* The section contains constructor information. This section
1206131832Sobrien     type is used by the linker to create lists of constructors and
1207131832Sobrien     destructors used by <<g++>>. When a back end sees a symbol
1208131832Sobrien     which should be used in a constructor list, it creates a new
1209131832Sobrien     section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
1210131832Sobrien     the symbol to it, and builds a relocation. To build the lists
1211131832Sobrien     of constructors, all the linker has to do is catenate all the
1212131832Sobrien     sections called <<__CTOR_LIST__>> and relocate the data
1213131832Sobrien     contained within - exactly the operations it would peform on
1214131832Sobrien     standard data.  */
1215218822Sdim#define SEC_CONSTRUCTOR 0x080
1216131832Sobrien
1217131832Sobrien  /* The section has contents - a data section could be
1218131832Sobrien     <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
1219131832Sobrien     <<SEC_HAS_CONTENTS>>  */
1220218822Sdim#define SEC_HAS_CONTENTS 0x100
1221131832Sobrien
1222131832Sobrien  /* An instruction to the linker to not output the section
1223131832Sobrien     even if it has information which would normally be written.  */
1224218822Sdim#define SEC_NEVER_LOAD 0x200
1225131832Sobrien
1226131832Sobrien  /* The section contains thread local data.  */
1227218822Sdim#define SEC_THREAD_LOCAL 0x400
1228131832Sobrien
1229131832Sobrien  /* The section has GOT references.  This flag is only for the
1230131832Sobrien     linker, and is currently only used by the elf32-hppa back end.
1231131832Sobrien     It will be set if global offset table references were detected
1232131832Sobrien     in this section, which indicate to the linker that the section
1233131832Sobrien     contains PIC code, and must be handled specially when doing a
1234131832Sobrien     static link.  */
1235218822Sdim#define SEC_HAS_GOT_REF 0x800
1236131832Sobrien
1237131832Sobrien  /* The section contains common symbols (symbols may be defined
1238131832Sobrien     multiple times, the value of a symbol is the amount of
1239131832Sobrien     space it requires, and the largest symbol value is the one
1240131832Sobrien     used).  Most targets have exactly one of these (which we
1241131832Sobrien     translate to bfd_com_section_ptr), but ECOFF has two.  */
1242218822Sdim#define SEC_IS_COMMON 0x1000
1243131832Sobrien
1244131832Sobrien  /* The section contains only debugging information.  For
1245131832Sobrien     example, this is set for ELF .debug and .stab sections.
1246131832Sobrien     strip tests this flag to see if a section can be
1247131832Sobrien     discarded.  */
1248218822Sdim#define SEC_DEBUGGING 0x2000
1249131832Sobrien
1250131832Sobrien  /* The contents of this section are held in memory pointed to
1251131832Sobrien     by the contents field.  This is checked by bfd_get_section_contents,
1252131832Sobrien     and the data is retrieved from memory if appropriate.  */
1253218822Sdim#define SEC_IN_MEMORY 0x4000
1254131832Sobrien
1255131832Sobrien  /* The contents of this section are to be excluded by the
1256131832Sobrien     linker for executable and shared objects unless those
1257131832Sobrien     objects are to be further relocated.  */
1258218822Sdim#define SEC_EXCLUDE 0x8000
1259131832Sobrien
1260131832Sobrien  /* The contents of this section are to be sorted based on the sum of
1261131832Sobrien     the symbol and addend values specified by the associated relocation
1262131832Sobrien     entries.  Entries without associated relocation entries will be
1263131832Sobrien     appended to the end of the section in an unspecified order.  */
1264218822Sdim#define SEC_SORT_ENTRIES 0x10000
1265131832Sobrien
1266131832Sobrien  /* When linking, duplicate sections of the same name should be
1267131832Sobrien     discarded, rather than being combined into a single section as
1268131832Sobrien     is usually done.  This is similar to how common symbols are
1269131832Sobrien     handled.  See SEC_LINK_DUPLICATES below.  */
1270218822Sdim#define SEC_LINK_ONCE 0x20000
1271131832Sobrien
1272131832Sobrien  /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
1273131832Sobrien     should handle duplicate sections.  */
1274218822Sdim#define SEC_LINK_DUPLICATES 0x40000
1275131832Sobrien
1276131832Sobrien  /* This value for SEC_LINK_DUPLICATES means that duplicate
1277131832Sobrien     sections with the same name should simply be discarded.  */
1278131832Sobrien#define SEC_LINK_DUPLICATES_DISCARD 0x0
1279131832Sobrien
1280131832Sobrien  /* This value for SEC_LINK_DUPLICATES means that the linker
1281131832Sobrien     should warn if there are any duplicate sections, although
1282131832Sobrien     it should still only link one copy.  */
1283218822Sdim#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
1284131832Sobrien
1285131832Sobrien  /* This value for SEC_LINK_DUPLICATES means that the linker
1286131832Sobrien     should warn if any duplicate sections are a different size.  */
1287218822Sdim#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
1288131832Sobrien
1289131832Sobrien  /* This value for SEC_LINK_DUPLICATES means that the linker
1290131832Sobrien     should warn if any duplicate sections contain different
1291131832Sobrien     contents.  */
1292218822Sdim#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
1293218822Sdim  (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
1294131832Sobrien
1295131832Sobrien  /* This section was created by the linker as part of dynamic
1296131832Sobrien     relocation or other arcane processing.  It is skipped when
1297131832Sobrien     going through the first-pass output, trusting that someone
1298131832Sobrien     else up the line will take care of it later.  */
1299218822Sdim#define SEC_LINKER_CREATED 0x200000
1300131832Sobrien
1301218822Sdim  /* This section should not be subject to garbage collection.
1302218822Sdim     Also set to inform the linker that this section should not be
1303218822Sdim     listed in the link map as discarded.  */
1304218822Sdim#define SEC_KEEP 0x400000
1305131832Sobrien
1306131832Sobrien  /* This section contains "short" data, and should be placed
1307131832Sobrien     "near" the GP.  */
1308218822Sdim#define SEC_SMALL_DATA 0x800000
1309131832Sobrien
1310131832Sobrien  /* Attempt to merge identical entities in the section.
1311131832Sobrien     Entity size is given in the entsize field.  */
1312218822Sdim#define SEC_MERGE 0x1000000
1313131832Sobrien
1314131832Sobrien  /* If given with SEC_MERGE, entities to merge are zero terminated
1315131832Sobrien     strings where entsize specifies character size instead of fixed
1316131832Sobrien     size entries.  */
1317218822Sdim#define SEC_STRINGS 0x2000000
1318131832Sobrien
1319131832Sobrien  /* This section contains data about section groups.  */
1320218822Sdim#define SEC_GROUP 0x4000000
1321131832Sobrien
1322218822Sdim  /* The section is a COFF shared library section.  This flag is
1323218822Sdim     only for the linker.  If this type of section appears in
1324218822Sdim     the input file, the linker must copy it to the output file
1325218822Sdim     without changing the vma or size.  FIXME: Although this
1326218822Sdim     was originally intended to be general, it really is COFF
1327218822Sdim     specific (and the flag was renamed to indicate this).  It
1328218822Sdim     might be cleaner to have some more general mechanism to
1329218822Sdim     allow the back end to control what the linker does with
1330218822Sdim     sections.  */
1331218822Sdim#define SEC_COFF_SHARED_LIBRARY 0x10000000
1332218822Sdim
1333218822Sdim  /* This section contains data which may be shared with other
1334218822Sdim     executables or shared objects. This is for COFF only.  */
1335218822Sdim#define SEC_COFF_SHARED 0x20000000
1336218822Sdim
1337218822Sdim  /* When a section with this flag is being linked, then if the size of
1338218822Sdim     the input section is less than a page, it should not cross a page
1339218822Sdim     boundary.  If the size of the input section is one page or more,
1340218822Sdim     it should be aligned on a page boundary.  This is for TI
1341218822Sdim     TMS320C54X only.  */
1342218822Sdim#define SEC_TIC54X_BLOCK 0x40000000
1343218822Sdim
1344218822Sdim  /* Conditionally link this section; do not link if there are no
1345218822Sdim     references found to any symbol in the section.  This is for TI
1346218822Sdim     TMS320C54X only.  */
1347218822Sdim#define SEC_TIC54X_CLINK 0x80000000
1348218822Sdim
1349131832Sobrien  /*  End of section flags.  */
1350131832Sobrien
1351131832Sobrien  /* Some internal packed boolean fields.  */
1352131832Sobrien
1353131832Sobrien  /* See the vma field.  */
1354131832Sobrien  unsigned int user_set_vma : 1;
1355131832Sobrien
1356131832Sobrien  /* A mark flag used by some of the linker backends.  */
1357131832Sobrien  unsigned int linker_mark : 1;
1358131832Sobrien
1359131832Sobrien  /* Another mark flag used by some of the linker backends.  Set for
1360131832Sobrien     output sections that have an input section.  */
1361131832Sobrien  unsigned int linker_has_input : 1;
1362131832Sobrien
1363218822Sdim  /* Mark flags used by some linker backends for garbage collection.  */
1364131832Sobrien  unsigned int gc_mark : 1;
1365218822Sdim  unsigned int gc_mark_from_eh : 1;
1366131832Sobrien
1367131832Sobrien  /* The following flags are used by the ELF linker. */
1368131832Sobrien
1369131832Sobrien  /* Mark sections which have been allocated to segments.  */
1370131832Sobrien  unsigned int segment_mark : 1;
1371131832Sobrien
1372131832Sobrien  /* Type of sec_info information.  */
1373131832Sobrien  unsigned int sec_info_type:3;
1374131832Sobrien#define ELF_INFO_TYPE_NONE      0
1375131832Sobrien#define ELF_INFO_TYPE_STABS     1
1376131832Sobrien#define ELF_INFO_TYPE_MERGE     2
1377131832Sobrien#define ELF_INFO_TYPE_EH_FRAME  3
1378131832Sobrien#define ELF_INFO_TYPE_JUST_SYMS 4
1379131832Sobrien
1380131832Sobrien  /* Nonzero if this section uses RELA relocations, rather than REL.  */
1381131832Sobrien  unsigned int use_rela_p:1;
1382131832Sobrien
1383218822Sdim  /* Bits used by various backends.  The generic code doesn't touch
1384218822Sdim     these fields.  */
1385218822Sdim
1386218822Sdim  /* Nonzero if this section has TLS related relocations.  */
1387131832Sobrien  unsigned int has_tls_reloc:1;
1388131832Sobrien
1389218822Sdim  /* Nonzero if this section has a gp reloc.  */
1390218822Sdim  unsigned int has_gp_reloc:1;
1391218822Sdim
1392131832Sobrien  /* Nonzero if this section needs the relax finalize pass.  */
1393131832Sobrien  unsigned int need_finalize_relax:1;
1394131832Sobrien
1395218822Sdim  /* Whether relocations have been processed.  */
1396218822Sdim  unsigned int reloc_done : 1;
1397131832Sobrien
1398131832Sobrien  /* End of internal packed boolean fields.  */
1399131832Sobrien
1400131832Sobrien  /*  The virtual memory address of the section - where it will be
1401131832Sobrien      at run time.  The symbols are relocated against this.  The
1402131832Sobrien      user_set_vma flag is maintained by bfd; if it's not set, the
1403131832Sobrien      backend can assign addresses (for example, in <<a.out>>, where
1404131832Sobrien      the default address for <<.data>> is dependent on the specific
1405131832Sobrien      target and various flags).  */
1406131832Sobrien  bfd_vma vma;
1407131832Sobrien
1408131832Sobrien  /*  The load address of the section - where it would be in a
1409131832Sobrien      rom image; really only used for writing section header
1410131832Sobrien      information.  */
1411131832Sobrien  bfd_vma lma;
1412131832Sobrien
1413131832Sobrien  /* The size of the section in octets, as it will be output.
1414131832Sobrien     Contains a value even if the section has no contents (e.g., the
1415218822Sdim     size of <<.bss>>).  */
1416218822Sdim  bfd_size_type size;
1417131832Sobrien
1418218822Sdim  /* For input sections, the original size on disk of the section, in
1419218822Sdim     octets.  This field is used by the linker relaxation code.  It is
1420218822Sdim     currently only set for sections where the linker relaxation scheme
1421218822Sdim     doesn't cache altered section and reloc contents (stabs, eh_frame,
1422218822Sdim     SEC_MERGE, some coff relaxing targets), and thus the original size
1423218822Sdim     needs to be kept to read the section multiple times.
1424218822Sdim     For output sections, rawsize holds the section size calculated on
1425218822Sdim     a previous linker relaxation pass.  */
1426218822Sdim  bfd_size_type rawsize;
1427131832Sobrien
1428131832Sobrien  /* If this section is going to be output, then this value is the
1429131832Sobrien     offset in *bytes* into the output section of the first byte in the
1430131832Sobrien     input section (byte ==> smallest addressable unit on the
1431131832Sobrien     target).  In most cases, if this was going to start at the
1432131832Sobrien     100th octet (8-bit quantity) in the output section, this value
1433131832Sobrien     would be 100.  However, if the target byte size is 16 bits
1434131832Sobrien     (bfd_octets_per_byte is "2"), this value would be 50.  */
1435131832Sobrien  bfd_vma output_offset;
1436131832Sobrien
1437131832Sobrien  /* The output section through which to map on output.  */
1438131832Sobrien  struct bfd_section *output_section;
1439131832Sobrien
1440131832Sobrien  /* The alignment requirement of the section, as an exponent of 2 -
1441131832Sobrien     e.g., 3 aligns to 2^3 (or 8).  */
1442131832Sobrien  unsigned int alignment_power;
1443131832Sobrien
1444131832Sobrien  /* If an input section, a pointer to a vector of relocation
1445131832Sobrien     records for the data in this section.  */
1446131832Sobrien  struct reloc_cache_entry *relocation;
1447131832Sobrien
1448131832Sobrien  /* If an output section, a pointer to a vector of pointers to
1449131832Sobrien     relocation records for the data in this section.  */
1450131832Sobrien  struct reloc_cache_entry **orelocation;
1451131832Sobrien
1452131832Sobrien  /* The number of relocation records in one of the above.  */
1453131832Sobrien  unsigned reloc_count;
1454131832Sobrien
1455131832Sobrien  /* Information below is back end specific - and not always used
1456131832Sobrien     or updated.  */
1457131832Sobrien
1458131832Sobrien  /* File position of section data.  */
1459131832Sobrien  file_ptr filepos;
1460131832Sobrien
1461131832Sobrien  /* File position of relocation info.  */
1462131832Sobrien  file_ptr rel_filepos;
1463131832Sobrien
1464131832Sobrien  /* File position of line data.  */
1465131832Sobrien  file_ptr line_filepos;
1466131832Sobrien
1467131832Sobrien  /* Pointer to data for applications.  */
1468131832Sobrien  void *userdata;
1469131832Sobrien
1470131832Sobrien  /* If the SEC_IN_MEMORY flag is set, this points to the actual
1471131832Sobrien     contents.  */
1472131832Sobrien  unsigned char *contents;
1473131832Sobrien
1474131832Sobrien  /* Attached line number information.  */
1475131832Sobrien  alent *lineno;
1476131832Sobrien
1477131832Sobrien  /* Number of line number records.  */
1478131832Sobrien  unsigned int lineno_count;
1479131832Sobrien
1480131832Sobrien  /* Entity size for merging purposes.  */
1481131832Sobrien  unsigned int entsize;
1482131832Sobrien
1483131832Sobrien  /* Points to the kept section if this section is a link-once section,
1484131832Sobrien     and is discarded.  */
1485131832Sobrien  struct bfd_section *kept_section;
1486131832Sobrien
1487131832Sobrien  /* When a section is being output, this value changes as more
1488131832Sobrien     linenumbers are written out.  */
1489131832Sobrien  file_ptr moving_line_filepos;
1490131832Sobrien
1491131832Sobrien  /* What the section number is in the target world.  */
1492131832Sobrien  int target_index;
1493131832Sobrien
1494131832Sobrien  void *used_by_bfd;
1495131832Sobrien
1496131832Sobrien  /* If this is a constructor section then here is a list of the
1497131832Sobrien     relocations created to relocate items within it.  */
1498131832Sobrien  struct relent_chain *constructor_chain;
1499131832Sobrien
1500131832Sobrien  /* The BFD which owns the section.  */
1501131832Sobrien  bfd *owner;
1502131832Sobrien
1503131832Sobrien  /* A symbol which points at this section only.  */
1504131832Sobrien  struct bfd_symbol *symbol;
1505131832Sobrien  struct bfd_symbol **symbol_ptr_ptr;
1506131832Sobrien
1507218822Sdim  /* Early in the link process, map_head and map_tail are used to build
1508218822Sdim     a list of input sections attached to an output section.  Later,
1509218822Sdim     output sections use these fields for a list of bfd_link_order
1510218822Sdim     structs.  */
1511218822Sdim  union {
1512218822Sdim    struct bfd_link_order *link_order;
1513218822Sdim    struct bfd_section *s;
1514218822Sdim  } map_head, map_tail;
1515131832Sobrien} asection;
1516131832Sobrien
1517131832Sobrien/* These sections are global, and are managed by BFD.  The application
1518131832Sobrien   and target back end are not permitted to change the values in
1519131832Sobrien   these sections.  New code should use the section_ptr macros rather
1520131832Sobrien   than referring directly to the const sections.  The const sections
1521131832Sobrien   may eventually vanish.  */
1522131832Sobrien#define BFD_ABS_SECTION_NAME "*ABS*"
1523131832Sobrien#define BFD_UND_SECTION_NAME "*UND*"
1524131832Sobrien#define BFD_COM_SECTION_NAME "*COM*"
1525131832Sobrien#define BFD_IND_SECTION_NAME "*IND*"
1526131832Sobrien
1527131832Sobrien/* The absolute section.  */
1528131832Sobrienextern asection bfd_abs_section;
1529131832Sobrien#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
1530131832Sobrien#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1531131832Sobrien/* Pointer to the undefined section.  */
1532131832Sobrienextern asection bfd_und_section;
1533131832Sobrien#define bfd_und_section_ptr ((asection *) &bfd_und_section)
1534131832Sobrien#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1535131832Sobrien/* Pointer to the common section.  */
1536131832Sobrienextern asection bfd_com_section;
1537131832Sobrien#define bfd_com_section_ptr ((asection *) &bfd_com_section)
1538131832Sobrien/* Pointer to the indirect section.  */
1539131832Sobrienextern asection bfd_ind_section;
1540131832Sobrien#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
1541131832Sobrien#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1542131832Sobrien
1543131832Sobrien#define bfd_is_const_section(SEC)              \
1544131832Sobrien (   ((SEC) == bfd_abs_section_ptr)            \
1545131832Sobrien  || ((SEC) == bfd_und_section_ptr)            \
1546131832Sobrien  || ((SEC) == bfd_com_section_ptr)            \
1547131832Sobrien  || ((SEC) == bfd_ind_section_ptr))
1548131832Sobrien
1549131832Sobrien/* Macros to handle insertion and deletion of a bfd's sections.  These
1550131832Sobrien   only handle the list pointers, ie. do not adjust section_count,
1551131832Sobrien   target_index etc.  */
1552218822Sdim#define bfd_section_list_remove(ABFD, S) \
1553131832Sobrien  do                                                   \
1554131832Sobrien    {                                                  \
1555218822Sdim      asection *_s = S;                                \
1556218822Sdim      asection *_next = _s->next;                      \
1557218822Sdim      asection *_prev = _s->prev;                      \
1558218822Sdim      if (_prev)                                       \
1559218822Sdim        _prev->next = _next;                           \
1560218822Sdim      else                                             \
1561218822Sdim        (ABFD)->sections = _next;                      \
1562218822Sdim      if (_next)                                       \
1563218822Sdim        _next->prev = _prev;                           \
1564218822Sdim      else                                             \
1565218822Sdim        (ABFD)->section_last = _prev;                  \
1566131832Sobrien    }                                                  \
1567131832Sobrien  while (0)
1568218822Sdim#define bfd_section_list_append(ABFD, S) \
1569131832Sobrien  do                                                   \
1570131832Sobrien    {                                                  \
1571131832Sobrien      asection *_s = S;                                \
1572218822Sdim      bfd *_abfd = ABFD;                               \
1573218822Sdim      _s->next = NULL;                                 \
1574218822Sdim      if (_abfd->section_last)                         \
1575218822Sdim        {                                              \
1576218822Sdim          _s->prev = _abfd->section_last;              \
1577218822Sdim          _abfd->section_last->next = _s;              \
1578218822Sdim        }                                              \
1579218822Sdim      else                                             \
1580218822Sdim        {                                              \
1581218822Sdim          _s->prev = NULL;                             \
1582218822Sdim          _abfd->sections = _s;                        \
1583218822Sdim        }                                              \
1584218822Sdim      _abfd->section_last = _s;                        \
1585131832Sobrien    }                                                  \
1586131832Sobrien  while (0)
1587218822Sdim#define bfd_section_list_prepend(ABFD, S) \
1588218822Sdim  do                                                   \
1589218822Sdim    {                                                  \
1590218822Sdim      asection *_s = S;                                \
1591218822Sdim      bfd *_abfd = ABFD;                               \
1592218822Sdim      _s->prev = NULL;                                 \
1593218822Sdim      if (_abfd->sections)                             \
1594218822Sdim        {                                              \
1595218822Sdim          _s->next = _abfd->sections;                  \
1596218822Sdim          _abfd->sections->prev = _s;                  \
1597218822Sdim        }                                              \
1598218822Sdim      else                                             \
1599218822Sdim        {                                              \
1600218822Sdim          _s->next = NULL;                             \
1601218822Sdim          _abfd->section_last = _s;                    \
1602218822Sdim        }                                              \
1603218822Sdim      _abfd->sections = _s;                            \
1604218822Sdim    }                                                  \
1605218822Sdim  while (0)
1606218822Sdim#define bfd_section_list_insert_after(ABFD, A, S) \
1607218822Sdim  do                                                   \
1608218822Sdim    {                                                  \
1609218822Sdim      asection *_a = A;                                \
1610218822Sdim      asection *_s = S;                                \
1611218822Sdim      asection *_next = _a->next;                      \
1612218822Sdim      _s->next = _next;                                \
1613218822Sdim      _s->prev = _a;                                   \
1614218822Sdim      _a->next = _s;                                   \
1615218822Sdim      if (_next)                                       \
1616218822Sdim        _next->prev = _s;                              \
1617218822Sdim      else                                             \
1618218822Sdim        (ABFD)->section_last = _s;                     \
1619218822Sdim    }                                                  \
1620218822Sdim  while (0)
1621218822Sdim#define bfd_section_list_insert_before(ABFD, B, S) \
1622218822Sdim  do                                                   \
1623218822Sdim    {                                                  \
1624218822Sdim      asection *_b = B;                                \
1625218822Sdim      asection *_s = S;                                \
1626218822Sdim      asection *_prev = _b->prev;                      \
1627218822Sdim      _s->prev = _prev;                                \
1628218822Sdim      _s->next = _b;                                   \
1629218822Sdim      _b->prev = _s;                                   \
1630218822Sdim      if (_prev)                                       \
1631218822Sdim        _prev->next = _s;                              \
1632218822Sdim      else                                             \
1633218822Sdim        (ABFD)->sections = _s;                         \
1634218822Sdim    }                                                  \
1635218822Sdim  while (0)
1636218822Sdim#define bfd_section_removed_from_list(ABFD, S) \
1637218822Sdim  ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
1638131832Sobrien
1639218822Sdim#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX)                   \
1640218822Sdim  /* name, id,  index, next, prev, flags, user_set_vma,            */  \
1641218822Sdim  { NAME,  IDX, 0,     NULL, NULL, FLAGS, 0,                           \
1642218822Sdim                                                                       \
1643218822Sdim  /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh,      */  \
1644218822Sdim     0,           0,                1,       0,                        \
1645218822Sdim                                                                       \
1646218822Sdim  /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc,       */  \
1647218822Sdim     0,            0,             0,          0,                       \
1648218822Sdim                                                                       \
1649218822Sdim  /* has_gp_reloc, need_finalize_relax, reloc_done,                */  \
1650218822Sdim     0,            0,                   0,                             \
1651218822Sdim                                                                       \
1652218822Sdim  /* vma, lma, size, rawsize                                       */  \
1653218822Sdim     0,   0,   0,    0,                                                \
1654218822Sdim                                                                       \
1655218822Sdim  /* output_offset, output_section,              alignment_power,  */  \
1656218822Sdim     0,             (struct bfd_section *) &SEC, 0,                    \
1657218822Sdim                                                                       \
1658218822Sdim  /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */  \
1659218822Sdim     NULL,       NULL,        0,           0,       0,                 \
1660218822Sdim                                                                       \
1661218822Sdim  /* line_filepos, userdata, contents, lineno, lineno_count,       */  \
1662218822Sdim     0,            NULL,     NULL,     NULL,   0,                      \
1663218822Sdim                                                                       \
1664218822Sdim  /* entsize, kept_section, moving_line_filepos,                    */ \
1665218822Sdim     0,       NULL,          0,                                        \
1666218822Sdim                                                                       \
1667218822Sdim  /* target_index, used_by_bfd, constructor_chain, owner,          */  \
1668218822Sdim     0,            NULL,        NULL,              NULL,               \
1669218822Sdim                                                                       \
1670218822Sdim  /* symbol,                    symbol_ptr_ptr,                    */  \
1671218822Sdim     (struct bfd_symbol *) SYM, &SEC.symbol,                           \
1672218822Sdim                                                                       \
1673218822Sdim  /* map_head, map_tail                                            */  \
1674218822Sdim     { NULL }, { NULL }                                                \
1675218822Sdim    }
1676218822Sdim
1677131832Sobrienvoid bfd_section_list_clear (bfd *);
1678131832Sobrien
1679131832Sobrienasection *bfd_get_section_by_name (bfd *abfd, const char *name);
1680131832Sobrien
1681218822Sdimasection *bfd_get_section_by_name_if
1682218822Sdim   (bfd *abfd,
1683218822Sdim    const char *name,
1684218822Sdim    bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1685218822Sdim    void *obj);
1686218822Sdim
1687131832Sobrienchar *bfd_get_unique_section_name
1688131832Sobrien   (bfd *abfd, const char *templat, int *count);
1689131832Sobrien
1690131832Sobrienasection *bfd_make_section_old_way (bfd *abfd, const char *name);
1691131832Sobrien
1692218822Sdimasection *bfd_make_section_anyway_with_flags
1693218822Sdim   (bfd *abfd, const char *name, flagword flags);
1694218822Sdim
1695131832Sobrienasection *bfd_make_section_anyway (bfd *abfd, const char *name);
1696131832Sobrien
1697218822Sdimasection *bfd_make_section_with_flags
1698218822Sdim   (bfd *, const char *name, flagword flags);
1699218822Sdim
1700131832Sobrienasection *bfd_make_section (bfd *, const char *name);
1701131832Sobrien
1702131832Sobrienbfd_boolean bfd_set_section_flags
1703131832Sobrien   (bfd *abfd, asection *sec, flagword flags);
1704131832Sobrien
1705131832Sobrienvoid bfd_map_over_sections
1706131832Sobrien   (bfd *abfd,
1707131832Sobrien    void (*func) (bfd *abfd, asection *sect, void *obj),
1708131832Sobrien    void *obj);
1709131832Sobrien
1710218822Sdimasection *bfd_sections_find_if
1711218822Sdim   (bfd *abfd,
1712218822Sdim    bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1713218822Sdim    void *obj);
1714218822Sdim
1715131832Sobrienbfd_boolean bfd_set_section_size
1716131832Sobrien   (bfd *abfd, asection *sec, bfd_size_type val);
1717131832Sobrien
1718131832Sobrienbfd_boolean bfd_set_section_contents
1719131832Sobrien   (bfd *abfd, asection *section, const void *data,
1720131832Sobrien    file_ptr offset, bfd_size_type count);
1721131832Sobrien
1722131832Sobrienbfd_boolean bfd_get_section_contents
1723131832Sobrien   (bfd *abfd, asection *section, void *location, file_ptr offset,
1724131832Sobrien    bfd_size_type count);
1725131832Sobrien
1726218822Sdimbfd_boolean bfd_malloc_and_get_section
1727218822Sdim   (bfd *abfd, asection *section, bfd_byte **buf);
1728218822Sdim
1729131832Sobrienbfd_boolean bfd_copy_private_section_data
1730131832Sobrien   (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1731131832Sobrien
1732131832Sobrien#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1733131832Sobrien     BFD_SEND (obfd, _bfd_copy_private_section_data, \
1734131832Sobrien               (ibfd, isection, obfd, osection))
1735218822Sdimbfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1736131832Sobrien
1737131832Sobrienbfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1738131832Sobrien
1739131832Sobrien/* Extracted from archures.c.  */
1740131832Sobrienenum bfd_architecture
1741131832Sobrien{
1742131832Sobrien  bfd_arch_unknown,   /* File arch not known.  */
1743131832Sobrien  bfd_arch_obscure,   /* Arch known, not one of these.  */
1744131832Sobrien  bfd_arch_m68k,      /* Motorola 68xxx */
1745131832Sobrien#define bfd_mach_m68000 1
1746131832Sobrien#define bfd_mach_m68008 2
1747131832Sobrien#define bfd_mach_m68010 3
1748131832Sobrien#define bfd_mach_m68020 4
1749131832Sobrien#define bfd_mach_m68030 5
1750131832Sobrien#define bfd_mach_m68040 6
1751131832Sobrien#define bfd_mach_m68060 7
1752131832Sobrien#define bfd_mach_cpu32  8
1753218822Sdim#define bfd_mach_fido   9
1754218822Sdim#define bfd_mach_mcf_isa_a_nodiv 10
1755218822Sdim#define bfd_mach_mcf_isa_a 11
1756218822Sdim#define bfd_mach_mcf_isa_a_mac 12
1757218822Sdim#define bfd_mach_mcf_isa_a_emac 13
1758218822Sdim#define bfd_mach_mcf_isa_aplus 14
1759218822Sdim#define bfd_mach_mcf_isa_aplus_mac 15
1760218822Sdim#define bfd_mach_mcf_isa_aplus_emac 16
1761218822Sdim#define bfd_mach_mcf_isa_b_nousp 17
1762218822Sdim#define bfd_mach_mcf_isa_b_nousp_mac 18
1763218822Sdim#define bfd_mach_mcf_isa_b_nousp_emac 19
1764218822Sdim#define bfd_mach_mcf_isa_b 20
1765218822Sdim#define bfd_mach_mcf_isa_b_mac 21
1766218822Sdim#define bfd_mach_mcf_isa_b_emac 22
1767218822Sdim#define bfd_mach_mcf_isa_b_float 23
1768218822Sdim#define bfd_mach_mcf_isa_b_float_mac 24
1769218822Sdim#define bfd_mach_mcf_isa_b_float_emac 25
1770218822Sdim#define bfd_mach_mcf_isa_c 26
1771218822Sdim#define bfd_mach_mcf_isa_c_mac 27
1772218822Sdim#define bfd_mach_mcf_isa_c_emac 28
1773131832Sobrien  bfd_arch_vax,       /* DEC Vax */
1774131832Sobrien  bfd_arch_i960,      /* Intel 960 */
1775131832Sobrien    /* The order of the following is important.
1776131832Sobrien       lower number indicates a machine type that
1777131832Sobrien       only accepts a subset of the instructions
1778131832Sobrien       available to machines with higher numbers.
1779131832Sobrien       The exception is the "ca", which is
1780131832Sobrien       incompatible with all other machines except
1781131832Sobrien       "core".  */
1782131832Sobrien
1783131832Sobrien#define bfd_mach_i960_core      1
1784131832Sobrien#define bfd_mach_i960_ka_sa     2
1785131832Sobrien#define bfd_mach_i960_kb_sb     3
1786131832Sobrien#define bfd_mach_i960_mc        4
1787131832Sobrien#define bfd_mach_i960_xa        5
1788131832Sobrien#define bfd_mach_i960_ca        6
1789131832Sobrien#define bfd_mach_i960_jx        7
1790131832Sobrien#define bfd_mach_i960_hx        8
1791131832Sobrien
1792131832Sobrien  bfd_arch_or32,      /* OpenRISC 32 */
1793131832Sobrien
1794131832Sobrien  bfd_arch_sparc,     /* SPARC */
1795131832Sobrien#define bfd_mach_sparc                 1
1796131832Sobrien/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
1797131832Sobrien#define bfd_mach_sparc_sparclet        2
1798131832Sobrien#define bfd_mach_sparc_sparclite       3
1799131832Sobrien#define bfd_mach_sparc_v8plus          4
1800131832Sobrien#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
1801131832Sobrien#define bfd_mach_sparc_sparclite_le    6
1802131832Sobrien#define bfd_mach_sparc_v9              7
1803131832Sobrien#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
1804131832Sobrien#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
1805131832Sobrien#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
1806131832Sobrien/* Nonzero if MACH has the v9 instruction set.  */
1807131832Sobrien#define bfd_mach_sparc_v9_p(mach) \
1808131832Sobrien  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
1809131832Sobrien   && (mach) != bfd_mach_sparc_sparclite_le)
1810218822Sdim/* Nonzero if MACH is a 64 bit sparc architecture.  */
1811218822Sdim#define bfd_mach_sparc_64bit_p(mach) \
1812218822Sdim  ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
1813218822Sdim  bfd_arch_spu,       /* PowerPC SPU */
1814218822Sdim#define bfd_mach_spu           256
1815131832Sobrien  bfd_arch_mips,      /* MIPS Rxxxx */
1816131832Sobrien#define bfd_mach_mips3000              3000
1817131832Sobrien#define bfd_mach_mips3900              3900
1818131832Sobrien#define bfd_mach_mips4000              4000
1819131832Sobrien#define bfd_mach_mips4010              4010
1820131832Sobrien#define bfd_mach_mips4100              4100
1821131832Sobrien#define bfd_mach_mips4111              4111
1822131832Sobrien#define bfd_mach_mips4120              4120
1823131832Sobrien#define bfd_mach_mips4300              4300
1824131832Sobrien#define bfd_mach_mips4400              4400
1825131832Sobrien#define bfd_mach_mips4600              4600
1826131832Sobrien#define bfd_mach_mips4650              4650
1827131832Sobrien#define bfd_mach_mips5000              5000
1828131832Sobrien#define bfd_mach_mips5400              5400
1829131832Sobrien#define bfd_mach_mips5500              5500
1830131832Sobrien#define bfd_mach_mips6000              6000
1831131832Sobrien#define bfd_mach_mips7000              7000
1832131832Sobrien#define bfd_mach_mips8000              8000
1833208737Sjmallett#define bfd_mach_mips9000              9000
1834131832Sobrien#define bfd_mach_mips10000             10000
1835131832Sobrien#define bfd_mach_mips12000             12000
1836131832Sobrien#define bfd_mach_mips16                16
1837131832Sobrien#define bfd_mach_mips5                 5
1838208737Sjmallett#define bfd_mach_mips_octeon           6502
1839131832Sobrien#define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
1840131832Sobrien#define bfd_mach_mipsisa32             32
1841131832Sobrien#define bfd_mach_mipsisa32r2           33
1842131832Sobrien#define bfd_mach_mipsisa64             64
1843131832Sobrien#define bfd_mach_mipsisa64r2           65
1844131832Sobrien  bfd_arch_i386,      /* Intel 386 */
1845131832Sobrien#define bfd_mach_i386_i386 1
1846131832Sobrien#define bfd_mach_i386_i8086 2
1847131832Sobrien#define bfd_mach_i386_i386_intel_syntax 3
1848131832Sobrien#define bfd_mach_x86_64 64
1849131832Sobrien#define bfd_mach_x86_64_intel_syntax 65
1850131832Sobrien  bfd_arch_we32k,     /* AT&T WE32xxx */
1851131832Sobrien  bfd_arch_tahoe,     /* CCI/Harris Tahoe */
1852131832Sobrien  bfd_arch_i860,      /* Intel 860 */
1853131832Sobrien  bfd_arch_i370,      /* IBM 360/370 Mainframes */
1854131832Sobrien  bfd_arch_romp,      /* IBM ROMP PC/RT */
1855131832Sobrien  bfd_arch_convex,    /* Convex */
1856131832Sobrien  bfd_arch_m88k,      /* Motorola 88xxx */
1857131832Sobrien  bfd_arch_m98k,      /* Motorola 98xxx */
1858131832Sobrien  bfd_arch_pyramid,   /* Pyramid Technology */
1859131832Sobrien  bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
1860131832Sobrien#define bfd_mach_h8300    1
1861131832Sobrien#define bfd_mach_h8300h   2
1862131832Sobrien#define bfd_mach_h8300s   3
1863131832Sobrien#define bfd_mach_h8300hn  4
1864131832Sobrien#define bfd_mach_h8300sn  5
1865131832Sobrien#define bfd_mach_h8300sx  6
1866131832Sobrien#define bfd_mach_h8300sxn 7
1867131832Sobrien  bfd_arch_pdp11,     /* DEC PDP-11 */
1868131832Sobrien  bfd_arch_powerpc,   /* PowerPC */
1869131832Sobrien#define bfd_mach_ppc           32
1870131832Sobrien#define bfd_mach_ppc64         64
1871131832Sobrien#define bfd_mach_ppc_403       403
1872131832Sobrien#define bfd_mach_ppc_403gc     4030
1873131832Sobrien#define bfd_mach_ppc_505       505
1874131832Sobrien#define bfd_mach_ppc_601       601
1875131832Sobrien#define bfd_mach_ppc_602       602
1876131832Sobrien#define bfd_mach_ppc_603       603
1877131832Sobrien#define bfd_mach_ppc_ec603e    6031
1878131832Sobrien#define bfd_mach_ppc_604       604
1879131832Sobrien#define bfd_mach_ppc_620       620
1880131832Sobrien#define bfd_mach_ppc_630       630
1881131832Sobrien#define bfd_mach_ppc_750       750
1882131832Sobrien#define bfd_mach_ppc_860       860
1883131832Sobrien#define bfd_mach_ppc_a35       35
1884131832Sobrien#define bfd_mach_ppc_rs64ii    642
1885131832Sobrien#define bfd_mach_ppc_rs64iii   643
1886131832Sobrien#define bfd_mach_ppc_7400      7400
1887131832Sobrien#define bfd_mach_ppc_e500      500
1888131832Sobrien  bfd_arch_rs6000,    /* IBM RS/6000 */
1889131832Sobrien#define bfd_mach_rs6k          6000
1890131832Sobrien#define bfd_mach_rs6k_rs1      6001
1891131832Sobrien#define bfd_mach_rs6k_rsc      6003
1892131832Sobrien#define bfd_mach_rs6k_rs2      6002
1893131832Sobrien  bfd_arch_hppa,      /* HP PA RISC */
1894131832Sobrien#define bfd_mach_hppa10        10
1895131832Sobrien#define bfd_mach_hppa11        11
1896131832Sobrien#define bfd_mach_hppa20        20
1897131832Sobrien#define bfd_mach_hppa20w       25
1898131832Sobrien  bfd_arch_d10v,      /* Mitsubishi D10V */
1899131832Sobrien#define bfd_mach_d10v          1
1900131832Sobrien#define bfd_mach_d10v_ts2      2
1901131832Sobrien#define bfd_mach_d10v_ts3      3
1902131832Sobrien  bfd_arch_d30v,      /* Mitsubishi D30V */
1903131832Sobrien  bfd_arch_dlx,       /* DLX */
1904131832Sobrien  bfd_arch_m68hc11,   /* Motorola 68HC11 */
1905131832Sobrien  bfd_arch_m68hc12,   /* Motorola 68HC12 */
1906131832Sobrien#define bfd_mach_m6812_default 0
1907131832Sobrien#define bfd_mach_m6812         1
1908131832Sobrien#define bfd_mach_m6812s        2
1909131832Sobrien  bfd_arch_z8k,       /* Zilog Z8000 */
1910131832Sobrien#define bfd_mach_z8001         1
1911131832Sobrien#define bfd_mach_z8002         2
1912131832Sobrien  bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
1913131832Sobrien  bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
1914131832Sobrien#define bfd_mach_sh            1
1915131832Sobrien#define bfd_mach_sh2        0x20
1916131832Sobrien#define bfd_mach_sh_dsp     0x2d
1917218822Sdim#define bfd_mach_sh2a       0x2a
1918218822Sdim#define bfd_mach_sh2a_nofpu 0x2b
1919218822Sdim#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
1920218822Sdim#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
1921218822Sdim#define bfd_mach_sh2a_or_sh4  0x2a3
1922218822Sdim#define bfd_mach_sh2a_or_sh3e 0x2a4
1923131832Sobrien#define bfd_mach_sh2e       0x2e
1924131832Sobrien#define bfd_mach_sh3        0x30
1925218822Sdim#define bfd_mach_sh3_nommu  0x31
1926131832Sobrien#define bfd_mach_sh3_dsp    0x3d
1927131832Sobrien#define bfd_mach_sh3e       0x3e
1928131832Sobrien#define bfd_mach_sh4        0x40
1929131832Sobrien#define bfd_mach_sh4_nofpu  0x41
1930218822Sdim#define bfd_mach_sh4_nommu_nofpu  0x42
1931131832Sobrien#define bfd_mach_sh4a       0x4a
1932131832Sobrien#define bfd_mach_sh4a_nofpu 0x4b
1933131832Sobrien#define bfd_mach_sh4al_dsp  0x4d
1934131832Sobrien#define bfd_mach_sh5        0x50
1935131832Sobrien  bfd_arch_alpha,     /* Dec Alpha */
1936131832Sobrien#define bfd_mach_alpha_ev4  0x10
1937131832Sobrien#define bfd_mach_alpha_ev5  0x20
1938131832Sobrien#define bfd_mach_alpha_ev6  0x30
1939131832Sobrien  bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
1940131832Sobrien#define bfd_mach_arm_unknown   0
1941131832Sobrien#define bfd_mach_arm_2         1
1942131832Sobrien#define bfd_mach_arm_2a        2
1943131832Sobrien#define bfd_mach_arm_3         3
1944131832Sobrien#define bfd_mach_arm_3M        4
1945131832Sobrien#define bfd_mach_arm_4         5
1946131832Sobrien#define bfd_mach_arm_4T        6
1947131832Sobrien#define bfd_mach_arm_5         7
1948131832Sobrien#define bfd_mach_arm_5T        8
1949131832Sobrien#define bfd_mach_arm_5TE       9
1950131832Sobrien#define bfd_mach_arm_XScale    10
1951131832Sobrien#define bfd_mach_arm_ep9312    11
1952131832Sobrien#define bfd_mach_arm_iWMMXt    12
1953218822Sdim#define bfd_mach_arm_iWMMXt2   13
1954131832Sobrien  bfd_arch_ns32k,     /* National Semiconductors ns32000 */
1955131832Sobrien  bfd_arch_w65,       /* WDC 65816 */
1956131832Sobrien  bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
1957131832Sobrien  bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
1958131832Sobrien#define bfd_mach_tic3x         30
1959131832Sobrien#define bfd_mach_tic4x         40
1960131832Sobrien  bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
1961131832Sobrien  bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
1962131832Sobrien  bfd_arch_v850,      /* NEC V850 */
1963131832Sobrien#define bfd_mach_v850          1
1964131832Sobrien#define bfd_mach_v850e         'E'
1965131832Sobrien#define bfd_mach_v850e1        '1'
1966131832Sobrien  bfd_arch_arc,       /* ARC Cores */
1967131832Sobrien#define bfd_mach_arc_5         5
1968131832Sobrien#define bfd_mach_arc_6         6
1969131832Sobrien#define bfd_mach_arc_7         7
1970131832Sobrien#define bfd_mach_arc_8         8
1971218822Sdim bfd_arch_m32c,     /* Renesas M16C/M32C.  */
1972218822Sdim#define bfd_mach_m16c        0x75
1973218822Sdim#define bfd_mach_m32c        0x78
1974131832Sobrien  bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
1975131832Sobrien#define bfd_mach_m32r          1 /* For backwards compatibility.  */
1976131832Sobrien#define bfd_mach_m32rx         'x'
1977131832Sobrien#define bfd_mach_m32r2         '2'
1978131832Sobrien  bfd_arch_mn10200,   /* Matsushita MN10200 */
1979131832Sobrien  bfd_arch_mn10300,   /* Matsushita MN10300 */
1980131832Sobrien#define bfd_mach_mn10300               300
1981131832Sobrien#define bfd_mach_am33          330
1982131832Sobrien#define bfd_mach_am33_2        332
1983131832Sobrien  bfd_arch_fr30,
1984131832Sobrien#define bfd_mach_fr30          0x46523330
1985131832Sobrien  bfd_arch_frv,
1986131832Sobrien#define bfd_mach_frv           1
1987131832Sobrien#define bfd_mach_frvsimple     2
1988131832Sobrien#define bfd_mach_fr300         300
1989131832Sobrien#define bfd_mach_fr400         400
1990218822Sdim#define bfd_mach_fr450         450
1991131832Sobrien#define bfd_mach_frvtomcat     499     /* fr500 prototype */
1992131832Sobrien#define bfd_mach_fr500         500
1993131832Sobrien#define bfd_mach_fr550         550
1994131832Sobrien  bfd_arch_mcore,
1995218822Sdim  bfd_arch_mep,
1996218822Sdim#define bfd_mach_mep           1
1997218822Sdim#define bfd_mach_mep_h1        0x6831
1998131832Sobrien  bfd_arch_ia64,      /* HP/Intel ia64 */
1999131832Sobrien#define bfd_mach_ia64_elf64    64
2000131832Sobrien#define bfd_mach_ia64_elf32    32
2001131832Sobrien  bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
2002131832Sobrien#define bfd_mach_ip2022        1
2003131832Sobrien#define bfd_mach_ip2022ext     2
2004131832Sobrien bfd_arch_iq2000,     /* Vitesse IQ2000.  */
2005131832Sobrien#define bfd_mach_iq2000        1
2006131832Sobrien#define bfd_mach_iq10          2
2007218822Sdim  bfd_arch_mt,
2008218822Sdim#define bfd_mach_ms1           1
2009218822Sdim#define bfd_mach_mrisc2        2
2010218822Sdim#define bfd_mach_ms2           3
2011131832Sobrien  bfd_arch_pj,
2012131832Sobrien  bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
2013131832Sobrien#define bfd_mach_avr1          1
2014131832Sobrien#define bfd_mach_avr2          2
2015131832Sobrien#define bfd_mach_avr3          3
2016131832Sobrien#define bfd_mach_avr4          4
2017131832Sobrien#define bfd_mach_avr5          5
2018218822Sdim#define bfd_mach_avr6          6
2019218822Sdim  bfd_arch_bfin,        /* ADI Blackfin */
2020218822Sdim#define bfd_mach_bfin          1
2021218822Sdim  bfd_arch_cr16,       /* National Semiconductor CompactRISC (ie CR16). */
2022218822Sdim#define bfd_mach_cr16          1
2023218822Sdim  bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
2024218822Sdim#define bfd_mach_cr16c         1
2025218822Sdim  bfd_arch_crx,       /*  National Semiconductor CRX.  */
2026218822Sdim#define bfd_mach_crx           1
2027131832Sobrien  bfd_arch_cris,      /* Axis CRIS */
2028218822Sdim#define bfd_mach_cris_v0_v10   255
2029218822Sdim#define bfd_mach_cris_v32      32
2030218822Sdim#define bfd_mach_cris_v10_v32  1032
2031131832Sobrien  bfd_arch_s390,      /* IBM s390 */
2032131832Sobrien#define bfd_mach_s390_31       31
2033131832Sobrien#define bfd_mach_s390_64       64
2034218822Sdim  bfd_arch_score,     /* Sunplus score */
2035131832Sobrien  bfd_arch_openrisc,  /* OpenRISC */
2036131832Sobrien  bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
2037131832Sobrien  bfd_arch_xstormy16,
2038131832Sobrien#define bfd_mach_xstormy16     1
2039131832Sobrien  bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
2040131832Sobrien#define bfd_mach_msp11          11
2041131832Sobrien#define bfd_mach_msp110         110
2042131832Sobrien#define bfd_mach_msp12          12
2043131832Sobrien#define bfd_mach_msp13          13
2044131832Sobrien#define bfd_mach_msp14          14
2045131832Sobrien#define bfd_mach_msp15          15
2046218822Sdim#define bfd_mach_msp16          16
2047218822Sdim#define bfd_mach_msp21          21
2048131832Sobrien#define bfd_mach_msp31          31
2049131832Sobrien#define bfd_mach_msp32          32
2050131832Sobrien#define bfd_mach_msp33          33
2051131832Sobrien#define bfd_mach_msp41          41
2052131832Sobrien#define bfd_mach_msp42          42
2053131832Sobrien#define bfd_mach_msp43          43
2054131832Sobrien#define bfd_mach_msp44          44
2055218822Sdim  bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
2056218822Sdim#define bfd_mach_xc16x         1
2057218822Sdim#define bfd_mach_xc16xl        2
2058218822Sdim#define bfd_mach_xc16xs         3
2059131832Sobrien  bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
2060131832Sobrien#define bfd_mach_xtensa        1
2061218822Sdim   bfd_arch_maxq,     /* Dallas MAXQ 10/20 */
2062218822Sdim#define bfd_mach_maxq10    10
2063218822Sdim#define bfd_mach_maxq20    20
2064218822Sdim  bfd_arch_z80,
2065218822Sdim#define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
2066218822Sdim#define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
2067218822Sdim#define bfd_mach_z80full        7 /* All undocumented instructions.  */
2068218822Sdim#define bfd_mach_r800           11 /* R800: successor with multiplication.  */
2069131832Sobrien  bfd_arch_last
2070131832Sobrien  };
2071131832Sobrien
2072131832Sobrientypedef struct bfd_arch_info
2073131832Sobrien{
2074131832Sobrien  int bits_per_word;
2075131832Sobrien  int bits_per_address;
2076131832Sobrien  int bits_per_byte;
2077131832Sobrien  enum bfd_architecture arch;
2078131832Sobrien  unsigned long mach;
2079131832Sobrien  const char *arch_name;
2080131832Sobrien  const char *printable_name;
2081131832Sobrien  unsigned int section_align_power;
2082131832Sobrien  /* TRUE if this is the default machine for the architecture.
2083131832Sobrien     The default arch should be the first entry for an arch so that
2084131832Sobrien     all the entries for that arch can be accessed via <<next>>.  */
2085131832Sobrien  bfd_boolean the_default;
2086131832Sobrien  const struct bfd_arch_info * (*compatible)
2087131832Sobrien    (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
2088131832Sobrien
2089131832Sobrien  bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
2090131832Sobrien
2091131832Sobrien  const struct bfd_arch_info *next;
2092131832Sobrien}
2093131832Sobrienbfd_arch_info_type;
2094131832Sobrien
2095131832Sobrienconst char *bfd_printable_name (bfd *abfd);
2096131832Sobrien
2097131832Sobrienconst bfd_arch_info_type *bfd_scan_arch (const char *string);
2098131832Sobrien
2099131832Sobrienconst char **bfd_arch_list (void);
2100131832Sobrien
2101131832Sobrienconst bfd_arch_info_type *bfd_arch_get_compatible
2102131832Sobrien   (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2103131832Sobrien
2104131832Sobrienvoid bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2105131832Sobrien
2106131832Sobrienenum bfd_architecture bfd_get_arch (bfd *abfd);
2107131832Sobrien
2108131832Sobrienunsigned long bfd_get_mach (bfd *abfd);
2109131832Sobrien
2110131832Sobrienunsigned int bfd_arch_bits_per_byte (bfd *abfd);
2111131832Sobrien
2112131832Sobrienunsigned int bfd_arch_bits_per_address (bfd *abfd);
2113131832Sobrien
2114131832Sobrienconst bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2115131832Sobrien
2116131832Sobrienconst bfd_arch_info_type *bfd_lookup_arch
2117131832Sobrien   (enum bfd_architecture arch, unsigned long machine);
2118131832Sobrien
2119131832Sobrienconst char *bfd_printable_arch_mach
2120131832Sobrien   (enum bfd_architecture arch, unsigned long machine);
2121131832Sobrien
2122131832Sobrienunsigned int bfd_octets_per_byte (bfd *abfd);
2123131832Sobrien
2124131832Sobrienunsigned int bfd_arch_mach_octets_per_byte
2125131832Sobrien   (enum bfd_architecture arch, unsigned long machine);
2126131832Sobrien
2127131832Sobrien/* Extracted from reloc.c.  */
2128131832Sobrientypedef enum bfd_reloc_status
2129131832Sobrien{
2130131832Sobrien  /* No errors detected.  */
2131131832Sobrien  bfd_reloc_ok,
2132131832Sobrien
2133131832Sobrien  /* The relocation was performed, but there was an overflow.  */
2134131832Sobrien  bfd_reloc_overflow,
2135131832Sobrien
2136131832Sobrien  /* The address to relocate was not within the section supplied.  */
2137131832Sobrien  bfd_reloc_outofrange,
2138131832Sobrien
2139131832Sobrien  /* Used by special functions.  */
2140131832Sobrien  bfd_reloc_continue,
2141131832Sobrien
2142131832Sobrien  /* Unsupported relocation size requested.  */
2143131832Sobrien  bfd_reloc_notsupported,
2144131832Sobrien
2145131832Sobrien  /* Unused.  */
2146131832Sobrien  bfd_reloc_other,
2147131832Sobrien
2148131832Sobrien  /* The symbol to relocate against was undefined.  */
2149131832Sobrien  bfd_reloc_undefined,
2150131832Sobrien
2151131832Sobrien  /* The relocation was performed, but may not be ok - presently
2152131832Sobrien     generated only when linking i960 coff files with i960 b.out
2153131832Sobrien     symbols.  If this type is returned, the error_message argument
2154131832Sobrien     to bfd_perform_relocation will be set.  */
2155131832Sobrien  bfd_reloc_dangerous
2156131832Sobrien }
2157131832Sobrien bfd_reloc_status_type;
2158131832Sobrien
2159131832Sobrien
2160131832Sobrientypedef struct reloc_cache_entry
2161131832Sobrien{
2162131832Sobrien  /* A pointer into the canonical table of pointers.  */
2163131832Sobrien  struct bfd_symbol **sym_ptr_ptr;
2164131832Sobrien
2165131832Sobrien  /* offset in section.  */
2166131832Sobrien  bfd_size_type address;
2167131832Sobrien
2168131832Sobrien  /* addend for relocation value.  */
2169131832Sobrien  bfd_vma addend;
2170131832Sobrien
2171131832Sobrien  /* Pointer to how to perform the required relocation.  */
2172131832Sobrien  reloc_howto_type *howto;
2173131832Sobrien
2174131832Sobrien}
2175131832Sobrienarelent;
2176131832Sobrien
2177131832Sobrienenum complain_overflow
2178131832Sobrien{
2179131832Sobrien  /* Do not complain on overflow.  */
2180131832Sobrien  complain_overflow_dont,
2181131832Sobrien
2182218822Sdim  /* Complain if the value overflows when considered as a signed
2183218822Sdim     number one bit larger than the field.  ie. A bitfield of N bits
2184218822Sdim     is allowed to represent -2**n to 2**n-1.  */
2185131832Sobrien  complain_overflow_bitfield,
2186131832Sobrien
2187218822Sdim  /* Complain if the value overflows when considered as a signed
2188131832Sobrien     number.  */
2189131832Sobrien  complain_overflow_signed,
2190131832Sobrien
2191131832Sobrien  /* Complain if the value overflows when considered as an
2192131832Sobrien     unsigned number.  */
2193131832Sobrien  complain_overflow_unsigned
2194131832Sobrien};
2195131832Sobrien
2196131832Sobrienstruct reloc_howto_struct
2197131832Sobrien{
2198131832Sobrien  /*  The type field has mainly a documentary use - the back end can
2199131832Sobrien      do what it wants with it, though normally the back end's
2200131832Sobrien      external idea of what a reloc number is stored
2201131832Sobrien      in this field.  For example, a PC relative word relocation
2202131832Sobrien      in a coff environment has the type 023 - because that's
2203131832Sobrien      what the outside world calls a R_PCRWORD reloc.  */
2204131832Sobrien  unsigned int type;
2205131832Sobrien
2206131832Sobrien  /*  The value the final relocation is shifted right by.  This drops
2207131832Sobrien      unwanted data from the relocation.  */
2208131832Sobrien  unsigned int rightshift;
2209131832Sobrien
2210131832Sobrien  /*  The size of the item to be relocated.  This is *not* a
2211131832Sobrien      power-of-two measure.  To get the number of bytes operated
2212131832Sobrien      on by a type of relocation, use bfd_get_reloc_size.  */
2213131832Sobrien  int size;
2214131832Sobrien
2215131832Sobrien  /*  The number of bits in the item to be relocated.  This is used
2216131832Sobrien      when doing overflow checking.  */
2217131832Sobrien  unsigned int bitsize;
2218131832Sobrien
2219131832Sobrien  /*  Notes that the relocation is relative to the location in the
2220131832Sobrien      data section of the addend.  The relocation function will
2221131832Sobrien      subtract from the relocation value the address of the location
2222131832Sobrien      being relocated.  */
2223131832Sobrien  bfd_boolean pc_relative;
2224131832Sobrien
2225131832Sobrien  /*  The bit position of the reloc value in the destination.
2226131832Sobrien      The relocated value is left shifted by this amount.  */
2227131832Sobrien  unsigned int bitpos;
2228131832Sobrien
2229131832Sobrien  /* What type of overflow error should be checked for when
2230131832Sobrien     relocating.  */
2231131832Sobrien  enum complain_overflow complain_on_overflow;
2232131832Sobrien
2233131832Sobrien  /* If this field is non null, then the supplied function is
2234131832Sobrien     called rather than the normal function.  This allows really
2235131832Sobrien     strange relocation methods to be accommodated (e.g., i960 callj
2236131832Sobrien     instructions).  */
2237131832Sobrien  bfd_reloc_status_type (*special_function)
2238131832Sobrien    (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2239131832Sobrien     bfd *, char **);
2240131832Sobrien
2241131832Sobrien  /* The textual name of the relocation type.  */
2242131832Sobrien  char *name;
2243131832Sobrien
2244131832Sobrien  /* Some formats record a relocation addend in the section contents
2245131832Sobrien     rather than with the relocation.  For ELF formats this is the
2246131832Sobrien     distinction between USE_REL and USE_RELA (though the code checks
2247131832Sobrien     for USE_REL == 1/0).  The value of this field is TRUE if the
2248131832Sobrien     addend is recorded with the section contents; when performing a
2249131832Sobrien     partial link (ld -r) the section contents (the data) will be
2250131832Sobrien     modified.  The value of this field is FALSE if addends are
2251131832Sobrien     recorded with the relocation (in arelent.addend); when performing
2252131832Sobrien     a partial link the relocation will be modified.
2253131832Sobrien     All relocations for all ELF USE_RELA targets should set this field
2254131832Sobrien     to FALSE (values of TRUE should be looked on with suspicion).
2255131832Sobrien     However, the converse is not true: not all relocations of all ELF
2256131832Sobrien     USE_REL targets set this field to TRUE.  Why this is so is peculiar
2257131832Sobrien     to each particular target.  For relocs that aren't used in partial
2258131832Sobrien     links (e.g. GOT stuff) it doesn't matter what this is set to.  */
2259131832Sobrien  bfd_boolean partial_inplace;
2260131832Sobrien
2261131832Sobrien  /* src_mask selects the part of the instruction (or data) to be used
2262131832Sobrien     in the relocation sum.  If the target relocations don't have an
2263131832Sobrien     addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2264131832Sobrien     dst_mask to extract the addend from the section contents.  If
2265131832Sobrien     relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2266131832Sobrien     field should be zero.  Non-zero values for ELF USE_RELA targets are
2267131832Sobrien     bogus as in those cases the value in the dst_mask part of the
2268131832Sobrien     section contents should be treated as garbage.  */
2269131832Sobrien  bfd_vma src_mask;
2270131832Sobrien
2271131832Sobrien  /* dst_mask selects which parts of the instruction (or data) are
2272131832Sobrien     replaced with a relocated value.  */
2273131832Sobrien  bfd_vma dst_mask;
2274131832Sobrien
2275131832Sobrien  /* When some formats create PC relative instructions, they leave
2276131832Sobrien     the value of the pc of the place being relocated in the offset
2277131832Sobrien     slot of the instruction, so that a PC relative relocation can
2278131832Sobrien     be made just by adding in an ordinary offset (e.g., sun3 a.out).
2279131832Sobrien     Some formats leave the displacement part of an instruction
2280131832Sobrien     empty (e.g., m88k bcs); this flag signals the fact.  */
2281131832Sobrien  bfd_boolean pcrel_offset;
2282131832Sobrien};
2283131832Sobrien
2284131832Sobrien#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
2285131832Sobrien  { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
2286131832Sobrien#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
2287131832Sobrien  HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
2288131832Sobrien         NAME, FALSE, 0, 0, IN)
2289131832Sobrien
2290131832Sobrien#define EMPTY_HOWTO(C) \
2291131832Sobrien  HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2292131832Sobrien         NULL, FALSE, 0, 0, FALSE)
2293131832Sobrien
2294131832Sobrien#define HOWTO_PREPARE(relocation, symbol)               \
2295131832Sobrien  {                                                     \
2296131832Sobrien    if (symbol != NULL)                                 \
2297131832Sobrien      {                                                 \
2298131832Sobrien        if (bfd_is_com_section (symbol->section))       \
2299131832Sobrien          {                                             \
2300131832Sobrien            relocation = 0;                             \
2301131832Sobrien          }                                             \
2302131832Sobrien        else                                            \
2303131832Sobrien          {                                             \
2304131832Sobrien            relocation = symbol->value;                 \
2305131832Sobrien          }                                             \
2306131832Sobrien      }                                                 \
2307131832Sobrien  }
2308131832Sobrien
2309131832Sobrienunsigned int bfd_get_reloc_size (reloc_howto_type *);
2310131832Sobrien
2311131832Sobrientypedef struct relent_chain
2312131832Sobrien{
2313131832Sobrien  arelent relent;
2314131832Sobrien  struct relent_chain *next;
2315131832Sobrien}
2316131832Sobrienarelent_chain;
2317131832Sobrien
2318131832Sobrienbfd_reloc_status_type bfd_check_overflow
2319131832Sobrien   (enum complain_overflow how,
2320131832Sobrien    unsigned int bitsize,
2321131832Sobrien    unsigned int rightshift,
2322131832Sobrien    unsigned int addrsize,
2323131832Sobrien    bfd_vma relocation);
2324131832Sobrien
2325131832Sobrienbfd_reloc_status_type bfd_perform_relocation
2326131832Sobrien   (bfd *abfd,
2327131832Sobrien    arelent *reloc_entry,
2328131832Sobrien    void *data,
2329131832Sobrien    asection *input_section,
2330131832Sobrien    bfd *output_bfd,
2331131832Sobrien    char **error_message);
2332131832Sobrien
2333131832Sobrienbfd_reloc_status_type bfd_install_relocation
2334131832Sobrien   (bfd *abfd,
2335131832Sobrien    arelent *reloc_entry,
2336131832Sobrien    void *data, bfd_vma data_start,
2337131832Sobrien    asection *input_section,
2338131832Sobrien    char **error_message);
2339131832Sobrien
2340131832Sobrienenum bfd_reloc_code_real {
2341131832Sobrien  _dummy_first_bfd_reloc_code_real,
2342131832Sobrien
2343131832Sobrien
2344131832Sobrien/* Basic absolute relocations of N bits.  */
2345131832Sobrien  BFD_RELOC_64,
2346131832Sobrien  BFD_RELOC_32,
2347131832Sobrien  BFD_RELOC_26,
2348131832Sobrien  BFD_RELOC_24,
2349131832Sobrien  BFD_RELOC_16,
2350131832Sobrien  BFD_RELOC_14,
2351131832Sobrien  BFD_RELOC_8,
2352131832Sobrien
2353131832Sobrien/* PC-relative relocations.  Sometimes these are relative to the address
2354131832Sobrienof the relocation itself; sometimes they are relative to the start of
2355131832Sobrienthe section containing the relocation.  It depends on the specific target.
2356131832Sobrien
2357131832SobrienThe 24-bit relocation is used in some Intel 960 configurations.  */
2358131832Sobrien  BFD_RELOC_64_PCREL,
2359131832Sobrien  BFD_RELOC_32_PCREL,
2360131832Sobrien  BFD_RELOC_24_PCREL,
2361131832Sobrien  BFD_RELOC_16_PCREL,
2362131832Sobrien  BFD_RELOC_12_PCREL,
2363131832Sobrien  BFD_RELOC_8_PCREL,
2364131832Sobrien
2365218822Sdim/* Section relative relocations.  Some targets need this for DWARF2.  */
2366218822Sdim  BFD_RELOC_32_SECREL,
2367218822Sdim
2368131832Sobrien/* For ELF.  */
2369131832Sobrien  BFD_RELOC_32_GOT_PCREL,
2370131832Sobrien  BFD_RELOC_16_GOT_PCREL,
2371131832Sobrien  BFD_RELOC_8_GOT_PCREL,
2372131832Sobrien  BFD_RELOC_32_GOTOFF,
2373131832Sobrien  BFD_RELOC_16_GOTOFF,
2374131832Sobrien  BFD_RELOC_LO16_GOTOFF,
2375131832Sobrien  BFD_RELOC_HI16_GOTOFF,
2376131832Sobrien  BFD_RELOC_HI16_S_GOTOFF,
2377131832Sobrien  BFD_RELOC_8_GOTOFF,
2378131832Sobrien  BFD_RELOC_64_PLT_PCREL,
2379131832Sobrien  BFD_RELOC_32_PLT_PCREL,
2380131832Sobrien  BFD_RELOC_24_PLT_PCREL,
2381131832Sobrien  BFD_RELOC_16_PLT_PCREL,
2382131832Sobrien  BFD_RELOC_8_PLT_PCREL,
2383131832Sobrien  BFD_RELOC_64_PLTOFF,
2384131832Sobrien  BFD_RELOC_32_PLTOFF,
2385131832Sobrien  BFD_RELOC_16_PLTOFF,
2386131832Sobrien  BFD_RELOC_LO16_PLTOFF,
2387131832Sobrien  BFD_RELOC_HI16_PLTOFF,
2388131832Sobrien  BFD_RELOC_HI16_S_PLTOFF,
2389131832Sobrien  BFD_RELOC_8_PLTOFF,
2390131832Sobrien
2391131832Sobrien/* Relocations used by 68K ELF.  */
2392131832Sobrien  BFD_RELOC_68K_GLOB_DAT,
2393131832Sobrien  BFD_RELOC_68K_JMP_SLOT,
2394131832Sobrien  BFD_RELOC_68K_RELATIVE,
2395131832Sobrien
2396131832Sobrien/* Linkage-table relative.  */
2397131832Sobrien  BFD_RELOC_32_BASEREL,
2398131832Sobrien  BFD_RELOC_16_BASEREL,
2399131832Sobrien  BFD_RELOC_LO16_BASEREL,
2400131832Sobrien  BFD_RELOC_HI16_BASEREL,
2401131832Sobrien  BFD_RELOC_HI16_S_BASEREL,
2402131832Sobrien  BFD_RELOC_8_BASEREL,
2403131832Sobrien  BFD_RELOC_RVA,
2404131832Sobrien
2405131832Sobrien/* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
2406131832Sobrien  BFD_RELOC_8_FFnn,
2407131832Sobrien
2408131832Sobrien/* These PC-relative relocations are stored as word displacements --
2409131832Sobrieni.e., byte displacements shifted right two bits.  The 30-bit word
2410131832Sobriendisplacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2411131832SobrienSPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
2412131832Sobriensigned 16-bit displacement is used on the MIPS, and the 23-bit
2413131832Sobriendisplacement is used on the Alpha.  */
2414131832Sobrien  BFD_RELOC_32_PCREL_S2,
2415131832Sobrien  BFD_RELOC_16_PCREL_S2,
2416131832Sobrien  BFD_RELOC_23_PCREL_S2,
2417131832Sobrien
2418131832Sobrien/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2419131832Sobrienthe target word.  These are used on the SPARC.  */
2420131832Sobrien  BFD_RELOC_HI22,
2421131832Sobrien  BFD_RELOC_LO10,
2422131832Sobrien
2423131832Sobrien/* For systems that allocate a Global Pointer register, these are
2424131832Sobriendisplacements off that register.  These relocation types are
2425131832Sobrienhandled specially, because the value the register will have is
2426131832Sobriendecided relatively late.  */
2427131832Sobrien  BFD_RELOC_GPREL16,
2428131832Sobrien  BFD_RELOC_GPREL32,
2429131832Sobrien
2430131832Sobrien/* Reloc types used for i960/b.out.  */
2431131832Sobrien  BFD_RELOC_I960_CALLJ,
2432131832Sobrien
2433131832Sobrien/* SPARC ELF relocations.  There is probably some overlap with other
2434131832Sobrienrelocation types already defined.  */
2435131832Sobrien  BFD_RELOC_NONE,
2436131832Sobrien  BFD_RELOC_SPARC_WDISP22,
2437131832Sobrien  BFD_RELOC_SPARC22,
2438131832Sobrien  BFD_RELOC_SPARC13,
2439131832Sobrien  BFD_RELOC_SPARC_GOT10,
2440131832Sobrien  BFD_RELOC_SPARC_GOT13,
2441131832Sobrien  BFD_RELOC_SPARC_GOT22,
2442131832Sobrien  BFD_RELOC_SPARC_PC10,
2443131832Sobrien  BFD_RELOC_SPARC_PC22,
2444131832Sobrien  BFD_RELOC_SPARC_WPLT30,
2445131832Sobrien  BFD_RELOC_SPARC_COPY,
2446131832Sobrien  BFD_RELOC_SPARC_GLOB_DAT,
2447131832Sobrien  BFD_RELOC_SPARC_JMP_SLOT,
2448131832Sobrien  BFD_RELOC_SPARC_RELATIVE,
2449131832Sobrien  BFD_RELOC_SPARC_UA16,
2450131832Sobrien  BFD_RELOC_SPARC_UA32,
2451131832Sobrien  BFD_RELOC_SPARC_UA64,
2452131832Sobrien
2453131832Sobrien/* I think these are specific to SPARC a.out (e.g., Sun 4).  */
2454131832Sobrien  BFD_RELOC_SPARC_BASE13,
2455131832Sobrien  BFD_RELOC_SPARC_BASE22,
2456131832Sobrien
2457131832Sobrien/* SPARC64 relocations  */
2458131832Sobrien#define BFD_RELOC_SPARC_64 BFD_RELOC_64
2459131832Sobrien  BFD_RELOC_SPARC_10,
2460131832Sobrien  BFD_RELOC_SPARC_11,
2461131832Sobrien  BFD_RELOC_SPARC_OLO10,
2462131832Sobrien  BFD_RELOC_SPARC_HH22,
2463131832Sobrien  BFD_RELOC_SPARC_HM10,
2464131832Sobrien  BFD_RELOC_SPARC_LM22,
2465131832Sobrien  BFD_RELOC_SPARC_PC_HH22,
2466131832Sobrien  BFD_RELOC_SPARC_PC_HM10,
2467131832Sobrien  BFD_RELOC_SPARC_PC_LM22,
2468131832Sobrien  BFD_RELOC_SPARC_WDISP16,
2469131832Sobrien  BFD_RELOC_SPARC_WDISP19,
2470131832Sobrien  BFD_RELOC_SPARC_7,
2471131832Sobrien  BFD_RELOC_SPARC_6,
2472131832Sobrien  BFD_RELOC_SPARC_5,
2473131832Sobrien#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2474131832Sobrien  BFD_RELOC_SPARC_PLT32,
2475131832Sobrien  BFD_RELOC_SPARC_PLT64,
2476131832Sobrien  BFD_RELOC_SPARC_HIX22,
2477131832Sobrien  BFD_RELOC_SPARC_LOX10,
2478131832Sobrien  BFD_RELOC_SPARC_H44,
2479131832Sobrien  BFD_RELOC_SPARC_M44,
2480131832Sobrien  BFD_RELOC_SPARC_L44,
2481131832Sobrien  BFD_RELOC_SPARC_REGISTER,
2482131832Sobrien
2483131832Sobrien/* SPARC little endian relocation  */
2484131832Sobrien  BFD_RELOC_SPARC_REV32,
2485131832Sobrien
2486131832Sobrien/* SPARC TLS relocations  */
2487131832Sobrien  BFD_RELOC_SPARC_TLS_GD_HI22,
2488131832Sobrien  BFD_RELOC_SPARC_TLS_GD_LO10,
2489131832Sobrien  BFD_RELOC_SPARC_TLS_GD_ADD,
2490131832Sobrien  BFD_RELOC_SPARC_TLS_GD_CALL,
2491131832Sobrien  BFD_RELOC_SPARC_TLS_LDM_HI22,
2492131832Sobrien  BFD_RELOC_SPARC_TLS_LDM_LO10,
2493131832Sobrien  BFD_RELOC_SPARC_TLS_LDM_ADD,
2494131832Sobrien  BFD_RELOC_SPARC_TLS_LDM_CALL,
2495131832Sobrien  BFD_RELOC_SPARC_TLS_LDO_HIX22,
2496131832Sobrien  BFD_RELOC_SPARC_TLS_LDO_LOX10,
2497131832Sobrien  BFD_RELOC_SPARC_TLS_LDO_ADD,
2498131832Sobrien  BFD_RELOC_SPARC_TLS_IE_HI22,
2499131832Sobrien  BFD_RELOC_SPARC_TLS_IE_LO10,
2500131832Sobrien  BFD_RELOC_SPARC_TLS_IE_LD,
2501131832Sobrien  BFD_RELOC_SPARC_TLS_IE_LDX,
2502131832Sobrien  BFD_RELOC_SPARC_TLS_IE_ADD,
2503131832Sobrien  BFD_RELOC_SPARC_TLS_LE_HIX22,
2504131832Sobrien  BFD_RELOC_SPARC_TLS_LE_LOX10,
2505131832Sobrien  BFD_RELOC_SPARC_TLS_DTPMOD32,
2506131832Sobrien  BFD_RELOC_SPARC_TLS_DTPMOD64,
2507131832Sobrien  BFD_RELOC_SPARC_TLS_DTPOFF32,
2508131832Sobrien  BFD_RELOC_SPARC_TLS_DTPOFF64,
2509131832Sobrien  BFD_RELOC_SPARC_TLS_TPOFF32,
2510131832Sobrien  BFD_RELOC_SPARC_TLS_TPOFF64,
2511131832Sobrien
2512218822Sdim/* SPU Relocations.  */
2513218822Sdim  BFD_RELOC_SPU_IMM7,
2514218822Sdim  BFD_RELOC_SPU_IMM8,
2515218822Sdim  BFD_RELOC_SPU_IMM10,
2516218822Sdim  BFD_RELOC_SPU_IMM10W,
2517218822Sdim  BFD_RELOC_SPU_IMM16,
2518218822Sdim  BFD_RELOC_SPU_IMM16W,
2519218822Sdim  BFD_RELOC_SPU_IMM18,
2520218822Sdim  BFD_RELOC_SPU_PCREL9a,
2521218822Sdim  BFD_RELOC_SPU_PCREL9b,
2522218822Sdim  BFD_RELOC_SPU_PCREL16,
2523218822Sdim  BFD_RELOC_SPU_LO16,
2524218822Sdim  BFD_RELOC_SPU_HI16,
2525218822Sdim  BFD_RELOC_SPU_PPU32,
2526218822Sdim  BFD_RELOC_SPU_PPU64,
2527218822Sdim
2528131832Sobrien/* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
2529131832Sobrien"addend" in some special way.
2530131832SobrienFor GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2531131832Sobrienwriting; when reading, it will be the absolute section symbol.  The
2532131832Sobrienaddend is the displacement in bytes of the "lda" instruction from
2533131832Sobrienthe "ldah" instruction (which is at the address of this reloc).  */
2534131832Sobrien  BFD_RELOC_ALPHA_GPDISP_HI16,
2535131832Sobrien
2536131832Sobrien/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2537131832Sobrienwith GPDISP_HI16 relocs.  The addend is ignored when writing the
2538131832Sobrienrelocations out, and is filled in with the file's GP value on
2539131832Sobrienreading, for convenience.  */
2540131832Sobrien  BFD_RELOC_ALPHA_GPDISP_LO16,
2541131832Sobrien
2542131832Sobrien/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2543131832Sobrienrelocation except that there is no accompanying GPDISP_LO16
2544131832Sobrienrelocation.  */
2545131832Sobrien  BFD_RELOC_ALPHA_GPDISP,
2546131832Sobrien
2547131832Sobrien/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2548131832Sobrienthe assembler turns it into a LDQ instruction to load the address of
2549131832Sobrienthe symbol, and then fills in a register in the real instruction.
2550131832Sobrien
2551131832SobrienThe LITERAL reloc, at the LDQ instruction, refers to the .lita
2552131832Sobriensection symbol.  The addend is ignored when writing, but is filled
2553131832Sobrienin with the file's GP value on reading, for convenience, as with the
2554131832SobrienGPDISP_LO16 reloc.
2555131832Sobrien
2556131832SobrienThe ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2557131832SobrienIt should refer to the symbol to be referenced, as with 16_GOTOFF,
2558131832Sobrienbut it generates output not based on the position within the .got
2559131832Sobriensection, but relative to the GP value chosen for the file during the
2560131832Sobrienfinal link stage.
2561131832Sobrien
2562131832SobrienThe LITUSE reloc, on the instruction using the loaded address, gives
2563131832Sobrieninformation to the linker that it might be able to use to optimize
2564131832Sobrienaway some literal section references.  The symbol is ignored (read
2565131832Sobrienas the absolute section symbol), and the "addend" indicates the type
2566131832Sobrienof instruction using the register:
2567131832Sobrien1 - "memory" fmt insn
2568131832Sobrien2 - byte-manipulation (byte offset reg)
2569131832Sobrien3 - jsr (target of branch)  */
2570131832Sobrien  BFD_RELOC_ALPHA_LITERAL,
2571131832Sobrien  BFD_RELOC_ALPHA_ELF_LITERAL,
2572131832Sobrien  BFD_RELOC_ALPHA_LITUSE,
2573131832Sobrien
2574131832Sobrien/* The HINT relocation indicates a value that should be filled into the
2575131832Sobrien"hint" field of a jmp/jsr/ret instruction, for possible branch-
2576131832Sobrienprediction logic which may be provided on some processors.  */
2577131832Sobrien  BFD_RELOC_ALPHA_HINT,
2578131832Sobrien
2579131832Sobrien/* The LINKAGE relocation outputs a linkage pair in the object file,
2580131832Sobrienwhich is filled by the linker.  */
2581131832Sobrien  BFD_RELOC_ALPHA_LINKAGE,
2582131832Sobrien
2583131832Sobrien/* The CODEADDR relocation outputs a STO_CA in the object file,
2584131832Sobrienwhich is filled by the linker.  */
2585131832Sobrien  BFD_RELOC_ALPHA_CODEADDR,
2586131832Sobrien
2587131832Sobrien/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2588131832SobrienGP register.  */
2589131832Sobrien  BFD_RELOC_ALPHA_GPREL_HI16,
2590131832Sobrien  BFD_RELOC_ALPHA_GPREL_LO16,
2591131832Sobrien
2592131832Sobrien/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2593131832Sobrienshare a common GP, and the target address is adjusted for
2594131832SobrienSTO_ALPHA_STD_GPLOAD.  */
2595131832Sobrien  BFD_RELOC_ALPHA_BRSGP,
2596131832Sobrien
2597131832Sobrien/* Alpha thread-local storage relocations.  */
2598131832Sobrien  BFD_RELOC_ALPHA_TLSGD,
2599131832Sobrien  BFD_RELOC_ALPHA_TLSLDM,
2600131832Sobrien  BFD_RELOC_ALPHA_DTPMOD64,
2601131832Sobrien  BFD_RELOC_ALPHA_GOTDTPREL16,
2602131832Sobrien  BFD_RELOC_ALPHA_DTPREL64,
2603131832Sobrien  BFD_RELOC_ALPHA_DTPREL_HI16,
2604131832Sobrien  BFD_RELOC_ALPHA_DTPREL_LO16,
2605131832Sobrien  BFD_RELOC_ALPHA_DTPREL16,
2606131832Sobrien  BFD_RELOC_ALPHA_GOTTPREL16,
2607131832Sobrien  BFD_RELOC_ALPHA_TPREL64,
2608131832Sobrien  BFD_RELOC_ALPHA_TPREL_HI16,
2609131832Sobrien  BFD_RELOC_ALPHA_TPREL_LO16,
2610131832Sobrien  BFD_RELOC_ALPHA_TPREL16,
2611131832Sobrien
2612131832Sobrien/* Bits 27..2 of the relocation address shifted right 2 bits;
2613131832Sobriensimple reloc otherwise.  */
2614131832Sobrien  BFD_RELOC_MIPS_JMP,
2615131832Sobrien
2616131832Sobrien/* The MIPS16 jump instruction.  */
2617131832Sobrien  BFD_RELOC_MIPS16_JMP,
2618131832Sobrien
2619131832Sobrien/* MIPS16 GP relative reloc.  */
2620131832Sobrien  BFD_RELOC_MIPS16_GPREL,
2621131832Sobrien
2622131832Sobrien/* High 16 bits of 32-bit value; simple reloc.  */
2623131832Sobrien  BFD_RELOC_HI16,
2624131832Sobrien
2625131832Sobrien/* High 16 bits of 32-bit value but the low 16 bits will be sign
2626131832Sobrienextended and added to form the final result.  If the low 16
2627131832Sobrienbits form a negative number, we need to add one to the high value
2628131832Sobriento compensate for the borrow when the low bits are added.  */
2629131832Sobrien  BFD_RELOC_HI16_S,
2630131832Sobrien
2631131832Sobrien/* Low 16 bits.  */
2632131832Sobrien  BFD_RELOC_LO16,
2633131832Sobrien
2634218822Sdim/* High 16 bits of 32-bit pc-relative value  */
2635218822Sdim  BFD_RELOC_HI16_PCREL,
2636131832Sobrien
2637218822Sdim/* High 16 bits of 32-bit pc-relative value, adjusted  */
2638218822Sdim  BFD_RELOC_HI16_S_PCREL,
2639131832Sobrien
2640218822Sdim/* Low 16 bits of pc-relative value  */
2641218822Sdim  BFD_RELOC_LO16_PCREL,
2642218822Sdim
2643218822Sdim/* MIPS16 high 16 bits of 32-bit value.  */
2644218822Sdim  BFD_RELOC_MIPS16_HI16,
2645218822Sdim
2646218822Sdim/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
2647218822Sdimextended and added to form the final result.  If the low 16
2648218822Sdimbits form a negative number, we need to add one to the high value
2649218822Sdimto compensate for the borrow when the low bits are added.  */
2650218822Sdim  BFD_RELOC_MIPS16_HI16_S,
2651218822Sdim
2652218822Sdim/* MIPS16 low 16 bits.  */
2653218822Sdim  BFD_RELOC_MIPS16_LO16,
2654218822Sdim
2655131832Sobrien/* Relocation against a MIPS literal section.  */
2656131832Sobrien  BFD_RELOC_MIPS_LITERAL,
2657131832Sobrien
2658131832Sobrien/* MIPS ELF relocations.  */
2659131832Sobrien  BFD_RELOC_MIPS_GOT16,
2660131832Sobrien  BFD_RELOC_MIPS_CALL16,
2661131832Sobrien  BFD_RELOC_MIPS_GOT_HI16,
2662131832Sobrien  BFD_RELOC_MIPS_GOT_LO16,
2663131832Sobrien  BFD_RELOC_MIPS_CALL_HI16,
2664131832Sobrien  BFD_RELOC_MIPS_CALL_LO16,
2665131832Sobrien  BFD_RELOC_MIPS_SUB,
2666131832Sobrien  BFD_RELOC_MIPS_GOT_PAGE,
2667131832Sobrien  BFD_RELOC_MIPS_GOT_OFST,
2668131832Sobrien  BFD_RELOC_MIPS_GOT_DISP,
2669131832Sobrien  BFD_RELOC_MIPS_SHIFT5,
2670131832Sobrien  BFD_RELOC_MIPS_SHIFT6,
2671131832Sobrien  BFD_RELOC_MIPS_INSERT_A,
2672131832Sobrien  BFD_RELOC_MIPS_INSERT_B,
2673131832Sobrien  BFD_RELOC_MIPS_DELETE,
2674131832Sobrien  BFD_RELOC_MIPS_HIGHEST,
2675131832Sobrien  BFD_RELOC_MIPS_HIGHER,
2676131832Sobrien  BFD_RELOC_MIPS_SCN_DISP,
2677131832Sobrien  BFD_RELOC_MIPS_REL16,
2678131832Sobrien  BFD_RELOC_MIPS_RELGOT,
2679131832Sobrien  BFD_RELOC_MIPS_JALR,
2680218822Sdim  BFD_RELOC_MIPS_TLS_DTPMOD32,
2681218822Sdim  BFD_RELOC_MIPS_TLS_DTPREL32,
2682218822Sdim  BFD_RELOC_MIPS_TLS_DTPMOD64,
2683218822Sdim  BFD_RELOC_MIPS_TLS_DTPREL64,
2684218822Sdim  BFD_RELOC_MIPS_TLS_GD,
2685218822Sdim  BFD_RELOC_MIPS_TLS_LDM,
2686218822Sdim  BFD_RELOC_MIPS_TLS_DTPREL_HI16,
2687218822Sdim  BFD_RELOC_MIPS_TLS_DTPREL_LO16,
2688218822Sdim  BFD_RELOC_MIPS_TLS_GOTTPREL,
2689218822Sdim  BFD_RELOC_MIPS_TLS_TPREL32,
2690218822Sdim  BFD_RELOC_MIPS_TLS_TPREL64,
2691218822Sdim  BFD_RELOC_MIPS_TLS_TPREL_HI16,
2692218822Sdim  BFD_RELOC_MIPS_TLS_TPREL_LO16,
2693131832Sobrien
2694131832Sobrien
2695218822Sdim/* MIPS ELF relocations (VxWorks extensions).  */
2696218822Sdim  BFD_RELOC_MIPS_COPY,
2697218822Sdim  BFD_RELOC_MIPS_JUMP_SLOT,
2698218822Sdim
2699218822Sdim
2700131832Sobrien/* Fujitsu Frv Relocations.  */
2701131832Sobrien  BFD_RELOC_FRV_LABEL16,
2702131832Sobrien  BFD_RELOC_FRV_LABEL24,
2703131832Sobrien  BFD_RELOC_FRV_LO16,
2704131832Sobrien  BFD_RELOC_FRV_HI16,
2705131832Sobrien  BFD_RELOC_FRV_GPREL12,
2706131832Sobrien  BFD_RELOC_FRV_GPRELU12,
2707131832Sobrien  BFD_RELOC_FRV_GPREL32,
2708131832Sobrien  BFD_RELOC_FRV_GPRELHI,
2709131832Sobrien  BFD_RELOC_FRV_GPRELLO,
2710131832Sobrien  BFD_RELOC_FRV_GOT12,
2711131832Sobrien  BFD_RELOC_FRV_GOTHI,
2712131832Sobrien  BFD_RELOC_FRV_GOTLO,
2713131832Sobrien  BFD_RELOC_FRV_FUNCDESC,
2714131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOT12,
2715131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOTHI,
2716131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOTLO,
2717131832Sobrien  BFD_RELOC_FRV_FUNCDESC_VALUE,
2718131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
2719131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
2720131832Sobrien  BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
2721131832Sobrien  BFD_RELOC_FRV_GOTOFF12,
2722131832Sobrien  BFD_RELOC_FRV_GOTOFFHI,
2723131832Sobrien  BFD_RELOC_FRV_GOTOFFLO,
2724218822Sdim  BFD_RELOC_FRV_GETTLSOFF,
2725218822Sdim  BFD_RELOC_FRV_TLSDESC_VALUE,
2726218822Sdim  BFD_RELOC_FRV_GOTTLSDESC12,
2727218822Sdim  BFD_RELOC_FRV_GOTTLSDESCHI,
2728218822Sdim  BFD_RELOC_FRV_GOTTLSDESCLO,
2729218822Sdim  BFD_RELOC_FRV_TLSMOFF12,
2730218822Sdim  BFD_RELOC_FRV_TLSMOFFHI,
2731218822Sdim  BFD_RELOC_FRV_TLSMOFFLO,
2732218822Sdim  BFD_RELOC_FRV_GOTTLSOFF12,
2733218822Sdim  BFD_RELOC_FRV_GOTTLSOFFHI,
2734218822Sdim  BFD_RELOC_FRV_GOTTLSOFFLO,
2735218822Sdim  BFD_RELOC_FRV_TLSOFF,
2736218822Sdim  BFD_RELOC_FRV_TLSDESC_RELAX,
2737218822Sdim  BFD_RELOC_FRV_GETTLSOFF_RELAX,
2738218822Sdim  BFD_RELOC_FRV_TLSOFF_RELAX,
2739218822Sdim  BFD_RELOC_FRV_TLSMOFF,
2740131832Sobrien
2741131832Sobrien
2742131832Sobrien/* This is a 24bit GOT-relative reloc for the mn10300.  */
2743131832Sobrien  BFD_RELOC_MN10300_GOTOFF24,
2744131832Sobrien
2745131832Sobrien/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
2746131832Sobrienin the instruction.  */
2747131832Sobrien  BFD_RELOC_MN10300_GOT32,
2748131832Sobrien
2749131832Sobrien/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
2750131832Sobrienin the instruction.  */
2751131832Sobrien  BFD_RELOC_MN10300_GOT24,
2752131832Sobrien
2753131832Sobrien/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
2754131832Sobrienin the instruction.  */
2755131832Sobrien  BFD_RELOC_MN10300_GOT16,
2756131832Sobrien
2757131832Sobrien/* Copy symbol at runtime.  */
2758131832Sobrien  BFD_RELOC_MN10300_COPY,
2759131832Sobrien
2760131832Sobrien/* Create GOT entry.  */
2761131832Sobrien  BFD_RELOC_MN10300_GLOB_DAT,
2762131832Sobrien
2763131832Sobrien/* Create PLT entry.  */
2764131832Sobrien  BFD_RELOC_MN10300_JMP_SLOT,
2765131832Sobrien
2766131832Sobrien/* Adjust by program base.  */
2767131832Sobrien  BFD_RELOC_MN10300_RELATIVE,
2768131832Sobrien
2769131832Sobrien
2770131832Sobrien/* i386/elf relocations  */
2771131832Sobrien  BFD_RELOC_386_GOT32,
2772131832Sobrien  BFD_RELOC_386_PLT32,
2773131832Sobrien  BFD_RELOC_386_COPY,
2774131832Sobrien  BFD_RELOC_386_GLOB_DAT,
2775131832Sobrien  BFD_RELOC_386_JUMP_SLOT,
2776131832Sobrien  BFD_RELOC_386_RELATIVE,
2777131832Sobrien  BFD_RELOC_386_GOTOFF,
2778131832Sobrien  BFD_RELOC_386_GOTPC,
2779131832Sobrien  BFD_RELOC_386_TLS_TPOFF,
2780131832Sobrien  BFD_RELOC_386_TLS_IE,
2781131832Sobrien  BFD_RELOC_386_TLS_GOTIE,
2782131832Sobrien  BFD_RELOC_386_TLS_LE,
2783131832Sobrien  BFD_RELOC_386_TLS_GD,
2784131832Sobrien  BFD_RELOC_386_TLS_LDM,
2785131832Sobrien  BFD_RELOC_386_TLS_LDO_32,
2786131832Sobrien  BFD_RELOC_386_TLS_IE_32,
2787131832Sobrien  BFD_RELOC_386_TLS_LE_32,
2788131832Sobrien  BFD_RELOC_386_TLS_DTPMOD32,
2789131832Sobrien  BFD_RELOC_386_TLS_DTPOFF32,
2790131832Sobrien  BFD_RELOC_386_TLS_TPOFF32,
2791218822Sdim  BFD_RELOC_386_TLS_GOTDESC,
2792218822Sdim  BFD_RELOC_386_TLS_DESC_CALL,
2793218822Sdim  BFD_RELOC_386_TLS_DESC,
2794131832Sobrien
2795131832Sobrien/* x86-64/elf relocations  */
2796131832Sobrien  BFD_RELOC_X86_64_GOT32,
2797131832Sobrien  BFD_RELOC_X86_64_PLT32,
2798131832Sobrien  BFD_RELOC_X86_64_COPY,
2799131832Sobrien  BFD_RELOC_X86_64_GLOB_DAT,
2800131832Sobrien  BFD_RELOC_X86_64_JUMP_SLOT,
2801131832Sobrien  BFD_RELOC_X86_64_RELATIVE,
2802131832Sobrien  BFD_RELOC_X86_64_GOTPCREL,
2803131832Sobrien  BFD_RELOC_X86_64_32S,
2804131832Sobrien  BFD_RELOC_X86_64_DTPMOD64,
2805131832Sobrien  BFD_RELOC_X86_64_DTPOFF64,
2806131832Sobrien  BFD_RELOC_X86_64_TPOFF64,
2807131832Sobrien  BFD_RELOC_X86_64_TLSGD,
2808131832Sobrien  BFD_RELOC_X86_64_TLSLD,
2809131832Sobrien  BFD_RELOC_X86_64_DTPOFF32,
2810131832Sobrien  BFD_RELOC_X86_64_GOTTPOFF,
2811131832Sobrien  BFD_RELOC_X86_64_TPOFF32,
2812218822Sdim  BFD_RELOC_X86_64_GOTOFF64,
2813218822Sdim  BFD_RELOC_X86_64_GOTPC32,
2814218822Sdim  BFD_RELOC_X86_64_GOT64,
2815218822Sdim  BFD_RELOC_X86_64_GOTPCREL64,
2816218822Sdim  BFD_RELOC_X86_64_GOTPC64,
2817218822Sdim  BFD_RELOC_X86_64_GOTPLT64,
2818218822Sdim  BFD_RELOC_X86_64_PLTOFF64,
2819218822Sdim  BFD_RELOC_X86_64_GOTPC32_TLSDESC,
2820218822Sdim  BFD_RELOC_X86_64_TLSDESC_CALL,
2821218822Sdim  BFD_RELOC_X86_64_TLSDESC,
2822131832Sobrien
2823131832Sobrien/* ns32k relocations  */
2824131832Sobrien  BFD_RELOC_NS32K_IMM_8,
2825131832Sobrien  BFD_RELOC_NS32K_IMM_16,
2826131832Sobrien  BFD_RELOC_NS32K_IMM_32,
2827131832Sobrien  BFD_RELOC_NS32K_IMM_8_PCREL,
2828131832Sobrien  BFD_RELOC_NS32K_IMM_16_PCREL,
2829131832Sobrien  BFD_RELOC_NS32K_IMM_32_PCREL,
2830131832Sobrien  BFD_RELOC_NS32K_DISP_8,
2831131832Sobrien  BFD_RELOC_NS32K_DISP_16,
2832131832Sobrien  BFD_RELOC_NS32K_DISP_32,
2833131832Sobrien  BFD_RELOC_NS32K_DISP_8_PCREL,
2834131832Sobrien  BFD_RELOC_NS32K_DISP_16_PCREL,
2835131832Sobrien  BFD_RELOC_NS32K_DISP_32_PCREL,
2836131832Sobrien
2837131832Sobrien/* PDP11 relocations  */
2838131832Sobrien  BFD_RELOC_PDP11_DISP_8_PCREL,
2839131832Sobrien  BFD_RELOC_PDP11_DISP_6_PCREL,
2840131832Sobrien
2841131832Sobrien/* Picojava relocs.  Not all of these appear in object files.  */
2842131832Sobrien  BFD_RELOC_PJ_CODE_HI16,
2843131832Sobrien  BFD_RELOC_PJ_CODE_LO16,
2844131832Sobrien  BFD_RELOC_PJ_CODE_DIR16,
2845131832Sobrien  BFD_RELOC_PJ_CODE_DIR32,
2846131832Sobrien  BFD_RELOC_PJ_CODE_REL16,
2847131832Sobrien  BFD_RELOC_PJ_CODE_REL32,
2848131832Sobrien
2849131832Sobrien/* Power(rs6000) and PowerPC relocations.  */
2850131832Sobrien  BFD_RELOC_PPC_B26,
2851131832Sobrien  BFD_RELOC_PPC_BA26,
2852131832Sobrien  BFD_RELOC_PPC_TOC16,
2853131832Sobrien  BFD_RELOC_PPC_B16,
2854131832Sobrien  BFD_RELOC_PPC_B16_BRTAKEN,
2855131832Sobrien  BFD_RELOC_PPC_B16_BRNTAKEN,
2856131832Sobrien  BFD_RELOC_PPC_BA16,
2857131832Sobrien  BFD_RELOC_PPC_BA16_BRTAKEN,
2858131832Sobrien  BFD_RELOC_PPC_BA16_BRNTAKEN,
2859131832Sobrien  BFD_RELOC_PPC_COPY,
2860131832Sobrien  BFD_RELOC_PPC_GLOB_DAT,
2861131832Sobrien  BFD_RELOC_PPC_JMP_SLOT,
2862131832Sobrien  BFD_RELOC_PPC_RELATIVE,
2863131832Sobrien  BFD_RELOC_PPC_LOCAL24PC,
2864131832Sobrien  BFD_RELOC_PPC_EMB_NADDR32,
2865131832Sobrien  BFD_RELOC_PPC_EMB_NADDR16,
2866131832Sobrien  BFD_RELOC_PPC_EMB_NADDR16_LO,
2867131832Sobrien  BFD_RELOC_PPC_EMB_NADDR16_HI,
2868131832Sobrien  BFD_RELOC_PPC_EMB_NADDR16_HA,
2869131832Sobrien  BFD_RELOC_PPC_EMB_SDAI16,
2870131832Sobrien  BFD_RELOC_PPC_EMB_SDA2I16,
2871131832Sobrien  BFD_RELOC_PPC_EMB_SDA2REL,
2872131832Sobrien  BFD_RELOC_PPC_EMB_SDA21,
2873131832Sobrien  BFD_RELOC_PPC_EMB_MRKREF,
2874131832Sobrien  BFD_RELOC_PPC_EMB_RELSEC16,
2875131832Sobrien  BFD_RELOC_PPC_EMB_RELST_LO,
2876131832Sobrien  BFD_RELOC_PPC_EMB_RELST_HI,
2877131832Sobrien  BFD_RELOC_PPC_EMB_RELST_HA,
2878131832Sobrien  BFD_RELOC_PPC_EMB_BIT_FLD,
2879131832Sobrien  BFD_RELOC_PPC_EMB_RELSDA,
2880131832Sobrien  BFD_RELOC_PPC64_HIGHER,
2881131832Sobrien  BFD_RELOC_PPC64_HIGHER_S,
2882131832Sobrien  BFD_RELOC_PPC64_HIGHEST,
2883131832Sobrien  BFD_RELOC_PPC64_HIGHEST_S,
2884131832Sobrien  BFD_RELOC_PPC64_TOC16_LO,
2885131832Sobrien  BFD_RELOC_PPC64_TOC16_HI,
2886131832Sobrien  BFD_RELOC_PPC64_TOC16_HA,
2887131832Sobrien  BFD_RELOC_PPC64_TOC,
2888131832Sobrien  BFD_RELOC_PPC64_PLTGOT16,
2889131832Sobrien  BFD_RELOC_PPC64_PLTGOT16_LO,
2890131832Sobrien  BFD_RELOC_PPC64_PLTGOT16_HI,
2891131832Sobrien  BFD_RELOC_PPC64_PLTGOT16_HA,
2892131832Sobrien  BFD_RELOC_PPC64_ADDR16_DS,
2893131832Sobrien  BFD_RELOC_PPC64_ADDR16_LO_DS,
2894131832Sobrien  BFD_RELOC_PPC64_GOT16_DS,
2895131832Sobrien  BFD_RELOC_PPC64_GOT16_LO_DS,
2896131832Sobrien  BFD_RELOC_PPC64_PLT16_LO_DS,
2897131832Sobrien  BFD_RELOC_PPC64_SECTOFF_DS,
2898131832Sobrien  BFD_RELOC_PPC64_SECTOFF_LO_DS,
2899131832Sobrien  BFD_RELOC_PPC64_TOC16_DS,
2900131832Sobrien  BFD_RELOC_PPC64_TOC16_LO_DS,
2901131832Sobrien  BFD_RELOC_PPC64_PLTGOT16_DS,
2902131832Sobrien  BFD_RELOC_PPC64_PLTGOT16_LO_DS,
2903131832Sobrien
2904131832Sobrien/* PowerPC and PowerPC64 thread-local storage relocations.  */
2905131832Sobrien  BFD_RELOC_PPC_TLS,
2906131832Sobrien  BFD_RELOC_PPC_DTPMOD,
2907131832Sobrien  BFD_RELOC_PPC_TPREL16,
2908131832Sobrien  BFD_RELOC_PPC_TPREL16_LO,
2909131832Sobrien  BFD_RELOC_PPC_TPREL16_HI,
2910131832Sobrien  BFD_RELOC_PPC_TPREL16_HA,
2911131832Sobrien  BFD_RELOC_PPC_TPREL,
2912131832Sobrien  BFD_RELOC_PPC_DTPREL16,
2913131832Sobrien  BFD_RELOC_PPC_DTPREL16_LO,
2914131832Sobrien  BFD_RELOC_PPC_DTPREL16_HI,
2915131832Sobrien  BFD_RELOC_PPC_DTPREL16_HA,
2916131832Sobrien  BFD_RELOC_PPC_DTPREL,
2917131832Sobrien  BFD_RELOC_PPC_GOT_TLSGD16,
2918131832Sobrien  BFD_RELOC_PPC_GOT_TLSGD16_LO,
2919131832Sobrien  BFD_RELOC_PPC_GOT_TLSGD16_HI,
2920131832Sobrien  BFD_RELOC_PPC_GOT_TLSGD16_HA,
2921131832Sobrien  BFD_RELOC_PPC_GOT_TLSLD16,
2922131832Sobrien  BFD_RELOC_PPC_GOT_TLSLD16_LO,
2923131832Sobrien  BFD_RELOC_PPC_GOT_TLSLD16_HI,
2924131832Sobrien  BFD_RELOC_PPC_GOT_TLSLD16_HA,
2925131832Sobrien  BFD_RELOC_PPC_GOT_TPREL16,
2926131832Sobrien  BFD_RELOC_PPC_GOT_TPREL16_LO,
2927131832Sobrien  BFD_RELOC_PPC_GOT_TPREL16_HI,
2928131832Sobrien  BFD_RELOC_PPC_GOT_TPREL16_HA,
2929131832Sobrien  BFD_RELOC_PPC_GOT_DTPREL16,
2930131832Sobrien  BFD_RELOC_PPC_GOT_DTPREL16_LO,
2931131832Sobrien  BFD_RELOC_PPC_GOT_DTPREL16_HI,
2932131832Sobrien  BFD_RELOC_PPC_GOT_DTPREL16_HA,
2933131832Sobrien  BFD_RELOC_PPC64_TPREL16_DS,
2934131832Sobrien  BFD_RELOC_PPC64_TPREL16_LO_DS,
2935131832Sobrien  BFD_RELOC_PPC64_TPREL16_HIGHER,
2936131832Sobrien  BFD_RELOC_PPC64_TPREL16_HIGHERA,
2937131832Sobrien  BFD_RELOC_PPC64_TPREL16_HIGHEST,
2938131832Sobrien  BFD_RELOC_PPC64_TPREL16_HIGHESTA,
2939131832Sobrien  BFD_RELOC_PPC64_DTPREL16_DS,
2940131832Sobrien  BFD_RELOC_PPC64_DTPREL16_LO_DS,
2941131832Sobrien  BFD_RELOC_PPC64_DTPREL16_HIGHER,
2942131832Sobrien  BFD_RELOC_PPC64_DTPREL16_HIGHERA,
2943131832Sobrien  BFD_RELOC_PPC64_DTPREL16_HIGHEST,
2944131832Sobrien  BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
2945131832Sobrien
2946131832Sobrien/* IBM 370/390 relocations  */
2947131832Sobrien  BFD_RELOC_I370_D12,
2948131832Sobrien
2949131832Sobrien/* The type of reloc used to build a constructor table - at the moment
2950131832Sobrienprobably a 32 bit wide absolute relocation, but the target can choose.
2951131832SobrienIt generally does map to one of the other relocation types.  */
2952131832Sobrien  BFD_RELOC_CTOR,
2953131832Sobrien
2954131832Sobrien/* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
2955131832Sobriennot stored in the instruction.  */
2956131832Sobrien  BFD_RELOC_ARM_PCREL_BRANCH,
2957131832Sobrien
2958131832Sobrien/* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
2959131832Sobriennot stored in the instruction.  The 2nd lowest bit comes from a 1 bit
2960131832Sobrienfield in the instruction.  */
2961131832Sobrien  BFD_RELOC_ARM_PCREL_BLX,
2962131832Sobrien
2963131832Sobrien/* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
2964131832Sobriennot stored in the instruction.  The 2nd lowest bit comes from a 1 bit
2965131832Sobrienfield in the instruction.  */
2966131832Sobrien  BFD_RELOC_THUMB_PCREL_BLX,
2967131832Sobrien
2968218822Sdim/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
2969218822Sdim  BFD_RELOC_ARM_PCREL_CALL,
2970218822Sdim
2971218822Sdim/* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
2972218822Sdim  BFD_RELOC_ARM_PCREL_JUMP,
2973218822Sdim
2974218822Sdim/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
2975218822SdimThe lowest bit must be zero and is not stored in the instruction.
2976218822SdimNote that the corresponding ELF R_ARM_THM_JUMPnn constant has an
2977218822Sdim"nn" one smaller in all cases.  Note further that BRANCH23
2978218822Sdimcorresponds to R_ARM_THM_CALL.  */
2979218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH7,
2980218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH9,
2981218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH12,
2982218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH20,
2983218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH23,
2984218822Sdim  BFD_RELOC_THUMB_PCREL_BRANCH25,
2985218822Sdim
2986218822Sdim/* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
2987218822Sdim  BFD_RELOC_ARM_OFFSET_IMM,
2988218822Sdim
2989218822Sdim/* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
2990218822Sdim  BFD_RELOC_ARM_THUMB_OFFSET,
2991218822Sdim
2992218822Sdim/* Pc-relative or absolute relocation depending on target.  Used for
2993218822Sdimentries in .init_array sections.  */
2994218822Sdim  BFD_RELOC_ARM_TARGET1,
2995218822Sdim
2996218822Sdim/* Read-only segment base relative address.  */
2997218822Sdim  BFD_RELOC_ARM_ROSEGREL32,
2998218822Sdim
2999218822Sdim/* Data segment base relative address.  */
3000218822Sdim  BFD_RELOC_ARM_SBREL32,
3001218822Sdim
3002218822Sdim/* This reloc is used for references to RTTI data from exception handling
3003218822Sdimtables.  The actual definition depends on the target.  It may be a
3004218822Sdimpc-relative or some form of GOT-indirect relocation.  */
3005218822Sdim  BFD_RELOC_ARM_TARGET2,
3006218822Sdim
3007218822Sdim/* 31-bit PC relative address.  */
3008218822Sdim  BFD_RELOC_ARM_PREL31,
3009218822Sdim
3010218822Sdim/* Low and High halfword relocations for MOVW and MOVT instructions.  */
3011218822Sdim  BFD_RELOC_ARM_MOVW,
3012218822Sdim  BFD_RELOC_ARM_MOVT,
3013218822Sdim  BFD_RELOC_ARM_MOVW_PCREL,
3014218822Sdim  BFD_RELOC_ARM_MOVT_PCREL,
3015218822Sdim  BFD_RELOC_ARM_THUMB_MOVW,
3016218822Sdim  BFD_RELOC_ARM_THUMB_MOVT,
3017218822Sdim  BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3018218822Sdim  BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3019218822Sdim
3020218822Sdim/* Relocations for setting up GOTs and PLTs for shared libraries.  */
3021218822Sdim  BFD_RELOC_ARM_JUMP_SLOT,
3022218822Sdim  BFD_RELOC_ARM_GLOB_DAT,
3023218822Sdim  BFD_RELOC_ARM_GOT32,
3024218822Sdim  BFD_RELOC_ARM_PLT32,
3025218822Sdim  BFD_RELOC_ARM_RELATIVE,
3026218822Sdim  BFD_RELOC_ARM_GOTOFF,
3027218822Sdim  BFD_RELOC_ARM_GOTPC,
3028218822Sdim
3029218822Sdim/* ARM thread-local storage relocations.  */
3030218822Sdim  BFD_RELOC_ARM_TLS_GD32,
3031218822Sdim  BFD_RELOC_ARM_TLS_LDO32,
3032218822Sdim  BFD_RELOC_ARM_TLS_LDM32,
3033218822Sdim  BFD_RELOC_ARM_TLS_DTPOFF32,
3034218822Sdim  BFD_RELOC_ARM_TLS_DTPMOD32,
3035218822Sdim  BFD_RELOC_ARM_TLS_TPOFF32,
3036218822Sdim  BFD_RELOC_ARM_TLS_IE32,
3037218822Sdim  BFD_RELOC_ARM_TLS_LE32,
3038218822Sdim
3039218822Sdim/* ARM group relocations.  */
3040218822Sdim  BFD_RELOC_ARM_ALU_PC_G0_NC,
3041218822Sdim  BFD_RELOC_ARM_ALU_PC_G0,
3042218822Sdim  BFD_RELOC_ARM_ALU_PC_G1_NC,
3043218822Sdim  BFD_RELOC_ARM_ALU_PC_G1,
3044218822Sdim  BFD_RELOC_ARM_ALU_PC_G2,
3045218822Sdim  BFD_RELOC_ARM_LDR_PC_G0,
3046218822Sdim  BFD_RELOC_ARM_LDR_PC_G1,
3047218822Sdim  BFD_RELOC_ARM_LDR_PC_G2,
3048218822Sdim  BFD_RELOC_ARM_LDRS_PC_G0,
3049218822Sdim  BFD_RELOC_ARM_LDRS_PC_G1,
3050218822Sdim  BFD_RELOC_ARM_LDRS_PC_G2,
3051218822Sdim  BFD_RELOC_ARM_LDC_PC_G0,
3052218822Sdim  BFD_RELOC_ARM_LDC_PC_G1,
3053218822Sdim  BFD_RELOC_ARM_LDC_PC_G2,
3054218822Sdim  BFD_RELOC_ARM_ALU_SB_G0_NC,
3055218822Sdim  BFD_RELOC_ARM_ALU_SB_G0,
3056218822Sdim  BFD_RELOC_ARM_ALU_SB_G1_NC,
3057218822Sdim  BFD_RELOC_ARM_ALU_SB_G1,
3058218822Sdim  BFD_RELOC_ARM_ALU_SB_G2,
3059218822Sdim  BFD_RELOC_ARM_LDR_SB_G0,
3060218822Sdim  BFD_RELOC_ARM_LDR_SB_G1,
3061218822Sdim  BFD_RELOC_ARM_LDR_SB_G2,
3062218822Sdim  BFD_RELOC_ARM_LDRS_SB_G0,
3063218822Sdim  BFD_RELOC_ARM_LDRS_SB_G1,
3064218822Sdim  BFD_RELOC_ARM_LDRS_SB_G2,
3065218822Sdim  BFD_RELOC_ARM_LDC_SB_G0,
3066218822Sdim  BFD_RELOC_ARM_LDC_SB_G1,
3067218822Sdim  BFD_RELOC_ARM_LDC_SB_G2,
3068218822Sdim
3069131832Sobrien/* These relocs are only used within the ARM assembler.  They are not
3070131832Sobrien(at present) written to any object files.  */
3071131832Sobrien  BFD_RELOC_ARM_IMMEDIATE,
3072131832Sobrien  BFD_RELOC_ARM_ADRL_IMMEDIATE,
3073218822Sdim  BFD_RELOC_ARM_T32_IMMEDIATE,
3074218822Sdim  BFD_RELOC_ARM_T32_ADD_IMM,
3075218822Sdim  BFD_RELOC_ARM_T32_IMM12,
3076218822Sdim  BFD_RELOC_ARM_T32_ADD_PC12,
3077131832Sobrien  BFD_RELOC_ARM_SHIFT_IMM,
3078218822Sdim  BFD_RELOC_ARM_SMC,
3079131832Sobrien  BFD_RELOC_ARM_SWI,
3080131832Sobrien  BFD_RELOC_ARM_MULTI,
3081131832Sobrien  BFD_RELOC_ARM_CP_OFF_IMM,
3082131832Sobrien  BFD_RELOC_ARM_CP_OFF_IMM_S2,
3083218822Sdim  BFD_RELOC_ARM_T32_CP_OFF_IMM,
3084218822Sdim  BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3085131832Sobrien  BFD_RELOC_ARM_ADR_IMM,
3086131832Sobrien  BFD_RELOC_ARM_LDR_IMM,
3087131832Sobrien  BFD_RELOC_ARM_LITERAL,
3088131832Sobrien  BFD_RELOC_ARM_IN_POOL,
3089131832Sobrien  BFD_RELOC_ARM_OFFSET_IMM8,
3090218822Sdim  BFD_RELOC_ARM_T32_OFFSET_U8,
3091218822Sdim  BFD_RELOC_ARM_T32_OFFSET_IMM,
3092131832Sobrien  BFD_RELOC_ARM_HWLITERAL,
3093131832Sobrien  BFD_RELOC_ARM_THUMB_ADD,
3094131832Sobrien  BFD_RELOC_ARM_THUMB_IMM,
3095131832Sobrien  BFD_RELOC_ARM_THUMB_SHIFT,
3096131832Sobrien
3097131832Sobrien/* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
3098131832Sobrien  BFD_RELOC_SH_PCDISP8BY2,
3099131832Sobrien  BFD_RELOC_SH_PCDISP12BY2,
3100218822Sdim  BFD_RELOC_SH_IMM3,
3101218822Sdim  BFD_RELOC_SH_IMM3U,
3102218822Sdim  BFD_RELOC_SH_DISP12,
3103218822Sdim  BFD_RELOC_SH_DISP12BY2,
3104218822Sdim  BFD_RELOC_SH_DISP12BY4,
3105218822Sdim  BFD_RELOC_SH_DISP12BY8,
3106218822Sdim  BFD_RELOC_SH_DISP20,
3107218822Sdim  BFD_RELOC_SH_DISP20BY8,
3108131832Sobrien  BFD_RELOC_SH_IMM4,
3109131832Sobrien  BFD_RELOC_SH_IMM4BY2,
3110131832Sobrien  BFD_RELOC_SH_IMM4BY4,
3111131832Sobrien  BFD_RELOC_SH_IMM8,
3112131832Sobrien  BFD_RELOC_SH_IMM8BY2,
3113131832Sobrien  BFD_RELOC_SH_IMM8BY4,
3114131832Sobrien  BFD_RELOC_SH_PCRELIMM8BY2,
3115131832Sobrien  BFD_RELOC_SH_PCRELIMM8BY4,
3116131832Sobrien  BFD_RELOC_SH_SWITCH16,
3117131832Sobrien  BFD_RELOC_SH_SWITCH32,
3118131832Sobrien  BFD_RELOC_SH_USES,
3119131832Sobrien  BFD_RELOC_SH_COUNT,
3120131832Sobrien  BFD_RELOC_SH_ALIGN,
3121131832Sobrien  BFD_RELOC_SH_CODE,
3122131832Sobrien  BFD_RELOC_SH_DATA,
3123131832Sobrien  BFD_RELOC_SH_LABEL,
3124131832Sobrien  BFD_RELOC_SH_LOOP_START,
3125131832Sobrien  BFD_RELOC_SH_LOOP_END,
3126131832Sobrien  BFD_RELOC_SH_COPY,
3127131832Sobrien  BFD_RELOC_SH_GLOB_DAT,
3128131832Sobrien  BFD_RELOC_SH_JMP_SLOT,
3129131832Sobrien  BFD_RELOC_SH_RELATIVE,
3130131832Sobrien  BFD_RELOC_SH_GOTPC,
3131131832Sobrien  BFD_RELOC_SH_GOT_LOW16,
3132131832Sobrien  BFD_RELOC_SH_GOT_MEDLOW16,
3133131832Sobrien  BFD_RELOC_SH_GOT_MEDHI16,
3134131832Sobrien  BFD_RELOC_SH_GOT_HI16,
3135131832Sobrien  BFD_RELOC_SH_GOTPLT_LOW16,
3136131832Sobrien  BFD_RELOC_SH_GOTPLT_MEDLOW16,
3137131832Sobrien  BFD_RELOC_SH_GOTPLT_MEDHI16,
3138131832Sobrien  BFD_RELOC_SH_GOTPLT_HI16,
3139131832Sobrien  BFD_RELOC_SH_PLT_LOW16,
3140131832Sobrien  BFD_RELOC_SH_PLT_MEDLOW16,
3141131832Sobrien  BFD_RELOC_SH_PLT_MEDHI16,
3142131832Sobrien  BFD_RELOC_SH_PLT_HI16,
3143131832Sobrien  BFD_RELOC_SH_GOTOFF_LOW16,
3144131832Sobrien  BFD_RELOC_SH_GOTOFF_MEDLOW16,
3145131832Sobrien  BFD_RELOC_SH_GOTOFF_MEDHI16,
3146131832Sobrien  BFD_RELOC_SH_GOTOFF_HI16,
3147131832Sobrien  BFD_RELOC_SH_GOTPC_LOW16,
3148131832Sobrien  BFD_RELOC_SH_GOTPC_MEDLOW16,
3149131832Sobrien  BFD_RELOC_SH_GOTPC_MEDHI16,
3150131832Sobrien  BFD_RELOC_SH_GOTPC_HI16,
3151131832Sobrien  BFD_RELOC_SH_COPY64,
3152131832Sobrien  BFD_RELOC_SH_GLOB_DAT64,
3153131832Sobrien  BFD_RELOC_SH_JMP_SLOT64,
3154131832Sobrien  BFD_RELOC_SH_RELATIVE64,
3155131832Sobrien  BFD_RELOC_SH_GOT10BY4,
3156131832Sobrien  BFD_RELOC_SH_GOT10BY8,
3157131832Sobrien  BFD_RELOC_SH_GOTPLT10BY4,
3158131832Sobrien  BFD_RELOC_SH_GOTPLT10BY8,
3159131832Sobrien  BFD_RELOC_SH_GOTPLT32,
3160131832Sobrien  BFD_RELOC_SH_SHMEDIA_CODE,
3161131832Sobrien  BFD_RELOC_SH_IMMU5,
3162131832Sobrien  BFD_RELOC_SH_IMMS6,
3163131832Sobrien  BFD_RELOC_SH_IMMS6BY32,
3164131832Sobrien  BFD_RELOC_SH_IMMU6,
3165131832Sobrien  BFD_RELOC_SH_IMMS10,
3166131832Sobrien  BFD_RELOC_SH_IMMS10BY2,
3167131832Sobrien  BFD_RELOC_SH_IMMS10BY4,
3168131832Sobrien  BFD_RELOC_SH_IMMS10BY8,
3169131832Sobrien  BFD_RELOC_SH_IMMS16,
3170131832Sobrien  BFD_RELOC_SH_IMMU16,
3171131832Sobrien  BFD_RELOC_SH_IMM_LOW16,
3172131832Sobrien  BFD_RELOC_SH_IMM_LOW16_PCREL,
3173131832Sobrien  BFD_RELOC_SH_IMM_MEDLOW16,
3174131832Sobrien  BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3175131832Sobrien  BFD_RELOC_SH_IMM_MEDHI16,
3176131832Sobrien  BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3177131832Sobrien  BFD_RELOC_SH_IMM_HI16,
3178131832Sobrien  BFD_RELOC_SH_IMM_HI16_PCREL,
3179131832Sobrien  BFD_RELOC_SH_PT_16,
3180131832Sobrien  BFD_RELOC_SH_TLS_GD_32,
3181131832Sobrien  BFD_RELOC_SH_TLS_LD_32,
3182131832Sobrien  BFD_RELOC_SH_TLS_LDO_32,
3183131832Sobrien  BFD_RELOC_SH_TLS_IE_32,
3184131832Sobrien  BFD_RELOC_SH_TLS_LE_32,
3185131832Sobrien  BFD_RELOC_SH_TLS_DTPMOD32,
3186131832Sobrien  BFD_RELOC_SH_TLS_DTPOFF32,
3187131832Sobrien  BFD_RELOC_SH_TLS_TPOFF32,
3188131832Sobrien
3189131832Sobrien/* ARC Cores relocs.
3190131832SobrienARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
3191131832Sobriennot stored in the instruction.  The high 20 bits are installed in bits 26
3192131832Sobrienthrough 7 of the instruction.  */
3193131832Sobrien  BFD_RELOC_ARC_B22_PCREL,
3194131832Sobrien
3195131832Sobrien/* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
3196131832Sobrienstored in the instruction.  The high 24 bits are installed in bits 23
3197131832Sobrienthrough 0.  */
3198131832Sobrien  BFD_RELOC_ARC_B26,
3199131832Sobrien
3200218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc.  */
3201218822Sdim  BFD_RELOC_BFIN_16_IMM,
3202218822Sdim
3203218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
3204218822Sdim  BFD_RELOC_BFIN_16_HIGH,
3205218822Sdim
3206218822Sdim/* ADI Blackfin 'a' part of LSETUP.  */
3207218822Sdim  BFD_RELOC_BFIN_4_PCREL,
3208218822Sdim
3209218822Sdim/* ADI Blackfin.  */
3210218822Sdim  BFD_RELOC_BFIN_5_PCREL,
3211218822Sdim
3212218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
3213218822Sdim  BFD_RELOC_BFIN_16_LOW,
3214218822Sdim
3215218822Sdim/* ADI Blackfin.  */
3216218822Sdim  BFD_RELOC_BFIN_10_PCREL,
3217218822Sdim
3218218822Sdim/* ADI Blackfin 'b' part of LSETUP.  */
3219218822Sdim  BFD_RELOC_BFIN_11_PCREL,
3220218822Sdim
3221218822Sdim/* ADI Blackfin.  */
3222218822Sdim  BFD_RELOC_BFIN_12_PCREL_JUMP,
3223218822Sdim
3224218822Sdim/* ADI Blackfin Short jump, pcrel.  */
3225218822Sdim  BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3226218822Sdim
3227218822Sdim/* ADI Blackfin Call.x not implemented.  */
3228218822Sdim  BFD_RELOC_BFIN_24_PCREL_CALL_X,
3229218822Sdim
3230218822Sdim/* ADI Blackfin Long Jump pcrel.  */
3231218822Sdim  BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3232218822Sdim
3233218822Sdim/* ADI Blackfin FD-PIC relocations.  */
3234218822Sdim  BFD_RELOC_BFIN_GOT17M4,
3235218822Sdim  BFD_RELOC_BFIN_GOTHI,
3236218822Sdim  BFD_RELOC_BFIN_GOTLO,
3237218822Sdim  BFD_RELOC_BFIN_FUNCDESC,
3238218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3239218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3240218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3241218822Sdim  BFD_RELOC_BFIN_FUNCDESC_VALUE,
3242218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3243218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3244218822Sdim  BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3245218822Sdim  BFD_RELOC_BFIN_GOTOFF17M4,
3246218822Sdim  BFD_RELOC_BFIN_GOTOFFHI,
3247218822Sdim  BFD_RELOC_BFIN_GOTOFFLO,
3248218822Sdim
3249218822Sdim/* ADI Blackfin GOT relocation.  */
3250218822Sdim  BFD_RELOC_BFIN_GOT,
3251218822Sdim
3252218822Sdim/* ADI Blackfin PLTPC relocation.  */
3253218822Sdim  BFD_RELOC_BFIN_PLTPC,
3254218822Sdim
3255218822Sdim/* ADI Blackfin arithmetic relocation.  */
3256218822Sdim  BFD_ARELOC_BFIN_PUSH,
3257218822Sdim
3258218822Sdim/* ADI Blackfin arithmetic relocation.  */
3259218822Sdim  BFD_ARELOC_BFIN_CONST,
3260218822Sdim
3261218822Sdim/* ADI Blackfin arithmetic relocation.  */
3262218822Sdim  BFD_ARELOC_BFIN_ADD,
3263218822Sdim
3264218822Sdim/* ADI Blackfin arithmetic relocation.  */
3265218822Sdim  BFD_ARELOC_BFIN_SUB,
3266218822Sdim
3267218822Sdim/* ADI Blackfin arithmetic relocation.  */
3268218822Sdim  BFD_ARELOC_BFIN_MULT,
3269218822Sdim
3270218822Sdim/* ADI Blackfin arithmetic relocation.  */
3271218822Sdim  BFD_ARELOC_BFIN_DIV,
3272218822Sdim
3273218822Sdim/* ADI Blackfin arithmetic relocation.  */
3274218822Sdim  BFD_ARELOC_BFIN_MOD,
3275218822Sdim
3276218822Sdim/* ADI Blackfin arithmetic relocation.  */
3277218822Sdim  BFD_ARELOC_BFIN_LSHIFT,
3278218822Sdim
3279218822Sdim/* ADI Blackfin arithmetic relocation.  */
3280218822Sdim  BFD_ARELOC_BFIN_RSHIFT,
3281218822Sdim
3282218822Sdim/* ADI Blackfin arithmetic relocation.  */
3283218822Sdim  BFD_ARELOC_BFIN_AND,
3284218822Sdim
3285218822Sdim/* ADI Blackfin arithmetic relocation.  */
3286218822Sdim  BFD_ARELOC_BFIN_OR,
3287218822Sdim
3288218822Sdim/* ADI Blackfin arithmetic relocation.  */
3289218822Sdim  BFD_ARELOC_BFIN_XOR,
3290218822Sdim
3291218822Sdim/* ADI Blackfin arithmetic relocation.  */
3292218822Sdim  BFD_ARELOC_BFIN_LAND,
3293218822Sdim
3294218822Sdim/* ADI Blackfin arithmetic relocation.  */
3295218822Sdim  BFD_ARELOC_BFIN_LOR,
3296218822Sdim
3297218822Sdim/* ADI Blackfin arithmetic relocation.  */
3298218822Sdim  BFD_ARELOC_BFIN_LEN,
3299218822Sdim
3300218822Sdim/* ADI Blackfin arithmetic relocation.  */
3301218822Sdim  BFD_ARELOC_BFIN_NEG,
3302218822Sdim
3303218822Sdim/* ADI Blackfin arithmetic relocation.  */
3304218822Sdim  BFD_ARELOC_BFIN_COMP,
3305218822Sdim
3306218822Sdim/* ADI Blackfin arithmetic relocation.  */
3307218822Sdim  BFD_ARELOC_BFIN_PAGE,
3308218822Sdim
3309218822Sdim/* ADI Blackfin arithmetic relocation.  */
3310218822Sdim  BFD_ARELOC_BFIN_HWPAGE,
3311218822Sdim
3312218822Sdim/* ADI Blackfin arithmetic relocation.  */
3313218822Sdim  BFD_ARELOC_BFIN_ADDR,
3314218822Sdim
3315131832Sobrien/* Mitsubishi D10V relocs.
3316131832SobrienThis is a 10-bit reloc with the right 2 bits
3317131832Sobrienassumed to be 0.  */
3318131832Sobrien  BFD_RELOC_D10V_10_PCREL_R,
3319131832Sobrien
3320131832Sobrien/* Mitsubishi D10V relocs.
3321131832SobrienThis is a 10-bit reloc with the right 2 bits
3322131832Sobrienassumed to be 0.  This is the same as the previous reloc
3323131832Sobrienexcept it is in the left container, i.e.,
3324131832Sobrienshifted left 15 bits.  */
3325131832Sobrien  BFD_RELOC_D10V_10_PCREL_L,
3326131832Sobrien
3327131832Sobrien/* This is an 18-bit reloc with the right 2 bits
3328131832Sobrienassumed to be 0.  */
3329131832Sobrien  BFD_RELOC_D10V_18,
3330131832Sobrien
3331131832Sobrien/* This is an 18-bit reloc with the right 2 bits
3332131832Sobrienassumed to be 0.  */
3333131832Sobrien  BFD_RELOC_D10V_18_PCREL,
3334131832Sobrien
3335131832Sobrien/* Mitsubishi D30V relocs.
3336131832SobrienThis is a 6-bit absolute reloc.  */
3337131832Sobrien  BFD_RELOC_D30V_6,
3338131832Sobrien
3339131832Sobrien/* This is a 6-bit pc-relative reloc with
3340131832Sobrienthe right 3 bits assumed to be 0.  */
3341131832Sobrien  BFD_RELOC_D30V_9_PCREL,
3342131832Sobrien
3343131832Sobrien/* This is a 6-bit pc-relative reloc with
3344131832Sobrienthe right 3 bits assumed to be 0. Same
3345131832Sobrienas the previous reloc but on the right side
3346131832Sobrienof the container.  */
3347131832Sobrien  BFD_RELOC_D30V_9_PCREL_R,
3348131832Sobrien
3349131832Sobrien/* This is a 12-bit absolute reloc with the
3350131832Sobrienright 3 bitsassumed to be 0.  */
3351131832Sobrien  BFD_RELOC_D30V_15,
3352131832Sobrien
3353131832Sobrien/* This is a 12-bit pc-relative reloc with
3354131832Sobrienthe right 3 bits assumed to be 0.  */
3355131832Sobrien  BFD_RELOC_D30V_15_PCREL,
3356131832Sobrien
3357131832Sobrien/* This is a 12-bit pc-relative reloc with
3358131832Sobrienthe right 3 bits assumed to be 0. Same
3359131832Sobrienas the previous reloc but on the right side
3360131832Sobrienof the container.  */
3361131832Sobrien  BFD_RELOC_D30V_15_PCREL_R,
3362131832Sobrien
3363131832Sobrien/* This is an 18-bit absolute reloc with
3364131832Sobrienthe right 3 bits assumed to be 0.  */
3365131832Sobrien  BFD_RELOC_D30V_21,
3366131832Sobrien
3367131832Sobrien/* This is an 18-bit pc-relative reloc with
3368131832Sobrienthe right 3 bits assumed to be 0.  */
3369131832Sobrien  BFD_RELOC_D30V_21_PCREL,
3370131832Sobrien
3371131832Sobrien/* This is an 18-bit pc-relative reloc with
3372131832Sobrienthe right 3 bits assumed to be 0. Same
3373131832Sobrienas the previous reloc but on the right side
3374131832Sobrienof the container.  */
3375131832Sobrien  BFD_RELOC_D30V_21_PCREL_R,
3376131832Sobrien
3377131832Sobrien/* This is a 32-bit absolute reloc.  */
3378131832Sobrien  BFD_RELOC_D30V_32,
3379131832Sobrien
3380131832Sobrien/* This is a 32-bit pc-relative reloc.  */
3381131832Sobrien  BFD_RELOC_D30V_32_PCREL,
3382131832Sobrien
3383131832Sobrien/* DLX relocs  */
3384131832Sobrien  BFD_RELOC_DLX_HI16_S,
3385131832Sobrien
3386131832Sobrien/* DLX relocs  */
3387131832Sobrien  BFD_RELOC_DLX_LO16,
3388131832Sobrien
3389131832Sobrien/* DLX relocs  */
3390131832Sobrien  BFD_RELOC_DLX_JMP26,
3391131832Sobrien
3392218822Sdim/* Renesas M16C/M32C Relocations.  */
3393218822Sdim  BFD_RELOC_M32C_HI8,
3394218822Sdim  BFD_RELOC_M32C_RL_JUMP,
3395218822Sdim  BFD_RELOC_M32C_RL_1ADDR,
3396218822Sdim  BFD_RELOC_M32C_RL_2ADDR,
3397218822Sdim
3398131832Sobrien/* Renesas M32R (formerly Mitsubishi M32R) relocs.
3399131832SobrienThis is a 24 bit absolute address.  */
3400131832Sobrien  BFD_RELOC_M32R_24,
3401131832Sobrien
3402131832Sobrien/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
3403131832Sobrien  BFD_RELOC_M32R_10_PCREL,
3404131832Sobrien
3405131832Sobrien/* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
3406131832Sobrien  BFD_RELOC_M32R_18_PCREL,
3407131832Sobrien
3408131832Sobrien/* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
3409131832Sobrien  BFD_RELOC_M32R_26_PCREL,
3410131832Sobrien
3411131832Sobrien/* This is a 16-bit reloc containing the high 16 bits of an address
3412131832Sobrienused when the lower 16 bits are treated as unsigned.  */
3413131832Sobrien  BFD_RELOC_M32R_HI16_ULO,
3414131832Sobrien
3415131832Sobrien/* This is a 16-bit reloc containing the high 16 bits of an address
3416131832Sobrienused when the lower 16 bits are treated as signed.  */
3417131832Sobrien  BFD_RELOC_M32R_HI16_SLO,
3418131832Sobrien
3419131832Sobrien/* This is a 16-bit reloc containing the lower 16 bits of an address.  */
3420131832Sobrien  BFD_RELOC_M32R_LO16,
3421131832Sobrien
3422131832Sobrien/* This is a 16-bit reloc containing the small data area offset for use in
3423131832Sobrienadd3, load, and store instructions.  */
3424131832Sobrien  BFD_RELOC_M32R_SDA16,
3425131832Sobrien
3426131832Sobrien/* For PIC.  */
3427131832Sobrien  BFD_RELOC_M32R_GOT24,
3428131832Sobrien  BFD_RELOC_M32R_26_PLTREL,
3429131832Sobrien  BFD_RELOC_M32R_COPY,
3430131832Sobrien  BFD_RELOC_M32R_GLOB_DAT,
3431131832Sobrien  BFD_RELOC_M32R_JMP_SLOT,
3432131832Sobrien  BFD_RELOC_M32R_RELATIVE,
3433131832Sobrien  BFD_RELOC_M32R_GOTOFF,
3434218822Sdim  BFD_RELOC_M32R_GOTOFF_HI_ULO,
3435218822Sdim  BFD_RELOC_M32R_GOTOFF_HI_SLO,
3436218822Sdim  BFD_RELOC_M32R_GOTOFF_LO,
3437131832Sobrien  BFD_RELOC_M32R_GOTPC24,
3438131832Sobrien  BFD_RELOC_M32R_GOT16_HI_ULO,
3439131832Sobrien  BFD_RELOC_M32R_GOT16_HI_SLO,
3440131832Sobrien  BFD_RELOC_M32R_GOT16_LO,
3441131832Sobrien  BFD_RELOC_M32R_GOTPC_HI_ULO,
3442131832Sobrien  BFD_RELOC_M32R_GOTPC_HI_SLO,
3443131832Sobrien  BFD_RELOC_M32R_GOTPC_LO,
3444131832Sobrien
3445131832Sobrien/* This is a 9-bit reloc  */
3446131832Sobrien  BFD_RELOC_V850_9_PCREL,
3447131832Sobrien
3448131832Sobrien/* This is a 22-bit reloc  */
3449131832Sobrien  BFD_RELOC_V850_22_PCREL,
3450131832Sobrien
3451131832Sobrien/* This is a 16 bit offset from the short data area pointer.  */
3452131832Sobrien  BFD_RELOC_V850_SDA_16_16_OFFSET,
3453131832Sobrien
3454131832Sobrien/* This is a 16 bit offset (of which only 15 bits are used) from the
3455131832Sobrienshort data area pointer.  */
3456131832Sobrien  BFD_RELOC_V850_SDA_15_16_OFFSET,
3457131832Sobrien
3458131832Sobrien/* This is a 16 bit offset from the zero data area pointer.  */
3459131832Sobrien  BFD_RELOC_V850_ZDA_16_16_OFFSET,
3460131832Sobrien
3461131832Sobrien/* This is a 16 bit offset (of which only 15 bits are used) from the
3462131832Sobrienzero data area pointer.  */
3463131832Sobrien  BFD_RELOC_V850_ZDA_15_16_OFFSET,
3464131832Sobrien
3465131832Sobrien/* This is an 8 bit offset (of which only 6 bits are used) from the
3466131832Sobrientiny data area pointer.  */
3467131832Sobrien  BFD_RELOC_V850_TDA_6_8_OFFSET,
3468131832Sobrien
3469131832Sobrien/* This is an 8bit offset (of which only 7 bits are used) from the tiny
3470131832Sobriendata area pointer.  */
3471131832Sobrien  BFD_RELOC_V850_TDA_7_8_OFFSET,
3472131832Sobrien
3473131832Sobrien/* This is a 7 bit offset from the tiny data area pointer.  */
3474131832Sobrien  BFD_RELOC_V850_TDA_7_7_OFFSET,
3475131832Sobrien
3476131832Sobrien/* This is a 16 bit offset from the tiny data area pointer.  */
3477131832Sobrien  BFD_RELOC_V850_TDA_16_16_OFFSET,
3478131832Sobrien
3479131832Sobrien/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
3480131832Sobriendata area pointer.  */
3481131832Sobrien  BFD_RELOC_V850_TDA_4_5_OFFSET,
3482131832Sobrien
3483131832Sobrien/* This is a 4 bit offset from the tiny data area pointer.  */
3484131832Sobrien  BFD_RELOC_V850_TDA_4_4_OFFSET,
3485131832Sobrien
3486131832Sobrien/* This is a 16 bit offset from the short data area pointer, with the
3487131832Sobrienbits placed non-contiguously in the instruction.  */
3488131832Sobrien  BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
3489131832Sobrien
3490131832Sobrien/* This is a 16 bit offset from the zero data area pointer, with the
3491131832Sobrienbits placed non-contiguously in the instruction.  */
3492131832Sobrien  BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
3493131832Sobrien
3494131832Sobrien/* This is a 6 bit offset from the call table base pointer.  */
3495131832Sobrien  BFD_RELOC_V850_CALLT_6_7_OFFSET,
3496131832Sobrien
3497131832Sobrien/* This is a 16 bit offset from the call table base pointer.  */
3498131832Sobrien  BFD_RELOC_V850_CALLT_16_16_OFFSET,
3499131832Sobrien
3500131832Sobrien/* Used for relaxing indirect function calls.  */
3501131832Sobrien  BFD_RELOC_V850_LONGCALL,
3502131832Sobrien
3503131832Sobrien/* Used for relaxing indirect jumps.  */
3504131832Sobrien  BFD_RELOC_V850_LONGJUMP,
3505131832Sobrien
3506131832Sobrien/* Used to maintain alignment whilst relaxing.  */
3507131832Sobrien  BFD_RELOC_V850_ALIGN,
3508131832Sobrien
3509218822Sdim/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
3510218822Sdiminstructions.  */
3511218822Sdim  BFD_RELOC_V850_LO16_SPLIT_OFFSET,
3512218822Sdim
3513131832Sobrien/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3514131832Sobrieninstruction.  */
3515131832Sobrien  BFD_RELOC_MN10300_32_PCREL,
3516131832Sobrien
3517131832Sobrien/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3518131832Sobrieninstruction.  */
3519131832Sobrien  BFD_RELOC_MN10300_16_PCREL,
3520131832Sobrien
3521131832Sobrien/* This is a 8bit DP reloc for the tms320c30, where the most
3522131832Sobriensignificant 8 bits of a 24 bit word are placed into the least
3523131832Sobriensignificant 8 bits of the opcode.  */
3524131832Sobrien  BFD_RELOC_TIC30_LDP,
3525131832Sobrien
3526131832Sobrien/* This is a 7bit reloc for the tms320c54x, where the least
3527131832Sobriensignificant 7 bits of a 16 bit word are placed into the least
3528131832Sobriensignificant 7 bits of the opcode.  */
3529131832Sobrien  BFD_RELOC_TIC54X_PARTLS7,
3530131832Sobrien
3531131832Sobrien/* This is a 9bit DP reloc for the tms320c54x, where the most
3532131832Sobriensignificant 9 bits of a 16 bit word are placed into the least
3533131832Sobriensignificant 9 bits of the opcode.  */
3534131832Sobrien  BFD_RELOC_TIC54X_PARTMS9,
3535131832Sobrien
3536131832Sobrien/* This is an extended address 23-bit reloc for the tms320c54x.  */
3537131832Sobrien  BFD_RELOC_TIC54X_23,
3538131832Sobrien
3539131832Sobrien/* This is a 16-bit reloc for the tms320c54x, where the least
3540131832Sobriensignificant 16 bits of a 23-bit extended address are placed into
3541131832Sobrienthe opcode.  */
3542131832Sobrien  BFD_RELOC_TIC54X_16_OF_23,
3543131832Sobrien
3544131832Sobrien/* This is a reloc for the tms320c54x, where the most
3545131832Sobriensignificant 7 bits of a 23-bit extended address are placed into
3546131832Sobrienthe opcode.  */
3547131832Sobrien  BFD_RELOC_TIC54X_MS7_OF_23,
3548131832Sobrien
3549131832Sobrien/* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
3550131832Sobrien  BFD_RELOC_FR30_48,
3551131832Sobrien
3552131832Sobrien/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
3553131832Sobrientwo sections.  */
3554131832Sobrien  BFD_RELOC_FR30_20,
3555131832Sobrien
3556131832Sobrien/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
3557131832Sobrien4 bits.  */
3558131832Sobrien  BFD_RELOC_FR30_6_IN_4,
3559131832Sobrien
3560131832Sobrien/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
3561131832Sobrieninto 8 bits.  */
3562131832Sobrien  BFD_RELOC_FR30_8_IN_8,
3563131832Sobrien
3564131832Sobrien/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
3565131832Sobrieninto 8 bits.  */
3566131832Sobrien  BFD_RELOC_FR30_9_IN_8,
3567131832Sobrien
3568131832Sobrien/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
3569131832Sobrieninto 8 bits.  */
3570131832Sobrien  BFD_RELOC_FR30_10_IN_8,
3571131832Sobrien
3572131832Sobrien/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
3573131832Sobrienshort offset into 8 bits.  */
3574131832Sobrien  BFD_RELOC_FR30_9_PCREL,
3575131832Sobrien
3576131832Sobrien/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
3577131832Sobrienshort offset into 11 bits.  */
3578131832Sobrien  BFD_RELOC_FR30_12_PCREL,
3579131832Sobrien
3580131832Sobrien/* Motorola Mcore relocations.  */
3581131832Sobrien  BFD_RELOC_MCORE_PCREL_IMM8BY4,
3582131832Sobrien  BFD_RELOC_MCORE_PCREL_IMM11BY2,
3583131832Sobrien  BFD_RELOC_MCORE_PCREL_IMM4BY2,
3584131832Sobrien  BFD_RELOC_MCORE_PCREL_32,
3585131832Sobrien  BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
3586131832Sobrien  BFD_RELOC_MCORE_RVA,
3587131832Sobrien
3588218822Sdim/* Toshiba Media Processor Relocations.  */
3589218822Sdim  BFD_RELOC_MEP_8,
3590218822Sdim  BFD_RELOC_MEP_16,
3591218822Sdim  BFD_RELOC_MEP_32,
3592218822Sdim  BFD_RELOC_MEP_PCREL8A2,
3593218822Sdim  BFD_RELOC_MEP_PCREL12A2,
3594218822Sdim  BFD_RELOC_MEP_PCREL17A2,
3595218822Sdim  BFD_RELOC_MEP_PCREL24A2,
3596218822Sdim  BFD_RELOC_MEP_PCABS24A2,
3597218822Sdim  BFD_RELOC_MEP_LOW16,
3598218822Sdim  BFD_RELOC_MEP_HI16U,
3599218822Sdim  BFD_RELOC_MEP_HI16S,
3600218822Sdim  BFD_RELOC_MEP_GPREL,
3601218822Sdim  BFD_RELOC_MEP_TPREL,
3602218822Sdim  BFD_RELOC_MEP_TPREL7,
3603218822Sdim  BFD_RELOC_MEP_TPREL7A2,
3604218822Sdim  BFD_RELOC_MEP_TPREL7A4,
3605218822Sdim  BFD_RELOC_MEP_UIMM24,
3606218822Sdim  BFD_RELOC_MEP_ADDR24A4,
3607218822Sdim  BFD_RELOC_MEP_GNU_VTINHERIT,
3608218822Sdim  BFD_RELOC_MEP_GNU_VTENTRY,
3609218822Sdim
3610218822Sdim
3611131832Sobrien/* These are relocations for the GETA instruction.  */
3612131832Sobrien  BFD_RELOC_MMIX_GETA,
3613131832Sobrien  BFD_RELOC_MMIX_GETA_1,
3614131832Sobrien  BFD_RELOC_MMIX_GETA_2,
3615131832Sobrien  BFD_RELOC_MMIX_GETA_3,
3616131832Sobrien
3617131832Sobrien/* These are relocations for a conditional branch instruction.  */
3618131832Sobrien  BFD_RELOC_MMIX_CBRANCH,
3619131832Sobrien  BFD_RELOC_MMIX_CBRANCH_J,
3620131832Sobrien  BFD_RELOC_MMIX_CBRANCH_1,
3621131832Sobrien  BFD_RELOC_MMIX_CBRANCH_2,
3622131832Sobrien  BFD_RELOC_MMIX_CBRANCH_3,
3623131832Sobrien
3624131832Sobrien/* These are relocations for the PUSHJ instruction.  */
3625131832Sobrien  BFD_RELOC_MMIX_PUSHJ,
3626131832Sobrien  BFD_RELOC_MMIX_PUSHJ_1,
3627131832Sobrien  BFD_RELOC_MMIX_PUSHJ_2,
3628131832Sobrien  BFD_RELOC_MMIX_PUSHJ_3,
3629131832Sobrien  BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
3630131832Sobrien
3631131832Sobrien/* These are relocations for the JMP instruction.  */
3632131832Sobrien  BFD_RELOC_MMIX_JMP,
3633131832Sobrien  BFD_RELOC_MMIX_JMP_1,
3634131832Sobrien  BFD_RELOC_MMIX_JMP_2,
3635131832Sobrien  BFD_RELOC_MMIX_JMP_3,
3636131832Sobrien
3637131832Sobrien/* This is a relocation for a relative address as in a GETA instruction or
3638131832Sobriena branch.  */
3639131832Sobrien  BFD_RELOC_MMIX_ADDR19,
3640131832Sobrien
3641131832Sobrien/* This is a relocation for a relative address as in a JMP instruction.  */
3642131832Sobrien  BFD_RELOC_MMIX_ADDR27,
3643131832Sobrien
3644131832Sobrien/* This is a relocation for an instruction field that may be a general
3645131832Sobrienregister or a value 0..255.  */
3646131832Sobrien  BFD_RELOC_MMIX_REG_OR_BYTE,
3647131832Sobrien
3648131832Sobrien/* This is a relocation for an instruction field that may be a general
3649131832Sobrienregister.  */
3650131832Sobrien  BFD_RELOC_MMIX_REG,
3651131832Sobrien
3652131832Sobrien/* This is a relocation for two instruction fields holding a register and
3653131832Sobrienan offset, the equivalent of the relocation.  */
3654131832Sobrien  BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
3655131832Sobrien
3656131832Sobrien/* This relocation is an assertion that the expression is not allocated as
3657131832Sobriena global register.  It does not modify contents.  */
3658131832Sobrien  BFD_RELOC_MMIX_LOCAL,
3659131832Sobrien
3660131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
3661131832Sobrienshort offset into 7 bits.  */
3662131832Sobrien  BFD_RELOC_AVR_7_PCREL,
3663131832Sobrien
3664131832Sobrien/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
3665131832Sobrienshort offset into 12 bits.  */
3666131832Sobrien  BFD_RELOC_AVR_13_PCREL,
3667131832Sobrien
3668131832Sobrien/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
3669131832Sobrienprogram memory address) into 16 bits.  */
3670131832Sobrien  BFD_RELOC_AVR_16_PM,
3671131832Sobrien
3672131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
3673131832Sobriendata memory address) into 8 bit immediate value of LDI insn.  */
3674131832Sobrien  BFD_RELOC_AVR_LO8_LDI,
3675131832Sobrien
3676131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
3677131832Sobrienof data memory address) into 8 bit immediate value of LDI insn.  */
3678131832Sobrien  BFD_RELOC_AVR_HI8_LDI,
3679131832Sobrien
3680131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
3681131832Sobrienof program memory address) into 8 bit immediate value of LDI insn.  */
3682131832Sobrien  BFD_RELOC_AVR_HH8_LDI,
3683131832Sobrien
3684218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
3685218822Sdimof 32 bit value) into 8 bit immediate value of LDI insn.  */
3686218822Sdim  BFD_RELOC_AVR_MS8_LDI,
3687218822Sdim
3688131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3689131832Sobrien(usually data memory address) into 8 bit immediate value of SUBI insn.  */
3690131832Sobrien  BFD_RELOC_AVR_LO8_LDI_NEG,
3691131832Sobrien
3692131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3693131832Sobrien(high 8 bit of data memory address) into 8 bit immediate value of
3694131832SobrienSUBI insn.  */
3695131832Sobrien  BFD_RELOC_AVR_HI8_LDI_NEG,
3696131832Sobrien
3697131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3698131832Sobrien(most high 8 bit of program memory address) into 8 bit immediate value
3699131832Sobrienof LDI or SUBI insn.  */
3700131832Sobrien  BFD_RELOC_AVR_HH8_LDI_NEG,
3701131832Sobrien
3702218822Sdim/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
3703218822Sdimof 32 bit value) into 8 bit immediate value of LDI insn.  */
3704218822Sdim  BFD_RELOC_AVR_MS8_LDI_NEG,
3705218822Sdim
3706131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
3707131832Sobriencommand address) into 8 bit immediate value of LDI insn.  */
3708131832Sobrien  BFD_RELOC_AVR_LO8_LDI_PM,
3709131832Sobrien
3710218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value
3711218822Sdim(command address) into 8 bit immediate value of LDI insn. If the address
3712218822Sdimis beyond the 128k boundary, the linker inserts a jump stub for this reloc
3713218822Sdimin the lower 128k.  */
3714218822Sdim  BFD_RELOC_AVR_LO8_LDI_GS,
3715218822Sdim
3716131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
3717131832Sobrienof command address) into 8 bit immediate value of LDI insn.  */
3718131832Sobrien  BFD_RELOC_AVR_HI8_LDI_PM,
3719131832Sobrien
3720218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
3721218822Sdimof command address) into 8 bit immediate value of LDI insn.  If the address
3722218822Sdimis beyond the 128k boundary, the linker inserts a jump stub for this reloc
3723218822Sdimbelow 128k.  */
3724218822Sdim  BFD_RELOC_AVR_HI8_LDI_GS,
3725218822Sdim
3726131832Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
3727131832Sobrienof command address) into 8 bit immediate value of LDI insn.  */
3728131832Sobrien  BFD_RELOC_AVR_HH8_LDI_PM,
3729131832Sobrien
3730131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3731131832Sobrien(usually command address) into 8 bit immediate value of SUBI insn.  */
3732131832Sobrien  BFD_RELOC_AVR_LO8_LDI_PM_NEG,
3733131832Sobrien
3734131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3735131832Sobrien(high 8 bit of 16 bit command address) into 8 bit immediate value
3736131832Sobrienof SUBI insn.  */
3737131832Sobrien  BFD_RELOC_AVR_HI8_LDI_PM_NEG,
3738131832Sobrien
3739131832Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
3740131832Sobrien(high 6 bit of 22 bit command address) into 8 bit immediate
3741131832Sobrienvalue of SUBI insn.  */
3742131832Sobrien  BFD_RELOC_AVR_HH8_LDI_PM_NEG,
3743131832Sobrien
3744131832Sobrien/* This is a 32 bit reloc for the AVR that stores 23 bit value
3745131832Sobrieninto 22 bits.  */
3746131832Sobrien  BFD_RELOC_AVR_CALL,
3747131832Sobrien
3748218822Sdim/* This is a 16 bit reloc for the AVR that stores all needed bits
3749218822Sdimfor absolute addressing with ldi with overflow check to linktime  */
3750218822Sdim  BFD_RELOC_AVR_LDI,
3751218822Sdim
3752218822Sdim/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
3753218822Sdiminstructions  */
3754218822Sdim  BFD_RELOC_AVR_6,
3755218822Sdim
3756218822Sdim/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
3757218822Sdiminstructions  */
3758218822Sdim  BFD_RELOC_AVR_6_ADIW,
3759218822Sdim
3760131832Sobrien/* Direct 12 bit.  */
3761131832Sobrien  BFD_RELOC_390_12,
3762131832Sobrien
3763131832Sobrien/* 12 bit GOT offset.  */
3764131832Sobrien  BFD_RELOC_390_GOT12,
3765131832Sobrien
3766131832Sobrien/* 32 bit PC relative PLT address.  */
3767131832Sobrien  BFD_RELOC_390_PLT32,
3768131832Sobrien
3769131832Sobrien/* Copy symbol at runtime.  */
3770131832Sobrien  BFD_RELOC_390_COPY,
3771131832Sobrien
3772131832Sobrien/* Create GOT entry.  */
3773131832Sobrien  BFD_RELOC_390_GLOB_DAT,
3774131832Sobrien
3775131832Sobrien/* Create PLT entry.  */
3776131832Sobrien  BFD_RELOC_390_JMP_SLOT,
3777131832Sobrien
3778131832Sobrien/* Adjust by program base.  */
3779131832Sobrien  BFD_RELOC_390_RELATIVE,
3780131832Sobrien
3781131832Sobrien/* 32 bit PC relative offset to GOT.  */
3782131832Sobrien  BFD_RELOC_390_GOTPC,
3783131832Sobrien
3784131832Sobrien/* 16 bit GOT offset.  */
3785131832Sobrien  BFD_RELOC_390_GOT16,
3786131832Sobrien
3787131832Sobrien/* PC relative 16 bit shifted by 1.  */
3788131832Sobrien  BFD_RELOC_390_PC16DBL,
3789131832Sobrien
3790131832Sobrien/* 16 bit PC rel. PLT shifted by 1.  */
3791131832Sobrien  BFD_RELOC_390_PLT16DBL,
3792131832Sobrien
3793131832Sobrien/* PC relative 32 bit shifted by 1.  */
3794131832Sobrien  BFD_RELOC_390_PC32DBL,
3795131832Sobrien
3796131832Sobrien/* 32 bit PC rel. PLT shifted by 1.  */
3797131832Sobrien  BFD_RELOC_390_PLT32DBL,
3798131832Sobrien
3799131832Sobrien/* 32 bit PC rel. GOT shifted by 1.  */
3800131832Sobrien  BFD_RELOC_390_GOTPCDBL,
3801131832Sobrien
3802131832Sobrien/* 64 bit GOT offset.  */
3803131832Sobrien  BFD_RELOC_390_GOT64,
3804131832Sobrien
3805131832Sobrien/* 64 bit PC relative PLT address.  */
3806131832Sobrien  BFD_RELOC_390_PLT64,
3807131832Sobrien
3808131832Sobrien/* 32 bit rel. offset to GOT entry.  */
3809131832Sobrien  BFD_RELOC_390_GOTENT,
3810131832Sobrien
3811131832Sobrien/* 64 bit offset to GOT.  */
3812131832Sobrien  BFD_RELOC_390_GOTOFF64,
3813131832Sobrien
3814131832Sobrien/* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
3815131832Sobrien  BFD_RELOC_390_GOTPLT12,
3816131832Sobrien
3817131832Sobrien/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
3818131832Sobrien  BFD_RELOC_390_GOTPLT16,
3819131832Sobrien
3820131832Sobrien/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
3821131832Sobrien  BFD_RELOC_390_GOTPLT32,
3822131832Sobrien
3823131832Sobrien/* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
3824131832Sobrien  BFD_RELOC_390_GOTPLT64,
3825131832Sobrien
3826131832Sobrien/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
3827131832Sobrien  BFD_RELOC_390_GOTPLTENT,
3828131832Sobrien
3829131832Sobrien/* 16-bit rel. offset from the GOT to a PLT entry.  */
3830131832Sobrien  BFD_RELOC_390_PLTOFF16,
3831131832Sobrien
3832131832Sobrien/* 32-bit rel. offset from the GOT to a PLT entry.  */
3833131832Sobrien  BFD_RELOC_390_PLTOFF32,
3834131832Sobrien
3835131832Sobrien/* 64-bit rel. offset from the GOT to a PLT entry.  */
3836131832Sobrien  BFD_RELOC_390_PLTOFF64,
3837131832Sobrien
3838131832Sobrien/* s390 tls relocations.  */
3839131832Sobrien  BFD_RELOC_390_TLS_LOAD,
3840131832Sobrien  BFD_RELOC_390_TLS_GDCALL,
3841131832Sobrien  BFD_RELOC_390_TLS_LDCALL,
3842131832Sobrien  BFD_RELOC_390_TLS_GD32,
3843131832Sobrien  BFD_RELOC_390_TLS_GD64,
3844131832Sobrien  BFD_RELOC_390_TLS_GOTIE12,
3845131832Sobrien  BFD_RELOC_390_TLS_GOTIE32,
3846131832Sobrien  BFD_RELOC_390_TLS_GOTIE64,
3847131832Sobrien  BFD_RELOC_390_TLS_LDM32,
3848131832Sobrien  BFD_RELOC_390_TLS_LDM64,
3849131832Sobrien  BFD_RELOC_390_TLS_IE32,
3850131832Sobrien  BFD_RELOC_390_TLS_IE64,
3851131832Sobrien  BFD_RELOC_390_TLS_IEENT,
3852131832Sobrien  BFD_RELOC_390_TLS_LE32,
3853131832Sobrien  BFD_RELOC_390_TLS_LE64,
3854131832Sobrien  BFD_RELOC_390_TLS_LDO32,
3855131832Sobrien  BFD_RELOC_390_TLS_LDO64,
3856131832Sobrien  BFD_RELOC_390_TLS_DTPMOD,
3857131832Sobrien  BFD_RELOC_390_TLS_DTPOFF,
3858131832Sobrien  BFD_RELOC_390_TLS_TPOFF,
3859131832Sobrien
3860131832Sobrien/* Long displacement extension.  */
3861131832Sobrien  BFD_RELOC_390_20,
3862131832Sobrien  BFD_RELOC_390_GOT20,
3863131832Sobrien  BFD_RELOC_390_GOTPLT20,
3864131832Sobrien  BFD_RELOC_390_TLS_GOTIE20,
3865131832Sobrien
3866218822Sdim/* Score relocations  */
3867218822Sdim  BFD_RELOC_SCORE_DUMMY1,
3868218822Sdim
3869218822Sdim/* Low 16 bit for load/store  */
3870218822Sdim  BFD_RELOC_SCORE_GPREL15,
3871218822Sdim
3872218822Sdim/* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
3873218822Sdim  BFD_RELOC_SCORE_DUMMY2,
3874218822Sdim  BFD_RELOC_SCORE_JMP,
3875218822Sdim
3876218822Sdim/* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
3877218822Sdim  BFD_RELOC_SCORE_BRANCH,
3878218822Sdim
3879218822Sdim/* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
3880218822Sdim  BFD_RELOC_SCORE16_JMP,
3881218822Sdim
3882218822Sdim/* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
3883218822Sdim  BFD_RELOC_SCORE16_BRANCH,
3884218822Sdim
3885218822Sdim/* Undocumented Score relocs  */
3886218822Sdim  BFD_RELOC_SCORE_GOT15,
3887218822Sdim  BFD_RELOC_SCORE_GOT_LO16,
3888218822Sdim  BFD_RELOC_SCORE_CALL15,
3889218822Sdim  BFD_RELOC_SCORE_DUMMY_HI16,
3890218822Sdim
3891131832Sobrien/* Scenix IP2K - 9-bit register number / data address  */
3892131832Sobrien  BFD_RELOC_IP2K_FR9,
3893131832Sobrien
3894131832Sobrien/* Scenix IP2K - 4-bit register/data bank number  */
3895131832Sobrien  BFD_RELOC_IP2K_BANK,
3896131832Sobrien
3897131832Sobrien/* Scenix IP2K - low 13 bits of instruction word address  */
3898131832Sobrien  BFD_RELOC_IP2K_ADDR16CJP,
3899131832Sobrien
3900131832Sobrien/* Scenix IP2K - high 3 bits of instruction word address  */
3901131832Sobrien  BFD_RELOC_IP2K_PAGE3,
3902131832Sobrien
3903131832Sobrien/* Scenix IP2K - ext/low/high 8 bits of data address  */
3904131832Sobrien  BFD_RELOC_IP2K_LO8DATA,
3905131832Sobrien  BFD_RELOC_IP2K_HI8DATA,
3906131832Sobrien  BFD_RELOC_IP2K_EX8DATA,
3907131832Sobrien
3908131832Sobrien/* Scenix IP2K - low/high 8 bits of instruction word address  */
3909131832Sobrien  BFD_RELOC_IP2K_LO8INSN,
3910131832Sobrien  BFD_RELOC_IP2K_HI8INSN,
3911131832Sobrien
3912131832Sobrien/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
3913131832Sobrien  BFD_RELOC_IP2K_PC_SKIP,
3914131832Sobrien
3915131832Sobrien/* Scenix IP2K - 16 bit word address in text section.  */
3916131832Sobrien  BFD_RELOC_IP2K_TEXT,
3917131832Sobrien
3918131832Sobrien/* Scenix IP2K - 7-bit sp or dp offset  */
3919131832Sobrien  BFD_RELOC_IP2K_FR_OFFSET,
3920131832Sobrien
3921131832Sobrien/* Scenix VPE4K coprocessor - data/insn-space addressing  */
3922131832Sobrien  BFD_RELOC_VPE4KMATH_DATA,
3923131832Sobrien  BFD_RELOC_VPE4KMATH_INSN,
3924131832Sobrien
3925131832Sobrien/* These two relocations are used by the linker to determine which of
3926131832Sobrienthe entries in a C++ virtual function table are actually used.  When
3927131832Sobrienthe --gc-sections option is given, the linker will zero out the entries
3928131832Sobrienthat are not used, so that the code for those functions need not be
3929131832Sobrienincluded in the output.
3930131832Sobrien
3931131832SobrienVTABLE_INHERIT is a zero-space relocation used to describe to the
3932131832Sobrienlinker the inheritance tree of a C++ virtual function table.  The
3933131832Sobrienrelocation's symbol should be the parent class' vtable, and the
3934131832Sobrienrelocation should be located at the child vtable.
3935131832Sobrien
3936131832SobrienVTABLE_ENTRY is a zero-space relocation that describes the use of a
3937131832Sobrienvirtual function table entry.  The reloc's symbol should refer to the
3938131832Sobrientable of the class mentioned in the code.  Off of that base, an offset
3939131832Sobriendescribes the entry that is being used.  For Rela hosts, this offset
3940131832Sobrienis stored in the reloc's addend.  For Rel hosts, we are forced to put
3941131832Sobrienthis offset in the reloc's section offset.  */
3942131832Sobrien  BFD_RELOC_VTABLE_INHERIT,
3943131832Sobrien  BFD_RELOC_VTABLE_ENTRY,
3944131832Sobrien
3945131832Sobrien/* Intel IA64 Relocations.  */
3946131832Sobrien  BFD_RELOC_IA64_IMM14,
3947131832Sobrien  BFD_RELOC_IA64_IMM22,
3948131832Sobrien  BFD_RELOC_IA64_IMM64,
3949131832Sobrien  BFD_RELOC_IA64_DIR32MSB,
3950131832Sobrien  BFD_RELOC_IA64_DIR32LSB,
3951131832Sobrien  BFD_RELOC_IA64_DIR64MSB,
3952131832Sobrien  BFD_RELOC_IA64_DIR64LSB,
3953131832Sobrien  BFD_RELOC_IA64_GPREL22,
3954131832Sobrien  BFD_RELOC_IA64_GPREL64I,
3955131832Sobrien  BFD_RELOC_IA64_GPREL32MSB,
3956131832Sobrien  BFD_RELOC_IA64_GPREL32LSB,
3957131832Sobrien  BFD_RELOC_IA64_GPREL64MSB,
3958131832Sobrien  BFD_RELOC_IA64_GPREL64LSB,
3959131832Sobrien  BFD_RELOC_IA64_LTOFF22,
3960131832Sobrien  BFD_RELOC_IA64_LTOFF64I,
3961131832Sobrien  BFD_RELOC_IA64_PLTOFF22,
3962131832Sobrien  BFD_RELOC_IA64_PLTOFF64I,
3963131832Sobrien  BFD_RELOC_IA64_PLTOFF64MSB,
3964131832Sobrien  BFD_RELOC_IA64_PLTOFF64LSB,
3965131832Sobrien  BFD_RELOC_IA64_FPTR64I,
3966131832Sobrien  BFD_RELOC_IA64_FPTR32MSB,
3967131832Sobrien  BFD_RELOC_IA64_FPTR32LSB,
3968131832Sobrien  BFD_RELOC_IA64_FPTR64MSB,
3969131832Sobrien  BFD_RELOC_IA64_FPTR64LSB,
3970131832Sobrien  BFD_RELOC_IA64_PCREL21B,
3971131832Sobrien  BFD_RELOC_IA64_PCREL21BI,
3972131832Sobrien  BFD_RELOC_IA64_PCREL21M,
3973131832Sobrien  BFD_RELOC_IA64_PCREL21F,
3974131832Sobrien  BFD_RELOC_IA64_PCREL22,
3975131832Sobrien  BFD_RELOC_IA64_PCREL60B,
3976131832Sobrien  BFD_RELOC_IA64_PCREL64I,
3977131832Sobrien  BFD_RELOC_IA64_PCREL32MSB,
3978131832Sobrien  BFD_RELOC_IA64_PCREL32LSB,
3979131832Sobrien  BFD_RELOC_IA64_PCREL64MSB,
3980131832Sobrien  BFD_RELOC_IA64_PCREL64LSB,
3981131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR22,
3982131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR64I,
3983131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR32MSB,
3984131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR32LSB,
3985131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR64MSB,
3986131832Sobrien  BFD_RELOC_IA64_LTOFF_FPTR64LSB,
3987131832Sobrien  BFD_RELOC_IA64_SEGREL32MSB,
3988131832Sobrien  BFD_RELOC_IA64_SEGREL32LSB,
3989131832Sobrien  BFD_RELOC_IA64_SEGREL64MSB,
3990131832Sobrien  BFD_RELOC_IA64_SEGREL64LSB,
3991131832Sobrien  BFD_RELOC_IA64_SECREL32MSB,
3992131832Sobrien  BFD_RELOC_IA64_SECREL32LSB,
3993131832Sobrien  BFD_RELOC_IA64_SECREL64MSB,
3994131832Sobrien  BFD_RELOC_IA64_SECREL64LSB,
3995131832Sobrien  BFD_RELOC_IA64_REL32MSB,
3996131832Sobrien  BFD_RELOC_IA64_REL32LSB,
3997131832Sobrien  BFD_RELOC_IA64_REL64MSB,
3998131832Sobrien  BFD_RELOC_IA64_REL64LSB,
3999131832Sobrien  BFD_RELOC_IA64_LTV32MSB,
4000131832Sobrien  BFD_RELOC_IA64_LTV32LSB,
4001131832Sobrien  BFD_RELOC_IA64_LTV64MSB,
4002131832Sobrien  BFD_RELOC_IA64_LTV64LSB,
4003131832Sobrien  BFD_RELOC_IA64_IPLTMSB,
4004131832Sobrien  BFD_RELOC_IA64_IPLTLSB,
4005131832Sobrien  BFD_RELOC_IA64_COPY,
4006131832Sobrien  BFD_RELOC_IA64_LTOFF22X,
4007131832Sobrien  BFD_RELOC_IA64_LDXMOV,
4008131832Sobrien  BFD_RELOC_IA64_TPREL14,
4009131832Sobrien  BFD_RELOC_IA64_TPREL22,
4010131832Sobrien  BFD_RELOC_IA64_TPREL64I,
4011131832Sobrien  BFD_RELOC_IA64_TPREL64MSB,
4012131832Sobrien  BFD_RELOC_IA64_TPREL64LSB,
4013131832Sobrien  BFD_RELOC_IA64_LTOFF_TPREL22,
4014131832Sobrien  BFD_RELOC_IA64_DTPMOD64MSB,
4015131832Sobrien  BFD_RELOC_IA64_DTPMOD64LSB,
4016131832Sobrien  BFD_RELOC_IA64_LTOFF_DTPMOD22,
4017131832Sobrien  BFD_RELOC_IA64_DTPREL14,
4018131832Sobrien  BFD_RELOC_IA64_DTPREL22,
4019131832Sobrien  BFD_RELOC_IA64_DTPREL64I,
4020131832Sobrien  BFD_RELOC_IA64_DTPREL32MSB,
4021131832Sobrien  BFD_RELOC_IA64_DTPREL32LSB,
4022131832Sobrien  BFD_RELOC_IA64_DTPREL64MSB,
4023131832Sobrien  BFD_RELOC_IA64_DTPREL64LSB,
4024131832Sobrien  BFD_RELOC_IA64_LTOFF_DTPREL22,
4025131832Sobrien
4026131832Sobrien/* Motorola 68HC11 reloc.
4027131832SobrienThis is the 8 bit high part of an absolute address.  */
4028131832Sobrien  BFD_RELOC_M68HC11_HI8,
4029131832Sobrien
4030131832Sobrien/* Motorola 68HC11 reloc.
4031131832SobrienThis is the 8 bit low part of an absolute address.  */
4032131832Sobrien  BFD_RELOC_M68HC11_LO8,
4033131832Sobrien
4034131832Sobrien/* Motorola 68HC11 reloc.
4035131832SobrienThis is the 3 bit of a value.  */
4036131832Sobrien  BFD_RELOC_M68HC11_3B,
4037131832Sobrien
4038131832Sobrien/* Motorola 68HC11 reloc.
4039131832SobrienThis reloc marks the beginning of a jump/call instruction.
4040131832SobrienIt is used for linker relaxation to correctly identify beginning
4041131832Sobrienof instruction and change some branches to use PC-relative
4042131832Sobrienaddressing mode.  */
4043131832Sobrien  BFD_RELOC_M68HC11_RL_JUMP,
4044131832Sobrien
4045131832Sobrien/* Motorola 68HC11 reloc.
4046131832SobrienThis reloc marks a group of several instructions that gcc generates
4047131832Sobrienand for which the linker relaxation pass can modify and/or remove
4048131832Sobriensome of them.  */
4049131832Sobrien  BFD_RELOC_M68HC11_RL_GROUP,
4050131832Sobrien
4051131832Sobrien/* Motorola 68HC11 reloc.
4052131832SobrienThis is the 16-bit lower part of an address.  It is used for 'call'
4053131832Sobrieninstruction to specify the symbol address without any special
4054131832Sobrientransformation (due to memory bank window).  */
4055131832Sobrien  BFD_RELOC_M68HC11_LO16,
4056131832Sobrien
4057131832Sobrien/* Motorola 68HC11 reloc.
4058131832SobrienThis is a 8-bit reloc that specifies the page number of an address.
4059131832SobrienIt is used by 'call' instruction to specify the page number of
4060131832Sobrienthe symbol.  */
4061131832Sobrien  BFD_RELOC_M68HC11_PAGE,
4062131832Sobrien
4063131832Sobrien/* Motorola 68HC11 reloc.
4064131832SobrienThis is a 24-bit reloc that represents the address with a 16-bit
4065131832Sobrienvalue and a 8-bit page number.  The symbol address is transformed
4066131832Sobriento follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
4067131832Sobrien  BFD_RELOC_M68HC11_24,
4068131832Sobrien
4069131832Sobrien/* Motorola 68HC12 reloc.
4070131832SobrienThis is the 5 bits of a value.  */
4071131832Sobrien  BFD_RELOC_M68HC12_5B,
4072131832Sobrien
4073218822Sdim/* NS CR16C Relocations.  */
4074218822Sdim  BFD_RELOC_16C_NUM08,
4075218822Sdim  BFD_RELOC_16C_NUM08_C,
4076218822Sdim  BFD_RELOC_16C_NUM16,
4077218822Sdim  BFD_RELOC_16C_NUM16_C,
4078218822Sdim  BFD_RELOC_16C_NUM32,
4079218822Sdim  BFD_RELOC_16C_NUM32_C,
4080218822Sdim  BFD_RELOC_16C_DISP04,
4081218822Sdim  BFD_RELOC_16C_DISP04_C,
4082218822Sdim  BFD_RELOC_16C_DISP08,
4083218822Sdim  BFD_RELOC_16C_DISP08_C,
4084218822Sdim  BFD_RELOC_16C_DISP16,
4085218822Sdim  BFD_RELOC_16C_DISP16_C,
4086218822Sdim  BFD_RELOC_16C_DISP24,
4087218822Sdim  BFD_RELOC_16C_DISP24_C,
4088218822Sdim  BFD_RELOC_16C_DISP24a,
4089218822Sdim  BFD_RELOC_16C_DISP24a_C,
4090218822Sdim  BFD_RELOC_16C_REG04,
4091218822Sdim  BFD_RELOC_16C_REG04_C,
4092218822Sdim  BFD_RELOC_16C_REG04a,
4093218822Sdim  BFD_RELOC_16C_REG04a_C,
4094218822Sdim  BFD_RELOC_16C_REG14,
4095218822Sdim  BFD_RELOC_16C_REG14_C,
4096218822Sdim  BFD_RELOC_16C_REG16,
4097218822Sdim  BFD_RELOC_16C_REG16_C,
4098218822Sdim  BFD_RELOC_16C_REG20,
4099218822Sdim  BFD_RELOC_16C_REG20_C,
4100218822Sdim  BFD_RELOC_16C_ABS20,
4101218822Sdim  BFD_RELOC_16C_ABS20_C,
4102218822Sdim  BFD_RELOC_16C_ABS24,
4103218822Sdim  BFD_RELOC_16C_ABS24_C,
4104218822Sdim  BFD_RELOC_16C_IMM04,
4105218822Sdim  BFD_RELOC_16C_IMM04_C,
4106218822Sdim  BFD_RELOC_16C_IMM16,
4107218822Sdim  BFD_RELOC_16C_IMM16_C,
4108218822Sdim  BFD_RELOC_16C_IMM20,
4109218822Sdim  BFD_RELOC_16C_IMM20_C,
4110218822Sdim  BFD_RELOC_16C_IMM24,
4111218822Sdim  BFD_RELOC_16C_IMM24_C,
4112218822Sdim  BFD_RELOC_16C_IMM32,
4113218822Sdim  BFD_RELOC_16C_IMM32_C,
4114218822Sdim
4115218822Sdim/* NS CR16 Relocations.  */
4116218822Sdim  BFD_RELOC_CR16_NUM8,
4117218822Sdim  BFD_RELOC_CR16_NUM16,
4118218822Sdim  BFD_RELOC_CR16_NUM32,
4119218822Sdim  BFD_RELOC_CR16_NUM32a,
4120218822Sdim  BFD_RELOC_CR16_REGREL0,
4121218822Sdim  BFD_RELOC_CR16_REGREL4,
4122218822Sdim  BFD_RELOC_CR16_REGREL4a,
4123218822Sdim  BFD_RELOC_CR16_REGREL14,
4124218822Sdim  BFD_RELOC_CR16_REGREL14a,
4125218822Sdim  BFD_RELOC_CR16_REGREL16,
4126218822Sdim  BFD_RELOC_CR16_REGREL20,
4127218822Sdim  BFD_RELOC_CR16_REGREL20a,
4128218822Sdim  BFD_RELOC_CR16_ABS20,
4129218822Sdim  BFD_RELOC_CR16_ABS24,
4130218822Sdim  BFD_RELOC_CR16_IMM4,
4131218822Sdim  BFD_RELOC_CR16_IMM8,
4132218822Sdim  BFD_RELOC_CR16_IMM16,
4133218822Sdim  BFD_RELOC_CR16_IMM20,
4134218822Sdim  BFD_RELOC_CR16_IMM24,
4135218822Sdim  BFD_RELOC_CR16_IMM32,
4136218822Sdim  BFD_RELOC_CR16_IMM32a,
4137218822Sdim  BFD_RELOC_CR16_DISP4,
4138218822Sdim  BFD_RELOC_CR16_DISP8,
4139218822Sdim  BFD_RELOC_CR16_DISP16,
4140218822Sdim  BFD_RELOC_CR16_DISP20,
4141218822Sdim  BFD_RELOC_CR16_DISP24,
4142218822Sdim  BFD_RELOC_CR16_DISP24a,
4143218822Sdim
4144218822Sdim/* NS CRX Relocations.  */
4145218822Sdim  BFD_RELOC_CRX_REL4,
4146218822Sdim  BFD_RELOC_CRX_REL8,
4147218822Sdim  BFD_RELOC_CRX_REL8_CMP,
4148218822Sdim  BFD_RELOC_CRX_REL16,
4149218822Sdim  BFD_RELOC_CRX_REL24,
4150218822Sdim  BFD_RELOC_CRX_REL32,
4151218822Sdim  BFD_RELOC_CRX_REGREL12,
4152218822Sdim  BFD_RELOC_CRX_REGREL22,
4153218822Sdim  BFD_RELOC_CRX_REGREL28,
4154218822Sdim  BFD_RELOC_CRX_REGREL32,
4155218822Sdim  BFD_RELOC_CRX_ABS16,
4156218822Sdim  BFD_RELOC_CRX_ABS32,
4157218822Sdim  BFD_RELOC_CRX_NUM8,
4158218822Sdim  BFD_RELOC_CRX_NUM16,
4159218822Sdim  BFD_RELOC_CRX_NUM32,
4160218822Sdim  BFD_RELOC_CRX_IMM16,
4161218822Sdim  BFD_RELOC_CRX_IMM32,
4162218822Sdim  BFD_RELOC_CRX_SWITCH8,
4163218822Sdim  BFD_RELOC_CRX_SWITCH16,
4164218822Sdim  BFD_RELOC_CRX_SWITCH32,
4165218822Sdim
4166131832Sobrien/* These relocs are only used within the CRIS assembler.  They are not
4167131832Sobrien(at present) written to any object files.  */
4168131832Sobrien  BFD_RELOC_CRIS_BDISP8,
4169131832Sobrien  BFD_RELOC_CRIS_UNSIGNED_5,
4170131832Sobrien  BFD_RELOC_CRIS_SIGNED_6,
4171131832Sobrien  BFD_RELOC_CRIS_UNSIGNED_6,
4172218822Sdim  BFD_RELOC_CRIS_SIGNED_8,
4173218822Sdim  BFD_RELOC_CRIS_UNSIGNED_8,
4174218822Sdim  BFD_RELOC_CRIS_SIGNED_16,
4175218822Sdim  BFD_RELOC_CRIS_UNSIGNED_16,
4176218822Sdim  BFD_RELOC_CRIS_LAPCQ_OFFSET,
4177131832Sobrien  BFD_RELOC_CRIS_UNSIGNED_4,
4178131832Sobrien
4179131832Sobrien/* Relocs used in ELF shared libraries for CRIS.  */
4180131832Sobrien  BFD_RELOC_CRIS_COPY,
4181131832Sobrien  BFD_RELOC_CRIS_GLOB_DAT,
4182131832Sobrien  BFD_RELOC_CRIS_JUMP_SLOT,
4183131832Sobrien  BFD_RELOC_CRIS_RELATIVE,
4184131832Sobrien
4185131832Sobrien/* 32-bit offset to symbol-entry within GOT.  */
4186131832Sobrien  BFD_RELOC_CRIS_32_GOT,
4187131832Sobrien
4188131832Sobrien/* 16-bit offset to symbol-entry within GOT.  */
4189131832Sobrien  BFD_RELOC_CRIS_16_GOT,
4190131832Sobrien
4191131832Sobrien/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
4192131832Sobrien  BFD_RELOC_CRIS_32_GOTPLT,
4193131832Sobrien
4194131832Sobrien/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
4195131832Sobrien  BFD_RELOC_CRIS_16_GOTPLT,
4196131832Sobrien
4197131832Sobrien/* 32-bit offset to symbol, relative to GOT.  */
4198131832Sobrien  BFD_RELOC_CRIS_32_GOTREL,
4199131832Sobrien
4200131832Sobrien/* 32-bit offset to symbol with PLT entry, relative to GOT.  */
4201131832Sobrien  BFD_RELOC_CRIS_32_PLT_GOTREL,
4202131832Sobrien
4203131832Sobrien/* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
4204131832Sobrien  BFD_RELOC_CRIS_32_PLT_PCREL,
4205131832Sobrien
4206131832Sobrien/* Intel i860 Relocations.  */
4207131832Sobrien  BFD_RELOC_860_COPY,
4208131832Sobrien  BFD_RELOC_860_GLOB_DAT,
4209131832Sobrien  BFD_RELOC_860_JUMP_SLOT,
4210131832Sobrien  BFD_RELOC_860_RELATIVE,
4211131832Sobrien  BFD_RELOC_860_PC26,
4212131832Sobrien  BFD_RELOC_860_PLT26,
4213131832Sobrien  BFD_RELOC_860_PC16,
4214131832Sobrien  BFD_RELOC_860_LOW0,
4215131832Sobrien  BFD_RELOC_860_SPLIT0,
4216131832Sobrien  BFD_RELOC_860_LOW1,
4217131832Sobrien  BFD_RELOC_860_SPLIT1,
4218131832Sobrien  BFD_RELOC_860_LOW2,
4219131832Sobrien  BFD_RELOC_860_SPLIT2,
4220131832Sobrien  BFD_RELOC_860_LOW3,
4221131832Sobrien  BFD_RELOC_860_LOGOT0,
4222131832Sobrien  BFD_RELOC_860_SPGOT0,
4223131832Sobrien  BFD_RELOC_860_LOGOT1,
4224131832Sobrien  BFD_RELOC_860_SPGOT1,
4225131832Sobrien  BFD_RELOC_860_LOGOTOFF0,
4226131832Sobrien  BFD_RELOC_860_SPGOTOFF0,
4227131832Sobrien  BFD_RELOC_860_LOGOTOFF1,
4228131832Sobrien  BFD_RELOC_860_SPGOTOFF1,
4229131832Sobrien  BFD_RELOC_860_LOGOTOFF2,
4230131832Sobrien  BFD_RELOC_860_LOGOTOFF3,
4231131832Sobrien  BFD_RELOC_860_LOPC,
4232131832Sobrien  BFD_RELOC_860_HIGHADJ,
4233131832Sobrien  BFD_RELOC_860_HAGOT,
4234131832Sobrien  BFD_RELOC_860_HAGOTOFF,
4235131832Sobrien  BFD_RELOC_860_HAPC,
4236131832Sobrien  BFD_RELOC_860_HIGH,
4237131832Sobrien  BFD_RELOC_860_HIGOT,
4238131832Sobrien  BFD_RELOC_860_HIGOTOFF,
4239131832Sobrien
4240131832Sobrien/* OpenRISC Relocations.  */
4241131832Sobrien  BFD_RELOC_OPENRISC_ABS_26,
4242131832Sobrien  BFD_RELOC_OPENRISC_REL_26,
4243131832Sobrien
4244131832Sobrien/* H8 elf Relocations.  */
4245131832Sobrien  BFD_RELOC_H8_DIR16A8,
4246131832Sobrien  BFD_RELOC_H8_DIR16R8,
4247131832Sobrien  BFD_RELOC_H8_DIR24A8,
4248131832Sobrien  BFD_RELOC_H8_DIR24R8,
4249131832Sobrien  BFD_RELOC_H8_DIR32A16,
4250131832Sobrien
4251131832Sobrien/* Sony Xstormy16 Relocations.  */
4252131832Sobrien  BFD_RELOC_XSTORMY16_REL_12,
4253131832Sobrien  BFD_RELOC_XSTORMY16_12,
4254131832Sobrien  BFD_RELOC_XSTORMY16_24,
4255131832Sobrien  BFD_RELOC_XSTORMY16_FPTR16,
4256131832Sobrien
4257218822Sdim/* Self-describing complex relocations.  */
4258218822Sdim  BFD_RELOC_RELC,
4259218822Sdim
4260218822Sdim
4261218822Sdim/* Infineon Relocations.  */
4262218822Sdim  BFD_RELOC_XC16X_PAG,
4263218822Sdim  BFD_RELOC_XC16X_POF,
4264218822Sdim  BFD_RELOC_XC16X_SEG,
4265218822Sdim  BFD_RELOC_XC16X_SOF,
4266218822Sdim
4267131832Sobrien/* Relocations used by VAX ELF.  */
4268131832Sobrien  BFD_RELOC_VAX_GLOB_DAT,
4269131832Sobrien  BFD_RELOC_VAX_JMP_SLOT,
4270131832Sobrien  BFD_RELOC_VAX_RELATIVE,
4271131832Sobrien
4272218822Sdim/* Morpho MT - 16 bit immediate relocation.  */
4273218822Sdim  BFD_RELOC_MT_PC16,
4274218822Sdim
4275218822Sdim/* Morpho MT - Hi 16 bits of an address.  */
4276218822Sdim  BFD_RELOC_MT_HI16,
4277218822Sdim
4278218822Sdim/* Morpho MT - Low 16 bits of an address.  */
4279218822Sdim  BFD_RELOC_MT_LO16,
4280218822Sdim
4281218822Sdim/* Morpho MT - Used to tell the linker which vtable entries are used.  */
4282218822Sdim  BFD_RELOC_MT_GNU_VTINHERIT,
4283218822Sdim
4284218822Sdim/* Morpho MT - Used to tell the linker which vtable entries are used.  */
4285218822Sdim  BFD_RELOC_MT_GNU_VTENTRY,
4286218822Sdim
4287218822Sdim/* Morpho MT - 8 bit immediate relocation.  */
4288218822Sdim  BFD_RELOC_MT_PCINSN8,
4289218822Sdim
4290131832Sobrien/* msp430 specific relocation codes  */
4291131832Sobrien  BFD_RELOC_MSP430_10_PCREL,
4292131832Sobrien  BFD_RELOC_MSP430_16_PCREL,
4293131832Sobrien  BFD_RELOC_MSP430_16,
4294131832Sobrien  BFD_RELOC_MSP430_16_PCREL_BYTE,
4295131832Sobrien  BFD_RELOC_MSP430_16_BYTE,
4296218822Sdim  BFD_RELOC_MSP430_2X_PCREL,
4297218822Sdim  BFD_RELOC_MSP430_RL_PCREL,
4298131832Sobrien
4299131832Sobrien/* IQ2000 Relocations.  */
4300131832Sobrien  BFD_RELOC_IQ2000_OFFSET_16,
4301131832Sobrien  BFD_RELOC_IQ2000_OFFSET_21,
4302131832Sobrien  BFD_RELOC_IQ2000_UHI16,
4303131832Sobrien
4304131832Sobrien/* Special Xtensa relocation used only by PLT entries in ELF shared
4305131832Sobrienobjects to indicate that the runtime linker should set the value
4306131832Sobriento one of its own internal functions or data structures.  */
4307131832Sobrien  BFD_RELOC_XTENSA_RTLD,
4308131832Sobrien
4309131832Sobrien/* Xtensa relocations for ELF shared objects.  */
4310131832Sobrien  BFD_RELOC_XTENSA_GLOB_DAT,
4311131832Sobrien  BFD_RELOC_XTENSA_JMP_SLOT,
4312131832Sobrien  BFD_RELOC_XTENSA_RELATIVE,
4313131832Sobrien
4314131832Sobrien/* Xtensa relocation used in ELF object files for symbols that may require
4315131832SobrienPLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
4316131832Sobrien  BFD_RELOC_XTENSA_PLT,
4317131832Sobrien
4318218822Sdim/* Xtensa relocations to mark the difference of two local symbols.
4319218822SdimThese are only needed to support linker relaxation and can be ignored
4320218822Sdimwhen not relaxing.  The field is set to the value of the difference
4321218822Sdimassuming no relaxation.  The relocation encodes the position of the
4322218822Sdimfirst symbol so the linker can determine whether to adjust the field
4323218822Sdimvalue.  */
4324218822Sdim  BFD_RELOC_XTENSA_DIFF8,
4325218822Sdim  BFD_RELOC_XTENSA_DIFF16,
4326218822Sdim  BFD_RELOC_XTENSA_DIFF32,
4327218822Sdim
4328218822Sdim/* Generic Xtensa relocations for instruction operands.  Only the slot
4329218822Sdimnumber is encoded in the relocation.  The relocation applies to the
4330218822Sdimlast PC-relative immediate operand, or if there are no PC-relative
4331218822Sdimimmediates, to the last immediate operand.  */
4332218822Sdim  BFD_RELOC_XTENSA_SLOT0_OP,
4333218822Sdim  BFD_RELOC_XTENSA_SLOT1_OP,
4334218822Sdim  BFD_RELOC_XTENSA_SLOT2_OP,
4335218822Sdim  BFD_RELOC_XTENSA_SLOT3_OP,
4336218822Sdim  BFD_RELOC_XTENSA_SLOT4_OP,
4337218822Sdim  BFD_RELOC_XTENSA_SLOT5_OP,
4338218822Sdim  BFD_RELOC_XTENSA_SLOT6_OP,
4339218822Sdim  BFD_RELOC_XTENSA_SLOT7_OP,
4340218822Sdim  BFD_RELOC_XTENSA_SLOT8_OP,
4341218822Sdim  BFD_RELOC_XTENSA_SLOT9_OP,
4342218822Sdim  BFD_RELOC_XTENSA_SLOT10_OP,
4343218822Sdim  BFD_RELOC_XTENSA_SLOT11_OP,
4344218822Sdim  BFD_RELOC_XTENSA_SLOT12_OP,
4345218822Sdim  BFD_RELOC_XTENSA_SLOT13_OP,
4346218822Sdim  BFD_RELOC_XTENSA_SLOT14_OP,
4347218822Sdim
4348218822Sdim/* Alternate Xtensa relocations.  Only the slot is encoded in the
4349218822Sdimrelocation.  The meaning of these relocations is opcode-specific.  */
4350218822Sdim  BFD_RELOC_XTENSA_SLOT0_ALT,
4351218822Sdim  BFD_RELOC_XTENSA_SLOT1_ALT,
4352218822Sdim  BFD_RELOC_XTENSA_SLOT2_ALT,
4353218822Sdim  BFD_RELOC_XTENSA_SLOT3_ALT,
4354218822Sdim  BFD_RELOC_XTENSA_SLOT4_ALT,
4355218822Sdim  BFD_RELOC_XTENSA_SLOT5_ALT,
4356218822Sdim  BFD_RELOC_XTENSA_SLOT6_ALT,
4357218822Sdim  BFD_RELOC_XTENSA_SLOT7_ALT,
4358218822Sdim  BFD_RELOC_XTENSA_SLOT8_ALT,
4359218822Sdim  BFD_RELOC_XTENSA_SLOT9_ALT,
4360218822Sdim  BFD_RELOC_XTENSA_SLOT10_ALT,
4361218822Sdim  BFD_RELOC_XTENSA_SLOT11_ALT,
4362218822Sdim  BFD_RELOC_XTENSA_SLOT12_ALT,
4363218822Sdim  BFD_RELOC_XTENSA_SLOT13_ALT,
4364218822Sdim  BFD_RELOC_XTENSA_SLOT14_ALT,
4365218822Sdim
4366218822Sdim/* Xtensa relocations for backward compatibility.  These have all been
4367218822Sdimreplaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
4368131832Sobrien  BFD_RELOC_XTENSA_OP0,
4369131832Sobrien  BFD_RELOC_XTENSA_OP1,
4370131832Sobrien  BFD_RELOC_XTENSA_OP2,
4371131832Sobrien
4372218822Sdim/* Xtensa relocation to mark that the assembler expanded the
4373131832Sobrieninstructions from an original target.  The expansion size is
4374131832Sobrienencoded in the reloc size.  */
4375131832Sobrien  BFD_RELOC_XTENSA_ASM_EXPAND,
4376131832Sobrien
4377218822Sdim/* Xtensa relocation to mark that the linker should simplify
4378218822Sdimassembler-expanded instructions.  This is commonly used
4379218822Sdiminternally by the linker after analysis of a
4380131832SobrienBFD_RELOC_XTENSA_ASM_EXPAND.  */
4381131832Sobrien  BFD_RELOC_XTENSA_ASM_SIMPLIFY,
4382218822Sdim
4383218822Sdim/* 8 bit signed offset in (ix+d) or (iy+d).  */
4384218822Sdim  BFD_RELOC_Z80_DISP8,
4385218822Sdim
4386218822Sdim/* DJNZ offset.  */
4387218822Sdim  BFD_RELOC_Z8K_DISP7,
4388218822Sdim
4389218822Sdim/* CALR offset.  */
4390218822Sdim  BFD_RELOC_Z8K_CALLR,
4391218822Sdim
4392218822Sdim/* 4 bit value.  */
4393218822Sdim  BFD_RELOC_Z8K_IMM4L,
4394131832Sobrien  BFD_RELOC_UNUSED };
4395131832Sobrientypedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
4396131832Sobrienreloc_howto_type *bfd_reloc_type_lookup
4397131832Sobrien   (bfd *abfd, bfd_reloc_code_real_type code);
4398218822Sdimreloc_howto_type *bfd_reloc_name_lookup
4399218822Sdim   (bfd *abfd, const char *reloc_name);
4400131832Sobrien
4401131832Sobrienconst char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
4402131832Sobrien
4403131832Sobrien/* Extracted from syms.c.  */
4404131832Sobrien
4405131832Sobrientypedef struct bfd_symbol
4406131832Sobrien{
4407131832Sobrien  /* A pointer to the BFD which owns the symbol. This information
4408131832Sobrien     is necessary so that a back end can work out what additional
4409131832Sobrien     information (invisible to the application writer) is carried
4410131832Sobrien     with the symbol.
4411131832Sobrien
4412131832Sobrien     This field is *almost* redundant, since you can use section->owner
4413131832Sobrien     instead, except that some symbols point to the global sections
4414131832Sobrien     bfd_{abs,com,und}_section.  This could be fixed by making
4415131832Sobrien     these globals be per-bfd (or per-target-flavor).  FIXME.  */
4416131832Sobrien  struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
4417131832Sobrien
4418131832Sobrien  /* The text of the symbol. The name is left alone, and not copied; the
4419131832Sobrien     application may not alter it.  */
4420131832Sobrien  const char *name;
4421131832Sobrien
4422131832Sobrien  /* The value of the symbol.  This really should be a union of a
4423131832Sobrien     numeric value with a pointer, since some flags indicate that
4424131832Sobrien     a pointer to another symbol is stored here.  */
4425131832Sobrien  symvalue value;
4426131832Sobrien
4427131832Sobrien  /* Attributes of a symbol.  */
4428131832Sobrien#define BSF_NO_FLAGS    0x00
4429131832Sobrien
4430131832Sobrien  /* The symbol has local scope; <<static>> in <<C>>. The value
4431131832Sobrien     is the offset into the section of the data.  */
4432131832Sobrien#define BSF_LOCAL      0x01
4433131832Sobrien
4434131832Sobrien  /* The symbol has global scope; initialized data in <<C>>. The
4435131832Sobrien     value is the offset into the section of the data.  */
4436131832Sobrien#define BSF_GLOBAL     0x02
4437131832Sobrien
4438131832Sobrien  /* The symbol has global scope and is exported. The value is
4439131832Sobrien     the offset into the section of the data.  */
4440131832Sobrien#define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
4441131832Sobrien
4442131832Sobrien  /* A normal C symbol would be one of:
4443131832Sobrien     <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
4444131832Sobrien     <<BSF_GLOBAL>>.  */
4445131832Sobrien
4446131832Sobrien  /* The symbol is a debugging record. The value has an arbitrary
4447131832Sobrien     meaning, unless BSF_DEBUGGING_RELOC is also set.  */
4448131832Sobrien#define BSF_DEBUGGING  0x08
4449131832Sobrien
4450131832Sobrien  /* The symbol denotes a function entry point.  Used in ELF,
4451131832Sobrien     perhaps others someday.  */
4452131832Sobrien#define BSF_FUNCTION    0x10
4453131832Sobrien
4454131832Sobrien  /* Used by the linker.  */
4455131832Sobrien#define BSF_KEEP        0x20
4456131832Sobrien#define BSF_KEEP_G      0x40
4457131832Sobrien
4458131832Sobrien  /* A weak global symbol, overridable without warnings by
4459131832Sobrien     a regular global symbol of the same name.  */
4460131832Sobrien#define BSF_WEAK        0x80
4461131832Sobrien
4462131832Sobrien  /* This symbol was created to point to a section, e.g. ELF's
4463131832Sobrien     STT_SECTION symbols.  */
4464131832Sobrien#define BSF_SECTION_SYM 0x100
4465131832Sobrien
4466131832Sobrien  /* The symbol used to be a common symbol, but now it is
4467131832Sobrien     allocated.  */
4468131832Sobrien#define BSF_OLD_COMMON  0x200
4469131832Sobrien
4470131832Sobrien  /* The default value for common data.  */
4471131832Sobrien#define BFD_FORT_COMM_DEFAULT_VALUE 0
4472131832Sobrien
4473131832Sobrien  /* In some files the type of a symbol sometimes alters its
4474131832Sobrien     location in an output file - ie in coff a <<ISFCN>> symbol
4475131832Sobrien     which is also <<C_EXT>> symbol appears where it was
4476131832Sobrien     declared and not at the end of a section.  This bit is set
4477131832Sobrien     by the target BFD part to convey this information.  */
4478131832Sobrien#define BSF_NOT_AT_END    0x400
4479131832Sobrien
4480131832Sobrien  /* Signal that the symbol is the label of constructor section.  */
4481131832Sobrien#define BSF_CONSTRUCTOR   0x800
4482131832Sobrien
4483131832Sobrien  /* Signal that the symbol is a warning symbol.  The name is a
4484131832Sobrien     warning.  The name of the next symbol is the one to warn about;
4485131832Sobrien     if a reference is made to a symbol with the same name as the next
4486131832Sobrien     symbol, a warning is issued by the linker.  */
4487131832Sobrien#define BSF_WARNING       0x1000
4488131832Sobrien
4489131832Sobrien  /* Signal that the symbol is indirect.  This symbol is an indirect
4490131832Sobrien     pointer to the symbol with the same name as the next symbol.  */
4491131832Sobrien#define BSF_INDIRECT      0x2000
4492131832Sobrien
4493131832Sobrien  /* BSF_FILE marks symbols that contain a file name.  This is used
4494131832Sobrien     for ELF STT_FILE symbols.  */
4495131832Sobrien#define BSF_FILE          0x4000
4496131832Sobrien
4497131832Sobrien  /* Symbol is from dynamic linking information.  */
4498131832Sobrien#define BSF_DYNAMIC       0x8000
4499131832Sobrien
4500131832Sobrien  /* The symbol denotes a data object.  Used in ELF, and perhaps
4501131832Sobrien     others someday.  */
4502131832Sobrien#define BSF_OBJECT        0x10000
4503131832Sobrien
4504131832Sobrien  /* This symbol is a debugging symbol.  The value is the offset
4505131832Sobrien     into the section of the data.  BSF_DEBUGGING should be set
4506131832Sobrien     as well.  */
4507131832Sobrien#define BSF_DEBUGGING_RELOC 0x20000
4508131832Sobrien
4509131832Sobrien  /* This symbol is thread local.  Used in ELF.  */
4510131832Sobrien#define BSF_THREAD_LOCAL  0x40000
4511131832Sobrien
4512218822Sdim  /* This symbol represents a complex relocation expression,
4513218822Sdim     with the expression tree serialized in the symbol name.  */
4514218822Sdim#define BSF_RELC 0x80000
4515218822Sdim
4516218822Sdim  /* This symbol represents a signed complex relocation expression,
4517218822Sdim     with the expression tree serialized in the symbol name.  */
4518218822Sdim#define BSF_SRELC 0x100000
4519218822Sdim
4520131832Sobrien  flagword flags;
4521131832Sobrien
4522131832Sobrien  /* A pointer to the section to which this symbol is
4523131832Sobrien     relative.  This will always be non NULL, there are special
4524131832Sobrien     sections for undefined and absolute symbols.  */
4525131832Sobrien  struct bfd_section *section;
4526131832Sobrien
4527131832Sobrien  /* Back end special data.  */
4528131832Sobrien  union
4529131832Sobrien    {
4530131832Sobrien      void *p;
4531131832Sobrien      bfd_vma i;
4532131832Sobrien    }
4533131832Sobrien  udata;
4534131832Sobrien}
4535131832Sobrienasymbol;
4536131832Sobrien
4537131832Sobrien#define bfd_get_symtab_upper_bound(abfd) \
4538131832Sobrien     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
4539131832Sobrien
4540131832Sobrienbfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
4541131832Sobrien
4542131832Sobrienbfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
4543131832Sobrien
4544131832Sobrien#define bfd_is_local_label_name(abfd, name) \
4545131832Sobrien  BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
4546131832Sobrien
4547218822Sdimbfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
4548218822Sdim
4549218822Sdim#define bfd_is_target_special_symbol(abfd, sym) \
4550218822Sdim  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
4551218822Sdim
4552131832Sobrien#define bfd_canonicalize_symtab(abfd, location) \
4553131832Sobrien  BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
4554131832Sobrien
4555131832Sobrienbfd_boolean bfd_set_symtab
4556131832Sobrien   (bfd *abfd, asymbol **location, unsigned int count);
4557131832Sobrien
4558131832Sobrienvoid bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
4559131832Sobrien
4560131832Sobrien#define bfd_make_empty_symbol(abfd) \
4561131832Sobrien  BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
4562131832Sobrien
4563131832Sobrienasymbol *_bfd_generic_make_empty_symbol (bfd *);
4564131832Sobrien
4565131832Sobrien#define bfd_make_debug_symbol(abfd,ptr,size) \
4566131832Sobrien  BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
4567131832Sobrien
4568131832Sobrienint bfd_decode_symclass (asymbol *symbol);
4569131832Sobrien
4570131832Sobrienbfd_boolean bfd_is_undefined_symclass (int symclass);
4571131832Sobrien
4572131832Sobrienvoid bfd_symbol_info (asymbol *symbol, symbol_info *ret);
4573131832Sobrien
4574131832Sobrienbfd_boolean bfd_copy_private_symbol_data
4575131832Sobrien   (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
4576131832Sobrien
4577131832Sobrien#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
4578131832Sobrien  BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
4579131832Sobrien            (ibfd, isymbol, obfd, osymbol))
4580131832Sobrien
4581131832Sobrien/* Extracted from bfd.c.  */
4582131832Sobrienstruct bfd
4583131832Sobrien{
4584131832Sobrien  /* A unique identifier of the BFD  */
4585131832Sobrien  unsigned int id;
4586131832Sobrien
4587131832Sobrien  /* The filename the application opened the BFD with.  */
4588131832Sobrien  const char *filename;
4589131832Sobrien
4590131832Sobrien  /* A pointer to the target jump table.  */
4591131832Sobrien  const struct bfd_target *xvec;
4592131832Sobrien
4593218822Sdim  /* The IOSTREAM, and corresponding IO vector that provide access
4594218822Sdim     to the file backing the BFD.  */
4595131832Sobrien  void *iostream;
4596218822Sdim  const struct bfd_iovec *iovec;
4597131832Sobrien
4598131832Sobrien  /* Is the file descriptor being cached?  That is, can it be closed as
4599131832Sobrien     needed, and re-opened when accessed later?  */
4600131832Sobrien  bfd_boolean cacheable;
4601131832Sobrien
4602131832Sobrien  /* Marks whether there was a default target specified when the
4603131832Sobrien     BFD was opened. This is used to select which matching algorithm
4604131832Sobrien     to use to choose the back end.  */
4605131832Sobrien  bfd_boolean target_defaulted;
4606131832Sobrien
4607131832Sobrien  /* The caching routines use these to maintain a
4608131832Sobrien     least-recently-used list of BFDs.  */
4609131832Sobrien  struct bfd *lru_prev, *lru_next;
4610131832Sobrien
4611131832Sobrien  /* When a file is closed by the caching routines, BFD retains
4612131832Sobrien     state information on the file here...  */
4613131832Sobrien  ufile_ptr where;
4614131832Sobrien
4615131832Sobrien  /* ... and here: (``once'' means at least once).  */
4616131832Sobrien  bfd_boolean opened_once;
4617131832Sobrien
4618131832Sobrien  /* Set if we have a locally maintained mtime value, rather than
4619131832Sobrien     getting it from the file each time.  */
4620131832Sobrien  bfd_boolean mtime_set;
4621131832Sobrien
4622131832Sobrien  /* File modified time, if mtime_set is TRUE.  */
4623131832Sobrien  long mtime;
4624131832Sobrien
4625131832Sobrien  /* Reserved for an unimplemented file locking extension.  */
4626131832Sobrien  int ifd;
4627131832Sobrien
4628131832Sobrien  /* The format which belongs to the BFD. (object, core, etc.)  */
4629131832Sobrien  bfd_format format;
4630131832Sobrien
4631131832Sobrien  /* The direction with which the BFD was opened.  */
4632131832Sobrien  enum bfd_direction
4633131832Sobrien    {
4634131832Sobrien      no_direction = 0,
4635131832Sobrien      read_direction = 1,
4636131832Sobrien      write_direction = 2,
4637131832Sobrien      both_direction = 3
4638131832Sobrien    }
4639131832Sobrien  direction;
4640131832Sobrien
4641131832Sobrien  /* Format_specific flags.  */
4642131832Sobrien  flagword flags;
4643131832Sobrien
4644131832Sobrien  /* Currently my_archive is tested before adding origin to
4645131832Sobrien     anything. I believe that this can become always an add of
4646131832Sobrien     origin, with origin set to 0 for non archive files.  */
4647131832Sobrien  ufile_ptr origin;
4648131832Sobrien
4649131832Sobrien  /* Remember when output has begun, to stop strange things
4650131832Sobrien     from happening.  */
4651131832Sobrien  bfd_boolean output_has_begun;
4652131832Sobrien
4653131832Sobrien  /* A hash table for section names.  */
4654131832Sobrien  struct bfd_hash_table section_htab;
4655131832Sobrien
4656131832Sobrien  /* Pointer to linked list of sections.  */
4657131832Sobrien  struct bfd_section *sections;
4658131832Sobrien
4659218822Sdim  /* The last section on the section list.  */
4660218822Sdim  struct bfd_section *section_last;
4661131832Sobrien
4662131832Sobrien  /* The number of sections.  */
4663131832Sobrien  unsigned int section_count;
4664131832Sobrien
4665131832Sobrien  /* Stuff only useful for object files:
4666131832Sobrien     The start address.  */
4667131832Sobrien  bfd_vma start_address;
4668131832Sobrien
4669131832Sobrien  /* Used for input and output.  */
4670131832Sobrien  unsigned int symcount;
4671131832Sobrien
4672131832Sobrien  /* Symbol table for output BFD (with symcount entries).  */
4673131832Sobrien  struct bfd_symbol  **outsymbols;
4674131832Sobrien
4675131832Sobrien  /* Used for slurped dynamic symbol tables.  */
4676131832Sobrien  unsigned int dynsymcount;
4677131832Sobrien
4678131832Sobrien  /* Pointer to structure which contains architecture information.  */
4679131832Sobrien  const struct bfd_arch_info *arch_info;
4680131832Sobrien
4681218822Sdim  /* Flag set if symbols from this BFD should not be exported.  */
4682218822Sdim  bfd_boolean no_export;
4683218822Sdim
4684131832Sobrien  /* Stuff only useful for archives.  */
4685131832Sobrien  void *arelt_data;
4686131832Sobrien  struct bfd *my_archive;      /* The containing archive BFD.  */
4687218822Sdim  struct bfd *archive_next;    /* The next BFD in the archive.  */
4688131832Sobrien  struct bfd *archive_head;    /* The first BFD in the archive.  */
4689131832Sobrien  bfd_boolean has_armap;
4690131832Sobrien
4691131832Sobrien  /* A chain of BFD structures involved in a link.  */
4692131832Sobrien  struct bfd *link_next;
4693131832Sobrien
4694131832Sobrien  /* A field used by _bfd_generic_link_add_archive_symbols.  This will
4695131832Sobrien     be used only for archive elements.  */
4696131832Sobrien  int archive_pass;
4697131832Sobrien
4698131832Sobrien  /* Used by the back end to hold private data.  */
4699131832Sobrien  union
4700131832Sobrien    {
4701131832Sobrien      struct aout_data_struct *aout_data;
4702131832Sobrien      struct artdata *aout_ar_data;
4703131832Sobrien      struct _oasys_data *oasys_obj_data;
4704131832Sobrien      struct _oasys_ar_data *oasys_ar_data;
4705131832Sobrien      struct coff_tdata *coff_obj_data;
4706131832Sobrien      struct pe_tdata *pe_obj_data;
4707131832Sobrien      struct xcoff_tdata *xcoff_obj_data;
4708131832Sobrien      struct ecoff_tdata *ecoff_obj_data;
4709131832Sobrien      struct ieee_data_struct *ieee_data;
4710131832Sobrien      struct ieee_ar_data_struct *ieee_ar_data;
4711131832Sobrien      struct srec_data_struct *srec_data;
4712131832Sobrien      struct ihex_data_struct *ihex_data;
4713131832Sobrien      struct tekhex_data_struct *tekhex_data;
4714131832Sobrien      struct elf_obj_tdata *elf_obj_data;
4715131832Sobrien      struct nlm_obj_tdata *nlm_obj_data;
4716131832Sobrien      struct bout_data_struct *bout_data;
4717131832Sobrien      struct mmo_data_struct *mmo_data;
4718131832Sobrien      struct sun_core_struct *sun_core_data;
4719131832Sobrien      struct sco5_core_struct *sco5_core_data;
4720131832Sobrien      struct trad_core_struct *trad_core_data;
4721131832Sobrien      struct som_data_struct *som_data;
4722131832Sobrien      struct hpux_core_struct *hpux_core_data;
4723131832Sobrien      struct hppabsd_core_struct *hppabsd_core_data;
4724131832Sobrien      struct sgi_core_struct *sgi_core_data;
4725131832Sobrien      struct lynx_core_struct *lynx_core_data;
4726131832Sobrien      struct osf_core_struct *osf_core_data;
4727131832Sobrien      struct cisco_core_struct *cisco_core_data;
4728131832Sobrien      struct versados_data_struct *versados_data;
4729131832Sobrien      struct netbsd_core_struct *netbsd_core_data;
4730131832Sobrien      struct mach_o_data_struct *mach_o_data;
4731131832Sobrien      struct mach_o_fat_data_struct *mach_o_fat_data;
4732131832Sobrien      struct bfd_pef_data_struct *pef_data;
4733131832Sobrien      struct bfd_pef_xlib_data_struct *pef_xlib_data;
4734131832Sobrien      struct bfd_sym_data_struct *sym_data;
4735131832Sobrien      void *any;
4736131832Sobrien    }
4737131832Sobrien  tdata;
4738131832Sobrien
4739131832Sobrien  /* Used by the application to hold private data.  */
4740131832Sobrien  void *usrdata;
4741131832Sobrien
4742131832Sobrien  /* Where all the allocated stuff under this BFD goes.  This is a
4743131832Sobrien     struct objalloc *, but we use void * to avoid requiring the inclusion
4744131832Sobrien     of objalloc.h.  */
4745131832Sobrien  void *memory;
4746131832Sobrien};
4747131832Sobrien
4748131832Sobrientypedef enum bfd_error
4749131832Sobrien{
4750131832Sobrien  bfd_error_no_error = 0,
4751131832Sobrien  bfd_error_system_call,
4752131832Sobrien  bfd_error_invalid_target,
4753131832Sobrien  bfd_error_wrong_format,
4754131832Sobrien  bfd_error_wrong_object_format,
4755131832Sobrien  bfd_error_invalid_operation,
4756131832Sobrien  bfd_error_no_memory,
4757131832Sobrien  bfd_error_no_symbols,
4758131832Sobrien  bfd_error_no_armap,
4759131832Sobrien  bfd_error_no_more_archived_files,
4760131832Sobrien  bfd_error_malformed_archive,
4761131832Sobrien  bfd_error_file_not_recognized,
4762131832Sobrien  bfd_error_file_ambiguously_recognized,
4763131832Sobrien  bfd_error_no_contents,
4764131832Sobrien  bfd_error_nonrepresentable_section,
4765131832Sobrien  bfd_error_no_debug_section,
4766131832Sobrien  bfd_error_bad_value,
4767131832Sobrien  bfd_error_file_truncated,
4768131832Sobrien  bfd_error_file_too_big,
4769218822Sdim  bfd_error_on_input,
4770131832Sobrien  bfd_error_invalid_error_code
4771131832Sobrien}
4772131832Sobrienbfd_error_type;
4773131832Sobrien
4774131832Sobrienbfd_error_type bfd_get_error (void);
4775131832Sobrien
4776218822Sdimvoid bfd_set_error (bfd_error_type error_tag, ...);
4777131832Sobrien
4778131832Sobrienconst char *bfd_errmsg (bfd_error_type error_tag);
4779131832Sobrien
4780131832Sobrienvoid bfd_perror (const char *message);
4781131832Sobrien
4782131832Sobrientypedef void (*bfd_error_handler_type) (const char *, ...);
4783131832Sobrien
4784131832Sobrienbfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
4785131832Sobrien
4786131832Sobrienvoid bfd_set_error_program_name (const char *);
4787131832Sobrien
4788131832Sobrienbfd_error_handler_type bfd_get_error_handler (void);
4789131832Sobrien
4790131832Sobrienlong bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
4791131832Sobrien
4792131832Sobrienlong bfd_canonicalize_reloc
4793131832Sobrien   (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
4794131832Sobrien
4795131832Sobrienvoid bfd_set_reloc
4796131832Sobrien   (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
4797131832Sobrien
4798131832Sobrienbfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
4799131832Sobrien
4800131832Sobrienint bfd_get_arch_size (bfd *abfd);
4801131832Sobrien
4802131832Sobrienint bfd_get_sign_extend_vma (bfd *abfd);
4803131832Sobrien
4804131832Sobrienbfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
4805131832Sobrien
4806131832Sobrienunsigned int bfd_get_gp_size (bfd *abfd);
4807131832Sobrien
4808131832Sobrienvoid bfd_set_gp_size (bfd *abfd, unsigned int i);
4809131832Sobrien
4810131832Sobrienbfd_vma bfd_scan_vma (const char *string, const char **end, int base);
4811131832Sobrien
4812218822Sdimbfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
4813218822Sdim
4814218822Sdim#define bfd_copy_private_header_data(ibfd, obfd) \
4815218822Sdim     BFD_SEND (obfd, _bfd_copy_private_header_data, \
4816218822Sdim               (ibfd, obfd))
4817131832Sobrienbfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
4818131832Sobrien
4819131832Sobrien#define bfd_copy_private_bfd_data(ibfd, obfd) \
4820131832Sobrien     BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
4821131832Sobrien               (ibfd, obfd))
4822131832Sobrienbfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
4823131832Sobrien
4824131832Sobrien#define bfd_merge_private_bfd_data(ibfd, obfd) \
4825131832Sobrien     BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
4826131832Sobrien               (ibfd, obfd))
4827131832Sobrienbfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
4828131832Sobrien
4829131832Sobrien#define bfd_set_private_flags(abfd, flags) \
4830131832Sobrien     BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
4831218822Sdim#define bfd_sizeof_headers(abfd, info) \
4832218822Sdim       BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
4833131832Sobrien
4834131832Sobrien#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
4835131832Sobrien       BFD_SEND (abfd, _bfd_find_nearest_line, \
4836131832Sobrien                 (abfd, sec, syms, off, file, func, line))
4837131832Sobrien
4838218822Sdim#define bfd_find_line(abfd, syms, sym, file, line) \
4839218822Sdim       BFD_SEND (abfd, _bfd_find_line, \
4840218822Sdim                 (abfd, syms, sym, file, line))
4841218822Sdim
4842218822Sdim#define bfd_find_inliner_info(abfd, file, func, line) \
4843218822Sdim       BFD_SEND (abfd, _bfd_find_inliner_info, \
4844218822Sdim                 (abfd, file, func, line))
4845218822Sdim
4846131832Sobrien#define bfd_debug_info_start(abfd) \
4847131832Sobrien       BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
4848131832Sobrien
4849131832Sobrien#define bfd_debug_info_end(abfd) \
4850131832Sobrien       BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
4851131832Sobrien
4852131832Sobrien#define bfd_debug_info_accumulate(abfd, section) \
4853131832Sobrien       BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
4854131832Sobrien
4855131832Sobrien#define bfd_stat_arch_elt(abfd, stat) \
4856131832Sobrien       BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
4857131832Sobrien
4858131832Sobrien#define bfd_update_armap_timestamp(abfd) \
4859131832Sobrien       BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
4860131832Sobrien
4861131832Sobrien#define bfd_set_arch_mach(abfd, arch, mach)\
4862131832Sobrien       BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
4863131832Sobrien
4864131832Sobrien#define bfd_relax_section(abfd, section, link_info, again) \
4865131832Sobrien       BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
4866131832Sobrien
4867131832Sobrien#define bfd_gc_sections(abfd, link_info) \
4868131832Sobrien       BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
4869131832Sobrien
4870131832Sobrien#define bfd_merge_sections(abfd, link_info) \
4871131832Sobrien       BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
4872131832Sobrien
4873218822Sdim#define bfd_is_group_section(abfd, sec) \
4874218822Sdim       BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
4875218822Sdim
4876131832Sobrien#define bfd_discard_group(abfd, sec) \
4877131832Sobrien       BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
4878131832Sobrien
4879131832Sobrien#define bfd_link_hash_table_create(abfd) \
4880131832Sobrien       BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
4881131832Sobrien
4882131832Sobrien#define bfd_link_hash_table_free(abfd, hash) \
4883131832Sobrien       BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
4884131832Sobrien
4885131832Sobrien#define bfd_link_add_symbols(abfd, info) \
4886131832Sobrien       BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
4887131832Sobrien
4888218822Sdim#define bfd_link_just_syms(abfd, sec, info) \
4889131832Sobrien       BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
4890131832Sobrien
4891131832Sobrien#define bfd_final_link(abfd, info) \
4892131832Sobrien       BFD_SEND (abfd, _bfd_final_link, (abfd, info))
4893131832Sobrien
4894131832Sobrien#define bfd_free_cached_info(abfd) \
4895131832Sobrien       BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
4896131832Sobrien
4897131832Sobrien#define bfd_get_dynamic_symtab_upper_bound(abfd) \
4898131832Sobrien       BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
4899131832Sobrien
4900131832Sobrien#define bfd_print_private_bfd_data(abfd, file)\
4901131832Sobrien       BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
4902131832Sobrien
4903131832Sobrien#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
4904131832Sobrien       BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
4905131832Sobrien
4906218822Sdim#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
4907218822Sdim       BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
4908218822Sdim                                                   dyncount, dynsyms, ret))
4909218822Sdim
4910131832Sobrien#define bfd_get_dynamic_reloc_upper_bound(abfd) \
4911131832Sobrien       BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
4912131832Sobrien
4913131832Sobrien#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
4914131832Sobrien       BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
4915131832Sobrien
4916131832Sobrienextern bfd_byte *bfd_get_relocated_section_contents
4917131832Sobrien  (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
4918131832Sobrien   bfd_boolean, asymbol **);
4919131832Sobrien
4920131832Sobrienbfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
4921131832Sobrien
4922131832Sobrienstruct bfd_preserve
4923131832Sobrien{
4924131832Sobrien  void *marker;
4925131832Sobrien  void *tdata;
4926131832Sobrien  flagword flags;
4927131832Sobrien  const struct bfd_arch_info *arch_info;
4928131832Sobrien  struct bfd_section *sections;
4929218822Sdim  struct bfd_section *section_last;
4930131832Sobrien  unsigned int section_count;
4931131832Sobrien  struct bfd_hash_table section_htab;
4932131832Sobrien};
4933131832Sobrien
4934131832Sobrienbfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
4935131832Sobrien
4936131832Sobrienvoid bfd_preserve_restore (bfd *, struct bfd_preserve *);
4937131832Sobrien
4938131832Sobrienvoid bfd_preserve_finish (bfd *, struct bfd_preserve *);
4939131832Sobrien
4940218822Sdimbfd_vma bfd_emul_get_maxpagesize (const char *);
4941218822Sdim
4942218822Sdimvoid bfd_emul_set_maxpagesize (const char *, bfd_vma);
4943218822Sdim
4944218822Sdimbfd_vma bfd_emul_get_commonpagesize (const char *);
4945218822Sdim
4946218822Sdimvoid bfd_emul_set_commonpagesize (const char *, bfd_vma);
4947218822Sdim
4948218822Sdimchar *bfd_demangle (bfd *, const char *, int);
4949218822Sdim
4950131832Sobrien/* Extracted from archive.c.  */
4951131832Sobriensymindex bfd_get_next_mapent
4952131832Sobrien   (bfd *abfd, symindex previous, carsym **sym);
4953131832Sobrien
4954131832Sobrienbfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
4955131832Sobrien
4956131832Sobrienbfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
4957131832Sobrien
4958131832Sobrien/* Extracted from corefile.c.  */
4959131832Sobrienconst char *bfd_core_file_failing_command (bfd *abfd);
4960131832Sobrien
4961131832Sobrienint bfd_core_file_failing_signal (bfd *abfd);
4962131832Sobrien
4963131832Sobrienbfd_boolean core_file_matches_executable_p
4964131832Sobrien   (bfd *core_bfd, bfd *exec_bfd);
4965131832Sobrien
4966218822Sdimbfd_boolean generic_core_file_matches_executable_p
4967218822Sdim   (bfd *core_bfd, bfd *exec_bfd);
4968218822Sdim
4969131832Sobrien/* Extracted from targets.c.  */
4970131832Sobrien#define BFD_SEND(bfd, message, arglist) \
4971131832Sobrien  ((*((bfd)->xvec->message)) arglist)
4972131832Sobrien
4973131832Sobrien#ifdef DEBUG_BFD_SEND
4974131832Sobrien#undef BFD_SEND
4975131832Sobrien#define BFD_SEND(bfd, message, arglist) \
4976131832Sobrien  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
4977131832Sobrien    ((*((bfd)->xvec->message)) arglist) : \
4978131832Sobrien    (bfd_assert (__FILE__,__LINE__), NULL))
4979131832Sobrien#endif
4980131832Sobrien#define BFD_SEND_FMT(bfd, message, arglist) \
4981131832Sobrien  (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
4982131832Sobrien
4983131832Sobrien#ifdef DEBUG_BFD_SEND
4984131832Sobrien#undef BFD_SEND_FMT
4985131832Sobrien#define BFD_SEND_FMT(bfd, message, arglist) \
4986131832Sobrien  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
4987131832Sobrien   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
4988131832Sobrien   (bfd_assert (__FILE__,__LINE__), NULL))
4989131832Sobrien#endif
4990131832Sobrien
4991131832Sobrienenum bfd_flavour
4992131832Sobrien{
4993131832Sobrien  bfd_target_unknown_flavour,
4994131832Sobrien  bfd_target_aout_flavour,
4995131832Sobrien  bfd_target_coff_flavour,
4996131832Sobrien  bfd_target_ecoff_flavour,
4997131832Sobrien  bfd_target_xcoff_flavour,
4998131832Sobrien  bfd_target_elf_flavour,
4999131832Sobrien  bfd_target_ieee_flavour,
5000131832Sobrien  bfd_target_nlm_flavour,
5001131832Sobrien  bfd_target_oasys_flavour,
5002131832Sobrien  bfd_target_tekhex_flavour,
5003131832Sobrien  bfd_target_srec_flavour,
5004131832Sobrien  bfd_target_ihex_flavour,
5005131832Sobrien  bfd_target_som_flavour,
5006131832Sobrien  bfd_target_os9k_flavour,
5007131832Sobrien  bfd_target_versados_flavour,
5008131832Sobrien  bfd_target_msdos_flavour,
5009131832Sobrien  bfd_target_ovax_flavour,
5010131832Sobrien  bfd_target_evax_flavour,
5011131832Sobrien  bfd_target_mmo_flavour,
5012131832Sobrien  bfd_target_mach_o_flavour,
5013131832Sobrien  bfd_target_pef_flavour,
5014131832Sobrien  bfd_target_pef_xlib_flavour,
5015131832Sobrien  bfd_target_sym_flavour
5016131832Sobrien};
5017131832Sobrien
5018131832Sobrienenum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
5019131832Sobrien
5020131832Sobrien/* Forward declaration.  */
5021131832Sobrientypedef struct bfd_link_info _bfd_link_info;
5022131832Sobrien
5023131832Sobrientypedef struct bfd_target
5024131832Sobrien{
5025131832Sobrien  /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
5026131832Sobrien  char *name;
5027131832Sobrien
5028131832Sobrien /* The "flavour" of a back end is a general indication about
5029131832Sobrien    the contents of a file.  */
5030131832Sobrien  enum bfd_flavour flavour;
5031131832Sobrien
5032131832Sobrien  /* The order of bytes within the data area of a file.  */
5033131832Sobrien  enum bfd_endian byteorder;
5034131832Sobrien
5035131832Sobrien /* The order of bytes within the header parts of a file.  */
5036131832Sobrien  enum bfd_endian header_byteorder;
5037131832Sobrien
5038131832Sobrien  /* A mask of all the flags which an executable may have set -
5039131832Sobrien     from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
5040131832Sobrien  flagword object_flags;
5041131832Sobrien
5042131832Sobrien /* A mask of all the flags which a section may have set - from
5043131832Sobrien    the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
5044131832Sobrien  flagword section_flags;
5045131832Sobrien
5046131832Sobrien /* The character normally found at the front of a symbol.
5047131832Sobrien    (if any), perhaps `_'.  */
5048131832Sobrien  char symbol_leading_char;
5049131832Sobrien
5050131832Sobrien /* The pad character for file names within an archive header.  */
5051131832Sobrien  char ar_pad_char;
5052131832Sobrien
5053131832Sobrien  /* The maximum number of characters in an archive header.  */
5054131832Sobrien  unsigned short ar_max_namelen;
5055131832Sobrien
5056131832Sobrien  /* Entries for byte swapping for data. These are different from the
5057218822Sdim     other entry points, since they don't take a BFD as the first argument.
5058131832Sobrien     Certain other handlers could do the same.  */
5059131832Sobrien  bfd_uint64_t   (*bfd_getx64) (const void *);
5060131832Sobrien  bfd_int64_t    (*bfd_getx_signed_64) (const void *);
5061131832Sobrien  void           (*bfd_putx64) (bfd_uint64_t, void *);
5062131832Sobrien  bfd_vma        (*bfd_getx32) (const void *);
5063131832Sobrien  bfd_signed_vma (*bfd_getx_signed_32) (const void *);
5064131832Sobrien  void           (*bfd_putx32) (bfd_vma, void *);
5065131832Sobrien  bfd_vma        (*bfd_getx16) (const void *);
5066131832Sobrien  bfd_signed_vma (*bfd_getx_signed_16) (const void *);
5067131832Sobrien  void           (*bfd_putx16) (bfd_vma, void *);
5068131832Sobrien
5069131832Sobrien  /* Byte swapping for the headers.  */
5070131832Sobrien  bfd_uint64_t   (*bfd_h_getx64) (const void *);
5071131832Sobrien  bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
5072131832Sobrien  void           (*bfd_h_putx64) (bfd_uint64_t, void *);
5073131832Sobrien  bfd_vma        (*bfd_h_getx32) (const void *);
5074131832Sobrien  bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
5075131832Sobrien  void           (*bfd_h_putx32) (bfd_vma, void *);
5076131832Sobrien  bfd_vma        (*bfd_h_getx16) (const void *);
5077131832Sobrien  bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
5078131832Sobrien  void           (*bfd_h_putx16) (bfd_vma, void *);
5079131832Sobrien
5080131832Sobrien  /* Format dependent routines: these are vectors of entry points
5081131832Sobrien     within the target vector structure, one for each format to check.  */
5082131832Sobrien
5083131832Sobrien  /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
5084131832Sobrien  const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
5085131832Sobrien
5086131832Sobrien  /* Set the format of a file being written.  */
5087131832Sobrien  bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
5088131832Sobrien
5089131832Sobrien  /* Write cached information into a file being written, at <<bfd_close>>.  */
5090131832Sobrien  bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
5091131832Sobrien
5092131832Sobrien
5093131832Sobrien  /* Generic entry points.  */
5094131832Sobrien#define BFD_JUMP_TABLE_GENERIC(NAME) \
5095131832Sobrien  NAME##_close_and_cleanup, \
5096131832Sobrien  NAME##_bfd_free_cached_info, \
5097131832Sobrien  NAME##_new_section_hook, \
5098131832Sobrien  NAME##_get_section_contents, \
5099131832Sobrien  NAME##_get_section_contents_in_window
5100131832Sobrien
5101131832Sobrien  /* Called when the BFD is being closed to do any necessary cleanup.  */
5102131832Sobrien  bfd_boolean (*_close_and_cleanup) (bfd *);
5103131832Sobrien  /* Ask the BFD to free all cached information.  */
5104131832Sobrien  bfd_boolean (*_bfd_free_cached_info) (bfd *);
5105131832Sobrien  /* Called when a new section is created.  */
5106131832Sobrien  bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
5107131832Sobrien  /* Read the contents of a section.  */
5108131832Sobrien  bfd_boolean (*_bfd_get_section_contents)
5109131832Sobrien    (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
5110131832Sobrien  bfd_boolean (*_bfd_get_section_contents_in_window)
5111131832Sobrien    (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
5112131832Sobrien
5113131832Sobrien  /* Entry points to copy private data.  */
5114131832Sobrien#define BFD_JUMP_TABLE_COPY(NAME) \
5115131832Sobrien  NAME##_bfd_copy_private_bfd_data, \
5116131832Sobrien  NAME##_bfd_merge_private_bfd_data, \
5117218822Sdim  _bfd_generic_init_private_section_data, \
5118131832Sobrien  NAME##_bfd_copy_private_section_data, \
5119131832Sobrien  NAME##_bfd_copy_private_symbol_data, \
5120218822Sdim  NAME##_bfd_copy_private_header_data, \
5121131832Sobrien  NAME##_bfd_set_private_flags, \
5122131832Sobrien  NAME##_bfd_print_private_bfd_data
5123131832Sobrien
5124131832Sobrien  /* Called to copy BFD general private data from one object file
5125131832Sobrien     to another.  */
5126131832Sobrien  bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
5127131832Sobrien  /* Called to merge BFD general private data from one object file
5128131832Sobrien     to a common output file when linking.  */
5129131832Sobrien  bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
5130218822Sdim  /* Called to initialize BFD private section data from one object file
5131218822Sdim     to another.  */
5132218822Sdim#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
5133218822Sdim  BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
5134218822Sdim  bfd_boolean (*_bfd_init_private_section_data)
5135218822Sdim    (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
5136131832Sobrien  /* Called to copy BFD private section data from one object file
5137131832Sobrien     to another.  */
5138131832Sobrien  bfd_boolean (*_bfd_copy_private_section_data)
5139131832Sobrien    (bfd *, sec_ptr, bfd *, sec_ptr);
5140131832Sobrien  /* Called to copy BFD private symbol data from one symbol
5141131832Sobrien     to another.  */
5142131832Sobrien  bfd_boolean (*_bfd_copy_private_symbol_data)
5143131832Sobrien    (bfd *, asymbol *, bfd *, asymbol *);
5144218822Sdim  /* Called to copy BFD private header data from one object file
5145218822Sdim     to another.  */
5146218822Sdim  bfd_boolean (*_bfd_copy_private_header_data)
5147218822Sdim    (bfd *, bfd *);
5148131832Sobrien  /* Called to set private backend flags.  */
5149131832Sobrien  bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
5150131832Sobrien
5151131832Sobrien  /* Called to print private BFD data.  */
5152131832Sobrien  bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
5153131832Sobrien
5154131832Sobrien  /* Core file entry points.  */
5155131832Sobrien#define BFD_JUMP_TABLE_CORE(NAME) \
5156131832Sobrien  NAME##_core_file_failing_command, \
5157131832Sobrien  NAME##_core_file_failing_signal, \
5158131832Sobrien  NAME##_core_file_matches_executable_p
5159131832Sobrien
5160131832Sobrien  char *      (*_core_file_failing_command) (bfd *);
5161131832Sobrien  int         (*_core_file_failing_signal) (bfd *);
5162131832Sobrien  bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
5163131832Sobrien
5164131832Sobrien  /* Archive entry points.  */
5165131832Sobrien#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
5166131832Sobrien  NAME##_slurp_armap, \
5167131832Sobrien  NAME##_slurp_extended_name_table, \
5168131832Sobrien  NAME##_construct_extended_name_table, \
5169131832Sobrien  NAME##_truncate_arname, \
5170131832Sobrien  NAME##_write_armap, \
5171131832Sobrien  NAME##_read_ar_hdr, \
5172131832Sobrien  NAME##_openr_next_archived_file, \
5173131832Sobrien  NAME##_get_elt_at_index, \
5174131832Sobrien  NAME##_generic_stat_arch_elt, \
5175131832Sobrien  NAME##_update_armap_timestamp
5176131832Sobrien
5177131832Sobrien  bfd_boolean (*_bfd_slurp_armap) (bfd *);
5178131832Sobrien  bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
5179131832Sobrien  bfd_boolean (*_bfd_construct_extended_name_table)
5180131832Sobrien    (bfd *, char **, bfd_size_type *, const char **);
5181131832Sobrien  void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
5182131832Sobrien  bfd_boolean (*write_armap)
5183131832Sobrien    (bfd *, unsigned int, struct orl *, unsigned int, int);
5184131832Sobrien  void *      (*_bfd_read_ar_hdr_fn) (bfd *);
5185131832Sobrien  bfd *       (*openr_next_archived_file) (bfd *, bfd *);
5186131832Sobrien#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
5187131832Sobrien  bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
5188131832Sobrien  int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
5189131832Sobrien  bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
5190131832Sobrien
5191131832Sobrien  /* Entry points used for symbols.  */
5192131832Sobrien#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
5193131832Sobrien  NAME##_get_symtab_upper_bound, \
5194131832Sobrien  NAME##_canonicalize_symtab, \
5195131832Sobrien  NAME##_make_empty_symbol, \
5196131832Sobrien  NAME##_print_symbol, \
5197131832Sobrien  NAME##_get_symbol_info, \
5198131832Sobrien  NAME##_bfd_is_local_label_name, \
5199218822Sdim  NAME##_bfd_is_target_special_symbol, \
5200131832Sobrien  NAME##_get_lineno, \
5201131832Sobrien  NAME##_find_nearest_line, \
5202218822Sdim  _bfd_generic_find_line, \
5203218822Sdim  NAME##_find_inliner_info, \
5204131832Sobrien  NAME##_bfd_make_debug_symbol, \
5205131832Sobrien  NAME##_read_minisymbols, \
5206131832Sobrien  NAME##_minisymbol_to_symbol
5207131832Sobrien
5208131832Sobrien  long        (*_bfd_get_symtab_upper_bound) (bfd *);
5209131832Sobrien  long        (*_bfd_canonicalize_symtab)
5210131832Sobrien    (bfd *, struct bfd_symbol **);
5211131832Sobrien  struct bfd_symbol *
5212131832Sobrien              (*_bfd_make_empty_symbol) (bfd *);
5213131832Sobrien  void        (*_bfd_print_symbol)
5214131832Sobrien    (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
5215131832Sobrien#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
5216131832Sobrien  void        (*_bfd_get_symbol_info)
5217131832Sobrien    (bfd *, struct bfd_symbol *, symbol_info *);
5218131832Sobrien#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
5219131832Sobrien  bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
5220218822Sdim  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
5221131832Sobrien  alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
5222131832Sobrien  bfd_boolean (*_bfd_find_nearest_line)
5223131832Sobrien    (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
5224131832Sobrien     const char **, const char **, unsigned int *);
5225218822Sdim  bfd_boolean (*_bfd_find_line)
5226218822Sdim    (bfd *, struct bfd_symbol **, struct bfd_symbol *,
5227218822Sdim     const char **, unsigned int *);
5228218822Sdim  bfd_boolean (*_bfd_find_inliner_info)
5229218822Sdim    (bfd *, const char **, const char **, unsigned int *);
5230131832Sobrien /* Back-door to allow format-aware applications to create debug symbols
5231131832Sobrien    while using BFD for everything else.  Currently used by the assembler
5232131832Sobrien    when creating COFF files.  */
5233131832Sobrien  asymbol *   (*_bfd_make_debug_symbol)
5234131832Sobrien    (bfd *, void *, unsigned long size);
5235131832Sobrien#define bfd_read_minisymbols(b, d, m, s) \
5236131832Sobrien  BFD_SEND (b, _read_minisymbols, (b, d, m, s))
5237131832Sobrien  long        (*_read_minisymbols)
5238131832Sobrien    (bfd *, bfd_boolean, void **, unsigned int *);
5239131832Sobrien#define bfd_minisymbol_to_symbol(b, d, m, f) \
5240131832Sobrien  BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
5241131832Sobrien  asymbol *   (*_minisymbol_to_symbol)
5242131832Sobrien    (bfd *, bfd_boolean, const void *, asymbol *);
5243131832Sobrien
5244131832Sobrien  /* Routines for relocs.  */
5245131832Sobrien#define BFD_JUMP_TABLE_RELOCS(NAME) \
5246131832Sobrien  NAME##_get_reloc_upper_bound, \
5247131832Sobrien  NAME##_canonicalize_reloc, \
5248218822Sdim  NAME##_bfd_reloc_type_lookup, \
5249218822Sdim  NAME##_bfd_reloc_name_lookup
5250131832Sobrien
5251131832Sobrien  long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
5252131832Sobrien  long        (*_bfd_canonicalize_reloc)
5253131832Sobrien    (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
5254131832Sobrien  /* See documentation on reloc types.  */
5255131832Sobrien  reloc_howto_type *
5256131832Sobrien              (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
5257218822Sdim  reloc_howto_type *
5258218822Sdim              (*reloc_name_lookup) (bfd *, const char *);
5259131832Sobrien
5260218822Sdim
5261131832Sobrien  /* Routines used when writing an object file.  */
5262131832Sobrien#define BFD_JUMP_TABLE_WRITE(NAME) \
5263131832Sobrien  NAME##_set_arch_mach, \
5264131832Sobrien  NAME##_set_section_contents
5265131832Sobrien
5266131832Sobrien  bfd_boolean (*_bfd_set_arch_mach)
5267131832Sobrien    (bfd *, enum bfd_architecture, unsigned long);
5268131832Sobrien  bfd_boolean (*_bfd_set_section_contents)
5269131832Sobrien    (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
5270131832Sobrien
5271131832Sobrien  /* Routines used by the linker.  */
5272131832Sobrien#define BFD_JUMP_TABLE_LINK(NAME) \
5273131832Sobrien  NAME##_sizeof_headers, \
5274131832Sobrien  NAME##_bfd_get_relocated_section_contents, \
5275131832Sobrien  NAME##_bfd_relax_section, \
5276131832Sobrien  NAME##_bfd_link_hash_table_create, \
5277131832Sobrien  NAME##_bfd_link_hash_table_free, \
5278131832Sobrien  NAME##_bfd_link_add_symbols, \
5279131832Sobrien  NAME##_bfd_link_just_syms, \
5280131832Sobrien  NAME##_bfd_final_link, \
5281131832Sobrien  NAME##_bfd_link_split_section, \
5282131832Sobrien  NAME##_bfd_gc_sections, \
5283131832Sobrien  NAME##_bfd_merge_sections, \
5284218822Sdim  NAME##_bfd_is_group_section, \
5285218822Sdim  NAME##_bfd_discard_group, \
5286218822Sdim  NAME##_section_already_linked \
5287131832Sobrien
5288218822Sdim  int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
5289131832Sobrien  bfd_byte *  (*_bfd_get_relocated_section_contents)
5290131832Sobrien    (bfd *, struct bfd_link_info *, struct bfd_link_order *,
5291131832Sobrien     bfd_byte *, bfd_boolean, struct bfd_symbol **);
5292131832Sobrien
5293131832Sobrien  bfd_boolean (*_bfd_relax_section)
5294131832Sobrien    (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
5295131832Sobrien
5296131832Sobrien  /* Create a hash table for the linker.  Different backends store
5297131832Sobrien     different information in this table.  */
5298131832Sobrien  struct bfd_link_hash_table *
5299131832Sobrien              (*_bfd_link_hash_table_create) (bfd *);
5300131832Sobrien
5301131832Sobrien  /* Release the memory associated with the linker hash table.  */
5302131832Sobrien  void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
5303131832Sobrien
5304131832Sobrien  /* Add symbols from this object file into the hash table.  */
5305131832Sobrien  bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
5306131832Sobrien
5307131832Sobrien  /* Indicate that we are only retrieving symbol values from this section.  */
5308131832Sobrien  void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
5309131832Sobrien
5310131832Sobrien  /* Do a link based on the link_order structures attached to each
5311131832Sobrien     section of the BFD.  */
5312131832Sobrien  bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
5313131832Sobrien
5314131832Sobrien  /* Should this section be split up into smaller pieces during linking.  */
5315131832Sobrien  bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
5316131832Sobrien
5317131832Sobrien  /* Remove sections that are not referenced from the output.  */
5318131832Sobrien  bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
5319131832Sobrien
5320131832Sobrien  /* Attempt to merge SEC_MERGE sections.  */
5321131832Sobrien  bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
5322131832Sobrien
5323218822Sdim  /* Is this section a member of a group?  */
5324218822Sdim  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
5325218822Sdim
5326131832Sobrien  /* Discard members of a group.  */
5327131832Sobrien  bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
5328131832Sobrien
5329218822Sdim  /* Check if SEC has been already linked during a reloceatable or
5330218822Sdim     final link.  */
5331218822Sdim  void (*_section_already_linked) (bfd *, struct bfd_section *,
5332218822Sdim                                   struct bfd_link_info *);
5333218822Sdim
5334131832Sobrien  /* Routines to handle dynamic symbols and relocs.  */
5335131832Sobrien#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
5336131832Sobrien  NAME##_get_dynamic_symtab_upper_bound, \
5337131832Sobrien  NAME##_canonicalize_dynamic_symtab, \
5338218822Sdim  NAME##_get_synthetic_symtab, \
5339131832Sobrien  NAME##_get_dynamic_reloc_upper_bound, \
5340131832Sobrien  NAME##_canonicalize_dynamic_reloc
5341131832Sobrien
5342131832Sobrien  /* Get the amount of memory required to hold the dynamic symbols.  */
5343131832Sobrien  long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
5344131832Sobrien  /* Read in the dynamic symbols.  */
5345131832Sobrien  long        (*_bfd_canonicalize_dynamic_symtab)
5346131832Sobrien    (bfd *, struct bfd_symbol **);
5347218822Sdim  /* Create synthetized symbols.  */
5348218822Sdim  long        (*_bfd_get_synthetic_symtab)
5349218822Sdim    (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
5350218822Sdim     struct bfd_symbol **);
5351131832Sobrien  /* Get the amount of memory required to hold the dynamic relocs.  */
5352131832Sobrien  long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
5353131832Sobrien  /* Read in the dynamic relocs.  */
5354131832Sobrien  long        (*_bfd_canonicalize_dynamic_reloc)
5355131832Sobrien    (bfd *, arelent **, struct bfd_symbol **);
5356131832Sobrien
5357131832Sobrien  /* Opposite endian version of this target.  */
5358131832Sobrien  const struct bfd_target * alternative_target;
5359131832Sobrien
5360131832Sobrien  /* Data for use by back-end routines, which isn't
5361131832Sobrien     generic enough to belong in this structure.  */
5362131832Sobrien  const void *backend_data;
5363131832Sobrien
5364131832Sobrien} bfd_target;
5365131832Sobrien
5366131832Sobrienbfd_boolean bfd_set_default_target (const char *name);
5367131832Sobrien
5368131832Sobrienconst bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
5369131832Sobrien
5370131832Sobrienconst char ** bfd_target_list (void);
5371131832Sobrien
5372131832Sobrienconst bfd_target *bfd_search_for_target
5373131832Sobrien   (int (*search_func) (const bfd_target *, void *),
5374131832Sobrien    void *);
5375131832Sobrien
5376131832Sobrien/* Extracted from format.c.  */
5377131832Sobrienbfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
5378131832Sobrien
5379131832Sobrienbfd_boolean bfd_check_format_matches
5380131832Sobrien   (bfd *abfd, bfd_format format, char ***matching);
5381131832Sobrien
5382131832Sobrienbfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
5383131832Sobrien
5384131832Sobrienconst char *bfd_format_string (bfd_format format);
5385131832Sobrien
5386131832Sobrien/* Extracted from linker.c.  */
5387131832Sobrienbfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
5388131832Sobrien
5389131832Sobrien#define bfd_link_split_section(abfd, sec) \
5390131832Sobrien       BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
5391131832Sobrien
5392218822Sdimvoid bfd_section_already_linked (bfd *abfd, asection *sec,
5393218822Sdim    struct bfd_link_info *info);
5394218822Sdim
5395218822Sdim#define bfd_section_already_linked(abfd, sec, info) \
5396218822Sdim       BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
5397218822Sdim
5398131832Sobrien/* Extracted from simple.c.  */
5399131832Sobrienbfd_byte *bfd_simple_get_relocated_section_contents
5400131832Sobrien   (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
5401131832Sobrien
5402131832Sobrien#ifdef __cplusplus
5403131832Sobrien}
5404131832Sobrien#endif
5405131832Sobrien#endif
5406