1440a403fSchristos /* This file is automatically generated.  DO NOT EDIT! */
2*b88e3e88Schristos /* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp  */
306324dcfSchristos /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
4440a403fSchristos 
5440a403fSchristos /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
6440a403fSchristos    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
7440a403fSchristos    "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
8440a403fSchristos    "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
9440a403fSchristos    "linker.c", "simple.c" and "compress.c".
10440a403fSchristos    Run "make headers" in your build bfd/ to regenerate.  */
11440a403fSchristos 
12440a403fSchristos /* Main header file for the bfd library -- portable access to object files.
13440a403fSchristos 
14*b88e3e88Schristos    Copyright (C) 1990-2020 Free Software Foundation, Inc.
15440a403fSchristos 
16440a403fSchristos    Contributed by Cygnus Support.
17440a403fSchristos 
18440a403fSchristos    This file is part of BFD, the Binary File Descriptor library.
19440a403fSchristos 
20440a403fSchristos    This program is free software; you can redistribute it and/or modify
21440a403fSchristos    it under the terms of the GNU General Public License as published by
22440a403fSchristos    the Free Software Foundation; either version 3 of the License, or
23440a403fSchristos    (at your option) any later version.
24440a403fSchristos 
25440a403fSchristos    This program is distributed in the hope that it will be useful,
26440a403fSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
27440a403fSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28440a403fSchristos    GNU General Public License for more details.
29440a403fSchristos 
30440a403fSchristos    You should have received a copy of the GNU General Public License
31440a403fSchristos    along with this program; if not, write to the Free Software
32440a403fSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
33440a403fSchristos 
34440a403fSchristos #ifndef __BFD_H_SEEN__
35440a403fSchristos #define __BFD_H_SEEN__
36440a403fSchristos 
37440a403fSchristos /* PR 14072: Ensure that config.h is included first.  */
38440a403fSchristos #if !defined PACKAGE && !defined PACKAGE_VERSION
39440a403fSchristos #error config.h must be included before this header
40440a403fSchristos #endif
41440a403fSchristos 
42440a403fSchristos #ifdef __cplusplus
43440a403fSchristos extern "C" {
44440a403fSchristos #endif
45440a403fSchristos 
46440a403fSchristos #include "ansidecl.h"
47440a403fSchristos #include "symcat.h"
48*b88e3e88Schristos #include "bfd_stdint.h"
4906324dcfSchristos #include "diagnostics.h"
5006324dcfSchristos #include <stdarg.h>
51440a403fSchristos #include <sys/stat.h>
52440a403fSchristos 
53440a403fSchristos #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
54440a403fSchristos #ifndef SABER
55440a403fSchristos /* This hack is to avoid a problem with some strict ANSI C preprocessors.
56440a403fSchristos    The problem is, "32_" is not a valid preprocessing token, and we don't
57440a403fSchristos    want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
58440a403fSchristos    cause the inner CONCAT2 macros to be evaluated first, producing
59440a403fSchristos    still-valid pp-tokens.  Then the final concatenation can be done.  */
60440a403fSchristos #undef CONCAT4
61440a403fSchristos #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
62440a403fSchristos #endif
63440a403fSchristos #endif
64440a403fSchristos 
65440a403fSchristos /* This is a utility macro to handle the situation where the code
66440a403fSchristos    wants to place a constant string into the code, followed by a
67440a403fSchristos    comma and then the length of the string.  Doing this by hand
68440a403fSchristos    is error prone, so using this macro is safer.  */
69440a403fSchristos #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
70440a403fSchristos /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
71440a403fSchristos    to create the arguments to another macro, since the preprocessor
72440a403fSchristos    will mis-count the number of arguments to the outer macro (by not
73440a403fSchristos    evaluating STRING_COMMA_LEN and so missing the comma).  This is a
74440a403fSchristos    problem for example when trying to use STRING_COMMA_LEN to build
75440a403fSchristos    the arguments to the strncmp() macro.  Hence this alternative
76440a403fSchristos    definition of strncmp is provided here.
77440a403fSchristos 
78440a403fSchristos    Note - these macros do NOT work if STR2 is not a constant string.  */
79440a403fSchristos #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
80440a403fSchristos   /* strcpy() can have a similar problem, but since we know we are
81440a403fSchristos      copying a constant string, we can use memcpy which will be faster
82440a403fSchristos      since there is no need to check for a NUL byte inside STR.  We
83440a403fSchristos      can also save time if we do not need to copy the terminating NUL.  */
84440a403fSchristos #define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
85440a403fSchristos #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
86440a403fSchristos 
87440a403fSchristos 
88440a403fSchristos #define BFD_SUPPORTS_PLUGINS 1
89440a403fSchristos 
90440a403fSchristos /* The word size used by BFD on the host.  This may be 64 with a 32
91440a403fSchristos    bit target if the host is 64 bit, or if other 64 bit targets have
92440a403fSchristos    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
93440a403fSchristos #define BFD_ARCH_SIZE 64
94440a403fSchristos 
95440a403fSchristos /* The word size of the default bfd target.  */
96440a403fSchristos #define BFD_DEFAULT_TARGET_SIZE 64
97440a403fSchristos 
98440a403fSchristos #define BFD_HOST_64BIT_LONG 0
99440a403fSchristos #define BFD_HOST_64BIT_LONG_LONG 1
100440a403fSchristos #if 1
101440a403fSchristos #define BFD_HOST_64_BIT long long
102440a403fSchristos #define BFD_HOST_U_64_BIT unsigned long long
103440a403fSchristos typedef BFD_HOST_64_BIT bfd_int64_t;
104440a403fSchristos typedef BFD_HOST_U_64_BIT bfd_uint64_t;
105440a403fSchristos #endif
106440a403fSchristos 
10706324dcfSchristos #ifdef HAVE_INTTYPES_H
10806324dcfSchristos # include <inttypes.h>
10906324dcfSchristos #else
11006324dcfSchristos # if BFD_HOST_64BIT_LONG
11106324dcfSchristos #  define BFD_PRI64 "l"
11206324dcfSchristos # elif defined (__MSVCRT__)
11306324dcfSchristos #  define BFD_PRI64 "I64"
11406324dcfSchristos # else
11506324dcfSchristos #  define BFD_PRI64 "ll"
11606324dcfSchristos # endif
11706324dcfSchristos # undef PRId64
11806324dcfSchristos # define PRId64 BFD_PRI64 "d"
11906324dcfSchristos # undef PRIu64
12006324dcfSchristos # define PRIu64 BFD_PRI64 "u"
12106324dcfSchristos # undef PRIx64
12206324dcfSchristos # define PRIx64 BFD_PRI64 "x"
12306324dcfSchristos #endif
12406324dcfSchristos 
125440a403fSchristos #if BFD_ARCH_SIZE >= 64
126440a403fSchristos #define BFD64
127440a403fSchristos #endif
128440a403fSchristos 
129440a403fSchristos #ifndef INLINE
130440a403fSchristos #if __GNUC__ >= 2
131440a403fSchristos #define INLINE __inline__
132440a403fSchristos #else
133440a403fSchristos #define INLINE
134440a403fSchristos #endif
135440a403fSchristos #endif
136440a403fSchristos 
137440a403fSchristos /* Declaring a type wide enough to hold a host long and a host pointer.  */
138440a403fSchristos #define BFD_HOSTPTR_T unsigned long
139440a403fSchristos typedef BFD_HOSTPTR_T bfd_hostptr_t;
140440a403fSchristos 
141440a403fSchristos /* Forward declaration.  */
142440a403fSchristos typedef struct bfd bfd;
143440a403fSchristos 
144440a403fSchristos /* Boolean type used in bfd.  Too many systems define their own
145440a403fSchristos    versions of "boolean" for us to safely typedef a "boolean" of
146440a403fSchristos    our own.  Using an enum for "bfd_boolean" has its own set of
147440a403fSchristos    problems, with strange looking casts required to avoid warnings
148440a403fSchristos    on some older compilers.  Thus we just use an int.
149440a403fSchristos 
150440a403fSchristos    General rule: Functions which are bfd_boolean return TRUE on
151440a403fSchristos    success and FALSE on failure (unless they're a predicate).  */
152440a403fSchristos 
153440a403fSchristos typedef int bfd_boolean;
154440a403fSchristos #undef FALSE
155440a403fSchristos #undef TRUE
156440a403fSchristos #define FALSE 0
157440a403fSchristos #define TRUE 1
158440a403fSchristos 
159440a403fSchristos #ifdef BFD64
160440a403fSchristos 
161440a403fSchristos #ifndef BFD_HOST_64_BIT
162440a403fSchristos  #error No 64 bit integer type available
163440a403fSchristos #endif /* ! defined (BFD_HOST_64_BIT) */
164440a403fSchristos 
165440a403fSchristos typedef BFD_HOST_U_64_BIT bfd_vma;
166440a403fSchristos typedef BFD_HOST_64_BIT bfd_signed_vma;
167440a403fSchristos typedef BFD_HOST_U_64_BIT bfd_size_type;
168440a403fSchristos typedef BFD_HOST_U_64_BIT symvalue;
169440a403fSchristos 
170440a403fSchristos #if BFD_HOST_64BIT_LONG
171440a403fSchristos #define BFD_VMA_FMT "l"
172440a403fSchristos #elif defined (__MSVCRT__)
173440a403fSchristos #define BFD_VMA_FMT "I64"
174440a403fSchristos #else
175440a403fSchristos #define BFD_VMA_FMT "ll"
176440a403fSchristos #endif
177440a403fSchristos 
178440a403fSchristos #ifndef fprintf_vma
179440a403fSchristos #define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
180440a403fSchristos #define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
181440a403fSchristos #endif
182440a403fSchristos 
183440a403fSchristos #else /* not BFD64  */
184440a403fSchristos 
185440a403fSchristos /* Represent a target address.  Also used as a generic unsigned type
186440a403fSchristos    which is guaranteed to be big enough to hold any arithmetic types
187440a403fSchristos    we need to deal with.  */
188440a403fSchristos typedef unsigned long bfd_vma;
189440a403fSchristos 
190440a403fSchristos /* A generic signed type which is guaranteed to be big enough to hold any
191440a403fSchristos    arithmetic types we need to deal with.  Can be assumed to be compatible
192440a403fSchristos    with bfd_vma in the same way that signed and unsigned ints are compatible
193440a403fSchristos    (as parameters, in assignment, etc).  */
194440a403fSchristos typedef long bfd_signed_vma;
195440a403fSchristos 
196440a403fSchristos typedef unsigned long symvalue;
197440a403fSchristos typedef unsigned long bfd_size_type;
198440a403fSchristos 
199440a403fSchristos /* Print a bfd_vma x on stream s.  */
200440a403fSchristos #define BFD_VMA_FMT "l"
201440a403fSchristos #define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
202440a403fSchristos #define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
203440a403fSchristos 
204440a403fSchristos #endif /* not BFD64  */
205440a403fSchristos 
206440a403fSchristos #define HALF_BFD_SIZE_TYPE \
207440a403fSchristos   (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
208440a403fSchristos 
209440a403fSchristos #ifndef BFD_HOST_64_BIT
210440a403fSchristos /* Fall back on a 32 bit type.  The idea is to make these types always
211440a403fSchristos    available for function return types, but in the case that
212440a403fSchristos    BFD_HOST_64_BIT is undefined such a function should abort or
213440a403fSchristos    otherwise signal an error.  */
214440a403fSchristos typedef bfd_signed_vma bfd_int64_t;
215440a403fSchristos typedef bfd_vma bfd_uint64_t;
216440a403fSchristos #endif
217440a403fSchristos 
218440a403fSchristos /* An offset into a file.  BFD always uses the largest possible offset
219440a403fSchristos    based on the build time availability of fseek, fseeko, or fseeko64.  */
220440a403fSchristos typedef BFD_HOST_64_BIT file_ptr;
221440a403fSchristos typedef unsigned BFD_HOST_64_BIT ufile_ptr;
222440a403fSchristos 
223440a403fSchristos extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
224440a403fSchristos extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
225440a403fSchristos 
226440a403fSchristos #define printf_vma(x) fprintf_vma(stdout,x)
227440a403fSchristos #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
228440a403fSchristos 
229440a403fSchristos typedef unsigned int flagword;	/* 32 bits of flags */
230440a403fSchristos typedef unsigned char bfd_byte;
231440a403fSchristos 
232440a403fSchristos /* File formats.  */
233440a403fSchristos 
234440a403fSchristos typedef enum bfd_format
235440a403fSchristos {
236440a403fSchristos   bfd_unknown = 0,	/* File format is unknown.  */
237440a403fSchristos   bfd_object,		/* Linker/assembler/compiler output.  */
238440a403fSchristos   bfd_archive,		/* Object archive file.  */
239440a403fSchristos   bfd_core,		/* Core dump.  */
240440a403fSchristos   bfd_type_end		/* Marks the end; don't use it!  */
241440a403fSchristos }
242440a403fSchristos bfd_format;
243440a403fSchristos 
244440a403fSchristos /* Symbols and relocation.  */
245440a403fSchristos 
246440a403fSchristos /* A count of carsyms (canonical archive symbols).  */
247440a403fSchristos typedef unsigned long symindex;
248440a403fSchristos 
249440a403fSchristos #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
250440a403fSchristos 
251440a403fSchristos /* A canonical archive symbol.  */
252440a403fSchristos /* This is a type pun with struct ranlib on purpose!  */
253440a403fSchristos typedef struct carsym
254440a403fSchristos {
255*b88e3e88Schristos   const char *name;
256440a403fSchristos   file_ptr file_offset;	/* Look here to find the file.  */
257440a403fSchristos }
258440a403fSchristos carsym;			/* To make these you call a carsymogen.  */
259440a403fSchristos 
260440a403fSchristos /* Used in generating armaps (archive tables of contents).
261440a403fSchristos    Perhaps just a forward definition would do?  */
262440a403fSchristos struct orl		/* Output ranlib.  */
263440a403fSchristos {
264440a403fSchristos   char **name;		/* Symbol name.  */
265440a403fSchristos   union
266440a403fSchristos   {
267440a403fSchristos     file_ptr pos;
268440a403fSchristos     bfd *abfd;
269440a403fSchristos   } u;			/* bfd* or file position.  */
270440a403fSchristos   int namidx;		/* Index into string table.  */
271440a403fSchristos };
27206324dcfSchristos 
273440a403fSchristos /* Linenumber stuff.  */
274440a403fSchristos typedef struct lineno_cache_entry
275440a403fSchristos {
276440a403fSchristos   unsigned int line_number;	/* Linenumber from start of function.  */
277440a403fSchristos   union
278440a403fSchristos   {
279440a403fSchristos     struct bfd_symbol *sym;	/* Function name.  */
280440a403fSchristos     bfd_vma offset;		/* Offset into section.  */
281440a403fSchristos   } u;
282440a403fSchristos }
283440a403fSchristos alent;
284440a403fSchristos 
285440a403fSchristos /* Object and core file sections.  */
28606324dcfSchristos typedef struct bfd_section *sec_ptr;
287440a403fSchristos 
288440a403fSchristos #define	align_power(addr, align)	\
289440a403fSchristos   (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
290440a403fSchristos 
29106324dcfSchristos /* Align an address upward to a boundary, expressed as a number of bytes.
29206324dcfSchristos    E.g. align to an 8-byte boundary with argument of 8.  Take care never
29306324dcfSchristos    to wrap around if the address is within boundary-1 of the end of the
29406324dcfSchristos    address space.  */
29506324dcfSchristos #define BFD_ALIGN(this, boundary)					  \
29606324dcfSchristos   ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))		  \
29706324dcfSchristos    ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
29806324dcfSchristos    : ~ (bfd_vma) 0)
299440a403fSchristos 
300440a403fSchristos typedef enum bfd_print_symbol
301440a403fSchristos {
302440a403fSchristos   bfd_print_symbol_name,
303440a403fSchristos   bfd_print_symbol_more,
304440a403fSchristos   bfd_print_symbol_all
305440a403fSchristos } bfd_print_symbol_type;
306440a403fSchristos 
307440a403fSchristos /* Information about a symbol that nm needs.  */
308440a403fSchristos 
309440a403fSchristos typedef struct _symbol_info
310440a403fSchristos {
311440a403fSchristos   symvalue value;
312440a403fSchristos   char type;
313440a403fSchristos   const char *name;		/* Symbol name.  */
314440a403fSchristos   unsigned char stab_type;	/* Stab type.  */
315440a403fSchristos   char stab_other;		/* Stab other.  */
316440a403fSchristos   short stab_desc;		/* Stab desc.  */
317440a403fSchristos   const char *stab_name;	/* String for stab type.  */
318440a403fSchristos } symbol_info;
319440a403fSchristos 
320440a403fSchristos /* Get the name of a stabs type code.  */
321440a403fSchristos 
322440a403fSchristos extern const char *bfd_get_stab_name (int);
323440a403fSchristos 
324440a403fSchristos /* Hash table routines.  There is no way to free up a hash table.  */
325440a403fSchristos 
326440a403fSchristos /* An element in the hash table.  Most uses will actually use a larger
327440a403fSchristos    structure, and an instance of this will be the first field.  */
328440a403fSchristos 
329440a403fSchristos struct bfd_hash_entry
330440a403fSchristos {
331440a403fSchristos   /* Next entry for this hash code.  */
332440a403fSchristos   struct bfd_hash_entry *next;
333440a403fSchristos   /* String being hashed.  */
334440a403fSchristos   const char *string;
335440a403fSchristos   /* Hash code.  This is the full hash code, not the index into the
336440a403fSchristos      table.  */
337440a403fSchristos   unsigned long hash;
338440a403fSchristos };
339440a403fSchristos 
340440a403fSchristos /* A hash table.  */
341440a403fSchristos 
342440a403fSchristos struct bfd_hash_table
343440a403fSchristos {
344440a403fSchristos   /* The hash array.  */
345440a403fSchristos   struct bfd_hash_entry **table;
346440a403fSchristos   /* A function used to create new elements in the hash table.  The
347440a403fSchristos      first entry is itself a pointer to an element.  When this
348440a403fSchristos      function is first invoked, this pointer will be NULL.  However,
349440a403fSchristos      having the pointer permits a hierarchy of method functions to be
350440a403fSchristos      built each of which calls the function in the superclass.  Thus
351440a403fSchristos      each function should be written to allocate a new block of memory
352440a403fSchristos      only if the argument is NULL.  */
353440a403fSchristos   struct bfd_hash_entry *(*newfunc)
354440a403fSchristos     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
355440a403fSchristos   /* An objalloc for this hash table.  This is a struct objalloc *,
356440a403fSchristos      but we use void * to avoid requiring the inclusion of objalloc.h.  */
357440a403fSchristos   void *memory;
358440a403fSchristos   /* The number of slots in the hash table.  */
359440a403fSchristos   unsigned int size;
360440a403fSchristos   /* The number of entries in the hash table.  */
361440a403fSchristos   unsigned int count;
362440a403fSchristos   /* The size of elements.  */
363440a403fSchristos   unsigned int entsize;
364440a403fSchristos   /* If non-zero, don't grow the hash table.  */
365440a403fSchristos   unsigned int frozen:1;
366440a403fSchristos };
367440a403fSchristos 
368440a403fSchristos /* Initialize a hash table.  */
369440a403fSchristos extern bfd_boolean bfd_hash_table_init
370440a403fSchristos   (struct bfd_hash_table *,
371440a403fSchristos    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
372440a403fSchristos 			       struct bfd_hash_table *,
373440a403fSchristos 			       const char *),
374440a403fSchristos    unsigned int);
375440a403fSchristos 
376440a403fSchristos /* Initialize a hash table specifying a size.  */
377440a403fSchristos extern bfd_boolean bfd_hash_table_init_n
378440a403fSchristos   (struct bfd_hash_table *,
379440a403fSchristos    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
380440a403fSchristos 			       struct bfd_hash_table *,
381440a403fSchristos 			       const char *),
382440a403fSchristos    unsigned int, unsigned int);
383440a403fSchristos 
384440a403fSchristos /* Free up a hash table.  */
385440a403fSchristos extern void bfd_hash_table_free
386440a403fSchristos   (struct bfd_hash_table *);
387440a403fSchristos 
388440a403fSchristos /* Look up a string in a hash table.  If CREATE is TRUE, a new entry
389440a403fSchristos    will be created for this string if one does not already exist.  The
390440a403fSchristos    COPY argument must be TRUE if this routine should copy the string
391440a403fSchristos    into newly allocated memory when adding an entry.  */
392440a403fSchristos extern struct bfd_hash_entry *bfd_hash_lookup
393440a403fSchristos   (struct bfd_hash_table *, const char *, bfd_boolean create,
394440a403fSchristos    bfd_boolean copy);
395440a403fSchristos 
396440a403fSchristos /* Insert an entry in a hash table.  */
397440a403fSchristos extern struct bfd_hash_entry *bfd_hash_insert
398440a403fSchristos   (struct bfd_hash_table *, const char *, unsigned long);
399440a403fSchristos 
400440a403fSchristos /* Rename an entry in a hash table.  */
401440a403fSchristos extern void bfd_hash_rename
402440a403fSchristos   (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
403440a403fSchristos 
404440a403fSchristos /* Replace an entry in a hash table.  */
405440a403fSchristos extern void bfd_hash_replace
406440a403fSchristos   (struct bfd_hash_table *, struct bfd_hash_entry *old,
407440a403fSchristos    struct bfd_hash_entry *nw);
408440a403fSchristos 
409440a403fSchristos /* Base method for creating a hash table entry.  */
410440a403fSchristos extern struct bfd_hash_entry *bfd_hash_newfunc
411440a403fSchristos   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
412440a403fSchristos 
413440a403fSchristos /* Grab some space for a hash table entry.  */
414440a403fSchristos extern void *bfd_hash_allocate
415440a403fSchristos   (struct bfd_hash_table *, unsigned int);
416440a403fSchristos 
417440a403fSchristos /* Traverse a hash table in a random order, calling a function on each
418440a403fSchristos    element.  If the function returns FALSE, the traversal stops.  The
419440a403fSchristos    INFO argument is passed to the function.  */
420440a403fSchristos extern void bfd_hash_traverse
421440a403fSchristos   (struct bfd_hash_table *,
422440a403fSchristos    bfd_boolean (*) (struct bfd_hash_entry *, void *),
423440a403fSchristos    void *info);
424440a403fSchristos 
425440a403fSchristos /* Allows the default size of a hash table to be configured. New hash
426440a403fSchristos    tables allocated using bfd_hash_table_init will be created with
427440a403fSchristos    this size.  */
428440a403fSchristos extern unsigned long bfd_hash_set_default_size (unsigned long);
429440a403fSchristos 
430440a403fSchristos /* Types of compressed DWARF debug sections.  We currently support
431440a403fSchristos    zlib.  */
432440a403fSchristos enum compressed_debug_section_type
433440a403fSchristos {
434440a403fSchristos   COMPRESS_DEBUG_NONE = 0,
435440a403fSchristos   COMPRESS_DEBUG = 1 << 0,
436440a403fSchristos   COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
437440a403fSchristos   COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
438440a403fSchristos };
439440a403fSchristos 
440440a403fSchristos /* This structure is used to keep track of stabs in sections
441440a403fSchristos    information while linking.  */
442440a403fSchristos 
443440a403fSchristos struct stab_info
444440a403fSchristos {
445440a403fSchristos   /* A hash table used to hold stabs strings.  */
446440a403fSchristos   struct bfd_strtab_hash *strings;
447440a403fSchristos   /* The header file hash table.  */
448440a403fSchristos   struct bfd_hash_table includes;
449440a403fSchristos   /* The first .stabstr section.  */
450440a403fSchristos   struct bfd_section *stabstr;
451440a403fSchristos };
452440a403fSchristos 
453440a403fSchristos #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
454440a403fSchristos 
455440a403fSchristos /* User program access to BFD facilities.  */
456440a403fSchristos 
457440a403fSchristos /* Direct I/O routines, for programs which know more about the object
458440a403fSchristos    file than BFD does.  Use higher level routines if possible.  */
459440a403fSchristos 
460440a403fSchristos extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
461440a403fSchristos extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
462440a403fSchristos extern int bfd_seek (bfd *, file_ptr, int);
463440a403fSchristos extern file_ptr bfd_tell (bfd *);
464440a403fSchristos extern int bfd_flush (bfd *);
465440a403fSchristos extern int bfd_stat (bfd *, struct stat *);
466440a403fSchristos 
467440a403fSchristos /* Deprecated old routines.  */
468440a403fSchristos #if __GNUC__
469440a403fSchristos #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
47006324dcfSchristos   (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),	\
471440a403fSchristos    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
472440a403fSchristos #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
47306324dcfSchristos   (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
474440a403fSchristos    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
475440a403fSchristos #else
476440a403fSchristos #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
47706324dcfSchristos   (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
478440a403fSchristos    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
479440a403fSchristos #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
48006324dcfSchristos   (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
481440a403fSchristos    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
482440a403fSchristos #endif
48306324dcfSchristos extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
484440a403fSchristos 
485440a403fSchristos extern bfd_boolean bfd_cache_close
486440a403fSchristos   (bfd *abfd);
487440a403fSchristos /* NB: This declaration should match the autogenerated one in libbfd.h.  */
488440a403fSchristos 
489440a403fSchristos extern bfd_boolean bfd_cache_close_all (void);
490440a403fSchristos 
491440a403fSchristos extern bfd_boolean bfd_record_phdr
492440a403fSchristos   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
493440a403fSchristos    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
494440a403fSchristos 
495440a403fSchristos /* Byte swapping routines.  */
496440a403fSchristos 
497440a403fSchristos bfd_uint64_t bfd_getb64 (const void *);
498440a403fSchristos bfd_uint64_t bfd_getl64 (const void *);
499440a403fSchristos bfd_int64_t bfd_getb_signed_64 (const void *);
500440a403fSchristos bfd_int64_t bfd_getl_signed_64 (const void *);
501440a403fSchristos bfd_vma bfd_getb32 (const void *);
502440a403fSchristos bfd_vma bfd_getl32 (const void *);
503440a403fSchristos bfd_signed_vma bfd_getb_signed_32 (const void *);
504440a403fSchristos bfd_signed_vma bfd_getl_signed_32 (const void *);
505440a403fSchristos bfd_vma bfd_getb16 (const void *);
506440a403fSchristos bfd_vma bfd_getl16 (const void *);
507440a403fSchristos bfd_signed_vma bfd_getb_signed_16 (const void *);
508440a403fSchristos bfd_signed_vma bfd_getl_signed_16 (const void *);
509440a403fSchristos void bfd_putb64 (bfd_uint64_t, void *);
510440a403fSchristos void bfd_putl64 (bfd_uint64_t, void *);
511440a403fSchristos void bfd_putb32 (bfd_vma, void *);
512440a403fSchristos void bfd_putl32 (bfd_vma, void *);
51306324dcfSchristos void bfd_putb24 (bfd_vma, void *);
51406324dcfSchristos void bfd_putl24 (bfd_vma, void *);
515440a403fSchristos void bfd_putb16 (bfd_vma, void *);
516440a403fSchristos void bfd_putl16 (bfd_vma, void *);
517440a403fSchristos 
518440a403fSchristos /* Byte swapping routines which take size and endiannes as arguments.  */
519440a403fSchristos 
520440a403fSchristos bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
521440a403fSchristos void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
522440a403fSchristos 
523440a403fSchristos 
524440a403fSchristos /* mmap hacks */
525440a403fSchristos 
526440a403fSchristos struct _bfd_window_internal;
527440a403fSchristos typedef struct _bfd_window_internal bfd_window_internal;
528440a403fSchristos 
529440a403fSchristos typedef struct _bfd_window
530440a403fSchristos {
531440a403fSchristos   /* What the user asked for.  */
532440a403fSchristos   void *data;
533440a403fSchristos   bfd_size_type size;
534440a403fSchristos   /* The actual window used by BFD.  Small user-requested read-only
535440a403fSchristos      regions sharing a page may share a single window into the object
536440a403fSchristos      file.  Read-write versions shouldn't until I've fixed things to
537440a403fSchristos      keep track of which portions have been claimed by the
538440a403fSchristos      application; don't want to give the same region back when the
539440a403fSchristos      application wants two writable copies!  */
540440a403fSchristos   struct _bfd_window_internal *i;
541440a403fSchristos }
542440a403fSchristos bfd_window;
543440a403fSchristos 
544440a403fSchristos extern void bfd_init_window
545440a403fSchristos   (bfd_window *);
546440a403fSchristos extern void bfd_free_window
547440a403fSchristos   (bfd_window *);
548440a403fSchristos extern bfd_boolean bfd_get_file_window
549440a403fSchristos   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
550*b88e3e88Schristos 
551*b88e3e88Schristos /* Externally visible ELF routines.  */
552440a403fSchristos 
553*b88e3e88Schristos /* Create a new BFD as if by bfd_openr.  Rather than opening a file,
554*b88e3e88Schristos    reconstruct an ELF file by reading the segments out of remote
555*b88e3e88Schristos    memory based on the ELF file header at EHDR_VMA and the ELF program
556*b88e3e88Schristos    headers it points to.  If non-zero, SIZE is the known extent of the
557*b88e3e88Schristos    object.  If not null, *LOADBASEP is filled in with the difference
558*b88e3e88Schristos    between the VMAs from which the segments were read, and the VMAs
559*b88e3e88Schristos    the file headers (and hence BFD's idea of each section's VMA) put
560*b88e3e88Schristos    them at.
561440a403fSchristos 
562*b88e3e88Schristos    The function TARGET_READ_MEMORY is called to copy LEN bytes from
563*b88e3e88Schristos    the remote memory at target address VMA into the local buffer at
564*b88e3e88Schristos    MYADDR; it should return zero on success or an `errno' code on
565*b88e3e88Schristos    failure.  TEMPL must be a BFD for a target with the word size and
566*b88e3e88Schristos    byte order found in the remote memory.  */
567*b88e3e88Schristos extern bfd *bfd_elf_bfd_from_remote_memory
568*b88e3e88Schristos   (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
569*b88e3e88Schristos    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
570*b88e3e88Schristos 			      bfd_size_type len));
571440a403fSchristos 
572*b88e3e88Schristos /* Forward declarations.  */
573*b88e3e88Schristos struct ecoff_debug_info;
574*b88e3e88Schristos struct ecoff_debug_swap;
575*b88e3e88Schristos struct ecoff_extr;
576*b88e3e88Schristos struct bfd_link_info;
577*b88e3e88Schristos struct bfd_link_hash_entry;
578440a403fSchristos /* Extracted from init.c.  */
579*b88e3e88Schristos unsigned int bfd_init (void);
580440a403fSchristos 
581*b88e3e88Schristos 
582*b88e3e88Schristos /* Value returned by bfd_init.  */
583*b88e3e88Schristos 
584*b88e3e88Schristos #define BFD_INIT_MAGIC (sizeof (struct bfd_section))
585440a403fSchristos /* Extracted from opncls.c.  */
586440a403fSchristos /* Set to N to open the next N BFDs using an alternate id space.  */
587440a403fSchristos extern unsigned int bfd_use_reserved_id;
588440a403fSchristos bfd *bfd_fopen (const char *filename, const char *target,
589440a403fSchristos     const char *mode, int fd);
590440a403fSchristos 
591440a403fSchristos bfd *bfd_openr (const char *filename, const char *target);
592440a403fSchristos 
593440a403fSchristos bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
594440a403fSchristos 
59506324dcfSchristos bfd *bfd_openstreamr (const char * filename, const char * target,
59606324dcfSchristos     void * stream);
597440a403fSchristos 
598440a403fSchristos bfd *bfd_openr_iovec (const char *filename, const char *target,
599440a403fSchristos     void *(*open_func) (struct bfd *nbfd,
600440a403fSchristos     void *open_closure),
601440a403fSchristos     void *open_closure,
602440a403fSchristos     file_ptr (*pread_func) (struct bfd *nbfd,
603440a403fSchristos     void *stream,
604440a403fSchristos     void *buf,
605440a403fSchristos     file_ptr nbytes,
606440a403fSchristos     file_ptr offset),
607440a403fSchristos     int (*close_func) (struct bfd *nbfd,
608440a403fSchristos     void *stream),
609440a403fSchristos     int (*stat_func) (struct bfd *abfd,
610440a403fSchristos     void *stream,
611440a403fSchristos     struct stat *sb));
612440a403fSchristos 
613440a403fSchristos bfd *bfd_openw (const char *filename, const char *target);
614440a403fSchristos 
615440a403fSchristos bfd_boolean bfd_close (bfd *abfd);
616440a403fSchristos 
617440a403fSchristos bfd_boolean bfd_close_all_done (bfd *);
618440a403fSchristos 
619440a403fSchristos bfd *bfd_create (const char *filename, bfd *templ);
620440a403fSchristos 
621440a403fSchristos bfd_boolean bfd_make_writable (bfd *abfd);
622440a403fSchristos 
623440a403fSchristos bfd_boolean bfd_make_readable (bfd *abfd);
624440a403fSchristos 
625440a403fSchristos void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
626440a403fSchristos 
627440a403fSchristos void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
628440a403fSchristos 
629440a403fSchristos unsigned long bfd_calc_gnu_debuglink_crc32
630440a403fSchristos    (unsigned long crc, const unsigned char *buf, bfd_size_type len);
631440a403fSchristos 
632440a403fSchristos char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
633440a403fSchristos 
634440a403fSchristos char *bfd_get_alt_debug_link_info (bfd * abfd,
635440a403fSchristos     bfd_size_type *buildid_len,
636440a403fSchristos     bfd_byte **buildid_out);
637440a403fSchristos 
638440a403fSchristos char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
639440a403fSchristos 
640440a403fSchristos char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
641440a403fSchristos 
642440a403fSchristos struct bfd_section *bfd_create_gnu_debuglink_section
643440a403fSchristos    (bfd *abfd, const char *filename);
644440a403fSchristos 
645440a403fSchristos bfd_boolean bfd_fill_in_gnu_debuglink_section
646440a403fSchristos    (bfd *abfd, struct bfd_section *sect, const char *filename);
647440a403fSchristos 
64806324dcfSchristos char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
64906324dcfSchristos 
650*b88e3e88Schristos void bfd_set_filename (bfd *abfd, char *filename);
651*b88e3e88Schristos 
652440a403fSchristos /* Extracted from libbfd.c.  */
653440a403fSchristos 
654440a403fSchristos /* Byte swapping macros for user section data.  */
655440a403fSchristos 
656440a403fSchristos #define bfd_put_8(abfd, val, ptr) \
657440a403fSchristos   ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
658440a403fSchristos #define bfd_put_signed_8 \
659440a403fSchristos   bfd_put_8
660440a403fSchristos #define bfd_get_8(abfd, ptr) \
661*b88e3e88Schristos   ((bfd_vma) *(const unsigned char *) (ptr) & 0xff)
662440a403fSchristos #define bfd_get_signed_8(abfd, ptr) \
663*b88e3e88Schristos   ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
664440a403fSchristos 
665440a403fSchristos #define bfd_put_16(abfd, val, ptr) \
666440a403fSchristos   BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
667440a403fSchristos #define bfd_put_signed_16 \
668440a403fSchristos   bfd_put_16
669440a403fSchristos #define bfd_get_16(abfd, ptr) \
670440a403fSchristos   BFD_SEND (abfd, bfd_getx16, (ptr))
671440a403fSchristos #define bfd_get_signed_16(abfd, ptr) \
672440a403fSchristos   BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
673440a403fSchristos 
674*b88e3e88Schristos #define bfd_put_24(abfd, val, ptr) \
675*b88e3e88Schristos   do                                   \
676*b88e3e88Schristos     if (bfd_big_endian (abfd))         \
677*b88e3e88Schristos       bfd_putb24 ((val), (ptr));       \
678*b88e3e88Schristos     else                               \
679*b88e3e88Schristos       bfd_putl24 ((val), (ptr));       \
680*b88e3e88Schristos   while (0)
681*b88e3e88Schristos 
682*b88e3e88Schristos bfd_vma bfd_getb24 (const void *p);
683*b88e3e88Schristos bfd_vma bfd_getl24 (const void *p);
684*b88e3e88Schristos 
685*b88e3e88Schristos #define bfd_get_24(abfd, ptr) \
686*b88e3e88Schristos   (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
687*b88e3e88Schristos 
688440a403fSchristos #define bfd_put_32(abfd, val, ptr) \
689440a403fSchristos   BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
690440a403fSchristos #define bfd_put_signed_32 \
691440a403fSchristos   bfd_put_32
692440a403fSchristos #define bfd_get_32(abfd, ptr) \
693440a403fSchristos   BFD_SEND (abfd, bfd_getx32, (ptr))
694440a403fSchristos #define bfd_get_signed_32(abfd, ptr) \
695440a403fSchristos   BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
696440a403fSchristos 
697440a403fSchristos #define bfd_put_64(abfd, val, ptr) \
698440a403fSchristos   BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
699440a403fSchristos #define bfd_put_signed_64 \
700440a403fSchristos   bfd_put_64
701440a403fSchristos #define bfd_get_64(abfd, ptr) \
702440a403fSchristos   BFD_SEND (abfd, bfd_getx64, (ptr))
703440a403fSchristos #define bfd_get_signed_64(abfd, ptr) \
704440a403fSchristos   BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
705440a403fSchristos 
706440a403fSchristos #define bfd_get(bits, abfd, ptr)                       \
707*b88e3e88Schristos   ((bits) == 8 ? bfd_get_8 (abfd, ptr)                 \
708440a403fSchristos    : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
709440a403fSchristos    : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
710440a403fSchristos    : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
711440a403fSchristos    : (abort (), (bfd_vma) - 1))
712440a403fSchristos 
713440a403fSchristos #define bfd_put(bits, abfd, val, ptr)                  \
714440a403fSchristos   ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
715440a403fSchristos    : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)        \
716440a403fSchristos    : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)        \
717440a403fSchristos    : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)        \
718440a403fSchristos    : (abort (), (void) 0))
719440a403fSchristos 
720440a403fSchristos 
721440a403fSchristos /* Byte swapping macros for file header data.  */
722440a403fSchristos 
723440a403fSchristos #define bfd_h_put_8(abfd, val, ptr) \
724440a403fSchristos   bfd_put_8 (abfd, val, ptr)
725440a403fSchristos #define bfd_h_put_signed_8(abfd, val, ptr) \
726440a403fSchristos   bfd_put_8 (abfd, val, ptr)
727440a403fSchristos #define bfd_h_get_8(abfd, ptr) \
728440a403fSchristos   bfd_get_8 (abfd, ptr)
729440a403fSchristos #define bfd_h_get_signed_8(abfd, ptr) \
730440a403fSchristos   bfd_get_signed_8 (abfd, ptr)
731440a403fSchristos 
732440a403fSchristos #define bfd_h_put_16(abfd, val, ptr) \
733440a403fSchristos   BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
734440a403fSchristos #define bfd_h_put_signed_16 \
735440a403fSchristos   bfd_h_put_16
736440a403fSchristos #define bfd_h_get_16(abfd, ptr) \
737440a403fSchristos   BFD_SEND (abfd, bfd_h_getx16, (ptr))
738440a403fSchristos #define bfd_h_get_signed_16(abfd, ptr) \
739440a403fSchristos   BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
740440a403fSchristos 
741440a403fSchristos #define bfd_h_put_32(abfd, val, ptr) \
742440a403fSchristos   BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
743440a403fSchristos #define bfd_h_put_signed_32 \
744440a403fSchristos   bfd_h_put_32
745440a403fSchristos #define bfd_h_get_32(abfd, ptr) \
746440a403fSchristos   BFD_SEND (abfd, bfd_h_getx32, (ptr))
747440a403fSchristos #define bfd_h_get_signed_32(abfd, ptr) \
748440a403fSchristos   BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
749440a403fSchristos 
750440a403fSchristos #define bfd_h_put_64(abfd, val, ptr) \
751440a403fSchristos   BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
752440a403fSchristos #define bfd_h_put_signed_64 \
753440a403fSchristos   bfd_h_put_64
754440a403fSchristos #define bfd_h_get_64(abfd, ptr) \
755440a403fSchristos   BFD_SEND (abfd, bfd_h_getx64, (ptr))
756440a403fSchristos #define bfd_h_get_signed_64(abfd, ptr) \
757440a403fSchristos   BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
758440a403fSchristos 
759440a403fSchristos /* Aliases for the above, which should eventually go away.  */
760440a403fSchristos 
761440a403fSchristos #define H_PUT_64  bfd_h_put_64
762440a403fSchristos #define H_PUT_32  bfd_h_put_32
763440a403fSchristos #define H_PUT_16  bfd_h_put_16
764440a403fSchristos #define H_PUT_8   bfd_h_put_8
765440a403fSchristos #define H_PUT_S64 bfd_h_put_signed_64
766440a403fSchristos #define H_PUT_S32 bfd_h_put_signed_32
767440a403fSchristos #define H_PUT_S16 bfd_h_put_signed_16
768440a403fSchristos #define H_PUT_S8  bfd_h_put_signed_8
769440a403fSchristos #define H_GET_64  bfd_h_get_64
770440a403fSchristos #define H_GET_32  bfd_h_get_32
771440a403fSchristos #define H_GET_16  bfd_h_get_16
772440a403fSchristos #define H_GET_8   bfd_h_get_8
773440a403fSchristos #define H_GET_S64 bfd_h_get_signed_64
774440a403fSchristos #define H_GET_S32 bfd_h_get_signed_32
775440a403fSchristos #define H_GET_S16 bfd_h_get_signed_16
776440a403fSchristos #define H_GET_S8  bfd_h_get_signed_8
777440a403fSchristos 
778440a403fSchristos 
779440a403fSchristos /* Extracted from bfdio.c.  */
780440a403fSchristos long bfd_get_mtime (bfd *abfd);
781440a403fSchristos 
78206324dcfSchristos ufile_ptr bfd_get_size (bfd *abfd);
78306324dcfSchristos 
78406324dcfSchristos ufile_ptr bfd_get_file_size (bfd *abfd);
785440a403fSchristos 
786440a403fSchristos void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
787440a403fSchristos     int prot, int flags, file_ptr offset,
788440a403fSchristos     void **map_addr, bfd_size_type *map_len);
789440a403fSchristos 
790440a403fSchristos /* Extracted from bfdwin.c.  */
791440a403fSchristos /* Extracted from section.c.  */
792440a403fSchristos 
793440a403fSchristos typedef struct bfd_section
794440a403fSchristos {
795440a403fSchristos   /* The name of the section; the name isn't a copy, the pointer is
796440a403fSchristos      the same as that passed to bfd_make_section.  */
797440a403fSchristos   const char *name;
798440a403fSchristos 
799440a403fSchristos   /* A unique sequence number.  */
800440a403fSchristos   unsigned int id;
801440a403fSchristos 
802440a403fSchristos   /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
803440a403fSchristos   unsigned int index;
804440a403fSchristos 
805440a403fSchristos   /* The next section in the list belonging to the BFD, or NULL.  */
806440a403fSchristos   struct bfd_section *next;
807440a403fSchristos 
808440a403fSchristos   /* The previous section in the list belonging to the BFD, or NULL.  */
809440a403fSchristos   struct bfd_section *prev;
810440a403fSchristos 
811440a403fSchristos   /* The field flags contains attributes of the section. Some
812440a403fSchristos      flags are read in from the object file, and some are
813440a403fSchristos      synthesized from other information.  */
814440a403fSchristos   flagword flags;
815440a403fSchristos 
81606324dcfSchristos #define SEC_NO_FLAGS                      0x0
817440a403fSchristos 
818440a403fSchristos   /* Tells the OS to allocate space for this section when loading.
819440a403fSchristos      This is clear for a section containing debug information only.  */
82006324dcfSchristos #define SEC_ALLOC                         0x1
821440a403fSchristos 
822440a403fSchristos   /* Tells the OS to load the section from the file when loading.
823440a403fSchristos      This is clear for a .bss section.  */
82406324dcfSchristos #define SEC_LOAD                          0x2
825440a403fSchristos 
826440a403fSchristos   /* The section contains data still to be relocated, so there is
827440a403fSchristos      some relocation information too.  */
82806324dcfSchristos #define SEC_RELOC                         0x4
829440a403fSchristos 
830440a403fSchristos   /* A signal to the OS that the section contains read only data.  */
83106324dcfSchristos #define SEC_READONLY                      0x8
832440a403fSchristos 
833440a403fSchristos   /* The section contains code only.  */
83406324dcfSchristos #define SEC_CODE                         0x10
835440a403fSchristos 
836440a403fSchristos   /* The section contains data only.  */
83706324dcfSchristos #define SEC_DATA                         0x20
838440a403fSchristos 
839440a403fSchristos   /* The section will reside in ROM.  */
84006324dcfSchristos #define SEC_ROM                          0x40
841440a403fSchristos 
842440a403fSchristos   /* The section contains constructor information. This section
843440a403fSchristos      type is used by the linker to create lists of constructors and
844440a403fSchristos      destructors used by <<g++>>. When a back end sees a symbol
845440a403fSchristos      which should be used in a constructor list, it creates a new
846440a403fSchristos      section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
847440a403fSchristos      the symbol to it, and builds a relocation. To build the lists
848440a403fSchristos      of constructors, all the linker has to do is catenate all the
849440a403fSchristos      sections called <<__CTOR_LIST__>> and relocate the data
850440a403fSchristos      contained within - exactly the operations it would peform on
851440a403fSchristos      standard data.  */
85206324dcfSchristos #define SEC_CONSTRUCTOR                  0x80
853440a403fSchristos 
854440a403fSchristos   /* The section has contents - a data section could be
855440a403fSchristos      <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
856440a403fSchristos      <<SEC_HAS_CONTENTS>>  */
857440a403fSchristos #define SEC_HAS_CONTENTS                0x100
858440a403fSchristos 
859440a403fSchristos   /* An instruction to the linker to not output the section
860440a403fSchristos      even if it has information which would normally be written.  */
861440a403fSchristos #define SEC_NEVER_LOAD                  0x200
862440a403fSchristos 
863440a403fSchristos   /* The section contains thread local data.  */
864440a403fSchristos #define SEC_THREAD_LOCAL                0x400
865440a403fSchristos 
86606324dcfSchristos   /* The section's size is fixed.  Generic linker code will not
86706324dcfSchristos      recalculate it and it is up to whoever has set this flag to
86806324dcfSchristos      get the size right.  */
86906324dcfSchristos #define SEC_FIXED_SIZE                  0x800
870440a403fSchristos 
871440a403fSchristos   /* The section contains common symbols (symbols may be defined
872440a403fSchristos      multiple times, the value of a symbol is the amount of
873440a403fSchristos      space it requires, and the largest symbol value is the one
874440a403fSchristos      used).  Most targets have exactly one of these (which we
875440a403fSchristos      translate to bfd_com_section_ptr), but ECOFF has two.  */
876440a403fSchristos #define SEC_IS_COMMON                  0x1000
877440a403fSchristos 
878440a403fSchristos   /* The section contains only debugging information.  For
879440a403fSchristos      example, this is set for ELF .debug and .stab sections.
880440a403fSchristos      strip tests this flag to see if a section can be
881440a403fSchristos      discarded.  */
882440a403fSchristos #define SEC_DEBUGGING                  0x2000
883440a403fSchristos 
884440a403fSchristos   /* The contents of this section are held in memory pointed to
885440a403fSchristos      by the contents field.  This is checked by bfd_get_section_contents,
886440a403fSchristos      and the data is retrieved from memory if appropriate.  */
887440a403fSchristos #define SEC_IN_MEMORY                  0x4000
888440a403fSchristos 
889440a403fSchristos   /* The contents of this section are to be excluded by the
890440a403fSchristos      linker for executable and shared objects unless those
891440a403fSchristos      objects are to be further relocated.  */
892440a403fSchristos #define SEC_EXCLUDE                    0x8000
893440a403fSchristos 
894440a403fSchristos   /* The contents of this section are to be sorted based on the sum of
895440a403fSchristos      the symbol and addend values specified by the associated relocation
896440a403fSchristos      entries.  Entries without associated relocation entries will be
897440a403fSchristos      appended to the end of the section in an unspecified order.  */
898440a403fSchristos #define SEC_SORT_ENTRIES              0x10000
899440a403fSchristos 
900440a403fSchristos   /* When linking, duplicate sections of the same name should be
901440a403fSchristos      discarded, rather than being combined into a single section as
902440a403fSchristos      is usually done.  This is similar to how common symbols are
903440a403fSchristos      handled.  See SEC_LINK_DUPLICATES below.  */
904440a403fSchristos #define SEC_LINK_ONCE                 0x20000
905440a403fSchristos 
906440a403fSchristos   /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
907440a403fSchristos      should handle duplicate sections.  */
908440a403fSchristos #define SEC_LINK_DUPLICATES           0xc0000
909440a403fSchristos 
910440a403fSchristos   /* This value for SEC_LINK_DUPLICATES means that duplicate
911440a403fSchristos      sections with the same name should simply be discarded.  */
912440a403fSchristos #define SEC_LINK_DUPLICATES_DISCARD       0x0
913440a403fSchristos 
914440a403fSchristos   /* This value for SEC_LINK_DUPLICATES means that the linker
915440a403fSchristos      should warn if there are any duplicate sections, although
916440a403fSchristos      it should still only link one copy.  */
917440a403fSchristos #define SEC_LINK_DUPLICATES_ONE_ONLY  0x40000
918440a403fSchristos 
919440a403fSchristos   /* This value for SEC_LINK_DUPLICATES means that the linker
920440a403fSchristos      should warn if any duplicate sections are a different size.  */
921440a403fSchristos #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
922440a403fSchristos 
923440a403fSchristos   /* This value for SEC_LINK_DUPLICATES means that the linker
924440a403fSchristos      should warn if any duplicate sections contain different
925440a403fSchristos      contents.  */
926440a403fSchristos #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
927440a403fSchristos   (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
928440a403fSchristos 
929440a403fSchristos   /* This section was created by the linker as part of dynamic
930440a403fSchristos      relocation or other arcane processing.  It is skipped when
931440a403fSchristos      going through the first-pass output, trusting that someone
932440a403fSchristos      else up the line will take care of it later.  */
933440a403fSchristos #define SEC_LINKER_CREATED           0x100000
934440a403fSchristos 
935440a403fSchristos   /* This section should not be subject to garbage collection.
936440a403fSchristos      Also set to inform the linker that this section should not be
937440a403fSchristos      listed in the link map as discarded.  */
938440a403fSchristos #define SEC_KEEP                     0x200000
939440a403fSchristos 
940440a403fSchristos   /* This section contains "short" data, and should be placed
941440a403fSchristos      "near" the GP.  */
942440a403fSchristos #define SEC_SMALL_DATA               0x400000
943440a403fSchristos 
944440a403fSchristos   /* Attempt to merge identical entities in the section.
945440a403fSchristos      Entity size is given in the entsize field.  */
946440a403fSchristos #define SEC_MERGE                    0x800000
947440a403fSchristos 
948440a403fSchristos   /* If given with SEC_MERGE, entities to merge are zero terminated
949440a403fSchristos      strings where entsize specifies character size instead of fixed
950440a403fSchristos      size entries.  */
951440a403fSchristos #define SEC_STRINGS                 0x1000000
952440a403fSchristos 
953440a403fSchristos   /* This section contains data about section groups.  */
954440a403fSchristos #define SEC_GROUP                   0x2000000
955440a403fSchristos 
956440a403fSchristos   /* The section is a COFF shared library section.  This flag is
957440a403fSchristos      only for the linker.  If this type of section appears in
958440a403fSchristos      the input file, the linker must copy it to the output file
959440a403fSchristos      without changing the vma or size.  FIXME: Although this
960440a403fSchristos      was originally intended to be general, it really is COFF
961440a403fSchristos      specific (and the flag was renamed to indicate this).  It
962440a403fSchristos      might be cleaner to have some more general mechanism to
963440a403fSchristos      allow the back end to control what the linker does with
964440a403fSchristos      sections.  */
965440a403fSchristos #define SEC_COFF_SHARED_LIBRARY     0x4000000
966440a403fSchristos 
967440a403fSchristos   /* This input section should be copied to output in reverse order
968440a403fSchristos      as an array of pointers.  This is for ELF linker internal use
969440a403fSchristos      only.  */
970440a403fSchristos #define SEC_ELF_REVERSE_COPY        0x4000000
971440a403fSchristos 
972440a403fSchristos   /* This section contains data which may be shared with other
973440a403fSchristos      executables or shared objects. This is for COFF only.  */
974440a403fSchristos #define SEC_COFF_SHARED             0x8000000
975440a403fSchristos 
976440a403fSchristos   /* This section should be compressed.  This is for ELF linker
977440a403fSchristos      internal use only.  */
978440a403fSchristos #define SEC_ELF_COMPRESS            0x8000000
979440a403fSchristos 
980440a403fSchristos   /* When a section with this flag is being linked, then if the size of
981440a403fSchristos      the input section is less than a page, it should not cross a page
982440a403fSchristos      boundary.  If the size of the input section is one page or more,
983440a403fSchristos      it should be aligned on a page boundary.  This is for TI
984440a403fSchristos      TMS320C54X only.  */
985440a403fSchristos #define SEC_TIC54X_BLOCK           0x10000000
986440a403fSchristos 
987440a403fSchristos   /* This section should be renamed.  This is for ELF linker
988440a403fSchristos      internal use only.  */
989440a403fSchristos #define SEC_ELF_RENAME             0x10000000
990440a403fSchristos 
991440a403fSchristos   /* Conditionally link this section; do not link if there are no
992440a403fSchristos      references found to any symbol in the section.  This is for TI
993440a403fSchristos      TMS320C54X only.  */
994440a403fSchristos #define SEC_TIC54X_CLINK           0x20000000
995440a403fSchristos 
996440a403fSchristos   /* This section contains vliw code.  This is for Toshiba MeP only.  */
997440a403fSchristos #define SEC_MEP_VLIW               0x20000000
998440a403fSchristos 
999*b88e3e88Schristos   /* All symbols, sizes and relocations in this section are octets
1000*b88e3e88Schristos      instead of bytes.  Required for DWARF debug sections as DWARF
1001*b88e3e88Schristos      information is organized in octets, not bytes.  */
1002*b88e3e88Schristos #define SEC_ELF_OCTETS             0x40000000
1003*b88e3e88Schristos 
1004440a403fSchristos   /* Indicate that section has the no read flag set. This happens
1005440a403fSchristos      when memory read flag isn't set. */
1006440a403fSchristos #define SEC_COFF_NOREAD            0x40000000
1007440a403fSchristos 
100806324dcfSchristos   /* Indicate that section has the purecode flag set.  */
100906324dcfSchristos #define SEC_ELF_PURECODE           0x80000000
1010440a403fSchristos 
1011440a403fSchristos   /*  End of section flags.  */
1012440a403fSchristos 
1013440a403fSchristos   /* Some internal packed boolean fields.  */
1014440a403fSchristos 
1015440a403fSchristos   /* See the vma field.  */
1016440a403fSchristos   unsigned int user_set_vma : 1;
1017440a403fSchristos 
1018440a403fSchristos   /* A mark flag used by some of the linker backends.  */
1019440a403fSchristos   unsigned int linker_mark : 1;
1020440a403fSchristos 
1021440a403fSchristos   /* Another mark flag used by some of the linker backends.  Set for
1022440a403fSchristos      output sections that have an input section.  */
1023440a403fSchristos   unsigned int linker_has_input : 1;
1024440a403fSchristos 
1025440a403fSchristos   /* Mark flag used by some linker backends for garbage collection.  */
1026440a403fSchristos   unsigned int gc_mark : 1;
1027440a403fSchristos 
1028440a403fSchristos   /* Section compression status.  */
1029440a403fSchristos   unsigned int compress_status : 2;
1030440a403fSchristos #define COMPRESS_SECTION_NONE    0
1031440a403fSchristos #define COMPRESS_SECTION_DONE    1
1032440a403fSchristos #define DECOMPRESS_SECTION_SIZED 2
1033440a403fSchristos 
1034440a403fSchristos   /* The following flags are used by the ELF linker. */
1035440a403fSchristos 
1036440a403fSchristos   /* Mark sections which have been allocated to segments.  */
1037440a403fSchristos   unsigned int segment_mark : 1;
1038440a403fSchristos 
1039440a403fSchristos   /* Type of sec_info information.  */
1040440a403fSchristos   unsigned int sec_info_type:3;
1041440a403fSchristos #define SEC_INFO_TYPE_NONE      0
1042440a403fSchristos #define SEC_INFO_TYPE_STABS     1
1043440a403fSchristos #define SEC_INFO_TYPE_MERGE     2
1044440a403fSchristos #define SEC_INFO_TYPE_EH_FRAME  3
1045440a403fSchristos #define SEC_INFO_TYPE_JUST_SYMS 4
1046440a403fSchristos #define SEC_INFO_TYPE_TARGET    5
1047440a403fSchristos #define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1048440a403fSchristos 
1049440a403fSchristos   /* Nonzero if this section uses RELA relocations, rather than REL.  */
1050440a403fSchristos   unsigned int use_rela_p:1;
1051440a403fSchristos 
1052440a403fSchristos   /* Bits used by various backends.  The generic code doesn't touch
1053440a403fSchristos      these fields.  */
1054440a403fSchristos 
1055440a403fSchristos   unsigned int sec_flg0:1;
1056440a403fSchristos   unsigned int sec_flg1:1;
1057440a403fSchristos   unsigned int sec_flg2:1;
1058440a403fSchristos   unsigned int sec_flg3:1;
1059440a403fSchristos   unsigned int sec_flg4:1;
1060440a403fSchristos   unsigned int sec_flg5:1;
1061440a403fSchristos 
1062440a403fSchristos   /* End of internal packed boolean fields.  */
1063440a403fSchristos 
1064440a403fSchristos   /*  The virtual memory address of the section - where it will be
1065440a403fSchristos       at run time.  The symbols are relocated against this.  The
1066440a403fSchristos       user_set_vma flag is maintained by bfd; if it's not set, the
1067440a403fSchristos       backend can assign addresses (for example, in <<a.out>>, where
1068440a403fSchristos       the default address for <<.data>> is dependent on the specific
1069440a403fSchristos       target and various flags).  */
1070440a403fSchristos   bfd_vma vma;
1071440a403fSchristos 
1072440a403fSchristos   /*  The load address of the section - where it would be in a
1073440a403fSchristos       rom image; really only used for writing section header
1074440a403fSchristos       information.  */
1075440a403fSchristos   bfd_vma lma;
1076440a403fSchristos 
1077440a403fSchristos   /* The size of the section in *octets*, as it will be output.
1078440a403fSchristos      Contains a value even if the section has no contents (e.g., the
1079440a403fSchristos      size of <<.bss>>).  */
1080440a403fSchristos   bfd_size_type size;
1081440a403fSchristos 
1082440a403fSchristos   /* For input sections, the original size on disk of the section, in
1083440a403fSchristos      octets.  This field should be set for any section whose size is
1084440a403fSchristos      changed by linker relaxation.  It is required for sections where
1085440a403fSchristos      the linker relaxation scheme doesn't cache altered section and
1086440a403fSchristos      reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1087440a403fSchristos      targets), and thus the original size needs to be kept to read the
1088440a403fSchristos      section multiple times.  For output sections, rawsize holds the
1089440a403fSchristos      section size calculated on a previous linker relaxation pass.  */
1090440a403fSchristos   bfd_size_type rawsize;
1091440a403fSchristos 
1092440a403fSchristos   /* The compressed size of the section in octets.  */
1093440a403fSchristos   bfd_size_type compressed_size;
1094440a403fSchristos 
1095440a403fSchristos   /* Relaxation table. */
1096440a403fSchristos   struct relax_table *relax;
1097440a403fSchristos 
1098440a403fSchristos   /* Count of used relaxation table entries. */
1099440a403fSchristos   int relax_count;
1100440a403fSchristos 
1101440a403fSchristos 
1102440a403fSchristos   /* If this section is going to be output, then this value is the
1103440a403fSchristos      offset in *bytes* into the output section of the first byte in the
1104440a403fSchristos      input section (byte ==> smallest addressable unit on the
1105440a403fSchristos      target).  In most cases, if this was going to start at the
1106440a403fSchristos      100th octet (8-bit quantity) in the output section, this value
1107440a403fSchristos      would be 100.  However, if the target byte size is 16 bits
1108440a403fSchristos      (bfd_octets_per_byte is "2"), this value would be 50.  */
1109440a403fSchristos   bfd_vma output_offset;
1110440a403fSchristos 
1111440a403fSchristos   /* The output section through which to map on output.  */
1112440a403fSchristos   struct bfd_section *output_section;
1113440a403fSchristos 
1114440a403fSchristos   /* The alignment requirement of the section, as an exponent of 2 -
1115440a403fSchristos      e.g., 3 aligns to 2^3 (or 8).  */
1116440a403fSchristos   unsigned int alignment_power;
1117440a403fSchristos 
1118440a403fSchristos   /* If an input section, a pointer to a vector of relocation
1119440a403fSchristos      records for the data in this section.  */
1120440a403fSchristos   struct reloc_cache_entry *relocation;
1121440a403fSchristos 
1122440a403fSchristos   /* If an output section, a pointer to a vector of pointers to
1123440a403fSchristos      relocation records for the data in this section.  */
1124440a403fSchristos   struct reloc_cache_entry **orelocation;
1125440a403fSchristos 
1126440a403fSchristos   /* The number of relocation records in one of the above.  */
1127440a403fSchristos   unsigned reloc_count;
1128440a403fSchristos 
1129440a403fSchristos   /* Information below is back end specific - and not always used
1130440a403fSchristos      or updated.  */
1131440a403fSchristos 
1132440a403fSchristos   /* File position of section data.  */
1133440a403fSchristos   file_ptr filepos;
1134440a403fSchristos 
1135440a403fSchristos   /* File position of relocation info.  */
1136440a403fSchristos   file_ptr rel_filepos;
1137440a403fSchristos 
1138440a403fSchristos   /* File position of line data.  */
1139440a403fSchristos   file_ptr line_filepos;
1140440a403fSchristos 
1141440a403fSchristos   /* Pointer to data for applications.  */
1142440a403fSchristos   void *userdata;
1143440a403fSchristos 
1144440a403fSchristos   /* If the SEC_IN_MEMORY flag is set, this points to the actual
1145440a403fSchristos      contents.  */
1146440a403fSchristos   unsigned char *contents;
1147440a403fSchristos 
1148440a403fSchristos   /* Attached line number information.  */
1149440a403fSchristos   alent *lineno;
1150440a403fSchristos 
1151440a403fSchristos   /* Number of line number records.  */
1152440a403fSchristos   unsigned int lineno_count;
1153440a403fSchristos 
1154440a403fSchristos   /* Entity size for merging purposes.  */
1155440a403fSchristos   unsigned int entsize;
1156440a403fSchristos 
1157440a403fSchristos   /* Points to the kept section if this section is a link-once section,
1158440a403fSchristos      and is discarded.  */
1159440a403fSchristos   struct bfd_section *kept_section;
1160440a403fSchristos 
1161440a403fSchristos   /* When a section is being output, this value changes as more
1162440a403fSchristos      linenumbers are written out.  */
1163440a403fSchristos   file_ptr moving_line_filepos;
1164440a403fSchristos 
1165440a403fSchristos   /* What the section number is in the target world.  */
1166440a403fSchristos   int target_index;
1167440a403fSchristos 
1168440a403fSchristos   void *used_by_bfd;
1169440a403fSchristos 
1170440a403fSchristos   /* If this is a constructor section then here is a list of the
1171440a403fSchristos      relocations created to relocate items within it.  */
1172440a403fSchristos   struct relent_chain *constructor_chain;
1173440a403fSchristos 
1174440a403fSchristos   /* The BFD which owns the section.  */
1175440a403fSchristos   bfd *owner;
1176440a403fSchristos 
1177440a403fSchristos   /* A symbol which points at this section only.  */
1178440a403fSchristos   struct bfd_symbol *symbol;
1179440a403fSchristos   struct bfd_symbol **symbol_ptr_ptr;
1180440a403fSchristos 
1181440a403fSchristos   /* Early in the link process, map_head and map_tail are used to build
1182440a403fSchristos      a list of input sections attached to an output section.  Later,
1183440a403fSchristos      output sections use these fields for a list of bfd_link_order
1184440a403fSchristos      structs.  */
1185440a403fSchristos   union {
1186440a403fSchristos     struct bfd_link_order *link_order;
1187440a403fSchristos     struct bfd_section *s;
1188440a403fSchristos   } map_head, map_tail;
1189440a403fSchristos } asection;
1190440a403fSchristos 
1191440a403fSchristos /* Relax table contains information about instructions which can
1192440a403fSchristos    be removed by relaxation -- replacing a long address with a
1193440a403fSchristos    short address.  */
1194440a403fSchristos struct relax_table {
1195440a403fSchristos   /* Address where bytes may be deleted. */
1196440a403fSchristos   bfd_vma addr;
1197440a403fSchristos 
1198440a403fSchristos   /* Number of bytes to be deleted.  */
1199440a403fSchristos   int size;
1200440a403fSchristos };
1201440a403fSchristos 
1202*b88e3e88Schristos static inline const char *
bfd_section_name(const asection * sec)1203*b88e3e88Schristos bfd_section_name (const asection *sec)
1204*b88e3e88Schristos {
1205*b88e3e88Schristos   return sec->name;
1206*b88e3e88Schristos }
1207*b88e3e88Schristos 
1208*b88e3e88Schristos static inline bfd_size_type
bfd_section_size(const asection * sec)1209*b88e3e88Schristos bfd_section_size (const asection *sec)
1210*b88e3e88Schristos {
1211*b88e3e88Schristos   return sec->size;
1212*b88e3e88Schristos }
1213*b88e3e88Schristos 
1214*b88e3e88Schristos static inline bfd_vma
bfd_section_vma(const asection * sec)1215*b88e3e88Schristos bfd_section_vma (const asection *sec)
1216*b88e3e88Schristos {
1217*b88e3e88Schristos   return sec->vma;
1218*b88e3e88Schristos }
1219*b88e3e88Schristos 
1220*b88e3e88Schristos static inline bfd_vma
bfd_section_lma(const asection * sec)1221*b88e3e88Schristos bfd_section_lma (const asection *sec)
1222*b88e3e88Schristos {
1223*b88e3e88Schristos   return sec->lma;
1224*b88e3e88Schristos }
1225*b88e3e88Schristos 
1226*b88e3e88Schristos static inline unsigned int
bfd_section_alignment(const asection * sec)1227*b88e3e88Schristos bfd_section_alignment (const asection *sec)
1228*b88e3e88Schristos {
1229*b88e3e88Schristos   return sec->alignment_power;
1230*b88e3e88Schristos }
1231*b88e3e88Schristos 
1232*b88e3e88Schristos static inline flagword
bfd_section_flags(const asection * sec)1233*b88e3e88Schristos bfd_section_flags (const asection *sec)
1234*b88e3e88Schristos {
1235*b88e3e88Schristos   return sec->flags;
1236*b88e3e88Schristos }
1237*b88e3e88Schristos 
1238*b88e3e88Schristos static inline void *
bfd_section_userdata(const asection * sec)1239*b88e3e88Schristos bfd_section_userdata (const asection *sec)
1240*b88e3e88Schristos {
1241*b88e3e88Schristos   return sec->userdata;
1242*b88e3e88Schristos }
1243*b88e3e88Schristos static inline bfd_boolean
bfd_is_com_section(const asection * sec)1244*b88e3e88Schristos bfd_is_com_section (const asection *sec)
1245*b88e3e88Schristos {
1246*b88e3e88Schristos   return (sec->flags & SEC_IS_COMMON) != 0;
1247*b88e3e88Schristos }
1248*b88e3e88Schristos 
1249440a403fSchristos /* Note: the following are provided as inline functions rather than macros
1250440a403fSchristos    because not all callers use the return value.  A macro implementation
1251440a403fSchristos    would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
1252440a403fSchristos    compilers will complain about comma expressions that have no effect.  */
1253440a403fSchristos static inline bfd_boolean
bfd_set_section_userdata(asection * sec,void * val)1254*b88e3e88Schristos bfd_set_section_userdata (asection *sec, void *val)
1255440a403fSchristos {
1256*b88e3e88Schristos   sec->userdata = val;
1257440a403fSchristos   return TRUE;
1258440a403fSchristos }
1259440a403fSchristos 
1260440a403fSchristos static inline bfd_boolean
bfd_set_section_vma(asection * sec,bfd_vma val)1261*b88e3e88Schristos bfd_set_section_vma (asection *sec, bfd_vma val)
1262440a403fSchristos {
1263*b88e3e88Schristos   sec->vma = sec->lma = val;
1264*b88e3e88Schristos   sec->user_set_vma = TRUE;
1265440a403fSchristos   return TRUE;
1266440a403fSchristos }
1267440a403fSchristos 
1268440a403fSchristos static inline bfd_boolean
bfd_set_section_lma(asection * sec,bfd_vma val)1269*b88e3e88Schristos bfd_set_section_lma (asection *sec, bfd_vma val)
1270440a403fSchristos {
1271*b88e3e88Schristos   sec->lma = val;
1272*b88e3e88Schristos   return TRUE;
1273*b88e3e88Schristos }
1274*b88e3e88Schristos 
1275*b88e3e88Schristos static inline bfd_boolean
bfd_set_section_alignment(asection * sec,unsigned int val)1276*b88e3e88Schristos bfd_set_section_alignment (asection *sec, unsigned int val)
1277*b88e3e88Schristos {
1278*b88e3e88Schristos   sec->alignment_power = val;
1279440a403fSchristos   return TRUE;
1280440a403fSchristos }
1281440a403fSchristos 
1282440a403fSchristos /* These sections are global, and are managed by BFD.  The application
1283440a403fSchristos    and target back end are not permitted to change the values in
1284440a403fSchristos    these sections.  */
1285440a403fSchristos extern asection _bfd_std_section[4];
1286440a403fSchristos 
1287440a403fSchristos #define BFD_ABS_SECTION_NAME "*ABS*"
1288440a403fSchristos #define BFD_UND_SECTION_NAME "*UND*"
1289440a403fSchristos #define BFD_COM_SECTION_NAME "*COM*"
1290440a403fSchristos #define BFD_IND_SECTION_NAME "*IND*"
1291440a403fSchristos 
1292440a403fSchristos /* Pointer to the common section.  */
1293440a403fSchristos #define bfd_com_section_ptr (&_bfd_std_section[0])
1294440a403fSchristos /* Pointer to the undefined section.  */
1295440a403fSchristos #define bfd_und_section_ptr (&_bfd_std_section[1])
1296440a403fSchristos /* Pointer to the absolute section.  */
1297440a403fSchristos #define bfd_abs_section_ptr (&_bfd_std_section[2])
1298440a403fSchristos /* Pointer to the indirect section.  */
1299440a403fSchristos #define bfd_ind_section_ptr (&_bfd_std_section[3])
1300440a403fSchristos 
1301*b88e3e88Schristos static inline bfd_boolean
bfd_is_und_section(const asection * sec)1302*b88e3e88Schristos bfd_is_und_section (const asection *sec)
1303*b88e3e88Schristos {
1304*b88e3e88Schristos   return sec == bfd_und_section_ptr;
1305*b88e3e88Schristos }
1306440a403fSchristos 
1307*b88e3e88Schristos static inline bfd_boolean
bfd_is_abs_section(const asection * sec)1308*b88e3e88Schristos bfd_is_abs_section (const asection *sec)
1309*b88e3e88Schristos {
1310*b88e3e88Schristos   return sec == bfd_abs_section_ptr;
1311*b88e3e88Schristos }
1312440a403fSchristos 
1313*b88e3e88Schristos static inline bfd_boolean
bfd_is_ind_section(const asection * sec)1314*b88e3e88Schristos bfd_is_ind_section (const asection *sec)
1315*b88e3e88Schristos {
1316*b88e3e88Schristos   return sec == bfd_ind_section_ptr;
1317*b88e3e88Schristos }
1318*b88e3e88Schristos 
1319*b88e3e88Schristos static inline bfd_boolean
bfd_is_const_section(const asection * sec)1320*b88e3e88Schristos bfd_is_const_section (const asection *sec)
1321*b88e3e88Schristos {
1322*b88e3e88Schristos   return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr;
1323*b88e3e88Schristos }
1324*b88e3e88Schristos 
1325*b88e3e88Schristos /* Return TRUE if input section SEC has been discarded.  */
1326*b88e3e88Schristos static inline bfd_boolean
discarded_section(const asection * sec)1327*b88e3e88Schristos discarded_section (const asection *sec)
1328*b88e3e88Schristos {
1329*b88e3e88Schristos   return (!bfd_is_abs_section (sec)
1330*b88e3e88Schristos           && bfd_is_abs_section (sec->output_section)
1331*b88e3e88Schristos           && sec->sec_info_type != SEC_INFO_TYPE_MERGE
1332*b88e3e88Schristos           && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS);
1333*b88e3e88Schristos }
1334440a403fSchristos 
133506324dcfSchristos #define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)                   \
1336440a403fSchristos   /* name, id,  index, next, prev, flags, user_set_vma,            */  \
1337440a403fSchristos   {  NAME, IDX, 0,     NULL, NULL, FLAGS, 0,                           \
1338440a403fSchristos                                                                        \
1339440a403fSchristos   /* linker_mark, linker_has_input, gc_mark, decompress_status,    */  \
1340440a403fSchristos      0,           0,                1,       0,                        \
1341440a403fSchristos                                                                        \
1342440a403fSchristos   /* segment_mark, sec_info_type, use_rela_p,                      */  \
1343440a403fSchristos      0,            0,             0,                                   \
1344440a403fSchristos                                                                        \
1345440a403fSchristos   /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5,   */  \
1346440a403fSchristos      0,        0,        0,        0,        0,        0,              \
1347440a403fSchristos                                                                        \
1348440a403fSchristos   /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */  \
1349440a403fSchristos      0,   0,   0,    0,       0,               0,     0,               \
1350440a403fSchristos                                                                        \
1351440a403fSchristos   /* output_offset, output_section, alignment_power,               */  \
1352440a403fSchristos      0,             &SEC,           0,                                 \
1353440a403fSchristos                                                                        \
1354440a403fSchristos   /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */  \
1355440a403fSchristos      NULL,       NULL,        0,           0,       0,                 \
1356440a403fSchristos                                                                        \
1357440a403fSchristos   /* line_filepos, userdata, contents, lineno, lineno_count,       */  \
1358440a403fSchristos      0,            NULL,     NULL,     NULL,   0,                      \
1359440a403fSchristos                                                                        \
1360440a403fSchristos   /* entsize, kept_section, moving_line_filepos,                    */ \
1361440a403fSchristos      0,       NULL,          0,                                        \
1362440a403fSchristos                                                                        \
1363440a403fSchristos   /* target_index, used_by_bfd, constructor_chain, owner,          */  \
1364440a403fSchristos      0,            NULL,        NULL,              NULL,               \
1365440a403fSchristos                                                                        \
1366440a403fSchristos   /* symbol,                    symbol_ptr_ptr,                    */  \
1367440a403fSchristos      (struct bfd_symbol *) SYM, &SEC.symbol,                           \
1368440a403fSchristos                                                                        \
1369440a403fSchristos   /* map_head, map_tail                                            */  \
1370440a403fSchristos      { NULL }, { NULL }                                                \
1371440a403fSchristos     }
1372440a403fSchristos 
137306324dcfSchristos /* We use a macro to initialize the static asymbol structures because
137406324dcfSchristos    traditional C does not permit us to initialize a union member while
137506324dcfSchristos    gcc warns if we don't initialize it.
137606324dcfSchristos    the_bfd, name, value, attr, section [, udata]  */
137706324dcfSchristos #ifdef __STDC__
137806324dcfSchristos #define GLOBAL_SYM_INIT(NAME, SECTION) \
137906324dcfSchristos   { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
138006324dcfSchristos #else
138106324dcfSchristos #define GLOBAL_SYM_INIT(NAME, SECTION) \
138206324dcfSchristos   { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
138306324dcfSchristos #endif
138406324dcfSchristos 
1385440a403fSchristos void bfd_section_list_clear (bfd *);
1386440a403fSchristos 
1387440a403fSchristos asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1388440a403fSchristos 
1389440a403fSchristos asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1390440a403fSchristos 
1391440a403fSchristos asection *bfd_get_linker_section (bfd *abfd, const char *name);
1392440a403fSchristos 
1393440a403fSchristos asection *bfd_get_section_by_name_if
1394440a403fSchristos    (bfd *abfd,
1395440a403fSchristos     const char *name,
1396440a403fSchristos     bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1397440a403fSchristos     void *obj);
1398440a403fSchristos 
1399440a403fSchristos char *bfd_get_unique_section_name
1400440a403fSchristos    (bfd *abfd, const char *templat, int *count);
1401440a403fSchristos 
1402440a403fSchristos asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1403440a403fSchristos 
1404440a403fSchristos asection *bfd_make_section_anyway_with_flags
1405440a403fSchristos    (bfd *abfd, const char *name, flagword flags);
1406440a403fSchristos 
1407440a403fSchristos asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1408440a403fSchristos 
1409440a403fSchristos asection *bfd_make_section_with_flags
1410440a403fSchristos    (bfd *, const char *name, flagword flags);
1411440a403fSchristos 
1412440a403fSchristos asection *bfd_make_section (bfd *, const char *name);
1413440a403fSchristos 
1414*b88e3e88Schristos bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
1415440a403fSchristos 
1416440a403fSchristos void bfd_rename_section
1417*b88e3e88Schristos    (asection *sec, const char *newname);
1418440a403fSchristos 
1419440a403fSchristos void bfd_map_over_sections
1420440a403fSchristos    (bfd *abfd,
1421440a403fSchristos     void (*func) (bfd *abfd, asection *sect, void *obj),
1422440a403fSchristos     void *obj);
1423440a403fSchristos 
1424440a403fSchristos asection *bfd_sections_find_if
1425440a403fSchristos    (bfd *abfd,
1426440a403fSchristos     bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1427440a403fSchristos     void *obj);
1428440a403fSchristos 
1429*b88e3e88Schristos bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val);
1430440a403fSchristos 
1431440a403fSchristos bfd_boolean bfd_set_section_contents
1432440a403fSchristos    (bfd *abfd, asection *section, const void *data,
1433440a403fSchristos     file_ptr offset, bfd_size_type count);
1434440a403fSchristos 
1435440a403fSchristos bfd_boolean bfd_get_section_contents
1436440a403fSchristos    (bfd *abfd, asection *section, void *location, file_ptr offset,
1437440a403fSchristos     bfd_size_type count);
1438440a403fSchristos 
1439440a403fSchristos bfd_boolean bfd_malloc_and_get_section
1440440a403fSchristos    (bfd *abfd, asection *section, bfd_byte **buf);
1441440a403fSchristos 
1442440a403fSchristos bfd_boolean bfd_copy_private_section_data
1443440a403fSchristos    (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1444440a403fSchristos 
1445440a403fSchristos #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1446440a403fSchristos        BFD_SEND (obfd, _bfd_copy_private_section_data, \
1447440a403fSchristos                  (ibfd, isection, obfd, osection))
1448440a403fSchristos bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1449440a403fSchristos 
1450*b88e3e88Schristos const char *bfd_generic_group_name (bfd *, const asection *sec);
1451*b88e3e88Schristos 
1452440a403fSchristos bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1453440a403fSchristos 
1454440a403fSchristos /* Extracted from archures.c.  */
1455440a403fSchristos enum bfd_architecture
1456440a403fSchristos {
1457440a403fSchristos   bfd_arch_unknown,   /* File arch not known.  */
1458440a403fSchristos   bfd_arch_obscure,   /* Arch known, not one of these.  */
145906324dcfSchristos   bfd_arch_m68k,      /* Motorola 68xxx.  */
1460440a403fSchristos #define bfd_mach_m68000                1
1461440a403fSchristos #define bfd_mach_m68008                2
1462440a403fSchristos #define bfd_mach_m68010                3
1463440a403fSchristos #define bfd_mach_m68020                4
1464440a403fSchristos #define bfd_mach_m68030                5
1465440a403fSchristos #define bfd_mach_m68040                6
1466440a403fSchristos #define bfd_mach_m68060                7
1467440a403fSchristos #define bfd_mach_cpu32                 8
1468440a403fSchristos #define bfd_mach_fido                  9
1469440a403fSchristos #define bfd_mach_mcf_isa_a_nodiv       10
1470440a403fSchristos #define bfd_mach_mcf_isa_a             11
1471440a403fSchristos #define bfd_mach_mcf_isa_a_mac         12
1472440a403fSchristos #define bfd_mach_mcf_isa_a_emac        13
1473440a403fSchristos #define bfd_mach_mcf_isa_aplus         14
1474440a403fSchristos #define bfd_mach_mcf_isa_aplus_mac     15
1475440a403fSchristos #define bfd_mach_mcf_isa_aplus_emac    16
1476440a403fSchristos #define bfd_mach_mcf_isa_b_nousp       17
1477440a403fSchristos #define bfd_mach_mcf_isa_b_nousp_mac   18
1478440a403fSchristos #define bfd_mach_mcf_isa_b_nousp_emac  19
1479440a403fSchristos #define bfd_mach_mcf_isa_b             20
1480440a403fSchristos #define bfd_mach_mcf_isa_b_mac         21
1481440a403fSchristos #define bfd_mach_mcf_isa_b_emac        22
1482440a403fSchristos #define bfd_mach_mcf_isa_b_float       23
1483440a403fSchristos #define bfd_mach_mcf_isa_b_float_mac   24
1484440a403fSchristos #define bfd_mach_mcf_isa_b_float_emac  25
1485440a403fSchristos #define bfd_mach_mcf_isa_c             26
1486440a403fSchristos #define bfd_mach_mcf_isa_c_mac         27
1487440a403fSchristos #define bfd_mach_mcf_isa_c_emac        28
1488440a403fSchristos #define bfd_mach_mcf_isa_c_nodiv       29
1489440a403fSchristos #define bfd_mach_mcf_isa_c_nodiv_mac   30
1490440a403fSchristos #define bfd_mach_mcf_isa_c_nodiv_emac  31
149106324dcfSchristos   bfd_arch_vax,       /* DEC Vax.  */
1492440a403fSchristos 
149306324dcfSchristos   bfd_arch_or1k,      /* OpenRISC 1000.  */
1494440a403fSchristos #define bfd_mach_or1k          1
1495440a403fSchristos #define bfd_mach_or1knd        2
1496440a403fSchristos 
149706324dcfSchristos   bfd_arch_sparc,     /* SPARC.  */
1498440a403fSchristos #define bfd_mach_sparc                 1
1499440a403fSchristos /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
1500440a403fSchristos #define bfd_mach_sparc_sparclet        2
1501440a403fSchristos #define bfd_mach_sparc_sparclite       3
1502440a403fSchristos #define bfd_mach_sparc_v8plus          4
1503440a403fSchristos #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
1504440a403fSchristos #define bfd_mach_sparc_sparclite_le    6
1505440a403fSchristos #define bfd_mach_sparc_v9              7
1506440a403fSchristos #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
1507440a403fSchristos #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
1508440a403fSchristos #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
1509440a403fSchristos #define bfd_mach_sparc_v8plusc         11 /* with UA2005 and T1 add'ns.  */
1510440a403fSchristos #define bfd_mach_sparc_v9c             12 /* with UA2005 and T1 add'ns.  */
1511440a403fSchristos #define bfd_mach_sparc_v8plusd         13 /* with UA2007 and T3 add'ns.  */
1512440a403fSchristos #define bfd_mach_sparc_v9d             14 /* with UA2007 and T3 add'ns.  */
1513440a403fSchristos #define bfd_mach_sparc_v8pluse         15 /* with OSA2001 and T4 add'ns (no IMA).  */
1514440a403fSchristos #define bfd_mach_sparc_v9e             16 /* with OSA2001 and T4 add'ns (no IMA).  */
1515440a403fSchristos #define bfd_mach_sparc_v8plusv         17 /* with OSA2011 and T4 and IMA and FJMAU add'ns.  */
1516440a403fSchristos #define bfd_mach_sparc_v9v             18 /* with OSA2011 and T4 and IMA and FJMAU add'ns.  */
1517440a403fSchristos #define bfd_mach_sparc_v8plusm         19 /* with OSA2015 and M7 add'ns.  */
1518440a403fSchristos #define bfd_mach_sparc_v9m             20 /* with OSA2015 and M7 add'ns.  */
151906324dcfSchristos #define bfd_mach_sparc_v8plusm8        21 /* with OSA2017 and M8 add'ns.  */
152006324dcfSchristos #define bfd_mach_sparc_v9m8            22 /* with OSA2017 and M8 add'ns.  */
1521440a403fSchristos /* Nonzero if MACH has the v9 instruction set.  */
1522440a403fSchristos #define bfd_mach_sparc_v9_p(mach) \
152306324dcfSchristos   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
1524440a403fSchristos    && (mach) != bfd_mach_sparc_sparclite_le)
1525440a403fSchristos /* Nonzero if MACH is a 64 bit sparc architecture.  */
1526440a403fSchristos #define bfd_mach_sparc_64bit_p(mach) \
1527440a403fSchristos   ((mach) >= bfd_mach_sparc_v9 \
1528440a403fSchristos    && (mach) != bfd_mach_sparc_v8plusb \
1529440a403fSchristos    && (mach) != bfd_mach_sparc_v8plusc \
1530440a403fSchristos    && (mach) != bfd_mach_sparc_v8plusd \
1531440a403fSchristos    && (mach) != bfd_mach_sparc_v8pluse \
1532440a403fSchristos    && (mach) != bfd_mach_sparc_v8plusv \
153306324dcfSchristos    && (mach) != bfd_mach_sparc_v8plusm \
153406324dcfSchristos    && (mach) != bfd_mach_sparc_v8plusm8)
153506324dcfSchristos   bfd_arch_spu,       /* PowerPC SPU.  */
1536440a403fSchristos #define bfd_mach_spu           256
153706324dcfSchristos   bfd_arch_mips,      /* MIPS Rxxxx.  */
1538440a403fSchristos #define bfd_mach_mips3000              3000
1539440a403fSchristos #define bfd_mach_mips3900              3900
1540440a403fSchristos #define bfd_mach_mips4000              4000
1541440a403fSchristos #define bfd_mach_mips4010              4010
1542440a403fSchristos #define bfd_mach_mips4100              4100
1543440a403fSchristos #define bfd_mach_mips4111              4111
1544440a403fSchristos #define bfd_mach_mips4120              4120
1545440a403fSchristos #define bfd_mach_mips4300              4300
1546440a403fSchristos #define bfd_mach_mips4400              4400
1547440a403fSchristos #define bfd_mach_mips4600              4600
1548440a403fSchristos #define bfd_mach_mips4650              4650
1549440a403fSchristos #define bfd_mach_mips5000              5000
1550440a403fSchristos #define bfd_mach_mips5400              5400
1551440a403fSchristos #define bfd_mach_mips5500              5500
1552440a403fSchristos #define bfd_mach_mips5900              5900
1553440a403fSchristos #define bfd_mach_mips6000              6000
1554440a403fSchristos #define bfd_mach_mips7000              7000
1555440a403fSchristos #define bfd_mach_mips8000              8000
1556440a403fSchristos #define bfd_mach_mips9000              9000
1557440a403fSchristos #define bfd_mach_mips10000             10000
1558440a403fSchristos #define bfd_mach_mips12000             12000
1559440a403fSchristos #define bfd_mach_mips14000             14000
1560440a403fSchristos #define bfd_mach_mips16000             16000
1561440a403fSchristos #define bfd_mach_mips16                16
1562440a403fSchristos #define bfd_mach_mips5                 5
1563440a403fSchristos #define bfd_mach_mips_loongson_2e      3001
1564440a403fSchristos #define bfd_mach_mips_loongson_2f      3002
1565*b88e3e88Schristos #define bfd_mach_mips_gs464            3003
1566*b88e3e88Schristos #define bfd_mach_mips_gs464e           3004
1567*b88e3e88Schristos #define bfd_mach_mips_gs264e           3005
156806324dcfSchristos #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01.  */
1569440a403fSchristos #define bfd_mach_mips_octeon           6501
1570440a403fSchristos #define bfd_mach_mips_octeonp          6601
1571440a403fSchristos #define bfd_mach_mips_octeon2          6502
1572440a403fSchristos #define bfd_mach_mips_octeon3          6503
157306324dcfSchristos #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'.  */
157406324dcfSchristos #define bfd_mach_mips_interaptiv_mr2   736550   /* decimal 'IA2'.  */
1575440a403fSchristos #define bfd_mach_mipsisa32             32
1576440a403fSchristos #define bfd_mach_mipsisa32r2           33
1577440a403fSchristos #define bfd_mach_mipsisa32r3           34
1578440a403fSchristos #define bfd_mach_mipsisa32r5           36
1579440a403fSchristos #define bfd_mach_mipsisa32r6           37
1580440a403fSchristos #define bfd_mach_mipsisa64             64
1581440a403fSchristos #define bfd_mach_mipsisa64r2           65
1582440a403fSchristos #define bfd_mach_mipsisa64r3           66
1583440a403fSchristos #define bfd_mach_mipsisa64r5           68
1584440a403fSchristos #define bfd_mach_mipsisa64r6           69
1585440a403fSchristos #define bfd_mach_mips_micromips        96
158606324dcfSchristos   bfd_arch_i386,      /* Intel 386.  */
1587440a403fSchristos #define bfd_mach_i386_intel_syntax     (1 << 0)
1588440a403fSchristos #define bfd_mach_i386_i8086            (1 << 1)
1589440a403fSchristos #define bfd_mach_i386_i386             (1 << 2)
1590440a403fSchristos #define bfd_mach_x86_64                (1 << 3)
1591440a403fSchristos #define bfd_mach_x64_32                (1 << 4)
1592440a403fSchristos #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
1593440a403fSchristos #define bfd_mach_x86_64_intel_syntax   (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
1594440a403fSchristos #define bfd_mach_x64_32_intel_syntax   (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
159506324dcfSchristos   bfd_arch_l1om,      /* Intel L1OM.  */
1596440a403fSchristos #define bfd_mach_l1om                  (1 << 5)
1597440a403fSchristos #define bfd_mach_l1om_intel_syntax     (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
159806324dcfSchristos   bfd_arch_k1om,      /* Intel K1OM.  */
1599440a403fSchristos #define bfd_mach_k1om                  (1 << 6)
1600440a403fSchristos #define bfd_mach_k1om_intel_syntax     (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
1601440a403fSchristos #define bfd_mach_i386_nacl             (1 << 7)
1602440a403fSchristos #define bfd_mach_i386_i386_nacl        (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
1603440a403fSchristos #define bfd_mach_x86_64_nacl           (bfd_mach_x86_64 | bfd_mach_i386_nacl)
1604440a403fSchristos #define bfd_mach_x64_32_nacl           (bfd_mach_x64_32 | bfd_mach_i386_nacl)
160506324dcfSchristos   bfd_arch_iamcu,     /* Intel MCU.  */
1606440a403fSchristos #define bfd_mach_iamcu                 (1 << 8)
1607440a403fSchristos #define bfd_mach_i386_iamcu            (bfd_mach_i386_i386 | bfd_mach_iamcu)
1608440a403fSchristos #define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
160906324dcfSchristos   bfd_arch_romp,      /* IBM ROMP PC/RT.  */
161006324dcfSchristos   bfd_arch_convex,    /* Convex.  */
161106324dcfSchristos   bfd_arch_m98k,      /* Motorola 98xxx.  */
161206324dcfSchristos   bfd_arch_pyramid,   /* Pyramid Technology.  */
161306324dcfSchristos   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300).  */
1614440a403fSchristos #define bfd_mach_h8300         1
1615440a403fSchristos #define bfd_mach_h8300h        2
1616440a403fSchristos #define bfd_mach_h8300s        3
1617440a403fSchristos #define bfd_mach_h8300hn       4
1618440a403fSchristos #define bfd_mach_h8300sn       5
1619440a403fSchristos #define bfd_mach_h8300sx       6
1620440a403fSchristos #define bfd_mach_h8300sxn      7
162106324dcfSchristos   bfd_arch_pdp11,     /* DEC PDP-11.  */
1622440a403fSchristos   bfd_arch_plugin,
162306324dcfSchristos   bfd_arch_powerpc,   /* PowerPC.  */
1624440a403fSchristos #define bfd_mach_ppc           32
1625440a403fSchristos #define bfd_mach_ppc64         64
1626440a403fSchristos #define bfd_mach_ppc_403       403
1627440a403fSchristos #define bfd_mach_ppc_403gc     4030
1628440a403fSchristos #define bfd_mach_ppc_405       405
1629440a403fSchristos #define bfd_mach_ppc_505       505
1630440a403fSchristos #define bfd_mach_ppc_601       601
1631440a403fSchristos #define bfd_mach_ppc_602       602
1632440a403fSchristos #define bfd_mach_ppc_603       603
1633440a403fSchristos #define bfd_mach_ppc_ec603e    6031
1634440a403fSchristos #define bfd_mach_ppc_604       604
1635440a403fSchristos #define bfd_mach_ppc_620       620
1636440a403fSchristos #define bfd_mach_ppc_630       630
1637440a403fSchristos #define bfd_mach_ppc_750       750
1638440a403fSchristos #define bfd_mach_ppc_860       860
1639440a403fSchristos #define bfd_mach_ppc_a35       35
1640440a403fSchristos #define bfd_mach_ppc_rs64ii    642
1641440a403fSchristos #define bfd_mach_ppc_rs64iii   643
1642440a403fSchristos #define bfd_mach_ppc_7400      7400
1643440a403fSchristos #define bfd_mach_ppc_e500      500
1644440a403fSchristos #define bfd_mach_ppc_e500mc    5001
1645440a403fSchristos #define bfd_mach_ppc_e500mc64  5005
1646440a403fSchristos #define bfd_mach_ppc_e5500     5006
1647440a403fSchristos #define bfd_mach_ppc_e6500     5007
1648440a403fSchristos #define bfd_mach_ppc_titan     83
1649440a403fSchristos #define bfd_mach_ppc_vle       84
165006324dcfSchristos   bfd_arch_rs6000,    /* IBM RS/6000.  */
1651440a403fSchristos #define bfd_mach_rs6k          6000
1652440a403fSchristos #define bfd_mach_rs6k_rs1      6001
1653440a403fSchristos #define bfd_mach_rs6k_rsc      6003
1654440a403fSchristos #define bfd_mach_rs6k_rs2      6002
165506324dcfSchristos   bfd_arch_hppa,      /* HP PA RISC.  */
1656440a403fSchristos #define bfd_mach_hppa10        10
1657440a403fSchristos #define bfd_mach_hppa11        11
1658440a403fSchristos #define bfd_mach_hppa20        20
1659440a403fSchristos #define bfd_mach_hppa20w       25
166006324dcfSchristos   bfd_arch_d10v,      /* Mitsubishi D10V.  */
1661440a403fSchristos #define bfd_mach_d10v          1
1662440a403fSchristos #define bfd_mach_d10v_ts2      2
1663440a403fSchristos #define bfd_mach_d10v_ts3      3
166406324dcfSchristos   bfd_arch_d30v,      /* Mitsubishi D30V.  */
166506324dcfSchristos   bfd_arch_dlx,       /* DLX.  */
166606324dcfSchristos   bfd_arch_m68hc11,   /* Motorola 68HC11.  */
166706324dcfSchristos   bfd_arch_m68hc12,   /* Motorola 68HC12.  */
1668440a403fSchristos #define bfd_mach_m6812_default 0
1669440a403fSchristos #define bfd_mach_m6812         1
1670440a403fSchristos #define bfd_mach_m6812s        2
167106324dcfSchristos   bfd_arch_m9s12x,    /* Freescale S12X.  */
167206324dcfSchristos   bfd_arch_m9s12xg,   /* Freescale XGATE.  */
167306324dcfSchristos   bfd_arch_s12z,    /* Freescale S12Z.  */
167406324dcfSchristos #define bfd_mach_s12z_default 0
167506324dcfSchristos   bfd_arch_z8k,       /* Zilog Z8000.  */
1676440a403fSchristos #define bfd_mach_z8001         1
1677440a403fSchristos #define bfd_mach_z8002         2
167806324dcfSchristos   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH).  */
1679440a403fSchristos #define bfd_mach_sh                            1
1680440a403fSchristos #define bfd_mach_sh2                           0x20
1681440a403fSchristos #define bfd_mach_sh_dsp                        0x2d
1682440a403fSchristos #define bfd_mach_sh2a                          0x2a
1683440a403fSchristos #define bfd_mach_sh2a_nofpu                    0x2b
1684440a403fSchristos #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
1685440a403fSchristos #define bfd_mach_sh2a_nofpu_or_sh3_nommu       0x2a2
1686440a403fSchristos #define bfd_mach_sh2a_or_sh4                   0x2a3
1687440a403fSchristos #define bfd_mach_sh2a_or_sh3e                  0x2a4
1688440a403fSchristos #define bfd_mach_sh2e                          0x2e
1689440a403fSchristos #define bfd_mach_sh3                           0x30
1690440a403fSchristos #define bfd_mach_sh3_nommu                     0x31
1691440a403fSchristos #define bfd_mach_sh3_dsp                       0x3d
1692440a403fSchristos #define bfd_mach_sh3e                          0x3e
1693440a403fSchristos #define bfd_mach_sh4                           0x40
1694440a403fSchristos #define bfd_mach_sh4_nofpu                     0x41
1695440a403fSchristos #define bfd_mach_sh4_nommu_nofpu               0x42
1696440a403fSchristos #define bfd_mach_sh4a                          0x4a
1697440a403fSchristos #define bfd_mach_sh4a_nofpu                    0x4b
1698440a403fSchristos #define bfd_mach_sh4al_dsp                     0x4d
169906324dcfSchristos   bfd_arch_alpha,     /* Dec Alpha.  */
1700440a403fSchristos #define bfd_mach_alpha_ev4     0x10
1701440a403fSchristos #define bfd_mach_alpha_ev5     0x20
1702440a403fSchristos #define bfd_mach_alpha_ev6     0x30
1703440a403fSchristos   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
1704440a403fSchristos #define bfd_mach_arm_unknown   0
1705440a403fSchristos #define bfd_mach_arm_2         1
1706440a403fSchristos #define bfd_mach_arm_2a        2
1707440a403fSchristos #define bfd_mach_arm_3         3
1708440a403fSchristos #define bfd_mach_arm_3M        4
1709440a403fSchristos #define bfd_mach_arm_4         5
1710440a403fSchristos #define bfd_mach_arm_4T        6
1711440a403fSchristos #define bfd_mach_arm_5         7
1712440a403fSchristos #define bfd_mach_arm_5T        8
1713440a403fSchristos #define bfd_mach_arm_5TE       9
1714440a403fSchristos #define bfd_mach_arm_XScale    10
1715440a403fSchristos #define bfd_mach_arm_ep9312    11
1716440a403fSchristos #define bfd_mach_arm_iWMMXt    12
1717440a403fSchristos #define bfd_mach_arm_iWMMXt2   13
1718*b88e3e88Schristos #define bfd_mach_arm_5TEJ      14
1719*b88e3e88Schristos #define bfd_mach_arm_6         15
1720*b88e3e88Schristos #define bfd_mach_arm_6KZ       16
1721*b88e3e88Schristos #define bfd_mach_arm_6T2       17
1722*b88e3e88Schristos #define bfd_mach_arm_6K        18
1723*b88e3e88Schristos #define bfd_mach_arm_7         19
1724*b88e3e88Schristos #define bfd_mach_arm_6M        20
1725*b88e3e88Schristos #define bfd_mach_arm_6SM       21
1726*b88e3e88Schristos #define bfd_mach_arm_7EM       22
1727*b88e3e88Schristos #define bfd_mach_arm_8         23
1728*b88e3e88Schristos #define bfd_mach_arm_8R        24
1729*b88e3e88Schristos #define bfd_mach_arm_8M_BASE   25
1730*b88e3e88Schristos #define bfd_mach_arm_8M_MAIN   26
1731*b88e3e88Schristos #define bfd_mach_arm_8_1M_MAIN 27
173206324dcfSchristos   bfd_arch_nds32,     /* Andes NDS32.  */
1733440a403fSchristos #define bfd_mach_n1            1
1734440a403fSchristos #define bfd_mach_n1h           2
1735440a403fSchristos #define bfd_mach_n1h_v2        3
1736440a403fSchristos #define bfd_mach_n1h_v3        4
1737440a403fSchristos #define bfd_mach_n1h_v3m       5
173806324dcfSchristos   bfd_arch_ns32k,     /* National Semiconductors ns32000.  */
173906324dcfSchristos   bfd_arch_tic30,     /* Texas Instruments TMS320C30.  */
174006324dcfSchristos   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X.  */
1741440a403fSchristos #define bfd_mach_tic3x         30
1742440a403fSchristos #define bfd_mach_tic4x         40
174306324dcfSchristos   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X.  */
174406324dcfSchristos   bfd_arch_tic6x,     /* Texas Instruments TMS320C6X.  */
174506324dcfSchristos   bfd_arch_v850,      /* NEC V850.  */
174606324dcfSchristos   bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI).  */
1747440a403fSchristos #define bfd_mach_v850          1
1748440a403fSchristos #define bfd_mach_v850e         'E'
1749440a403fSchristos #define bfd_mach_v850e1        '1'
1750440a403fSchristos #define bfd_mach_v850e2        0x4532
1751440a403fSchristos #define bfd_mach_v850e2v3      0x45325633
175206324dcfSchristos #define bfd_mach_v850e3v5      0x45335635 /* ('E'|'3'|'V'|'5').  */
175306324dcfSchristos   bfd_arch_arc,       /* ARC Cores.  */
1754440a403fSchristos #define bfd_mach_arc_a4        0
1755440a403fSchristos #define bfd_mach_arc_a5        1
1756440a403fSchristos #define bfd_mach_arc_arc600    2
1757440a403fSchristos #define bfd_mach_arc_arc601    4
1758440a403fSchristos #define bfd_mach_arc_arc700    3
1759440a403fSchristos #define bfd_mach_arc_arcv2     5
1760440a403fSchristos  bfd_arch_m32c,       /* Renesas M16C/M32C.  */
1761440a403fSchristos #define bfd_mach_m16c          0x75
1762440a403fSchristos #define bfd_mach_m32c          0x78
176306324dcfSchristos   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D).  */
1764440a403fSchristos #define bfd_mach_m32r          1 /* For backwards compatibility.  */
1765440a403fSchristos #define bfd_mach_m32rx         'x'
1766440a403fSchristos #define bfd_mach_m32r2         '2'
176706324dcfSchristos   bfd_arch_mn10200,   /* Matsushita MN10200.  */
176806324dcfSchristos   bfd_arch_mn10300,   /* Matsushita MN10300.  */
1769440a403fSchristos #define bfd_mach_mn10300       300
1770440a403fSchristos #define bfd_mach_am33          330
1771440a403fSchristos #define bfd_mach_am33_2        332
1772440a403fSchristos   bfd_arch_fr30,
1773440a403fSchristos #define bfd_mach_fr30          0x46523330
1774440a403fSchristos   bfd_arch_frv,
1775440a403fSchristos #define bfd_mach_frv           1
1776440a403fSchristos #define bfd_mach_frvsimple     2
1777440a403fSchristos #define bfd_mach_fr300         300
1778440a403fSchristos #define bfd_mach_fr400         400
1779440a403fSchristos #define bfd_mach_fr450         450
178006324dcfSchristos #define bfd_mach_frvtomcat     499     /* fr500 prototype.  */
1781440a403fSchristos #define bfd_mach_fr500         500
1782440a403fSchristos #define bfd_mach_fr550         550
178306324dcfSchristos   bfd_arch_moxie,     /* The moxie processor.  */
1784440a403fSchristos #define bfd_mach_moxie         1
178506324dcfSchristos   bfd_arch_ft32,      /* The ft32 processor.  */
1786440a403fSchristos #define bfd_mach_ft32          1
178706324dcfSchristos #define bfd_mach_ft32b         2
1788440a403fSchristos   bfd_arch_mcore,
1789440a403fSchristos   bfd_arch_mep,
1790440a403fSchristos #define bfd_mach_mep           1
1791440a403fSchristos #define bfd_mach_mep_h1        0x6831
1792440a403fSchristos #define bfd_mach_mep_c5        0x6335
1793440a403fSchristos   bfd_arch_metag,
1794440a403fSchristos #define bfd_mach_metag         1
179506324dcfSchristos   bfd_arch_ia64,      /* HP/Intel ia64.  */
1796440a403fSchristos #define bfd_mach_ia64_elf64    64
1797440a403fSchristos #define bfd_mach_ia64_elf32    32
1798440a403fSchristos   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
1799440a403fSchristos #define bfd_mach_ip2022        1
1800440a403fSchristos #define bfd_mach_ip2022ext     2
1801440a403fSchristos  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
1802440a403fSchristos #define bfd_mach_iq2000        1
1803440a403fSchristos #define bfd_mach_iq10          2
1804*b88e3e88Schristos   bfd_arch_bpf,       /* Linux eBPF.  */
1805*b88e3e88Schristos #define bfd_mach_bpf           1
180606324dcfSchristos   bfd_arch_epiphany,  /* Adapteva EPIPHANY.  */
1807440a403fSchristos #define bfd_mach_epiphany16    1
1808440a403fSchristos #define bfd_mach_epiphany32    2
1809440a403fSchristos   bfd_arch_mt,
1810440a403fSchristos #define bfd_mach_ms1           1
1811440a403fSchristos #define bfd_mach_mrisc2        2
1812440a403fSchristos #define bfd_mach_ms2           3
1813440a403fSchristos   bfd_arch_pj,
1814440a403fSchristos   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
1815440a403fSchristos #define bfd_mach_avr1          1
1816440a403fSchristos #define bfd_mach_avr2          2
1817440a403fSchristos #define bfd_mach_avr25         25
1818440a403fSchristos #define bfd_mach_avr3          3
1819440a403fSchristos #define bfd_mach_avr31         31
1820440a403fSchristos #define bfd_mach_avr35         35
1821440a403fSchristos #define bfd_mach_avr4          4
1822440a403fSchristos #define bfd_mach_avr5          5
1823440a403fSchristos #define bfd_mach_avr51         51
1824440a403fSchristos #define bfd_mach_avr6          6
1825440a403fSchristos #define bfd_mach_avrtiny       100
1826440a403fSchristos #define bfd_mach_avrxmega1     101
1827440a403fSchristos #define bfd_mach_avrxmega2     102
1828440a403fSchristos #define bfd_mach_avrxmega3     103
1829440a403fSchristos #define bfd_mach_avrxmega4     104
1830440a403fSchristos #define bfd_mach_avrxmega5     105
1831440a403fSchristos #define bfd_mach_avrxmega6     106
1832440a403fSchristos #define bfd_mach_avrxmega7     107
183306324dcfSchristos   bfd_arch_bfin,      /* ADI Blackfin.  */
1834440a403fSchristos #define bfd_mach_bfin          1
1835440a403fSchristos   bfd_arch_cr16,      /* National Semiconductor CompactRISC (ie CR16).  */
1836440a403fSchristos #define bfd_mach_cr16          1
1837440a403fSchristos   bfd_arch_crx,       /*  National Semiconductor CRX.  */
1838440a403fSchristos #define bfd_mach_crx           1
183906324dcfSchristos   bfd_arch_cris,      /* Axis CRIS.  */
1840440a403fSchristos #define bfd_mach_cris_v0_v10   255
1841440a403fSchristos #define bfd_mach_cris_v32      32
1842440a403fSchristos #define bfd_mach_cris_v10_v32  1032
184306324dcfSchristos   bfd_arch_riscv,
184406324dcfSchristos #define bfd_mach_riscv32       132
184506324dcfSchristos #define bfd_mach_riscv64       164
1846440a403fSchristos   bfd_arch_rl78,
1847440a403fSchristos #define bfd_mach_rl78          0x75
1848440a403fSchristos   bfd_arch_rx,        /* Renesas RX.  */
1849440a403fSchristos #define bfd_mach_rx            0x75
1850*b88e3e88Schristos #define bfd_mach_rx_v2         0x76
1851*b88e3e88Schristos #define bfd_mach_rx_v3         0x77
185206324dcfSchristos   bfd_arch_s390,      /* IBM s390.  */
1853440a403fSchristos #define bfd_mach_s390_31       31
1854440a403fSchristos #define bfd_mach_s390_64       64
185506324dcfSchristos   bfd_arch_score,     /* Sunplus score.  */
1856440a403fSchristos #define bfd_mach_score3        3
1857440a403fSchristos #define bfd_mach_score7        7
1858440a403fSchristos   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
1859440a403fSchristos   bfd_arch_xstormy16,
1860440a403fSchristos #define bfd_mach_xstormy16     1
1861440a403fSchristos   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
1862440a403fSchristos #define bfd_mach_msp11         11
1863440a403fSchristos #define bfd_mach_msp110        110
1864440a403fSchristos #define bfd_mach_msp12         12
1865440a403fSchristos #define bfd_mach_msp13         13
1866440a403fSchristos #define bfd_mach_msp14         14
1867440a403fSchristos #define bfd_mach_msp15         15
1868440a403fSchristos #define bfd_mach_msp16         16
1869440a403fSchristos #define bfd_mach_msp20         20
1870440a403fSchristos #define bfd_mach_msp21         21
1871440a403fSchristos #define bfd_mach_msp22         22
1872440a403fSchristos #define bfd_mach_msp23         23
1873440a403fSchristos #define bfd_mach_msp24         24
1874440a403fSchristos #define bfd_mach_msp26         26
1875440a403fSchristos #define bfd_mach_msp31         31
1876440a403fSchristos #define bfd_mach_msp32         32
1877440a403fSchristos #define bfd_mach_msp33         33
1878440a403fSchristos #define bfd_mach_msp41         41
1879440a403fSchristos #define bfd_mach_msp42         42
1880440a403fSchristos #define bfd_mach_msp43         43
1881440a403fSchristos #define bfd_mach_msp44         44
1882440a403fSchristos #define bfd_mach_msp430x       45
1883440a403fSchristos #define bfd_mach_msp46         46
1884440a403fSchristos #define bfd_mach_msp47         47
1885440a403fSchristos #define bfd_mach_msp54         54
1886440a403fSchristos   bfd_arch_xc16x,     /* Infineon's XC16X Series.  */
1887440a403fSchristos #define bfd_mach_xc16x         1
1888440a403fSchristos #define bfd_mach_xc16xl        2
1889440a403fSchristos #define bfd_mach_xc16xs        3
189006324dcfSchristos   bfd_arch_xgate,     /* Freescale XGATE.  */
1891440a403fSchristos #define bfd_mach_xgate         1
1892440a403fSchristos   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
1893440a403fSchristos #define bfd_mach_xtensa        1
1894440a403fSchristos   bfd_arch_z80,
1895*b88e3e88Schristos #define bfd_mach_gbz80         0 /* GameBoy Z80 (reduced instruction set) */
1896*b88e3e88Schristos #define bfd_mach_z80strict     1 /* Z80 without undocumented opcodes.  */
1897*b88e3e88Schristos #define bfd_mach_z180          2 /* Z180: successor with additional instructions, but without halves of ix and iy */
1898*b88e3e88Schristos #define bfd_mach_z80           3 /* Z80 with ixl, ixh, iyl, and iyh.  */
1899*b88e3e88Schristos #define bfd_mach_ez80_z80      4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */
1900*b88e3e88Schristos #define bfd_mach_ez80_adl      5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */
1901*b88e3e88Schristos #define bfd_mach_z80full       7 /* Z80 with all undocumented instructions.  */
1902440a403fSchristos #define bfd_mach_r800          11 /* R800: successor with multiplication.  */
190306324dcfSchristos   bfd_arch_lm32,      /* Lattice Mico32.  */
1904440a403fSchristos #define bfd_mach_lm32          1
1905440a403fSchristos   bfd_arch_microblaze,/* Xilinx MicroBlaze.  */
190606324dcfSchristos   bfd_arch_tilepro,   /* Tilera TILEPro.  */
190706324dcfSchristos   bfd_arch_tilegx,    /* Tilera TILE-Gx.  */
1908440a403fSchristos #define bfd_mach_tilepro       1
1909440a403fSchristos #define bfd_mach_tilegx        1
1910440a403fSchristos #define bfd_mach_tilegx32      2
191106324dcfSchristos   bfd_arch_aarch64,   /* AArch64.  */
1912440a403fSchristos #define bfd_mach_aarch64 0
1913440a403fSchristos #define bfd_mach_aarch64_ilp32 32
191406324dcfSchristos   bfd_arch_nios2,     /* Nios II.  */
1915440a403fSchristos #define bfd_mach_nios2         0
1916440a403fSchristos #define bfd_mach_nios2r1       1
1917440a403fSchristos #define bfd_mach_nios2r2       2
191806324dcfSchristos   bfd_arch_visium,    /* Visium.  */
1919440a403fSchristos #define bfd_mach_visium        1
192006324dcfSchristos   bfd_arch_wasm32,    /* WebAssembly.  */
192106324dcfSchristos #define bfd_mach_wasm32        1
192206324dcfSchristos   bfd_arch_pru,       /* PRU.  */
192306324dcfSchristos #define bfd_mach_pru           0
192406324dcfSchristos   bfd_arch_nfp,       /* Netronome Flow Processor */
192506324dcfSchristos #define bfd_mach_nfp3200       0x3200
192606324dcfSchristos #define bfd_mach_nfp6000       0x6000
1927*b88e3e88Schristos   bfd_arch_csky,      /* C-SKY.  */
1928*b88e3e88Schristos #define bfd_mach_ck_unknown    0
1929*b88e3e88Schristos #define bfd_mach_ck510         1
1930*b88e3e88Schristos #define bfd_mach_ck610         2
1931*b88e3e88Schristos #define bfd_mach_ck801         3
1932*b88e3e88Schristos #define bfd_mach_ck802         4
1933*b88e3e88Schristos #define bfd_mach_ck803         5
1934*b88e3e88Schristos #define bfd_mach_ck807         6
1935*b88e3e88Schristos #define bfd_mach_ck810         7
1936440a403fSchristos   bfd_arch_last
1937440a403fSchristos   };
1938440a403fSchristos 
1939440a403fSchristos typedef struct bfd_arch_info
1940440a403fSchristos {
1941440a403fSchristos   int bits_per_word;
1942440a403fSchristos   int bits_per_address;
1943440a403fSchristos   int bits_per_byte;
1944440a403fSchristos   enum bfd_architecture arch;
1945440a403fSchristos   unsigned long mach;
1946440a403fSchristos   const char *arch_name;
1947440a403fSchristos   const char *printable_name;
1948440a403fSchristos   unsigned int section_align_power;
1949440a403fSchristos   /* TRUE if this is the default machine for the architecture.
1950440a403fSchristos      The default arch should be the first entry for an arch so that
1951440a403fSchristos      all the entries for that arch can be accessed via <<next>>.  */
1952440a403fSchristos   bfd_boolean the_default;
195306324dcfSchristos   const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
195406324dcfSchristos                                               const struct bfd_arch_info *);
1955440a403fSchristos 
1956440a403fSchristos   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
1957440a403fSchristos 
1958440a403fSchristos   /* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
1959440a403fSchristos      IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
1960440a403fSchristos      TRUE, the buffer contains code.  */
1961440a403fSchristos   void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
1962440a403fSchristos                  bfd_boolean code);
1963440a403fSchristos 
1964440a403fSchristos   const struct bfd_arch_info *next;
1965*b88e3e88Schristos 
1966*b88e3e88Schristos   /* On some architectures the offset for a relocation can point into
1967*b88e3e88Schristos      the middle of an instruction.  This field specifies the maximum
1968*b88e3e88Schristos      offset such a relocation can have (in octets).  This affects the
1969*b88e3e88Schristos      behaviour of the disassembler, since a value greater than zero
1970*b88e3e88Schristos      means that it may need to disassemble an instruction twice, once
1971*b88e3e88Schristos      to get its length and then a second time to display it.  If the
1972*b88e3e88Schristos      value is negative then this has to be done for every single
1973*b88e3e88Schristos      instruction, regardless of the offset of the reloc.  */
1974*b88e3e88Schristos   signed int max_reloc_offset_into_insn;
1975440a403fSchristos }
1976440a403fSchristos bfd_arch_info_type;
1977440a403fSchristos 
1978440a403fSchristos const char *bfd_printable_name (bfd *abfd);
1979440a403fSchristos 
1980440a403fSchristos const bfd_arch_info_type *bfd_scan_arch (const char *string);
1981440a403fSchristos 
1982440a403fSchristos const char **bfd_arch_list (void);
1983440a403fSchristos 
1984440a403fSchristos const bfd_arch_info_type *bfd_arch_get_compatible
1985440a403fSchristos    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
1986440a403fSchristos 
1987440a403fSchristos void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
1988440a403fSchristos 
198906324dcfSchristos bfd_boolean bfd_default_set_arch_mach
199006324dcfSchristos    (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
199106324dcfSchristos 
1992*b88e3e88Schristos enum bfd_architecture bfd_get_arch (const bfd *abfd);
1993440a403fSchristos 
1994*b88e3e88Schristos unsigned long bfd_get_mach (const bfd *abfd);
1995440a403fSchristos 
1996*b88e3e88Schristos unsigned int bfd_arch_bits_per_byte (const bfd *abfd);
1997440a403fSchristos 
1998*b88e3e88Schristos unsigned int bfd_arch_bits_per_address (const bfd *abfd);
1999440a403fSchristos 
2000440a403fSchristos const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2001440a403fSchristos 
2002440a403fSchristos const bfd_arch_info_type *bfd_lookup_arch
2003440a403fSchristos    (enum bfd_architecture arch, unsigned long machine);
2004440a403fSchristos 
2005440a403fSchristos const char *bfd_printable_arch_mach
2006440a403fSchristos    (enum bfd_architecture arch, unsigned long machine);
2007440a403fSchristos 
2008*b88e3e88Schristos unsigned int bfd_octets_per_byte (const bfd *abfd,
2009*b88e3e88Schristos     const asection *sec);
2010440a403fSchristos 
2011440a403fSchristos unsigned int bfd_arch_mach_octets_per_byte
2012440a403fSchristos    (enum bfd_architecture arch, unsigned long machine);
2013440a403fSchristos 
2014440a403fSchristos /* Extracted from reloc.c.  */
2015440a403fSchristos 
2016440a403fSchristos typedef enum bfd_reloc_status
2017440a403fSchristos {
201806324dcfSchristos   /* No errors detected.  Note - the value 2 is used so that it
201906324dcfSchristos      will not be mistaken for the boolean TRUE or FALSE values.  */
202006324dcfSchristos   bfd_reloc_ok = 2,
2021440a403fSchristos 
2022440a403fSchristos   /* The relocation was performed, but there was an overflow.  */
2023440a403fSchristos   bfd_reloc_overflow,
2024440a403fSchristos 
2025440a403fSchristos   /* The address to relocate was not within the section supplied.  */
2026440a403fSchristos   bfd_reloc_outofrange,
2027440a403fSchristos 
2028440a403fSchristos   /* Used by special functions.  */
2029440a403fSchristos   bfd_reloc_continue,
2030440a403fSchristos 
2031440a403fSchristos   /* Unsupported relocation size requested.  */
2032440a403fSchristos   bfd_reloc_notsupported,
2033440a403fSchristos 
2034440a403fSchristos   /* Unused.  */
2035440a403fSchristos   bfd_reloc_other,
2036440a403fSchristos 
2037440a403fSchristos   /* The symbol to relocate against was undefined.  */
2038440a403fSchristos   bfd_reloc_undefined,
2039440a403fSchristos 
204006324dcfSchristos   /* The relocation was performed, but may not be ok.  If this type is
204106324dcfSchristos      returned, the error_message argument to bfd_perform_relocation
204206324dcfSchristos      will be set.  */
2043440a403fSchristos   bfd_reloc_dangerous
2044440a403fSchristos  }
2045440a403fSchristos  bfd_reloc_status_type;
2046440a403fSchristos 
2047*b88e3e88Schristos typedef const struct reloc_howto_struct reloc_howto_type;
2048440a403fSchristos 
2049440a403fSchristos typedef struct reloc_cache_entry
2050440a403fSchristos {
2051440a403fSchristos   /* A pointer into the canonical table of pointers.  */
2052440a403fSchristos   struct bfd_symbol **sym_ptr_ptr;
2053440a403fSchristos 
2054440a403fSchristos   /* offset in section.  */
2055440a403fSchristos   bfd_size_type address;
2056440a403fSchristos 
2057440a403fSchristos   /* addend for relocation value.  */
2058440a403fSchristos   bfd_vma addend;
2059440a403fSchristos 
2060440a403fSchristos   /* Pointer to how to perform the required relocation.  */
2061440a403fSchristos   reloc_howto_type *howto;
2062440a403fSchristos 
2063440a403fSchristos }
2064440a403fSchristos arelent;
2065440a403fSchristos 
2066440a403fSchristos 
2067440a403fSchristos enum complain_overflow
2068440a403fSchristos {
2069440a403fSchristos   /* Do not complain on overflow.  */
2070440a403fSchristos   complain_overflow_dont,
2071440a403fSchristos 
2072440a403fSchristos   /* Complain if the value overflows when considered as a signed
2073440a403fSchristos      number one bit larger than the field.  ie. A bitfield of N bits
2074440a403fSchristos      is allowed to represent -2**n to 2**n-1.  */
2075440a403fSchristos   complain_overflow_bitfield,
2076440a403fSchristos 
2077440a403fSchristos   /* Complain if the value overflows when considered as a signed
2078440a403fSchristos      number.  */
2079440a403fSchristos   complain_overflow_signed,
2080440a403fSchristos 
2081440a403fSchristos   /* Complain if the value overflows when considered as an
2082440a403fSchristos      unsigned number.  */
2083440a403fSchristos   complain_overflow_unsigned
2084440a403fSchristos };
2085440a403fSchristos struct reloc_howto_struct
2086440a403fSchristos {
2087440a403fSchristos   /* The type field has mainly a documentary use - the back end can
2088*b88e3e88Schristos      do what it wants with it, though normally the back end's idea of
2089*b88e3e88Schristos      an external reloc number is stored in this field.  */
2090440a403fSchristos   unsigned int type;
2091440a403fSchristos 
2092*b88e3e88Schristos   /* The encoded size of the item to be relocated.  This is *not* a
2093*b88e3e88Schristos      power-of-two measure.  Use bfd_get_reloc_size to find the size
2094*b88e3e88Schristos      of the item in bytes.  */
2095*b88e3e88Schristos   unsigned int size:3;
2096*b88e3e88Schristos 
2097*b88e3e88Schristos   /* The number of bits in the field to be relocated.  This is used
2098*b88e3e88Schristos      when doing overflow checking.  */
2099*b88e3e88Schristos   unsigned int bitsize:7;
2100*b88e3e88Schristos 
2101440a403fSchristos   /* The value the final relocation is shifted right by.  This drops
2102440a403fSchristos      unwanted data from the relocation.  */
2103*b88e3e88Schristos   unsigned int rightshift:6;
2104440a403fSchristos 
2105440a403fSchristos   /* The bit position of the reloc value in the destination.
2106440a403fSchristos      The relocated value is left shifted by this amount.  */
2107*b88e3e88Schristos   unsigned int bitpos:6;
2108440a403fSchristos 
2109440a403fSchristos   /* What type of overflow error should be checked for when
2110440a403fSchristos      relocating.  */
2111*b88e3e88Schristos   ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2112440a403fSchristos 
2113*b88e3e88Schristos   /* The relocation value should be negated before applying.  */
2114*b88e3e88Schristos   unsigned int negate:1;
2115440a403fSchristos 
2116*b88e3e88Schristos   /* The relocation is relative to the item being relocated.  */
2117*b88e3e88Schristos   unsigned int pc_relative:1;
2118440a403fSchristos 
2119440a403fSchristos   /* Some formats record a relocation addend in the section contents
2120440a403fSchristos      rather than with the relocation.  For ELF formats this is the
2121440a403fSchristos      distinction between USE_REL and USE_RELA (though the code checks
2122440a403fSchristos      for USE_REL == 1/0).  The value of this field is TRUE if the
2123440a403fSchristos      addend is recorded with the section contents; when performing a
2124440a403fSchristos      partial link (ld -r) the section contents (the data) will be
2125440a403fSchristos      modified.  The value of this field is FALSE if addends are
2126440a403fSchristos      recorded with the relocation (in arelent.addend); when performing
2127440a403fSchristos      a partial link the relocation will be modified.
2128440a403fSchristos      All relocations for all ELF USE_RELA targets should set this field
2129440a403fSchristos      to FALSE (values of TRUE should be looked on with suspicion).
2130440a403fSchristos      However, the converse is not true: not all relocations of all ELF
2131440a403fSchristos      USE_REL targets set this field to TRUE.  Why this is so is peculiar
2132440a403fSchristos      to each particular target.  For relocs that aren't used in partial
2133440a403fSchristos      links (e.g. GOT stuff) it doesn't matter what this is set to.  */
2134*b88e3e88Schristos   unsigned int partial_inplace:1;
2135440a403fSchristos 
2136440a403fSchristos   /* When some formats create PC relative instructions, they leave
2137440a403fSchristos      the value of the pc of the place being relocated in the offset
2138440a403fSchristos      slot of the instruction, so that a PC relative relocation can
2139440a403fSchristos      be made just by adding in an ordinary offset (e.g., sun3 a.out).
2140440a403fSchristos      Some formats leave the displacement part of an instruction
214106324dcfSchristos      empty (e.g., ELF); this flag signals the fact.  */
2142*b88e3e88Schristos   unsigned int pcrel_offset:1;
2143*b88e3e88Schristos 
2144*b88e3e88Schristos   /* src_mask selects the part of the instruction (or data) to be used
2145*b88e3e88Schristos      in the relocation sum.  If the target relocations don't have an
2146*b88e3e88Schristos      addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
2147*b88e3e88Schristos      dst_mask to extract the addend from the section contents.  If
2148*b88e3e88Schristos      relocations do have an addend in the reloc, eg. ELF USE_RELA, this
2149*b88e3e88Schristos      field should normally be zero.  Non-zero values for ELF USE_RELA
2150*b88e3e88Schristos      targets should be viewed with suspicion as normally the value in
2151*b88e3e88Schristos      the dst_mask part of the section contents should be ignored.  */
2152*b88e3e88Schristos   bfd_vma src_mask;
2153*b88e3e88Schristos 
2154*b88e3e88Schristos   /* dst_mask selects which parts of the instruction (or data) are
2155*b88e3e88Schristos      replaced with a relocated value.  */
2156*b88e3e88Schristos   bfd_vma dst_mask;
2157*b88e3e88Schristos 
2158*b88e3e88Schristos   /* If this field is non null, then the supplied function is
2159*b88e3e88Schristos      called rather than the normal function.  This allows really
2160*b88e3e88Schristos      strange relocation methods to be accommodated.  */
2161*b88e3e88Schristos   bfd_reloc_status_type (*special_function)
2162*b88e3e88Schristos     (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
2163*b88e3e88Schristos      bfd *, char **);
2164*b88e3e88Schristos 
2165*b88e3e88Schristos   /* The textual name of the relocation type.  */
2166*b88e3e88Schristos   const char *name;
2167440a403fSchristos };
2168440a403fSchristos 
2169*b88e3e88Schristos #define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name,   \
2170*b88e3e88Schristos               inplace, src_mask, dst_mask, pcrel_off)                  \
2171*b88e3e88Schristos   { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf,  \
2172*b88e3e88Schristos     size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2173440a403fSchristos #define EMPTY_HOWTO(C) \
2174440a403fSchristos   HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2175440a403fSchristos          NULL, FALSE, 0, 0, FALSE)
2176440a403fSchristos 
2177440a403fSchristos unsigned int bfd_get_reloc_size (reloc_howto_type *);
2178440a403fSchristos 
2179440a403fSchristos typedef struct relent_chain
2180440a403fSchristos {
2181440a403fSchristos   arelent relent;
2182440a403fSchristos   struct relent_chain *next;
2183440a403fSchristos }
2184440a403fSchristos arelent_chain;
2185440a403fSchristos 
2186440a403fSchristos bfd_reloc_status_type bfd_check_overflow
2187440a403fSchristos    (enum complain_overflow how,
2188440a403fSchristos     unsigned int bitsize,
2189440a403fSchristos     unsigned int rightshift,
2190440a403fSchristos     unsigned int addrsize,
2191440a403fSchristos     bfd_vma relocation);
2192440a403fSchristos 
219306324dcfSchristos bfd_boolean bfd_reloc_offset_in_range
219406324dcfSchristos    (reloc_howto_type *howto,
219506324dcfSchristos     bfd *abfd,
219606324dcfSchristos     asection *section,
219706324dcfSchristos     bfd_size_type offset);
219806324dcfSchristos 
2199440a403fSchristos bfd_reloc_status_type bfd_perform_relocation
2200440a403fSchristos    (bfd *abfd,
2201440a403fSchristos     arelent *reloc_entry,
2202440a403fSchristos     void *data,
2203440a403fSchristos     asection *input_section,
2204440a403fSchristos     bfd *output_bfd,
2205440a403fSchristos     char **error_message);
2206440a403fSchristos 
2207440a403fSchristos bfd_reloc_status_type bfd_install_relocation
2208440a403fSchristos    (bfd *abfd,
2209440a403fSchristos     arelent *reloc_entry,
2210440a403fSchristos     void *data, bfd_vma data_start,
2211440a403fSchristos     asection *input_section,
2212440a403fSchristos     char **error_message);
2213440a403fSchristos 
2214440a403fSchristos enum bfd_reloc_code_real {
2215440a403fSchristos   _dummy_first_bfd_reloc_code_real,
2216440a403fSchristos 
2217440a403fSchristos 
2218440a403fSchristos /* Basic absolute relocations of N bits.  */
2219440a403fSchristos   BFD_RELOC_64,
2220440a403fSchristos   BFD_RELOC_32,
2221440a403fSchristos   BFD_RELOC_26,
2222440a403fSchristos   BFD_RELOC_24,
2223440a403fSchristos   BFD_RELOC_16,
2224440a403fSchristos   BFD_RELOC_14,
2225440a403fSchristos   BFD_RELOC_8,
2226440a403fSchristos 
2227440a403fSchristos /* PC-relative relocations.  Sometimes these are relative to the address
2228440a403fSchristos of the relocation itself; sometimes they are relative to the start of
222906324dcfSchristos the section containing the relocation.  It depends on the specific target.  */
2230440a403fSchristos   BFD_RELOC_64_PCREL,
2231440a403fSchristos   BFD_RELOC_32_PCREL,
2232440a403fSchristos   BFD_RELOC_24_PCREL,
2233440a403fSchristos   BFD_RELOC_16_PCREL,
2234440a403fSchristos   BFD_RELOC_12_PCREL,
2235440a403fSchristos   BFD_RELOC_8_PCREL,
2236440a403fSchristos 
2237440a403fSchristos /* Section relative relocations.  Some targets need this for DWARF2.  */
2238440a403fSchristos   BFD_RELOC_32_SECREL,
2239440a403fSchristos 
2240440a403fSchristos /* For ELF.  */
2241440a403fSchristos   BFD_RELOC_32_GOT_PCREL,
2242440a403fSchristos   BFD_RELOC_16_GOT_PCREL,
2243440a403fSchristos   BFD_RELOC_8_GOT_PCREL,
2244440a403fSchristos   BFD_RELOC_32_GOTOFF,
2245440a403fSchristos   BFD_RELOC_16_GOTOFF,
2246440a403fSchristos   BFD_RELOC_LO16_GOTOFF,
2247440a403fSchristos   BFD_RELOC_HI16_GOTOFF,
2248440a403fSchristos   BFD_RELOC_HI16_S_GOTOFF,
2249440a403fSchristos   BFD_RELOC_8_GOTOFF,
2250440a403fSchristos   BFD_RELOC_64_PLT_PCREL,
2251440a403fSchristos   BFD_RELOC_32_PLT_PCREL,
2252440a403fSchristos   BFD_RELOC_24_PLT_PCREL,
2253440a403fSchristos   BFD_RELOC_16_PLT_PCREL,
2254440a403fSchristos   BFD_RELOC_8_PLT_PCREL,
2255440a403fSchristos   BFD_RELOC_64_PLTOFF,
2256440a403fSchristos   BFD_RELOC_32_PLTOFF,
2257440a403fSchristos   BFD_RELOC_16_PLTOFF,
2258440a403fSchristos   BFD_RELOC_LO16_PLTOFF,
2259440a403fSchristos   BFD_RELOC_HI16_PLTOFF,
2260440a403fSchristos   BFD_RELOC_HI16_S_PLTOFF,
2261440a403fSchristos   BFD_RELOC_8_PLTOFF,
2262440a403fSchristos 
2263440a403fSchristos /* Size relocations.  */
2264440a403fSchristos   BFD_RELOC_SIZE32,
2265440a403fSchristos   BFD_RELOC_SIZE64,
2266440a403fSchristos 
2267440a403fSchristos /* Relocations used by 68K ELF.  */
2268440a403fSchristos   BFD_RELOC_68K_GLOB_DAT,
2269440a403fSchristos   BFD_RELOC_68K_JMP_SLOT,
2270440a403fSchristos   BFD_RELOC_68K_RELATIVE,
2271440a403fSchristos   BFD_RELOC_68K_TLS_GD32,
2272440a403fSchristos   BFD_RELOC_68K_TLS_GD16,
2273440a403fSchristos   BFD_RELOC_68K_TLS_GD8,
2274440a403fSchristos   BFD_RELOC_68K_TLS_LDM32,
2275440a403fSchristos   BFD_RELOC_68K_TLS_LDM16,
2276440a403fSchristos   BFD_RELOC_68K_TLS_LDM8,
2277440a403fSchristos   BFD_RELOC_68K_TLS_LDO32,
2278440a403fSchristos   BFD_RELOC_68K_TLS_LDO16,
2279440a403fSchristos   BFD_RELOC_68K_TLS_LDO8,
2280440a403fSchristos   BFD_RELOC_68K_TLS_IE32,
2281440a403fSchristos   BFD_RELOC_68K_TLS_IE16,
2282440a403fSchristos   BFD_RELOC_68K_TLS_IE8,
2283440a403fSchristos   BFD_RELOC_68K_TLS_LE32,
2284440a403fSchristos   BFD_RELOC_68K_TLS_LE16,
2285440a403fSchristos   BFD_RELOC_68K_TLS_LE8,
2286440a403fSchristos 
2287440a403fSchristos /* Linkage-table relative.  */
2288440a403fSchristos   BFD_RELOC_32_BASEREL,
2289440a403fSchristos   BFD_RELOC_16_BASEREL,
2290440a403fSchristos   BFD_RELOC_LO16_BASEREL,
2291440a403fSchristos   BFD_RELOC_HI16_BASEREL,
2292440a403fSchristos   BFD_RELOC_HI16_S_BASEREL,
2293440a403fSchristos   BFD_RELOC_8_BASEREL,
2294440a403fSchristos   BFD_RELOC_RVA,
2295440a403fSchristos 
2296440a403fSchristos /* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
2297440a403fSchristos   BFD_RELOC_8_FFnn,
2298440a403fSchristos 
2299440a403fSchristos /* These PC-relative relocations are stored as word displacements --
2300440a403fSchristos i.e., byte displacements shifted right two bits.  The 30-bit word
2301440a403fSchristos displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2302440a403fSchristos SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
2303440a403fSchristos signed 16-bit displacement is used on the MIPS, and the 23-bit
2304440a403fSchristos displacement is used on the Alpha.  */
2305440a403fSchristos   BFD_RELOC_32_PCREL_S2,
2306440a403fSchristos   BFD_RELOC_16_PCREL_S2,
2307440a403fSchristos   BFD_RELOC_23_PCREL_S2,
2308440a403fSchristos 
2309440a403fSchristos /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2310440a403fSchristos the target word.  These are used on the SPARC.  */
2311440a403fSchristos   BFD_RELOC_HI22,
2312440a403fSchristos   BFD_RELOC_LO10,
2313440a403fSchristos 
2314440a403fSchristos /* For systems that allocate a Global Pointer register, these are
2315440a403fSchristos displacements off that register.  These relocation types are
2316440a403fSchristos handled specially, because the value the register will have is
2317440a403fSchristos decided relatively late.  */
2318440a403fSchristos   BFD_RELOC_GPREL16,
2319440a403fSchristos   BFD_RELOC_GPREL32,
2320440a403fSchristos 
2321440a403fSchristos /* SPARC ELF relocations.  There is probably some overlap with other
2322440a403fSchristos relocation types already defined.  */
2323440a403fSchristos   BFD_RELOC_NONE,
2324440a403fSchristos   BFD_RELOC_SPARC_WDISP22,
2325440a403fSchristos   BFD_RELOC_SPARC22,
2326440a403fSchristos   BFD_RELOC_SPARC13,
2327440a403fSchristos   BFD_RELOC_SPARC_GOT10,
2328440a403fSchristos   BFD_RELOC_SPARC_GOT13,
2329440a403fSchristos   BFD_RELOC_SPARC_GOT22,
2330440a403fSchristos   BFD_RELOC_SPARC_PC10,
2331440a403fSchristos   BFD_RELOC_SPARC_PC22,
2332440a403fSchristos   BFD_RELOC_SPARC_WPLT30,
2333440a403fSchristos   BFD_RELOC_SPARC_COPY,
2334440a403fSchristos   BFD_RELOC_SPARC_GLOB_DAT,
2335440a403fSchristos   BFD_RELOC_SPARC_JMP_SLOT,
2336440a403fSchristos   BFD_RELOC_SPARC_RELATIVE,
2337440a403fSchristos   BFD_RELOC_SPARC_UA16,
2338440a403fSchristos   BFD_RELOC_SPARC_UA32,
2339440a403fSchristos   BFD_RELOC_SPARC_UA64,
2340440a403fSchristos   BFD_RELOC_SPARC_GOTDATA_HIX22,
2341440a403fSchristos   BFD_RELOC_SPARC_GOTDATA_LOX10,
2342440a403fSchristos   BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2343440a403fSchristos   BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2344440a403fSchristos   BFD_RELOC_SPARC_GOTDATA_OP,
2345440a403fSchristos   BFD_RELOC_SPARC_JMP_IREL,
2346440a403fSchristos   BFD_RELOC_SPARC_IRELATIVE,
2347440a403fSchristos 
2348440a403fSchristos /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
2349440a403fSchristos   BFD_RELOC_SPARC_BASE13,
2350440a403fSchristos   BFD_RELOC_SPARC_BASE22,
2351440a403fSchristos 
2352440a403fSchristos /* SPARC64 relocations  */
2353440a403fSchristos #define BFD_RELOC_SPARC_64 BFD_RELOC_64
2354440a403fSchristos   BFD_RELOC_SPARC_10,
2355440a403fSchristos   BFD_RELOC_SPARC_11,
2356440a403fSchristos   BFD_RELOC_SPARC_OLO10,
2357440a403fSchristos   BFD_RELOC_SPARC_HH22,
2358440a403fSchristos   BFD_RELOC_SPARC_HM10,
2359440a403fSchristos   BFD_RELOC_SPARC_LM22,
2360440a403fSchristos   BFD_RELOC_SPARC_PC_HH22,
2361440a403fSchristos   BFD_RELOC_SPARC_PC_HM10,
2362440a403fSchristos   BFD_RELOC_SPARC_PC_LM22,
2363440a403fSchristos   BFD_RELOC_SPARC_WDISP16,
2364440a403fSchristos   BFD_RELOC_SPARC_WDISP19,
2365440a403fSchristos   BFD_RELOC_SPARC_7,
2366440a403fSchristos   BFD_RELOC_SPARC_6,
2367440a403fSchristos   BFD_RELOC_SPARC_5,
2368440a403fSchristos #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2369440a403fSchristos   BFD_RELOC_SPARC_PLT32,
2370440a403fSchristos   BFD_RELOC_SPARC_PLT64,
2371440a403fSchristos   BFD_RELOC_SPARC_HIX22,
2372440a403fSchristos   BFD_RELOC_SPARC_LOX10,
2373440a403fSchristos   BFD_RELOC_SPARC_H44,
2374440a403fSchristos   BFD_RELOC_SPARC_M44,
2375440a403fSchristos   BFD_RELOC_SPARC_L44,
2376440a403fSchristos   BFD_RELOC_SPARC_REGISTER,
2377440a403fSchristos   BFD_RELOC_SPARC_H34,
2378440a403fSchristos   BFD_RELOC_SPARC_SIZE32,
2379440a403fSchristos   BFD_RELOC_SPARC_SIZE64,
2380440a403fSchristos   BFD_RELOC_SPARC_WDISP10,
2381440a403fSchristos 
2382440a403fSchristos /* SPARC little endian relocation  */
2383440a403fSchristos   BFD_RELOC_SPARC_REV32,
2384440a403fSchristos 
2385440a403fSchristos /* SPARC TLS relocations  */
2386440a403fSchristos   BFD_RELOC_SPARC_TLS_GD_HI22,
2387440a403fSchristos   BFD_RELOC_SPARC_TLS_GD_LO10,
2388440a403fSchristos   BFD_RELOC_SPARC_TLS_GD_ADD,
2389440a403fSchristos   BFD_RELOC_SPARC_TLS_GD_CALL,
2390440a403fSchristos   BFD_RELOC_SPARC_TLS_LDM_HI22,
2391440a403fSchristos   BFD_RELOC_SPARC_TLS_LDM_LO10,
2392440a403fSchristos   BFD_RELOC_SPARC_TLS_LDM_ADD,
2393440a403fSchristos   BFD_RELOC_SPARC_TLS_LDM_CALL,
2394440a403fSchristos   BFD_RELOC_SPARC_TLS_LDO_HIX22,
2395440a403fSchristos   BFD_RELOC_SPARC_TLS_LDO_LOX10,
2396440a403fSchristos   BFD_RELOC_SPARC_TLS_LDO_ADD,
2397440a403fSchristos   BFD_RELOC_SPARC_TLS_IE_HI22,
2398440a403fSchristos   BFD_RELOC_SPARC_TLS_IE_LO10,
2399440a403fSchristos   BFD_RELOC_SPARC_TLS_IE_LD,
2400440a403fSchristos   BFD_RELOC_SPARC_TLS_IE_LDX,
2401440a403fSchristos   BFD_RELOC_SPARC_TLS_IE_ADD,
2402440a403fSchristos   BFD_RELOC_SPARC_TLS_LE_HIX22,
2403440a403fSchristos   BFD_RELOC_SPARC_TLS_LE_LOX10,
2404440a403fSchristos   BFD_RELOC_SPARC_TLS_DTPMOD32,
2405440a403fSchristos   BFD_RELOC_SPARC_TLS_DTPMOD64,
2406440a403fSchristos   BFD_RELOC_SPARC_TLS_DTPOFF32,
2407440a403fSchristos   BFD_RELOC_SPARC_TLS_DTPOFF64,
2408440a403fSchristos   BFD_RELOC_SPARC_TLS_TPOFF32,
2409440a403fSchristos   BFD_RELOC_SPARC_TLS_TPOFF64,
2410440a403fSchristos 
2411440a403fSchristos /* SPU Relocations.  */
2412440a403fSchristos   BFD_RELOC_SPU_IMM7,
2413440a403fSchristos   BFD_RELOC_SPU_IMM8,
2414440a403fSchristos   BFD_RELOC_SPU_IMM10,
2415440a403fSchristos   BFD_RELOC_SPU_IMM10W,
2416440a403fSchristos   BFD_RELOC_SPU_IMM16,
2417440a403fSchristos   BFD_RELOC_SPU_IMM16W,
2418440a403fSchristos   BFD_RELOC_SPU_IMM18,
2419440a403fSchristos   BFD_RELOC_SPU_PCREL9a,
2420440a403fSchristos   BFD_RELOC_SPU_PCREL9b,
2421440a403fSchristos   BFD_RELOC_SPU_PCREL16,
2422440a403fSchristos   BFD_RELOC_SPU_LO16,
2423440a403fSchristos   BFD_RELOC_SPU_HI16,
2424440a403fSchristos   BFD_RELOC_SPU_PPU32,
2425440a403fSchristos   BFD_RELOC_SPU_PPU64,
2426440a403fSchristos   BFD_RELOC_SPU_ADD_PIC,
2427440a403fSchristos 
2428440a403fSchristos /* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
2429440a403fSchristos "addend" in some special way.
2430440a403fSchristos For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2431440a403fSchristos writing; when reading, it will be the absolute section symbol.  The
2432440a403fSchristos addend is the displacement in bytes of the "lda" instruction from
2433440a403fSchristos the "ldah" instruction (which is at the address of this reloc).  */
2434440a403fSchristos   BFD_RELOC_ALPHA_GPDISP_HI16,
2435440a403fSchristos 
2436440a403fSchristos /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2437440a403fSchristos with GPDISP_HI16 relocs.  The addend is ignored when writing the
2438440a403fSchristos relocations out, and is filled in with the file's GP value on
2439440a403fSchristos reading, for convenience.  */
2440440a403fSchristos   BFD_RELOC_ALPHA_GPDISP_LO16,
2441440a403fSchristos 
2442440a403fSchristos /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2443440a403fSchristos relocation except that there is no accompanying GPDISP_LO16
2444440a403fSchristos relocation.  */
2445440a403fSchristos   BFD_RELOC_ALPHA_GPDISP,
2446440a403fSchristos 
2447440a403fSchristos /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2448440a403fSchristos the assembler turns it into a LDQ instruction to load the address of
2449440a403fSchristos the symbol, and then fills in a register in the real instruction.
2450440a403fSchristos 
2451440a403fSchristos The LITERAL reloc, at the LDQ instruction, refers to the .lita
2452440a403fSchristos section symbol.  The addend is ignored when writing, but is filled
2453440a403fSchristos in with the file's GP value on reading, for convenience, as with the
2454440a403fSchristos GPDISP_LO16 reloc.
2455440a403fSchristos 
2456440a403fSchristos The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2457440a403fSchristos It should refer to the symbol to be referenced, as with 16_GOTOFF,
2458440a403fSchristos but it generates output not based on the position within the .got
2459440a403fSchristos section, but relative to the GP value chosen for the file during the
2460440a403fSchristos final link stage.
2461440a403fSchristos 
2462440a403fSchristos The LITUSE reloc, on the instruction using the loaded address, gives
2463440a403fSchristos information to the linker that it might be able to use to optimize
2464440a403fSchristos away some literal section references.  The symbol is ignored (read
2465440a403fSchristos as the absolute section symbol), and the "addend" indicates the type
2466440a403fSchristos of instruction using the register:
2467440a403fSchristos 1 - "memory" fmt insn
2468440a403fSchristos 2 - byte-manipulation (byte offset reg)
2469440a403fSchristos 3 - jsr (target of branch)  */
2470440a403fSchristos   BFD_RELOC_ALPHA_LITERAL,
2471440a403fSchristos   BFD_RELOC_ALPHA_ELF_LITERAL,
2472440a403fSchristos   BFD_RELOC_ALPHA_LITUSE,
2473440a403fSchristos 
2474440a403fSchristos /* The HINT relocation indicates a value that should be filled into the
2475440a403fSchristos "hint" field of a jmp/jsr/ret instruction, for possible branch-
2476440a403fSchristos prediction logic which may be provided on some processors.  */
2477440a403fSchristos   BFD_RELOC_ALPHA_HINT,
2478440a403fSchristos 
2479440a403fSchristos /* The LINKAGE relocation outputs a linkage pair in the object file,
2480440a403fSchristos which is filled by the linker.  */
2481440a403fSchristos   BFD_RELOC_ALPHA_LINKAGE,
2482440a403fSchristos 
2483440a403fSchristos /* The CODEADDR relocation outputs a STO_CA in the object file,
2484440a403fSchristos which is filled by the linker.  */
2485440a403fSchristos   BFD_RELOC_ALPHA_CODEADDR,
2486440a403fSchristos 
2487440a403fSchristos /* The GPREL_HI/LO relocations together form a 32-bit offset from the
2488440a403fSchristos GP register.  */
2489440a403fSchristos   BFD_RELOC_ALPHA_GPREL_HI16,
2490440a403fSchristos   BFD_RELOC_ALPHA_GPREL_LO16,
2491440a403fSchristos 
2492440a403fSchristos /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2493440a403fSchristos share a common GP, and the target address is adjusted for
2494440a403fSchristos STO_ALPHA_STD_GPLOAD.  */
2495440a403fSchristos   BFD_RELOC_ALPHA_BRSGP,
2496440a403fSchristos 
2497440a403fSchristos /* The NOP relocation outputs a NOP if the longword displacement
2498440a403fSchristos between two procedure entry points is < 2^21.  */
2499440a403fSchristos   BFD_RELOC_ALPHA_NOP,
2500440a403fSchristos 
2501440a403fSchristos /* The BSR relocation outputs a BSR if the longword displacement
2502440a403fSchristos between two procedure entry points is < 2^21.  */
2503440a403fSchristos   BFD_RELOC_ALPHA_BSR,
2504440a403fSchristos 
2505440a403fSchristos /* The LDA relocation outputs a LDA if the longword displacement
2506440a403fSchristos between two procedure entry points is < 2^16.  */
2507440a403fSchristos   BFD_RELOC_ALPHA_LDA,
2508440a403fSchristos 
2509440a403fSchristos /* The BOH relocation outputs a BSR if the longword displacement
2510440a403fSchristos between two procedure entry points is < 2^21, or else a hint.  */
2511440a403fSchristos   BFD_RELOC_ALPHA_BOH,
2512440a403fSchristos 
2513440a403fSchristos /* Alpha thread-local storage relocations.  */
2514440a403fSchristos   BFD_RELOC_ALPHA_TLSGD,
2515440a403fSchristos   BFD_RELOC_ALPHA_TLSLDM,
2516440a403fSchristos   BFD_RELOC_ALPHA_DTPMOD64,
2517440a403fSchristos   BFD_RELOC_ALPHA_GOTDTPREL16,
2518440a403fSchristos   BFD_RELOC_ALPHA_DTPREL64,
2519440a403fSchristos   BFD_RELOC_ALPHA_DTPREL_HI16,
2520440a403fSchristos   BFD_RELOC_ALPHA_DTPREL_LO16,
2521440a403fSchristos   BFD_RELOC_ALPHA_DTPREL16,
2522440a403fSchristos   BFD_RELOC_ALPHA_GOTTPREL16,
2523440a403fSchristos   BFD_RELOC_ALPHA_TPREL64,
2524440a403fSchristos   BFD_RELOC_ALPHA_TPREL_HI16,
2525440a403fSchristos   BFD_RELOC_ALPHA_TPREL_LO16,
2526440a403fSchristos   BFD_RELOC_ALPHA_TPREL16,
2527440a403fSchristos 
2528440a403fSchristos /* The MIPS jump instruction.  */
2529440a403fSchristos   BFD_RELOC_MIPS_JMP,
2530440a403fSchristos   BFD_RELOC_MICROMIPS_JMP,
2531440a403fSchristos 
2532440a403fSchristos /* The MIPS16 jump instruction.  */
2533440a403fSchristos   BFD_RELOC_MIPS16_JMP,
2534440a403fSchristos 
2535440a403fSchristos /* MIPS16 GP relative reloc.  */
2536440a403fSchristos   BFD_RELOC_MIPS16_GPREL,
2537440a403fSchristos 
2538440a403fSchristos /* High 16 bits of 32-bit value; simple reloc.  */
2539440a403fSchristos   BFD_RELOC_HI16,
2540440a403fSchristos 
2541440a403fSchristos /* High 16 bits of 32-bit value but the low 16 bits will be sign
2542440a403fSchristos extended and added to form the final result.  If the low 16
2543440a403fSchristos bits form a negative number, we need to add one to the high value
2544440a403fSchristos to compensate for the borrow when the low bits are added.  */
2545440a403fSchristos   BFD_RELOC_HI16_S,
2546440a403fSchristos 
2547440a403fSchristos /* Low 16 bits.  */
2548440a403fSchristos   BFD_RELOC_LO16,
2549440a403fSchristos 
2550440a403fSchristos /* High 16 bits of 32-bit pc-relative value  */
2551440a403fSchristos   BFD_RELOC_HI16_PCREL,
2552440a403fSchristos 
2553440a403fSchristos /* High 16 bits of 32-bit pc-relative value, adjusted  */
2554440a403fSchristos   BFD_RELOC_HI16_S_PCREL,
2555440a403fSchristos 
2556440a403fSchristos /* Low 16 bits of pc-relative value  */
2557440a403fSchristos   BFD_RELOC_LO16_PCREL,
2558440a403fSchristos 
2559440a403fSchristos /* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
2560440a403fSchristos 16-bit immediate fields  */
2561440a403fSchristos   BFD_RELOC_MIPS16_GOT16,
2562440a403fSchristos   BFD_RELOC_MIPS16_CALL16,
2563440a403fSchristos 
2564440a403fSchristos /* MIPS16 high 16 bits of 32-bit value.  */
2565440a403fSchristos   BFD_RELOC_MIPS16_HI16,
2566440a403fSchristos 
2567440a403fSchristos /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
2568440a403fSchristos extended and added to form the final result.  If the low 16
2569440a403fSchristos bits form a negative number, we need to add one to the high value
2570440a403fSchristos to compensate for the borrow when the low bits are added.  */
2571440a403fSchristos   BFD_RELOC_MIPS16_HI16_S,
2572440a403fSchristos 
2573440a403fSchristos /* MIPS16 low 16 bits.  */
2574440a403fSchristos   BFD_RELOC_MIPS16_LO16,
2575440a403fSchristos 
2576440a403fSchristos /* MIPS16 TLS relocations  */
2577440a403fSchristos   BFD_RELOC_MIPS16_TLS_GD,
2578440a403fSchristos   BFD_RELOC_MIPS16_TLS_LDM,
2579440a403fSchristos   BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
2580440a403fSchristos   BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
2581440a403fSchristos   BFD_RELOC_MIPS16_TLS_GOTTPREL,
2582440a403fSchristos   BFD_RELOC_MIPS16_TLS_TPREL_HI16,
2583440a403fSchristos   BFD_RELOC_MIPS16_TLS_TPREL_LO16,
2584440a403fSchristos 
2585440a403fSchristos /* Relocation against a MIPS literal section.  */
2586440a403fSchristos   BFD_RELOC_MIPS_LITERAL,
2587440a403fSchristos   BFD_RELOC_MICROMIPS_LITERAL,
2588440a403fSchristos 
2589440a403fSchristos /* microMIPS PC-relative relocations.  */
2590440a403fSchristos   BFD_RELOC_MICROMIPS_7_PCREL_S1,
2591440a403fSchristos   BFD_RELOC_MICROMIPS_10_PCREL_S1,
2592440a403fSchristos   BFD_RELOC_MICROMIPS_16_PCREL_S1,
2593440a403fSchristos 
2594440a403fSchristos /* MIPS16 PC-relative relocation.  */
2595440a403fSchristos   BFD_RELOC_MIPS16_16_PCREL_S1,
2596440a403fSchristos 
2597440a403fSchristos /* MIPS PC-relative relocations.  */
2598440a403fSchristos   BFD_RELOC_MIPS_21_PCREL_S2,
2599440a403fSchristos   BFD_RELOC_MIPS_26_PCREL_S2,
2600440a403fSchristos   BFD_RELOC_MIPS_18_PCREL_S3,
2601440a403fSchristos   BFD_RELOC_MIPS_19_PCREL_S2,
2602440a403fSchristos 
2603440a403fSchristos /* microMIPS versions of generic BFD relocs.  */
2604440a403fSchristos   BFD_RELOC_MICROMIPS_GPREL16,
2605440a403fSchristos   BFD_RELOC_MICROMIPS_HI16,
2606440a403fSchristos   BFD_RELOC_MICROMIPS_HI16_S,
2607440a403fSchristos   BFD_RELOC_MICROMIPS_LO16,
2608440a403fSchristos 
2609440a403fSchristos /* MIPS ELF relocations.  */
2610440a403fSchristos   BFD_RELOC_MIPS_GOT16,
2611440a403fSchristos   BFD_RELOC_MICROMIPS_GOT16,
2612440a403fSchristos   BFD_RELOC_MIPS_CALL16,
2613440a403fSchristos   BFD_RELOC_MICROMIPS_CALL16,
2614440a403fSchristos   BFD_RELOC_MIPS_GOT_HI16,
2615440a403fSchristos   BFD_RELOC_MICROMIPS_GOT_HI16,
2616440a403fSchristos   BFD_RELOC_MIPS_GOT_LO16,
2617440a403fSchristos   BFD_RELOC_MICROMIPS_GOT_LO16,
2618440a403fSchristos   BFD_RELOC_MIPS_CALL_HI16,
2619440a403fSchristos   BFD_RELOC_MICROMIPS_CALL_HI16,
2620440a403fSchristos   BFD_RELOC_MIPS_CALL_LO16,
2621440a403fSchristos   BFD_RELOC_MICROMIPS_CALL_LO16,
2622440a403fSchristos   BFD_RELOC_MIPS_SUB,
2623440a403fSchristos   BFD_RELOC_MICROMIPS_SUB,
2624440a403fSchristos   BFD_RELOC_MIPS_GOT_PAGE,
2625440a403fSchristos   BFD_RELOC_MICROMIPS_GOT_PAGE,
2626440a403fSchristos   BFD_RELOC_MIPS_GOT_OFST,
2627440a403fSchristos   BFD_RELOC_MICROMIPS_GOT_OFST,
2628440a403fSchristos   BFD_RELOC_MIPS_GOT_DISP,
2629440a403fSchristos   BFD_RELOC_MICROMIPS_GOT_DISP,
2630440a403fSchristos   BFD_RELOC_MIPS_SHIFT5,
2631440a403fSchristos   BFD_RELOC_MIPS_SHIFT6,
2632440a403fSchristos   BFD_RELOC_MIPS_INSERT_A,
2633440a403fSchristos   BFD_RELOC_MIPS_INSERT_B,
2634440a403fSchristos   BFD_RELOC_MIPS_DELETE,
2635440a403fSchristos   BFD_RELOC_MIPS_HIGHEST,
2636440a403fSchristos   BFD_RELOC_MICROMIPS_HIGHEST,
2637440a403fSchristos   BFD_RELOC_MIPS_HIGHER,
2638440a403fSchristos   BFD_RELOC_MICROMIPS_HIGHER,
2639440a403fSchristos   BFD_RELOC_MIPS_SCN_DISP,
2640440a403fSchristos   BFD_RELOC_MICROMIPS_SCN_DISP,
2641440a403fSchristos   BFD_RELOC_MIPS_REL16,
2642440a403fSchristos   BFD_RELOC_MIPS_RELGOT,
2643440a403fSchristos   BFD_RELOC_MIPS_JALR,
2644440a403fSchristos   BFD_RELOC_MICROMIPS_JALR,
2645440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPMOD32,
2646440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPREL32,
2647440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPMOD64,
2648440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPREL64,
2649440a403fSchristos   BFD_RELOC_MIPS_TLS_GD,
2650440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_GD,
2651440a403fSchristos   BFD_RELOC_MIPS_TLS_LDM,
2652440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_LDM,
2653440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPREL_HI16,
2654440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
2655440a403fSchristos   BFD_RELOC_MIPS_TLS_DTPREL_LO16,
2656440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
2657440a403fSchristos   BFD_RELOC_MIPS_TLS_GOTTPREL,
2658440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
2659440a403fSchristos   BFD_RELOC_MIPS_TLS_TPREL32,
2660440a403fSchristos   BFD_RELOC_MIPS_TLS_TPREL64,
2661440a403fSchristos   BFD_RELOC_MIPS_TLS_TPREL_HI16,
2662440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
2663440a403fSchristos   BFD_RELOC_MIPS_TLS_TPREL_LO16,
2664440a403fSchristos   BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
2665440a403fSchristos   BFD_RELOC_MIPS_EH,
2666440a403fSchristos 
2667440a403fSchristos 
2668440a403fSchristos /* MIPS ELF relocations (VxWorks and PLT extensions).  */
2669440a403fSchristos   BFD_RELOC_MIPS_COPY,
2670440a403fSchristos   BFD_RELOC_MIPS_JUMP_SLOT,
2671440a403fSchristos 
2672440a403fSchristos 
2673440a403fSchristos /* Moxie ELF relocations.  */
2674440a403fSchristos   BFD_RELOC_MOXIE_10_PCREL,
2675440a403fSchristos 
2676440a403fSchristos 
2677440a403fSchristos /* FT32 ELF relocations.  */
2678440a403fSchristos   BFD_RELOC_FT32_10,
2679440a403fSchristos   BFD_RELOC_FT32_20,
2680440a403fSchristos   BFD_RELOC_FT32_17,
2681440a403fSchristos   BFD_RELOC_FT32_18,
268206324dcfSchristos   BFD_RELOC_FT32_RELAX,
268306324dcfSchristos   BFD_RELOC_FT32_SC0,
268406324dcfSchristos   BFD_RELOC_FT32_SC1,
268506324dcfSchristos   BFD_RELOC_FT32_15,
268606324dcfSchristos   BFD_RELOC_FT32_DIFF32,
2687440a403fSchristos 
2688440a403fSchristos 
2689440a403fSchristos /* Fujitsu Frv Relocations.  */
2690440a403fSchristos   BFD_RELOC_FRV_LABEL16,
2691440a403fSchristos   BFD_RELOC_FRV_LABEL24,
2692440a403fSchristos   BFD_RELOC_FRV_LO16,
2693440a403fSchristos   BFD_RELOC_FRV_HI16,
2694440a403fSchristos   BFD_RELOC_FRV_GPREL12,
2695440a403fSchristos   BFD_RELOC_FRV_GPRELU12,
2696440a403fSchristos   BFD_RELOC_FRV_GPREL32,
2697440a403fSchristos   BFD_RELOC_FRV_GPRELHI,
2698440a403fSchristos   BFD_RELOC_FRV_GPRELLO,
2699440a403fSchristos   BFD_RELOC_FRV_GOT12,
2700440a403fSchristos   BFD_RELOC_FRV_GOTHI,
2701440a403fSchristos   BFD_RELOC_FRV_GOTLO,
2702440a403fSchristos   BFD_RELOC_FRV_FUNCDESC,
2703440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOT12,
2704440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOTHI,
2705440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOTLO,
2706440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_VALUE,
2707440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
2708440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
2709440a403fSchristos   BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
2710440a403fSchristos   BFD_RELOC_FRV_GOTOFF12,
2711440a403fSchristos   BFD_RELOC_FRV_GOTOFFHI,
2712440a403fSchristos   BFD_RELOC_FRV_GOTOFFLO,
2713440a403fSchristos   BFD_RELOC_FRV_GETTLSOFF,
2714440a403fSchristos   BFD_RELOC_FRV_TLSDESC_VALUE,
2715440a403fSchristos   BFD_RELOC_FRV_GOTTLSDESC12,
2716440a403fSchristos   BFD_RELOC_FRV_GOTTLSDESCHI,
2717440a403fSchristos   BFD_RELOC_FRV_GOTTLSDESCLO,
2718440a403fSchristos   BFD_RELOC_FRV_TLSMOFF12,
2719440a403fSchristos   BFD_RELOC_FRV_TLSMOFFHI,
2720440a403fSchristos   BFD_RELOC_FRV_TLSMOFFLO,
2721440a403fSchristos   BFD_RELOC_FRV_GOTTLSOFF12,
2722440a403fSchristos   BFD_RELOC_FRV_GOTTLSOFFHI,
2723440a403fSchristos   BFD_RELOC_FRV_GOTTLSOFFLO,
2724440a403fSchristos   BFD_RELOC_FRV_TLSOFF,
2725440a403fSchristos   BFD_RELOC_FRV_TLSDESC_RELAX,
2726440a403fSchristos   BFD_RELOC_FRV_GETTLSOFF_RELAX,
2727440a403fSchristos   BFD_RELOC_FRV_TLSOFF_RELAX,
2728440a403fSchristos   BFD_RELOC_FRV_TLSMOFF,
2729440a403fSchristos 
2730440a403fSchristos 
2731440a403fSchristos /* This is a 24bit GOT-relative reloc for the mn10300.  */
2732440a403fSchristos   BFD_RELOC_MN10300_GOTOFF24,
2733440a403fSchristos 
2734440a403fSchristos /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
2735440a403fSchristos in the instruction.  */
2736440a403fSchristos   BFD_RELOC_MN10300_GOT32,
2737440a403fSchristos 
2738440a403fSchristos /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
2739440a403fSchristos in the instruction.  */
2740440a403fSchristos   BFD_RELOC_MN10300_GOT24,
2741440a403fSchristos 
2742440a403fSchristos /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
2743440a403fSchristos in the instruction.  */
2744440a403fSchristos   BFD_RELOC_MN10300_GOT16,
2745440a403fSchristos 
2746440a403fSchristos /* Copy symbol at runtime.  */
2747440a403fSchristos   BFD_RELOC_MN10300_COPY,
2748440a403fSchristos 
2749440a403fSchristos /* Create GOT entry.  */
2750440a403fSchristos   BFD_RELOC_MN10300_GLOB_DAT,
2751440a403fSchristos 
2752440a403fSchristos /* Create PLT entry.  */
2753440a403fSchristos   BFD_RELOC_MN10300_JMP_SLOT,
2754440a403fSchristos 
2755440a403fSchristos /* Adjust by program base.  */
2756440a403fSchristos   BFD_RELOC_MN10300_RELATIVE,
2757440a403fSchristos 
2758440a403fSchristos /* Together with another reloc targeted at the same location,
2759440a403fSchristos allows for a value that is the difference of two symbols
2760440a403fSchristos in the same section.  */
2761440a403fSchristos   BFD_RELOC_MN10300_SYM_DIFF,
2762440a403fSchristos 
2763440a403fSchristos /* The addend of this reloc is an alignment power that must
2764440a403fSchristos be honoured at the offset's location, regardless of linker
2765440a403fSchristos relaxation.  */
2766440a403fSchristos   BFD_RELOC_MN10300_ALIGN,
2767440a403fSchristos 
2768440a403fSchristos /* Various TLS-related relocations.  */
2769440a403fSchristos   BFD_RELOC_MN10300_TLS_GD,
2770440a403fSchristos   BFD_RELOC_MN10300_TLS_LD,
2771440a403fSchristos   BFD_RELOC_MN10300_TLS_LDO,
2772440a403fSchristos   BFD_RELOC_MN10300_TLS_GOTIE,
2773440a403fSchristos   BFD_RELOC_MN10300_TLS_IE,
2774440a403fSchristos   BFD_RELOC_MN10300_TLS_LE,
2775440a403fSchristos   BFD_RELOC_MN10300_TLS_DTPMOD,
2776440a403fSchristos   BFD_RELOC_MN10300_TLS_DTPOFF,
2777440a403fSchristos   BFD_RELOC_MN10300_TLS_TPOFF,
2778440a403fSchristos 
2779440a403fSchristos /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
2780440a403fSchristos instruction.  */
2781440a403fSchristos   BFD_RELOC_MN10300_32_PCREL,
2782440a403fSchristos 
2783440a403fSchristos /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
2784440a403fSchristos instruction.  */
2785440a403fSchristos   BFD_RELOC_MN10300_16_PCREL,
2786440a403fSchristos 
2787440a403fSchristos 
2788440a403fSchristos /* i386/elf relocations  */
2789440a403fSchristos   BFD_RELOC_386_GOT32,
2790440a403fSchristos   BFD_RELOC_386_PLT32,
2791440a403fSchristos   BFD_RELOC_386_COPY,
2792440a403fSchristos   BFD_RELOC_386_GLOB_DAT,
2793440a403fSchristos   BFD_RELOC_386_JUMP_SLOT,
2794440a403fSchristos   BFD_RELOC_386_RELATIVE,
2795440a403fSchristos   BFD_RELOC_386_GOTOFF,
2796440a403fSchristos   BFD_RELOC_386_GOTPC,
2797440a403fSchristos   BFD_RELOC_386_TLS_TPOFF,
2798440a403fSchristos   BFD_RELOC_386_TLS_IE,
2799440a403fSchristos   BFD_RELOC_386_TLS_GOTIE,
2800440a403fSchristos   BFD_RELOC_386_TLS_LE,
2801440a403fSchristos   BFD_RELOC_386_TLS_GD,
2802440a403fSchristos   BFD_RELOC_386_TLS_LDM,
2803440a403fSchristos   BFD_RELOC_386_TLS_LDO_32,
2804440a403fSchristos   BFD_RELOC_386_TLS_IE_32,
2805440a403fSchristos   BFD_RELOC_386_TLS_LE_32,
2806440a403fSchristos   BFD_RELOC_386_TLS_DTPMOD32,
2807440a403fSchristos   BFD_RELOC_386_TLS_DTPOFF32,
2808440a403fSchristos   BFD_RELOC_386_TLS_TPOFF32,
2809440a403fSchristos   BFD_RELOC_386_TLS_GOTDESC,
2810440a403fSchristos   BFD_RELOC_386_TLS_DESC_CALL,
2811440a403fSchristos   BFD_RELOC_386_TLS_DESC,
2812440a403fSchristos   BFD_RELOC_386_IRELATIVE,
2813440a403fSchristos   BFD_RELOC_386_GOT32X,
2814440a403fSchristos 
2815440a403fSchristos /* x86-64/elf relocations  */
2816440a403fSchristos   BFD_RELOC_X86_64_GOT32,
2817440a403fSchristos   BFD_RELOC_X86_64_PLT32,
2818440a403fSchristos   BFD_RELOC_X86_64_COPY,
2819440a403fSchristos   BFD_RELOC_X86_64_GLOB_DAT,
2820440a403fSchristos   BFD_RELOC_X86_64_JUMP_SLOT,
2821440a403fSchristos   BFD_RELOC_X86_64_RELATIVE,
2822440a403fSchristos   BFD_RELOC_X86_64_GOTPCREL,
2823440a403fSchristos   BFD_RELOC_X86_64_32S,
2824440a403fSchristos   BFD_RELOC_X86_64_DTPMOD64,
2825440a403fSchristos   BFD_RELOC_X86_64_DTPOFF64,
2826440a403fSchristos   BFD_RELOC_X86_64_TPOFF64,
2827440a403fSchristos   BFD_RELOC_X86_64_TLSGD,
2828440a403fSchristos   BFD_RELOC_X86_64_TLSLD,
2829440a403fSchristos   BFD_RELOC_X86_64_DTPOFF32,
2830440a403fSchristos   BFD_RELOC_X86_64_GOTTPOFF,
2831440a403fSchristos   BFD_RELOC_X86_64_TPOFF32,
2832440a403fSchristos   BFD_RELOC_X86_64_GOTOFF64,
2833440a403fSchristos   BFD_RELOC_X86_64_GOTPC32,
2834440a403fSchristos   BFD_RELOC_X86_64_GOT64,
2835440a403fSchristos   BFD_RELOC_X86_64_GOTPCREL64,
2836440a403fSchristos   BFD_RELOC_X86_64_GOTPC64,
2837440a403fSchristos   BFD_RELOC_X86_64_GOTPLT64,
2838440a403fSchristos   BFD_RELOC_X86_64_PLTOFF64,
2839440a403fSchristos   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
2840440a403fSchristos   BFD_RELOC_X86_64_TLSDESC_CALL,
2841440a403fSchristos   BFD_RELOC_X86_64_TLSDESC,
2842440a403fSchristos   BFD_RELOC_X86_64_IRELATIVE,
2843440a403fSchristos   BFD_RELOC_X86_64_PC32_BND,
2844440a403fSchristos   BFD_RELOC_X86_64_PLT32_BND,
2845440a403fSchristos   BFD_RELOC_X86_64_GOTPCRELX,
2846440a403fSchristos   BFD_RELOC_X86_64_REX_GOTPCRELX,
2847440a403fSchristos 
2848440a403fSchristos /* ns32k relocations  */
2849440a403fSchristos   BFD_RELOC_NS32K_IMM_8,
2850440a403fSchristos   BFD_RELOC_NS32K_IMM_16,
2851440a403fSchristos   BFD_RELOC_NS32K_IMM_32,
2852440a403fSchristos   BFD_RELOC_NS32K_IMM_8_PCREL,
2853440a403fSchristos   BFD_RELOC_NS32K_IMM_16_PCREL,
2854440a403fSchristos   BFD_RELOC_NS32K_IMM_32_PCREL,
2855440a403fSchristos   BFD_RELOC_NS32K_DISP_8,
2856440a403fSchristos   BFD_RELOC_NS32K_DISP_16,
2857440a403fSchristos   BFD_RELOC_NS32K_DISP_32,
2858440a403fSchristos   BFD_RELOC_NS32K_DISP_8_PCREL,
2859440a403fSchristos   BFD_RELOC_NS32K_DISP_16_PCREL,
2860440a403fSchristos   BFD_RELOC_NS32K_DISP_32_PCREL,
2861440a403fSchristos 
2862440a403fSchristos /* PDP11 relocations  */
2863440a403fSchristos   BFD_RELOC_PDP11_DISP_8_PCREL,
2864440a403fSchristos   BFD_RELOC_PDP11_DISP_6_PCREL,
2865440a403fSchristos 
2866440a403fSchristos /* Picojava relocs.  Not all of these appear in object files.  */
2867440a403fSchristos   BFD_RELOC_PJ_CODE_HI16,
2868440a403fSchristos   BFD_RELOC_PJ_CODE_LO16,
2869440a403fSchristos   BFD_RELOC_PJ_CODE_DIR16,
2870440a403fSchristos   BFD_RELOC_PJ_CODE_DIR32,
2871440a403fSchristos   BFD_RELOC_PJ_CODE_REL16,
2872440a403fSchristos   BFD_RELOC_PJ_CODE_REL32,
2873440a403fSchristos 
2874440a403fSchristos /* Power(rs6000) and PowerPC relocations.  */
2875440a403fSchristos   BFD_RELOC_PPC_B26,
2876440a403fSchristos   BFD_RELOC_PPC_BA26,
2877440a403fSchristos   BFD_RELOC_PPC_TOC16,
2878440a403fSchristos   BFD_RELOC_PPC_B16,
2879440a403fSchristos   BFD_RELOC_PPC_B16_BRTAKEN,
2880440a403fSchristos   BFD_RELOC_PPC_B16_BRNTAKEN,
2881440a403fSchristos   BFD_RELOC_PPC_BA16,
2882440a403fSchristos   BFD_RELOC_PPC_BA16_BRTAKEN,
2883440a403fSchristos   BFD_RELOC_PPC_BA16_BRNTAKEN,
2884440a403fSchristos   BFD_RELOC_PPC_COPY,
2885440a403fSchristos   BFD_RELOC_PPC_GLOB_DAT,
2886440a403fSchristos   BFD_RELOC_PPC_JMP_SLOT,
2887440a403fSchristos   BFD_RELOC_PPC_RELATIVE,
2888440a403fSchristos   BFD_RELOC_PPC_LOCAL24PC,
2889440a403fSchristos   BFD_RELOC_PPC_EMB_NADDR32,
2890440a403fSchristos   BFD_RELOC_PPC_EMB_NADDR16,
2891440a403fSchristos   BFD_RELOC_PPC_EMB_NADDR16_LO,
2892440a403fSchristos   BFD_RELOC_PPC_EMB_NADDR16_HI,
2893440a403fSchristos   BFD_RELOC_PPC_EMB_NADDR16_HA,
2894440a403fSchristos   BFD_RELOC_PPC_EMB_SDAI16,
2895440a403fSchristos   BFD_RELOC_PPC_EMB_SDA2I16,
2896440a403fSchristos   BFD_RELOC_PPC_EMB_SDA2REL,
2897440a403fSchristos   BFD_RELOC_PPC_EMB_SDA21,
2898440a403fSchristos   BFD_RELOC_PPC_EMB_MRKREF,
2899440a403fSchristos   BFD_RELOC_PPC_EMB_RELSEC16,
2900440a403fSchristos   BFD_RELOC_PPC_EMB_RELST_LO,
2901440a403fSchristos   BFD_RELOC_PPC_EMB_RELST_HI,
2902440a403fSchristos   BFD_RELOC_PPC_EMB_RELST_HA,
2903440a403fSchristos   BFD_RELOC_PPC_EMB_BIT_FLD,
2904440a403fSchristos   BFD_RELOC_PPC_EMB_RELSDA,
2905440a403fSchristos   BFD_RELOC_PPC_VLE_REL8,
2906440a403fSchristos   BFD_RELOC_PPC_VLE_REL15,
2907440a403fSchristos   BFD_RELOC_PPC_VLE_REL24,
2908440a403fSchristos   BFD_RELOC_PPC_VLE_LO16A,
2909440a403fSchristos   BFD_RELOC_PPC_VLE_LO16D,
2910440a403fSchristos   BFD_RELOC_PPC_VLE_HI16A,
2911440a403fSchristos   BFD_RELOC_PPC_VLE_HI16D,
2912440a403fSchristos   BFD_RELOC_PPC_VLE_HA16A,
2913440a403fSchristos   BFD_RELOC_PPC_VLE_HA16D,
2914440a403fSchristos   BFD_RELOC_PPC_VLE_SDA21,
2915440a403fSchristos   BFD_RELOC_PPC_VLE_SDA21_LO,
2916440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_LO16A,
2917440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_LO16D,
2918440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_HI16A,
2919440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_HI16D,
2920440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_HA16A,
2921440a403fSchristos   BFD_RELOC_PPC_VLE_SDAREL_HA16D,
292206324dcfSchristos   BFD_RELOC_PPC_16DX_HA,
2923440a403fSchristos   BFD_RELOC_PPC_REL16DX_HA,
2924440a403fSchristos   BFD_RELOC_PPC64_HIGHER,
2925440a403fSchristos   BFD_RELOC_PPC64_HIGHER_S,
2926440a403fSchristos   BFD_RELOC_PPC64_HIGHEST,
2927440a403fSchristos   BFD_RELOC_PPC64_HIGHEST_S,
2928440a403fSchristos   BFD_RELOC_PPC64_TOC16_LO,
2929440a403fSchristos   BFD_RELOC_PPC64_TOC16_HI,
2930440a403fSchristos   BFD_RELOC_PPC64_TOC16_HA,
2931440a403fSchristos   BFD_RELOC_PPC64_TOC,
2932440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16,
2933440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16_LO,
2934440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16_HI,
2935440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16_HA,
2936440a403fSchristos   BFD_RELOC_PPC64_ADDR16_DS,
2937440a403fSchristos   BFD_RELOC_PPC64_ADDR16_LO_DS,
2938440a403fSchristos   BFD_RELOC_PPC64_GOT16_DS,
2939440a403fSchristos   BFD_RELOC_PPC64_GOT16_LO_DS,
2940440a403fSchristos   BFD_RELOC_PPC64_PLT16_LO_DS,
2941440a403fSchristos   BFD_RELOC_PPC64_SECTOFF_DS,
2942440a403fSchristos   BFD_RELOC_PPC64_SECTOFF_LO_DS,
2943440a403fSchristos   BFD_RELOC_PPC64_TOC16_DS,
2944440a403fSchristos   BFD_RELOC_PPC64_TOC16_LO_DS,
2945440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16_DS,
2946440a403fSchristos   BFD_RELOC_PPC64_PLTGOT16_LO_DS,
2947440a403fSchristos   BFD_RELOC_PPC64_ADDR16_HIGH,
2948440a403fSchristos   BFD_RELOC_PPC64_ADDR16_HIGHA,
2949*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGH,
2950*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHA,
2951*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHER,
2952*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHERA,
2953*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHEST,
2954*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHESTA,
2955440a403fSchristos   BFD_RELOC_PPC64_ADDR64_LOCAL,
2956440a403fSchristos   BFD_RELOC_PPC64_ENTRY,
2957*b88e3e88Schristos   BFD_RELOC_PPC64_REL24_NOTOC,
2958*b88e3e88Schristos   BFD_RELOC_PPC64_D34,
2959*b88e3e88Schristos   BFD_RELOC_PPC64_D34_LO,
2960*b88e3e88Schristos   BFD_RELOC_PPC64_D34_HI30,
2961*b88e3e88Schristos   BFD_RELOC_PPC64_D34_HA30,
2962*b88e3e88Schristos   BFD_RELOC_PPC64_PCREL34,
2963*b88e3e88Schristos   BFD_RELOC_PPC64_GOT_PCREL34,
2964*b88e3e88Schristos   BFD_RELOC_PPC64_PLT_PCREL34,
2965*b88e3e88Schristos   BFD_RELOC_PPC64_ADDR16_HIGHER34,
2966*b88e3e88Schristos   BFD_RELOC_PPC64_ADDR16_HIGHERA34,
2967*b88e3e88Schristos   BFD_RELOC_PPC64_ADDR16_HIGHEST34,
2968*b88e3e88Schristos   BFD_RELOC_PPC64_ADDR16_HIGHESTA34,
2969*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHER34,
2970*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHERA34,
2971*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHEST34,
2972*b88e3e88Schristos   BFD_RELOC_PPC64_REL16_HIGHESTA34,
2973*b88e3e88Schristos   BFD_RELOC_PPC64_D28,
2974*b88e3e88Schristos   BFD_RELOC_PPC64_PCREL28,
2975440a403fSchristos 
2976440a403fSchristos /* PowerPC and PowerPC64 thread-local storage relocations.  */
2977440a403fSchristos   BFD_RELOC_PPC_TLS,
2978440a403fSchristos   BFD_RELOC_PPC_TLSGD,
2979440a403fSchristos   BFD_RELOC_PPC_TLSLD,
2980440a403fSchristos   BFD_RELOC_PPC_DTPMOD,
2981440a403fSchristos   BFD_RELOC_PPC_TPREL16,
2982440a403fSchristos   BFD_RELOC_PPC_TPREL16_LO,
2983440a403fSchristos   BFD_RELOC_PPC_TPREL16_HI,
2984440a403fSchristos   BFD_RELOC_PPC_TPREL16_HA,
2985440a403fSchristos   BFD_RELOC_PPC_TPREL,
2986440a403fSchristos   BFD_RELOC_PPC_DTPREL16,
2987440a403fSchristos   BFD_RELOC_PPC_DTPREL16_LO,
2988440a403fSchristos   BFD_RELOC_PPC_DTPREL16_HI,
2989440a403fSchristos   BFD_RELOC_PPC_DTPREL16_HA,
2990440a403fSchristos   BFD_RELOC_PPC_DTPREL,
2991440a403fSchristos   BFD_RELOC_PPC_GOT_TLSGD16,
2992440a403fSchristos   BFD_RELOC_PPC_GOT_TLSGD16_LO,
2993440a403fSchristos   BFD_RELOC_PPC_GOT_TLSGD16_HI,
2994440a403fSchristos   BFD_RELOC_PPC_GOT_TLSGD16_HA,
2995440a403fSchristos   BFD_RELOC_PPC_GOT_TLSLD16,
2996440a403fSchristos   BFD_RELOC_PPC_GOT_TLSLD16_LO,
2997440a403fSchristos   BFD_RELOC_PPC_GOT_TLSLD16_HI,
2998440a403fSchristos   BFD_RELOC_PPC_GOT_TLSLD16_HA,
2999440a403fSchristos   BFD_RELOC_PPC_GOT_TPREL16,
3000440a403fSchristos   BFD_RELOC_PPC_GOT_TPREL16_LO,
3001440a403fSchristos   BFD_RELOC_PPC_GOT_TPREL16_HI,
3002440a403fSchristos   BFD_RELOC_PPC_GOT_TPREL16_HA,
3003440a403fSchristos   BFD_RELOC_PPC_GOT_DTPREL16,
3004440a403fSchristos   BFD_RELOC_PPC_GOT_DTPREL16_LO,
3005440a403fSchristos   BFD_RELOC_PPC_GOT_DTPREL16_HI,
3006440a403fSchristos   BFD_RELOC_PPC_GOT_DTPREL16_HA,
3007440a403fSchristos   BFD_RELOC_PPC64_TPREL16_DS,
3008440a403fSchristos   BFD_RELOC_PPC64_TPREL16_LO_DS,
3009*b88e3e88Schristos   BFD_RELOC_PPC64_TPREL16_HIGH,
3010*b88e3e88Schristos   BFD_RELOC_PPC64_TPREL16_HIGHA,
3011440a403fSchristos   BFD_RELOC_PPC64_TPREL16_HIGHER,
3012440a403fSchristos   BFD_RELOC_PPC64_TPREL16_HIGHERA,
3013440a403fSchristos   BFD_RELOC_PPC64_TPREL16_HIGHEST,
3014440a403fSchristos   BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3015440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_DS,
3016440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_LO_DS,
3017*b88e3e88Schristos   BFD_RELOC_PPC64_DTPREL16_HIGH,
3018*b88e3e88Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHA,
3019440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_HIGHER,
3020440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3021440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3022440a403fSchristos   BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3023*b88e3e88Schristos   BFD_RELOC_PPC64_TPREL34,
3024*b88e3e88Schristos   BFD_RELOC_PPC64_DTPREL34,
3025*b88e3e88Schristos   BFD_RELOC_PPC64_GOT_TLSGD34,
3026*b88e3e88Schristos   BFD_RELOC_PPC64_GOT_TLSLD34,
3027*b88e3e88Schristos   BFD_RELOC_PPC64_GOT_TPREL34,
3028*b88e3e88Schristos   BFD_RELOC_PPC64_GOT_DTPREL34,
3029*b88e3e88Schristos   BFD_RELOC_PPC64_TLS_PCREL,
3030440a403fSchristos 
3031440a403fSchristos /* IBM 370/390 relocations  */
3032440a403fSchristos   BFD_RELOC_I370_D12,
3033440a403fSchristos 
3034440a403fSchristos /* The type of reloc used to build a constructor table - at the moment
3035440a403fSchristos probably a 32 bit wide absolute relocation, but the target can choose.
3036440a403fSchristos It generally does map to one of the other relocation types.  */
3037440a403fSchristos   BFD_RELOC_CTOR,
3038440a403fSchristos 
3039440a403fSchristos /* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
3040440a403fSchristos not stored in the instruction.  */
3041440a403fSchristos   BFD_RELOC_ARM_PCREL_BRANCH,
3042440a403fSchristos 
3043440a403fSchristos /* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
3044440a403fSchristos not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
3045440a403fSchristos field in the instruction.  */
3046440a403fSchristos   BFD_RELOC_ARM_PCREL_BLX,
3047440a403fSchristos 
3048440a403fSchristos /* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
3049440a403fSchristos not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
3050440a403fSchristos field in the instruction.  */
3051440a403fSchristos   BFD_RELOC_THUMB_PCREL_BLX,
3052440a403fSchristos 
3053440a403fSchristos /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
3054440a403fSchristos   BFD_RELOC_ARM_PCREL_CALL,
3055440a403fSchristos 
3056440a403fSchristos /* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
3057440a403fSchristos   BFD_RELOC_ARM_PCREL_JUMP,
3058440a403fSchristos 
3059*b88e3e88Schristos /* ARM 5-bit pc-relative branch for Branch Future instructions.  */
3060*b88e3e88Schristos   BFD_RELOC_THUMB_PCREL_BRANCH5,
3061*b88e3e88Schristos 
3062*b88e3e88Schristos /* ARM 6-bit pc-relative branch for BFCSEL instruction.  */
3063*b88e3e88Schristos   BFD_RELOC_THUMB_PCREL_BFCSEL,
3064*b88e3e88Schristos 
3065*b88e3e88Schristos /* ARM 17-bit pc-relative branch for Branch Future instructions.  */
3066*b88e3e88Schristos   BFD_RELOC_ARM_THUMB_BF17,
3067*b88e3e88Schristos 
3068*b88e3e88Schristos /* ARM 13-bit pc-relative branch for BFCSEL instruction.  */
3069*b88e3e88Schristos   BFD_RELOC_ARM_THUMB_BF13,
3070*b88e3e88Schristos 
3071*b88e3e88Schristos /* ARM 19-bit pc-relative branch for Branch Future Link instruction.  */
3072*b88e3e88Schristos   BFD_RELOC_ARM_THUMB_BF19,
3073*b88e3e88Schristos 
3074*b88e3e88Schristos /* ARM 12-bit pc-relative branch for Low Overhead Loop instructions.  */
3075*b88e3e88Schristos   BFD_RELOC_ARM_THUMB_LOOP12,
3076*b88e3e88Schristos 
3077440a403fSchristos /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3078440a403fSchristos The lowest bit must be zero and is not stored in the instruction.
3079440a403fSchristos Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3080440a403fSchristos "nn" one smaller in all cases.  Note further that BRANCH23
3081440a403fSchristos corresponds to R_ARM_THM_CALL.  */
3082440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH7,
3083440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH9,
3084440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH12,
3085440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH20,
3086440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH23,
3087440a403fSchristos   BFD_RELOC_THUMB_PCREL_BRANCH25,
3088440a403fSchristos 
3089440a403fSchristos /* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
3090440a403fSchristos   BFD_RELOC_ARM_OFFSET_IMM,
3091440a403fSchristos 
3092440a403fSchristos /* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
3093440a403fSchristos   BFD_RELOC_ARM_THUMB_OFFSET,
3094440a403fSchristos 
3095440a403fSchristos /* Pc-relative or absolute relocation depending on target.  Used for
3096440a403fSchristos entries in .init_array sections.  */
3097440a403fSchristos   BFD_RELOC_ARM_TARGET1,
3098440a403fSchristos 
3099440a403fSchristos /* Read-only segment base relative address.  */
3100440a403fSchristos   BFD_RELOC_ARM_ROSEGREL32,
3101440a403fSchristos 
3102440a403fSchristos /* Data segment base relative address.  */
3103440a403fSchristos   BFD_RELOC_ARM_SBREL32,
3104440a403fSchristos 
3105440a403fSchristos /* This reloc is used for references to RTTI data from exception handling
3106440a403fSchristos tables.  The actual definition depends on the target.  It may be a
3107440a403fSchristos pc-relative or some form of GOT-indirect relocation.  */
3108440a403fSchristos   BFD_RELOC_ARM_TARGET2,
3109440a403fSchristos 
3110440a403fSchristos /* 31-bit PC relative address.  */
3111440a403fSchristos   BFD_RELOC_ARM_PREL31,
3112440a403fSchristos 
3113440a403fSchristos /* Low and High halfword relocations for MOVW and MOVT instructions.  */
3114440a403fSchristos   BFD_RELOC_ARM_MOVW,
3115440a403fSchristos   BFD_RELOC_ARM_MOVT,
3116440a403fSchristos   BFD_RELOC_ARM_MOVW_PCREL,
3117440a403fSchristos   BFD_RELOC_ARM_MOVT_PCREL,
3118440a403fSchristos   BFD_RELOC_ARM_THUMB_MOVW,
3119440a403fSchristos   BFD_RELOC_ARM_THUMB_MOVT,
3120440a403fSchristos   BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3121440a403fSchristos   BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3122440a403fSchristos 
312306324dcfSchristos /* ARM FDPIC specific relocations.  */
312406324dcfSchristos   BFD_RELOC_ARM_GOTFUNCDESC,
312506324dcfSchristos   BFD_RELOC_ARM_GOTOFFFUNCDESC,
312606324dcfSchristos   BFD_RELOC_ARM_FUNCDESC,
312706324dcfSchristos   BFD_RELOC_ARM_FUNCDESC_VALUE,
312806324dcfSchristos   BFD_RELOC_ARM_TLS_GD32_FDPIC,
312906324dcfSchristos   BFD_RELOC_ARM_TLS_LDM32_FDPIC,
313006324dcfSchristos   BFD_RELOC_ARM_TLS_IE32_FDPIC,
313106324dcfSchristos 
3132440a403fSchristos /* Relocations for setting up GOTs and PLTs for shared libraries.  */
3133440a403fSchristos   BFD_RELOC_ARM_JUMP_SLOT,
3134440a403fSchristos   BFD_RELOC_ARM_GLOB_DAT,
3135440a403fSchristos   BFD_RELOC_ARM_GOT32,
3136440a403fSchristos   BFD_RELOC_ARM_PLT32,
3137440a403fSchristos   BFD_RELOC_ARM_RELATIVE,
3138440a403fSchristos   BFD_RELOC_ARM_GOTOFF,
3139440a403fSchristos   BFD_RELOC_ARM_GOTPC,
3140440a403fSchristos   BFD_RELOC_ARM_GOT_PREL,
3141440a403fSchristos 
3142440a403fSchristos /* ARM thread-local storage relocations.  */
3143440a403fSchristos   BFD_RELOC_ARM_TLS_GD32,
3144440a403fSchristos   BFD_RELOC_ARM_TLS_LDO32,
3145440a403fSchristos   BFD_RELOC_ARM_TLS_LDM32,
3146440a403fSchristos   BFD_RELOC_ARM_TLS_DTPOFF32,
3147440a403fSchristos   BFD_RELOC_ARM_TLS_DTPMOD32,
3148440a403fSchristos   BFD_RELOC_ARM_TLS_TPOFF32,
3149440a403fSchristos   BFD_RELOC_ARM_TLS_IE32,
3150440a403fSchristos   BFD_RELOC_ARM_TLS_LE32,
3151440a403fSchristos   BFD_RELOC_ARM_TLS_GOTDESC,
3152440a403fSchristos   BFD_RELOC_ARM_TLS_CALL,
3153440a403fSchristos   BFD_RELOC_ARM_THM_TLS_CALL,
3154440a403fSchristos   BFD_RELOC_ARM_TLS_DESCSEQ,
3155440a403fSchristos   BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3156440a403fSchristos   BFD_RELOC_ARM_TLS_DESC,
3157440a403fSchristos 
3158440a403fSchristos /* ARM group relocations.  */
3159440a403fSchristos   BFD_RELOC_ARM_ALU_PC_G0_NC,
3160440a403fSchristos   BFD_RELOC_ARM_ALU_PC_G0,
3161440a403fSchristos   BFD_RELOC_ARM_ALU_PC_G1_NC,
3162440a403fSchristos   BFD_RELOC_ARM_ALU_PC_G1,
3163440a403fSchristos   BFD_RELOC_ARM_ALU_PC_G2,
3164440a403fSchristos   BFD_RELOC_ARM_LDR_PC_G0,
3165440a403fSchristos   BFD_RELOC_ARM_LDR_PC_G1,
3166440a403fSchristos   BFD_RELOC_ARM_LDR_PC_G2,
3167440a403fSchristos   BFD_RELOC_ARM_LDRS_PC_G0,
3168440a403fSchristos   BFD_RELOC_ARM_LDRS_PC_G1,
3169440a403fSchristos   BFD_RELOC_ARM_LDRS_PC_G2,
3170440a403fSchristos   BFD_RELOC_ARM_LDC_PC_G0,
3171440a403fSchristos   BFD_RELOC_ARM_LDC_PC_G1,
3172440a403fSchristos   BFD_RELOC_ARM_LDC_PC_G2,
3173440a403fSchristos   BFD_RELOC_ARM_ALU_SB_G0_NC,
3174440a403fSchristos   BFD_RELOC_ARM_ALU_SB_G0,
3175440a403fSchristos   BFD_RELOC_ARM_ALU_SB_G1_NC,
3176440a403fSchristos   BFD_RELOC_ARM_ALU_SB_G1,
3177440a403fSchristos   BFD_RELOC_ARM_ALU_SB_G2,
3178440a403fSchristos   BFD_RELOC_ARM_LDR_SB_G0,
3179440a403fSchristos   BFD_RELOC_ARM_LDR_SB_G1,
3180440a403fSchristos   BFD_RELOC_ARM_LDR_SB_G2,
3181440a403fSchristos   BFD_RELOC_ARM_LDRS_SB_G0,
3182440a403fSchristos   BFD_RELOC_ARM_LDRS_SB_G1,
3183440a403fSchristos   BFD_RELOC_ARM_LDRS_SB_G2,
3184440a403fSchristos   BFD_RELOC_ARM_LDC_SB_G0,
3185440a403fSchristos   BFD_RELOC_ARM_LDC_SB_G1,
3186440a403fSchristos   BFD_RELOC_ARM_LDC_SB_G2,
3187440a403fSchristos 
3188440a403fSchristos /* Annotation of BX instructions.  */
3189440a403fSchristos   BFD_RELOC_ARM_V4BX,
3190440a403fSchristos 
3191440a403fSchristos /* ARM support for STT_GNU_IFUNC.  */
3192440a403fSchristos   BFD_RELOC_ARM_IRELATIVE,
3193440a403fSchristos 
3194440a403fSchristos /* Thumb1 relocations to support execute-only code.  */
3195440a403fSchristos   BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3196440a403fSchristos   BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3197440a403fSchristos   BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3198440a403fSchristos   BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3199440a403fSchristos 
3200440a403fSchristos /* These relocs are only used within the ARM assembler.  They are not
3201440a403fSchristos (at present) written to any object files.  */
3202440a403fSchristos   BFD_RELOC_ARM_IMMEDIATE,
3203440a403fSchristos   BFD_RELOC_ARM_ADRL_IMMEDIATE,
3204440a403fSchristos   BFD_RELOC_ARM_T32_IMMEDIATE,
3205440a403fSchristos   BFD_RELOC_ARM_T32_ADD_IMM,
3206440a403fSchristos   BFD_RELOC_ARM_T32_IMM12,
3207440a403fSchristos   BFD_RELOC_ARM_T32_ADD_PC12,
3208440a403fSchristos   BFD_RELOC_ARM_SHIFT_IMM,
3209440a403fSchristos   BFD_RELOC_ARM_SMC,
3210440a403fSchristos   BFD_RELOC_ARM_HVC,
3211440a403fSchristos   BFD_RELOC_ARM_SWI,
3212440a403fSchristos   BFD_RELOC_ARM_MULTI,
3213440a403fSchristos   BFD_RELOC_ARM_CP_OFF_IMM,
3214440a403fSchristos   BFD_RELOC_ARM_CP_OFF_IMM_S2,
3215440a403fSchristos   BFD_RELOC_ARM_T32_CP_OFF_IMM,
3216440a403fSchristos   BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3217*b88e3e88Schristos   BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM,
3218440a403fSchristos   BFD_RELOC_ARM_ADR_IMM,
3219440a403fSchristos   BFD_RELOC_ARM_LDR_IMM,
3220440a403fSchristos   BFD_RELOC_ARM_LITERAL,
3221440a403fSchristos   BFD_RELOC_ARM_IN_POOL,
3222440a403fSchristos   BFD_RELOC_ARM_OFFSET_IMM8,
3223440a403fSchristos   BFD_RELOC_ARM_T32_OFFSET_U8,
3224440a403fSchristos   BFD_RELOC_ARM_T32_OFFSET_IMM,
3225440a403fSchristos   BFD_RELOC_ARM_HWLITERAL,
3226440a403fSchristos   BFD_RELOC_ARM_THUMB_ADD,
3227440a403fSchristos   BFD_RELOC_ARM_THUMB_IMM,
3228440a403fSchristos   BFD_RELOC_ARM_THUMB_SHIFT,
3229440a403fSchristos 
3230440a403fSchristos /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
3231440a403fSchristos   BFD_RELOC_SH_PCDISP8BY2,
3232440a403fSchristos   BFD_RELOC_SH_PCDISP12BY2,
3233440a403fSchristos   BFD_RELOC_SH_IMM3,
3234440a403fSchristos   BFD_RELOC_SH_IMM3U,
3235440a403fSchristos   BFD_RELOC_SH_DISP12,
3236440a403fSchristos   BFD_RELOC_SH_DISP12BY2,
3237440a403fSchristos   BFD_RELOC_SH_DISP12BY4,
3238440a403fSchristos   BFD_RELOC_SH_DISP12BY8,
3239440a403fSchristos   BFD_RELOC_SH_DISP20,
3240440a403fSchristos   BFD_RELOC_SH_DISP20BY8,
3241440a403fSchristos   BFD_RELOC_SH_IMM4,
3242440a403fSchristos   BFD_RELOC_SH_IMM4BY2,
3243440a403fSchristos   BFD_RELOC_SH_IMM4BY4,
3244440a403fSchristos   BFD_RELOC_SH_IMM8,
3245440a403fSchristos   BFD_RELOC_SH_IMM8BY2,
3246440a403fSchristos   BFD_RELOC_SH_IMM8BY4,
3247440a403fSchristos   BFD_RELOC_SH_PCRELIMM8BY2,
3248440a403fSchristos   BFD_RELOC_SH_PCRELIMM8BY4,
3249440a403fSchristos   BFD_RELOC_SH_SWITCH16,
3250440a403fSchristos   BFD_RELOC_SH_SWITCH32,
3251440a403fSchristos   BFD_RELOC_SH_USES,
3252440a403fSchristos   BFD_RELOC_SH_COUNT,
3253440a403fSchristos   BFD_RELOC_SH_ALIGN,
3254440a403fSchristos   BFD_RELOC_SH_CODE,
3255440a403fSchristos   BFD_RELOC_SH_DATA,
3256440a403fSchristos   BFD_RELOC_SH_LABEL,
3257440a403fSchristos   BFD_RELOC_SH_LOOP_START,
3258440a403fSchristos   BFD_RELOC_SH_LOOP_END,
3259440a403fSchristos   BFD_RELOC_SH_COPY,
3260440a403fSchristos   BFD_RELOC_SH_GLOB_DAT,
3261440a403fSchristos   BFD_RELOC_SH_JMP_SLOT,
3262440a403fSchristos   BFD_RELOC_SH_RELATIVE,
3263440a403fSchristos   BFD_RELOC_SH_GOTPC,
3264440a403fSchristos   BFD_RELOC_SH_GOT_LOW16,
3265440a403fSchristos   BFD_RELOC_SH_GOT_MEDLOW16,
3266440a403fSchristos   BFD_RELOC_SH_GOT_MEDHI16,
3267440a403fSchristos   BFD_RELOC_SH_GOT_HI16,
3268440a403fSchristos   BFD_RELOC_SH_GOTPLT_LOW16,
3269440a403fSchristos   BFD_RELOC_SH_GOTPLT_MEDLOW16,
3270440a403fSchristos   BFD_RELOC_SH_GOTPLT_MEDHI16,
3271440a403fSchristos   BFD_RELOC_SH_GOTPLT_HI16,
3272440a403fSchristos   BFD_RELOC_SH_PLT_LOW16,
3273440a403fSchristos   BFD_RELOC_SH_PLT_MEDLOW16,
3274440a403fSchristos   BFD_RELOC_SH_PLT_MEDHI16,
3275440a403fSchristos   BFD_RELOC_SH_PLT_HI16,
3276440a403fSchristos   BFD_RELOC_SH_GOTOFF_LOW16,
3277440a403fSchristos   BFD_RELOC_SH_GOTOFF_MEDLOW16,
3278440a403fSchristos   BFD_RELOC_SH_GOTOFF_MEDHI16,
3279440a403fSchristos   BFD_RELOC_SH_GOTOFF_HI16,
3280440a403fSchristos   BFD_RELOC_SH_GOTPC_LOW16,
3281440a403fSchristos   BFD_RELOC_SH_GOTPC_MEDLOW16,
3282440a403fSchristos   BFD_RELOC_SH_GOTPC_MEDHI16,
3283440a403fSchristos   BFD_RELOC_SH_GOTPC_HI16,
3284440a403fSchristos   BFD_RELOC_SH_COPY64,
3285440a403fSchristos   BFD_RELOC_SH_GLOB_DAT64,
3286440a403fSchristos   BFD_RELOC_SH_JMP_SLOT64,
3287440a403fSchristos   BFD_RELOC_SH_RELATIVE64,
3288440a403fSchristos   BFD_RELOC_SH_GOT10BY4,
3289440a403fSchristos   BFD_RELOC_SH_GOT10BY8,
3290440a403fSchristos   BFD_RELOC_SH_GOTPLT10BY4,
3291440a403fSchristos   BFD_RELOC_SH_GOTPLT10BY8,
3292440a403fSchristos   BFD_RELOC_SH_GOTPLT32,
3293440a403fSchristos   BFD_RELOC_SH_SHMEDIA_CODE,
3294440a403fSchristos   BFD_RELOC_SH_IMMU5,
3295440a403fSchristos   BFD_RELOC_SH_IMMS6,
3296440a403fSchristos   BFD_RELOC_SH_IMMS6BY32,
3297440a403fSchristos   BFD_RELOC_SH_IMMU6,
3298440a403fSchristos   BFD_RELOC_SH_IMMS10,
3299440a403fSchristos   BFD_RELOC_SH_IMMS10BY2,
3300440a403fSchristos   BFD_RELOC_SH_IMMS10BY4,
3301440a403fSchristos   BFD_RELOC_SH_IMMS10BY8,
3302440a403fSchristos   BFD_RELOC_SH_IMMS16,
3303440a403fSchristos   BFD_RELOC_SH_IMMU16,
3304440a403fSchristos   BFD_RELOC_SH_IMM_LOW16,
3305440a403fSchristos   BFD_RELOC_SH_IMM_LOW16_PCREL,
3306440a403fSchristos   BFD_RELOC_SH_IMM_MEDLOW16,
3307440a403fSchristos   BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3308440a403fSchristos   BFD_RELOC_SH_IMM_MEDHI16,
3309440a403fSchristos   BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3310440a403fSchristos   BFD_RELOC_SH_IMM_HI16,
3311440a403fSchristos   BFD_RELOC_SH_IMM_HI16_PCREL,
3312440a403fSchristos   BFD_RELOC_SH_PT_16,
3313440a403fSchristos   BFD_RELOC_SH_TLS_GD_32,
3314440a403fSchristos   BFD_RELOC_SH_TLS_LD_32,
3315440a403fSchristos   BFD_RELOC_SH_TLS_LDO_32,
3316440a403fSchristos   BFD_RELOC_SH_TLS_IE_32,
3317440a403fSchristos   BFD_RELOC_SH_TLS_LE_32,
3318440a403fSchristos   BFD_RELOC_SH_TLS_DTPMOD32,
3319440a403fSchristos   BFD_RELOC_SH_TLS_DTPOFF32,
3320440a403fSchristos   BFD_RELOC_SH_TLS_TPOFF32,
3321440a403fSchristos   BFD_RELOC_SH_GOT20,
3322440a403fSchristos   BFD_RELOC_SH_GOTOFF20,
3323440a403fSchristos   BFD_RELOC_SH_GOTFUNCDESC,
3324440a403fSchristos   BFD_RELOC_SH_GOTFUNCDESC20,
3325440a403fSchristos   BFD_RELOC_SH_GOTOFFFUNCDESC,
3326440a403fSchristos   BFD_RELOC_SH_GOTOFFFUNCDESC20,
3327440a403fSchristos   BFD_RELOC_SH_FUNCDESC,
3328440a403fSchristos 
3329440a403fSchristos /* ARC relocs.  */
3330440a403fSchristos   BFD_RELOC_ARC_NONE,
3331440a403fSchristos   BFD_RELOC_ARC_8,
3332440a403fSchristos   BFD_RELOC_ARC_16,
3333440a403fSchristos   BFD_RELOC_ARC_24,
3334440a403fSchristos   BFD_RELOC_ARC_32,
3335440a403fSchristos   BFD_RELOC_ARC_N8,
3336440a403fSchristos   BFD_RELOC_ARC_N16,
3337440a403fSchristos   BFD_RELOC_ARC_N24,
3338440a403fSchristos   BFD_RELOC_ARC_N32,
3339440a403fSchristos   BFD_RELOC_ARC_SDA,
3340440a403fSchristos   BFD_RELOC_ARC_SECTOFF,
3341440a403fSchristos   BFD_RELOC_ARC_S21H_PCREL,
3342440a403fSchristos   BFD_RELOC_ARC_S21W_PCREL,
3343440a403fSchristos   BFD_RELOC_ARC_S25H_PCREL,
3344440a403fSchristos   BFD_RELOC_ARC_S25W_PCREL,
3345440a403fSchristos   BFD_RELOC_ARC_SDA32,
3346440a403fSchristos   BFD_RELOC_ARC_SDA_LDST,
3347440a403fSchristos   BFD_RELOC_ARC_SDA_LDST1,
3348440a403fSchristos   BFD_RELOC_ARC_SDA_LDST2,
3349440a403fSchristos   BFD_RELOC_ARC_SDA16_LD,
3350440a403fSchristos   BFD_RELOC_ARC_SDA16_LD1,
3351440a403fSchristos   BFD_RELOC_ARC_SDA16_LD2,
3352440a403fSchristos   BFD_RELOC_ARC_S13_PCREL,
3353440a403fSchristos   BFD_RELOC_ARC_W,
3354440a403fSchristos   BFD_RELOC_ARC_32_ME,
3355440a403fSchristos   BFD_RELOC_ARC_32_ME_S,
3356440a403fSchristos   BFD_RELOC_ARC_N32_ME,
3357440a403fSchristos   BFD_RELOC_ARC_SECTOFF_ME,
3358440a403fSchristos   BFD_RELOC_ARC_SDA32_ME,
3359440a403fSchristos   BFD_RELOC_ARC_W_ME,
3360440a403fSchristos   BFD_RELOC_AC_SECTOFF_U8,
3361440a403fSchristos   BFD_RELOC_AC_SECTOFF_U8_1,
3362440a403fSchristos   BFD_RELOC_AC_SECTOFF_U8_2,
336306324dcfSchristos   BFD_RELOC_AC_SECTOFF_S9,
336406324dcfSchristos   BFD_RELOC_AC_SECTOFF_S9_1,
336506324dcfSchristos   BFD_RELOC_AC_SECTOFF_S9_2,
3366440a403fSchristos   BFD_RELOC_ARC_SECTOFF_ME_1,
3367440a403fSchristos   BFD_RELOC_ARC_SECTOFF_ME_2,
3368440a403fSchristos   BFD_RELOC_ARC_SECTOFF_1,
3369440a403fSchristos   BFD_RELOC_ARC_SECTOFF_2,
337006324dcfSchristos   BFD_RELOC_ARC_SDA_12,
3371440a403fSchristos   BFD_RELOC_ARC_SDA16_ST2,
3372440a403fSchristos   BFD_RELOC_ARC_32_PCREL,
3373440a403fSchristos   BFD_RELOC_ARC_PC32,
3374440a403fSchristos   BFD_RELOC_ARC_GOT32,
3375440a403fSchristos   BFD_RELOC_ARC_GOTPC32,
3376440a403fSchristos   BFD_RELOC_ARC_PLT32,
3377440a403fSchristos   BFD_RELOC_ARC_COPY,
3378440a403fSchristos   BFD_RELOC_ARC_GLOB_DAT,
3379440a403fSchristos   BFD_RELOC_ARC_JMP_SLOT,
3380440a403fSchristos   BFD_RELOC_ARC_RELATIVE,
3381440a403fSchristos   BFD_RELOC_ARC_GOTOFF,
3382440a403fSchristos   BFD_RELOC_ARC_GOTPC,
3383440a403fSchristos   BFD_RELOC_ARC_S21W_PCREL_PLT,
3384440a403fSchristos   BFD_RELOC_ARC_S25H_PCREL_PLT,
3385440a403fSchristos   BFD_RELOC_ARC_TLS_DTPMOD,
3386440a403fSchristos   BFD_RELOC_ARC_TLS_TPOFF,
3387440a403fSchristos   BFD_RELOC_ARC_TLS_GD_GOT,
3388440a403fSchristos   BFD_RELOC_ARC_TLS_GD_LD,
3389440a403fSchristos   BFD_RELOC_ARC_TLS_GD_CALL,
3390440a403fSchristos   BFD_RELOC_ARC_TLS_IE_GOT,
3391440a403fSchristos   BFD_RELOC_ARC_TLS_DTPOFF,
3392440a403fSchristos   BFD_RELOC_ARC_TLS_DTPOFF_S9,
3393440a403fSchristos   BFD_RELOC_ARC_TLS_LE_S9,
3394440a403fSchristos   BFD_RELOC_ARC_TLS_LE_32,
3395440a403fSchristos   BFD_RELOC_ARC_S25W_PCREL_PLT,
3396440a403fSchristos   BFD_RELOC_ARC_S21H_PCREL_PLT,
3397440a403fSchristos   BFD_RELOC_ARC_NPS_CMEM16,
339806324dcfSchristos   BFD_RELOC_ARC_JLI_SECTOFF,
3399440a403fSchristos 
3400440a403fSchristos /* ADI Blackfin 16 bit immediate absolute reloc.  */
3401440a403fSchristos   BFD_RELOC_BFIN_16_IMM,
3402440a403fSchristos 
3403440a403fSchristos /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
3404440a403fSchristos   BFD_RELOC_BFIN_16_HIGH,
3405440a403fSchristos 
3406440a403fSchristos /* ADI Blackfin 'a' part of LSETUP.  */
3407440a403fSchristos   BFD_RELOC_BFIN_4_PCREL,
3408440a403fSchristos 
3409440a403fSchristos /* ADI Blackfin.  */
3410440a403fSchristos   BFD_RELOC_BFIN_5_PCREL,
3411440a403fSchristos 
3412440a403fSchristos /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
3413440a403fSchristos   BFD_RELOC_BFIN_16_LOW,
3414440a403fSchristos 
3415440a403fSchristos /* ADI Blackfin.  */
3416440a403fSchristos   BFD_RELOC_BFIN_10_PCREL,
3417440a403fSchristos 
3418440a403fSchristos /* ADI Blackfin 'b' part of LSETUP.  */
3419440a403fSchristos   BFD_RELOC_BFIN_11_PCREL,
3420440a403fSchristos 
3421440a403fSchristos /* ADI Blackfin.  */
3422440a403fSchristos   BFD_RELOC_BFIN_12_PCREL_JUMP,
3423440a403fSchristos 
3424440a403fSchristos /* ADI Blackfin Short jump, pcrel.  */
3425440a403fSchristos   BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3426440a403fSchristos 
3427440a403fSchristos /* ADI Blackfin Call.x not implemented.  */
3428440a403fSchristos   BFD_RELOC_BFIN_24_PCREL_CALL_X,
3429440a403fSchristos 
3430440a403fSchristos /* ADI Blackfin Long Jump pcrel.  */
3431440a403fSchristos   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3432440a403fSchristos 
3433440a403fSchristos /* ADI Blackfin FD-PIC relocations.  */
3434440a403fSchristos   BFD_RELOC_BFIN_GOT17M4,
3435440a403fSchristos   BFD_RELOC_BFIN_GOTHI,
3436440a403fSchristos   BFD_RELOC_BFIN_GOTLO,
3437440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC,
3438440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3439440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3440440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3441440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_VALUE,
3442440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3443440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3444440a403fSchristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3445440a403fSchristos   BFD_RELOC_BFIN_GOTOFF17M4,
3446440a403fSchristos   BFD_RELOC_BFIN_GOTOFFHI,
3447440a403fSchristos   BFD_RELOC_BFIN_GOTOFFLO,
3448440a403fSchristos 
3449440a403fSchristos /* ADI Blackfin GOT relocation.  */
3450440a403fSchristos   BFD_RELOC_BFIN_GOT,
3451440a403fSchristos 
3452440a403fSchristos /* ADI Blackfin PLTPC relocation.  */
3453440a403fSchristos   BFD_RELOC_BFIN_PLTPC,
3454440a403fSchristos 
3455440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3456440a403fSchristos   BFD_ARELOC_BFIN_PUSH,
3457440a403fSchristos 
3458440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3459440a403fSchristos   BFD_ARELOC_BFIN_CONST,
3460440a403fSchristos 
3461440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3462440a403fSchristos   BFD_ARELOC_BFIN_ADD,
3463440a403fSchristos 
3464440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3465440a403fSchristos   BFD_ARELOC_BFIN_SUB,
3466440a403fSchristos 
3467440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3468440a403fSchristos   BFD_ARELOC_BFIN_MULT,
3469440a403fSchristos 
3470440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3471440a403fSchristos   BFD_ARELOC_BFIN_DIV,
3472440a403fSchristos 
3473440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3474440a403fSchristos   BFD_ARELOC_BFIN_MOD,
3475440a403fSchristos 
3476440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3477440a403fSchristos   BFD_ARELOC_BFIN_LSHIFT,
3478440a403fSchristos 
3479440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3480440a403fSchristos   BFD_ARELOC_BFIN_RSHIFT,
3481440a403fSchristos 
3482440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3483440a403fSchristos   BFD_ARELOC_BFIN_AND,
3484440a403fSchristos 
3485440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3486440a403fSchristos   BFD_ARELOC_BFIN_OR,
3487440a403fSchristos 
3488440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3489440a403fSchristos   BFD_ARELOC_BFIN_XOR,
3490440a403fSchristos 
3491440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3492440a403fSchristos   BFD_ARELOC_BFIN_LAND,
3493440a403fSchristos 
3494440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3495440a403fSchristos   BFD_ARELOC_BFIN_LOR,
3496440a403fSchristos 
3497440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3498440a403fSchristos   BFD_ARELOC_BFIN_LEN,
3499440a403fSchristos 
3500440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3501440a403fSchristos   BFD_ARELOC_BFIN_NEG,
3502440a403fSchristos 
3503440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3504440a403fSchristos   BFD_ARELOC_BFIN_COMP,
3505440a403fSchristos 
3506440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3507440a403fSchristos   BFD_ARELOC_BFIN_PAGE,
3508440a403fSchristos 
3509440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3510440a403fSchristos   BFD_ARELOC_BFIN_HWPAGE,
3511440a403fSchristos 
3512440a403fSchristos /* ADI Blackfin arithmetic relocation.  */
3513440a403fSchristos   BFD_ARELOC_BFIN_ADDR,
3514440a403fSchristos 
3515440a403fSchristos /* Mitsubishi D10V relocs.
3516440a403fSchristos This is a 10-bit reloc with the right 2 bits
3517440a403fSchristos assumed to be 0.  */
3518440a403fSchristos   BFD_RELOC_D10V_10_PCREL_R,
3519440a403fSchristos 
3520440a403fSchristos /* Mitsubishi D10V relocs.
3521440a403fSchristos This is a 10-bit reloc with the right 2 bits
3522440a403fSchristos assumed to be 0.  This is the same as the previous reloc
3523440a403fSchristos except it is in the left container, i.e.,
3524440a403fSchristos shifted left 15 bits.  */
3525440a403fSchristos   BFD_RELOC_D10V_10_PCREL_L,
3526440a403fSchristos 
3527440a403fSchristos /* This is an 18-bit reloc with the right 2 bits
3528440a403fSchristos assumed to be 0.  */
3529440a403fSchristos   BFD_RELOC_D10V_18,
3530440a403fSchristos 
3531440a403fSchristos /* This is an 18-bit reloc with the right 2 bits
3532440a403fSchristos assumed to be 0.  */
3533440a403fSchristos   BFD_RELOC_D10V_18_PCREL,
3534440a403fSchristos 
3535440a403fSchristos /* Mitsubishi D30V relocs.
3536440a403fSchristos This is a 6-bit absolute reloc.  */
3537440a403fSchristos   BFD_RELOC_D30V_6,
3538440a403fSchristos 
3539440a403fSchristos /* This is a 6-bit pc-relative reloc with
3540440a403fSchristos the right 3 bits assumed to be 0.  */
3541440a403fSchristos   BFD_RELOC_D30V_9_PCREL,
3542440a403fSchristos 
3543440a403fSchristos /* This is a 6-bit pc-relative reloc with
3544440a403fSchristos the right 3 bits assumed to be 0. Same
3545440a403fSchristos as the previous reloc but on the right side
3546440a403fSchristos of the container.  */
3547440a403fSchristos   BFD_RELOC_D30V_9_PCREL_R,
3548440a403fSchristos 
3549440a403fSchristos /* This is a 12-bit absolute reloc with the
3550440a403fSchristos right 3 bitsassumed to be 0.  */
3551440a403fSchristos   BFD_RELOC_D30V_15,
3552440a403fSchristos 
3553440a403fSchristos /* This is a 12-bit pc-relative reloc with
3554440a403fSchristos the right 3 bits assumed to be 0.  */
3555440a403fSchristos   BFD_RELOC_D30V_15_PCREL,
3556440a403fSchristos 
3557440a403fSchristos /* This is a 12-bit pc-relative reloc with
3558440a403fSchristos the right 3 bits assumed to be 0. Same
3559440a403fSchristos as the previous reloc but on the right side
3560440a403fSchristos of the container.  */
3561440a403fSchristos   BFD_RELOC_D30V_15_PCREL_R,
3562440a403fSchristos 
3563440a403fSchristos /* This is an 18-bit absolute reloc with
3564440a403fSchristos the right 3 bits assumed to be 0.  */
3565440a403fSchristos   BFD_RELOC_D30V_21,
3566440a403fSchristos 
3567440a403fSchristos /* This is an 18-bit pc-relative reloc with
3568440a403fSchristos the right 3 bits assumed to be 0.  */
3569440a403fSchristos   BFD_RELOC_D30V_21_PCREL,
3570440a403fSchristos 
3571440a403fSchristos /* This is an 18-bit pc-relative reloc with
3572440a403fSchristos the right 3 bits assumed to be 0. Same
3573440a403fSchristos as the previous reloc but on the right side
3574440a403fSchristos of the container.  */
3575440a403fSchristos   BFD_RELOC_D30V_21_PCREL_R,
3576440a403fSchristos 
3577440a403fSchristos /* This is a 32-bit absolute reloc.  */
3578440a403fSchristos   BFD_RELOC_D30V_32,
3579440a403fSchristos 
3580440a403fSchristos /* This is a 32-bit pc-relative reloc.  */
3581440a403fSchristos   BFD_RELOC_D30V_32_PCREL,
3582440a403fSchristos 
3583440a403fSchristos /* DLX relocs  */
3584440a403fSchristos   BFD_RELOC_DLX_HI16_S,
3585440a403fSchristos 
3586440a403fSchristos /* DLX relocs  */
3587440a403fSchristos   BFD_RELOC_DLX_LO16,
3588440a403fSchristos 
3589440a403fSchristos /* DLX relocs  */
3590440a403fSchristos   BFD_RELOC_DLX_JMP26,
3591440a403fSchristos 
3592440a403fSchristos /* Renesas M16C/M32C Relocations.  */
3593440a403fSchristos   BFD_RELOC_M32C_HI8,
3594440a403fSchristos   BFD_RELOC_M32C_RL_JUMP,
3595440a403fSchristos   BFD_RELOC_M32C_RL_1ADDR,
3596440a403fSchristos   BFD_RELOC_M32C_RL_2ADDR,
3597440a403fSchristos 
3598440a403fSchristos /* Renesas M32R (formerly Mitsubishi M32R) relocs.
3599440a403fSchristos This is a 24 bit absolute address.  */
3600440a403fSchristos   BFD_RELOC_M32R_24,
3601440a403fSchristos 
3602440a403fSchristos /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
3603440a403fSchristos   BFD_RELOC_M32R_10_PCREL,
3604440a403fSchristos 
3605440a403fSchristos /* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
3606440a403fSchristos   BFD_RELOC_M32R_18_PCREL,
3607440a403fSchristos 
3608440a403fSchristos /* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
3609440a403fSchristos   BFD_RELOC_M32R_26_PCREL,
3610440a403fSchristos 
3611440a403fSchristos /* This is a 16-bit reloc containing the high 16 bits of an address
3612440a403fSchristos used when the lower 16 bits are treated as unsigned.  */
3613440a403fSchristos   BFD_RELOC_M32R_HI16_ULO,
3614440a403fSchristos 
3615440a403fSchristos /* This is a 16-bit reloc containing the high 16 bits of an address
3616440a403fSchristos used when the lower 16 bits are treated as signed.  */
3617440a403fSchristos   BFD_RELOC_M32R_HI16_SLO,
3618440a403fSchristos 
3619440a403fSchristos /* This is a 16-bit reloc containing the lower 16 bits of an address.  */
3620440a403fSchristos   BFD_RELOC_M32R_LO16,
3621440a403fSchristos 
3622440a403fSchristos /* This is a 16-bit reloc containing the small data area offset for use in
3623440a403fSchristos add3, load, and store instructions.  */
3624440a403fSchristos   BFD_RELOC_M32R_SDA16,
3625440a403fSchristos 
3626440a403fSchristos /* For PIC.  */
3627440a403fSchristos   BFD_RELOC_M32R_GOT24,
3628440a403fSchristos   BFD_RELOC_M32R_26_PLTREL,
3629440a403fSchristos   BFD_RELOC_M32R_COPY,
3630440a403fSchristos   BFD_RELOC_M32R_GLOB_DAT,
3631440a403fSchristos   BFD_RELOC_M32R_JMP_SLOT,
3632440a403fSchristos   BFD_RELOC_M32R_RELATIVE,
3633440a403fSchristos   BFD_RELOC_M32R_GOTOFF,
3634440a403fSchristos   BFD_RELOC_M32R_GOTOFF_HI_ULO,
3635440a403fSchristos   BFD_RELOC_M32R_GOTOFF_HI_SLO,
3636440a403fSchristos   BFD_RELOC_M32R_GOTOFF_LO,
3637440a403fSchristos   BFD_RELOC_M32R_GOTPC24,
3638440a403fSchristos   BFD_RELOC_M32R_GOT16_HI_ULO,
3639440a403fSchristos   BFD_RELOC_M32R_GOT16_HI_SLO,
3640440a403fSchristos   BFD_RELOC_M32R_GOT16_LO,
3641440a403fSchristos   BFD_RELOC_M32R_GOTPC_HI_ULO,
3642440a403fSchristos   BFD_RELOC_M32R_GOTPC_HI_SLO,
3643440a403fSchristos   BFD_RELOC_M32R_GOTPC_LO,
3644440a403fSchristos 
3645440a403fSchristos /* NDS32 relocs.
3646440a403fSchristos This is a 20 bit absolute address.  */
3647440a403fSchristos   BFD_RELOC_NDS32_20,
3648440a403fSchristos 
3649440a403fSchristos /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.  */
3650440a403fSchristos   BFD_RELOC_NDS32_9_PCREL,
3651440a403fSchristos 
3652440a403fSchristos /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.  */
3653440a403fSchristos   BFD_RELOC_NDS32_WORD_9_PCREL,
3654440a403fSchristos 
3655440a403fSchristos /* This is an 15-bit reloc with the right 1 bit assumed to be 0.  */
3656440a403fSchristos   BFD_RELOC_NDS32_15_PCREL,
3657440a403fSchristos 
3658440a403fSchristos /* This is an 17-bit reloc with the right 1 bit assumed to be 0.  */
3659440a403fSchristos   BFD_RELOC_NDS32_17_PCREL,
3660440a403fSchristos 
3661440a403fSchristos /* This is a 25-bit reloc with the right 1 bit assumed to be 0.  */
3662440a403fSchristos   BFD_RELOC_NDS32_25_PCREL,
3663440a403fSchristos 
3664440a403fSchristos /* This is a 20-bit reloc containing the high 20 bits of an address
3665440a403fSchristos used with the lower 12 bits  */
3666440a403fSchristos   BFD_RELOC_NDS32_HI20,
3667440a403fSchristos 
3668440a403fSchristos /* This is a 12-bit reloc containing the lower 12 bits of an address
3669440a403fSchristos then shift right by 3. This is used with ldi,sdi...  */
3670440a403fSchristos   BFD_RELOC_NDS32_LO12S3,
3671440a403fSchristos 
3672440a403fSchristos /* This is a 12-bit reloc containing the lower 12 bits of an address
3673440a403fSchristos then shift left by 2. This is used with lwi,swi...  */
3674440a403fSchristos   BFD_RELOC_NDS32_LO12S2,
3675440a403fSchristos 
3676440a403fSchristos /* This is a 12-bit reloc containing the lower 12 bits of an address
3677440a403fSchristos then shift left by 1. This is used with lhi,shi...  */
3678440a403fSchristos   BFD_RELOC_NDS32_LO12S1,
3679440a403fSchristos 
3680440a403fSchristos /* This is a 12-bit reloc containing the lower 12 bits of an address
3681440a403fSchristos then shift left by 0. This is used with lbisbi...  */
3682440a403fSchristos   BFD_RELOC_NDS32_LO12S0,
3683440a403fSchristos 
3684440a403fSchristos /* This is a 12-bit reloc containing the lower 12 bits of an address
3685440a403fSchristos then shift left by 0. This is only used with branch relaxations  */
3686440a403fSchristos   BFD_RELOC_NDS32_LO12S0_ORI,
3687440a403fSchristos 
3688440a403fSchristos /* This is a 15-bit reloc containing the small data area 18-bit signed offset
3689440a403fSchristos and shift left by 3 for use in ldi, sdi...  */
3690440a403fSchristos   BFD_RELOC_NDS32_SDA15S3,
3691440a403fSchristos 
3692440a403fSchristos /* This is a 15-bit reloc containing the small data area 17-bit signed offset
3693440a403fSchristos and shift left by 2 for use in lwi, swi...  */
3694440a403fSchristos   BFD_RELOC_NDS32_SDA15S2,
3695440a403fSchristos 
3696440a403fSchristos /* This is a 15-bit reloc containing the small data area 16-bit signed offset
3697440a403fSchristos and shift left by 1 for use in lhi, shi...  */
3698440a403fSchristos   BFD_RELOC_NDS32_SDA15S1,
3699440a403fSchristos 
3700440a403fSchristos /* This is a 15-bit reloc containing the small data area 15-bit signed offset
3701440a403fSchristos and shift left by 0 for use in lbi, sbi...  */
3702440a403fSchristos   BFD_RELOC_NDS32_SDA15S0,
3703440a403fSchristos 
3704440a403fSchristos /* This is a 16-bit reloc containing the small data area 16-bit signed offset
3705440a403fSchristos and shift left by 3  */
3706440a403fSchristos   BFD_RELOC_NDS32_SDA16S3,
3707440a403fSchristos 
3708440a403fSchristos /* This is a 17-bit reloc containing the small data area 17-bit signed offset
3709440a403fSchristos and shift left by 2 for use in lwi.gp, swi.gp...  */
3710440a403fSchristos   BFD_RELOC_NDS32_SDA17S2,
3711440a403fSchristos 
3712440a403fSchristos /* This is a 18-bit reloc containing the small data area 18-bit signed offset
3713440a403fSchristos and shift left by 1 for use in lhi.gp, shi.gp...  */
3714440a403fSchristos   BFD_RELOC_NDS32_SDA18S1,
3715440a403fSchristos 
3716440a403fSchristos /* This is a 19-bit reloc containing the small data area 19-bit signed offset
3717440a403fSchristos and shift left by 0 for use in lbi.gp, sbi.gp...  */
3718440a403fSchristos   BFD_RELOC_NDS32_SDA19S0,
3719440a403fSchristos 
3720440a403fSchristos /* for PIC  */
3721440a403fSchristos   BFD_RELOC_NDS32_GOT20,
3722440a403fSchristos   BFD_RELOC_NDS32_9_PLTREL,
3723440a403fSchristos   BFD_RELOC_NDS32_25_PLTREL,
3724440a403fSchristos   BFD_RELOC_NDS32_COPY,
3725440a403fSchristos   BFD_RELOC_NDS32_GLOB_DAT,
3726440a403fSchristos   BFD_RELOC_NDS32_JMP_SLOT,
3727440a403fSchristos   BFD_RELOC_NDS32_RELATIVE,
3728440a403fSchristos   BFD_RELOC_NDS32_GOTOFF,
3729440a403fSchristos   BFD_RELOC_NDS32_GOTOFF_HI20,
3730440a403fSchristos   BFD_RELOC_NDS32_GOTOFF_LO12,
3731440a403fSchristos   BFD_RELOC_NDS32_GOTPC20,
3732440a403fSchristos   BFD_RELOC_NDS32_GOT_HI20,
3733440a403fSchristos   BFD_RELOC_NDS32_GOT_LO12,
3734440a403fSchristos   BFD_RELOC_NDS32_GOTPC_HI20,
3735440a403fSchristos   BFD_RELOC_NDS32_GOTPC_LO12,
3736440a403fSchristos 
3737440a403fSchristos /* for relax  */
3738440a403fSchristos   BFD_RELOC_NDS32_INSN16,
3739440a403fSchristos   BFD_RELOC_NDS32_LABEL,
3740440a403fSchristos   BFD_RELOC_NDS32_LONGCALL1,
3741440a403fSchristos   BFD_RELOC_NDS32_LONGCALL2,
3742440a403fSchristos   BFD_RELOC_NDS32_LONGCALL3,
3743440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP1,
3744440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP2,
3745440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP3,
3746440a403fSchristos   BFD_RELOC_NDS32_LOADSTORE,
3747440a403fSchristos   BFD_RELOC_NDS32_9_FIXED,
3748440a403fSchristos   BFD_RELOC_NDS32_15_FIXED,
3749440a403fSchristos   BFD_RELOC_NDS32_17_FIXED,
3750440a403fSchristos   BFD_RELOC_NDS32_25_FIXED,
3751440a403fSchristos   BFD_RELOC_NDS32_LONGCALL4,
3752440a403fSchristos   BFD_RELOC_NDS32_LONGCALL5,
3753440a403fSchristos   BFD_RELOC_NDS32_LONGCALL6,
3754440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP4,
3755440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP5,
3756440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP6,
3757440a403fSchristos   BFD_RELOC_NDS32_LONGJUMP7,
3758440a403fSchristos 
3759440a403fSchristos /* for PIC  */
3760440a403fSchristos   BFD_RELOC_NDS32_PLTREL_HI20,
3761440a403fSchristos   BFD_RELOC_NDS32_PLTREL_LO12,
3762440a403fSchristos   BFD_RELOC_NDS32_PLT_GOTREL_HI20,
3763440a403fSchristos   BFD_RELOC_NDS32_PLT_GOTREL_LO12,
3764440a403fSchristos 
3765440a403fSchristos /* for floating point  */
3766440a403fSchristos   BFD_RELOC_NDS32_SDA12S2_DP,
3767440a403fSchristos   BFD_RELOC_NDS32_SDA12S2_SP,
3768440a403fSchristos   BFD_RELOC_NDS32_LO12S2_DP,
3769440a403fSchristos   BFD_RELOC_NDS32_LO12S2_SP,
3770440a403fSchristos 
3771440a403fSchristos /* for dwarf2 debug_line.  */
3772440a403fSchristos   BFD_RELOC_NDS32_DWARF2_OP1,
3773440a403fSchristos   BFD_RELOC_NDS32_DWARF2_OP2,
3774440a403fSchristos   BFD_RELOC_NDS32_DWARF2_LEB,
3775440a403fSchristos 
3776440a403fSchristos /* for eliminate 16-bit instructions  */
3777440a403fSchristos   BFD_RELOC_NDS32_UPDATE_TA,
3778440a403fSchristos 
3779440a403fSchristos /* for PIC object relaxation  */
3780440a403fSchristos   BFD_RELOC_NDS32_PLT_GOTREL_LO20,
3781440a403fSchristos   BFD_RELOC_NDS32_PLT_GOTREL_LO15,
3782440a403fSchristos   BFD_RELOC_NDS32_PLT_GOTREL_LO19,
3783440a403fSchristos   BFD_RELOC_NDS32_GOT_LO15,
3784440a403fSchristos   BFD_RELOC_NDS32_GOT_LO19,
3785440a403fSchristos   BFD_RELOC_NDS32_GOTOFF_LO15,
3786440a403fSchristos   BFD_RELOC_NDS32_GOTOFF_LO19,
3787440a403fSchristos   BFD_RELOC_NDS32_GOT15S2,
3788440a403fSchristos   BFD_RELOC_NDS32_GOT17S2,
3789440a403fSchristos 
3790440a403fSchristos /* NDS32 relocs.
3791440a403fSchristos This is a 5 bit absolute address.  */
3792440a403fSchristos   BFD_RELOC_NDS32_5,
3793440a403fSchristos 
3794440a403fSchristos /* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0.  */
3795440a403fSchristos   BFD_RELOC_NDS32_10_UPCREL,
3796440a403fSchristos 
3797440a403fSchristos /* If fp were omitted, fp can used as another gp.  */
3798440a403fSchristos   BFD_RELOC_NDS32_SDA_FP7U2_RELA,
3799440a403fSchristos 
3800440a403fSchristos /* relaxation relative relocation types  */
3801440a403fSchristos   BFD_RELOC_NDS32_RELAX_ENTRY,
3802440a403fSchristos   BFD_RELOC_NDS32_GOT_SUFF,
3803440a403fSchristos   BFD_RELOC_NDS32_GOTOFF_SUFF,
3804440a403fSchristos   BFD_RELOC_NDS32_PLT_GOT_SUFF,
3805440a403fSchristos   BFD_RELOC_NDS32_MULCALL_SUFF,
3806440a403fSchristos   BFD_RELOC_NDS32_PTR,
3807440a403fSchristos   BFD_RELOC_NDS32_PTR_COUNT,
3808440a403fSchristos   BFD_RELOC_NDS32_PTR_RESOLVED,
3809440a403fSchristos   BFD_RELOC_NDS32_PLTBLOCK,
3810440a403fSchristos   BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
3811440a403fSchristos   BFD_RELOC_NDS32_RELAX_REGION_END,
3812440a403fSchristos   BFD_RELOC_NDS32_MINUEND,
3813440a403fSchristos   BFD_RELOC_NDS32_SUBTRAHEND,
3814440a403fSchristos   BFD_RELOC_NDS32_DIFF8,
3815440a403fSchristos   BFD_RELOC_NDS32_DIFF16,
3816440a403fSchristos   BFD_RELOC_NDS32_DIFF32,
3817440a403fSchristos   BFD_RELOC_NDS32_DIFF_ULEB128,
3818440a403fSchristos   BFD_RELOC_NDS32_EMPTY,
3819440a403fSchristos 
3820440a403fSchristos /* This is a 25 bit absolute address.  */
3821440a403fSchristos   BFD_RELOC_NDS32_25_ABS,
3822440a403fSchristos 
3823440a403fSchristos /* For ex9 and ifc using.  */
3824440a403fSchristos   BFD_RELOC_NDS32_DATA,
3825440a403fSchristos   BFD_RELOC_NDS32_TRAN,
3826440a403fSchristos   BFD_RELOC_NDS32_17IFC_PCREL,
3827440a403fSchristos   BFD_RELOC_NDS32_10IFCU_PCREL,
3828440a403fSchristos 
3829440a403fSchristos /* For TLS.  */
3830440a403fSchristos   BFD_RELOC_NDS32_TPOFF,
3831*b88e3e88Schristos   BFD_RELOC_NDS32_GOTTPOFF,
3832440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_HI20,
3833440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_LO12,
3834440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_20,
3835440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_15S0,
3836440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_15S1,
3837440a403fSchristos   BFD_RELOC_NDS32_TLS_LE_15S2,
3838*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_LE_ADD,
3839*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_LE_LS,
3840*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IE_HI20,
3841*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IE_LO12,
3842*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IE_LO12S2,
3843*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IEGP_HI20,
3844*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IEGP_LO12,
3845*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
3846*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_IEGP_LW,
3847*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC,
3848*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_HI20,
3849*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_LO12,
3850*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_20,
3851*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
3852*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_ADD,
3853*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_FUNC,
3854*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_CALL,
3855*b88e3e88Schristos   BFD_RELOC_NDS32_TLS_DESC_MEM,
3856*b88e3e88Schristos   BFD_RELOC_NDS32_REMOVE,
3857*b88e3e88Schristos   BFD_RELOC_NDS32_GROUP,
3858*b88e3e88Schristos 
3859*b88e3e88Schristos /* For floating load store relaxation.  */
3860*b88e3e88Schristos   BFD_RELOC_NDS32_LSI,
3861440a403fSchristos 
3862440a403fSchristos /* This is a 9-bit reloc  */
3863440a403fSchristos   BFD_RELOC_V850_9_PCREL,
3864440a403fSchristos 
3865440a403fSchristos /* This is a 22-bit reloc  */
3866440a403fSchristos   BFD_RELOC_V850_22_PCREL,
3867440a403fSchristos 
3868440a403fSchristos /* This is a 16 bit offset from the short data area pointer.  */
3869440a403fSchristos   BFD_RELOC_V850_SDA_16_16_OFFSET,
3870440a403fSchristos 
3871440a403fSchristos /* This is a 16 bit offset (of which only 15 bits are used) from the
3872440a403fSchristos short data area pointer.  */
3873440a403fSchristos   BFD_RELOC_V850_SDA_15_16_OFFSET,
3874440a403fSchristos 
3875440a403fSchristos /* This is a 16 bit offset from the zero data area pointer.  */
3876440a403fSchristos   BFD_RELOC_V850_ZDA_16_16_OFFSET,
3877440a403fSchristos 
3878440a403fSchristos /* This is a 16 bit offset (of which only 15 bits are used) from the
3879440a403fSchristos zero data area pointer.  */
3880440a403fSchristos   BFD_RELOC_V850_ZDA_15_16_OFFSET,
3881440a403fSchristos 
3882440a403fSchristos /* This is an 8 bit offset (of which only 6 bits are used) from the
3883440a403fSchristos tiny data area pointer.  */
3884440a403fSchristos   BFD_RELOC_V850_TDA_6_8_OFFSET,
3885440a403fSchristos 
3886440a403fSchristos /* This is an 8bit offset (of which only 7 bits are used) from the tiny
3887440a403fSchristos data area pointer.  */
3888440a403fSchristos   BFD_RELOC_V850_TDA_7_8_OFFSET,
3889440a403fSchristos 
3890440a403fSchristos /* This is a 7 bit offset from the tiny data area pointer.  */
3891440a403fSchristos   BFD_RELOC_V850_TDA_7_7_OFFSET,
3892440a403fSchristos 
3893440a403fSchristos /* This is a 16 bit offset from the tiny data area pointer.  */
3894440a403fSchristos   BFD_RELOC_V850_TDA_16_16_OFFSET,
3895440a403fSchristos 
3896440a403fSchristos /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
3897440a403fSchristos data area pointer.  */
3898440a403fSchristos   BFD_RELOC_V850_TDA_4_5_OFFSET,
3899440a403fSchristos 
3900440a403fSchristos /* This is a 4 bit offset from the tiny data area pointer.  */
3901440a403fSchristos   BFD_RELOC_V850_TDA_4_4_OFFSET,
3902440a403fSchristos 
3903440a403fSchristos /* This is a 16 bit offset from the short data area pointer, with the
3904440a403fSchristos bits placed non-contiguously in the instruction.  */
3905440a403fSchristos   BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
3906440a403fSchristos 
3907440a403fSchristos /* This is a 16 bit offset from the zero data area pointer, with the
3908440a403fSchristos bits placed non-contiguously in the instruction.  */
3909440a403fSchristos   BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
3910440a403fSchristos 
3911440a403fSchristos /* This is a 6 bit offset from the call table base pointer.  */
3912440a403fSchristos   BFD_RELOC_V850_CALLT_6_7_OFFSET,
3913440a403fSchristos 
3914440a403fSchristos /* This is a 16 bit offset from the call table base pointer.  */
3915440a403fSchristos   BFD_RELOC_V850_CALLT_16_16_OFFSET,
3916440a403fSchristos 
3917440a403fSchristos /* Used for relaxing indirect function calls.  */
3918440a403fSchristos   BFD_RELOC_V850_LONGCALL,
3919440a403fSchristos 
3920440a403fSchristos /* Used for relaxing indirect jumps.  */
3921440a403fSchristos   BFD_RELOC_V850_LONGJUMP,
3922440a403fSchristos 
3923440a403fSchristos /* Used to maintain alignment whilst relaxing.  */
3924440a403fSchristos   BFD_RELOC_V850_ALIGN,
3925440a403fSchristos 
3926440a403fSchristos /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
3927440a403fSchristos instructions.  */
3928440a403fSchristos   BFD_RELOC_V850_LO16_SPLIT_OFFSET,
3929440a403fSchristos 
3930440a403fSchristos /* This is a 16-bit reloc.  */
3931440a403fSchristos   BFD_RELOC_V850_16_PCREL,
3932440a403fSchristos 
3933440a403fSchristos /* This is a 17-bit reloc.  */
3934440a403fSchristos   BFD_RELOC_V850_17_PCREL,
3935440a403fSchristos 
3936440a403fSchristos /* This is a 23-bit reloc.  */
3937440a403fSchristos   BFD_RELOC_V850_23,
3938440a403fSchristos 
3939440a403fSchristos /* This is a 32-bit reloc.  */
3940440a403fSchristos   BFD_RELOC_V850_32_PCREL,
3941440a403fSchristos 
3942440a403fSchristos /* This is a 32-bit reloc.  */
3943440a403fSchristos   BFD_RELOC_V850_32_ABS,
3944440a403fSchristos 
3945440a403fSchristos /* This is a 16-bit reloc.  */
3946440a403fSchristos   BFD_RELOC_V850_16_SPLIT_OFFSET,
3947440a403fSchristos 
3948440a403fSchristos /* This is a 16-bit reloc.  */
3949440a403fSchristos   BFD_RELOC_V850_16_S1,
3950440a403fSchristos 
3951440a403fSchristos /* Low 16 bits. 16 bit shifted by 1.  */
3952440a403fSchristos   BFD_RELOC_V850_LO16_S1,
3953440a403fSchristos 
3954440a403fSchristos /* This is a 16 bit offset from the call table base pointer.  */
3955440a403fSchristos   BFD_RELOC_V850_CALLT_15_16_OFFSET,
3956440a403fSchristos 
3957440a403fSchristos /* DSO relocations.  */
3958440a403fSchristos   BFD_RELOC_V850_32_GOTPCREL,
3959440a403fSchristos 
3960440a403fSchristos /* DSO relocations.  */
3961440a403fSchristos   BFD_RELOC_V850_16_GOT,
3962440a403fSchristos 
3963440a403fSchristos /* DSO relocations.  */
3964440a403fSchristos   BFD_RELOC_V850_32_GOT,
3965440a403fSchristos 
3966440a403fSchristos /* DSO relocations.  */
3967440a403fSchristos   BFD_RELOC_V850_22_PLT_PCREL,
3968440a403fSchristos 
3969440a403fSchristos /* DSO relocations.  */
3970440a403fSchristos   BFD_RELOC_V850_32_PLT_PCREL,
3971440a403fSchristos 
3972440a403fSchristos /* DSO relocations.  */
3973440a403fSchristos   BFD_RELOC_V850_COPY,
3974440a403fSchristos 
3975440a403fSchristos /* DSO relocations.  */
3976440a403fSchristos   BFD_RELOC_V850_GLOB_DAT,
3977440a403fSchristos 
3978440a403fSchristos /* DSO relocations.  */
3979440a403fSchristos   BFD_RELOC_V850_JMP_SLOT,
3980440a403fSchristos 
3981440a403fSchristos /* DSO relocations.  */
3982440a403fSchristos   BFD_RELOC_V850_RELATIVE,
3983440a403fSchristos 
3984440a403fSchristos /* DSO relocations.  */
3985440a403fSchristos   BFD_RELOC_V850_16_GOTOFF,
3986440a403fSchristos 
3987440a403fSchristos /* DSO relocations.  */
3988440a403fSchristos   BFD_RELOC_V850_32_GOTOFF,
3989440a403fSchristos 
3990440a403fSchristos /* start code.  */
3991440a403fSchristos   BFD_RELOC_V850_CODE,
3992440a403fSchristos 
3993440a403fSchristos /* start data in text.  */
3994440a403fSchristos   BFD_RELOC_V850_DATA,
3995440a403fSchristos 
3996440a403fSchristos /* This is a 8bit DP reloc for the tms320c30, where the most
3997440a403fSchristos significant 8 bits of a 24 bit word are placed into the least
3998440a403fSchristos significant 8 bits of the opcode.  */
3999440a403fSchristos   BFD_RELOC_TIC30_LDP,
4000440a403fSchristos 
4001440a403fSchristos /* This is a 7bit reloc for the tms320c54x, where the least
4002440a403fSchristos significant 7 bits of a 16 bit word are placed into the least
4003440a403fSchristos significant 7 bits of the opcode.  */
4004440a403fSchristos   BFD_RELOC_TIC54X_PARTLS7,
4005440a403fSchristos 
4006440a403fSchristos /* This is a 9bit DP reloc for the tms320c54x, where the most
4007440a403fSchristos significant 9 bits of a 16 bit word are placed into the least
4008440a403fSchristos significant 9 bits of the opcode.  */
4009440a403fSchristos   BFD_RELOC_TIC54X_PARTMS9,
4010440a403fSchristos 
4011440a403fSchristos /* This is an extended address 23-bit reloc for the tms320c54x.  */
4012440a403fSchristos   BFD_RELOC_TIC54X_23,
4013440a403fSchristos 
4014440a403fSchristos /* This is a 16-bit reloc for the tms320c54x, where the least
4015440a403fSchristos significant 16 bits of a 23-bit extended address are placed into
4016440a403fSchristos the opcode.  */
4017440a403fSchristos   BFD_RELOC_TIC54X_16_OF_23,
4018440a403fSchristos 
4019440a403fSchristos /* This is a reloc for the tms320c54x, where the most
4020440a403fSchristos significant 7 bits of a 23-bit extended address are placed into
4021440a403fSchristos the opcode.  */
4022440a403fSchristos   BFD_RELOC_TIC54X_MS7_OF_23,
4023440a403fSchristos 
4024440a403fSchristos /* TMS320C6000 relocations.  */
4025440a403fSchristos   BFD_RELOC_C6000_PCR_S21,
4026440a403fSchristos   BFD_RELOC_C6000_PCR_S12,
4027440a403fSchristos   BFD_RELOC_C6000_PCR_S10,
4028440a403fSchristos   BFD_RELOC_C6000_PCR_S7,
4029440a403fSchristos   BFD_RELOC_C6000_ABS_S16,
4030440a403fSchristos   BFD_RELOC_C6000_ABS_L16,
4031440a403fSchristos   BFD_RELOC_C6000_ABS_H16,
4032440a403fSchristos   BFD_RELOC_C6000_SBR_U15_B,
4033440a403fSchristos   BFD_RELOC_C6000_SBR_U15_H,
4034440a403fSchristos   BFD_RELOC_C6000_SBR_U15_W,
4035440a403fSchristos   BFD_RELOC_C6000_SBR_S16,
4036440a403fSchristos   BFD_RELOC_C6000_SBR_L16_B,
4037440a403fSchristos   BFD_RELOC_C6000_SBR_L16_H,
4038440a403fSchristos   BFD_RELOC_C6000_SBR_L16_W,
4039440a403fSchristos   BFD_RELOC_C6000_SBR_H16_B,
4040440a403fSchristos   BFD_RELOC_C6000_SBR_H16_H,
4041440a403fSchristos   BFD_RELOC_C6000_SBR_H16_W,
4042440a403fSchristos   BFD_RELOC_C6000_SBR_GOT_U15_W,
4043440a403fSchristos   BFD_RELOC_C6000_SBR_GOT_L16_W,
4044440a403fSchristos   BFD_RELOC_C6000_SBR_GOT_H16_W,
4045440a403fSchristos   BFD_RELOC_C6000_DSBT_INDEX,
4046440a403fSchristos   BFD_RELOC_C6000_PREL31,
4047440a403fSchristos   BFD_RELOC_C6000_COPY,
4048440a403fSchristos   BFD_RELOC_C6000_JUMP_SLOT,
4049440a403fSchristos   BFD_RELOC_C6000_EHTYPE,
4050440a403fSchristos   BFD_RELOC_C6000_PCR_H16,
4051440a403fSchristos   BFD_RELOC_C6000_PCR_L16,
4052440a403fSchristos   BFD_RELOC_C6000_ALIGN,
4053440a403fSchristos   BFD_RELOC_C6000_FPHEAD,
4054440a403fSchristos   BFD_RELOC_C6000_NOCMP,
4055440a403fSchristos 
4056440a403fSchristos /* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
4057440a403fSchristos   BFD_RELOC_FR30_48,
4058440a403fSchristos 
4059440a403fSchristos /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4060440a403fSchristos two sections.  */
4061440a403fSchristos   BFD_RELOC_FR30_20,
4062440a403fSchristos 
4063440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
4064440a403fSchristos 4 bits.  */
4065440a403fSchristos   BFD_RELOC_FR30_6_IN_4,
4066440a403fSchristos 
4067440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4068440a403fSchristos into 8 bits.  */
4069440a403fSchristos   BFD_RELOC_FR30_8_IN_8,
4070440a403fSchristos 
4071440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4072440a403fSchristos into 8 bits.  */
4073440a403fSchristos   BFD_RELOC_FR30_9_IN_8,
4074440a403fSchristos 
4075440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4076440a403fSchristos into 8 bits.  */
4077440a403fSchristos   BFD_RELOC_FR30_10_IN_8,
4078440a403fSchristos 
4079440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4080440a403fSchristos short offset into 8 bits.  */
4081440a403fSchristos   BFD_RELOC_FR30_9_PCREL,
4082440a403fSchristos 
4083440a403fSchristos /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4084440a403fSchristos short offset into 11 bits.  */
4085440a403fSchristos   BFD_RELOC_FR30_12_PCREL,
4086440a403fSchristos 
4087440a403fSchristos /* Motorola Mcore relocations.  */
4088440a403fSchristos   BFD_RELOC_MCORE_PCREL_IMM8BY4,
4089440a403fSchristos   BFD_RELOC_MCORE_PCREL_IMM11BY2,
4090440a403fSchristos   BFD_RELOC_MCORE_PCREL_IMM4BY2,
4091440a403fSchristos   BFD_RELOC_MCORE_PCREL_32,
4092440a403fSchristos   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4093440a403fSchristos   BFD_RELOC_MCORE_RVA,
4094440a403fSchristos 
4095440a403fSchristos /* Toshiba Media Processor Relocations.  */
4096440a403fSchristos   BFD_RELOC_MEP_8,
4097440a403fSchristos   BFD_RELOC_MEP_16,
4098440a403fSchristos   BFD_RELOC_MEP_32,
4099440a403fSchristos   BFD_RELOC_MEP_PCREL8A2,
4100440a403fSchristos   BFD_RELOC_MEP_PCREL12A2,
4101440a403fSchristos   BFD_RELOC_MEP_PCREL17A2,
4102440a403fSchristos   BFD_RELOC_MEP_PCREL24A2,
4103440a403fSchristos   BFD_RELOC_MEP_PCABS24A2,
4104440a403fSchristos   BFD_RELOC_MEP_LOW16,
4105440a403fSchristos   BFD_RELOC_MEP_HI16U,
4106440a403fSchristos   BFD_RELOC_MEP_HI16S,
4107440a403fSchristos   BFD_RELOC_MEP_GPREL,
4108440a403fSchristos   BFD_RELOC_MEP_TPREL,
4109440a403fSchristos   BFD_RELOC_MEP_TPREL7,
4110440a403fSchristos   BFD_RELOC_MEP_TPREL7A2,
4111440a403fSchristos   BFD_RELOC_MEP_TPREL7A4,
4112440a403fSchristos   BFD_RELOC_MEP_UIMM24,
4113440a403fSchristos   BFD_RELOC_MEP_ADDR24A4,
4114440a403fSchristos   BFD_RELOC_MEP_GNU_VTINHERIT,
4115440a403fSchristos   BFD_RELOC_MEP_GNU_VTENTRY,
4116440a403fSchristos 
4117440a403fSchristos 
4118440a403fSchristos /* Imagination Technologies Meta relocations.  */
4119440a403fSchristos   BFD_RELOC_METAG_HIADDR16,
4120440a403fSchristos   BFD_RELOC_METAG_LOADDR16,
4121440a403fSchristos   BFD_RELOC_METAG_RELBRANCH,
4122440a403fSchristos   BFD_RELOC_METAG_GETSETOFF,
4123440a403fSchristos   BFD_RELOC_METAG_HIOG,
4124440a403fSchristos   BFD_RELOC_METAG_LOOG,
4125440a403fSchristos   BFD_RELOC_METAG_REL8,
4126440a403fSchristos   BFD_RELOC_METAG_REL16,
4127440a403fSchristos   BFD_RELOC_METAG_HI16_GOTOFF,
4128440a403fSchristos   BFD_RELOC_METAG_LO16_GOTOFF,
4129440a403fSchristos   BFD_RELOC_METAG_GETSET_GOTOFF,
4130440a403fSchristos   BFD_RELOC_METAG_GETSET_GOT,
4131440a403fSchristos   BFD_RELOC_METAG_HI16_GOTPC,
4132440a403fSchristos   BFD_RELOC_METAG_LO16_GOTPC,
4133440a403fSchristos   BFD_RELOC_METAG_HI16_PLT,
4134440a403fSchristos   BFD_RELOC_METAG_LO16_PLT,
4135440a403fSchristos   BFD_RELOC_METAG_RELBRANCH_PLT,
4136440a403fSchristos   BFD_RELOC_METAG_GOTOFF,
4137440a403fSchristos   BFD_RELOC_METAG_PLT,
4138440a403fSchristos   BFD_RELOC_METAG_COPY,
4139440a403fSchristos   BFD_RELOC_METAG_JMP_SLOT,
4140440a403fSchristos   BFD_RELOC_METAG_RELATIVE,
4141440a403fSchristos   BFD_RELOC_METAG_GLOB_DAT,
4142440a403fSchristos   BFD_RELOC_METAG_TLS_GD,
4143440a403fSchristos   BFD_RELOC_METAG_TLS_LDM,
4144440a403fSchristos   BFD_RELOC_METAG_TLS_LDO_HI16,
4145440a403fSchristos   BFD_RELOC_METAG_TLS_LDO_LO16,
4146440a403fSchristos   BFD_RELOC_METAG_TLS_LDO,
4147440a403fSchristos   BFD_RELOC_METAG_TLS_IE,
4148440a403fSchristos   BFD_RELOC_METAG_TLS_IENONPIC,
4149440a403fSchristos   BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4150440a403fSchristos   BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4151440a403fSchristos   BFD_RELOC_METAG_TLS_TPOFF,
4152440a403fSchristos   BFD_RELOC_METAG_TLS_DTPMOD,
4153440a403fSchristos   BFD_RELOC_METAG_TLS_DTPOFF,
4154440a403fSchristos   BFD_RELOC_METAG_TLS_LE,
4155440a403fSchristos   BFD_RELOC_METAG_TLS_LE_HI16,
4156440a403fSchristos   BFD_RELOC_METAG_TLS_LE_LO16,
4157440a403fSchristos 
4158440a403fSchristos /* These are relocations for the GETA instruction.  */
4159440a403fSchristos   BFD_RELOC_MMIX_GETA,
4160440a403fSchristos   BFD_RELOC_MMIX_GETA_1,
4161440a403fSchristos   BFD_RELOC_MMIX_GETA_2,
4162440a403fSchristos   BFD_RELOC_MMIX_GETA_3,
4163440a403fSchristos 
4164440a403fSchristos /* These are relocations for a conditional branch instruction.  */
4165440a403fSchristos   BFD_RELOC_MMIX_CBRANCH,
4166440a403fSchristos   BFD_RELOC_MMIX_CBRANCH_J,
4167440a403fSchristos   BFD_RELOC_MMIX_CBRANCH_1,
4168440a403fSchristos   BFD_RELOC_MMIX_CBRANCH_2,
4169440a403fSchristos   BFD_RELOC_MMIX_CBRANCH_3,
4170440a403fSchristos 
4171440a403fSchristos /* These are relocations for the PUSHJ instruction.  */
4172440a403fSchristos   BFD_RELOC_MMIX_PUSHJ,
4173440a403fSchristos   BFD_RELOC_MMIX_PUSHJ_1,
4174440a403fSchristos   BFD_RELOC_MMIX_PUSHJ_2,
4175440a403fSchristos   BFD_RELOC_MMIX_PUSHJ_3,
4176440a403fSchristos   BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4177440a403fSchristos 
4178440a403fSchristos /* These are relocations for the JMP instruction.  */
4179440a403fSchristos   BFD_RELOC_MMIX_JMP,
4180440a403fSchristos   BFD_RELOC_MMIX_JMP_1,
4181440a403fSchristos   BFD_RELOC_MMIX_JMP_2,
4182440a403fSchristos   BFD_RELOC_MMIX_JMP_3,
4183440a403fSchristos 
4184440a403fSchristos /* This is a relocation for a relative address as in a GETA instruction or
4185440a403fSchristos a branch.  */
4186440a403fSchristos   BFD_RELOC_MMIX_ADDR19,
4187440a403fSchristos 
4188440a403fSchristos /* This is a relocation for a relative address as in a JMP instruction.  */
4189440a403fSchristos   BFD_RELOC_MMIX_ADDR27,
4190440a403fSchristos 
4191440a403fSchristos /* This is a relocation for an instruction field that may be a general
4192440a403fSchristos register or a value 0..255.  */
4193440a403fSchristos   BFD_RELOC_MMIX_REG_OR_BYTE,
4194440a403fSchristos 
4195440a403fSchristos /* This is a relocation for an instruction field that may be a general
4196440a403fSchristos register.  */
4197440a403fSchristos   BFD_RELOC_MMIX_REG,
4198440a403fSchristos 
4199440a403fSchristos /* This is a relocation for two instruction fields holding a register and
4200440a403fSchristos an offset, the equivalent of the relocation.  */
4201440a403fSchristos   BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4202440a403fSchristos 
4203440a403fSchristos /* This relocation is an assertion that the expression is not allocated as
4204440a403fSchristos a global register.  It does not modify contents.  */
4205440a403fSchristos   BFD_RELOC_MMIX_LOCAL,
4206440a403fSchristos 
4207440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4208440a403fSchristos short offset into 7 bits.  */
4209440a403fSchristos   BFD_RELOC_AVR_7_PCREL,
4210440a403fSchristos 
4211440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4212440a403fSchristos short offset into 12 bits.  */
4213440a403fSchristos   BFD_RELOC_AVR_13_PCREL,
4214440a403fSchristos 
4215440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4216440a403fSchristos program memory address) into 16 bits.  */
4217440a403fSchristos   BFD_RELOC_AVR_16_PM,
4218440a403fSchristos 
4219440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4220440a403fSchristos data memory address) into 8 bit immediate value of LDI insn.  */
4221440a403fSchristos   BFD_RELOC_AVR_LO8_LDI,
4222440a403fSchristos 
4223440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4224440a403fSchristos of data memory address) into 8 bit immediate value of LDI insn.  */
4225440a403fSchristos   BFD_RELOC_AVR_HI8_LDI,
4226440a403fSchristos 
4227440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4228440a403fSchristos of program memory address) into 8 bit immediate value of LDI insn.  */
4229440a403fSchristos   BFD_RELOC_AVR_HH8_LDI,
4230440a403fSchristos 
4231440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4232440a403fSchristos of 32 bit value) into 8 bit immediate value of LDI insn.  */
4233440a403fSchristos   BFD_RELOC_AVR_MS8_LDI,
4234440a403fSchristos 
4235440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4236440a403fSchristos (usually data memory address) into 8 bit immediate value of SUBI insn.  */
4237440a403fSchristos   BFD_RELOC_AVR_LO8_LDI_NEG,
4238440a403fSchristos 
4239440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4240440a403fSchristos (high 8 bit of data memory address) into 8 bit immediate value of
4241440a403fSchristos SUBI insn.  */
4242440a403fSchristos   BFD_RELOC_AVR_HI8_LDI_NEG,
4243440a403fSchristos 
4244440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4245440a403fSchristos (most high 8 bit of program memory address) into 8 bit immediate value
4246440a403fSchristos of LDI or SUBI insn.  */
4247440a403fSchristos   BFD_RELOC_AVR_HH8_LDI_NEG,
4248440a403fSchristos 
4249440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4250440a403fSchristos of 32 bit value) into 8 bit immediate value of LDI insn.  */
4251440a403fSchristos   BFD_RELOC_AVR_MS8_LDI_NEG,
4252440a403fSchristos 
4253440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4254440a403fSchristos command address) into 8 bit immediate value of LDI insn.  */
4255440a403fSchristos   BFD_RELOC_AVR_LO8_LDI_PM,
4256440a403fSchristos 
4257440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value
4258440a403fSchristos (command address) into 8 bit immediate value of LDI insn. If the address
4259440a403fSchristos is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4260440a403fSchristos in the lower 128k.  */
4261440a403fSchristos   BFD_RELOC_AVR_LO8_LDI_GS,
4262440a403fSchristos 
4263440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4264440a403fSchristos of command address) into 8 bit immediate value of LDI insn.  */
4265440a403fSchristos   BFD_RELOC_AVR_HI8_LDI_PM,
4266440a403fSchristos 
4267440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4268440a403fSchristos of command address) into 8 bit immediate value of LDI insn.  If the address
4269440a403fSchristos is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4270440a403fSchristos below 128k.  */
4271440a403fSchristos   BFD_RELOC_AVR_HI8_LDI_GS,
4272440a403fSchristos 
4273440a403fSchristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4274440a403fSchristos of command address) into 8 bit immediate value of LDI insn.  */
4275440a403fSchristos   BFD_RELOC_AVR_HH8_LDI_PM,
4276440a403fSchristos 
4277440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4278440a403fSchristos (usually command address) into 8 bit immediate value of SUBI insn.  */
4279440a403fSchristos   BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4280440a403fSchristos 
4281440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4282440a403fSchristos (high 8 bit of 16 bit command address) into 8 bit immediate value
4283440a403fSchristos of SUBI insn.  */
4284440a403fSchristos   BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4285440a403fSchristos 
4286440a403fSchristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4287440a403fSchristos (high 6 bit of 22 bit command address) into 8 bit immediate
4288440a403fSchristos value of SUBI insn.  */
4289440a403fSchristos   BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4290440a403fSchristos 
4291440a403fSchristos /* This is a 32 bit reloc for the AVR that stores 23 bit value
4292440a403fSchristos into 22 bits.  */
4293440a403fSchristos   BFD_RELOC_AVR_CALL,
4294440a403fSchristos 
4295440a403fSchristos /* This is a 16 bit reloc for the AVR that stores all needed bits
4296440a403fSchristos for absolute addressing with ldi with overflow check to linktime  */
4297440a403fSchristos   BFD_RELOC_AVR_LDI,
4298440a403fSchristos 
4299440a403fSchristos /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4300440a403fSchristos instructions  */
4301440a403fSchristos   BFD_RELOC_AVR_6,
4302440a403fSchristos 
4303440a403fSchristos /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4304440a403fSchristos instructions  */
4305440a403fSchristos   BFD_RELOC_AVR_6_ADIW,
4306440a403fSchristos 
4307440a403fSchristos /* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4308440a403fSchristos in .byte lo8(symbol)  */
4309440a403fSchristos   BFD_RELOC_AVR_8_LO,
4310440a403fSchristos 
4311440a403fSchristos /* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4312440a403fSchristos in .byte hi8(symbol)  */
4313440a403fSchristos   BFD_RELOC_AVR_8_HI,
4314440a403fSchristos 
4315440a403fSchristos /* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4316440a403fSchristos in .byte hlo8(symbol)  */
4317440a403fSchristos   BFD_RELOC_AVR_8_HLO,
4318440a403fSchristos 
4319440a403fSchristos /* AVR relocations to mark the difference of two local symbols.
4320440a403fSchristos These are only needed to support linker relaxation and can be ignored
4321440a403fSchristos when not relaxing.  The field is set to the value of the difference
4322440a403fSchristos assuming no relaxation.  The relocation encodes the position of the
4323440a403fSchristos second symbol so the linker can determine whether to adjust the field
4324440a403fSchristos value.  */
4325440a403fSchristos   BFD_RELOC_AVR_DIFF8,
4326440a403fSchristos   BFD_RELOC_AVR_DIFF16,
4327440a403fSchristos   BFD_RELOC_AVR_DIFF32,
4328440a403fSchristos 
4329440a403fSchristos /* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4330440a403fSchristos lds and sts instructions supported only tiny core.  */
4331440a403fSchristos   BFD_RELOC_AVR_LDS_STS_16,
4332440a403fSchristos 
4333440a403fSchristos /* This is a 6 bit reloc for the AVR that stores an I/O register
4334440a403fSchristos number for the IN and OUT instructions  */
4335440a403fSchristos   BFD_RELOC_AVR_PORT6,
4336440a403fSchristos 
4337440a403fSchristos /* This is a 5 bit reloc for the AVR that stores an I/O register
4338440a403fSchristos number for the SBIC, SBIS, SBI and CBI instructions  */
4339440a403fSchristos   BFD_RELOC_AVR_PORT5,
4340440a403fSchristos 
434106324dcfSchristos /* RISC-V relocations.  */
434206324dcfSchristos   BFD_RELOC_RISCV_HI20,
434306324dcfSchristos   BFD_RELOC_RISCV_PCREL_HI20,
434406324dcfSchristos   BFD_RELOC_RISCV_PCREL_LO12_I,
434506324dcfSchristos   BFD_RELOC_RISCV_PCREL_LO12_S,
434606324dcfSchristos   BFD_RELOC_RISCV_LO12_I,
434706324dcfSchristos   BFD_RELOC_RISCV_LO12_S,
434806324dcfSchristos   BFD_RELOC_RISCV_GPREL12_I,
434906324dcfSchristos   BFD_RELOC_RISCV_GPREL12_S,
435006324dcfSchristos   BFD_RELOC_RISCV_TPREL_HI20,
435106324dcfSchristos   BFD_RELOC_RISCV_TPREL_LO12_I,
435206324dcfSchristos   BFD_RELOC_RISCV_TPREL_LO12_S,
435306324dcfSchristos   BFD_RELOC_RISCV_TPREL_ADD,
435406324dcfSchristos   BFD_RELOC_RISCV_CALL,
435506324dcfSchristos   BFD_RELOC_RISCV_CALL_PLT,
435606324dcfSchristos   BFD_RELOC_RISCV_ADD8,
435706324dcfSchristos   BFD_RELOC_RISCV_ADD16,
435806324dcfSchristos   BFD_RELOC_RISCV_ADD32,
435906324dcfSchristos   BFD_RELOC_RISCV_ADD64,
436006324dcfSchristos   BFD_RELOC_RISCV_SUB8,
436106324dcfSchristos   BFD_RELOC_RISCV_SUB16,
436206324dcfSchristos   BFD_RELOC_RISCV_SUB32,
436306324dcfSchristos   BFD_RELOC_RISCV_SUB64,
436406324dcfSchristos   BFD_RELOC_RISCV_GOT_HI20,
436506324dcfSchristos   BFD_RELOC_RISCV_TLS_GOT_HI20,
436606324dcfSchristos   BFD_RELOC_RISCV_TLS_GD_HI20,
436706324dcfSchristos   BFD_RELOC_RISCV_JMP,
436806324dcfSchristos   BFD_RELOC_RISCV_TLS_DTPMOD32,
436906324dcfSchristos   BFD_RELOC_RISCV_TLS_DTPREL32,
437006324dcfSchristos   BFD_RELOC_RISCV_TLS_DTPMOD64,
437106324dcfSchristos   BFD_RELOC_RISCV_TLS_DTPREL64,
437206324dcfSchristos   BFD_RELOC_RISCV_TLS_TPREL32,
437306324dcfSchristos   BFD_RELOC_RISCV_TLS_TPREL64,
437406324dcfSchristos   BFD_RELOC_RISCV_ALIGN,
437506324dcfSchristos   BFD_RELOC_RISCV_RVC_BRANCH,
437606324dcfSchristos   BFD_RELOC_RISCV_RVC_JUMP,
437706324dcfSchristos   BFD_RELOC_RISCV_RVC_LUI,
437806324dcfSchristos   BFD_RELOC_RISCV_GPREL_I,
437906324dcfSchristos   BFD_RELOC_RISCV_GPREL_S,
438006324dcfSchristos   BFD_RELOC_RISCV_TPREL_I,
438106324dcfSchristos   BFD_RELOC_RISCV_TPREL_S,
438206324dcfSchristos   BFD_RELOC_RISCV_RELAX,
438306324dcfSchristos   BFD_RELOC_RISCV_CFA,
438406324dcfSchristos   BFD_RELOC_RISCV_SUB6,
438506324dcfSchristos   BFD_RELOC_RISCV_SET6,
438606324dcfSchristos   BFD_RELOC_RISCV_SET8,
438706324dcfSchristos   BFD_RELOC_RISCV_SET16,
438806324dcfSchristos   BFD_RELOC_RISCV_SET32,
438906324dcfSchristos   BFD_RELOC_RISCV_32_PCREL,
439006324dcfSchristos 
4391440a403fSchristos /* Renesas RL78 Relocations.  */
4392440a403fSchristos   BFD_RELOC_RL78_NEG8,
4393440a403fSchristos   BFD_RELOC_RL78_NEG16,
4394440a403fSchristos   BFD_RELOC_RL78_NEG24,
4395440a403fSchristos   BFD_RELOC_RL78_NEG32,
4396440a403fSchristos   BFD_RELOC_RL78_16_OP,
4397440a403fSchristos   BFD_RELOC_RL78_24_OP,
4398440a403fSchristos   BFD_RELOC_RL78_32_OP,
4399440a403fSchristos   BFD_RELOC_RL78_8U,
4400440a403fSchristos   BFD_RELOC_RL78_16U,
4401440a403fSchristos   BFD_RELOC_RL78_24U,
4402440a403fSchristos   BFD_RELOC_RL78_DIR3U_PCREL,
4403440a403fSchristos   BFD_RELOC_RL78_DIFF,
4404440a403fSchristos   BFD_RELOC_RL78_GPRELB,
4405440a403fSchristos   BFD_RELOC_RL78_GPRELW,
4406440a403fSchristos   BFD_RELOC_RL78_GPRELL,
4407440a403fSchristos   BFD_RELOC_RL78_SYM,
4408440a403fSchristos   BFD_RELOC_RL78_OP_SUBTRACT,
4409440a403fSchristos   BFD_RELOC_RL78_OP_NEG,
4410440a403fSchristos   BFD_RELOC_RL78_OP_AND,
4411440a403fSchristos   BFD_RELOC_RL78_OP_SHRA,
4412440a403fSchristos   BFD_RELOC_RL78_ABS8,
4413440a403fSchristos   BFD_RELOC_RL78_ABS16,
4414440a403fSchristos   BFD_RELOC_RL78_ABS16_REV,
4415440a403fSchristos   BFD_RELOC_RL78_ABS32,
4416440a403fSchristos   BFD_RELOC_RL78_ABS32_REV,
4417440a403fSchristos   BFD_RELOC_RL78_ABS16U,
4418440a403fSchristos   BFD_RELOC_RL78_ABS16UW,
4419440a403fSchristos   BFD_RELOC_RL78_ABS16UL,
4420440a403fSchristos   BFD_RELOC_RL78_RELAX,
4421440a403fSchristos   BFD_RELOC_RL78_HI16,
4422440a403fSchristos   BFD_RELOC_RL78_HI8,
4423440a403fSchristos   BFD_RELOC_RL78_LO16,
4424440a403fSchristos   BFD_RELOC_RL78_CODE,
4425440a403fSchristos   BFD_RELOC_RL78_SADDR,
4426440a403fSchristos 
4427440a403fSchristos /* Renesas RX Relocations.  */
4428440a403fSchristos   BFD_RELOC_RX_NEG8,
4429440a403fSchristos   BFD_RELOC_RX_NEG16,
4430440a403fSchristos   BFD_RELOC_RX_NEG24,
4431440a403fSchristos   BFD_RELOC_RX_NEG32,
4432440a403fSchristos   BFD_RELOC_RX_16_OP,
4433440a403fSchristos   BFD_RELOC_RX_24_OP,
4434440a403fSchristos   BFD_RELOC_RX_32_OP,
4435440a403fSchristos   BFD_RELOC_RX_8U,
4436440a403fSchristos   BFD_RELOC_RX_16U,
4437440a403fSchristos   BFD_RELOC_RX_24U,
4438440a403fSchristos   BFD_RELOC_RX_DIR3U_PCREL,
4439440a403fSchristos   BFD_RELOC_RX_DIFF,
4440440a403fSchristos   BFD_RELOC_RX_GPRELB,
4441440a403fSchristos   BFD_RELOC_RX_GPRELW,
4442440a403fSchristos   BFD_RELOC_RX_GPRELL,
4443440a403fSchristos   BFD_RELOC_RX_SYM,
4444440a403fSchristos   BFD_RELOC_RX_OP_SUBTRACT,
4445440a403fSchristos   BFD_RELOC_RX_OP_NEG,
4446440a403fSchristos   BFD_RELOC_RX_ABS8,
4447440a403fSchristos   BFD_RELOC_RX_ABS16,
4448440a403fSchristos   BFD_RELOC_RX_ABS16_REV,
4449440a403fSchristos   BFD_RELOC_RX_ABS32,
4450440a403fSchristos   BFD_RELOC_RX_ABS32_REV,
4451440a403fSchristos   BFD_RELOC_RX_ABS16U,
4452440a403fSchristos   BFD_RELOC_RX_ABS16UW,
4453440a403fSchristos   BFD_RELOC_RX_ABS16UL,
4454440a403fSchristos   BFD_RELOC_RX_RELAX,
4455440a403fSchristos 
4456440a403fSchristos /* Direct 12 bit.  */
4457440a403fSchristos   BFD_RELOC_390_12,
4458440a403fSchristos 
4459440a403fSchristos /* 12 bit GOT offset.  */
4460440a403fSchristos   BFD_RELOC_390_GOT12,
4461440a403fSchristos 
4462440a403fSchristos /* 32 bit PC relative PLT address.  */
4463440a403fSchristos   BFD_RELOC_390_PLT32,
4464440a403fSchristos 
4465440a403fSchristos /* Copy symbol at runtime.  */
4466440a403fSchristos   BFD_RELOC_390_COPY,
4467440a403fSchristos 
4468440a403fSchristos /* Create GOT entry.  */
4469440a403fSchristos   BFD_RELOC_390_GLOB_DAT,
4470440a403fSchristos 
4471440a403fSchristos /* Create PLT entry.  */
4472440a403fSchristos   BFD_RELOC_390_JMP_SLOT,
4473440a403fSchristos 
4474440a403fSchristos /* Adjust by program base.  */
4475440a403fSchristos   BFD_RELOC_390_RELATIVE,
4476440a403fSchristos 
4477440a403fSchristos /* 32 bit PC relative offset to GOT.  */
4478440a403fSchristos   BFD_RELOC_390_GOTPC,
4479440a403fSchristos 
4480440a403fSchristos /* 16 bit GOT offset.  */
4481440a403fSchristos   BFD_RELOC_390_GOT16,
4482440a403fSchristos 
4483440a403fSchristos /* PC relative 12 bit shifted by 1.  */
4484440a403fSchristos   BFD_RELOC_390_PC12DBL,
4485440a403fSchristos 
4486440a403fSchristos /* 12 bit PC rel. PLT shifted by 1.  */
4487440a403fSchristos   BFD_RELOC_390_PLT12DBL,
4488440a403fSchristos 
4489440a403fSchristos /* PC relative 16 bit shifted by 1.  */
4490440a403fSchristos   BFD_RELOC_390_PC16DBL,
4491440a403fSchristos 
4492440a403fSchristos /* 16 bit PC rel. PLT shifted by 1.  */
4493440a403fSchristos   BFD_RELOC_390_PLT16DBL,
4494440a403fSchristos 
4495440a403fSchristos /* PC relative 24 bit shifted by 1.  */
4496440a403fSchristos   BFD_RELOC_390_PC24DBL,
4497440a403fSchristos 
4498440a403fSchristos /* 24 bit PC rel. PLT shifted by 1.  */
4499440a403fSchristos   BFD_RELOC_390_PLT24DBL,
4500440a403fSchristos 
4501440a403fSchristos /* PC relative 32 bit shifted by 1.  */
4502440a403fSchristos   BFD_RELOC_390_PC32DBL,
4503440a403fSchristos 
4504440a403fSchristos /* 32 bit PC rel. PLT shifted by 1.  */
4505440a403fSchristos   BFD_RELOC_390_PLT32DBL,
4506440a403fSchristos 
4507440a403fSchristos /* 32 bit PC rel. GOT shifted by 1.  */
4508440a403fSchristos   BFD_RELOC_390_GOTPCDBL,
4509440a403fSchristos 
4510440a403fSchristos /* 64 bit GOT offset.  */
4511440a403fSchristos   BFD_RELOC_390_GOT64,
4512440a403fSchristos 
4513440a403fSchristos /* 64 bit PC relative PLT address.  */
4514440a403fSchristos   BFD_RELOC_390_PLT64,
4515440a403fSchristos 
4516440a403fSchristos /* 32 bit rel. offset to GOT entry.  */
4517440a403fSchristos   BFD_RELOC_390_GOTENT,
4518440a403fSchristos 
4519440a403fSchristos /* 64 bit offset to GOT.  */
4520440a403fSchristos   BFD_RELOC_390_GOTOFF64,
4521440a403fSchristos 
4522440a403fSchristos /* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
4523440a403fSchristos   BFD_RELOC_390_GOTPLT12,
4524440a403fSchristos 
4525440a403fSchristos /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
4526440a403fSchristos   BFD_RELOC_390_GOTPLT16,
4527440a403fSchristos 
4528440a403fSchristos /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
4529440a403fSchristos   BFD_RELOC_390_GOTPLT32,
4530440a403fSchristos 
4531440a403fSchristos /* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
4532440a403fSchristos   BFD_RELOC_390_GOTPLT64,
4533440a403fSchristos 
4534440a403fSchristos /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
4535440a403fSchristos   BFD_RELOC_390_GOTPLTENT,
4536440a403fSchristos 
4537440a403fSchristos /* 16-bit rel. offset from the GOT to a PLT entry.  */
4538440a403fSchristos   BFD_RELOC_390_PLTOFF16,
4539440a403fSchristos 
4540440a403fSchristos /* 32-bit rel. offset from the GOT to a PLT entry.  */
4541440a403fSchristos   BFD_RELOC_390_PLTOFF32,
4542440a403fSchristos 
4543440a403fSchristos /* 64-bit rel. offset from the GOT to a PLT entry.  */
4544440a403fSchristos   BFD_RELOC_390_PLTOFF64,
4545440a403fSchristos 
4546440a403fSchristos /* s390 tls relocations.  */
4547440a403fSchristos   BFD_RELOC_390_TLS_LOAD,
4548440a403fSchristos   BFD_RELOC_390_TLS_GDCALL,
4549440a403fSchristos   BFD_RELOC_390_TLS_LDCALL,
4550440a403fSchristos   BFD_RELOC_390_TLS_GD32,
4551440a403fSchristos   BFD_RELOC_390_TLS_GD64,
4552440a403fSchristos   BFD_RELOC_390_TLS_GOTIE12,
4553440a403fSchristos   BFD_RELOC_390_TLS_GOTIE32,
4554440a403fSchristos   BFD_RELOC_390_TLS_GOTIE64,
4555440a403fSchristos   BFD_RELOC_390_TLS_LDM32,
4556440a403fSchristos   BFD_RELOC_390_TLS_LDM64,
4557440a403fSchristos   BFD_RELOC_390_TLS_IE32,
4558440a403fSchristos   BFD_RELOC_390_TLS_IE64,
4559440a403fSchristos   BFD_RELOC_390_TLS_IEENT,
4560440a403fSchristos   BFD_RELOC_390_TLS_LE32,
4561440a403fSchristos   BFD_RELOC_390_TLS_LE64,
4562440a403fSchristos   BFD_RELOC_390_TLS_LDO32,
4563440a403fSchristos   BFD_RELOC_390_TLS_LDO64,
4564440a403fSchristos   BFD_RELOC_390_TLS_DTPMOD,
4565440a403fSchristos   BFD_RELOC_390_TLS_DTPOFF,
4566440a403fSchristos   BFD_RELOC_390_TLS_TPOFF,
4567440a403fSchristos 
4568440a403fSchristos /* Long displacement extension.  */
4569440a403fSchristos   BFD_RELOC_390_20,
4570440a403fSchristos   BFD_RELOC_390_GOT20,
4571440a403fSchristos   BFD_RELOC_390_GOTPLT20,
4572440a403fSchristos   BFD_RELOC_390_TLS_GOTIE20,
4573440a403fSchristos 
4574440a403fSchristos /* STT_GNU_IFUNC relocation.  */
4575440a403fSchristos   BFD_RELOC_390_IRELATIVE,
4576440a403fSchristos 
4577440a403fSchristos /* Score relocations
4578440a403fSchristos Low 16 bit for load/store  */
4579440a403fSchristos   BFD_RELOC_SCORE_GPREL15,
4580440a403fSchristos 
4581440a403fSchristos /* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
4582440a403fSchristos   BFD_RELOC_SCORE_DUMMY2,
4583440a403fSchristos   BFD_RELOC_SCORE_JMP,
4584440a403fSchristos 
4585440a403fSchristos /* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
4586440a403fSchristos   BFD_RELOC_SCORE_BRANCH,
4587440a403fSchristos 
4588440a403fSchristos /* This is a 32-bit reloc for 48-bit instructions.  */
4589440a403fSchristos   BFD_RELOC_SCORE_IMM30,
4590440a403fSchristos 
4591440a403fSchristos /* This is a 32-bit reloc for 48-bit instructions.  */
4592440a403fSchristos   BFD_RELOC_SCORE_IMM32,
4593440a403fSchristos 
4594440a403fSchristos /* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
4595440a403fSchristos   BFD_RELOC_SCORE16_JMP,
4596440a403fSchristos 
4597440a403fSchristos /* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
4598440a403fSchristos   BFD_RELOC_SCORE16_BRANCH,
4599440a403fSchristos 
4600440a403fSchristos /* This is a 9-bit reloc with the right 1 bit assumed to be 0  */
4601440a403fSchristos   BFD_RELOC_SCORE_BCMP,
4602440a403fSchristos 
4603440a403fSchristos /* Undocumented Score relocs  */
4604440a403fSchristos   BFD_RELOC_SCORE_GOT15,
4605440a403fSchristos   BFD_RELOC_SCORE_GOT_LO16,
4606440a403fSchristos   BFD_RELOC_SCORE_CALL15,
4607440a403fSchristos   BFD_RELOC_SCORE_DUMMY_HI16,
4608440a403fSchristos 
4609440a403fSchristos /* Scenix IP2K - 9-bit register number / data address  */
4610440a403fSchristos   BFD_RELOC_IP2K_FR9,
4611440a403fSchristos 
4612440a403fSchristos /* Scenix IP2K - 4-bit register/data bank number  */
4613440a403fSchristos   BFD_RELOC_IP2K_BANK,
4614440a403fSchristos 
4615440a403fSchristos /* Scenix IP2K - low 13 bits of instruction word address  */
4616440a403fSchristos   BFD_RELOC_IP2K_ADDR16CJP,
4617440a403fSchristos 
4618440a403fSchristos /* Scenix IP2K - high 3 bits of instruction word address  */
4619440a403fSchristos   BFD_RELOC_IP2K_PAGE3,
4620440a403fSchristos 
4621440a403fSchristos /* Scenix IP2K - ext/low/high 8 bits of data address  */
4622440a403fSchristos   BFD_RELOC_IP2K_LO8DATA,
4623440a403fSchristos   BFD_RELOC_IP2K_HI8DATA,
4624440a403fSchristos   BFD_RELOC_IP2K_EX8DATA,
4625440a403fSchristos 
4626440a403fSchristos /* Scenix IP2K - low/high 8 bits of instruction word address  */
4627440a403fSchristos   BFD_RELOC_IP2K_LO8INSN,
4628440a403fSchristos   BFD_RELOC_IP2K_HI8INSN,
4629440a403fSchristos 
4630440a403fSchristos /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
4631440a403fSchristos   BFD_RELOC_IP2K_PC_SKIP,
4632440a403fSchristos 
4633440a403fSchristos /* Scenix IP2K - 16 bit word address in text section.  */
4634440a403fSchristos   BFD_RELOC_IP2K_TEXT,
4635440a403fSchristos 
4636440a403fSchristos /* Scenix IP2K - 7-bit sp or dp offset  */
4637440a403fSchristos   BFD_RELOC_IP2K_FR_OFFSET,
4638440a403fSchristos 
4639440a403fSchristos /* Scenix VPE4K coprocessor - data/insn-space addressing  */
4640440a403fSchristos   BFD_RELOC_VPE4KMATH_DATA,
4641440a403fSchristos   BFD_RELOC_VPE4KMATH_INSN,
4642440a403fSchristos 
4643440a403fSchristos /* These two relocations are used by the linker to determine which of
4644440a403fSchristos the entries in a C++ virtual function table are actually used.  When
4645440a403fSchristos the --gc-sections option is given, the linker will zero out the entries
4646440a403fSchristos that are not used, so that the code for those functions need not be
4647440a403fSchristos included in the output.
4648440a403fSchristos 
4649440a403fSchristos VTABLE_INHERIT is a zero-space relocation used to describe to the
4650440a403fSchristos linker the inheritance tree of a C++ virtual function table.  The
4651440a403fSchristos relocation's symbol should be the parent class' vtable, and the
4652440a403fSchristos relocation should be located at the child vtable.
4653440a403fSchristos 
4654440a403fSchristos VTABLE_ENTRY is a zero-space relocation that describes the use of a
4655440a403fSchristos virtual function table entry.  The reloc's symbol should refer to the
4656440a403fSchristos table of the class mentioned in the code.  Off of that base, an offset
4657440a403fSchristos describes the entry that is being used.  For Rela hosts, this offset
4658440a403fSchristos is stored in the reloc's addend.  For Rel hosts, we are forced to put
4659440a403fSchristos this offset in the reloc's section offset.  */
4660440a403fSchristos   BFD_RELOC_VTABLE_INHERIT,
4661440a403fSchristos   BFD_RELOC_VTABLE_ENTRY,
4662440a403fSchristos 
4663440a403fSchristos /* Intel IA64 Relocations.  */
4664440a403fSchristos   BFD_RELOC_IA64_IMM14,
4665440a403fSchristos   BFD_RELOC_IA64_IMM22,
4666440a403fSchristos   BFD_RELOC_IA64_IMM64,
4667440a403fSchristos   BFD_RELOC_IA64_DIR32MSB,
4668440a403fSchristos   BFD_RELOC_IA64_DIR32LSB,
4669440a403fSchristos   BFD_RELOC_IA64_DIR64MSB,
4670440a403fSchristos   BFD_RELOC_IA64_DIR64LSB,
4671440a403fSchristos   BFD_RELOC_IA64_GPREL22,
4672440a403fSchristos   BFD_RELOC_IA64_GPREL64I,
4673440a403fSchristos   BFD_RELOC_IA64_GPREL32MSB,
4674440a403fSchristos   BFD_RELOC_IA64_GPREL32LSB,
4675440a403fSchristos   BFD_RELOC_IA64_GPREL64MSB,
4676440a403fSchristos   BFD_RELOC_IA64_GPREL64LSB,
4677440a403fSchristos   BFD_RELOC_IA64_LTOFF22,
4678440a403fSchristos   BFD_RELOC_IA64_LTOFF64I,
4679440a403fSchristos   BFD_RELOC_IA64_PLTOFF22,
4680440a403fSchristos   BFD_RELOC_IA64_PLTOFF64I,
4681440a403fSchristos   BFD_RELOC_IA64_PLTOFF64MSB,
4682440a403fSchristos   BFD_RELOC_IA64_PLTOFF64LSB,
4683440a403fSchristos   BFD_RELOC_IA64_FPTR64I,
4684440a403fSchristos   BFD_RELOC_IA64_FPTR32MSB,
4685440a403fSchristos   BFD_RELOC_IA64_FPTR32LSB,
4686440a403fSchristos   BFD_RELOC_IA64_FPTR64MSB,
4687440a403fSchristos   BFD_RELOC_IA64_FPTR64LSB,
4688440a403fSchristos   BFD_RELOC_IA64_PCREL21B,
4689440a403fSchristos   BFD_RELOC_IA64_PCREL21BI,
4690440a403fSchristos   BFD_RELOC_IA64_PCREL21M,
4691440a403fSchristos   BFD_RELOC_IA64_PCREL21F,
4692440a403fSchristos   BFD_RELOC_IA64_PCREL22,
4693440a403fSchristos   BFD_RELOC_IA64_PCREL60B,
4694440a403fSchristos   BFD_RELOC_IA64_PCREL64I,
4695440a403fSchristos   BFD_RELOC_IA64_PCREL32MSB,
4696440a403fSchristos   BFD_RELOC_IA64_PCREL32LSB,
4697440a403fSchristos   BFD_RELOC_IA64_PCREL64MSB,
4698440a403fSchristos   BFD_RELOC_IA64_PCREL64LSB,
4699440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR22,
4700440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR64I,
4701440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR32MSB,
4702440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR32LSB,
4703440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR64MSB,
4704440a403fSchristos   BFD_RELOC_IA64_LTOFF_FPTR64LSB,
4705440a403fSchristos   BFD_RELOC_IA64_SEGREL32MSB,
4706440a403fSchristos   BFD_RELOC_IA64_SEGREL32LSB,
4707440a403fSchristos   BFD_RELOC_IA64_SEGREL64MSB,
4708440a403fSchristos   BFD_RELOC_IA64_SEGREL64LSB,
4709440a403fSchristos   BFD_RELOC_IA64_SECREL32MSB,
4710440a403fSchristos   BFD_RELOC_IA64_SECREL32LSB,
4711440a403fSchristos   BFD_RELOC_IA64_SECREL64MSB,
4712440a403fSchristos   BFD_RELOC_IA64_SECREL64LSB,
4713440a403fSchristos   BFD_RELOC_IA64_REL32MSB,
4714440a403fSchristos   BFD_RELOC_IA64_REL32LSB,
4715440a403fSchristos   BFD_RELOC_IA64_REL64MSB,
4716440a403fSchristos   BFD_RELOC_IA64_REL64LSB,
4717440a403fSchristos   BFD_RELOC_IA64_LTV32MSB,
4718440a403fSchristos   BFD_RELOC_IA64_LTV32LSB,
4719440a403fSchristos   BFD_RELOC_IA64_LTV64MSB,
4720440a403fSchristos   BFD_RELOC_IA64_LTV64LSB,
4721440a403fSchristos   BFD_RELOC_IA64_IPLTMSB,
4722440a403fSchristos   BFD_RELOC_IA64_IPLTLSB,
4723440a403fSchristos   BFD_RELOC_IA64_COPY,
4724440a403fSchristos   BFD_RELOC_IA64_LTOFF22X,
4725440a403fSchristos   BFD_RELOC_IA64_LDXMOV,
4726440a403fSchristos   BFD_RELOC_IA64_TPREL14,
4727440a403fSchristos   BFD_RELOC_IA64_TPREL22,
4728440a403fSchristos   BFD_RELOC_IA64_TPREL64I,
4729440a403fSchristos   BFD_RELOC_IA64_TPREL64MSB,
4730440a403fSchristos   BFD_RELOC_IA64_TPREL64LSB,
4731440a403fSchristos   BFD_RELOC_IA64_LTOFF_TPREL22,
4732440a403fSchristos   BFD_RELOC_IA64_DTPMOD64MSB,
4733440a403fSchristos   BFD_RELOC_IA64_DTPMOD64LSB,
4734440a403fSchristos   BFD_RELOC_IA64_LTOFF_DTPMOD22,
4735440a403fSchristos   BFD_RELOC_IA64_DTPREL14,
4736440a403fSchristos   BFD_RELOC_IA64_DTPREL22,
4737440a403fSchristos   BFD_RELOC_IA64_DTPREL64I,
4738440a403fSchristos   BFD_RELOC_IA64_DTPREL32MSB,
4739440a403fSchristos   BFD_RELOC_IA64_DTPREL32LSB,
4740440a403fSchristos   BFD_RELOC_IA64_DTPREL64MSB,
4741440a403fSchristos   BFD_RELOC_IA64_DTPREL64LSB,
4742440a403fSchristos   BFD_RELOC_IA64_LTOFF_DTPREL22,
4743440a403fSchristos 
4744440a403fSchristos /* Motorola 68HC11 reloc.
4745440a403fSchristos This is the 8 bit high part of an absolute address.  */
4746440a403fSchristos   BFD_RELOC_M68HC11_HI8,
4747440a403fSchristos 
4748440a403fSchristos /* Motorola 68HC11 reloc.
4749440a403fSchristos This is the 8 bit low part of an absolute address.  */
4750440a403fSchristos   BFD_RELOC_M68HC11_LO8,
4751440a403fSchristos 
4752440a403fSchristos /* Motorola 68HC11 reloc.
4753440a403fSchristos This is the 3 bit of a value.  */
4754440a403fSchristos   BFD_RELOC_M68HC11_3B,
4755440a403fSchristos 
4756440a403fSchristos /* Motorola 68HC11 reloc.
4757440a403fSchristos This reloc marks the beginning of a jump/call instruction.
4758440a403fSchristos It is used for linker relaxation to correctly identify beginning
4759440a403fSchristos of instruction and change some branches to use PC-relative
4760440a403fSchristos addressing mode.  */
4761440a403fSchristos   BFD_RELOC_M68HC11_RL_JUMP,
4762440a403fSchristos 
4763440a403fSchristos /* Motorola 68HC11 reloc.
4764440a403fSchristos This reloc marks a group of several instructions that gcc generates
4765440a403fSchristos and for which the linker relaxation pass can modify and/or remove
4766440a403fSchristos some of them.  */
4767440a403fSchristos   BFD_RELOC_M68HC11_RL_GROUP,
4768440a403fSchristos 
4769440a403fSchristos /* Motorola 68HC11 reloc.
4770440a403fSchristos This is the 16-bit lower part of an address.  It is used for 'call'
4771440a403fSchristos instruction to specify the symbol address without any special
4772440a403fSchristos transformation (due to memory bank window).  */
4773440a403fSchristos   BFD_RELOC_M68HC11_LO16,
4774440a403fSchristos 
4775440a403fSchristos /* Motorola 68HC11 reloc.
4776440a403fSchristos This is a 8-bit reloc that specifies the page number of an address.
4777440a403fSchristos It is used by 'call' instruction to specify the page number of
4778440a403fSchristos the symbol.  */
4779440a403fSchristos   BFD_RELOC_M68HC11_PAGE,
4780440a403fSchristos 
4781440a403fSchristos /* Motorola 68HC11 reloc.
4782440a403fSchristos This is a 24-bit reloc that represents the address with a 16-bit
4783440a403fSchristos value and a 8-bit page number.  The symbol address is transformed
4784440a403fSchristos to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
4785440a403fSchristos   BFD_RELOC_M68HC11_24,
4786440a403fSchristos 
4787440a403fSchristos /* Motorola 68HC12 reloc.
4788440a403fSchristos This is the 5 bits of a value.  */
4789440a403fSchristos   BFD_RELOC_M68HC12_5B,
4790440a403fSchristos 
4791440a403fSchristos /* Freescale XGATE reloc.
4792440a403fSchristos This reloc marks the beginning of a bra/jal instruction.  */
4793440a403fSchristos   BFD_RELOC_XGATE_RL_JUMP,
4794440a403fSchristos 
4795440a403fSchristos /* Freescale XGATE reloc.
4796440a403fSchristos This reloc marks a group of several instructions that gcc generates
4797440a403fSchristos and for which the linker relaxation pass can modify and/or remove
4798440a403fSchristos some of them.  */
4799440a403fSchristos   BFD_RELOC_XGATE_RL_GROUP,
4800440a403fSchristos 
4801440a403fSchristos /* Freescale XGATE reloc.
4802440a403fSchristos This is the 16-bit lower part of an address.  It is used for the '16-bit'
4803440a403fSchristos instructions.  */
4804440a403fSchristos   BFD_RELOC_XGATE_LO16,
4805440a403fSchristos 
4806440a403fSchristos /* Freescale XGATE reloc.  */
4807440a403fSchristos   BFD_RELOC_XGATE_GPAGE,
4808440a403fSchristos 
4809440a403fSchristos /* Freescale XGATE reloc.  */
4810440a403fSchristos   BFD_RELOC_XGATE_24,
4811440a403fSchristos 
4812440a403fSchristos /* Freescale XGATE reloc.
4813440a403fSchristos This is a 9-bit pc-relative reloc.  */
4814440a403fSchristos   BFD_RELOC_XGATE_PCREL_9,
4815440a403fSchristos 
4816440a403fSchristos /* Freescale XGATE reloc.
4817440a403fSchristos This is a 10-bit pc-relative reloc.  */
4818440a403fSchristos   BFD_RELOC_XGATE_PCREL_10,
4819440a403fSchristos 
4820440a403fSchristos /* Freescale XGATE reloc.
4821440a403fSchristos This is the 16-bit lower part of an address.  It is used for the '16-bit'
4822440a403fSchristos instructions.  */
4823440a403fSchristos   BFD_RELOC_XGATE_IMM8_LO,
4824440a403fSchristos 
4825440a403fSchristos /* Freescale XGATE reloc.
4826440a403fSchristos This is the 16-bit higher part of an address.  It is used for the '16-bit'
4827440a403fSchristos instructions.  */
4828440a403fSchristos   BFD_RELOC_XGATE_IMM8_HI,
4829440a403fSchristos 
4830440a403fSchristos /* Freescale XGATE reloc.
4831440a403fSchristos This is a 3-bit pc-relative reloc.  */
4832440a403fSchristos   BFD_RELOC_XGATE_IMM3,
4833440a403fSchristos 
4834440a403fSchristos /* Freescale XGATE reloc.
4835440a403fSchristos This is a 4-bit pc-relative reloc.  */
4836440a403fSchristos   BFD_RELOC_XGATE_IMM4,
4837440a403fSchristos 
4838440a403fSchristos /* Freescale XGATE reloc.
4839440a403fSchristos This is a 5-bit pc-relative reloc.  */
4840440a403fSchristos   BFD_RELOC_XGATE_IMM5,
4841440a403fSchristos 
4842440a403fSchristos /* Motorola 68HC12 reloc.
4843440a403fSchristos This is the 9 bits of a value.  */
4844440a403fSchristos   BFD_RELOC_M68HC12_9B,
4845440a403fSchristos 
4846440a403fSchristos /* Motorola 68HC12 reloc.
4847440a403fSchristos This is the 16 bits of a value.  */
4848440a403fSchristos   BFD_RELOC_M68HC12_16B,
4849440a403fSchristos 
4850440a403fSchristos /* Motorola 68HC12/XGATE reloc.
4851440a403fSchristos This is a PCREL9 branch.  */
4852440a403fSchristos   BFD_RELOC_M68HC12_9_PCREL,
4853440a403fSchristos 
4854440a403fSchristos /* Motorola 68HC12/XGATE reloc.
4855440a403fSchristos This is a PCREL10 branch.  */
4856440a403fSchristos   BFD_RELOC_M68HC12_10_PCREL,
4857440a403fSchristos 
4858440a403fSchristos /* Motorola 68HC12/XGATE reloc.
4859440a403fSchristos This is the 8 bit low part of an absolute address and immediately precedes
4860440a403fSchristos a matching HI8XG part.  */
4861440a403fSchristos   BFD_RELOC_M68HC12_LO8XG,
4862440a403fSchristos 
4863440a403fSchristos /* Motorola 68HC12/XGATE reloc.
4864440a403fSchristos This is the 8 bit high part of an absolute address and immediately follows
4865440a403fSchristos a matching LO8XG part.  */
4866440a403fSchristos   BFD_RELOC_M68HC12_HI8XG,
4867440a403fSchristos 
486806324dcfSchristos /* Freescale S12Z reloc.
486906324dcfSchristos This is a 15 bit relative address.  If the most significant bits are all zero
487006324dcfSchristos then it may be truncated to 8 bits.  */
487106324dcfSchristos   BFD_RELOC_S12Z_15_PCREL,
487206324dcfSchristos 
4873440a403fSchristos /* NS CR16 Relocations.  */
4874440a403fSchristos   BFD_RELOC_CR16_NUM8,
4875440a403fSchristos   BFD_RELOC_CR16_NUM16,
4876440a403fSchristos   BFD_RELOC_CR16_NUM32,
4877440a403fSchristos   BFD_RELOC_CR16_NUM32a,
4878440a403fSchristos   BFD_RELOC_CR16_REGREL0,
4879440a403fSchristos   BFD_RELOC_CR16_REGREL4,
4880440a403fSchristos   BFD_RELOC_CR16_REGREL4a,
4881440a403fSchristos   BFD_RELOC_CR16_REGREL14,
4882440a403fSchristos   BFD_RELOC_CR16_REGREL14a,
4883440a403fSchristos   BFD_RELOC_CR16_REGREL16,
4884440a403fSchristos   BFD_RELOC_CR16_REGREL20,
4885440a403fSchristos   BFD_RELOC_CR16_REGREL20a,
4886440a403fSchristos   BFD_RELOC_CR16_ABS20,
4887440a403fSchristos   BFD_RELOC_CR16_ABS24,
4888440a403fSchristos   BFD_RELOC_CR16_IMM4,
4889440a403fSchristos   BFD_RELOC_CR16_IMM8,
4890440a403fSchristos   BFD_RELOC_CR16_IMM16,
4891440a403fSchristos   BFD_RELOC_CR16_IMM20,
4892440a403fSchristos   BFD_RELOC_CR16_IMM24,
4893440a403fSchristos   BFD_RELOC_CR16_IMM32,
4894440a403fSchristos   BFD_RELOC_CR16_IMM32a,
4895440a403fSchristos   BFD_RELOC_CR16_DISP4,
4896440a403fSchristos   BFD_RELOC_CR16_DISP8,
4897440a403fSchristos   BFD_RELOC_CR16_DISP16,
4898440a403fSchristos   BFD_RELOC_CR16_DISP20,
4899440a403fSchristos   BFD_RELOC_CR16_DISP24,
4900440a403fSchristos   BFD_RELOC_CR16_DISP24a,
4901440a403fSchristos   BFD_RELOC_CR16_SWITCH8,
4902440a403fSchristos   BFD_RELOC_CR16_SWITCH16,
4903440a403fSchristos   BFD_RELOC_CR16_SWITCH32,
4904440a403fSchristos   BFD_RELOC_CR16_GOT_REGREL20,
4905440a403fSchristos   BFD_RELOC_CR16_GOTC_REGREL20,
4906440a403fSchristos   BFD_RELOC_CR16_GLOB_DAT,
4907440a403fSchristos 
4908440a403fSchristos /* NS CRX Relocations.  */
4909440a403fSchristos   BFD_RELOC_CRX_REL4,
4910440a403fSchristos   BFD_RELOC_CRX_REL8,
4911440a403fSchristos   BFD_RELOC_CRX_REL8_CMP,
4912440a403fSchristos   BFD_RELOC_CRX_REL16,
4913440a403fSchristos   BFD_RELOC_CRX_REL24,
4914440a403fSchristos   BFD_RELOC_CRX_REL32,
4915440a403fSchristos   BFD_RELOC_CRX_REGREL12,
4916440a403fSchristos   BFD_RELOC_CRX_REGREL22,
4917440a403fSchristos   BFD_RELOC_CRX_REGREL28,
4918440a403fSchristos   BFD_RELOC_CRX_REGREL32,
4919440a403fSchristos   BFD_RELOC_CRX_ABS16,
4920440a403fSchristos   BFD_RELOC_CRX_ABS32,
4921440a403fSchristos   BFD_RELOC_CRX_NUM8,
4922440a403fSchristos   BFD_RELOC_CRX_NUM16,
4923440a403fSchristos   BFD_RELOC_CRX_NUM32,
4924440a403fSchristos   BFD_RELOC_CRX_IMM16,
4925440a403fSchristos   BFD_RELOC_CRX_IMM32,
4926440a403fSchristos   BFD_RELOC_CRX_SWITCH8,
4927440a403fSchristos   BFD_RELOC_CRX_SWITCH16,
4928440a403fSchristos   BFD_RELOC_CRX_SWITCH32,
4929440a403fSchristos 
4930440a403fSchristos /* These relocs are only used within the CRIS assembler.  They are not
4931440a403fSchristos (at present) written to any object files.  */
4932440a403fSchristos   BFD_RELOC_CRIS_BDISP8,
4933440a403fSchristos   BFD_RELOC_CRIS_UNSIGNED_5,
4934440a403fSchristos   BFD_RELOC_CRIS_SIGNED_6,
4935440a403fSchristos   BFD_RELOC_CRIS_UNSIGNED_6,
4936440a403fSchristos   BFD_RELOC_CRIS_SIGNED_8,
4937440a403fSchristos   BFD_RELOC_CRIS_UNSIGNED_8,
4938440a403fSchristos   BFD_RELOC_CRIS_SIGNED_16,
4939440a403fSchristos   BFD_RELOC_CRIS_UNSIGNED_16,
4940440a403fSchristos   BFD_RELOC_CRIS_LAPCQ_OFFSET,
4941440a403fSchristos   BFD_RELOC_CRIS_UNSIGNED_4,
4942440a403fSchristos 
4943440a403fSchristos /* Relocs used in ELF shared libraries for CRIS.  */
4944440a403fSchristos   BFD_RELOC_CRIS_COPY,
4945440a403fSchristos   BFD_RELOC_CRIS_GLOB_DAT,
4946440a403fSchristos   BFD_RELOC_CRIS_JUMP_SLOT,
4947440a403fSchristos   BFD_RELOC_CRIS_RELATIVE,
4948440a403fSchristos 
4949440a403fSchristos /* 32-bit offset to symbol-entry within GOT.  */
4950440a403fSchristos   BFD_RELOC_CRIS_32_GOT,
4951440a403fSchristos 
4952440a403fSchristos /* 16-bit offset to symbol-entry within GOT.  */
4953440a403fSchristos   BFD_RELOC_CRIS_16_GOT,
4954440a403fSchristos 
4955440a403fSchristos /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
4956440a403fSchristos   BFD_RELOC_CRIS_32_GOTPLT,
4957440a403fSchristos 
4958440a403fSchristos /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
4959440a403fSchristos   BFD_RELOC_CRIS_16_GOTPLT,
4960440a403fSchristos 
4961440a403fSchristos /* 32-bit offset to symbol, relative to GOT.  */
4962440a403fSchristos   BFD_RELOC_CRIS_32_GOTREL,
4963440a403fSchristos 
4964440a403fSchristos /* 32-bit offset to symbol with PLT entry, relative to GOT.  */
4965440a403fSchristos   BFD_RELOC_CRIS_32_PLT_GOTREL,
4966440a403fSchristos 
4967440a403fSchristos /* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
4968440a403fSchristos   BFD_RELOC_CRIS_32_PLT_PCREL,
4969440a403fSchristos 
4970440a403fSchristos /* Relocs used in TLS code for CRIS.  */
4971440a403fSchristos   BFD_RELOC_CRIS_32_GOT_GD,
4972440a403fSchristos   BFD_RELOC_CRIS_16_GOT_GD,
4973440a403fSchristos   BFD_RELOC_CRIS_32_GD,
4974440a403fSchristos   BFD_RELOC_CRIS_DTP,
4975440a403fSchristos   BFD_RELOC_CRIS_32_DTPREL,
4976440a403fSchristos   BFD_RELOC_CRIS_16_DTPREL,
4977440a403fSchristos   BFD_RELOC_CRIS_32_GOT_TPREL,
4978440a403fSchristos   BFD_RELOC_CRIS_16_GOT_TPREL,
4979440a403fSchristos   BFD_RELOC_CRIS_32_TPREL,
4980440a403fSchristos   BFD_RELOC_CRIS_16_TPREL,
4981440a403fSchristos   BFD_RELOC_CRIS_DTPMOD,
4982440a403fSchristos   BFD_RELOC_CRIS_32_IE,
4983440a403fSchristos 
4984440a403fSchristos /* OpenRISC 1000 Relocations.  */
4985440a403fSchristos   BFD_RELOC_OR1K_REL_26,
4986*b88e3e88Schristos   BFD_RELOC_OR1K_SLO16,
4987*b88e3e88Schristos   BFD_RELOC_OR1K_PCREL_PG21,
4988*b88e3e88Schristos   BFD_RELOC_OR1K_LO13,
4989*b88e3e88Schristos   BFD_RELOC_OR1K_SLO13,
4990440a403fSchristos   BFD_RELOC_OR1K_GOTPC_HI16,
4991440a403fSchristos   BFD_RELOC_OR1K_GOTPC_LO16,
4992440a403fSchristos   BFD_RELOC_OR1K_GOT16,
4993*b88e3e88Schristos   BFD_RELOC_OR1K_GOT_PG21,
4994*b88e3e88Schristos   BFD_RELOC_OR1K_GOT_LO13,
4995440a403fSchristos   BFD_RELOC_OR1K_PLT26,
4996*b88e3e88Schristos   BFD_RELOC_OR1K_PLTA26,
4997*b88e3e88Schristos   BFD_RELOC_OR1K_GOTOFF_SLO16,
4998440a403fSchristos   BFD_RELOC_OR1K_COPY,
4999440a403fSchristos   BFD_RELOC_OR1K_GLOB_DAT,
5000440a403fSchristos   BFD_RELOC_OR1K_JMP_SLOT,
5001440a403fSchristos   BFD_RELOC_OR1K_RELATIVE,
5002440a403fSchristos   BFD_RELOC_OR1K_TLS_GD_HI16,
5003440a403fSchristos   BFD_RELOC_OR1K_TLS_GD_LO16,
5004*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_GD_PG21,
5005*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_GD_LO13,
5006440a403fSchristos   BFD_RELOC_OR1K_TLS_LDM_HI16,
5007440a403fSchristos   BFD_RELOC_OR1K_TLS_LDM_LO16,
5008*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_LDM_PG21,
5009*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_LDM_LO13,
5010440a403fSchristos   BFD_RELOC_OR1K_TLS_LDO_HI16,
5011440a403fSchristos   BFD_RELOC_OR1K_TLS_LDO_LO16,
5012440a403fSchristos   BFD_RELOC_OR1K_TLS_IE_HI16,
5013*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_IE_AHI16,
5014440a403fSchristos   BFD_RELOC_OR1K_TLS_IE_LO16,
5015*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_IE_PG21,
5016*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_IE_LO13,
5017440a403fSchristos   BFD_RELOC_OR1K_TLS_LE_HI16,
5018*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_LE_AHI16,
5019440a403fSchristos   BFD_RELOC_OR1K_TLS_LE_LO16,
5020*b88e3e88Schristos   BFD_RELOC_OR1K_TLS_LE_SLO16,
5021440a403fSchristos   BFD_RELOC_OR1K_TLS_TPOFF,
5022440a403fSchristos   BFD_RELOC_OR1K_TLS_DTPOFF,
5023440a403fSchristos   BFD_RELOC_OR1K_TLS_DTPMOD,
5024440a403fSchristos 
5025440a403fSchristos /* H8 elf Relocations.  */
5026440a403fSchristos   BFD_RELOC_H8_DIR16A8,
5027440a403fSchristos   BFD_RELOC_H8_DIR16R8,
5028440a403fSchristos   BFD_RELOC_H8_DIR24A8,
5029440a403fSchristos   BFD_RELOC_H8_DIR24R8,
5030440a403fSchristos   BFD_RELOC_H8_DIR32A16,
5031440a403fSchristos   BFD_RELOC_H8_DISP32A16,
5032440a403fSchristos 
5033440a403fSchristos /* Sony Xstormy16 Relocations.  */
5034440a403fSchristos   BFD_RELOC_XSTORMY16_REL_12,
5035440a403fSchristos   BFD_RELOC_XSTORMY16_12,
5036440a403fSchristos   BFD_RELOC_XSTORMY16_24,
5037440a403fSchristos   BFD_RELOC_XSTORMY16_FPTR16,
5038440a403fSchristos 
5039440a403fSchristos /* Self-describing complex relocations.  */
5040440a403fSchristos   BFD_RELOC_RELC,
5041440a403fSchristos 
5042440a403fSchristos 
5043440a403fSchristos /* Infineon Relocations.  */
5044440a403fSchristos   BFD_RELOC_XC16X_PAG,
5045440a403fSchristos   BFD_RELOC_XC16X_POF,
5046440a403fSchristos   BFD_RELOC_XC16X_SEG,
5047440a403fSchristos   BFD_RELOC_XC16X_SOF,
5048440a403fSchristos 
5049440a403fSchristos /* Relocations used by VAX ELF.  */
5050440a403fSchristos   BFD_RELOC_VAX_GLOB_DAT,
5051440a403fSchristos   BFD_RELOC_VAX_JMP_SLOT,
5052440a403fSchristos   BFD_RELOC_VAX_RELATIVE,
5053440a403fSchristos 
5054440a403fSchristos /* Morpho MT - 16 bit immediate relocation.  */
5055440a403fSchristos   BFD_RELOC_MT_PC16,
5056440a403fSchristos 
5057440a403fSchristos /* Morpho MT - Hi 16 bits of an address.  */
5058440a403fSchristos   BFD_RELOC_MT_HI16,
5059440a403fSchristos 
5060440a403fSchristos /* Morpho MT - Low 16 bits of an address.  */
5061440a403fSchristos   BFD_RELOC_MT_LO16,
5062440a403fSchristos 
5063440a403fSchristos /* Morpho MT - Used to tell the linker which vtable entries are used.  */
5064440a403fSchristos   BFD_RELOC_MT_GNU_VTINHERIT,
5065440a403fSchristos 
5066440a403fSchristos /* Morpho MT - Used to tell the linker which vtable entries are used.  */
5067440a403fSchristos   BFD_RELOC_MT_GNU_VTENTRY,
5068440a403fSchristos 
5069440a403fSchristos /* Morpho MT - 8 bit immediate relocation.  */
5070440a403fSchristos   BFD_RELOC_MT_PCINSN8,
5071440a403fSchristos 
5072440a403fSchristos /* msp430 specific relocation codes  */
5073440a403fSchristos   BFD_RELOC_MSP430_10_PCREL,
5074440a403fSchristos   BFD_RELOC_MSP430_16_PCREL,
5075440a403fSchristos   BFD_RELOC_MSP430_16,
5076440a403fSchristos   BFD_RELOC_MSP430_16_PCREL_BYTE,
5077440a403fSchristos   BFD_RELOC_MSP430_16_BYTE,
5078440a403fSchristos   BFD_RELOC_MSP430_2X_PCREL,
5079440a403fSchristos   BFD_RELOC_MSP430_RL_PCREL,
5080440a403fSchristos   BFD_RELOC_MSP430_ABS8,
5081440a403fSchristos   BFD_RELOC_MSP430X_PCR20_EXT_SRC,
5082440a403fSchristos   BFD_RELOC_MSP430X_PCR20_EXT_DST,
5083440a403fSchristos   BFD_RELOC_MSP430X_PCR20_EXT_ODST,
5084440a403fSchristos   BFD_RELOC_MSP430X_ABS20_EXT_SRC,
5085440a403fSchristos   BFD_RELOC_MSP430X_ABS20_EXT_DST,
5086440a403fSchristos   BFD_RELOC_MSP430X_ABS20_EXT_ODST,
5087440a403fSchristos   BFD_RELOC_MSP430X_ABS20_ADR_SRC,
5088440a403fSchristos   BFD_RELOC_MSP430X_ABS20_ADR_DST,
5089440a403fSchristos   BFD_RELOC_MSP430X_PCR16,
5090440a403fSchristos   BFD_RELOC_MSP430X_PCR20_CALL,
5091440a403fSchristos   BFD_RELOC_MSP430X_ABS16,
5092440a403fSchristos   BFD_RELOC_MSP430_ABS_HI16,
5093440a403fSchristos   BFD_RELOC_MSP430_PREL31,
5094440a403fSchristos   BFD_RELOC_MSP430_SYM_DIFF,
5095440a403fSchristos 
5096440a403fSchristos /* Relocations used by the Altera Nios II core.  */
5097440a403fSchristos   BFD_RELOC_NIOS2_S16,
5098440a403fSchristos   BFD_RELOC_NIOS2_U16,
5099440a403fSchristos   BFD_RELOC_NIOS2_CALL26,
5100440a403fSchristos   BFD_RELOC_NIOS2_IMM5,
5101440a403fSchristos   BFD_RELOC_NIOS2_CACHE_OPX,
5102440a403fSchristos   BFD_RELOC_NIOS2_IMM6,
5103440a403fSchristos   BFD_RELOC_NIOS2_IMM8,
5104440a403fSchristos   BFD_RELOC_NIOS2_HI16,
5105440a403fSchristos   BFD_RELOC_NIOS2_LO16,
5106440a403fSchristos   BFD_RELOC_NIOS2_HIADJ16,
5107440a403fSchristos   BFD_RELOC_NIOS2_GPREL,
5108440a403fSchristos   BFD_RELOC_NIOS2_UJMP,
5109440a403fSchristos   BFD_RELOC_NIOS2_CJMP,
5110440a403fSchristos   BFD_RELOC_NIOS2_CALLR,
5111440a403fSchristos   BFD_RELOC_NIOS2_ALIGN,
5112440a403fSchristos   BFD_RELOC_NIOS2_GOT16,
5113440a403fSchristos   BFD_RELOC_NIOS2_CALL16,
5114440a403fSchristos   BFD_RELOC_NIOS2_GOTOFF_LO,
5115440a403fSchristos   BFD_RELOC_NIOS2_GOTOFF_HA,
5116440a403fSchristos   BFD_RELOC_NIOS2_PCREL_LO,
5117440a403fSchristos   BFD_RELOC_NIOS2_PCREL_HA,
5118440a403fSchristos   BFD_RELOC_NIOS2_TLS_GD16,
5119440a403fSchristos   BFD_RELOC_NIOS2_TLS_LDM16,
5120440a403fSchristos   BFD_RELOC_NIOS2_TLS_LDO16,
5121440a403fSchristos   BFD_RELOC_NIOS2_TLS_IE16,
5122440a403fSchristos   BFD_RELOC_NIOS2_TLS_LE16,
5123440a403fSchristos   BFD_RELOC_NIOS2_TLS_DTPMOD,
5124440a403fSchristos   BFD_RELOC_NIOS2_TLS_DTPREL,
5125440a403fSchristos   BFD_RELOC_NIOS2_TLS_TPREL,
5126440a403fSchristos   BFD_RELOC_NIOS2_COPY,
5127440a403fSchristos   BFD_RELOC_NIOS2_GLOB_DAT,
5128440a403fSchristos   BFD_RELOC_NIOS2_JUMP_SLOT,
5129440a403fSchristos   BFD_RELOC_NIOS2_RELATIVE,
5130440a403fSchristos   BFD_RELOC_NIOS2_GOTOFF,
5131440a403fSchristos   BFD_RELOC_NIOS2_CALL26_NOAT,
5132440a403fSchristos   BFD_RELOC_NIOS2_GOT_LO,
5133440a403fSchristos   BFD_RELOC_NIOS2_GOT_HA,
5134440a403fSchristos   BFD_RELOC_NIOS2_CALL_LO,
5135440a403fSchristos   BFD_RELOC_NIOS2_CALL_HA,
5136440a403fSchristos   BFD_RELOC_NIOS2_R2_S12,
5137440a403fSchristos   BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5138440a403fSchristos   BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5139440a403fSchristos   BFD_RELOC_NIOS2_R2_T1I7_2,
5140440a403fSchristos   BFD_RELOC_NIOS2_R2_T2I4,
5141440a403fSchristos   BFD_RELOC_NIOS2_R2_T2I4_1,
5142440a403fSchristos   BFD_RELOC_NIOS2_R2_T2I4_2,
5143440a403fSchristos   BFD_RELOC_NIOS2_R2_X1I7_2,
5144440a403fSchristos   BFD_RELOC_NIOS2_R2_X2L5,
5145440a403fSchristos   BFD_RELOC_NIOS2_R2_F1I5_2,
5146440a403fSchristos   BFD_RELOC_NIOS2_R2_L5I4X1,
5147440a403fSchristos   BFD_RELOC_NIOS2_R2_T1X1I6,
5148440a403fSchristos   BFD_RELOC_NIOS2_R2_T1X1I6_2,
5149440a403fSchristos 
515006324dcfSchristos /* PRU LDI 16-bit unsigned data-memory relocation.  */
515106324dcfSchristos   BFD_RELOC_PRU_U16,
515206324dcfSchristos 
515306324dcfSchristos /* PRU LDI 16-bit unsigned instruction-memory relocation.  */
515406324dcfSchristos   BFD_RELOC_PRU_U16_PMEMIMM,
515506324dcfSchristos 
515606324dcfSchristos /* PRU relocation for two consecutive LDI load instructions that load a
515706324dcfSchristos 32 bit value into a register. If the higher bits are all zero, then
515806324dcfSchristos the second instruction may be relaxed.  */
515906324dcfSchristos   BFD_RELOC_PRU_LDI32,
516006324dcfSchristos 
516106324dcfSchristos /* PRU QBBx 10-bit signed PC-relative relocation.  */
516206324dcfSchristos   BFD_RELOC_PRU_S10_PCREL,
516306324dcfSchristos 
516406324dcfSchristos /* PRU 8-bit unsigned relocation used for the LOOP instruction.  */
516506324dcfSchristos   BFD_RELOC_PRU_U8_PCREL,
516606324dcfSchristos 
516706324dcfSchristos /* PRU Program Memory relocations.  Used to convert from byte addressing to
516806324dcfSchristos 32-bit word addressing.  */
516906324dcfSchristos   BFD_RELOC_PRU_32_PMEM,
517006324dcfSchristos   BFD_RELOC_PRU_16_PMEM,
517106324dcfSchristos 
517206324dcfSchristos /* PRU relocations to mark the difference of two local symbols.
517306324dcfSchristos These are only needed to support linker relaxation and can be ignored
517406324dcfSchristos when not relaxing.  The field is set to the value of the difference
517506324dcfSchristos assuming no relaxation.  The relocation encodes the position of the
517606324dcfSchristos second symbol so the linker can determine whether to adjust the field
517706324dcfSchristos value. The PMEM variants encode the word difference, instead of byte
517806324dcfSchristos difference between symbols.  */
517906324dcfSchristos   BFD_RELOC_PRU_GNU_DIFF8,
518006324dcfSchristos   BFD_RELOC_PRU_GNU_DIFF16,
518106324dcfSchristos   BFD_RELOC_PRU_GNU_DIFF32,
518206324dcfSchristos   BFD_RELOC_PRU_GNU_DIFF16_PMEM,
518306324dcfSchristos   BFD_RELOC_PRU_GNU_DIFF32_PMEM,
518406324dcfSchristos 
5185440a403fSchristos /* IQ2000 Relocations.  */
5186440a403fSchristos   BFD_RELOC_IQ2000_OFFSET_16,
5187440a403fSchristos   BFD_RELOC_IQ2000_OFFSET_21,
5188440a403fSchristos   BFD_RELOC_IQ2000_UHI16,
5189440a403fSchristos 
5190440a403fSchristos /* Special Xtensa relocation used only by PLT entries in ELF shared
5191440a403fSchristos objects to indicate that the runtime linker should set the value
5192440a403fSchristos to one of its own internal functions or data structures.  */
5193440a403fSchristos   BFD_RELOC_XTENSA_RTLD,
5194440a403fSchristos 
5195440a403fSchristos /* Xtensa relocations for ELF shared objects.  */
5196440a403fSchristos   BFD_RELOC_XTENSA_GLOB_DAT,
5197440a403fSchristos   BFD_RELOC_XTENSA_JMP_SLOT,
5198440a403fSchristos   BFD_RELOC_XTENSA_RELATIVE,
5199440a403fSchristos 
5200440a403fSchristos /* Xtensa relocation used in ELF object files for symbols that may require
5201440a403fSchristos PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
5202440a403fSchristos   BFD_RELOC_XTENSA_PLT,
5203440a403fSchristos 
5204440a403fSchristos /* Xtensa relocations to mark the difference of two local symbols.
5205440a403fSchristos These are only needed to support linker relaxation and can be ignored
5206440a403fSchristos when not relaxing.  The field is set to the value of the difference
5207440a403fSchristos assuming no relaxation.  The relocation encodes the position of the
5208440a403fSchristos first symbol so the linker can determine whether to adjust the field
5209440a403fSchristos value.  */
5210440a403fSchristos   BFD_RELOC_XTENSA_DIFF8,
5211440a403fSchristos   BFD_RELOC_XTENSA_DIFF16,
5212440a403fSchristos   BFD_RELOC_XTENSA_DIFF32,
5213440a403fSchristos 
5214440a403fSchristos /* Generic Xtensa relocations for instruction operands.  Only the slot
5215440a403fSchristos number is encoded in the relocation.  The relocation applies to the
5216440a403fSchristos last PC-relative immediate operand, or if there are no PC-relative
5217440a403fSchristos immediates, to the last immediate operand.  */
5218440a403fSchristos   BFD_RELOC_XTENSA_SLOT0_OP,
5219440a403fSchristos   BFD_RELOC_XTENSA_SLOT1_OP,
5220440a403fSchristos   BFD_RELOC_XTENSA_SLOT2_OP,
5221440a403fSchristos   BFD_RELOC_XTENSA_SLOT3_OP,
5222440a403fSchristos   BFD_RELOC_XTENSA_SLOT4_OP,
5223440a403fSchristos   BFD_RELOC_XTENSA_SLOT5_OP,
5224440a403fSchristos   BFD_RELOC_XTENSA_SLOT6_OP,
5225440a403fSchristos   BFD_RELOC_XTENSA_SLOT7_OP,
5226440a403fSchristos   BFD_RELOC_XTENSA_SLOT8_OP,
5227440a403fSchristos   BFD_RELOC_XTENSA_SLOT9_OP,
5228440a403fSchristos   BFD_RELOC_XTENSA_SLOT10_OP,
5229440a403fSchristos   BFD_RELOC_XTENSA_SLOT11_OP,
5230440a403fSchristos   BFD_RELOC_XTENSA_SLOT12_OP,
5231440a403fSchristos   BFD_RELOC_XTENSA_SLOT13_OP,
5232440a403fSchristos   BFD_RELOC_XTENSA_SLOT14_OP,
5233440a403fSchristos 
5234440a403fSchristos /* Alternate Xtensa relocations.  Only the slot is encoded in the
5235440a403fSchristos relocation.  The meaning of these relocations is opcode-specific.  */
5236440a403fSchristos   BFD_RELOC_XTENSA_SLOT0_ALT,
5237440a403fSchristos   BFD_RELOC_XTENSA_SLOT1_ALT,
5238440a403fSchristos   BFD_RELOC_XTENSA_SLOT2_ALT,
5239440a403fSchristos   BFD_RELOC_XTENSA_SLOT3_ALT,
5240440a403fSchristos   BFD_RELOC_XTENSA_SLOT4_ALT,
5241440a403fSchristos   BFD_RELOC_XTENSA_SLOT5_ALT,
5242440a403fSchristos   BFD_RELOC_XTENSA_SLOT6_ALT,
5243440a403fSchristos   BFD_RELOC_XTENSA_SLOT7_ALT,
5244440a403fSchristos   BFD_RELOC_XTENSA_SLOT8_ALT,
5245440a403fSchristos   BFD_RELOC_XTENSA_SLOT9_ALT,
5246440a403fSchristos   BFD_RELOC_XTENSA_SLOT10_ALT,
5247440a403fSchristos   BFD_RELOC_XTENSA_SLOT11_ALT,
5248440a403fSchristos   BFD_RELOC_XTENSA_SLOT12_ALT,
5249440a403fSchristos   BFD_RELOC_XTENSA_SLOT13_ALT,
5250440a403fSchristos   BFD_RELOC_XTENSA_SLOT14_ALT,
5251440a403fSchristos 
5252440a403fSchristos /* Xtensa relocations for backward compatibility.  These have all been
5253440a403fSchristos replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
5254440a403fSchristos   BFD_RELOC_XTENSA_OP0,
5255440a403fSchristos   BFD_RELOC_XTENSA_OP1,
5256440a403fSchristos   BFD_RELOC_XTENSA_OP2,
5257440a403fSchristos 
5258440a403fSchristos /* Xtensa relocation to mark that the assembler expanded the
5259440a403fSchristos instructions from an original target.  The expansion size is
5260440a403fSchristos encoded in the reloc size.  */
5261440a403fSchristos   BFD_RELOC_XTENSA_ASM_EXPAND,
5262440a403fSchristos 
5263440a403fSchristos /* Xtensa relocation to mark that the linker should simplify
5264440a403fSchristos assembler-expanded instructions.  This is commonly used
5265440a403fSchristos internally by the linker after analysis of a
5266440a403fSchristos BFD_RELOC_XTENSA_ASM_EXPAND.  */
5267440a403fSchristos   BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5268440a403fSchristos 
5269440a403fSchristos /* Xtensa TLS relocations.  */
5270440a403fSchristos   BFD_RELOC_XTENSA_TLSDESC_FN,
5271440a403fSchristos   BFD_RELOC_XTENSA_TLSDESC_ARG,
5272440a403fSchristos   BFD_RELOC_XTENSA_TLS_DTPOFF,
5273440a403fSchristos   BFD_RELOC_XTENSA_TLS_TPOFF,
5274440a403fSchristos   BFD_RELOC_XTENSA_TLS_FUNC,
5275440a403fSchristos   BFD_RELOC_XTENSA_TLS_ARG,
5276440a403fSchristos   BFD_RELOC_XTENSA_TLS_CALL,
5277440a403fSchristos 
5278440a403fSchristos /* 8 bit signed offset in (ix+d) or (iy+d).  */
5279440a403fSchristos   BFD_RELOC_Z80_DISP8,
5280440a403fSchristos 
5281*b88e3e88Schristos /* First 8 bits of multibyte (32, 24 or 16 bit) value.  */
5282*b88e3e88Schristos   BFD_RELOC_Z80_BYTE0,
5283*b88e3e88Schristos 
5284*b88e3e88Schristos /* Second 8 bits of multibyte (32, 24 or 16 bit) value.  */
5285*b88e3e88Schristos   BFD_RELOC_Z80_BYTE1,
5286*b88e3e88Schristos 
5287*b88e3e88Schristos /* Third 8 bits of multibyte (32 or 24 bit) value.  */
5288*b88e3e88Schristos   BFD_RELOC_Z80_BYTE2,
5289*b88e3e88Schristos 
5290*b88e3e88Schristos /* Fourth 8 bits of multibyte (32 bit) value.  */
5291*b88e3e88Schristos   BFD_RELOC_Z80_BYTE3,
5292*b88e3e88Schristos 
5293*b88e3e88Schristos /* Lowest 16 bits of multibyte (32 or 24 bit) value.  */
5294*b88e3e88Schristos   BFD_RELOC_Z80_WORD0,
5295*b88e3e88Schristos 
5296*b88e3e88Schristos /* Highest 16 bits of multibyte (32 or 24 bit) value.  */
5297*b88e3e88Schristos   BFD_RELOC_Z80_WORD1,
5298*b88e3e88Schristos 
5299440a403fSchristos /* DJNZ offset.  */
5300440a403fSchristos   BFD_RELOC_Z8K_DISP7,
5301440a403fSchristos 
5302440a403fSchristos /* CALR offset.  */
5303440a403fSchristos   BFD_RELOC_Z8K_CALLR,
5304440a403fSchristos 
5305440a403fSchristos /* 4 bit value.  */
5306440a403fSchristos   BFD_RELOC_Z8K_IMM4L,
5307440a403fSchristos 
5308440a403fSchristos /* Lattice Mico32 relocations.  */
5309440a403fSchristos   BFD_RELOC_LM32_CALL,
5310440a403fSchristos   BFD_RELOC_LM32_BRANCH,
5311440a403fSchristos   BFD_RELOC_LM32_16_GOT,
5312440a403fSchristos   BFD_RELOC_LM32_GOTOFF_HI16,
5313440a403fSchristos   BFD_RELOC_LM32_GOTOFF_LO16,
5314440a403fSchristos   BFD_RELOC_LM32_COPY,
5315440a403fSchristos   BFD_RELOC_LM32_GLOB_DAT,
5316440a403fSchristos   BFD_RELOC_LM32_JMP_SLOT,
5317440a403fSchristos   BFD_RELOC_LM32_RELATIVE,
5318440a403fSchristos 
5319440a403fSchristos /* Difference between two section addreses.  Must be followed by a
5320440a403fSchristos BFD_RELOC_MACH_O_PAIR.  */
5321440a403fSchristos   BFD_RELOC_MACH_O_SECTDIFF,
5322440a403fSchristos 
5323440a403fSchristos /* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol.  */
5324440a403fSchristos   BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5325440a403fSchristos 
5326440a403fSchristos /* Pair of relocation.  Contains the first symbol.  */
5327440a403fSchristos   BFD_RELOC_MACH_O_PAIR,
5328440a403fSchristos 
5329440a403fSchristos /* Symbol will be substracted.  Must be followed by a BFD_RELOC_32.  */
5330440a403fSchristos   BFD_RELOC_MACH_O_SUBTRACTOR32,
5331440a403fSchristos 
5332440a403fSchristos /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
5333440a403fSchristos   BFD_RELOC_MACH_O_SUBTRACTOR64,
5334440a403fSchristos 
5335440a403fSchristos /* PCREL relocations.  They are marked as branch to create PLT entry if
5336440a403fSchristos required.  */
5337440a403fSchristos   BFD_RELOC_MACH_O_X86_64_BRANCH32,
5338440a403fSchristos   BFD_RELOC_MACH_O_X86_64_BRANCH8,
5339440a403fSchristos 
5340440a403fSchristos /* Used when referencing a GOT entry.  */
5341440a403fSchristos   BFD_RELOC_MACH_O_X86_64_GOT,
5342440a403fSchristos 
5343440a403fSchristos /* Used when loading a GOT entry with movq.  It is specially marked so that
5344440a403fSchristos the linker could optimize the movq to a leaq if possible.  */
5345440a403fSchristos   BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5346440a403fSchristos 
5347440a403fSchristos /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend.  */
5348440a403fSchristos   BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5349440a403fSchristos 
5350440a403fSchristos /* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend.  */
5351440a403fSchristos   BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5352440a403fSchristos 
5353440a403fSchristos /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend.  */
5354440a403fSchristos   BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5355440a403fSchristos 
535606324dcfSchristos /* Used when referencing a TLV entry.  */
535706324dcfSchristos   BFD_RELOC_MACH_O_X86_64_TLV,
535806324dcfSchristos 
5359440a403fSchristos /* Addend for PAGE or PAGEOFF.  */
5360440a403fSchristos   BFD_RELOC_MACH_O_ARM64_ADDEND,
5361440a403fSchristos 
5362440a403fSchristos /* Relative offset to page of GOT slot.  */
5363440a403fSchristos   BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5364440a403fSchristos 
5365440a403fSchristos /* Relative offset within page of GOT slot.  */
5366440a403fSchristos   BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5367440a403fSchristos 
5368440a403fSchristos /* Address of a GOT entry.  */
5369440a403fSchristos   BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5370440a403fSchristos 
5371440a403fSchristos /* This is a 32 bit reloc for the microblaze that stores the
5372440a403fSchristos low 16 bits of a value  */
5373440a403fSchristos   BFD_RELOC_MICROBLAZE_32_LO,
5374440a403fSchristos 
5375440a403fSchristos /* This is a 32 bit pc-relative reloc for the microblaze that
5376440a403fSchristos stores the low 16 bits of a value  */
5377440a403fSchristos   BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5378440a403fSchristos 
5379440a403fSchristos /* This is a 32 bit reloc for the microblaze that stores a
5380440a403fSchristos value relative to the read-only small data area anchor  */
5381440a403fSchristos   BFD_RELOC_MICROBLAZE_32_ROSDA,
5382440a403fSchristos 
5383440a403fSchristos /* This is a 32 bit reloc for the microblaze that stores a
5384440a403fSchristos value relative to the read-write small data area anchor  */
5385440a403fSchristos   BFD_RELOC_MICROBLAZE_32_RWSDA,
5386440a403fSchristos 
5387440a403fSchristos /* This is a 32 bit reloc for the microblaze to handle
5388440a403fSchristos expressions of the form "Symbol Op Symbol"  */
5389440a403fSchristos   BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5390440a403fSchristos 
5391440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5392440a403fSchristos value in two words (with an imm instruction).  No relocation is
5393440a403fSchristos done here - only used for relaxing  */
5394440a403fSchristos   BFD_RELOC_MICROBLAZE_64_NONE,
5395440a403fSchristos 
5396440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5397440a403fSchristos value in two words (with an imm instruction).  The relocation is
5398440a403fSchristos PC-relative GOT offset  */
5399440a403fSchristos   BFD_RELOC_MICROBLAZE_64_GOTPC,
5400440a403fSchristos 
5401440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5402440a403fSchristos value in two words (with an imm instruction).  The relocation is
5403440a403fSchristos GOT offset  */
5404440a403fSchristos   BFD_RELOC_MICROBLAZE_64_GOT,
5405440a403fSchristos 
5406440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5407440a403fSchristos value in two words (with an imm instruction).  The relocation is
5408440a403fSchristos PC-relative offset into PLT  */
5409440a403fSchristos   BFD_RELOC_MICROBLAZE_64_PLT,
5410440a403fSchristos 
5411440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit GOT relative
5412440a403fSchristos value in two words (with an imm instruction).  The relocation is
5413440a403fSchristos relative offset from _GLOBAL_OFFSET_TABLE_  */
5414440a403fSchristos   BFD_RELOC_MICROBLAZE_64_GOTOFF,
5415440a403fSchristos 
5416440a403fSchristos /* This is a 32 bit reloc that stores the 32 bit GOT relative
5417440a403fSchristos value in a word.  The relocation is relative offset from  */
5418440a403fSchristos   BFD_RELOC_MICROBLAZE_32_GOTOFF,
5419440a403fSchristos 
5420440a403fSchristos /* This is used to tell the dynamic linker to copy the value out of
5421440a403fSchristos the dynamic object into the runtime process image.  */
5422440a403fSchristos   BFD_RELOC_MICROBLAZE_COPY,
5423440a403fSchristos 
5424440a403fSchristos /* Unused Reloc  */
5425440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLS,
5426440a403fSchristos 
5427440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit GOT relative value
5428440a403fSchristos of the GOT TLS GD info entry in two words (with an imm instruction). The
5429440a403fSchristos relocation is GOT offset.  */
5430440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLSGD,
5431440a403fSchristos 
5432440a403fSchristos /* This is a 64 bit reloc that stores the 32 bit GOT relative value
5433440a403fSchristos of the GOT TLS LD info entry in two words (with an imm instruction). The
5434440a403fSchristos relocation is GOT offset.  */
5435440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLSLD,
5436440a403fSchristos 
5437440a403fSchristos /* This is a 32 bit reloc that stores the Module ID to GOT(n).  */
5438440a403fSchristos   BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5439440a403fSchristos 
5440440a403fSchristos /* This is a 32 bit reloc that stores TLS offset to GOT(n+1).  */
5441440a403fSchristos   BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5442440a403fSchristos 
5443440a403fSchristos /* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5444440a403fSchristos instruction)  */
5445440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5446440a403fSchristos 
5447440a403fSchristos /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5448440a403fSchristos to two words (uses imm instruction).  */
5449440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5450440a403fSchristos 
5451440a403fSchristos /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5452440a403fSchristos to two words (uses imm instruction).  */
5453440a403fSchristos   BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5454440a403fSchristos 
545506324dcfSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
545606324dcfSchristos value in two words (with an imm instruction).  The relocation is
545706324dcfSchristos PC-relative offset from start of TEXT.  */
545806324dcfSchristos   BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
545906324dcfSchristos 
546006324dcfSchristos /* This is a 64 bit reloc that stores the 32 bit offset
546106324dcfSchristos value in two words (with an imm instruction).  The relocation is
546206324dcfSchristos relative offset from start of TEXT.  */
546306324dcfSchristos   BFD_RELOC_MICROBLAZE_64_TEXTREL,
546406324dcfSchristos 
5465440a403fSchristos /* AArch64 pseudo relocation code to mark the start of the AArch64
5466440a403fSchristos relocation enumerators.  N.B. the order of the enumerators is
5467440a403fSchristos important as several tables in the AArch64 bfd backend are indexed
5468440a403fSchristos by these enumerators; make sure they are all synced.  */
5469440a403fSchristos   BFD_RELOC_AARCH64_RELOC_START,
5470440a403fSchristos 
5471440a403fSchristos /* Deprecated AArch64 null relocation code.  */
5472440a403fSchristos   BFD_RELOC_AARCH64_NULL,
5473440a403fSchristos 
5474440a403fSchristos /* AArch64 null relocation code.  */
5475440a403fSchristos   BFD_RELOC_AARCH64_NONE,
5476440a403fSchristos 
5477440a403fSchristos /* Basic absolute relocations of N bits.  These are equivalent to
5478440a403fSchristos BFD_RELOC_N and they were added to assist the indexing of the howto
5479440a403fSchristos table.  */
5480440a403fSchristos   BFD_RELOC_AARCH64_64,
5481440a403fSchristos   BFD_RELOC_AARCH64_32,
5482440a403fSchristos   BFD_RELOC_AARCH64_16,
5483440a403fSchristos 
5484440a403fSchristos /* PC-relative relocations.  These are equivalent to BFD_RELOC_N_PCREL
5485440a403fSchristos and they were added to assist the indexing of the howto table.  */
5486440a403fSchristos   BFD_RELOC_AARCH64_64_PCREL,
5487440a403fSchristos   BFD_RELOC_AARCH64_32_PCREL,
5488440a403fSchristos   BFD_RELOC_AARCH64_16_PCREL,
5489440a403fSchristos 
5490440a403fSchristos /* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5491440a403fSchristos of an unsigned address/value.  */
5492440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G0,
5493440a403fSchristos 
5494440a403fSchristos /* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5495440a403fSchristos an address/value.  No overflow checking.  */
5496440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G0_NC,
5497440a403fSchristos 
5498440a403fSchristos /* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5499440a403fSchristos of an unsigned address/value.  */
5500440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G1,
5501440a403fSchristos 
5502440a403fSchristos /* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5503440a403fSchristos of an address/value.  No overflow checking.  */
5504440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G1_NC,
5505440a403fSchristos 
5506440a403fSchristos /* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5507440a403fSchristos of an unsigned address/value.  */
5508440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G2,
5509440a403fSchristos 
5510440a403fSchristos /* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5511440a403fSchristos of an address/value.  No overflow checking.  */
5512440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G2_NC,
5513440a403fSchristos 
5514440a403fSchristos /* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5515440a403fSchristos of a signed or unsigned address/value.  */
5516440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G3,
5517440a403fSchristos 
5518440a403fSchristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5519440a403fSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5520440a403fSchristos value's sign.  */
5521440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G0_S,
5522440a403fSchristos 
5523440a403fSchristos /* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
5524440a403fSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5525440a403fSchristos value's sign.  */
5526440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G1_S,
5527440a403fSchristos 
5528440a403fSchristos /* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
5529440a403fSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5530440a403fSchristos value's sign.  */
5531440a403fSchristos   BFD_RELOC_AARCH64_MOVW_G2_S,
5532440a403fSchristos 
553306324dcfSchristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
553406324dcfSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
553506324dcfSchristos value's sign.  */
553606324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G0,
553706324dcfSchristos 
553806324dcfSchristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
553906324dcfSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
554006324dcfSchristos value's sign.  */
554106324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
554206324dcfSchristos 
554306324dcfSchristos /* AArch64 MOVK instruction with most significant bits 16 to 31
554406324dcfSchristos of a signed value.  */
554506324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G1,
554606324dcfSchristos 
554706324dcfSchristos /* AArch64 MOVK instruction with most significant bits 16 to 31
554806324dcfSchristos of a signed value.  */
554906324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
555006324dcfSchristos 
555106324dcfSchristos /* AArch64 MOVK instruction with most significant bits 32 to 47
555206324dcfSchristos of a signed value.  */
555306324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G2,
555406324dcfSchristos 
555506324dcfSchristos /* AArch64 MOVK instruction with most significant bits 32 to 47
555606324dcfSchristos of a signed value.  */
555706324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
555806324dcfSchristos 
555906324dcfSchristos /* AArch64 MOVK instruction with most significant bits 47 to 63
556006324dcfSchristos of a signed value.  */
556106324dcfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G3,
556206324dcfSchristos 
5563440a403fSchristos /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
5564440a403fSchristos offset.  The lowest two bits must be zero and are not stored in the
5565440a403fSchristos instruction, giving a 21 bit signed byte offset.  */
5566440a403fSchristos   BFD_RELOC_AARCH64_LD_LO19_PCREL,
5567440a403fSchristos 
5568440a403fSchristos /* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset.  */
5569440a403fSchristos   BFD_RELOC_AARCH64_ADR_LO21_PCREL,
5570440a403fSchristos 
5571440a403fSchristos /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5572440a403fSchristos offset, giving a 4KB aligned page base address.  */
5573440a403fSchristos   BFD_RELOC_AARCH64_ADR_HI21_PCREL,
5574440a403fSchristos 
5575440a403fSchristos /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5576440a403fSchristos offset, giving a 4KB aligned page base address, but with no overflow
5577440a403fSchristos checking.  */
5578440a403fSchristos   BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
5579440a403fSchristos 
5580440a403fSchristos /* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
5581440a403fSchristos Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5582440a403fSchristos   BFD_RELOC_AARCH64_ADD_LO12,
5583440a403fSchristos 
5584440a403fSchristos /* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
5585440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5586440a403fSchristos   BFD_RELOC_AARCH64_LDST8_LO12,
5587440a403fSchristos 
5588440a403fSchristos /* AArch64 14 bit pc-relative test bit and branch.
5589440a403fSchristos The lowest two bits must be zero and are not stored in the instruction,
5590440a403fSchristos giving a 16 bit signed byte offset.  */
5591440a403fSchristos   BFD_RELOC_AARCH64_TSTBR14,
5592440a403fSchristos 
5593440a403fSchristos /* AArch64 19 bit pc-relative conditional branch and compare & branch.
5594440a403fSchristos The lowest two bits must be zero and are not stored in the instruction,
5595440a403fSchristos giving a 21 bit signed byte offset.  */
5596440a403fSchristos   BFD_RELOC_AARCH64_BRANCH19,
5597440a403fSchristos 
5598440a403fSchristos /* AArch64 26 bit pc-relative unconditional branch.
5599440a403fSchristos The lowest two bits must be zero and are not stored in the instruction,
5600440a403fSchristos giving a 28 bit signed byte offset.  */
5601440a403fSchristos   BFD_RELOC_AARCH64_JUMP26,
5602440a403fSchristos 
5603440a403fSchristos /* AArch64 26 bit pc-relative unconditional branch and link.
5604440a403fSchristos The lowest two bits must be zero and are not stored in the instruction,
5605440a403fSchristos giving a 28 bit signed byte offset.  */
5606440a403fSchristos   BFD_RELOC_AARCH64_CALL26,
5607440a403fSchristos 
5608440a403fSchristos /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
5609440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5610440a403fSchristos   BFD_RELOC_AARCH64_LDST16_LO12,
5611440a403fSchristos 
5612440a403fSchristos /* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
5613440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5614440a403fSchristos   BFD_RELOC_AARCH64_LDST32_LO12,
5615440a403fSchristos 
5616440a403fSchristos /* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
5617440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5618440a403fSchristos   BFD_RELOC_AARCH64_LDST64_LO12,
5619440a403fSchristos 
5620440a403fSchristos /* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
5621440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5622440a403fSchristos   BFD_RELOC_AARCH64_LDST128_LO12,
5623440a403fSchristos 
5624440a403fSchristos /* AArch64 Load Literal instruction, holding a 19 bit PC relative word
5625440a403fSchristos offset of the global offset table entry for a symbol.  The lowest two
5626440a403fSchristos bits must be zero and are not stored in the instruction, giving a 21
5627440a403fSchristos bit signed byte offset.  This relocation type requires signed overflow
5628440a403fSchristos checking.  */
5629440a403fSchristos   BFD_RELOC_AARCH64_GOT_LD_PREL19,
5630440a403fSchristos 
5631440a403fSchristos /* Get to the page base of the global offset table entry for a symbol as
5632440a403fSchristos part of an ADRP instruction using a 21 bit PC relative value.Used in
5633440a403fSchristos conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC.  */
5634440a403fSchristos   BFD_RELOC_AARCH64_ADR_GOT_PAGE,
5635440a403fSchristos 
5636440a403fSchristos /* Unsigned 12 bit byte offset for 64 bit load/store from the page of
5637440a403fSchristos the GOT entry for this symbol.  Used in conjunction with
563806324dcfSchristos BFD_RELOC_AARCH64_ADR_GOT_PAGE.  Valid in LP64 ABI only.  */
5639440a403fSchristos   BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
5640440a403fSchristos 
5641440a403fSchristos /* Unsigned 12 bit byte offset for 32 bit load/store from the page of
5642440a403fSchristos the GOT entry for this symbol.  Used in conjunction with
564306324dcfSchristos BFD_RELOC_AARCH64_ADR_GOT_PAGE.  Valid in ILP32 ABI only.  */
5644440a403fSchristos   BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
5645440a403fSchristos 
5646440a403fSchristos /* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
5647440a403fSchristos for this symbol.  Valid in LP64 ABI only.  */
5648440a403fSchristos   BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
5649440a403fSchristos 
5650440a403fSchristos /* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
5651440a403fSchristos for this symbol.  Valid in LP64 ABI only.  */
5652440a403fSchristos   BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
5653440a403fSchristos 
5654440a403fSchristos /* Unsigned 15 bit byte offset for 64 bit load/store from the page of
5655440a403fSchristos the GOT entry for this symbol.  Valid in LP64 ABI only.  */
5656440a403fSchristos   BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
5657440a403fSchristos 
5658440a403fSchristos /* Scaled 14 bit byte offset to the page base of the global offset table.  */
5659440a403fSchristos   BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
5660440a403fSchristos 
5661440a403fSchristos /* Scaled 15 bit byte offset to the page base of the global offset table.  */
5662440a403fSchristos   BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
5663440a403fSchristos 
5664440a403fSchristos /* Get to the page base of the global offset table entry for a symbols
5665440a403fSchristos tls_index structure as part of an adrp instruction using a 21 bit PC
5666440a403fSchristos relative value.  Used in conjunction with
5667440a403fSchristos BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC.  */
5668440a403fSchristos   BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
5669440a403fSchristos 
5670440a403fSchristos /* AArch64 TLS General Dynamic  */
5671440a403fSchristos   BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
5672440a403fSchristos 
5673440a403fSchristos /* Unsigned 12 bit byte offset to global offset table entry for a symbols
5674440a403fSchristos tls_index structure.  Used in conjunction with
5675440a403fSchristos BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
5676440a403fSchristos   BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
5677440a403fSchristos 
5678440a403fSchristos /* AArch64 TLS General Dynamic relocation.  */
5679440a403fSchristos   BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
5680440a403fSchristos 
5681440a403fSchristos /* AArch64 TLS General Dynamic relocation.  */
5682440a403fSchristos   BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
5683440a403fSchristos 
5684440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5685440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
5686440a403fSchristos 
5687440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5688440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
5689440a403fSchristos 
5690440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5691440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
5692440a403fSchristos 
5693440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5694440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
5695440a403fSchristos 
5696440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5697440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
5698440a403fSchristos 
5699440a403fSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
5700440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
5701440a403fSchristos 
5702440a403fSchristos /* bit[23:12] of byte offset to module TLS base address.  */
5703440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
5704440a403fSchristos 
5705440a403fSchristos /* Unsigned 12 bit byte offset to module TLS base address.  */
5706440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
5707440a403fSchristos 
5708440a403fSchristos /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.  */
5709440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
5710440a403fSchristos 
5711440a403fSchristos /* Unsigned 12 bit byte offset to global offset table entry for a symbols
5712440a403fSchristos tls_index structure.  Used in conjunction with
5713440a403fSchristos BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.  */
5714440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
5715440a403fSchristos 
5716440a403fSchristos /* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
5717440a403fSchristos instruction.  */
5718440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
5719440a403fSchristos 
5720440a403fSchristos /* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction.  */
5721440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
5722440a403fSchristos 
5723440a403fSchristos /* bit[11:1] of byte offset to module TLS base address, encoded in ldst
5724440a403fSchristos instructions.  */
5725440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
5726440a403fSchristos 
5727440a403fSchristos /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check.  */
5728440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
5729440a403fSchristos 
5730440a403fSchristos /* bit[11:2] of byte offset to module TLS base address, encoded in ldst
5731440a403fSchristos instructions.  */
5732440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
5733440a403fSchristos 
5734440a403fSchristos /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check.  */
5735440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
5736440a403fSchristos 
5737440a403fSchristos /* bit[11:3] of byte offset to module TLS base address, encoded in ldst
5738440a403fSchristos instructions.  */
5739440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
5740440a403fSchristos 
5741440a403fSchristos /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check.  */
5742440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
5743440a403fSchristos 
5744440a403fSchristos /* bit[11:0] of byte offset to module TLS base address, encoded in ldst
5745440a403fSchristos instructions.  */
5746440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
5747440a403fSchristos 
5748440a403fSchristos /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check.  */
5749440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
5750440a403fSchristos 
5751440a403fSchristos /* bit[15:0] of byte offset to module TLS base address.  */
5752440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
5753440a403fSchristos 
5754440a403fSchristos /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0  */
5755440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
5756440a403fSchristos 
5757440a403fSchristos /* bit[31:16] of byte offset to module TLS base address.  */
5758440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
5759440a403fSchristos 
5760440a403fSchristos /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1  */
5761440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
5762440a403fSchristos 
5763440a403fSchristos /* bit[47:32] of byte offset to module TLS base address.  */
5764440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
5765440a403fSchristos 
5766440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5767440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
5768440a403fSchristos 
5769440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5770440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
5771440a403fSchristos 
5772440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5773440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
5774440a403fSchristos 
5775440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5776440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
5777440a403fSchristos 
5778440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5779440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
5780440a403fSchristos 
5781440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5782440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
5783440a403fSchristos 
5784440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5785440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
5786440a403fSchristos 
5787440a403fSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5788440a403fSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
5789440a403fSchristos 
579006324dcfSchristos /* bit[11:1] of byte offset to module TLS base address, encoded in ldst
579106324dcfSchristos instructions.  */
579206324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
579306324dcfSchristos 
579406324dcfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check.  */
579506324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
579606324dcfSchristos 
579706324dcfSchristos /* bit[11:2] of byte offset to module TLS base address, encoded in ldst
579806324dcfSchristos instructions.  */
579906324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
580006324dcfSchristos 
580106324dcfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check.  */
580206324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
580306324dcfSchristos 
580406324dcfSchristos /* bit[11:3] of byte offset to module TLS base address, encoded in ldst
580506324dcfSchristos instructions.  */
580606324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
580706324dcfSchristos 
580806324dcfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check.  */
580906324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
581006324dcfSchristos 
581106324dcfSchristos /* bit[11:0] of byte offset to module TLS base address, encoded in ldst
581206324dcfSchristos instructions.  */
581306324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
581406324dcfSchristos 
581506324dcfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check.  */
581606324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
581706324dcfSchristos 
5818440a403fSchristos /* AArch64 TLS DESC relocation.  */
5819440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
5820440a403fSchristos 
5821440a403fSchristos /* AArch64 TLS DESC relocation.  */
5822440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
5823440a403fSchristos 
5824440a403fSchristos /* AArch64 TLS DESC relocation.  */
5825440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
5826440a403fSchristos 
5827440a403fSchristos /* AArch64 TLS DESC relocation.  */
582806324dcfSchristos   BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
5829440a403fSchristos 
5830440a403fSchristos /* AArch64 TLS DESC relocation.  */
5831440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
5832440a403fSchristos 
5833440a403fSchristos /* AArch64 TLS DESC relocation.  */
583406324dcfSchristos   BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
5835440a403fSchristos 
5836440a403fSchristos /* AArch64 TLS DESC relocation.  */
5837440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
5838440a403fSchristos 
5839440a403fSchristos /* AArch64 TLS DESC relocation.  */
5840440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
5841440a403fSchristos 
5842440a403fSchristos /* AArch64 TLS DESC relocation.  */
5843440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_LDR,
5844440a403fSchristos 
5845440a403fSchristos /* AArch64 TLS DESC relocation.  */
5846440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_ADD,
5847440a403fSchristos 
5848440a403fSchristos /* AArch64 TLS DESC relocation.  */
5849440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_CALL,
5850440a403fSchristos 
5851440a403fSchristos /* AArch64 TLS relocation.  */
5852440a403fSchristos   BFD_RELOC_AARCH64_COPY,
5853440a403fSchristos 
5854440a403fSchristos /* AArch64 TLS relocation.  */
5855440a403fSchristos   BFD_RELOC_AARCH64_GLOB_DAT,
5856440a403fSchristos 
5857440a403fSchristos /* AArch64 TLS relocation.  */
5858440a403fSchristos   BFD_RELOC_AARCH64_JUMP_SLOT,
5859440a403fSchristos 
5860440a403fSchristos /* AArch64 TLS relocation.  */
5861440a403fSchristos   BFD_RELOC_AARCH64_RELATIVE,
5862440a403fSchristos 
5863440a403fSchristos /* AArch64 TLS relocation.  */
5864440a403fSchristos   BFD_RELOC_AARCH64_TLS_DTPMOD,
5865440a403fSchristos 
5866440a403fSchristos /* AArch64 TLS relocation.  */
5867440a403fSchristos   BFD_RELOC_AARCH64_TLS_DTPREL,
5868440a403fSchristos 
5869440a403fSchristos /* AArch64 TLS relocation.  */
5870440a403fSchristos   BFD_RELOC_AARCH64_TLS_TPREL,
5871440a403fSchristos 
5872440a403fSchristos /* AArch64 TLS relocation.  */
5873440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC,
5874440a403fSchristos 
5875440a403fSchristos /* AArch64 support for STT_GNU_IFUNC.  */
5876440a403fSchristos   BFD_RELOC_AARCH64_IRELATIVE,
5877440a403fSchristos 
5878440a403fSchristos /* AArch64 pseudo relocation code to mark the end of the AArch64
5879440a403fSchristos relocation enumerators that have direct mapping to ELF reloc codes.
5880440a403fSchristos There are a few more enumerators after this one; those are mainly
5881440a403fSchristos used by the AArch64 assembler for the internal fixup or to select
5882440a403fSchristos one of the above enumerators.  */
5883440a403fSchristos   BFD_RELOC_AARCH64_RELOC_END,
5884440a403fSchristos 
5885440a403fSchristos /* AArch64 pseudo relocation code to be used internally by the AArch64
5886440a403fSchristos assembler and not (currently) written to any object files.  */
5887440a403fSchristos   BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
5888440a403fSchristos 
5889440a403fSchristos /* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
5890440a403fSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5891440a403fSchristos   BFD_RELOC_AARCH64_LDST_LO12,
5892440a403fSchristos 
5893440a403fSchristos /* AArch64 pseudo relocation code for TLS local dynamic mode.  It's to be
5894440a403fSchristos used internally by the AArch64 assembler and not (currently) written to
5895440a403fSchristos any object files.  */
5896440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
5897440a403fSchristos 
5898440a403fSchristos /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check.  */
5899440a403fSchristos   BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
5900440a403fSchristos 
590106324dcfSchristos /* AArch64 pseudo relocation code for TLS local exec mode.  It's to be
590206324dcfSchristos used internally by the AArch64 assembler and not (currently) written to
590306324dcfSchristos any object files.  */
590406324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
590506324dcfSchristos 
590606324dcfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check.  */
590706324dcfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
590806324dcfSchristos 
5909440a403fSchristos /* AArch64 pseudo relocation code to be used internally by the AArch64
5910440a403fSchristos assembler and not (currently) written to any object files.  */
5911440a403fSchristos   BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
5912440a403fSchristos 
5913440a403fSchristos /* AArch64 pseudo relocation code to be used internally by the AArch64
5914440a403fSchristos assembler and not (currently) written to any object files.  */
5915440a403fSchristos   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
5916440a403fSchristos 
5917440a403fSchristos /* AArch64 pseudo relocation code to be used internally by the AArch64
5918440a403fSchristos assembler and not (currently) written to any object files.  */
5919440a403fSchristos   BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
5920440a403fSchristos 
5921440a403fSchristos /* Tilera TILEPro Relocations.  */
5922440a403fSchristos   BFD_RELOC_TILEPRO_COPY,
5923440a403fSchristos   BFD_RELOC_TILEPRO_GLOB_DAT,
5924440a403fSchristos   BFD_RELOC_TILEPRO_JMP_SLOT,
5925440a403fSchristos   BFD_RELOC_TILEPRO_RELATIVE,
5926440a403fSchristos   BFD_RELOC_TILEPRO_BROFF_X1,
5927440a403fSchristos   BFD_RELOC_TILEPRO_JOFFLONG_X1,
5928440a403fSchristos   BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
5929440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_X0,
5930440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_Y0,
5931440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_X1,
5932440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_Y1,
5933440a403fSchristos   BFD_RELOC_TILEPRO_DEST_IMM8_X1,
5934440a403fSchristos   BFD_RELOC_TILEPRO_MT_IMM15_X1,
5935440a403fSchristos   BFD_RELOC_TILEPRO_MF_IMM15_X1,
5936440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0,
5937440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1,
5938440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_LO,
5939440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_LO,
5940440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HI,
5941440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HI,
5942440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HA,
5943440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HA,
5944440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
5945440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
5946440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
5947440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
5948440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
5949440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
5950440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
5951440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
5952440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT,
5953440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT,
5954440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
5955440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
5956440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
5957440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
5958440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
5959440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
5960440a403fSchristos   BFD_RELOC_TILEPRO_MMSTART_X0,
5961440a403fSchristos   BFD_RELOC_TILEPRO_MMEND_X0,
5962440a403fSchristos   BFD_RELOC_TILEPRO_MMSTART_X1,
5963440a403fSchristos   BFD_RELOC_TILEPRO_MMEND_X1,
5964440a403fSchristos   BFD_RELOC_TILEPRO_SHAMT_X0,
5965440a403fSchristos   BFD_RELOC_TILEPRO_SHAMT_X1,
5966440a403fSchristos   BFD_RELOC_TILEPRO_SHAMT_Y0,
5967440a403fSchristos   BFD_RELOC_TILEPRO_SHAMT_Y1,
5968440a403fSchristos   BFD_RELOC_TILEPRO_TLS_GD_CALL,
5969440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
5970440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
5971440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
5972440a403fSchristos   BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
5973440a403fSchristos   BFD_RELOC_TILEPRO_TLS_IE_LOAD,
5974440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
5975440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
5976440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
5977440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
5978440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
5979440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
5980440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
5981440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
5982440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
5983440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
5984440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
5985440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
5986440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
5987440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
5988440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
5989440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
5990440a403fSchristos   BFD_RELOC_TILEPRO_TLS_DTPMOD32,
5991440a403fSchristos   BFD_RELOC_TILEPRO_TLS_DTPOFF32,
5992440a403fSchristos   BFD_RELOC_TILEPRO_TLS_TPOFF32,
5993440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
5994440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
5995440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
5996440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
5997440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
5998440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
5999440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6000440a403fSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6001440a403fSchristos 
6002440a403fSchristos /* Tilera TILE-Gx Relocations.  */
6003440a403fSchristos   BFD_RELOC_TILEGX_HW0,
6004440a403fSchristos   BFD_RELOC_TILEGX_HW1,
6005440a403fSchristos   BFD_RELOC_TILEGX_HW2,
6006440a403fSchristos   BFD_RELOC_TILEGX_HW3,
6007440a403fSchristos   BFD_RELOC_TILEGX_HW0_LAST,
6008440a403fSchristos   BFD_RELOC_TILEGX_HW1_LAST,
6009440a403fSchristos   BFD_RELOC_TILEGX_HW2_LAST,
6010440a403fSchristos   BFD_RELOC_TILEGX_COPY,
6011440a403fSchristos   BFD_RELOC_TILEGX_GLOB_DAT,
6012440a403fSchristos   BFD_RELOC_TILEGX_JMP_SLOT,
6013440a403fSchristos   BFD_RELOC_TILEGX_RELATIVE,
6014440a403fSchristos   BFD_RELOC_TILEGX_BROFF_X1,
6015440a403fSchristos   BFD_RELOC_TILEGX_JUMPOFF_X1,
6016440a403fSchristos   BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6017440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X0,
6018440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y0,
6019440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X1,
6020440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y1,
6021440a403fSchristos   BFD_RELOC_TILEGX_DEST_IMM8_X1,
6022440a403fSchristos   BFD_RELOC_TILEGX_MT_IMM14_X1,
6023440a403fSchristos   BFD_RELOC_TILEGX_MF_IMM14_X1,
6024440a403fSchristos   BFD_RELOC_TILEGX_MMSTART_X0,
6025440a403fSchristos   BFD_RELOC_TILEGX_MMEND_X0,
6026440a403fSchristos   BFD_RELOC_TILEGX_SHAMT_X0,
6027440a403fSchristos   BFD_RELOC_TILEGX_SHAMT_X1,
6028440a403fSchristos   BFD_RELOC_TILEGX_SHAMT_Y0,
6029440a403fSchristos   BFD_RELOC_TILEGX_SHAMT_Y1,
6030440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0,
6031440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0,
6032440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1,
6033440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1,
6034440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2,
6035440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2,
6036440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3,
6037440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3,
6038440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6039440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6040440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6041440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6042440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6043440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6044440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6045440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6046440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6047440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6048440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6049440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6050440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6051440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6052440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6053440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6054440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6055440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6056440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6057440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6058440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6059440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6060440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6061440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6062440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6063440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6064440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6065440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6066440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6067440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6068440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6069440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6070440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6071440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6072440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6073440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6074440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6075440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6076440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6077440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6078440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6079440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6080440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6081440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6082440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6083440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6084440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6085440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6086440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6087440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6088440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6089440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6090440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6091440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6092440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6093440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6094440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6095440a403fSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6096440a403fSchristos   BFD_RELOC_TILEGX_TLS_DTPMOD64,
6097440a403fSchristos   BFD_RELOC_TILEGX_TLS_DTPOFF64,
6098440a403fSchristos   BFD_RELOC_TILEGX_TLS_TPOFF64,
6099440a403fSchristos   BFD_RELOC_TILEGX_TLS_DTPMOD32,
6100440a403fSchristos   BFD_RELOC_TILEGX_TLS_DTPOFF32,
6101440a403fSchristos   BFD_RELOC_TILEGX_TLS_TPOFF32,
6102440a403fSchristos   BFD_RELOC_TILEGX_TLS_GD_CALL,
6103440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6104440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6105440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6106440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6107440a403fSchristos   BFD_RELOC_TILEGX_TLS_IE_LOAD,
6108440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6109440a403fSchristos   BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6110440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6111440a403fSchristos   BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6112440a403fSchristos 
6113*b88e3e88Schristos /* Linux eBPF relocations.  */
6114*b88e3e88Schristos   BFD_RELOC_BPF_64,
6115*b88e3e88Schristos   BFD_RELOC_BPF_32,
6116*b88e3e88Schristos   BFD_RELOC_BPF_16,
6117*b88e3e88Schristos   BFD_RELOC_BPF_DISP16,
6118*b88e3e88Schristos   BFD_RELOC_BPF_DISP32,
6119*b88e3e88Schristos 
6120440a403fSchristos /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement  */
6121440a403fSchristos   BFD_RELOC_EPIPHANY_SIMM8,
6122440a403fSchristos 
6123440a403fSchristos /* Adapteva EPIPHANY - 24 bit signed pc-relative displacement  */
6124440a403fSchristos   BFD_RELOC_EPIPHANY_SIMM24,
6125440a403fSchristos 
6126440a403fSchristos /* Adapteva EPIPHANY - 16 most-significant bits of absolute address  */
6127440a403fSchristos   BFD_RELOC_EPIPHANY_HIGH,
6128440a403fSchristos 
6129440a403fSchristos /* Adapteva EPIPHANY - 16 least-significant bits of absolute address  */
6130440a403fSchristos   BFD_RELOC_EPIPHANY_LOW,
6131440a403fSchristos 
6132440a403fSchristos /* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate  */
6133440a403fSchristos   BFD_RELOC_EPIPHANY_SIMM11,
6134440a403fSchristos 
6135440a403fSchristos /* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement)  */
6136440a403fSchristos   BFD_RELOC_EPIPHANY_IMM11,
6137440a403fSchristos 
6138440a403fSchristos /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction.  */
6139440a403fSchristos   BFD_RELOC_EPIPHANY_IMM8,
6140440a403fSchristos 
6141440a403fSchristos /* Visium Relocations.  */
6142440a403fSchristos   BFD_RELOC_VISIUM_HI16,
6143440a403fSchristos   BFD_RELOC_VISIUM_LO16,
6144440a403fSchristos   BFD_RELOC_VISIUM_IM16,
6145440a403fSchristos   BFD_RELOC_VISIUM_REL16,
6146440a403fSchristos   BFD_RELOC_VISIUM_HI16_PCREL,
6147440a403fSchristos   BFD_RELOC_VISIUM_LO16_PCREL,
6148440a403fSchristos   BFD_RELOC_VISIUM_IM16_PCREL,
614906324dcfSchristos 
615006324dcfSchristos /* WebAssembly relocations.  */
615106324dcfSchristos   BFD_RELOC_WASM32_LEB128,
615206324dcfSchristos   BFD_RELOC_WASM32_LEB128_GOT,
615306324dcfSchristos   BFD_RELOC_WASM32_LEB128_GOT_CODE,
615406324dcfSchristos   BFD_RELOC_WASM32_LEB128_PLT,
615506324dcfSchristos   BFD_RELOC_WASM32_PLT_INDEX,
615606324dcfSchristos   BFD_RELOC_WASM32_ABS32_CODE,
615706324dcfSchristos   BFD_RELOC_WASM32_COPY,
615806324dcfSchristos   BFD_RELOC_WASM32_CODE_POINTER,
615906324dcfSchristos   BFD_RELOC_WASM32_INDEX,
616006324dcfSchristos   BFD_RELOC_WASM32_PLT_SIG,
6161*b88e3e88Schristos 
6162*b88e3e88Schristos /* C-SKY relocations.  */
6163*b88e3e88Schristos   BFD_RELOC_CKCORE_NONE,
6164*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDR32,
6165*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM8BY4,
6166*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM11BY2,
6167*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM4BY2,
6168*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL32,
6169*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
6170*b88e3e88Schristos   BFD_RELOC_CKCORE_GNU_VTINHERIT,
6171*b88e3e88Schristos   BFD_RELOC_CKCORE_GNU_VTENTRY,
6172*b88e3e88Schristos   BFD_RELOC_CKCORE_RELATIVE,
6173*b88e3e88Schristos   BFD_RELOC_CKCORE_COPY,
6174*b88e3e88Schristos   BFD_RELOC_CKCORE_GLOB_DAT,
6175*b88e3e88Schristos   BFD_RELOC_CKCORE_JUMP_SLOT,
6176*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTOFF,
6177*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTPC,
6178*b88e3e88Schristos   BFD_RELOC_CKCORE_GOT32,
6179*b88e3e88Schristos   BFD_RELOC_CKCORE_PLT32,
6180*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRGOT,
6181*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRPLT,
6182*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM26BY2,
6183*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM16BY2,
6184*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM16BY4,
6185*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM10BY2,
6186*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM10BY4,
6187*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDR_HI16,
6188*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDR_LO16,
6189*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTPC_HI16,
6190*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTPC_LO16,
6191*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTOFF_HI16,
6192*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTOFF_LO16,
6193*b88e3e88Schristos   BFD_RELOC_CKCORE_GOT12,
6194*b88e3e88Schristos   BFD_RELOC_CKCORE_GOT_HI16,
6195*b88e3e88Schristos   BFD_RELOC_CKCORE_GOT_LO16,
6196*b88e3e88Schristos   BFD_RELOC_CKCORE_PLT12,
6197*b88e3e88Schristos   BFD_RELOC_CKCORE_PLT_HI16,
6198*b88e3e88Schristos   BFD_RELOC_CKCORE_PLT_LO16,
6199*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRGOT_HI16,
6200*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRGOT_LO16,
6201*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRPLT_HI16,
6202*b88e3e88Schristos   BFD_RELOC_CKCORE_ADDRPLT_LO16,
6203*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
6204*b88e3e88Schristos   BFD_RELOC_CKCORE_TOFFSET_LO16,
6205*b88e3e88Schristos   BFD_RELOC_CKCORE_DOFFSET_LO16,
6206*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM18BY2,
6207*b88e3e88Schristos   BFD_RELOC_CKCORE_DOFFSET_IMM18,
6208*b88e3e88Schristos   BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
6209*b88e3e88Schristos   BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
6210*b88e3e88Schristos   BFD_RELOC_CKCORE_GOTOFF_IMM18,
6211*b88e3e88Schristos   BFD_RELOC_CKCORE_GOT_IMM18BY4,
6212*b88e3e88Schristos   BFD_RELOC_CKCORE_PLT_IMM18BY4,
6213*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_IMM7BY4,
6214*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_LE32,
6215*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_IE32,
6216*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_GD32,
6217*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_LDM32,
6218*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_LDO32,
6219*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_DTPMOD32,
6220*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_DTPOFF32,
6221*b88e3e88Schristos   BFD_RELOC_CKCORE_TLS_TPOFF32,
6222*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
6223*b88e3e88Schristos   BFD_RELOC_CKCORE_NOJSRI,
6224*b88e3e88Schristos   BFD_RELOC_CKCORE_CALLGRAPH,
6225*b88e3e88Schristos   BFD_RELOC_CKCORE_IRELATIVE,
6226*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
6227*b88e3e88Schristos   BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
6228*b88e3e88Schristos 
6229*b88e3e88Schristos /* S12Z relocations.  */
6230*b88e3e88Schristos   BFD_RELOC_S12Z_OPR,
6231440a403fSchristos   BFD_RELOC_UNUSED };
6232440a403fSchristos 
6233440a403fSchristos typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6234440a403fSchristos reloc_howto_type *bfd_reloc_type_lookup
6235440a403fSchristos    (bfd *abfd, bfd_reloc_code_real_type code);
6236440a403fSchristos reloc_howto_type *bfd_reloc_name_lookup
6237440a403fSchristos    (bfd *abfd, const char *reloc_name);
6238440a403fSchristos 
6239440a403fSchristos const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6240440a403fSchristos 
6241440a403fSchristos /* Extracted from syms.c.  */
6242440a403fSchristos 
6243440a403fSchristos typedef struct bfd_symbol
6244440a403fSchristos {
6245440a403fSchristos   /* A pointer to the BFD which owns the symbol. This information
6246440a403fSchristos      is necessary so that a back end can work out what additional
6247440a403fSchristos      information (invisible to the application writer) is carried
6248440a403fSchristos      with the symbol.
6249440a403fSchristos 
6250440a403fSchristos      This field is *almost* redundant, since you can use section->owner
6251440a403fSchristos      instead, except that some symbols point to the global sections
6252440a403fSchristos      bfd_{abs,com,und}_section.  This could be fixed by making
6253440a403fSchristos      these globals be per-bfd (or per-target-flavor).  FIXME.  */
6254440a403fSchristos   struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
6255440a403fSchristos 
6256440a403fSchristos   /* The text of the symbol. The name is left alone, and not copied; the
6257440a403fSchristos      application may not alter it.  */
6258440a403fSchristos   const char *name;
6259440a403fSchristos 
6260440a403fSchristos   /* The value of the symbol.  This really should be a union of a
6261440a403fSchristos      numeric value with a pointer, since some flags indicate that
6262440a403fSchristos      a pointer to another symbol is stored here.  */
6263440a403fSchristos   symvalue value;
6264440a403fSchristos 
6265440a403fSchristos   /* Attributes of a symbol.  */
626606324dcfSchristos #define BSF_NO_FLAGS            0
6267440a403fSchristos 
6268440a403fSchristos   /* The symbol has local scope; <<static>> in <<C>>. The value
6269440a403fSchristos      is the offset into the section of the data.  */
6270440a403fSchristos #define BSF_LOCAL               (1 << 0)
6271440a403fSchristos 
6272440a403fSchristos   /* The symbol has global scope; initialized data in <<C>>. The
6273440a403fSchristos      value is the offset into the section of the data.  */
6274440a403fSchristos #define BSF_GLOBAL              (1 << 1)
6275440a403fSchristos 
6276440a403fSchristos   /* The symbol has global scope and is exported. The value is
6277440a403fSchristos      the offset into the section of the data.  */
6278440a403fSchristos #define BSF_EXPORT              BSF_GLOBAL /* No real difference.  */
6279440a403fSchristos 
6280440a403fSchristos   /* A normal C symbol would be one of:
6281440a403fSchristos      <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>.  */
6282440a403fSchristos 
6283440a403fSchristos   /* The symbol is a debugging record. The value has an arbitrary
6284440a403fSchristos      meaning, unless BSF_DEBUGGING_RELOC is also set.  */
6285440a403fSchristos #define BSF_DEBUGGING           (1 << 2)
6286440a403fSchristos 
6287440a403fSchristos   /* The symbol denotes a function entry point.  Used in ELF,
6288440a403fSchristos      perhaps others someday.  */
6289440a403fSchristos #define BSF_FUNCTION            (1 << 3)
6290440a403fSchristos 
6291440a403fSchristos   /* Used by the linker.  */
6292440a403fSchristos #define BSF_KEEP                (1 << 5)
6293440a403fSchristos 
6294440a403fSchristos   /* An ELF common symbol.  */
6295440a403fSchristos #define BSF_ELF_COMMON          (1 << 6)
6296440a403fSchristos 
6297440a403fSchristos   /* A weak global symbol, overridable without warnings by
6298440a403fSchristos      a regular global symbol of the same name.  */
6299440a403fSchristos #define BSF_WEAK                (1 << 7)
6300440a403fSchristos 
6301440a403fSchristos   /* This symbol was created to point to a section, e.g. ELF's
6302440a403fSchristos      STT_SECTION symbols.  */
6303440a403fSchristos #define BSF_SECTION_SYM         (1 << 8)
6304440a403fSchristos 
6305440a403fSchristos   /* The symbol used to be a common symbol, but now it is
6306440a403fSchristos      allocated.  */
6307440a403fSchristos #define BSF_OLD_COMMON          (1 << 9)
6308440a403fSchristos 
6309440a403fSchristos   /* In some files the type of a symbol sometimes alters its
6310440a403fSchristos      location in an output file - ie in coff a <<ISFCN>> symbol
6311440a403fSchristos      which is also <<C_EXT>> symbol appears where it was
6312440a403fSchristos      declared and not at the end of a section.  This bit is set
6313440a403fSchristos      by the target BFD part to convey this information.  */
6314440a403fSchristos #define BSF_NOT_AT_END          (1 << 10)
6315440a403fSchristos 
6316440a403fSchristos   /* Signal that the symbol is the label of constructor section.  */
6317440a403fSchristos #define BSF_CONSTRUCTOR         (1 << 11)
6318440a403fSchristos 
6319440a403fSchristos   /* Signal that the symbol is a warning symbol.  The name is a
6320440a403fSchristos      warning.  The name of the next symbol is the one to warn about;
6321440a403fSchristos      if a reference is made to a symbol with the same name as the next
6322440a403fSchristos      symbol, a warning is issued by the linker.  */
6323440a403fSchristos #define BSF_WARNING             (1 << 12)
6324440a403fSchristos 
6325440a403fSchristos   /* Signal that the symbol is indirect.  This symbol is an indirect
6326440a403fSchristos      pointer to the symbol with the same name as the next symbol.  */
6327440a403fSchristos #define BSF_INDIRECT            (1 << 13)
6328440a403fSchristos 
6329440a403fSchristos   /* BSF_FILE marks symbols that contain a file name.  This is used
6330440a403fSchristos      for ELF STT_FILE symbols.  */
6331440a403fSchristos #define BSF_FILE                (1 << 14)
6332440a403fSchristos 
6333440a403fSchristos   /* Symbol is from dynamic linking information.  */
6334440a403fSchristos #define BSF_DYNAMIC             (1 << 15)
6335440a403fSchristos 
6336440a403fSchristos   /* The symbol denotes a data object.  Used in ELF, and perhaps
6337440a403fSchristos      others someday.  */
6338440a403fSchristos #define BSF_OBJECT              (1 << 16)
6339440a403fSchristos 
6340440a403fSchristos   /* This symbol is a debugging symbol.  The value is the offset
6341440a403fSchristos      into the section of the data.  BSF_DEBUGGING should be set
6342440a403fSchristos      as well.  */
6343440a403fSchristos #define BSF_DEBUGGING_RELOC     (1 << 17)
6344440a403fSchristos 
6345440a403fSchristos   /* This symbol is thread local.  Used in ELF.  */
6346440a403fSchristos #define BSF_THREAD_LOCAL        (1 << 18)
6347440a403fSchristos 
6348440a403fSchristos   /* This symbol represents a complex relocation expression,
6349440a403fSchristos      with the expression tree serialized in the symbol name.  */
6350440a403fSchristos #define BSF_RELC                (1 << 19)
6351440a403fSchristos 
6352440a403fSchristos   /* This symbol represents a signed complex relocation expression,
6353440a403fSchristos      with the expression tree serialized in the symbol name.  */
6354440a403fSchristos #define BSF_SRELC               (1 << 20)
6355440a403fSchristos 
6356440a403fSchristos   /* This symbol was created by bfd_get_synthetic_symtab.  */
6357440a403fSchristos #define BSF_SYNTHETIC           (1 << 21)
6358440a403fSchristos 
6359440a403fSchristos   /* This symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
6360440a403fSchristos      The dynamic linker will compute the value of this symbol by
6361440a403fSchristos      calling the function that it points to.  BSF_FUNCTION must
6362440a403fSchristos      also be also set.  */
6363440a403fSchristos #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6364440a403fSchristos   /* This symbol is a globally unique data object.  The dynamic linker
6365440a403fSchristos      will make sure that in the entire process there is just one symbol
6366440a403fSchristos      with this name and type in use.  BSF_OBJECT must also be set.  */
6367440a403fSchristos #define BSF_GNU_UNIQUE          (1 << 23)
6368440a403fSchristos 
6369440a403fSchristos   flagword flags;
6370440a403fSchristos 
6371440a403fSchristos   /* A pointer to the section to which this symbol is
6372440a403fSchristos      relative.  This will always be non NULL, there are special
6373440a403fSchristos      sections for undefined and absolute symbols.  */
6374440a403fSchristos   struct bfd_section *section;
6375440a403fSchristos 
6376440a403fSchristos   /* Back end special data.  */
6377440a403fSchristos   union
6378440a403fSchristos     {
6379440a403fSchristos       void *p;
6380440a403fSchristos       bfd_vma i;
6381440a403fSchristos     }
6382440a403fSchristos   udata;
6383440a403fSchristos }
6384440a403fSchristos asymbol;
6385440a403fSchristos 
6386440a403fSchristos #define bfd_get_symtab_upper_bound(abfd) \
6387440a403fSchristos        BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6388440a403fSchristos 
6389440a403fSchristos bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6390440a403fSchristos 
6391440a403fSchristos bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6392440a403fSchristos 
6393440a403fSchristos #define bfd_is_local_label_name(abfd, name) \
6394440a403fSchristos        BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6395440a403fSchristos 
6396440a403fSchristos bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6397440a403fSchristos 
6398440a403fSchristos #define bfd_is_target_special_symbol(abfd, sym) \
6399440a403fSchristos        BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6400440a403fSchristos 
6401440a403fSchristos #define bfd_canonicalize_symtab(abfd, location) \
6402440a403fSchristos        BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6403440a403fSchristos 
6404440a403fSchristos bfd_boolean bfd_set_symtab
6405440a403fSchristos    (bfd *abfd, asymbol **location, unsigned int count);
6406440a403fSchristos 
6407440a403fSchristos void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6408440a403fSchristos 
6409440a403fSchristos #define bfd_make_empty_symbol(abfd) \
6410440a403fSchristos        BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6411440a403fSchristos 
6412440a403fSchristos asymbol *_bfd_generic_make_empty_symbol (bfd *);
6413440a403fSchristos 
6414440a403fSchristos #define bfd_make_debug_symbol(abfd,ptr,size) \
6415440a403fSchristos        BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6416440a403fSchristos 
6417440a403fSchristos int bfd_decode_symclass (asymbol *symbol);
6418440a403fSchristos 
6419440a403fSchristos bfd_boolean bfd_is_undefined_symclass (int symclass);
6420440a403fSchristos 
6421440a403fSchristos void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6422440a403fSchristos 
6423440a403fSchristos bfd_boolean bfd_copy_private_symbol_data
6424440a403fSchristos    (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6425440a403fSchristos 
6426440a403fSchristos #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6427440a403fSchristos        BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6428440a403fSchristos                  (ibfd, isymbol, obfd, osymbol))
6429440a403fSchristos 
6430440a403fSchristos /* Extracted from bfd.c.  */
6431440a403fSchristos 
6432440a403fSchristos enum bfd_direction
6433440a403fSchristos   {
6434440a403fSchristos     no_direction = 0,
6435440a403fSchristos     read_direction = 1,
6436440a403fSchristos     write_direction = 2,
6437440a403fSchristos     both_direction = 3
6438440a403fSchristos   };
6439440a403fSchristos 
6440440a403fSchristos enum bfd_plugin_format
6441440a403fSchristos   {
6442440a403fSchristos     bfd_plugin_unknown = 0,
6443440a403fSchristos     bfd_plugin_yes = 1,
6444440a403fSchristos     bfd_plugin_no = 2
6445440a403fSchristos   };
6446440a403fSchristos 
6447440a403fSchristos struct bfd_build_id
6448440a403fSchristos   {
6449440a403fSchristos     bfd_size_type size;
6450440a403fSchristos     bfd_byte data[1];
6451440a403fSchristos   };
6452440a403fSchristos 
6453440a403fSchristos struct bfd
6454440a403fSchristos {
6455440a403fSchristos   /* The filename the application opened the BFD with.  */
6456440a403fSchristos   const char *filename;
6457440a403fSchristos 
6458440a403fSchristos   /* A pointer to the target jump table.  */
6459440a403fSchristos   const struct bfd_target *xvec;
6460440a403fSchristos 
6461440a403fSchristos   /* The IOSTREAM, and corresponding IO vector that provide access
6462440a403fSchristos      to the file backing the BFD.  */
6463440a403fSchristos   void *iostream;
6464440a403fSchristos   const struct bfd_iovec *iovec;
6465440a403fSchristos 
6466440a403fSchristos   /* The caching routines use these to maintain a
6467440a403fSchristos      least-recently-used list of BFDs.  */
6468440a403fSchristos   struct bfd *lru_prev, *lru_next;
6469440a403fSchristos 
647006324dcfSchristos   /* Track current file position (or current buffer offset for
647106324dcfSchristos      in-memory BFDs).  When a file is closed by the caching routines,
647206324dcfSchristos      BFD retains state information on the file here.  */
6473440a403fSchristos   ufile_ptr where;
6474440a403fSchristos 
6475440a403fSchristos   /* File modified time, if mtime_set is TRUE.  */
6476440a403fSchristos   long mtime;
6477440a403fSchristos 
6478440a403fSchristos   /* A unique identifier of the BFD  */
6479440a403fSchristos   unsigned int id;
6480440a403fSchristos 
6481440a403fSchristos   /* The format which belongs to the BFD. (object, core, etc.)  */
6482440a403fSchristos   ENUM_BITFIELD (bfd_format) format : 3;
6483440a403fSchristos 
6484440a403fSchristos   /* The direction with which the BFD was opened.  */
6485440a403fSchristos   ENUM_BITFIELD (bfd_direction) direction : 2;
6486440a403fSchristos 
6487440a403fSchristos   /* Format_specific flags.  */
6488*b88e3e88Schristos   flagword flags;
6489440a403fSchristos 
6490440a403fSchristos   /* Values that may appear in the flags field of a BFD.  These also
6491440a403fSchristos      appear in the object_flags field of the bfd_target structure, where
6492440a403fSchristos      they indicate the set of flags used by that backend (not all flags
6493440a403fSchristos      are meaningful for all object file formats) (FIXME: at the moment,
6494440a403fSchristos      the object_flags values have mostly just been copied from backend
6495440a403fSchristos      to another, and are not necessarily correct).  */
6496440a403fSchristos 
649706324dcfSchristos #define BFD_NO_FLAGS                0x0
6498440a403fSchristos 
6499440a403fSchristos   /* BFD contains relocation entries.  */
650006324dcfSchristos #define HAS_RELOC                   0x1
6501440a403fSchristos 
6502440a403fSchristos   /* BFD is directly executable.  */
650306324dcfSchristos #define EXEC_P                      0x2
6504440a403fSchristos 
6505440a403fSchristos   /* BFD has line number information (basically used for F_LNNO in a
6506440a403fSchristos      COFF header).  */
650706324dcfSchristos #define HAS_LINENO                  0x4
6508440a403fSchristos 
6509440a403fSchristos   /* BFD has debugging information.  */
6510440a403fSchristos #define HAS_DEBUG                  0x08
6511440a403fSchristos 
6512440a403fSchristos   /* BFD has symbols.  */
6513440a403fSchristos #define HAS_SYMS                   0x10
6514440a403fSchristos 
6515440a403fSchristos   /* BFD has local symbols (basically used for F_LSYMS in a COFF
6516440a403fSchristos      header).  */
6517440a403fSchristos #define HAS_LOCALS                 0x20
6518440a403fSchristos 
6519440a403fSchristos   /* BFD is a dynamic object.  */
6520440a403fSchristos #define DYNAMIC                    0x40
6521440a403fSchristos 
6522440a403fSchristos   /* Text section is write protected (if D_PAGED is not set, this is
6523440a403fSchristos      like an a.out NMAGIC file) (the linker sets this by default, but
6524440a403fSchristos      clears it for -r or -N).  */
6525440a403fSchristos #define WP_TEXT                    0x80
6526440a403fSchristos 
6527440a403fSchristos   /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6528440a403fSchristos      linker sets this by default, but clears it for -r or -n or -N).  */
6529440a403fSchristos #define D_PAGED                   0x100
6530440a403fSchristos 
6531440a403fSchristos   /* BFD is relaxable (this means that bfd_relax_section may be able to
6532440a403fSchristos      do something) (sometimes bfd_relax_section can do something even if
6533440a403fSchristos      this is not set).  */
6534440a403fSchristos #define BFD_IS_RELAXABLE          0x200
6535440a403fSchristos 
6536440a403fSchristos   /* This may be set before writing out a BFD to request using a
6537440a403fSchristos      traditional format.  For example, this is used to request that when
6538440a403fSchristos      writing out an a.out object the symbols not be hashed to eliminate
6539440a403fSchristos      duplicates.  */
6540440a403fSchristos #define BFD_TRADITIONAL_FORMAT    0x400
6541440a403fSchristos 
6542440a403fSchristos   /* This flag indicates that the BFD contents are actually cached
6543440a403fSchristos      in memory.  If this is set, iostream points to a bfd_in_memory
6544440a403fSchristos      struct.  */
6545440a403fSchristos #define BFD_IN_MEMORY             0x800
6546440a403fSchristos 
6547440a403fSchristos   /* This BFD has been created by the linker and doesn't correspond
6548440a403fSchristos      to any input file.  */
6549440a403fSchristos #define BFD_LINKER_CREATED       0x1000
6550440a403fSchristos 
6551440a403fSchristos   /* This may be set before writing out a BFD to request that it
6552440a403fSchristos      be written using values for UIDs, GIDs, timestamps, etc. that
6553440a403fSchristos      will be consistent from run to run.  */
6554440a403fSchristos #define BFD_DETERMINISTIC_OUTPUT 0x2000
6555440a403fSchristos 
6556440a403fSchristos   /* Compress sections in this BFD.  */
6557440a403fSchristos #define BFD_COMPRESS             0x4000
6558440a403fSchristos 
6559440a403fSchristos   /* Decompress sections in this BFD.  */
6560440a403fSchristos #define BFD_DECOMPRESS           0x8000
6561440a403fSchristos 
6562440a403fSchristos   /* BFD is a dummy, for plugins.  */
6563440a403fSchristos #define BFD_PLUGIN              0x10000
6564440a403fSchristos 
6565440a403fSchristos   /* Compress sections in this BFD with SHF_COMPRESSED from gABI.  */
6566440a403fSchristos #define BFD_COMPRESS_GABI       0x20000
6567440a403fSchristos 
6568440a403fSchristos   /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
6569440a403fSchristos      BFD.  */
6570440a403fSchristos #define BFD_CONVERT_ELF_COMMON  0x40000
6571440a403fSchristos 
6572440a403fSchristos   /* Use the ELF STT_COMMON type in this BFD.  */
6573440a403fSchristos #define BFD_USE_ELF_STT_COMMON  0x80000
6574440a403fSchristos 
6575*b88e3e88Schristos   /* Put pathnames into archives (non-POSIX).  */
6576*b88e3e88Schristos #define BFD_ARCHIVE_FULL_PATH  0x100000
6577*b88e3e88Schristos 
6578440a403fSchristos   /* Flags bits to be saved in bfd_preserve_save.  */
6579440a403fSchristos #define BFD_FLAGS_SAVED \
658006324dcfSchristos   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
658106324dcfSchristos    | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
658206324dcfSchristos    | BFD_USE_ELF_STT_COMMON)
6583440a403fSchristos 
6584440a403fSchristos   /* Flags bits which are for BFD use only.  */
6585440a403fSchristos #define BFD_FLAGS_FOR_BFD_USE_MASK \
6586440a403fSchristos   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
6587440a403fSchristos    | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
6588440a403fSchristos    | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
6589440a403fSchristos 
6590440a403fSchristos   /* Is the file descriptor being cached?  That is, can it be closed as
6591440a403fSchristos      needed, and re-opened when accessed later?  */
6592440a403fSchristos   unsigned int cacheable : 1;
6593440a403fSchristos 
6594440a403fSchristos   /* Marks whether there was a default target specified when the
6595440a403fSchristos      BFD was opened. This is used to select which matching algorithm
6596440a403fSchristos      to use to choose the back end.  */
6597440a403fSchristos   unsigned int target_defaulted : 1;
6598440a403fSchristos 
6599440a403fSchristos   /* ... and here: (``once'' means at least once).  */
6600440a403fSchristos   unsigned int opened_once : 1;
6601440a403fSchristos 
6602440a403fSchristos   /* Set if we have a locally maintained mtime value, rather than
6603440a403fSchristos      getting it from the file each time.  */
6604440a403fSchristos   unsigned int mtime_set : 1;
6605440a403fSchristos 
6606440a403fSchristos   /* Flag set if symbols from this BFD should not be exported.  */
6607440a403fSchristos   unsigned int no_export : 1;
6608440a403fSchristos 
6609440a403fSchristos   /* Remember when output has begun, to stop strange things
6610440a403fSchristos      from happening.  */
6611440a403fSchristos   unsigned int output_has_begun : 1;
6612440a403fSchristos 
6613440a403fSchristos   /* Have archive map.  */
6614440a403fSchristos   unsigned int has_armap : 1;
6615440a403fSchristos 
6616440a403fSchristos   /* Set if this is a thin archive.  */
6617440a403fSchristos   unsigned int is_thin_archive : 1;
6618440a403fSchristos 
6619*b88e3e88Schristos   /* Set if this archive should not cache element positions.  */
6620*b88e3e88Schristos   unsigned int no_element_cache : 1;
6621*b88e3e88Schristos 
6622440a403fSchristos   /* Set if only required symbols should be added in the link hash table for
6623440a403fSchristos      this object.  Used by VMS linkers.  */
6624440a403fSchristos   unsigned int selective_search : 1;
6625440a403fSchristos 
6626440a403fSchristos   /* Set if this is the linker output BFD.  */
6627440a403fSchristos   unsigned int is_linker_output : 1;
6628440a403fSchristos 
6629440a403fSchristos   /* Set if this is the linker input BFD.  */
6630440a403fSchristos   unsigned int is_linker_input : 1;
6631440a403fSchristos 
6632440a403fSchristos   /* If this is an input for a compiler plug-in library.  */
6633440a403fSchristos   ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
6634440a403fSchristos 
6635440a403fSchristos   /* Set if this is a plugin output file.  */
6636440a403fSchristos   unsigned int lto_output : 1;
6637440a403fSchristos 
6638*b88e3e88Schristos   /* Set if this is a slim LTO object not loaded with a compiler plugin.  */
6639*b88e3e88Schristos   unsigned int lto_slim_object : 1;
6640*b88e3e88Schristos 
6641440a403fSchristos   /* Set to dummy BFD created when claimed by a compiler plug-in
6642440a403fSchristos      library.  */
6643440a403fSchristos   bfd *plugin_dummy_bfd;
6644440a403fSchristos 
6645440a403fSchristos   /* Currently my_archive is tested before adding origin to
6646440a403fSchristos      anything. I believe that this can become always an add of
6647440a403fSchristos      origin, with origin set to 0 for non archive files.  */
6648440a403fSchristos   ufile_ptr origin;
6649440a403fSchristos 
6650440a403fSchristos   /* The origin in the archive of the proxy entry.  This will
6651440a403fSchristos      normally be the same as origin, except for thin archives,
6652440a403fSchristos      when it will contain the current offset of the proxy in the
6653440a403fSchristos      thin archive rather than the offset of the bfd in its actual
6654440a403fSchristos      container.  */
6655440a403fSchristos   ufile_ptr proxy_origin;
6656440a403fSchristos 
6657440a403fSchristos   /* A hash table for section names.  */
6658440a403fSchristos   struct bfd_hash_table section_htab;
6659440a403fSchristos 
6660440a403fSchristos   /* Pointer to linked list of sections.  */
6661440a403fSchristos   struct bfd_section *sections;
6662440a403fSchristos 
6663440a403fSchristos   /* The last section on the section list.  */
6664440a403fSchristos   struct bfd_section *section_last;
6665440a403fSchristos 
6666440a403fSchristos   /* The number of sections.  */
6667440a403fSchristos   unsigned int section_count;
6668440a403fSchristos 
6669440a403fSchristos   /* A field used by _bfd_generic_link_add_archive_symbols.  This will
6670440a403fSchristos      be used only for archive elements.  */
6671440a403fSchristos   int archive_pass;
6672440a403fSchristos 
6673440a403fSchristos   /* Stuff only useful for object files:
6674440a403fSchristos      The start address.  */
6675440a403fSchristos   bfd_vma start_address;
6676440a403fSchristos 
6677440a403fSchristos   /* Symbol table for output BFD (with symcount entries).
6678440a403fSchristos      Also used by the linker to cache input BFD symbols.  */
6679440a403fSchristos   struct bfd_symbol  **outsymbols;
6680440a403fSchristos 
6681440a403fSchristos   /* Used for input and output.  */
6682440a403fSchristos   unsigned int symcount;
6683440a403fSchristos 
6684440a403fSchristos   /* Used for slurped dynamic symbol tables.  */
6685440a403fSchristos   unsigned int dynsymcount;
6686440a403fSchristos 
6687440a403fSchristos   /* Pointer to structure which contains architecture information.  */
6688440a403fSchristos   const struct bfd_arch_info *arch_info;
6689440a403fSchristos 
6690440a403fSchristos   /* Stuff only useful for archives.  */
6691440a403fSchristos   void *arelt_data;
6692440a403fSchristos   struct bfd *my_archive;      /* The containing archive BFD.  */
6693440a403fSchristos   struct bfd *archive_next;    /* The next BFD in the archive.  */
6694440a403fSchristos   struct bfd *archive_head;    /* The first BFD in the archive.  */
6695440a403fSchristos   struct bfd *nested_archives; /* List of nested archive in a flattened
6696440a403fSchristos                                   thin archive.  */
6697440a403fSchristos 
6698440a403fSchristos   union {
6699440a403fSchristos     /* For input BFDs, a chain of BFDs involved in a link.  */
6700440a403fSchristos     struct bfd *next;
6701440a403fSchristos     /* For output BFD, the linker hash table.  */
6702440a403fSchristos     struct bfd_link_hash_table *hash;
6703440a403fSchristos   } link;
6704440a403fSchristos 
6705440a403fSchristos   /* Used by the back end to hold private data.  */
6706440a403fSchristos   union
6707440a403fSchristos     {
6708440a403fSchristos       struct aout_data_struct *aout_data;
6709440a403fSchristos       struct artdata *aout_ar_data;
6710440a403fSchristos       struct coff_tdata *coff_obj_data;
6711440a403fSchristos       struct pe_tdata *pe_obj_data;
6712440a403fSchristos       struct xcoff_tdata *xcoff_obj_data;
6713440a403fSchristos       struct ecoff_tdata *ecoff_obj_data;
6714440a403fSchristos       struct srec_data_struct *srec_data;
6715440a403fSchristos       struct verilog_data_struct *verilog_data;
6716440a403fSchristos       struct ihex_data_struct *ihex_data;
6717440a403fSchristos       struct tekhex_data_struct *tekhex_data;
6718440a403fSchristos       struct elf_obj_tdata *elf_obj_data;
6719440a403fSchristos       struct mmo_data_struct *mmo_data;
6720440a403fSchristos       struct sun_core_struct *sun_core_data;
6721440a403fSchristos       struct sco5_core_struct *sco5_core_data;
6722440a403fSchristos       struct trad_core_struct *trad_core_data;
6723440a403fSchristos       struct som_data_struct *som_data;
6724440a403fSchristos       struct hpux_core_struct *hpux_core_data;
6725440a403fSchristos       struct hppabsd_core_struct *hppabsd_core_data;
6726440a403fSchristos       struct sgi_core_struct *sgi_core_data;
6727440a403fSchristos       struct lynx_core_struct *lynx_core_data;
6728440a403fSchristos       struct osf_core_struct *osf_core_data;
6729440a403fSchristos       struct cisco_core_struct *cisco_core_data;
6730440a403fSchristos       struct versados_data_struct *versados_data;
6731440a403fSchristos       struct netbsd_core_struct *netbsd_core_data;
6732440a403fSchristos       struct mach_o_data_struct *mach_o_data;
6733440a403fSchristos       struct mach_o_fat_data_struct *mach_o_fat_data;
6734440a403fSchristos       struct plugin_data_struct *plugin_data;
6735440a403fSchristos       struct bfd_pef_data_struct *pef_data;
6736440a403fSchristos       struct bfd_pef_xlib_data_struct *pef_xlib_data;
6737440a403fSchristos       struct bfd_sym_data_struct *sym_data;
6738440a403fSchristos       void *any;
6739440a403fSchristos     }
6740440a403fSchristos   tdata;
6741440a403fSchristos 
6742440a403fSchristos   /* Used by the application to hold private data.  */
6743440a403fSchristos   void *usrdata;
6744440a403fSchristos 
6745440a403fSchristos   /* Where all the allocated stuff under this BFD goes.  This is a
6746440a403fSchristos      struct objalloc *, but we use void * to avoid requiring the inclusion
6747440a403fSchristos      of objalloc.h.  */
6748440a403fSchristos   void *memory;
6749440a403fSchristos 
6750440a403fSchristos   /* For input BFDs, the build ID, if the object has one. */
6751440a403fSchristos   const struct bfd_build_id *build_id;
6752440a403fSchristos };
6753440a403fSchristos 
6754*b88e3e88Schristos static inline const char *
bfd_get_filename(const bfd * abfd)6755*b88e3e88Schristos bfd_get_filename (const bfd *abfd)
6756*b88e3e88Schristos {
6757*b88e3e88Schristos   return abfd->filename;
6758*b88e3e88Schristos }
6759*b88e3e88Schristos 
6760*b88e3e88Schristos static inline bfd_boolean
bfd_get_cacheable(const bfd * abfd)6761*b88e3e88Schristos bfd_get_cacheable (const bfd *abfd)
6762*b88e3e88Schristos {
6763*b88e3e88Schristos   return abfd->cacheable;
6764*b88e3e88Schristos }
6765*b88e3e88Schristos 
6766*b88e3e88Schristos static inline enum bfd_format
bfd_get_format(const bfd * abfd)6767*b88e3e88Schristos bfd_get_format (const bfd *abfd)
6768*b88e3e88Schristos {
6769*b88e3e88Schristos   return abfd->format;
6770*b88e3e88Schristos }
6771*b88e3e88Schristos 
6772*b88e3e88Schristos static inline flagword
bfd_get_file_flags(const bfd * abfd)6773*b88e3e88Schristos bfd_get_file_flags (const bfd *abfd)
6774*b88e3e88Schristos {
6775*b88e3e88Schristos   return abfd->flags;
6776*b88e3e88Schristos }
6777*b88e3e88Schristos 
6778*b88e3e88Schristos static inline bfd_vma
bfd_get_start_address(const bfd * abfd)6779*b88e3e88Schristos bfd_get_start_address (const bfd *abfd)
6780*b88e3e88Schristos {
6781*b88e3e88Schristos   return abfd->start_address;
6782*b88e3e88Schristos }
6783*b88e3e88Schristos 
6784*b88e3e88Schristos static inline unsigned int
bfd_get_symcount(const bfd * abfd)6785*b88e3e88Schristos bfd_get_symcount (const bfd *abfd)
6786*b88e3e88Schristos {
6787*b88e3e88Schristos   return abfd->symcount;
6788*b88e3e88Schristos }
6789*b88e3e88Schristos 
6790*b88e3e88Schristos static inline unsigned int
bfd_get_dynamic_symcount(const bfd * abfd)6791*b88e3e88Schristos bfd_get_dynamic_symcount (const bfd *abfd)
6792*b88e3e88Schristos {
6793*b88e3e88Schristos   return abfd->dynsymcount;
6794*b88e3e88Schristos }
6795*b88e3e88Schristos 
6796*b88e3e88Schristos static inline struct bfd_symbol **
bfd_get_outsymbols(const bfd * abfd)6797*b88e3e88Schristos bfd_get_outsymbols (const bfd *abfd)
6798*b88e3e88Schristos {
6799*b88e3e88Schristos   return abfd->outsymbols;
6800*b88e3e88Schristos }
6801*b88e3e88Schristos 
6802*b88e3e88Schristos static inline unsigned int
bfd_count_sections(const bfd * abfd)6803*b88e3e88Schristos bfd_count_sections (const bfd *abfd)
6804*b88e3e88Schristos {
6805*b88e3e88Schristos   return abfd->section_count;
6806*b88e3e88Schristos }
6807*b88e3e88Schristos 
6808*b88e3e88Schristos static inline bfd_boolean
bfd_has_map(const bfd * abfd)6809*b88e3e88Schristos bfd_has_map (const bfd *abfd)
6810*b88e3e88Schristos {
6811*b88e3e88Schristos   return abfd->has_armap;
6812*b88e3e88Schristos }
6813*b88e3e88Schristos 
6814*b88e3e88Schristos static inline bfd_boolean
bfd_is_thin_archive(const bfd * abfd)6815*b88e3e88Schristos bfd_is_thin_archive (const bfd *abfd)
6816*b88e3e88Schristos {
6817*b88e3e88Schristos   return abfd->is_thin_archive;
6818*b88e3e88Schristos }
6819*b88e3e88Schristos 
6820*b88e3e88Schristos static inline void *
bfd_usrdata(const bfd * abfd)6821*b88e3e88Schristos bfd_usrdata (const bfd *abfd)
6822*b88e3e88Schristos {
6823*b88e3e88Schristos   return abfd->usrdata;
6824*b88e3e88Schristos }
6825*b88e3e88Schristos 
6826440a403fSchristos /* See note beside bfd_set_section_userdata.  */
6827440a403fSchristos static inline bfd_boolean
bfd_set_cacheable(bfd * abfd,bfd_boolean val)6828440a403fSchristos bfd_set_cacheable (bfd * abfd, bfd_boolean val)
6829440a403fSchristos {
6830440a403fSchristos   abfd->cacheable = val;
6831440a403fSchristos   return TRUE;
6832440a403fSchristos }
6833440a403fSchristos 
6834*b88e3e88Schristos static inline void
bfd_set_thin_archive(bfd * abfd,bfd_boolean val)6835*b88e3e88Schristos bfd_set_thin_archive (bfd *abfd, bfd_boolean val)
6836*b88e3e88Schristos {
6837*b88e3e88Schristos   abfd->is_thin_archive = val;
6838*b88e3e88Schristos }
6839*b88e3e88Schristos 
6840*b88e3e88Schristos static inline void
bfd_set_usrdata(bfd * abfd,void * val)6841*b88e3e88Schristos bfd_set_usrdata (bfd *abfd, void *val)
6842*b88e3e88Schristos {
6843*b88e3e88Schristos   abfd->usrdata = val;
6844*b88e3e88Schristos }
6845*b88e3e88Schristos 
6846*b88e3e88Schristos static inline asection *
bfd_asymbol_section(const asymbol * sy)6847*b88e3e88Schristos bfd_asymbol_section (const asymbol *sy)
6848*b88e3e88Schristos {
6849*b88e3e88Schristos   return sy->section;
6850*b88e3e88Schristos }
6851*b88e3e88Schristos 
6852*b88e3e88Schristos static inline bfd_vma
bfd_asymbol_value(const asymbol * sy)6853*b88e3e88Schristos bfd_asymbol_value (const asymbol *sy)
6854*b88e3e88Schristos {
6855*b88e3e88Schristos   return sy->section->vma + sy->value;
6856*b88e3e88Schristos }
6857*b88e3e88Schristos 
6858*b88e3e88Schristos static inline const char *
bfd_asymbol_name(const asymbol * sy)6859*b88e3e88Schristos bfd_asymbol_name (const asymbol *sy)
6860*b88e3e88Schristos {
6861*b88e3e88Schristos   return sy->name;
6862*b88e3e88Schristos }
6863*b88e3e88Schristos 
6864*b88e3e88Schristos static inline struct bfd *
bfd_asymbol_bfd(const asymbol * sy)6865*b88e3e88Schristos bfd_asymbol_bfd (const asymbol *sy)
6866*b88e3e88Schristos {
6867*b88e3e88Schristos   return sy->the_bfd;
6868*b88e3e88Schristos }
6869*b88e3e88Schristos 
6870*b88e3e88Schristos static inline void
bfd_set_asymbol_name(asymbol * sy,const char * name)6871*b88e3e88Schristos bfd_set_asymbol_name (asymbol *sy, const char *name)
6872*b88e3e88Schristos {
6873*b88e3e88Schristos   sy->name = name;
6874*b88e3e88Schristos }
6875*b88e3e88Schristos 
6876*b88e3e88Schristos static inline bfd_size_type
bfd_get_section_limit_octets(const bfd * abfd,const asection * sec)6877*b88e3e88Schristos bfd_get_section_limit_octets (const bfd *abfd, const asection *sec)
6878*b88e3e88Schristos {
6879*b88e3e88Schristos   if (abfd->direction != write_direction && sec->rawsize != 0)
6880*b88e3e88Schristos     return sec->rawsize;
6881*b88e3e88Schristos   return sec->size;
6882*b88e3e88Schristos }
6883*b88e3e88Schristos 
6884*b88e3e88Schristos /* Find the address one past the end of SEC.  */
6885*b88e3e88Schristos static inline bfd_size_type
bfd_get_section_limit(const bfd * abfd,const asection * sec)6886*b88e3e88Schristos bfd_get_section_limit (const bfd *abfd, const asection *sec)
6887*b88e3e88Schristos {
6888*b88e3e88Schristos   return (bfd_get_section_limit_octets (abfd, sec)
6889*b88e3e88Schristos           / bfd_octets_per_byte (abfd, sec));
6890*b88e3e88Schristos }
6891*b88e3e88Schristos 
6892*b88e3e88Schristos /* Functions to handle insertion and deletion of a bfd's sections.  These
6893*b88e3e88Schristos    only handle the list pointers, ie. do not adjust section_count,
6894*b88e3e88Schristos    target_index etc.  */
6895*b88e3e88Schristos static inline void
bfd_section_list_remove(bfd * abfd,asection * s)6896*b88e3e88Schristos bfd_section_list_remove (bfd *abfd, asection *s)
6897*b88e3e88Schristos {
6898*b88e3e88Schristos   asection *next = s->next;
6899*b88e3e88Schristos   asection *prev = s->prev;
6900*b88e3e88Schristos   if (prev)
6901*b88e3e88Schristos     prev->next = next;
6902*b88e3e88Schristos   else
6903*b88e3e88Schristos     abfd->sections = next;
6904*b88e3e88Schristos   if (next)
6905*b88e3e88Schristos     next->prev = prev;
6906*b88e3e88Schristos   else
6907*b88e3e88Schristos     abfd->section_last = prev;
6908*b88e3e88Schristos }
6909*b88e3e88Schristos 
6910*b88e3e88Schristos static inline void
bfd_section_list_append(bfd * abfd,asection * s)6911*b88e3e88Schristos bfd_section_list_append (bfd *abfd, asection *s)
6912*b88e3e88Schristos {
6913*b88e3e88Schristos   s->next = 0;
6914*b88e3e88Schristos   if (abfd->section_last)
6915*b88e3e88Schristos     {
6916*b88e3e88Schristos       s->prev = abfd->section_last;
6917*b88e3e88Schristos       abfd->section_last->next = s;
6918*b88e3e88Schristos     }
6919*b88e3e88Schristos   else
6920*b88e3e88Schristos     {
6921*b88e3e88Schristos       s->prev = 0;
6922*b88e3e88Schristos       abfd->sections = s;
6923*b88e3e88Schristos     }
6924*b88e3e88Schristos   abfd->section_last = s;
6925*b88e3e88Schristos }
6926*b88e3e88Schristos 
6927*b88e3e88Schristos static inline void
bfd_section_list_prepend(bfd * abfd,asection * s)6928*b88e3e88Schristos bfd_section_list_prepend (bfd *abfd, asection *s)
6929*b88e3e88Schristos {
6930*b88e3e88Schristos   s->prev = 0;
6931*b88e3e88Schristos   if (abfd->sections)
6932*b88e3e88Schristos     {
6933*b88e3e88Schristos       s->next = abfd->sections;
6934*b88e3e88Schristos       abfd->sections->prev = s;
6935*b88e3e88Schristos     }
6936*b88e3e88Schristos   else
6937*b88e3e88Schristos     {
6938*b88e3e88Schristos       s->next = 0;
6939*b88e3e88Schristos       abfd->section_last = s;
6940*b88e3e88Schristos     }
6941*b88e3e88Schristos   abfd->sections = s;
6942*b88e3e88Schristos }
6943*b88e3e88Schristos 
6944*b88e3e88Schristos static inline void
bfd_section_list_insert_after(bfd * abfd,asection * a,asection * s)6945*b88e3e88Schristos bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s)
6946*b88e3e88Schristos {
6947*b88e3e88Schristos   asection *next = a->next;
6948*b88e3e88Schristos   s->next = next;
6949*b88e3e88Schristos   s->prev = a;
6950*b88e3e88Schristos   a->next = s;
6951*b88e3e88Schristos   if (next)
6952*b88e3e88Schristos     next->prev = s;
6953*b88e3e88Schristos   else
6954*b88e3e88Schristos     abfd->section_last = s;
6955*b88e3e88Schristos }
6956*b88e3e88Schristos 
6957*b88e3e88Schristos static inline void
bfd_section_list_insert_before(bfd * abfd,asection * b,asection * s)6958*b88e3e88Schristos bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s)
6959*b88e3e88Schristos {
6960*b88e3e88Schristos   asection *prev = b->prev;
6961*b88e3e88Schristos   s->prev = prev;
6962*b88e3e88Schristos   s->next = b;
6963*b88e3e88Schristos   b->prev = s;
6964*b88e3e88Schristos   if (prev)
6965*b88e3e88Schristos     prev->next = s;
6966*b88e3e88Schristos   else
6967*b88e3e88Schristos     abfd->sections = s;
6968*b88e3e88Schristos }
6969*b88e3e88Schristos 
6970*b88e3e88Schristos static inline bfd_boolean
bfd_section_removed_from_list(const bfd * abfd,const asection * s)6971*b88e3e88Schristos bfd_section_removed_from_list (const bfd *abfd, const asection *s)
6972*b88e3e88Schristos {
6973*b88e3e88Schristos   return s->next ? s->next->prev != s : abfd->section_last != s;
6974*b88e3e88Schristos }
6975*b88e3e88Schristos 
6976440a403fSchristos 
6977440a403fSchristos typedef enum bfd_error
6978440a403fSchristos {
6979440a403fSchristos   bfd_error_no_error = 0,
6980440a403fSchristos   bfd_error_system_call,
6981440a403fSchristos   bfd_error_invalid_target,
6982440a403fSchristos   bfd_error_wrong_format,
6983440a403fSchristos   bfd_error_wrong_object_format,
6984440a403fSchristos   bfd_error_invalid_operation,
6985440a403fSchristos   bfd_error_no_memory,
6986440a403fSchristos   bfd_error_no_symbols,
6987440a403fSchristos   bfd_error_no_armap,
6988440a403fSchristos   bfd_error_no_more_archived_files,
6989440a403fSchristos   bfd_error_malformed_archive,
6990440a403fSchristos   bfd_error_missing_dso,
6991440a403fSchristos   bfd_error_file_not_recognized,
6992440a403fSchristos   bfd_error_file_ambiguously_recognized,
6993440a403fSchristos   bfd_error_no_contents,
6994440a403fSchristos   bfd_error_nonrepresentable_section,
6995440a403fSchristos   bfd_error_no_debug_section,
6996440a403fSchristos   bfd_error_bad_value,
6997440a403fSchristos   bfd_error_file_truncated,
6998440a403fSchristos   bfd_error_file_too_big,
6999*b88e3e88Schristos   bfd_error_sorry,
7000440a403fSchristos   bfd_error_on_input,
7001440a403fSchristos   bfd_error_invalid_error_code
7002440a403fSchristos }
7003440a403fSchristos bfd_error_type;
7004440a403fSchristos 
7005440a403fSchristos bfd_error_type bfd_get_error (void);
7006440a403fSchristos 
700706324dcfSchristos void bfd_set_error (bfd_error_type error_tag);
700806324dcfSchristos 
700906324dcfSchristos void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7010440a403fSchristos 
7011440a403fSchristos const char *bfd_errmsg (bfd_error_type error_tag);
7012440a403fSchristos 
7013440a403fSchristos void bfd_perror (const char *message);
7014440a403fSchristos 
7015440a403fSchristos 
701606324dcfSchristos typedef void (*bfd_error_handler_type) (const char *, va_list);
701706324dcfSchristos 
701806324dcfSchristos void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
7019440a403fSchristos 
7020440a403fSchristos bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7021440a403fSchristos 
7022440a403fSchristos void bfd_set_error_program_name (const char *);
7023440a403fSchristos 
7024440a403fSchristos 
7025440a403fSchristos typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7026440a403fSchristos                                          const char *bfd_version,
7027440a403fSchristos                                          const char *bfd_file,
7028440a403fSchristos                                          int bfd_line);
7029440a403fSchristos 
7030440a403fSchristos bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7031440a403fSchristos 
7032440a403fSchristos long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7033440a403fSchristos 
7034440a403fSchristos long bfd_canonicalize_reloc
7035440a403fSchristos    (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7036440a403fSchristos 
7037440a403fSchristos void bfd_set_reloc
7038440a403fSchristos    (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7039440a403fSchristos 
704006324dcfSchristos #define bfd_set_reloc(abfd, asect, location, count) \
704106324dcfSchristos        BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7042440a403fSchristos bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7043440a403fSchristos 
7044440a403fSchristos int bfd_get_arch_size (bfd *abfd);
7045440a403fSchristos 
7046440a403fSchristos int bfd_get_sign_extend_vma (bfd *abfd);
7047440a403fSchristos 
7048440a403fSchristos bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7049440a403fSchristos 
7050440a403fSchristos unsigned int bfd_get_gp_size (bfd *abfd);
7051440a403fSchristos 
7052440a403fSchristos void bfd_set_gp_size (bfd *abfd, unsigned int i);
7053440a403fSchristos 
7054440a403fSchristos bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7055440a403fSchristos 
7056440a403fSchristos bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7057440a403fSchristos 
7058440a403fSchristos #define bfd_copy_private_header_data(ibfd, obfd) \
7059440a403fSchristos        BFD_SEND (obfd, _bfd_copy_private_header_data, \
7060440a403fSchristos                  (ibfd, obfd))
7061440a403fSchristos bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7062440a403fSchristos 
7063440a403fSchristos #define bfd_copy_private_bfd_data(ibfd, obfd) \
7064440a403fSchristos        BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7065440a403fSchristos                  (ibfd, obfd))
7066440a403fSchristos bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7067440a403fSchristos 
7068440a403fSchristos #define bfd_set_private_flags(abfd, flags) \
7069440a403fSchristos        BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7070440a403fSchristos #define bfd_sizeof_headers(abfd, info) \
7071440a403fSchristos        BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7072440a403fSchristos 
7073440a403fSchristos #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7074440a403fSchristos        BFD_SEND (abfd, _bfd_find_nearest_line, \
7075440a403fSchristos                  (abfd, syms, sec, off, file, func, line, NULL))
7076440a403fSchristos 
7077440a403fSchristos #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7078440a403fSchristos                                            line, disc) \
7079440a403fSchristos        BFD_SEND (abfd, _bfd_find_nearest_line, \
7080440a403fSchristos                  (abfd, syms, sec, off, file, func, line, disc))
7081440a403fSchristos 
7082440a403fSchristos #define bfd_find_line(abfd, syms, sym, file, line) \
7083440a403fSchristos        BFD_SEND (abfd, _bfd_find_line, \
7084440a403fSchristos                  (abfd, syms, sym, file, line))
7085440a403fSchristos 
7086440a403fSchristos #define bfd_find_inliner_info(abfd, file, func, line) \
7087440a403fSchristos        BFD_SEND (abfd, _bfd_find_inliner_info, \
7088440a403fSchristos                  (abfd, file, func, line))
7089440a403fSchristos 
7090440a403fSchristos #define bfd_debug_info_start(abfd) \
7091440a403fSchristos        BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7092440a403fSchristos 
7093440a403fSchristos #define bfd_debug_info_end(abfd) \
7094440a403fSchristos        BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7095440a403fSchristos 
7096440a403fSchristos #define bfd_debug_info_accumulate(abfd, section) \
7097440a403fSchristos        BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7098440a403fSchristos 
7099440a403fSchristos #define bfd_stat_arch_elt(abfd, stat) \
7100440a403fSchristos        BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
7101440a403fSchristos 
7102440a403fSchristos #define bfd_update_armap_timestamp(abfd) \
7103440a403fSchristos        BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7104440a403fSchristos 
7105440a403fSchristos #define bfd_set_arch_mach(abfd, arch, mach)\
7106440a403fSchristos        BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7107440a403fSchristos 
7108440a403fSchristos #define bfd_relax_section(abfd, section, link_info, again) \
7109440a403fSchristos        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7110440a403fSchristos 
7111440a403fSchristos #define bfd_gc_sections(abfd, link_info) \
7112440a403fSchristos        BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7113440a403fSchristos 
7114440a403fSchristos #define bfd_lookup_section_flags(link_info, flag_info, section) \
7115440a403fSchristos        BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7116440a403fSchristos 
7117440a403fSchristos #define bfd_merge_sections(abfd, link_info) \
7118440a403fSchristos        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7119440a403fSchristos 
7120440a403fSchristos #define bfd_is_group_section(abfd, sec) \
7121440a403fSchristos        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7122440a403fSchristos 
7123*b88e3e88Schristos #define bfd_group_name(abfd, sec) \
7124*b88e3e88Schristos        BFD_SEND (abfd, _bfd_group_name, (abfd, sec))
7125*b88e3e88Schristos 
7126440a403fSchristos #define bfd_discard_group(abfd, sec) \
7127440a403fSchristos        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7128440a403fSchristos 
7129440a403fSchristos #define bfd_link_hash_table_create(abfd) \
7130440a403fSchristos        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7131440a403fSchristos 
7132440a403fSchristos #define bfd_link_add_symbols(abfd, info) \
7133440a403fSchristos        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7134440a403fSchristos 
7135440a403fSchristos #define bfd_link_just_syms(abfd, sec, info) \
7136440a403fSchristos        BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7137440a403fSchristos 
7138440a403fSchristos #define bfd_final_link(abfd, info) \
7139440a403fSchristos        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7140440a403fSchristos 
7141440a403fSchristos #define bfd_free_cached_info(abfd) \
7142440a403fSchristos        BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7143440a403fSchristos 
7144440a403fSchristos #define bfd_get_dynamic_symtab_upper_bound(abfd) \
7145440a403fSchristos        BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7146440a403fSchristos 
7147440a403fSchristos #define bfd_print_private_bfd_data(abfd, file)\
7148440a403fSchristos        BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7149440a403fSchristos 
7150440a403fSchristos #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7151440a403fSchristos        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7152440a403fSchristos 
7153440a403fSchristos #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7154440a403fSchristos        BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7155440a403fSchristos                                                    dyncount, dynsyms, ret))
7156440a403fSchristos 
7157440a403fSchristos #define bfd_get_dynamic_reloc_upper_bound(abfd) \
7158440a403fSchristos        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7159440a403fSchristos 
7160440a403fSchristos #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7161440a403fSchristos        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7162440a403fSchristos 
7163440a403fSchristos extern bfd_byte *bfd_get_relocated_section_contents
7164440a403fSchristos   (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7165440a403fSchristos    bfd_boolean, asymbol **);
7166440a403fSchristos 
7167440a403fSchristos bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7168440a403fSchristos 
7169440a403fSchristos bfd_vma bfd_emul_get_maxpagesize (const char *);
7170440a403fSchristos 
7171440a403fSchristos void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7172440a403fSchristos 
717306324dcfSchristos bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7174440a403fSchristos 
7175440a403fSchristos void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7176440a403fSchristos 
7177440a403fSchristos char *bfd_demangle (bfd *, const char *, int);
7178440a403fSchristos 
7179440a403fSchristos void bfd_update_compression_header
7180440a403fSchristos    (bfd *abfd, bfd_byte *contents, asection *sec);
7181440a403fSchristos 
7182440a403fSchristos bfd_boolean bfd_check_compression_header
7183440a403fSchristos    (bfd *abfd, bfd_byte *contents, asection *sec,
7184*b88e3e88Schristos     bfd_size_type *uncompressed_size,
7185*b88e3e88Schristos     unsigned int *uncompressed_alignment_power);
7186440a403fSchristos 
7187440a403fSchristos int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7188440a403fSchristos 
7189440a403fSchristos bfd_size_type bfd_convert_section_size
7190440a403fSchristos    (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7191440a403fSchristos 
7192440a403fSchristos bfd_boolean bfd_convert_section_contents
7193440a403fSchristos    (bfd *ibfd, asection *isec, bfd *obfd,
7194440a403fSchristos     bfd_byte **ptr, bfd_size_type *ptr_size);
7195440a403fSchristos 
7196440a403fSchristos /* Extracted from archive.c.  */
7197440a403fSchristos symindex bfd_get_next_mapent
7198440a403fSchristos    (bfd *abfd, symindex previous, carsym **sym);
7199440a403fSchristos 
7200440a403fSchristos bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7201440a403fSchristos 
7202440a403fSchristos bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7203440a403fSchristos 
7204440a403fSchristos /* Extracted from corefile.c.  */
7205440a403fSchristos const char *bfd_core_file_failing_command (bfd *abfd);
7206440a403fSchristos 
7207440a403fSchristos int bfd_core_file_failing_signal (bfd *abfd);
7208440a403fSchristos 
7209440a403fSchristos int bfd_core_file_pid (bfd *abfd);
7210440a403fSchristos 
7211440a403fSchristos bfd_boolean core_file_matches_executable_p
7212440a403fSchristos    (bfd *core_bfd, bfd *exec_bfd);
7213440a403fSchristos 
7214440a403fSchristos bfd_boolean generic_core_file_matches_executable_p
7215440a403fSchristos    (bfd *core_bfd, bfd *exec_bfd);
7216440a403fSchristos 
7217440a403fSchristos /* Extracted from targets.c.  */
7218440a403fSchristos #define BFD_SEND(bfd, message, arglist) \
7219440a403fSchristos   ((*((bfd)->xvec->message)) arglist)
7220440a403fSchristos 
7221440a403fSchristos #ifdef DEBUG_BFD_SEND
7222440a403fSchristos #undef BFD_SEND
7223440a403fSchristos #define BFD_SEND(bfd, message, arglist) \
7224440a403fSchristos   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7225440a403fSchristos     ((*((bfd)->xvec->message)) arglist) : \
7226440a403fSchristos     (bfd_assert (__FILE__,__LINE__), NULL))
7227440a403fSchristos #endif
7228440a403fSchristos #define BFD_SEND_FMT(bfd, message, arglist) \
7229440a403fSchristos   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7230440a403fSchristos 
7231440a403fSchristos #ifdef DEBUG_BFD_SEND
7232440a403fSchristos #undef BFD_SEND_FMT
7233440a403fSchristos #define BFD_SEND_FMT(bfd, message, arglist) \
7234440a403fSchristos   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7235440a403fSchristos    (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7236440a403fSchristos    (bfd_assert (__FILE__,__LINE__), NULL))
7237440a403fSchristos #endif
7238440a403fSchristos 
7239440a403fSchristos enum bfd_flavour
7240440a403fSchristos {
7241440a403fSchristos   /* N.B. Update bfd_flavour_name if you change this.  */
7242440a403fSchristos   bfd_target_unknown_flavour,
7243440a403fSchristos   bfd_target_aout_flavour,
7244440a403fSchristos   bfd_target_coff_flavour,
7245440a403fSchristos   bfd_target_ecoff_flavour,
7246440a403fSchristos   bfd_target_xcoff_flavour,
7247440a403fSchristos   bfd_target_elf_flavour,
7248440a403fSchristos   bfd_target_tekhex_flavour,
7249440a403fSchristos   bfd_target_srec_flavour,
7250440a403fSchristos   bfd_target_verilog_flavour,
7251440a403fSchristos   bfd_target_ihex_flavour,
7252440a403fSchristos   bfd_target_som_flavour,
7253440a403fSchristos   bfd_target_os9k_flavour,
7254440a403fSchristos   bfd_target_versados_flavour,
7255440a403fSchristos   bfd_target_msdos_flavour,
7256440a403fSchristos   bfd_target_ovax_flavour,
7257440a403fSchristos   bfd_target_evax_flavour,
7258440a403fSchristos   bfd_target_mmo_flavour,
7259440a403fSchristos   bfd_target_mach_o_flavour,
7260440a403fSchristos   bfd_target_pef_flavour,
7261440a403fSchristos   bfd_target_pef_xlib_flavour,
7262440a403fSchristos   bfd_target_sym_flavour
7263440a403fSchristos };
7264440a403fSchristos 
7265440a403fSchristos enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7266440a403fSchristos 
7267440a403fSchristos /* Forward declaration.  */
7268440a403fSchristos typedef struct bfd_link_info _bfd_link_info;
7269440a403fSchristos 
7270440a403fSchristos /* Forward declaration.  */
7271440a403fSchristos typedef struct flag_info flag_info;
7272440a403fSchristos 
7273440a403fSchristos typedef struct bfd_target
7274440a403fSchristos {
7275440a403fSchristos   /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
7276*b88e3e88Schristos   const char *name;
7277440a403fSchristos 
7278440a403fSchristos  /* The "flavour" of a back end is a general indication about
7279440a403fSchristos     the contents of a file.  */
7280440a403fSchristos   enum bfd_flavour flavour;
7281440a403fSchristos 
7282440a403fSchristos   /* The order of bytes within the data area of a file.  */
7283440a403fSchristos   enum bfd_endian byteorder;
7284440a403fSchristos 
7285440a403fSchristos  /* The order of bytes within the header parts of a file.  */
7286440a403fSchristos   enum bfd_endian header_byteorder;
7287440a403fSchristos 
7288440a403fSchristos   /* A mask of all the flags which an executable may have set -
7289440a403fSchristos      from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
7290440a403fSchristos   flagword object_flags;
7291440a403fSchristos 
7292440a403fSchristos  /* A mask of all the flags which a section may have set - from
7293440a403fSchristos     the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
7294440a403fSchristos   flagword section_flags;
7295440a403fSchristos 
7296440a403fSchristos  /* The character normally found at the front of a symbol.
7297440a403fSchristos     (if any), perhaps `_'.  */
7298440a403fSchristos   char symbol_leading_char;
7299440a403fSchristos 
7300440a403fSchristos  /* The pad character for file names within an archive header.  */
7301440a403fSchristos   char ar_pad_char;
7302440a403fSchristos 
7303440a403fSchristos   /* The maximum number of characters in an archive header.  */
7304440a403fSchristos   unsigned char ar_max_namelen;
7305440a403fSchristos 
7306440a403fSchristos   /* How well this target matches, used to select between various
7307440a403fSchristos      possible targets when more than one target matches.  */
7308440a403fSchristos   unsigned char match_priority;
7309440a403fSchristos 
7310440a403fSchristos   /* Entries for byte swapping for data. These are different from the
7311440a403fSchristos      other entry points, since they don't take a BFD as the first argument.
7312440a403fSchristos      Certain other handlers could do the same.  */
7313440a403fSchristos   bfd_uint64_t   (*bfd_getx64) (const void *);
7314440a403fSchristos   bfd_int64_t    (*bfd_getx_signed_64) (const void *);
7315440a403fSchristos   void           (*bfd_putx64) (bfd_uint64_t, void *);
7316440a403fSchristos   bfd_vma        (*bfd_getx32) (const void *);
7317440a403fSchristos   bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7318440a403fSchristos   void           (*bfd_putx32) (bfd_vma, void *);
7319440a403fSchristos   bfd_vma        (*bfd_getx16) (const void *);
7320440a403fSchristos   bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7321440a403fSchristos   void           (*bfd_putx16) (bfd_vma, void *);
7322440a403fSchristos 
7323440a403fSchristos   /* Byte swapping for the headers.  */
7324440a403fSchristos   bfd_uint64_t   (*bfd_h_getx64) (const void *);
7325440a403fSchristos   bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
7326440a403fSchristos   void           (*bfd_h_putx64) (bfd_uint64_t, void *);
7327440a403fSchristos   bfd_vma        (*bfd_h_getx32) (const void *);
7328440a403fSchristos   bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7329440a403fSchristos   void           (*bfd_h_putx32) (bfd_vma, void *);
7330440a403fSchristos   bfd_vma        (*bfd_h_getx16) (const void *);
7331440a403fSchristos   bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7332440a403fSchristos   void           (*bfd_h_putx16) (bfd_vma, void *);
7333440a403fSchristos 
7334440a403fSchristos   /* Format dependent routines: these are vectors of entry points
7335440a403fSchristos      within the target vector structure, one for each format to check.  */
7336440a403fSchristos 
7337440a403fSchristos   /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
733806324dcfSchristos   const struct bfd_target *
733906324dcfSchristos               (*_bfd_check_format[bfd_type_end]) (bfd *);
7340440a403fSchristos 
7341440a403fSchristos   /* Set the format of a file being written.  */
7342440a403fSchristos   bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7343440a403fSchristos 
7344440a403fSchristos   /* Write cached information into a file being written, at <<bfd_close>>.  */
7345440a403fSchristos   bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7346440a403fSchristos 
7347440a403fSchristos 
7348440a403fSchristos   /* Generic entry points.  */
7349440a403fSchristos #define BFD_JUMP_TABLE_GENERIC(NAME) \
7350440a403fSchristos   NAME##_close_and_cleanup, \
7351440a403fSchristos   NAME##_bfd_free_cached_info, \
7352440a403fSchristos   NAME##_new_section_hook, \
7353440a403fSchristos   NAME##_get_section_contents, \
7354440a403fSchristos   NAME##_get_section_contents_in_window
7355440a403fSchristos 
7356440a403fSchristos   /* Called when the BFD is being closed to do any necessary cleanup.  */
7357440a403fSchristos   bfd_boolean (*_close_and_cleanup) (bfd *);
7358440a403fSchristos   /* Ask the BFD to free all cached information.  */
7359440a403fSchristos   bfd_boolean (*_bfd_free_cached_info) (bfd *);
7360440a403fSchristos   /* Called when a new section is created.  */
7361440a403fSchristos   bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7362440a403fSchristos   /* Read the contents of a section.  */
736306324dcfSchristos   bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
736406324dcfSchristos                                             bfd_size_type);
736506324dcfSchristos   bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
736606324dcfSchristos                                                       bfd_window *, file_ptr,
736706324dcfSchristos                                                       bfd_size_type);
7368440a403fSchristos 
7369440a403fSchristos   /* Entry points to copy private data.  */
7370440a403fSchristos #define BFD_JUMP_TABLE_COPY(NAME) \
7371440a403fSchristos   NAME##_bfd_copy_private_bfd_data, \
7372440a403fSchristos   NAME##_bfd_merge_private_bfd_data, \
7373440a403fSchristos   _bfd_generic_init_private_section_data, \
7374440a403fSchristos   NAME##_bfd_copy_private_section_data, \
7375440a403fSchristos   NAME##_bfd_copy_private_symbol_data, \
7376440a403fSchristos   NAME##_bfd_copy_private_header_data, \
7377440a403fSchristos   NAME##_bfd_set_private_flags, \
7378440a403fSchristos   NAME##_bfd_print_private_bfd_data
7379440a403fSchristos 
7380440a403fSchristos   /* Called to copy BFD general private data from one object file
7381440a403fSchristos      to another.  */
7382440a403fSchristos   bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7383440a403fSchristos   /* Called to merge BFD general private data from one object file
7384440a403fSchristos      to a common output file when linking.  */
738506324dcfSchristos   bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7386440a403fSchristos   /* Called to initialize BFD private section data from one object file
7387440a403fSchristos      to another.  */
7388440a403fSchristos #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
738906324dcfSchristos        BFD_SEND (obfd, _bfd_init_private_section_data, \
739006324dcfSchristos                  (ibfd, isec, obfd, osec, link_info))
739106324dcfSchristos   bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
739206324dcfSchristos                                                  sec_ptr,
739306324dcfSchristos                                                  struct bfd_link_info *);
7394440a403fSchristos   /* Called to copy BFD private section data from one object file
7395440a403fSchristos      to another.  */
739606324dcfSchristos   bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
739706324dcfSchristos                                                  sec_ptr);
7398440a403fSchristos   /* Called to copy BFD private symbol data from one symbol
7399440a403fSchristos      to another.  */
740006324dcfSchristos   bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
740106324dcfSchristos                                                 asymbol *);
7402440a403fSchristos   /* Called to copy BFD private header data from one object file
7403440a403fSchristos      to another.  */
740406324dcfSchristos   bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7405440a403fSchristos   /* Called to set private backend flags.  */
7406440a403fSchristos   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7407440a403fSchristos 
7408440a403fSchristos   /* Called to print private BFD data.  */
7409440a403fSchristos   bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7410440a403fSchristos 
7411440a403fSchristos   /* Core file entry points.  */
7412440a403fSchristos #define BFD_JUMP_TABLE_CORE(NAME) \
7413440a403fSchristos   NAME##_core_file_failing_command, \
7414440a403fSchristos   NAME##_core_file_failing_signal, \
7415440a403fSchristos   NAME##_core_file_matches_executable_p, \
7416440a403fSchristos   NAME##_core_file_pid
7417440a403fSchristos 
7418440a403fSchristos   char *      (*_core_file_failing_command) (bfd *);
7419440a403fSchristos   int         (*_core_file_failing_signal) (bfd *);
7420440a403fSchristos   bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7421440a403fSchristos   int         (*_core_file_pid) (bfd *);
7422440a403fSchristos 
7423440a403fSchristos   /* Archive entry points.  */
7424440a403fSchristos #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7425440a403fSchristos   NAME##_slurp_armap, \
7426440a403fSchristos   NAME##_slurp_extended_name_table, \
7427440a403fSchristos   NAME##_construct_extended_name_table, \
7428440a403fSchristos   NAME##_truncate_arname, \
7429440a403fSchristos   NAME##_write_armap, \
7430440a403fSchristos   NAME##_read_ar_hdr, \
7431440a403fSchristos   NAME##_write_ar_hdr, \
7432440a403fSchristos   NAME##_openr_next_archived_file, \
7433440a403fSchristos   NAME##_get_elt_at_index, \
7434440a403fSchristos   NAME##_generic_stat_arch_elt, \
7435440a403fSchristos   NAME##_update_armap_timestamp
7436440a403fSchristos 
7437440a403fSchristos   bfd_boolean (*_bfd_slurp_armap) (bfd *);
7438440a403fSchristos   bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
743906324dcfSchristos   bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
744006324dcfSchristos                                                      bfd_size_type *,
744106324dcfSchristos                                                      const char **);
7442440a403fSchristos   void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
744306324dcfSchristos   bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
744406324dcfSchristos                               unsigned int, int);
7445440a403fSchristos   void *      (*_bfd_read_ar_hdr_fn) (bfd *);
7446440a403fSchristos   bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7447440a403fSchristos   bfd *       (*openr_next_archived_file) (bfd *, bfd *);
744806324dcfSchristos #define bfd_get_elt_at_index(b,i) \
744906324dcfSchristos        BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7450440a403fSchristos   bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
7451440a403fSchristos   int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7452440a403fSchristos   bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7453440a403fSchristos 
7454440a403fSchristos   /* Entry points used for symbols.  */
7455440a403fSchristos #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7456440a403fSchristos   NAME##_get_symtab_upper_bound, \
7457440a403fSchristos   NAME##_canonicalize_symtab, \
7458440a403fSchristos   NAME##_make_empty_symbol, \
7459440a403fSchristos   NAME##_print_symbol, \
7460440a403fSchristos   NAME##_get_symbol_info, \
7461440a403fSchristos   NAME##_get_symbol_version_string, \
7462440a403fSchristos   NAME##_bfd_is_local_label_name, \
7463440a403fSchristos   NAME##_bfd_is_target_special_symbol, \
7464440a403fSchristos   NAME##_get_lineno, \
7465440a403fSchristos   NAME##_find_nearest_line, \
7466440a403fSchristos   NAME##_find_line, \
7467440a403fSchristos   NAME##_find_inliner_info, \
7468440a403fSchristos   NAME##_bfd_make_debug_symbol, \
7469440a403fSchristos   NAME##_read_minisymbols, \
7470440a403fSchristos   NAME##_minisymbol_to_symbol
7471440a403fSchristos 
7472440a403fSchristos   long        (*_bfd_get_symtab_upper_bound) (bfd *);
747306324dcfSchristos   long        (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7474440a403fSchristos   struct bfd_symbol *
7475440a403fSchristos               (*_bfd_make_empty_symbol) (bfd *);
747606324dcfSchristos   void        (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
747706324dcfSchristos                                     bfd_print_symbol_type);
747806324dcfSchristos #define bfd_print_symbol(b,p,s,e) \
747906324dcfSchristos        BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
748006324dcfSchristos   void        (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
748106324dcfSchristos                                        symbol_info *);
748206324dcfSchristos #define bfd_get_symbol_info(b,p,e) \
748306324dcfSchristos        BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
748406324dcfSchristos   const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
748506324dcfSchristos                                                  bfd_boolean *);
748606324dcfSchristos #define bfd_get_symbol_version_string(b,s,h) \
748706324dcfSchristos        BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
7488440a403fSchristos   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7489440a403fSchristos   bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7490440a403fSchristos   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
749106324dcfSchristos   bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
749206324dcfSchristos                                          struct bfd_section *, bfd_vma,
749306324dcfSchristos                                          const char **, const char **,
749406324dcfSchristos                                          unsigned int *, unsigned int *);
749506324dcfSchristos   bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
749606324dcfSchristos                                  struct bfd_symbol *, const char **,
749706324dcfSchristos                                  unsigned int *);
7498440a403fSchristos   bfd_boolean (*_bfd_find_inliner_info)
7499440a403fSchristos     (bfd *, const char **, const char **, unsigned int *);
7500440a403fSchristos  /* Back-door to allow format-aware applications to create debug symbols
7501440a403fSchristos     while using BFD for everything else.  Currently used by the assembler
7502440a403fSchristos     when creating COFF files.  */
750306324dcfSchristos   asymbol *   (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7504440a403fSchristos #define bfd_read_minisymbols(b, d, m, s) \
7505440a403fSchristos        BFD_SEND (b, _read_minisymbols, (b, d, m, s))
750606324dcfSchristos   long        (*_read_minisymbols) (bfd *, bfd_boolean, void **,
750706324dcfSchristos                                     unsigned int *);
7508440a403fSchristos #define bfd_minisymbol_to_symbol(b, d, m, f) \
7509440a403fSchristos        BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
751006324dcfSchristos   asymbol *   (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
751106324dcfSchristos                                         asymbol *);
7512440a403fSchristos 
7513440a403fSchristos   /* Routines for relocs.  */
7514440a403fSchristos #define BFD_JUMP_TABLE_RELOCS(NAME) \
7515440a403fSchristos   NAME##_get_reloc_upper_bound, \
7516440a403fSchristos   NAME##_canonicalize_reloc, \
751706324dcfSchristos   NAME##_set_reloc, \
7518440a403fSchristos   NAME##_bfd_reloc_type_lookup, \
7519440a403fSchristos   NAME##_bfd_reloc_name_lookup
7520440a403fSchristos 
7521440a403fSchristos   long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
752206324dcfSchristos   long        (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
752306324dcfSchristos                                           struct bfd_symbol **);
752406324dcfSchristos   void        (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7525440a403fSchristos   /* See documentation on reloc types.  */
7526440a403fSchristos   reloc_howto_type *
7527440a403fSchristos               (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7528440a403fSchristos   reloc_howto_type *
7529440a403fSchristos               (*reloc_name_lookup) (bfd *, const char *);
7530440a403fSchristos 
7531440a403fSchristos   /* Routines used when writing an object file.  */
7532440a403fSchristos #define BFD_JUMP_TABLE_WRITE(NAME) \
7533440a403fSchristos   NAME##_set_arch_mach, \
7534440a403fSchristos   NAME##_set_section_contents
7535440a403fSchristos 
753606324dcfSchristos   bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
753706324dcfSchristos                                      unsigned long);
753806324dcfSchristos   bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
753906324dcfSchristos                                             file_ptr, bfd_size_type);
7540440a403fSchristos 
7541440a403fSchristos   /* Routines used by the linker.  */
7542440a403fSchristos #define BFD_JUMP_TABLE_LINK(NAME) \
7543440a403fSchristos   NAME##_sizeof_headers, \
7544440a403fSchristos   NAME##_bfd_get_relocated_section_contents, \
7545440a403fSchristos   NAME##_bfd_relax_section, \
7546440a403fSchristos   NAME##_bfd_link_hash_table_create, \
7547440a403fSchristos   NAME##_bfd_link_add_symbols, \
7548440a403fSchristos   NAME##_bfd_link_just_syms, \
7549440a403fSchristos   NAME##_bfd_copy_link_hash_symbol_type, \
7550440a403fSchristos   NAME##_bfd_final_link, \
7551440a403fSchristos   NAME##_bfd_link_split_section, \
7552440a403fSchristos   NAME##_bfd_link_check_relocs, \
7553440a403fSchristos   NAME##_bfd_gc_sections, \
7554440a403fSchristos   NAME##_bfd_lookup_section_flags, \
7555440a403fSchristos   NAME##_bfd_merge_sections, \
7556440a403fSchristos   NAME##_bfd_is_group_section, \
7557*b88e3e88Schristos   NAME##_bfd_group_name, \
7558440a403fSchristos   NAME##_bfd_discard_group, \
7559440a403fSchristos   NAME##_section_already_linked, \
756006324dcfSchristos   NAME##_bfd_define_common_symbol, \
756106324dcfSchristos   NAME##_bfd_link_hide_symbol, \
756206324dcfSchristos   NAME##_bfd_define_start_stop
7563440a403fSchristos 
7564440a403fSchristos   int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
756506324dcfSchristos   bfd_byte *  (*_bfd_get_relocated_section_contents) (bfd *,
756606324dcfSchristos                                                       struct bfd_link_info *,
756706324dcfSchristos                                                       struct bfd_link_order *,
756806324dcfSchristos                                                       bfd_byte *, bfd_boolean,
756906324dcfSchristos                                                       struct bfd_symbol **);
7570440a403fSchristos 
757106324dcfSchristos   bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
757206324dcfSchristos                                      struct bfd_link_info *, bfd_boolean *);
7573440a403fSchristos 
7574440a403fSchristos   /* Create a hash table for the linker.  Different backends store
7575440a403fSchristos      different information in this table.  */
7576440a403fSchristos   struct bfd_link_hash_table *
7577440a403fSchristos               (*_bfd_link_hash_table_create) (bfd *);
7578440a403fSchristos 
7579440a403fSchristos   /* Add symbols from this object file into the hash table.  */
7580440a403fSchristos   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7581440a403fSchristos 
7582440a403fSchristos   /* Indicate that we are only retrieving symbol values from this section.  */
7583440a403fSchristos   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7584440a403fSchristos 
7585440a403fSchristos   /* Copy the symbol type and other attributes for a linker script
7586440a403fSchristos      assignment of one symbol to another.  */
7587440a403fSchristos #define bfd_copy_link_hash_symbol_type(b, t, f) \
7588440a403fSchristos        BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
758906324dcfSchristos   void        (*_bfd_copy_link_hash_symbol_type) (bfd *,
759006324dcfSchristos                                                   struct bfd_link_hash_entry *,
759106324dcfSchristos                                                   struct bfd_link_hash_entry *);
7592440a403fSchristos 
7593440a403fSchristos   /* Do a link based on the link_order structures attached to each
7594440a403fSchristos      section of the BFD.  */
7595440a403fSchristos   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7596440a403fSchristos 
7597440a403fSchristos   /* Should this section be split up into smaller pieces during linking.  */
7598440a403fSchristos   bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7599440a403fSchristos 
7600440a403fSchristos   /* Check the relocations in the bfd for validity.  */
7601440a403fSchristos   bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7602440a403fSchristos 
7603440a403fSchristos   /* Remove sections that are not referenced from the output.  */
7604440a403fSchristos   bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7605440a403fSchristos 
7606440a403fSchristos   /* Sets the bitmask of allowed and disallowed section flags.  */
7607440a403fSchristos   bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
760806324dcfSchristos                                             struct flag_info *, asection *);
7609440a403fSchristos 
7610440a403fSchristos   /* Attempt to merge SEC_MERGE sections.  */
7611440a403fSchristos   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7612440a403fSchristos 
7613440a403fSchristos   /* Is this section a member of a group?  */
7614440a403fSchristos   bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7615440a403fSchristos 
7616*b88e3e88Schristos   /* The group name, if section is a member of a group.  */
7617*b88e3e88Schristos   const char *(*_bfd_group_name) (bfd *, const struct bfd_section *);
7618*b88e3e88Schristos 
7619440a403fSchristos   /* Discard members of a group.  */
7620440a403fSchristos   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7621440a403fSchristos 
7622440a403fSchristos   /* Check if SEC has been already linked during a reloceatable or
7623440a403fSchristos      final link.  */
7624440a403fSchristos   bfd_boolean (*_section_already_linked) (bfd *, asection *,
7625440a403fSchristos                                           struct bfd_link_info *);
7626440a403fSchristos 
7627440a403fSchristos   /* Define a common symbol.  */
7628440a403fSchristos   bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7629440a403fSchristos                                             struct bfd_link_hash_entry *);
7630440a403fSchristos 
763106324dcfSchristos   /* Hide a symbol.  */
763206324dcfSchristos   void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
763306324dcfSchristos                                  struct bfd_link_hash_entry *);
763406324dcfSchristos 
763506324dcfSchristos   /* Define a __start, __stop, .startof. or .sizeof. symbol.  */
763606324dcfSchristos   struct bfd_link_hash_entry *
763706324dcfSchristos               (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
763806324dcfSchristos                                          asection *);
763906324dcfSchristos 
7640440a403fSchristos   /* Routines to handle dynamic symbols and relocs.  */
7641440a403fSchristos #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7642440a403fSchristos   NAME##_get_dynamic_symtab_upper_bound, \
7643440a403fSchristos   NAME##_canonicalize_dynamic_symtab, \
7644440a403fSchristos   NAME##_get_synthetic_symtab, \
7645440a403fSchristos   NAME##_get_dynamic_reloc_upper_bound, \
7646440a403fSchristos   NAME##_canonicalize_dynamic_reloc
7647440a403fSchristos 
7648440a403fSchristos   /* Get the amount of memory required to hold the dynamic symbols.  */
7649440a403fSchristos   long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7650440a403fSchristos   /* Read in the dynamic symbols.  */
765106324dcfSchristos   long        (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7652440a403fSchristos   /* Create synthetized symbols.  */
765306324dcfSchristos   long        (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
765406324dcfSchristos                                             long, struct bfd_symbol **,
7655440a403fSchristos                                             struct bfd_symbol **);
7656440a403fSchristos   /* Get the amount of memory required to hold the dynamic relocs.  */
7657440a403fSchristos   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7658440a403fSchristos   /* Read in the dynamic relocs.  */
765906324dcfSchristos   long        (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
766006324dcfSchristos                                                   struct bfd_symbol **);
7661440a403fSchristos 
7662440a403fSchristos   /* Opposite endian version of this target.  */
7663440a403fSchristos   const struct bfd_target *alternative_target;
7664440a403fSchristos 
7665440a403fSchristos   /* Data for use by back-end routines, which isn't
7666440a403fSchristos      generic enough to belong in this structure.  */
7667440a403fSchristos   const void *backend_data;
7668440a403fSchristos 
7669440a403fSchristos } bfd_target;
7670440a403fSchristos 
7671*b88e3e88Schristos static inline const char *
bfd_get_target(const bfd * abfd)7672*b88e3e88Schristos bfd_get_target (const bfd *abfd)
7673*b88e3e88Schristos {
7674*b88e3e88Schristos   return abfd->xvec->name;
7675*b88e3e88Schristos }
7676*b88e3e88Schristos 
7677*b88e3e88Schristos static inline enum bfd_flavour
bfd_get_flavour(const bfd * abfd)7678*b88e3e88Schristos bfd_get_flavour (const bfd *abfd)
7679*b88e3e88Schristos {
7680*b88e3e88Schristos   return abfd->xvec->flavour;
7681*b88e3e88Schristos }
7682*b88e3e88Schristos 
7683*b88e3e88Schristos static inline flagword
bfd_applicable_file_flags(const bfd * abfd)7684*b88e3e88Schristos bfd_applicable_file_flags (const bfd *abfd)
7685*b88e3e88Schristos {
7686*b88e3e88Schristos   return abfd->xvec->object_flags;
7687*b88e3e88Schristos }
7688*b88e3e88Schristos 
7689*b88e3e88Schristos static inline bfd_boolean
bfd_family_coff(const bfd * abfd)7690*b88e3e88Schristos bfd_family_coff (const bfd *abfd)
7691*b88e3e88Schristos {
7692*b88e3e88Schristos   return (bfd_get_flavour (abfd) == bfd_target_coff_flavour
7693*b88e3e88Schristos           || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
7694*b88e3e88Schristos }
7695*b88e3e88Schristos 
7696*b88e3e88Schristos static inline bfd_boolean
bfd_big_endian(const bfd * abfd)7697*b88e3e88Schristos bfd_big_endian (const bfd *abfd)
7698*b88e3e88Schristos {
7699*b88e3e88Schristos   return abfd->xvec->byteorder == BFD_ENDIAN_BIG;
7700*b88e3e88Schristos }
7701*b88e3e88Schristos static inline bfd_boolean
bfd_little_endian(const bfd * abfd)7702*b88e3e88Schristos bfd_little_endian (const bfd *abfd)
7703*b88e3e88Schristos {
7704*b88e3e88Schristos   return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE;
7705*b88e3e88Schristos }
7706*b88e3e88Schristos 
7707*b88e3e88Schristos static inline bfd_boolean
bfd_header_big_endian(const bfd * abfd)7708*b88e3e88Schristos bfd_header_big_endian (const bfd *abfd)
7709*b88e3e88Schristos {
7710*b88e3e88Schristos   return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG;
7711*b88e3e88Schristos }
7712*b88e3e88Schristos 
7713*b88e3e88Schristos static inline bfd_boolean
bfd_header_little_endian(const bfd * abfd)7714*b88e3e88Schristos bfd_header_little_endian (const bfd *abfd)
7715*b88e3e88Schristos {
7716*b88e3e88Schristos   return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE;
7717*b88e3e88Schristos }
7718*b88e3e88Schristos 
7719*b88e3e88Schristos static inline flagword
bfd_applicable_section_flags(const bfd * abfd)7720*b88e3e88Schristos bfd_applicable_section_flags (const bfd *abfd)
7721*b88e3e88Schristos {
7722*b88e3e88Schristos   return abfd->xvec->section_flags;
7723*b88e3e88Schristos }
7724*b88e3e88Schristos 
7725*b88e3e88Schristos static inline char
bfd_get_symbol_leading_char(const bfd * abfd)7726*b88e3e88Schristos bfd_get_symbol_leading_char (const bfd *abfd)
7727*b88e3e88Schristos {
7728*b88e3e88Schristos   return abfd->xvec->symbol_leading_char;
7729*b88e3e88Schristos }
7730*b88e3e88Schristos 
7731*b88e3e88Schristos static inline enum bfd_flavour
bfd_asymbol_flavour(const asymbol * sy)7732*b88e3e88Schristos bfd_asymbol_flavour (const asymbol *sy)
7733*b88e3e88Schristos {
7734*b88e3e88Schristos   if ((sy->flags & BSF_SYNTHETIC) != 0)
7735*b88e3e88Schristos     return bfd_target_unknown_flavour;
7736*b88e3e88Schristos   return sy->the_bfd->xvec->flavour;
7737*b88e3e88Schristos }
7738*b88e3e88Schristos 
7739440a403fSchristos bfd_boolean bfd_set_default_target (const char *name);
7740440a403fSchristos 
7741440a403fSchristos const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7742440a403fSchristos 
7743440a403fSchristos const bfd_target *bfd_get_target_info (const char *target_name,
7744440a403fSchristos     bfd *abfd,
7745440a403fSchristos     bfd_boolean *is_bigendian,
7746440a403fSchristos     int *underscoring,
7747440a403fSchristos     const char **def_target_arch);
7748440a403fSchristos const char ** bfd_target_list (void);
7749440a403fSchristos 
775006324dcfSchristos const bfd_target *bfd_iterate_over_targets
775106324dcfSchristos    (int (*func) (const bfd_target *, void *),
775206324dcfSchristos     void *data);
7753440a403fSchristos 
7754440a403fSchristos const char *bfd_flavour_name (enum bfd_flavour flavour);
7755440a403fSchristos 
7756440a403fSchristos /* Extracted from format.c.  */
7757440a403fSchristos bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7758440a403fSchristos 
7759440a403fSchristos bfd_boolean bfd_check_format_matches
7760440a403fSchristos    (bfd *abfd, bfd_format format, char ***matching);
7761440a403fSchristos 
7762440a403fSchristos bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7763440a403fSchristos 
7764440a403fSchristos const char *bfd_format_string (bfd_format format);
7765440a403fSchristos 
7766440a403fSchristos /* Extracted from linker.c.  */
7767*b88e3e88Schristos /* Return TRUE if the symbol described by a linker hash entry H
7768*b88e3e88Schristos    is going to be absolute.  Linker-script defined symbols can be
7769*b88e3e88Schristos    converted from absolute to section-relative ones late in the
7770*b88e3e88Schristos    link.  Use this macro to correctly determine whether the symbol
7771*b88e3e88Schristos    will actually end up absolute in output.  */
7772*b88e3e88Schristos #define bfd_is_abs_symbol(H) \
7773*b88e3e88Schristos   (((H)->type == bfd_link_hash_defined \
7774*b88e3e88Schristos     || (H)->type == bfd_link_hash_defweak) \
7775*b88e3e88Schristos    && bfd_is_abs_section ((H)->u.def.section) \
7776*b88e3e88Schristos    && !(H)->rel_from_abs)
7777*b88e3e88Schristos 
7778440a403fSchristos bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7779440a403fSchristos 
7780440a403fSchristos #define bfd_link_split_section(abfd, sec) \
7781440a403fSchristos        BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7782440a403fSchristos 
7783440a403fSchristos bfd_boolean bfd_section_already_linked (bfd *abfd,
7784440a403fSchristos     asection *sec,
7785440a403fSchristos     struct bfd_link_info *info);
7786440a403fSchristos 
7787440a403fSchristos #define bfd_section_already_linked(abfd, sec, info) \
7788440a403fSchristos        BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7789440a403fSchristos 
7790440a403fSchristos bfd_boolean bfd_generic_define_common_symbol
7791440a403fSchristos    (bfd *output_bfd, struct bfd_link_info *info,
7792440a403fSchristos     struct bfd_link_hash_entry *h);
7793440a403fSchristos 
7794440a403fSchristos #define bfd_define_common_symbol(output_bfd, info, h) \
7795440a403fSchristos        BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7796440a403fSchristos 
779706324dcfSchristos void _bfd_generic_link_hide_symbol
779806324dcfSchristos    (bfd *output_bfd, struct bfd_link_info *info,
779906324dcfSchristos     struct bfd_link_hash_entry *h);
780006324dcfSchristos 
780106324dcfSchristos #define bfd_link_hide_symbol(output_bfd, info, h) \
780206324dcfSchristos        BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
780306324dcfSchristos 
780406324dcfSchristos struct bfd_link_hash_entry *bfd_generic_define_start_stop
780506324dcfSchristos    (struct bfd_link_info *info,
780606324dcfSchristos     const char *symbol, asection *sec);
780706324dcfSchristos 
780806324dcfSchristos #define bfd_define_start_stop(output_bfd, info, symbol, sec) \
780906324dcfSchristos        BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
781006324dcfSchristos 
7811440a403fSchristos struct bfd_elf_version_tree * bfd_find_version_for_sym
7812440a403fSchristos    (struct bfd_elf_version_tree *verdefs,
7813440a403fSchristos     const char *sym_name, bfd_boolean *hide);
7814440a403fSchristos 
7815440a403fSchristos bfd_boolean bfd_hide_sym_by_version
7816440a403fSchristos    (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7817440a403fSchristos 
7818440a403fSchristos bfd_boolean bfd_link_check_relocs
7819440a403fSchristos    (bfd *abfd, struct bfd_link_info *info);
7820440a403fSchristos 
7821440a403fSchristos bfd_boolean _bfd_generic_link_check_relocs
7822440a403fSchristos    (bfd *abfd, struct bfd_link_info *info);
7823440a403fSchristos 
782406324dcfSchristos bfd_boolean bfd_merge_private_bfd_data
782506324dcfSchristos    (bfd *ibfd, struct bfd_link_info *info);
782606324dcfSchristos 
782706324dcfSchristos #define bfd_merge_private_bfd_data(ibfd, info) \
782806324dcfSchristos        BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
782906324dcfSchristos                  (ibfd, info))
7830440a403fSchristos /* Extracted from simple.c.  */
7831440a403fSchristos bfd_byte *bfd_simple_get_relocated_section_contents
7832440a403fSchristos    (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
7833440a403fSchristos 
7834440a403fSchristos /* Extracted from compress.c.  */
7835440a403fSchristos bfd_boolean bfd_get_full_section_contents
7836440a403fSchristos    (bfd *abfd, asection *section, bfd_byte **ptr);
7837440a403fSchristos 
7838440a403fSchristos void bfd_cache_section_contents
7839440a403fSchristos    (asection *sec, void *contents);
7840440a403fSchristos 
7841440a403fSchristos bfd_boolean bfd_is_section_compressed_with_header
7842440a403fSchristos    (bfd *abfd, asection *section,
7843440a403fSchristos     int *compression_header_size_p,
7844*b88e3e88Schristos     bfd_size_type *uncompressed_size_p,
7845*b88e3e88Schristos     unsigned int *uncompressed_alignment_power_p);
7846440a403fSchristos 
7847440a403fSchristos bfd_boolean bfd_is_section_compressed
7848440a403fSchristos    (bfd *abfd, asection *section);
7849440a403fSchristos 
7850440a403fSchristos bfd_boolean bfd_init_section_decompress_status
7851440a403fSchristos    (bfd *abfd, asection *section);
7852440a403fSchristos 
7853440a403fSchristos bfd_boolean bfd_init_section_compress_status
7854440a403fSchristos    (bfd *abfd, asection *section);
7855440a403fSchristos 
7856440a403fSchristos bfd_boolean bfd_compress_section
7857440a403fSchristos    (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
7858440a403fSchristos 
7859440a403fSchristos #ifdef __cplusplus
7860440a403fSchristos }
7861440a403fSchristos #endif
7862440a403fSchristos #endif
7863