1c63b39d6Schristos /* This file is automatically generated.  DO NOT EDIT! */
2*fd82c4c4Schristos /* Generated from: NetBSD: mknative-gdb,v 1.12 2020/09/17 16:54:31 christos Exp  */
377cd98dfSchristos /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
4c63b39d6Schristos 
5c63b39d6Schristos /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
6c63b39d6Schristos    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
7c63b39d6Schristos    "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
8c63b39d6Schristos    "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
9c63b39d6Schristos    "linker.c", "simple.c" and "compress.c".
10c63b39d6Schristos    Run "make headers" in your build bfd/ to regenerate.  */
11c63b39d6Schristos 
12c63b39d6Schristos /* Main header file for the bfd library -- portable access to object files.
13c63b39d6Schristos 
14*fd82c4c4Schristos    Copyright (C) 1990-2020 Free Software Foundation, Inc.
15c63b39d6Schristos 
16c63b39d6Schristos    Contributed by Cygnus Support.
17c63b39d6Schristos 
18c63b39d6Schristos    This file is part of BFD, the Binary File Descriptor library.
19c63b39d6Schristos 
20c63b39d6Schristos    This program is free software; you can redistribute it and/or modify
21c63b39d6Schristos    it under the terms of the GNU General Public License as published by
22c63b39d6Schristos    the Free Software Foundation; either version 3 of the License, or
23c63b39d6Schristos    (at your option) any later version.
24c63b39d6Schristos 
25c63b39d6Schristos    This program is distributed in the hope that it will be useful,
26c63b39d6Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
27c63b39d6Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28c63b39d6Schristos    GNU General Public License for more details.
29c63b39d6Schristos 
30c63b39d6Schristos    You should have received a copy of the GNU General Public License
31c63b39d6Schristos    along with this program; if not, write to the Free Software
32c63b39d6Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
33c63b39d6Schristos 
34c63b39d6Schristos #ifndef __BFD_H_SEEN__
35c63b39d6Schristos #define __BFD_H_SEEN__
36c63b39d6Schristos 
37fdeb0babSchristos /* PR 14072: Ensure that config.h is included first.  */
38fdeb0babSchristos #if !defined PACKAGE && !defined PACKAGE_VERSION
39fdeb0babSchristos #error config.h must be included before this header
40fdeb0babSchristos #endif
41fdeb0babSchristos 
42c63b39d6Schristos #ifdef __cplusplus
43c63b39d6Schristos extern "C" {
44c63b39d6Schristos #endif
45c63b39d6Schristos 
46c63b39d6Schristos #include "ansidecl.h"
47c63b39d6Schristos #include "symcat.h"
4877cd98dfSchristos #include "bfd_stdint.h"
4977cd98dfSchristos #include "diagnostics.h"
509bc6a05dSchristos #include <stdarg.h>
51fdeb0babSchristos #include <sys/stat.h>
52fdeb0babSchristos 
53c63b39d6Schristos #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
54c63b39d6Schristos #ifndef SABER
55c63b39d6Schristos /* This hack is to avoid a problem with some strict ANSI C preprocessors.
56c63b39d6Schristos    The problem is, "32_" is not a valid preprocessing token, and we don't
57c63b39d6Schristos    want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
58c63b39d6Schristos    cause the inner CONCAT2 macros to be evaluated first, producing
59c63b39d6Schristos    still-valid pp-tokens.  Then the final concatenation can be done.  */
60c63b39d6Schristos #undef CONCAT4
61c63b39d6Schristos #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
62c63b39d6Schristos #endif
63c63b39d6Schristos #endif
64c63b39d6Schristos 
65c63b39d6Schristos /* This is a utility macro to handle the situation where the code
66c63b39d6Schristos    wants to place a constant string into the code, followed by a
67c63b39d6Schristos    comma and then the length of the string.  Doing this by hand
68c63b39d6Schristos    is error prone, so using this macro is safer.  */
69c63b39d6Schristos #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
70c63b39d6Schristos /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
71c63b39d6Schristos    to create the arguments to another macro, since the preprocessor
72c63b39d6Schristos    will mis-count the number of arguments to the outer macro (by not
73c63b39d6Schristos    evaluating STRING_COMMA_LEN and so missing the comma).  This is a
74c63b39d6Schristos    problem for example when trying to use STRING_COMMA_LEN to build
75c63b39d6Schristos    the arguments to the strncmp() macro.  Hence this alternative
76c63b39d6Schristos    definition of strncmp is provided here.
77c63b39d6Schristos 
78c63b39d6Schristos    Note - these macros do NOT work if STR2 is not a constant string.  */
79c63b39d6Schristos #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
80c63b39d6Schristos   /* strcpy() can have a similar problem, but since we know we are
81c63b39d6Schristos      copying a constant string, we can use memcpy which will be faster
82c63b39d6Schristos      since there is no need to check for a NUL byte inside STR.  We
83c63b39d6Schristos      can also save time if we do not need to copy the terminating NUL.  */
84c63b39d6Schristos #define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
85c63b39d6Schristos #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
86c63b39d6Schristos 
87c63b39d6Schristos 
88b511d482Schristos #define BFD_SUPPORTS_PLUGINS 1
89c63b39d6Schristos 
90c63b39d6Schristos /* The word size used by BFD on the host.  This may be 64 with a 32
91c63b39d6Schristos    bit target if the host is 64 bit, or if other 64 bit targets have
92c63b39d6Schristos    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
93c63b39d6Schristos #define BFD_ARCH_SIZE 32
94c63b39d6Schristos 
95c63b39d6Schristos /* The word size of the default bfd target.  */
96c63b39d6Schristos #define BFD_DEFAULT_TARGET_SIZE 32
97c63b39d6Schristos 
98c63b39d6Schristos #define BFD_HOST_64BIT_LONG 0
99c63b39d6Schristos #define BFD_HOST_64BIT_LONG_LONG 1
100c63b39d6Schristos #if 1
101c63b39d6Schristos #define BFD_HOST_64_BIT long long
102c63b39d6Schristos #define BFD_HOST_U_64_BIT unsigned long long
103c63b39d6Schristos typedef BFD_HOST_64_BIT bfd_int64_t;
104c63b39d6Schristos typedef BFD_HOST_U_64_BIT bfd_uint64_t;
105c63b39d6Schristos #endif
106c63b39d6Schristos 
10777cd98dfSchristos #ifdef HAVE_INTTYPES_H
10877cd98dfSchristos # include <inttypes.h>
10977cd98dfSchristos #else
11077cd98dfSchristos # if BFD_HOST_64BIT_LONG
11177cd98dfSchristos #  define BFD_PRI64 "l"
11277cd98dfSchristos # elif defined (__MSVCRT__)
11377cd98dfSchristos #  define BFD_PRI64 "I64"
11477cd98dfSchristos # else
11577cd98dfSchristos #  define BFD_PRI64 "ll"
11677cd98dfSchristos # endif
11777cd98dfSchristos # undef PRId64
11877cd98dfSchristos # define PRId64 BFD_PRI64 "d"
11977cd98dfSchristos # undef PRIu64
12077cd98dfSchristos # define PRIu64 BFD_PRI64 "u"
12177cd98dfSchristos # undef PRIx64
12277cd98dfSchristos # define PRIx64 BFD_PRI64 "x"
12377cd98dfSchristos #endif
12477cd98dfSchristos 
125c63b39d6Schristos #if BFD_ARCH_SIZE >= 64
126c63b39d6Schristos #define BFD64
127c63b39d6Schristos #endif
128c63b39d6Schristos 
129c63b39d6Schristos #ifndef INLINE
130c63b39d6Schristos #if __GNUC__ >= 2
131c63b39d6Schristos #define INLINE __inline__
132c63b39d6Schristos #else
133c63b39d6Schristos #define INLINE
134c63b39d6Schristos #endif
135c63b39d6Schristos #endif
136c63b39d6Schristos 
137c63b39d6Schristos /* Declaring a type wide enough to hold a host long and a host pointer.  */
138c63b39d6Schristos #define BFD_HOSTPTR_T unsigned long
139c63b39d6Schristos typedef BFD_HOSTPTR_T bfd_hostptr_t;
140c63b39d6Schristos 
141c63b39d6Schristos /* Forward declaration.  */
142c63b39d6Schristos typedef struct bfd bfd;
143c63b39d6Schristos 
144c63b39d6Schristos /* Boolean type used in bfd.  Too many systems define their own
145c63b39d6Schristos    versions of "boolean" for us to safely typedef a "boolean" of
146c63b39d6Schristos    our own.  Using an enum for "bfd_boolean" has its own set of
147c63b39d6Schristos    problems, with strange looking casts required to avoid warnings
148c63b39d6Schristos    on some older compilers.  Thus we just use an int.
149c63b39d6Schristos 
150c63b39d6Schristos    General rule: Functions which are bfd_boolean return TRUE on
151c63b39d6Schristos    success and FALSE on failure (unless they're a predicate).  */
152c63b39d6Schristos 
153c63b39d6Schristos typedef int bfd_boolean;
154c63b39d6Schristos #undef FALSE
155c63b39d6Schristos #undef TRUE
156c63b39d6Schristos #define FALSE 0
157c63b39d6Schristos #define TRUE 1
158c63b39d6Schristos 
159c63b39d6Schristos #ifdef BFD64
160c63b39d6Schristos 
161c63b39d6Schristos #ifndef BFD_HOST_64_BIT
162c63b39d6Schristos  #error No 64 bit integer type available
163c63b39d6Schristos #endif /* ! defined (BFD_HOST_64_BIT) */
164c63b39d6Schristos 
165c63b39d6Schristos typedef BFD_HOST_U_64_BIT bfd_vma;
166c63b39d6Schristos typedef BFD_HOST_64_BIT bfd_signed_vma;
167c63b39d6Schristos typedef BFD_HOST_U_64_BIT bfd_size_type;
168c63b39d6Schristos typedef BFD_HOST_U_64_BIT symvalue;
169c63b39d6Schristos 
170c63b39d6Schristos #if BFD_HOST_64BIT_LONG
171c63b39d6Schristos #define BFD_VMA_FMT "l"
172c63b39d6Schristos #elif defined (__MSVCRT__)
173c63b39d6Schristos #define BFD_VMA_FMT "I64"
174c63b39d6Schristos #else
175c63b39d6Schristos #define BFD_VMA_FMT "ll"
176c63b39d6Schristos #endif
177c63b39d6Schristos 
178c63b39d6Schristos #ifndef fprintf_vma
179c63b39d6Schristos #define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
180c63b39d6Schristos #define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
181c63b39d6Schristos #endif
182c63b39d6Schristos 
183c63b39d6Schristos #else /* not BFD64  */
184c63b39d6Schristos 
185c63b39d6Schristos /* Represent a target address.  Also used as a generic unsigned type
186c63b39d6Schristos    which is guaranteed to be big enough to hold any arithmetic types
187c63b39d6Schristos    we need to deal with.  */
188c63b39d6Schristos typedef unsigned long bfd_vma;
189c63b39d6Schristos 
190c63b39d6Schristos /* A generic signed type which is guaranteed to be big enough to hold any
191c63b39d6Schristos    arithmetic types we need to deal with.  Can be assumed to be compatible
192c63b39d6Schristos    with bfd_vma in the same way that signed and unsigned ints are compatible
193c63b39d6Schristos    (as parameters, in assignment, etc).  */
194c63b39d6Schristos typedef long bfd_signed_vma;
195c63b39d6Schristos 
196c63b39d6Schristos typedef unsigned long symvalue;
197c63b39d6Schristos typedef unsigned long bfd_size_type;
198c63b39d6Schristos 
199c63b39d6Schristos /* Print a bfd_vma x on stream s.  */
200c63b39d6Schristos #define BFD_VMA_FMT "l"
201c63b39d6Schristos #define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
202c63b39d6Schristos #define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
203c63b39d6Schristos 
204c63b39d6Schristos #endif /* not BFD64  */
205c63b39d6Schristos 
206c63b39d6Schristos #define HALF_BFD_SIZE_TYPE \
207c63b39d6Schristos   (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
208c63b39d6Schristos 
209c63b39d6Schristos #ifndef BFD_HOST_64_BIT
210c63b39d6Schristos /* Fall back on a 32 bit type.  The idea is to make these types always
211c63b39d6Schristos    available for function return types, but in the case that
212c63b39d6Schristos    BFD_HOST_64_BIT is undefined such a function should abort or
213c63b39d6Schristos    otherwise signal an error.  */
214c63b39d6Schristos typedef bfd_signed_vma bfd_int64_t;
215c63b39d6Schristos typedef bfd_vma bfd_uint64_t;
216c63b39d6Schristos #endif
217c63b39d6Schristos 
218c63b39d6Schristos /* An offset into a file.  BFD always uses the largest possible offset
219c63b39d6Schristos    based on the build time availability of fseek, fseeko, or fseeko64.  */
220c63b39d6Schristos typedef BFD_HOST_64_BIT file_ptr;
221c63b39d6Schristos typedef unsigned BFD_HOST_64_BIT ufile_ptr;
222c63b39d6Schristos 
223c63b39d6Schristos extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
224c63b39d6Schristos extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
225c63b39d6Schristos 
226c63b39d6Schristos #define printf_vma(x) fprintf_vma(stdout,x)
227c63b39d6Schristos #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
228c63b39d6Schristos 
229c63b39d6Schristos typedef unsigned int flagword;	/* 32 bits of flags */
230c63b39d6Schristos typedef unsigned char bfd_byte;
231c63b39d6Schristos 
232c63b39d6Schristos /* File formats.  */
233c63b39d6Schristos 
234c63b39d6Schristos typedef enum bfd_format
235c63b39d6Schristos {
236c63b39d6Schristos   bfd_unknown = 0,	/* File format is unknown.  */
237c63b39d6Schristos   bfd_object,		/* Linker/assembler/compiler output.  */
238c63b39d6Schristos   bfd_archive,		/* Object archive file.  */
239c63b39d6Schristos   bfd_core,		/* Core dump.  */
240c63b39d6Schristos   bfd_type_end		/* Marks the end; don't use it!  */
241c63b39d6Schristos }
242c63b39d6Schristos bfd_format;
243c63b39d6Schristos 
244c63b39d6Schristos /* Symbols and relocation.  */
245c63b39d6Schristos 
246c63b39d6Schristos /* A count of carsyms (canonical archive symbols).  */
247c63b39d6Schristos typedef unsigned long symindex;
248c63b39d6Schristos 
249c63b39d6Schristos #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
250c63b39d6Schristos 
251c63b39d6Schristos /* A canonical archive symbol.  */
252c63b39d6Schristos /* This is a type pun with struct ranlib on purpose!  */
253c63b39d6Schristos typedef struct carsym
254c63b39d6Schristos {
255*fd82c4c4Schristos   const char *name;
256c63b39d6Schristos   file_ptr file_offset;	/* Look here to find the file.  */
257c63b39d6Schristos }
258c63b39d6Schristos carsym;			/* To make these you call a carsymogen.  */
259c63b39d6Schristos 
260c63b39d6Schristos /* Used in generating armaps (archive tables of contents).
261c63b39d6Schristos    Perhaps just a forward definition would do?  */
262c63b39d6Schristos struct orl		/* Output ranlib.  */
263c63b39d6Schristos {
264c63b39d6Schristos   char **name;		/* Symbol name.  */
265c63b39d6Schristos   union
266c63b39d6Schristos   {
267c63b39d6Schristos     file_ptr pos;
268c63b39d6Schristos     bfd *abfd;
269c63b39d6Schristos   } u;			/* bfd* or file position.  */
270c63b39d6Schristos   int namidx;		/* Index into string table.  */
271c63b39d6Schristos };
272a636ddcaSmrg 
273c63b39d6Schristos /* Linenumber stuff.  */
274c63b39d6Schristos typedef struct lineno_cache_entry
275c63b39d6Schristos {
276c63b39d6Schristos   unsigned int line_number;	/* Linenumber from start of function.  */
277c63b39d6Schristos   union
278c63b39d6Schristos   {
279c63b39d6Schristos     struct bfd_symbol *sym;	/* Function name.  */
280c63b39d6Schristos     bfd_vma offset;		/* Offset into section.  */
281c63b39d6Schristos   } u;
282c63b39d6Schristos }
283c63b39d6Schristos alent;
284c63b39d6Schristos 
285c63b39d6Schristos /* Object and core file sections.  */
286a636ddcaSmrg typedef struct bfd_section *sec_ptr;
287c63b39d6Schristos 
288c63b39d6Schristos #define	align_power(addr, align)	\
289a636ddcaSmrg   (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
290c63b39d6Schristos 
291a636ddcaSmrg /* Align an address upward to a boundary, expressed as a number of bytes.
292a636ddcaSmrg    E.g. align to an 8-byte boundary with argument of 8.  Take care never
293a636ddcaSmrg    to wrap around if the address is within boundary-1 of the end of the
294a636ddcaSmrg    address space.  */
295a636ddcaSmrg #define BFD_ALIGN(this, boundary)					  \
296a636ddcaSmrg   ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this))		  \
297a636ddcaSmrg    ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
298a636ddcaSmrg    : ~ (bfd_vma) 0)
299c63b39d6Schristos 
300c63b39d6Schristos typedef enum bfd_print_symbol
301c63b39d6Schristos {
302c63b39d6Schristos   bfd_print_symbol_name,
303c63b39d6Schristos   bfd_print_symbol_more,
304c63b39d6Schristos   bfd_print_symbol_all
305c63b39d6Schristos } bfd_print_symbol_type;
306c63b39d6Schristos 
307c63b39d6Schristos /* Information about a symbol that nm needs.  */
308c63b39d6Schristos 
309c63b39d6Schristos typedef struct _symbol_info
310c63b39d6Schristos {
311c63b39d6Schristos   symvalue value;
312c63b39d6Schristos   char type;
313c63b39d6Schristos   const char *name;		/* Symbol name.  */
314c63b39d6Schristos   unsigned char stab_type;	/* Stab type.  */
315c63b39d6Schristos   char stab_other;		/* Stab other.  */
316c63b39d6Schristos   short stab_desc;		/* Stab desc.  */
317c63b39d6Schristos   const char *stab_name;	/* String for stab type.  */
318c63b39d6Schristos } symbol_info;
319c63b39d6Schristos 
320c63b39d6Schristos /* Get the name of a stabs type code.  */
321c63b39d6Schristos 
322c63b39d6Schristos extern const char *bfd_get_stab_name (int);
323c63b39d6Schristos 
324c63b39d6Schristos /* Hash table routines.  There is no way to free up a hash table.  */
325c63b39d6Schristos 
326c63b39d6Schristos /* An element in the hash table.  Most uses will actually use a larger
327c63b39d6Schristos    structure, and an instance of this will be the first field.  */
328c63b39d6Schristos 
329c63b39d6Schristos struct bfd_hash_entry
330c63b39d6Schristos {
331c63b39d6Schristos   /* Next entry for this hash code.  */
332c63b39d6Schristos   struct bfd_hash_entry *next;
333c63b39d6Schristos   /* String being hashed.  */
334c63b39d6Schristos   const char *string;
335c63b39d6Schristos   /* Hash code.  This is the full hash code, not the index into the
336c63b39d6Schristos      table.  */
337c63b39d6Schristos   unsigned long hash;
338c63b39d6Schristos };
339c63b39d6Schristos 
340c63b39d6Schristos /* A hash table.  */
341c63b39d6Schristos 
342c63b39d6Schristos struct bfd_hash_table
343c63b39d6Schristos {
344c63b39d6Schristos   /* The hash array.  */
345c63b39d6Schristos   struct bfd_hash_entry **table;
346c63b39d6Schristos   /* A function used to create new elements in the hash table.  The
347c63b39d6Schristos      first entry is itself a pointer to an element.  When this
348c63b39d6Schristos      function is first invoked, this pointer will be NULL.  However,
349c63b39d6Schristos      having the pointer permits a hierarchy of method functions to be
350c63b39d6Schristos      built each of which calls the function in the superclass.  Thus
351c63b39d6Schristos      each function should be written to allocate a new block of memory
352c63b39d6Schristos      only if the argument is NULL.  */
353c63b39d6Schristos   struct bfd_hash_entry *(*newfunc)
354c63b39d6Schristos     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
355c63b39d6Schristos   /* An objalloc for this hash table.  This is a struct objalloc *,
356c63b39d6Schristos      but we use void * to avoid requiring the inclusion of objalloc.h.  */
357c63b39d6Schristos   void *memory;
358c63b39d6Schristos   /* The number of slots in the hash table.  */
359c63b39d6Schristos   unsigned int size;
360c63b39d6Schristos   /* The number of entries in the hash table.  */
361c63b39d6Schristos   unsigned int count;
362c63b39d6Schristos   /* The size of elements.  */
363c63b39d6Schristos   unsigned int entsize;
364c63b39d6Schristos   /* If non-zero, don't grow the hash table.  */
365c63b39d6Schristos   unsigned int frozen:1;
366c63b39d6Schristos };
367c63b39d6Schristos 
368c63b39d6Schristos /* Initialize a hash table.  */
369c63b39d6Schristos extern bfd_boolean bfd_hash_table_init
370c63b39d6Schristos   (struct bfd_hash_table *,
371c63b39d6Schristos    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
372c63b39d6Schristos 			       struct bfd_hash_table *,
373c63b39d6Schristos 			       const char *),
374c63b39d6Schristos    unsigned int);
375c63b39d6Schristos 
376c63b39d6Schristos /* Initialize a hash table specifying a size.  */
377c63b39d6Schristos extern bfd_boolean bfd_hash_table_init_n
378c63b39d6Schristos   (struct bfd_hash_table *,
379c63b39d6Schristos    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
380c63b39d6Schristos 			       struct bfd_hash_table *,
381c63b39d6Schristos 			       const char *),
382c63b39d6Schristos    unsigned int, unsigned int);
383c63b39d6Schristos 
384c63b39d6Schristos /* Free up a hash table.  */
385c63b39d6Schristos extern void bfd_hash_table_free
386c63b39d6Schristos   (struct bfd_hash_table *);
387c63b39d6Schristos 
388c63b39d6Schristos /* Look up a string in a hash table.  If CREATE is TRUE, a new entry
389c63b39d6Schristos    will be created for this string if one does not already exist.  The
390c63b39d6Schristos    COPY argument must be TRUE if this routine should copy the string
391c63b39d6Schristos    into newly allocated memory when adding an entry.  */
392c63b39d6Schristos extern struct bfd_hash_entry *bfd_hash_lookup
393c63b39d6Schristos   (struct bfd_hash_table *, const char *, bfd_boolean create,
394c63b39d6Schristos    bfd_boolean copy);
395c63b39d6Schristos 
396c63b39d6Schristos /* Insert an entry in a hash table.  */
397c63b39d6Schristos extern struct bfd_hash_entry *bfd_hash_insert
398c63b39d6Schristos   (struct bfd_hash_table *, const char *, unsigned long);
399c63b39d6Schristos 
400c63b39d6Schristos /* Rename an entry in a hash table.  */
401c63b39d6Schristos extern void bfd_hash_rename
402c63b39d6Schristos   (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
403c63b39d6Schristos 
404c63b39d6Schristos /* Replace an entry in a hash table.  */
405c63b39d6Schristos extern void bfd_hash_replace
406c63b39d6Schristos   (struct bfd_hash_table *, struct bfd_hash_entry *old,
407c63b39d6Schristos    struct bfd_hash_entry *nw);
408c63b39d6Schristos 
409c63b39d6Schristos /* Base method for creating a hash table entry.  */
410c63b39d6Schristos extern struct bfd_hash_entry *bfd_hash_newfunc
411c63b39d6Schristos   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
412c63b39d6Schristos 
413c63b39d6Schristos /* Grab some space for a hash table entry.  */
414c63b39d6Schristos extern void *bfd_hash_allocate
415c63b39d6Schristos   (struct bfd_hash_table *, unsigned int);
416c63b39d6Schristos 
417c63b39d6Schristos /* Traverse a hash table in a random order, calling a function on each
418c63b39d6Schristos    element.  If the function returns FALSE, the traversal stops.  The
419c63b39d6Schristos    INFO argument is passed to the function.  */
420c63b39d6Schristos extern void bfd_hash_traverse
421c63b39d6Schristos   (struct bfd_hash_table *,
422c63b39d6Schristos    bfd_boolean (*) (struct bfd_hash_entry *, void *),
423c63b39d6Schristos    void *info);
424c63b39d6Schristos 
425c63b39d6Schristos /* Allows the default size of a hash table to be configured. New hash
426c63b39d6Schristos    tables allocated using bfd_hash_table_init will be created with
427c63b39d6Schristos    this size.  */
428fdeb0babSchristos extern unsigned long bfd_hash_set_default_size (unsigned long);
429c63b39d6Schristos 
430e8beca2cSchristos /* Types of compressed DWARF debug sections.  We currently support
431e8beca2cSchristos    zlib.  */
432e8beca2cSchristos enum compressed_debug_section_type
433e8beca2cSchristos {
434e8beca2cSchristos   COMPRESS_DEBUG_NONE = 0,
435e8beca2cSchristos   COMPRESS_DEBUG = 1 << 0,
436e8beca2cSchristos   COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1,
437e8beca2cSchristos   COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2
438e8beca2cSchristos };
439e8beca2cSchristos 
440c63b39d6Schristos /* This structure is used to keep track of stabs in sections
441c63b39d6Schristos    information while linking.  */
442c63b39d6Schristos 
443c63b39d6Schristos struct stab_info
444c63b39d6Schristos {
445c63b39d6Schristos   /* A hash table used to hold stabs strings.  */
446c63b39d6Schristos   struct bfd_strtab_hash *strings;
447c63b39d6Schristos   /* The header file hash table.  */
448c63b39d6Schristos   struct bfd_hash_table includes;
449c63b39d6Schristos   /* The first .stabstr section.  */
450c63b39d6Schristos   struct bfd_section *stabstr;
451c63b39d6Schristos };
452c63b39d6Schristos 
453c63b39d6Schristos #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
454c63b39d6Schristos 
455c63b39d6Schristos /* User program access to BFD facilities.  */
456c63b39d6Schristos 
457c63b39d6Schristos /* Direct I/O routines, for programs which know more about the object
458c63b39d6Schristos    file than BFD does.  Use higher level routines if possible.  */
459c63b39d6Schristos 
460c63b39d6Schristos extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
461c63b39d6Schristos extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
462c63b39d6Schristos extern int bfd_seek (bfd *, file_ptr, int);
463c63b39d6Schristos extern file_ptr bfd_tell (bfd *);
464c63b39d6Schristos extern int bfd_flush (bfd *);
465c63b39d6Schristos extern int bfd_stat (bfd *, struct stat *);
466c63b39d6Schristos 
467c63b39d6Schristos /* Deprecated old routines.  */
468c63b39d6Schristos #if __GNUC__
469c63b39d6Schristos #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
4709bc6a05dSchristos   (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),	\
471c63b39d6Schristos    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
472c63b39d6Schristos #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
4739bc6a05dSchristos   (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
474c63b39d6Schristos    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
475c63b39d6Schristos #else
476c63b39d6Schristos #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
4779bc6a05dSchristos   (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
478c63b39d6Schristos    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
479c63b39d6Schristos #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
4809bc6a05dSchristos   (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
481c63b39d6Schristos    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
482c63b39d6Schristos #endif
4839bc6a05dSchristos extern void _bfd_warn_deprecated (const char *, const char *, int, const char *);
484c63b39d6Schristos 
485c63b39d6Schristos extern bfd_boolean bfd_cache_close
486c63b39d6Schristos   (bfd *abfd);
487c63b39d6Schristos /* NB: This declaration should match the autogenerated one in libbfd.h.  */
488c63b39d6Schristos 
489c63b39d6Schristos extern bfd_boolean bfd_cache_close_all (void);
490c63b39d6Schristos 
491c63b39d6Schristos extern bfd_boolean bfd_record_phdr
492c63b39d6Schristos   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
493c63b39d6Schristos    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
494c63b39d6Schristos 
495c63b39d6Schristos /* Byte swapping routines.  */
496c63b39d6Schristos 
497c63b39d6Schristos bfd_uint64_t bfd_getb64 (const void *);
498c63b39d6Schristos bfd_uint64_t bfd_getl64 (const void *);
499c63b39d6Schristos bfd_int64_t bfd_getb_signed_64 (const void *);
500c63b39d6Schristos bfd_int64_t bfd_getl_signed_64 (const void *);
501c63b39d6Schristos bfd_vma bfd_getb32 (const void *);
502c63b39d6Schristos bfd_vma bfd_getl32 (const void *);
503c63b39d6Schristos bfd_signed_vma bfd_getb_signed_32 (const void *);
504c63b39d6Schristos bfd_signed_vma bfd_getl_signed_32 (const void *);
505c63b39d6Schristos bfd_vma bfd_getb16 (const void *);
506c63b39d6Schristos bfd_vma bfd_getl16 (const void *);
507c63b39d6Schristos bfd_signed_vma bfd_getb_signed_16 (const void *);
508c63b39d6Schristos bfd_signed_vma bfd_getl_signed_16 (const void *);
509c63b39d6Schristos void bfd_putb64 (bfd_uint64_t, void *);
510c63b39d6Schristos void bfd_putl64 (bfd_uint64_t, void *);
511c63b39d6Schristos void bfd_putb32 (bfd_vma, void *);
512c63b39d6Schristos void bfd_putl32 (bfd_vma, void *);
51377cd98dfSchristos void bfd_putb24 (bfd_vma, void *);
51477cd98dfSchristos void bfd_putl24 (bfd_vma, void *);
515c63b39d6Schristos void bfd_putb16 (bfd_vma, void *);
516c63b39d6Schristos void bfd_putl16 (bfd_vma, void *);
517c63b39d6Schristos 
518c63b39d6Schristos /* Byte swapping routines which take size and endiannes as arguments.  */
519c63b39d6Schristos 
520c63b39d6Schristos bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
521c63b39d6Schristos void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
522c63b39d6Schristos 
523c63b39d6Schristos 
524c63b39d6Schristos /* mmap hacks */
525c63b39d6Schristos 
526c63b39d6Schristos struct _bfd_window_internal;
527c63b39d6Schristos typedef struct _bfd_window_internal bfd_window_internal;
528c63b39d6Schristos 
529c63b39d6Schristos typedef struct _bfd_window
530c63b39d6Schristos {
531c63b39d6Schristos   /* What the user asked for.  */
532c63b39d6Schristos   void *data;
533c63b39d6Schristos   bfd_size_type size;
534c63b39d6Schristos   /* The actual window used by BFD.  Small user-requested read-only
535c63b39d6Schristos      regions sharing a page may share a single window into the object
536c63b39d6Schristos      file.  Read-write versions shouldn't until I've fixed things to
537c63b39d6Schristos      keep track of which portions have been claimed by the
538c63b39d6Schristos      application; don't want to give the same region back when the
539c63b39d6Schristos      application wants two writable copies!  */
540c63b39d6Schristos   struct _bfd_window_internal *i;
541c63b39d6Schristos }
542c63b39d6Schristos bfd_window;
543c63b39d6Schristos 
544c63b39d6Schristos extern void bfd_init_window
545c63b39d6Schristos   (bfd_window *);
546c63b39d6Schristos extern void bfd_free_window
547c63b39d6Schristos   (bfd_window *);
548c63b39d6Schristos extern bfd_boolean bfd_get_file_window
549c63b39d6Schristos   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
550*fd82c4c4Schristos 
551*fd82c4c4Schristos /* Externally visible ELF routines.  */
552c63b39d6Schristos 
553*fd82c4c4Schristos /* Create a new BFD as if by bfd_openr.  Rather than opening a file,
554*fd82c4c4Schristos    reconstruct an ELF file by reading the segments out of remote
555*fd82c4c4Schristos    memory based on the ELF file header at EHDR_VMA and the ELF program
556*fd82c4c4Schristos    headers it points to.  If non-zero, SIZE is the known extent of the
557*fd82c4c4Schristos    object.  If not null, *LOADBASEP is filled in with the difference
558*fd82c4c4Schristos    between the VMAs from which the segments were read, and the VMAs
559*fd82c4c4Schristos    the file headers (and hence BFD's idea of each section's VMA) put
560*fd82c4c4Schristos    them at.
561c63b39d6Schristos 
562*fd82c4c4Schristos    The function TARGET_READ_MEMORY is called to copy LEN bytes from
563*fd82c4c4Schristos    the remote memory at target address VMA into the local buffer at
564*fd82c4c4Schristos    MYADDR; it should return zero on success or an `errno' code on
565*fd82c4c4Schristos    failure.  TEMPL must be a BFD for a target with the word size and
566*fd82c4c4Schristos    byte order found in the remote memory.  */
567*fd82c4c4Schristos extern bfd *bfd_elf_bfd_from_remote_memory
568*fd82c4c4Schristos   (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
569*fd82c4c4Schristos    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
570*fd82c4c4Schristos 			      bfd_size_type len));
571c63b39d6Schristos 
572*fd82c4c4Schristos /* Forward declarations.  */
573*fd82c4c4Schristos struct ecoff_debug_info;
574*fd82c4c4Schristos struct ecoff_debug_swap;
575*fd82c4c4Schristos struct ecoff_extr;
576*fd82c4c4Schristos struct bfd_link_info;
577*fd82c4c4Schristos struct bfd_link_hash_entry;
57877cd98dfSchristos /* Extracted from init.c.  */
57977cd98dfSchristos unsigned int bfd_init (void);
58077cd98dfSchristos 
58177cd98dfSchristos 
58277cd98dfSchristos /* Value returned by bfd_init.  */
58377cd98dfSchristos 
58477cd98dfSchristos #define BFD_INIT_MAGIC (sizeof (struct bfd_section))
585c63b39d6Schristos /* Extracted from opncls.c.  */
586b511d482Schristos /* Set to N to open the next N BFDs using an alternate id space.  */
587c63b39d6Schristos extern unsigned int bfd_use_reserved_id;
588c63b39d6Schristos bfd *bfd_fopen (const char *filename, const char *target,
589c63b39d6Schristos     const char *mode, int fd);
590c63b39d6Schristos 
591c63b39d6Schristos bfd *bfd_openr (const char *filename, const char *target);
592c63b39d6Schristos 
593c63b39d6Schristos bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
594c63b39d6Schristos 
5959bc6a05dSchristos bfd *bfd_openstreamr (const char * filename, const char * target,
5969bc6a05dSchristos     void * stream);
597c63b39d6Schristos 
598c63b39d6Schristos bfd *bfd_openr_iovec (const char *filename, const char *target,
599c63b39d6Schristos     void *(*open_func) (struct bfd *nbfd,
600c63b39d6Schristos     void *open_closure),
601c63b39d6Schristos     void *open_closure,
602c63b39d6Schristos     file_ptr (*pread_func) (struct bfd *nbfd,
603c63b39d6Schristos     void *stream,
604c63b39d6Schristos     void *buf,
605c63b39d6Schristos     file_ptr nbytes,
606c63b39d6Schristos     file_ptr offset),
607c63b39d6Schristos     int (*close_func) (struct bfd *nbfd,
608c63b39d6Schristos     void *stream),
609c63b39d6Schristos     int (*stat_func) (struct bfd *abfd,
610c63b39d6Schristos     void *stream,
611c63b39d6Schristos     struct stat *sb));
612c63b39d6Schristos 
613c63b39d6Schristos bfd *bfd_openw (const char *filename, const char *target);
614c63b39d6Schristos 
615c63b39d6Schristos bfd_boolean bfd_close (bfd *abfd);
616c63b39d6Schristos 
617c63b39d6Schristos bfd_boolean bfd_close_all_done (bfd *);
618c63b39d6Schristos 
619c63b39d6Schristos bfd *bfd_create (const char *filename, bfd *templ);
620c63b39d6Schristos 
621c63b39d6Schristos bfd_boolean bfd_make_writable (bfd *abfd);
622c63b39d6Schristos 
623c63b39d6Schristos bfd_boolean bfd_make_readable (bfd *abfd);
624c63b39d6Schristos 
625c63b39d6Schristos void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
626c63b39d6Schristos 
627c63b39d6Schristos void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
628c63b39d6Schristos 
629c63b39d6Schristos unsigned long bfd_calc_gnu_debuglink_crc32
630c63b39d6Schristos    (unsigned long crc, const unsigned char *buf, bfd_size_type len);
631c63b39d6Schristos 
63244a21023Schristos char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
63344a21023Schristos 
63444a21023Schristos char *bfd_get_alt_debug_link_info (bfd * abfd,
63544a21023Schristos     bfd_size_type *buildid_len,
63644a21023Schristos     bfd_byte **buildid_out);
63744a21023Schristos 
638c63b39d6Schristos char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
639c63b39d6Schristos 
64044a21023Schristos char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir);
64144a21023Schristos 
642c63b39d6Schristos struct bfd_section *bfd_create_gnu_debuglink_section
643c63b39d6Schristos    (bfd *abfd, const char *filename);
644c63b39d6Schristos 
645c63b39d6Schristos bfd_boolean bfd_fill_in_gnu_debuglink_section
646c63b39d6Schristos    (bfd *abfd, struct bfd_section *sect, const char *filename);
647c63b39d6Schristos 
6489bc6a05dSchristos char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
6499bc6a05dSchristos 
650*fd82c4c4Schristos const char *bfd_set_filename (bfd *abfd, const char *filename);
651*fd82c4c4Schristos 
652c63b39d6Schristos /* Extracted from libbfd.c.  */
653c63b39d6Schristos 
654c63b39d6Schristos /* Byte swapping macros for user section data.  */
655c63b39d6Schristos 
656c63b39d6Schristos #define bfd_put_8(abfd, val, ptr) \
657c63b39d6Schristos   ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
658c63b39d6Schristos #define bfd_put_signed_8 \
659c63b39d6Schristos   bfd_put_8
660c63b39d6Schristos #define bfd_get_8(abfd, ptr) \
661*fd82c4c4Schristos   ((bfd_vma) *(const unsigned char *) (ptr) & 0xff)
662c63b39d6Schristos #define bfd_get_signed_8(abfd, ptr) \
663*fd82c4c4Schristos   ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
664c63b39d6Schristos 
665c63b39d6Schristos #define bfd_put_16(abfd, val, ptr) \
666c63b39d6Schristos   BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
667c63b39d6Schristos #define bfd_put_signed_16 \
668c63b39d6Schristos   bfd_put_16
669c63b39d6Schristos #define bfd_get_16(abfd, ptr) \
670c63b39d6Schristos   BFD_SEND (abfd, bfd_getx16, (ptr))
671c63b39d6Schristos #define bfd_get_signed_16(abfd, ptr) \
672c63b39d6Schristos   BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
673c63b39d6Schristos 
67477cd98dfSchristos #define bfd_put_24(abfd, val, ptr) \
67577cd98dfSchristos   do                                   \
67677cd98dfSchristos     if (bfd_big_endian (abfd))         \
67777cd98dfSchristos       bfd_putb24 ((val), (ptr));       \
67877cd98dfSchristos     else                               \
67977cd98dfSchristos       bfd_putl24 ((val), (ptr));       \
68077cd98dfSchristos   while (0)
68177cd98dfSchristos 
68277cd98dfSchristos bfd_vma bfd_getb24 (const void *p);
68377cd98dfSchristos bfd_vma bfd_getl24 (const void *p);
68477cd98dfSchristos 
68577cd98dfSchristos #define bfd_get_24(abfd, ptr) \
68677cd98dfSchristos   (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr))
68777cd98dfSchristos 
688c63b39d6Schristos #define bfd_put_32(abfd, val, ptr) \
689c63b39d6Schristos   BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
690c63b39d6Schristos #define bfd_put_signed_32 \
691c63b39d6Schristos   bfd_put_32
692c63b39d6Schristos #define bfd_get_32(abfd, ptr) \
693c63b39d6Schristos   BFD_SEND (abfd, bfd_getx32, (ptr))
694c63b39d6Schristos #define bfd_get_signed_32(abfd, ptr) \
695c63b39d6Schristos   BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
696c63b39d6Schristos 
697c63b39d6Schristos #define bfd_put_64(abfd, val, ptr) \
698c63b39d6Schristos   BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
699c63b39d6Schristos #define bfd_put_signed_64 \
700c63b39d6Schristos   bfd_put_64
701c63b39d6Schristos #define bfd_get_64(abfd, ptr) \
702c63b39d6Schristos   BFD_SEND (abfd, bfd_getx64, (ptr))
703c63b39d6Schristos #define bfd_get_signed_64(abfd, ptr) \
704c63b39d6Schristos   BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
705c63b39d6Schristos 
706c63b39d6Schristos #define bfd_get(bits, abfd, ptr)                       \
707*fd82c4c4Schristos   ((bits) == 8 ? bfd_get_8 (abfd, ptr)                 \
708c63b39d6Schristos    : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
709c63b39d6Schristos    : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
710c63b39d6Schristos    : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
711c63b39d6Schristos    : (abort (), (bfd_vma) - 1))
712c63b39d6Schristos 
713c63b39d6Schristos #define bfd_put(bits, abfd, val, ptr)                  \
714c63b39d6Schristos   ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
715c63b39d6Schristos    : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)        \
716c63b39d6Schristos    : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)        \
717c63b39d6Schristos    : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)        \
718c63b39d6Schristos    : (abort (), (void) 0))
719c63b39d6Schristos 
720c63b39d6Schristos 
721c63b39d6Schristos /* Byte swapping macros for file header data.  */
722c63b39d6Schristos 
723c63b39d6Schristos #define bfd_h_put_8(abfd, val, ptr) \
724c63b39d6Schristos   bfd_put_8 (abfd, val, ptr)
725c63b39d6Schristos #define bfd_h_put_signed_8(abfd, val, ptr) \
726c63b39d6Schristos   bfd_put_8 (abfd, val, ptr)
727c63b39d6Schristos #define bfd_h_get_8(abfd, ptr) \
728c63b39d6Schristos   bfd_get_8 (abfd, ptr)
729c63b39d6Schristos #define bfd_h_get_signed_8(abfd, ptr) \
730c63b39d6Schristos   bfd_get_signed_8 (abfd, ptr)
731c63b39d6Schristos 
732c63b39d6Schristos #define bfd_h_put_16(abfd, val, ptr) \
733c63b39d6Schristos   BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
734c63b39d6Schristos #define bfd_h_put_signed_16 \
735c63b39d6Schristos   bfd_h_put_16
736c63b39d6Schristos #define bfd_h_get_16(abfd, ptr) \
737c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx16, (ptr))
738c63b39d6Schristos #define bfd_h_get_signed_16(abfd, ptr) \
739c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
740c63b39d6Schristos 
741c63b39d6Schristos #define bfd_h_put_32(abfd, val, ptr) \
742c63b39d6Schristos   BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
743c63b39d6Schristos #define bfd_h_put_signed_32 \
744c63b39d6Schristos   bfd_h_put_32
745c63b39d6Schristos #define bfd_h_get_32(abfd, ptr) \
746c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx32, (ptr))
747c63b39d6Schristos #define bfd_h_get_signed_32(abfd, ptr) \
748c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
749c63b39d6Schristos 
750c63b39d6Schristos #define bfd_h_put_64(abfd, val, ptr) \
751c63b39d6Schristos   BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
752c63b39d6Schristos #define bfd_h_put_signed_64 \
753c63b39d6Schristos   bfd_h_put_64
754c63b39d6Schristos #define bfd_h_get_64(abfd, ptr) \
755c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx64, (ptr))
756c63b39d6Schristos #define bfd_h_get_signed_64(abfd, ptr) \
757c63b39d6Schristos   BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
758c63b39d6Schristos 
759c63b39d6Schristos /* Aliases for the above, which should eventually go away.  */
760c63b39d6Schristos 
761c63b39d6Schristos #define H_PUT_64  bfd_h_put_64
762c63b39d6Schristos #define H_PUT_32  bfd_h_put_32
763c63b39d6Schristos #define H_PUT_16  bfd_h_put_16
764c63b39d6Schristos #define H_PUT_8   bfd_h_put_8
765c63b39d6Schristos #define H_PUT_S64 bfd_h_put_signed_64
766c63b39d6Schristos #define H_PUT_S32 bfd_h_put_signed_32
767c63b39d6Schristos #define H_PUT_S16 bfd_h_put_signed_16
768c63b39d6Schristos #define H_PUT_S8  bfd_h_put_signed_8
769c63b39d6Schristos #define H_GET_64  bfd_h_get_64
770c63b39d6Schristos #define H_GET_32  bfd_h_get_32
771c63b39d6Schristos #define H_GET_16  bfd_h_get_16
772c63b39d6Schristos #define H_GET_8   bfd_h_get_8
773c63b39d6Schristos #define H_GET_S64 bfd_h_get_signed_64
774c63b39d6Schristos #define H_GET_S32 bfd_h_get_signed_32
775c63b39d6Schristos #define H_GET_S16 bfd_h_get_signed_16
776c63b39d6Schristos #define H_GET_S8  bfd_h_get_signed_8
777c63b39d6Schristos 
778c63b39d6Schristos 
779c63b39d6Schristos /* Extracted from bfdio.c.  */
780c63b39d6Schristos long bfd_get_mtime (bfd *abfd);
781c63b39d6Schristos 
78277cd98dfSchristos ufile_ptr bfd_get_size (bfd *abfd);
78377cd98dfSchristos 
78477cd98dfSchristos ufile_ptr bfd_get_file_size (bfd *abfd);
785c63b39d6Schristos 
786c63b39d6Schristos void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
787fdeb0babSchristos     int prot, int flags, file_ptr offset,
788fdeb0babSchristos     void **map_addr, bfd_size_type *map_len);
789c63b39d6Schristos 
790c63b39d6Schristos /* Extracted from bfdwin.c.  */
791c63b39d6Schristos /* Extracted from section.c.  */
792b511d482Schristos 
793c63b39d6Schristos typedef struct bfd_section
794c63b39d6Schristos {
795c63b39d6Schristos   /* The name of the section; the name isn't a copy, the pointer is
796c63b39d6Schristos      the same as that passed to bfd_make_section.  */
797c63b39d6Schristos   const char *name;
798c63b39d6Schristos 
799c63b39d6Schristos   /* A unique sequence number.  */
800a636ddcaSmrg   unsigned int id;
801c63b39d6Schristos 
802*fd82c4c4Schristos   /* A unique section number which can be used by assembler to
803*fd82c4c4Schristos      distinguish different sections with the same section name.  */
804*fd82c4c4Schristos   unsigned int section_id;
805*fd82c4c4Schristos 
806c63b39d6Schristos   /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
807a636ddcaSmrg   unsigned int index;
808c63b39d6Schristos 
809c63b39d6Schristos   /* The next section in the list belonging to the BFD, or NULL.  */
810c63b39d6Schristos   struct bfd_section *next;
811c63b39d6Schristos 
812c63b39d6Schristos   /* The previous section in the list belonging to the BFD, or NULL.  */
813c63b39d6Schristos   struct bfd_section *prev;
814c63b39d6Schristos 
815c63b39d6Schristos   /* The field flags contains attributes of the section. Some
816c63b39d6Schristos      flags are read in from the object file, and some are
817c63b39d6Schristos      synthesized from other information.  */
818c63b39d6Schristos   flagword flags;
819c63b39d6Schristos 
82077cd98dfSchristos #define SEC_NO_FLAGS                      0x0
821c63b39d6Schristos 
822c63b39d6Schristos   /* Tells the OS to allocate space for this section when loading.
823c63b39d6Schristos      This is clear for a section containing debug information only.  */
82477cd98dfSchristos #define SEC_ALLOC                         0x1
825c63b39d6Schristos 
826c63b39d6Schristos   /* Tells the OS to load the section from the file when loading.
827c63b39d6Schristos      This is clear for a .bss section.  */
82877cd98dfSchristos #define SEC_LOAD                          0x2
829c63b39d6Schristos 
830c63b39d6Schristos   /* The section contains data still to be relocated, so there is
831c63b39d6Schristos      some relocation information too.  */
83277cd98dfSchristos #define SEC_RELOC                         0x4
833c63b39d6Schristos 
834c63b39d6Schristos   /* A signal to the OS that the section contains read only data.  */
83577cd98dfSchristos #define SEC_READONLY                      0x8
836c63b39d6Schristos 
837c63b39d6Schristos   /* The section contains code only.  */
83877cd98dfSchristos #define SEC_CODE                         0x10
839c63b39d6Schristos 
840c63b39d6Schristos   /* The section contains data only.  */
84177cd98dfSchristos #define SEC_DATA                         0x20
842c63b39d6Schristos 
843c63b39d6Schristos   /* The section will reside in ROM.  */
84477cd98dfSchristos #define SEC_ROM                          0x40
845c63b39d6Schristos 
846c63b39d6Schristos   /* The section contains constructor information. This section
847c63b39d6Schristos      type is used by the linker to create lists of constructors and
848c63b39d6Schristos      destructors used by <<g++>>. When a back end sees a symbol
849c63b39d6Schristos      which should be used in a constructor list, it creates a new
850c63b39d6Schristos      section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
851c63b39d6Schristos      the symbol to it, and builds a relocation. To build the lists
852c63b39d6Schristos      of constructors, all the linker has to do is catenate all the
853c63b39d6Schristos      sections called <<__CTOR_LIST__>> and relocate the data
854c63b39d6Schristos      contained within - exactly the operations it would peform on
855c63b39d6Schristos      standard data.  */
85677cd98dfSchristos #define SEC_CONSTRUCTOR                  0x80
857c63b39d6Schristos 
858c63b39d6Schristos   /* The section has contents - a data section could be
859c63b39d6Schristos      <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
860c63b39d6Schristos      <<SEC_HAS_CONTENTS>>  */
861c63b39d6Schristos #define SEC_HAS_CONTENTS                0x100
862c63b39d6Schristos 
863c63b39d6Schristos   /* An instruction to the linker to not output the section
864c63b39d6Schristos      even if it has information which would normally be written.  */
865c63b39d6Schristos #define SEC_NEVER_LOAD                  0x200
866c63b39d6Schristos 
867c63b39d6Schristos   /* The section contains thread local data.  */
868c63b39d6Schristos #define SEC_THREAD_LOCAL                0x400
869c63b39d6Schristos 
87077cd98dfSchristos   /* The section's size is fixed.  Generic linker code will not
87177cd98dfSchristos      recalculate it and it is up to whoever has set this flag to
87277cd98dfSchristos      get the size right.  */
87377cd98dfSchristos #define SEC_FIXED_SIZE                  0x800
874c63b39d6Schristos 
875c63b39d6Schristos   /* The section contains common symbols (symbols may be defined
876c63b39d6Schristos      multiple times, the value of a symbol is the amount of
877c63b39d6Schristos      space it requires, and the largest symbol value is the one
878c63b39d6Schristos      used).  Most targets have exactly one of these (which we
879c63b39d6Schristos      translate to bfd_com_section_ptr), but ECOFF has two.  */
880c63b39d6Schristos #define SEC_IS_COMMON                  0x1000
881c63b39d6Schristos 
882c63b39d6Schristos   /* The section contains only debugging information.  For
883c63b39d6Schristos      example, this is set for ELF .debug and .stab sections.
884c63b39d6Schristos      strip tests this flag to see if a section can be
885c63b39d6Schristos      discarded.  */
886c63b39d6Schristos #define SEC_DEBUGGING                  0x2000
887c63b39d6Schristos 
888c63b39d6Schristos   /* The contents of this section are held in memory pointed to
889c63b39d6Schristos      by the contents field.  This is checked by bfd_get_section_contents,
890c63b39d6Schristos      and the data is retrieved from memory if appropriate.  */
891c63b39d6Schristos #define SEC_IN_MEMORY                  0x4000
892c63b39d6Schristos 
893c63b39d6Schristos   /* The contents of this section are to be excluded by the
894c63b39d6Schristos      linker for executable and shared objects unless those
895c63b39d6Schristos      objects are to be further relocated.  */
896c63b39d6Schristos #define SEC_EXCLUDE                    0x8000
897c63b39d6Schristos 
898c63b39d6Schristos   /* The contents of this section are to be sorted based on the sum of
899c63b39d6Schristos      the symbol and addend values specified by the associated relocation
900c63b39d6Schristos      entries.  Entries without associated relocation entries will be
901c63b39d6Schristos      appended to the end of the section in an unspecified order.  */
902c63b39d6Schristos #define SEC_SORT_ENTRIES              0x10000
903c63b39d6Schristos 
904c63b39d6Schristos   /* When linking, duplicate sections of the same name should be
905c63b39d6Schristos      discarded, rather than being combined into a single section as
906c63b39d6Schristos      is usually done.  This is similar to how common symbols are
907c63b39d6Schristos      handled.  See SEC_LINK_DUPLICATES below.  */
908c63b39d6Schristos #define SEC_LINK_ONCE                 0x20000
909c63b39d6Schristos 
910c63b39d6Schristos   /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
911c63b39d6Schristos      should handle duplicate sections.  */
912c63b39d6Schristos #define SEC_LINK_DUPLICATES           0xc0000
913c63b39d6Schristos 
914c63b39d6Schristos   /* This value for SEC_LINK_DUPLICATES means that duplicate
915c63b39d6Schristos      sections with the same name should simply be discarded.  */
916c63b39d6Schristos #define SEC_LINK_DUPLICATES_DISCARD       0x0
917c63b39d6Schristos 
918c63b39d6Schristos   /* This value for SEC_LINK_DUPLICATES means that the linker
919c63b39d6Schristos      should warn if there are any duplicate sections, although
920c63b39d6Schristos      it should still only link one copy.  */
921c63b39d6Schristos #define SEC_LINK_DUPLICATES_ONE_ONLY  0x40000
922c63b39d6Schristos 
923c63b39d6Schristos   /* This value for SEC_LINK_DUPLICATES means that the linker
924c63b39d6Schristos      should warn if any duplicate sections are a different size.  */
925c63b39d6Schristos #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
926c63b39d6Schristos 
927c63b39d6Schristos   /* This value for SEC_LINK_DUPLICATES means that the linker
928c63b39d6Schristos      should warn if any duplicate sections contain different
929c63b39d6Schristos      contents.  */
930c63b39d6Schristos #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
931c63b39d6Schristos   (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
932c63b39d6Schristos 
933c63b39d6Schristos   /* This section was created by the linker as part of dynamic
934c63b39d6Schristos      relocation or other arcane processing.  It is skipped when
935c63b39d6Schristos      going through the first-pass output, trusting that someone
936c63b39d6Schristos      else up the line will take care of it later.  */
937c63b39d6Schristos #define SEC_LINKER_CREATED           0x100000
938c63b39d6Schristos 
939*fd82c4c4Schristos   /* This section contains a section ID to distinguish different
940*fd82c4c4Schristos      sections with the same section name.  */
941*fd82c4c4Schristos #define SEC_ASSEMBLER_SECTION_ID     0x100000
942*fd82c4c4Schristos 
943c63b39d6Schristos   /* This section should not be subject to garbage collection.
944c63b39d6Schristos      Also set to inform the linker that this section should not be
945c63b39d6Schristos      listed in the link map as discarded.  */
946c63b39d6Schristos #define SEC_KEEP                     0x200000
947c63b39d6Schristos 
948c63b39d6Schristos   /* This section contains "short" data, and should be placed
949c63b39d6Schristos      "near" the GP.  */
950c63b39d6Schristos #define SEC_SMALL_DATA               0x400000
951c63b39d6Schristos 
952c63b39d6Schristos   /* Attempt to merge identical entities in the section.
953c63b39d6Schristos      Entity size is given in the entsize field.  */
954c63b39d6Schristos #define SEC_MERGE                    0x800000
955c63b39d6Schristos 
956c63b39d6Schristos   /* If given with SEC_MERGE, entities to merge are zero terminated
957c63b39d6Schristos      strings where entsize specifies character size instead of fixed
958c63b39d6Schristos      size entries.  */
959c63b39d6Schristos #define SEC_STRINGS                 0x1000000
960c63b39d6Schristos 
961c63b39d6Schristos   /* This section contains data about section groups.  */
962c63b39d6Schristos #define SEC_GROUP                   0x2000000
963c63b39d6Schristos 
964c63b39d6Schristos   /* The section is a COFF shared library section.  This flag is
965c63b39d6Schristos      only for the linker.  If this type of section appears in
966c63b39d6Schristos      the input file, the linker must copy it to the output file
967c63b39d6Schristos      without changing the vma or size.  FIXME: Although this
968c63b39d6Schristos      was originally intended to be general, it really is COFF
969c63b39d6Schristos      specific (and the flag was renamed to indicate this).  It
970c63b39d6Schristos      might be cleaner to have some more general mechanism to
971c63b39d6Schristos      allow the back end to control what the linker does with
972c63b39d6Schristos      sections.  */
973c63b39d6Schristos #define SEC_COFF_SHARED_LIBRARY     0x4000000
974c63b39d6Schristos 
975fdeb0babSchristos   /* This input section should be copied to output in reverse order
976fdeb0babSchristos      as an array of pointers.  This is for ELF linker internal use
977fdeb0babSchristos      only.  */
978fdeb0babSchristos #define SEC_ELF_REVERSE_COPY        0x4000000
979fdeb0babSchristos 
980c63b39d6Schristos   /* This section contains data which may be shared with other
981c63b39d6Schristos      executables or shared objects. This is for COFF only.  */
982c63b39d6Schristos #define SEC_COFF_SHARED             0x8000000
983c63b39d6Schristos 
984e8beca2cSchristos   /* This section should be compressed.  This is for ELF linker
985e8beca2cSchristos      internal use only.  */
986e8beca2cSchristos #define SEC_ELF_COMPRESS            0x8000000
987e8beca2cSchristos 
988c63b39d6Schristos   /* When a section with this flag is being linked, then if the size of
989c63b39d6Schristos      the input section is less than a page, it should not cross a page
990c63b39d6Schristos      boundary.  If the size of the input section is one page or more,
991c63b39d6Schristos      it should be aligned on a page boundary.  This is for TI
992c63b39d6Schristos      TMS320C54X only.  */
993c63b39d6Schristos #define SEC_TIC54X_BLOCK           0x10000000
994c63b39d6Schristos 
995e8beca2cSchristos   /* This section should be renamed.  This is for ELF linker
996e8beca2cSchristos      internal use only.  */
997e8beca2cSchristos #define SEC_ELF_RENAME             0x10000000
998e8beca2cSchristos 
999c63b39d6Schristos   /* Conditionally link this section; do not link if there are no
1000c63b39d6Schristos      references found to any symbol in the section.  This is for TI
1001c63b39d6Schristos      TMS320C54X only.  */
1002c63b39d6Schristos #define SEC_TIC54X_CLINK           0x20000000
1003c63b39d6Schristos 
1004e8beca2cSchristos   /* This section contains vliw code.  This is for Toshiba MeP only.  */
1005e8beca2cSchristos #define SEC_MEP_VLIW               0x20000000
1006e8beca2cSchristos 
1007*fd82c4c4Schristos   /* All symbols, sizes and relocations in this section are octets
1008*fd82c4c4Schristos      instead of bytes.  Required for DWARF debug sections as DWARF
1009*fd82c4c4Schristos      information is organized in octets, not bytes.  */
1010*fd82c4c4Schristos #define SEC_ELF_OCTETS             0x40000000
1011*fd82c4c4Schristos 
1012c63b39d6Schristos   /* Indicate that section has the no read flag set. This happens
1013c63b39d6Schristos      when memory read flag isn't set. */
1014c63b39d6Schristos #define SEC_COFF_NOREAD            0x40000000
1015c63b39d6Schristos 
1016a636ddcaSmrg   /* Indicate that section has the purecode flag set.  */
1017a636ddcaSmrg #define SEC_ELF_PURECODE           0x80000000
1018a636ddcaSmrg 
1019c63b39d6Schristos   /*  End of section flags.  */
1020c63b39d6Schristos 
1021c63b39d6Schristos   /* Some internal packed boolean fields.  */
1022c63b39d6Schristos 
1023c63b39d6Schristos   /* See the vma field.  */
1024c63b39d6Schristos   unsigned int user_set_vma : 1;
1025c63b39d6Schristos 
1026c63b39d6Schristos   /* A mark flag used by some of the linker backends.  */
1027c63b39d6Schristos   unsigned int linker_mark : 1;
1028c63b39d6Schristos 
1029c63b39d6Schristos   /* Another mark flag used by some of the linker backends.  Set for
1030c63b39d6Schristos      output sections that have an input section.  */
1031c63b39d6Schristos   unsigned int linker_has_input : 1;
1032c63b39d6Schristos 
1033c63b39d6Schristos   /* Mark flag used by some linker backends for garbage collection.  */
1034c63b39d6Schristos   unsigned int gc_mark : 1;
1035c63b39d6Schristos 
1036c63b39d6Schristos   /* Section compression status.  */
1037c63b39d6Schristos   unsigned int compress_status : 2;
1038c63b39d6Schristos #define COMPRESS_SECTION_NONE    0
1039c63b39d6Schristos #define COMPRESS_SECTION_DONE    1
1040c63b39d6Schristos #define DECOMPRESS_SECTION_SIZED 2
1041c63b39d6Schristos 
1042c63b39d6Schristos   /* The following flags are used by the ELF linker. */
1043c63b39d6Schristos 
1044c63b39d6Schristos   /* Mark sections which have been allocated to segments.  */
1045c63b39d6Schristos   unsigned int segment_mark : 1;
1046c63b39d6Schristos 
1047c63b39d6Schristos   /* Type of sec_info information.  */
1048c63b39d6Schristos   unsigned int sec_info_type:3;
1049fdeb0babSchristos #define SEC_INFO_TYPE_NONE      0
1050fdeb0babSchristos #define SEC_INFO_TYPE_STABS     1
1051fdeb0babSchristos #define SEC_INFO_TYPE_MERGE     2
1052fdeb0babSchristos #define SEC_INFO_TYPE_EH_FRAME  3
1053fdeb0babSchristos #define SEC_INFO_TYPE_JUST_SYMS 4
1054b511d482Schristos #define SEC_INFO_TYPE_TARGET    5
1055e8beca2cSchristos #define SEC_INFO_TYPE_EH_FRAME_ENTRY 6
1056c63b39d6Schristos 
1057c63b39d6Schristos   /* Nonzero if this section uses RELA relocations, rather than REL.  */
1058c63b39d6Schristos   unsigned int use_rela_p:1;
1059c63b39d6Schristos 
1060c63b39d6Schristos   /* Bits used by various backends.  The generic code doesn't touch
1061c63b39d6Schristos      these fields.  */
1062c63b39d6Schristos 
1063c63b39d6Schristos   unsigned int sec_flg0:1;
1064c63b39d6Schristos   unsigned int sec_flg1:1;
1065c63b39d6Schristos   unsigned int sec_flg2:1;
1066c63b39d6Schristos   unsigned int sec_flg3:1;
1067c63b39d6Schristos   unsigned int sec_flg4:1;
1068c63b39d6Schristos   unsigned int sec_flg5:1;
1069c63b39d6Schristos 
1070c63b39d6Schristos   /* End of internal packed boolean fields.  */
1071c63b39d6Schristos 
1072c63b39d6Schristos   /*  The virtual memory address of the section - where it will be
1073c63b39d6Schristos       at run time.  The symbols are relocated against this.  The
1074c63b39d6Schristos       user_set_vma flag is maintained by bfd; if it's not set, the
1075c63b39d6Schristos       backend can assign addresses (for example, in <<a.out>>, where
1076c63b39d6Schristos       the default address for <<.data>> is dependent on the specific
1077c63b39d6Schristos       target and various flags).  */
1078c63b39d6Schristos   bfd_vma vma;
1079c63b39d6Schristos 
1080c63b39d6Schristos   /*  The load address of the section - where it would be in a
1081c63b39d6Schristos       rom image; really only used for writing section header
1082c63b39d6Schristos       information.  */
1083c63b39d6Schristos   bfd_vma lma;
1084c63b39d6Schristos 
1085a636ddcaSmrg   /* The size of the section in *octets*, as it will be output.
1086c63b39d6Schristos      Contains a value even if the section has no contents (e.g., the
1087c63b39d6Schristos      size of <<.bss>>).  */
1088c63b39d6Schristos   bfd_size_type size;
1089c63b39d6Schristos 
1090c63b39d6Schristos   /* For input sections, the original size on disk of the section, in
1091c63b39d6Schristos      octets.  This field should be set for any section whose size is
1092c63b39d6Schristos      changed by linker relaxation.  It is required for sections where
1093c63b39d6Schristos      the linker relaxation scheme doesn't cache altered section and
1094c63b39d6Schristos      reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
1095c63b39d6Schristos      targets), and thus the original size needs to be kept to read the
1096c63b39d6Schristos      section multiple times.  For output sections, rawsize holds the
1097c63b39d6Schristos      section size calculated on a previous linker relaxation pass.  */
1098c63b39d6Schristos   bfd_size_type rawsize;
1099c63b39d6Schristos 
1100c63b39d6Schristos   /* The compressed size of the section in octets.  */
1101c63b39d6Schristos   bfd_size_type compressed_size;
1102c63b39d6Schristos 
1103c63b39d6Schristos   /* Relaxation table. */
1104c63b39d6Schristos   struct relax_table *relax;
1105c63b39d6Schristos 
1106c63b39d6Schristos   /* Count of used relaxation table entries. */
1107c63b39d6Schristos   int relax_count;
1108c63b39d6Schristos 
1109c63b39d6Schristos 
1110c63b39d6Schristos   /* If this section is going to be output, then this value is the
1111c63b39d6Schristos      offset in *bytes* into the output section of the first byte in the
1112c63b39d6Schristos      input section (byte ==> smallest addressable unit on the
1113c63b39d6Schristos      target).  In most cases, if this was going to start at the
1114c63b39d6Schristos      100th octet (8-bit quantity) in the output section, this value
1115c63b39d6Schristos      would be 100.  However, if the target byte size is 16 bits
1116c63b39d6Schristos      (bfd_octets_per_byte is "2"), this value would be 50.  */
1117c63b39d6Schristos   bfd_vma output_offset;
1118c63b39d6Schristos 
1119c63b39d6Schristos   /* The output section through which to map on output.  */
1120c63b39d6Schristos   struct bfd_section *output_section;
1121c63b39d6Schristos 
1122c63b39d6Schristos   /* The alignment requirement of the section, as an exponent of 2 -
1123c63b39d6Schristos      e.g., 3 aligns to 2^3 (or 8).  */
1124c63b39d6Schristos   unsigned int alignment_power;
1125c63b39d6Schristos 
1126c63b39d6Schristos   /* If an input section, a pointer to a vector of relocation
1127c63b39d6Schristos      records for the data in this section.  */
1128c63b39d6Schristos   struct reloc_cache_entry *relocation;
1129c63b39d6Schristos 
1130c63b39d6Schristos   /* If an output section, a pointer to a vector of pointers to
1131c63b39d6Schristos      relocation records for the data in this section.  */
1132c63b39d6Schristos   struct reloc_cache_entry **orelocation;
1133c63b39d6Schristos 
1134c63b39d6Schristos   /* The number of relocation records in one of the above.  */
1135c63b39d6Schristos   unsigned reloc_count;
1136c63b39d6Schristos 
1137c63b39d6Schristos   /* Information below is back end specific - and not always used
1138c63b39d6Schristos      or updated.  */
1139c63b39d6Schristos 
1140c63b39d6Schristos   /* File position of section data.  */
1141c63b39d6Schristos   file_ptr filepos;
1142c63b39d6Schristos 
1143c63b39d6Schristos   /* File position of relocation info.  */
1144c63b39d6Schristos   file_ptr rel_filepos;
1145c63b39d6Schristos 
1146c63b39d6Schristos   /* File position of line data.  */
1147c63b39d6Schristos   file_ptr line_filepos;
1148c63b39d6Schristos 
1149c63b39d6Schristos   /* Pointer to data for applications.  */
1150c63b39d6Schristos   void *userdata;
1151c63b39d6Schristos 
1152c63b39d6Schristos   /* If the SEC_IN_MEMORY flag is set, this points to the actual
1153c63b39d6Schristos      contents.  */
1154c63b39d6Schristos   unsigned char *contents;
1155c63b39d6Schristos 
1156c63b39d6Schristos   /* Attached line number information.  */
1157c63b39d6Schristos   alent *lineno;
1158c63b39d6Schristos 
1159c63b39d6Schristos   /* Number of line number records.  */
1160c63b39d6Schristos   unsigned int lineno_count;
1161c63b39d6Schristos 
1162c63b39d6Schristos   /* Entity size for merging purposes.  */
1163c63b39d6Schristos   unsigned int entsize;
1164c63b39d6Schristos 
1165c63b39d6Schristos   /* Points to the kept section if this section is a link-once section,
1166c63b39d6Schristos      and is discarded.  */
1167c63b39d6Schristos   struct bfd_section *kept_section;
1168c63b39d6Schristos 
1169c63b39d6Schristos   /* When a section is being output, this value changes as more
1170c63b39d6Schristos      linenumbers are written out.  */
1171c63b39d6Schristos   file_ptr moving_line_filepos;
1172c63b39d6Schristos 
1173c63b39d6Schristos   /* What the section number is in the target world.  */
1174c63b39d6Schristos   int target_index;
1175c63b39d6Schristos 
1176c63b39d6Schristos   void *used_by_bfd;
1177c63b39d6Schristos 
1178c63b39d6Schristos   /* If this is a constructor section then here is a list of the
1179c63b39d6Schristos      relocations created to relocate items within it.  */
1180c63b39d6Schristos   struct relent_chain *constructor_chain;
1181c63b39d6Schristos 
1182c63b39d6Schristos   /* The BFD which owns the section.  */
1183c63b39d6Schristos   bfd *owner;
1184c63b39d6Schristos 
1185c63b39d6Schristos   /* A symbol which points at this section only.  */
1186c63b39d6Schristos   struct bfd_symbol *symbol;
1187c63b39d6Schristos   struct bfd_symbol **symbol_ptr_ptr;
1188c63b39d6Schristos 
1189c63b39d6Schristos   /* Early in the link process, map_head and map_tail are used to build
1190c63b39d6Schristos      a list of input sections attached to an output section.  Later,
1191c63b39d6Schristos      output sections use these fields for a list of bfd_link_order
1192*fd82c4c4Schristos      structs.  The linked_to_symbol_name field is for ELF assembler
1193*fd82c4c4Schristos      internal use.  */
1194c63b39d6Schristos   union {
1195c63b39d6Schristos     struct bfd_link_order *link_order;
1196c63b39d6Schristos     struct bfd_section *s;
1197*fd82c4c4Schristos     const char *linked_to_symbol_name;
1198c63b39d6Schristos   } map_head, map_tail;
1199*fd82c4c4Schristos  /* Points to the output section this section is already assigned to, if any.
1200*fd82c4c4Schristos     This is used when support for non-contiguous memory regions is enabled.  */
1201*fd82c4c4Schristos  struct bfd_section *already_assigned;
1202*fd82c4c4Schristos 
1203c63b39d6Schristos } asection;
1204c63b39d6Schristos 
1205c63b39d6Schristos /* Relax table contains information about instructions which can
1206c63b39d6Schristos    be removed by relaxation -- replacing a long address with a
1207c63b39d6Schristos    short address.  */
1208c63b39d6Schristos struct relax_table {
1209c63b39d6Schristos   /* Address where bytes may be deleted. */
1210c63b39d6Schristos   bfd_vma addr;
1211c63b39d6Schristos 
1212c63b39d6Schristos   /* Number of bytes to be deleted.  */
1213c63b39d6Schristos   int size;
1214c63b39d6Schristos };
1215c63b39d6Schristos 
1216*fd82c4c4Schristos static inline const char *
bfd_section_name(const asection * sec)1217*fd82c4c4Schristos bfd_section_name (const asection *sec)
1218*fd82c4c4Schristos {
1219*fd82c4c4Schristos   return sec->name;
1220*fd82c4c4Schristos }
1221*fd82c4c4Schristos 
1222*fd82c4c4Schristos static inline bfd_size_type
bfd_section_size(const asection * sec)1223*fd82c4c4Schristos bfd_section_size (const asection *sec)
1224*fd82c4c4Schristos {
1225*fd82c4c4Schristos   return sec->size;
1226*fd82c4c4Schristos }
1227*fd82c4c4Schristos 
1228*fd82c4c4Schristos static inline bfd_vma
bfd_section_vma(const asection * sec)1229*fd82c4c4Schristos bfd_section_vma (const asection *sec)
1230*fd82c4c4Schristos {
1231*fd82c4c4Schristos   return sec->vma;
1232*fd82c4c4Schristos }
1233*fd82c4c4Schristos 
1234*fd82c4c4Schristos static inline bfd_vma
bfd_section_lma(const asection * sec)1235*fd82c4c4Schristos bfd_section_lma (const asection *sec)
1236*fd82c4c4Schristos {
1237*fd82c4c4Schristos   return sec->lma;
1238*fd82c4c4Schristos }
1239*fd82c4c4Schristos 
1240*fd82c4c4Schristos static inline unsigned int
bfd_section_alignment(const asection * sec)1241*fd82c4c4Schristos bfd_section_alignment (const asection *sec)
1242*fd82c4c4Schristos {
1243*fd82c4c4Schristos   return sec->alignment_power;
1244*fd82c4c4Schristos }
1245*fd82c4c4Schristos 
1246*fd82c4c4Schristos static inline flagword
bfd_section_flags(const asection * sec)1247*fd82c4c4Schristos bfd_section_flags (const asection *sec)
1248*fd82c4c4Schristos {
1249*fd82c4c4Schristos   return sec->flags;
1250*fd82c4c4Schristos }
1251*fd82c4c4Schristos 
1252*fd82c4c4Schristos static inline void *
bfd_section_userdata(const asection * sec)1253*fd82c4c4Schristos bfd_section_userdata (const asection *sec)
1254*fd82c4c4Schristos {
1255*fd82c4c4Schristos   return sec->userdata;
1256*fd82c4c4Schristos }
1257*fd82c4c4Schristos static inline bfd_boolean
bfd_is_com_section(const asection * sec)1258*fd82c4c4Schristos bfd_is_com_section (const asection *sec)
1259*fd82c4c4Schristos {
1260*fd82c4c4Schristos   return (sec->flags & SEC_IS_COMMON) != 0;
1261*fd82c4c4Schristos }
1262*fd82c4c4Schristos 
126344a21023Schristos /* Note: the following are provided as inline functions rather than macros
126444a21023Schristos    because not all callers use the return value.  A macro implementation
126544a21023Schristos    would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
126644a21023Schristos    compilers will complain about comma expressions that have no effect.  */
126744a21023Schristos static inline bfd_boolean
bfd_set_section_userdata(asection * sec,void * val)1268*fd82c4c4Schristos bfd_set_section_userdata (asection *sec, void *val)
126944a21023Schristos {
1270*fd82c4c4Schristos   sec->userdata = val;
127144a21023Schristos   return TRUE;
127244a21023Schristos }
127344a21023Schristos 
127444a21023Schristos static inline bfd_boolean
bfd_set_section_vma(asection * sec,bfd_vma val)1275*fd82c4c4Schristos bfd_set_section_vma (asection *sec, bfd_vma val)
127644a21023Schristos {
1277*fd82c4c4Schristos   sec->vma = sec->lma = val;
1278*fd82c4c4Schristos   sec->user_set_vma = TRUE;
127944a21023Schristos   return TRUE;
128044a21023Schristos }
128144a21023Schristos 
128244a21023Schristos static inline bfd_boolean
bfd_set_section_lma(asection * sec,bfd_vma val)1283*fd82c4c4Schristos bfd_set_section_lma (asection *sec, bfd_vma val)
128444a21023Schristos {
1285*fd82c4c4Schristos   sec->lma = val;
1286*fd82c4c4Schristos   return TRUE;
1287*fd82c4c4Schristos }
1288*fd82c4c4Schristos 
1289*fd82c4c4Schristos static inline bfd_boolean
bfd_set_section_alignment(asection * sec,unsigned int val)1290*fd82c4c4Schristos bfd_set_section_alignment (asection *sec, unsigned int val)
1291*fd82c4c4Schristos {
1292*fd82c4c4Schristos   sec->alignment_power = val;
129344a21023Schristos   return TRUE;
129444a21023Schristos }
129544a21023Schristos 
1296c63b39d6Schristos /* These sections are global, and are managed by BFD.  The application
1297c63b39d6Schristos    and target back end are not permitted to change the values in
1298fdeb0babSchristos    these sections.  */
1299fdeb0babSchristos extern asection _bfd_std_section[4];
1300fdeb0babSchristos 
1301c63b39d6Schristos #define BFD_ABS_SECTION_NAME "*ABS*"
1302c63b39d6Schristos #define BFD_UND_SECTION_NAME "*UND*"
1303c63b39d6Schristos #define BFD_COM_SECTION_NAME "*COM*"
1304c63b39d6Schristos #define BFD_IND_SECTION_NAME "*IND*"
1305c63b39d6Schristos 
1306c63b39d6Schristos /* Pointer to the common section.  */
1307fdeb0babSchristos #define bfd_com_section_ptr (&_bfd_std_section[0])
1308fdeb0babSchristos /* Pointer to the undefined section.  */
1309fdeb0babSchristos #define bfd_und_section_ptr (&_bfd_std_section[1])
1310fdeb0babSchristos /* Pointer to the absolute section.  */
1311fdeb0babSchristos #define bfd_abs_section_ptr (&_bfd_std_section[2])
1312c63b39d6Schristos /* Pointer to the indirect section.  */
1313fdeb0babSchristos #define bfd_ind_section_ptr (&_bfd_std_section[3])
1314fdeb0babSchristos 
1315*fd82c4c4Schristos static inline bfd_boolean
bfd_is_und_section(const asection * sec)1316*fd82c4c4Schristos bfd_is_und_section (const asection *sec)
1317*fd82c4c4Schristos {
1318*fd82c4c4Schristos   return sec == bfd_und_section_ptr;
1319*fd82c4c4Schristos }
1320c63b39d6Schristos 
1321*fd82c4c4Schristos static inline bfd_boolean
bfd_is_abs_section(const asection * sec)1322*fd82c4c4Schristos bfd_is_abs_section (const asection *sec)
1323*fd82c4c4Schristos {
1324*fd82c4c4Schristos   return sec == bfd_abs_section_ptr;
1325*fd82c4c4Schristos }
1326c63b39d6Schristos 
1327*fd82c4c4Schristos static inline bfd_boolean
bfd_is_ind_section(const asection * sec)1328*fd82c4c4Schristos bfd_is_ind_section (const asection *sec)
1329*fd82c4c4Schristos {
1330*fd82c4c4Schristos   return sec == bfd_ind_section_ptr;
1331*fd82c4c4Schristos }
1332*fd82c4c4Schristos 
1333*fd82c4c4Schristos static inline bfd_boolean
bfd_is_const_section(const asection * sec)1334*fd82c4c4Schristos bfd_is_const_section (const asection *sec)
1335*fd82c4c4Schristos {
1336*fd82c4c4Schristos   return (sec >= _bfd_std_section
1337*fd82c4c4Schristos           && sec < _bfd_std_section + (sizeof (_bfd_std_section)
1338*fd82c4c4Schristos                                        / sizeof (_bfd_std_section[0])));
1339*fd82c4c4Schristos }
1340*fd82c4c4Schristos 
1341*fd82c4c4Schristos /* Return TRUE if input section SEC has been discarded.  */
1342*fd82c4c4Schristos static inline bfd_boolean
discarded_section(const asection * sec)1343*fd82c4c4Schristos discarded_section (const asection *sec)
1344*fd82c4c4Schristos {
1345*fd82c4c4Schristos   return (!bfd_is_abs_section (sec)
1346*fd82c4c4Schristos           && bfd_is_abs_section (sec->output_section)
1347*fd82c4c4Schristos           && sec->sec_info_type != SEC_INFO_TYPE_MERGE
1348*fd82c4c4Schristos           && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS);
1349*fd82c4c4Schristos }
1350c63b39d6Schristos 
13519bc6a05dSchristos #define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)                   \
1352*fd82c4c4Schristos   /* name, id,  section_id, index, next, prev, flags, user_set_vma, */ \
1353*fd82c4c4Schristos   {  NAME, IDX, 0,          0,     NULL, NULL, FLAGS, 0,               \
1354c63b39d6Schristos                                                                        \
1355c63b39d6Schristos   /* linker_mark, linker_has_input, gc_mark, decompress_status,     */ \
1356c63b39d6Schristos      0,           0,                1,       0,                        \
1357c63b39d6Schristos                                                                        \
1358c63b39d6Schristos   /* segment_mark, sec_info_type, use_rela_p,                       */ \
1359c63b39d6Schristos      0,            0,             0,                                   \
1360c63b39d6Schristos                                                                        \
1361c63b39d6Schristos   /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5,    */ \
1362c63b39d6Schristos      0,        0,        0,        0,        0,        0,              \
1363c63b39d6Schristos                                                                        \
1364c63b39d6Schristos   /* vma, lma, size, rawsize, compressed_size, relax, relax_count,  */ \
1365c63b39d6Schristos      0,   0,   0,    0,       0,               0,     0,               \
1366c63b39d6Schristos                                                                        \
1367c63b39d6Schristos   /* output_offset, output_section, alignment_power,                */ \
1368fdeb0babSchristos      0,             &SEC,           0,                                 \
1369c63b39d6Schristos                                                                        \
1370c63b39d6Schristos   /* relocation, orelocation, reloc_count, filepos, rel_filepos,    */ \
1371c63b39d6Schristos      NULL,       NULL,        0,           0,       0,                 \
1372c63b39d6Schristos                                                                        \
1373c63b39d6Schristos   /* line_filepos, userdata, contents, lineno, lineno_count,        */ \
1374c63b39d6Schristos      0,            NULL,     NULL,     NULL,   0,                      \
1375c63b39d6Schristos                                                                        \
1376c63b39d6Schristos   /* entsize, kept_section, moving_line_filepos,                    */ \
1377c63b39d6Schristos      0,       NULL,         0,                                         \
1378c63b39d6Schristos                                                                        \
1379c63b39d6Schristos   /* target_index, used_by_bfd, constructor_chain, owner,           */ \
1380c63b39d6Schristos      0,            NULL,        NULL,              NULL,               \
1381c63b39d6Schristos                                                                        \
1382c63b39d6Schristos   /* symbol,                    symbol_ptr_ptr,                     */ \
1383c63b39d6Schristos      (struct bfd_symbol *) SYM, &SEC.symbol,                           \
1384c63b39d6Schristos                                                                        \
1385*fd82c4c4Schristos   /* map_head, map_tail, already_assigned                           */ \
1386*fd82c4c4Schristos      { NULL }, { NULL }, NULL                                          \
1387*fd82c4c4Schristos                                                                        \
1388c63b39d6Schristos     }
1389c63b39d6Schristos 
139077cd98dfSchristos /* We use a macro to initialize the static asymbol structures because
139177cd98dfSchristos    traditional C does not permit us to initialize a union member while
139277cd98dfSchristos    gcc warns if we don't initialize it.
139377cd98dfSchristos    the_bfd, name, value, attr, section [, udata]  */
139477cd98dfSchristos #ifdef __STDC__
139577cd98dfSchristos #define GLOBAL_SYM_INIT(NAME, SECTION) \
139677cd98dfSchristos   { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
139777cd98dfSchristos #else
139877cd98dfSchristos #define GLOBAL_SYM_INIT(NAME, SECTION) \
139977cd98dfSchristos   { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
140077cd98dfSchristos #endif
140177cd98dfSchristos 
1402c63b39d6Schristos void bfd_section_list_clear (bfd *);
1403c63b39d6Schristos 
1404c63b39d6Schristos asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1405c63b39d6Schristos 
1406a636ddcaSmrg asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec);
1407fdeb0babSchristos 
1408fdeb0babSchristos asection *bfd_get_linker_section (bfd *abfd, const char *name);
1409fdeb0babSchristos 
1410c63b39d6Schristos asection *bfd_get_section_by_name_if
1411c63b39d6Schristos    (bfd *abfd,
1412c63b39d6Schristos     const char *name,
1413c63b39d6Schristos     bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
1414c63b39d6Schristos     void *obj);
1415c63b39d6Schristos 
1416c63b39d6Schristos char *bfd_get_unique_section_name
1417c63b39d6Schristos    (bfd *abfd, const char *templat, int *count);
1418c63b39d6Schristos 
1419c63b39d6Schristos asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1420c63b39d6Schristos 
1421c63b39d6Schristos asection *bfd_make_section_anyway_with_flags
1422c63b39d6Schristos    (bfd *abfd, const char *name, flagword flags);
1423c63b39d6Schristos 
1424c63b39d6Schristos asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1425c63b39d6Schristos 
1426c63b39d6Schristos asection *bfd_make_section_with_flags
1427c63b39d6Schristos    (bfd *, const char *name, flagword flags);
1428c63b39d6Schristos 
1429c63b39d6Schristos asection *bfd_make_section (bfd *, const char *name);
1430c63b39d6Schristos 
1431*fd82c4c4Schristos bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
1432c63b39d6Schristos 
1433c63b39d6Schristos void bfd_rename_section
1434*fd82c4c4Schristos    (asection *sec, const char *newname);
1435c63b39d6Schristos 
1436c63b39d6Schristos void bfd_map_over_sections
1437c63b39d6Schristos    (bfd *abfd,
1438c63b39d6Schristos     void (*func) (bfd *abfd, asection *sect, void *obj),
1439c63b39d6Schristos     void *obj);
1440c63b39d6Schristos 
1441c63b39d6Schristos asection *bfd_sections_find_if
1442c63b39d6Schristos    (bfd *abfd,
1443c63b39d6Schristos     bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
1444c63b39d6Schristos     void *obj);
1445c63b39d6Schristos 
1446*fd82c4c4Schristos bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val);
1447c63b39d6Schristos 
1448c63b39d6Schristos bfd_boolean bfd_set_section_contents
1449c63b39d6Schristos    (bfd *abfd, asection *section, const void *data,
1450c63b39d6Schristos     file_ptr offset, bfd_size_type count);
1451c63b39d6Schristos 
1452c63b39d6Schristos bfd_boolean bfd_get_section_contents
1453c63b39d6Schristos    (bfd *abfd, asection *section, void *location, file_ptr offset,
1454c63b39d6Schristos     bfd_size_type count);
1455c63b39d6Schristos 
1456c63b39d6Schristos bfd_boolean bfd_malloc_and_get_section
1457c63b39d6Schristos    (bfd *abfd, asection *section, bfd_byte **buf);
1458c63b39d6Schristos 
1459c63b39d6Schristos bfd_boolean bfd_copy_private_section_data
1460c63b39d6Schristos    (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1461c63b39d6Schristos 
1462c63b39d6Schristos #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1463c63b39d6Schristos        BFD_SEND (obfd, _bfd_copy_private_section_data, \
1464c63b39d6Schristos                  (ibfd, isection, obfd, osection))
1465c63b39d6Schristos bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
1466c63b39d6Schristos 
1467*fd82c4c4Schristos const char *bfd_generic_group_name (bfd *, const asection *sec);
1468*fd82c4c4Schristos 
1469c63b39d6Schristos bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1470c63b39d6Schristos 
1471c63b39d6Schristos /* Extracted from archures.c.  */
1472c63b39d6Schristos enum bfd_architecture
1473c63b39d6Schristos {
1474c63b39d6Schristos   bfd_arch_unknown,   /* File arch not known.  */
1475c63b39d6Schristos   bfd_arch_obscure,   /* Arch known, not one of these.  */
147677cd98dfSchristos   bfd_arch_m68k,      /* Motorola 68xxx.  */
1477c63b39d6Schristos #define bfd_mach_m68000                1
1478c63b39d6Schristos #define bfd_mach_m68008                2
1479c63b39d6Schristos #define bfd_mach_m68010                3
1480c63b39d6Schristos #define bfd_mach_m68020                4
1481c63b39d6Schristos #define bfd_mach_m68030                5
1482c63b39d6Schristos #define bfd_mach_m68040                6
1483c63b39d6Schristos #define bfd_mach_m68060                7
1484c63b39d6Schristos #define bfd_mach_cpu32                 8
1485c63b39d6Schristos #define bfd_mach_fido                  9
1486c63b39d6Schristos #define bfd_mach_mcf_isa_a_nodiv       10
1487c63b39d6Schristos #define bfd_mach_mcf_isa_a             11
1488c63b39d6Schristos #define bfd_mach_mcf_isa_a_mac         12
1489c63b39d6Schristos #define bfd_mach_mcf_isa_a_emac        13
1490c63b39d6Schristos #define bfd_mach_mcf_isa_aplus         14
1491c63b39d6Schristos #define bfd_mach_mcf_isa_aplus_mac     15
1492c63b39d6Schristos #define bfd_mach_mcf_isa_aplus_emac    16
1493c63b39d6Schristos #define bfd_mach_mcf_isa_b_nousp       17
1494c63b39d6Schristos #define bfd_mach_mcf_isa_b_nousp_mac   18
1495c63b39d6Schristos #define bfd_mach_mcf_isa_b_nousp_emac  19
1496c63b39d6Schristos #define bfd_mach_mcf_isa_b             20
1497c63b39d6Schristos #define bfd_mach_mcf_isa_b_mac         21
1498c63b39d6Schristos #define bfd_mach_mcf_isa_b_emac        22
1499c63b39d6Schristos #define bfd_mach_mcf_isa_b_float       23
1500c63b39d6Schristos #define bfd_mach_mcf_isa_b_float_mac   24
1501c63b39d6Schristos #define bfd_mach_mcf_isa_b_float_emac  25
1502c63b39d6Schristos #define bfd_mach_mcf_isa_c             26
1503c63b39d6Schristos #define bfd_mach_mcf_isa_c_mac         27
1504c63b39d6Schristos #define bfd_mach_mcf_isa_c_emac        28
1505c63b39d6Schristos #define bfd_mach_mcf_isa_c_nodiv       29
1506c63b39d6Schristos #define bfd_mach_mcf_isa_c_nodiv_mac   30
1507c63b39d6Schristos #define bfd_mach_mcf_isa_c_nodiv_emac  31
150877cd98dfSchristos   bfd_arch_vax,       /* DEC Vax.  */
1509c63b39d6Schristos 
151077cd98dfSchristos   bfd_arch_or1k,      /* OpenRISC 1000.  */
1511b511d482Schristos #define bfd_mach_or1k          1
1512b511d482Schristos #define bfd_mach_or1knd        2
1513c63b39d6Schristos 
151477cd98dfSchristos   bfd_arch_sparc,     /* SPARC.  */
1515c63b39d6Schristos #define bfd_mach_sparc                 1
1516c63b39d6Schristos /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
1517c63b39d6Schristos #define bfd_mach_sparc_sparclet        2
1518c63b39d6Schristos #define bfd_mach_sparc_sparclite       3
1519c63b39d6Schristos #define bfd_mach_sparc_v8plus          4
1520c63b39d6Schristos #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
1521c63b39d6Schristos #define bfd_mach_sparc_sparclite_le    6
1522c63b39d6Schristos #define bfd_mach_sparc_v9              7
1523c63b39d6Schristos #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
1524c63b39d6Schristos #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
1525c63b39d6Schristos #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
1526a636ddcaSmrg #define bfd_mach_sparc_v8plusc         11 /* with UA2005 and T1 add'ns.  */
1527a636ddcaSmrg #define bfd_mach_sparc_v9c             12 /* with UA2005 and T1 add'ns.  */
1528a636ddcaSmrg #define bfd_mach_sparc_v8plusd         13 /* with UA2007 and T3 add'ns.  */
1529a636ddcaSmrg #define bfd_mach_sparc_v9d             14 /* with UA2007 and T3 add'ns.  */
1530a636ddcaSmrg #define bfd_mach_sparc_v8pluse         15 /* with OSA2001 and T4 add'ns (no IMA).  */
1531a636ddcaSmrg #define bfd_mach_sparc_v9e             16 /* with OSA2001 and T4 add'ns (no IMA).  */
1532a636ddcaSmrg #define bfd_mach_sparc_v8plusv         17 /* with OSA2011 and T4 and IMA and FJMAU add'ns.  */
1533a636ddcaSmrg #define bfd_mach_sparc_v9v             18 /* with OSA2011 and T4 and IMA and FJMAU add'ns.  */
1534a636ddcaSmrg #define bfd_mach_sparc_v8plusm         19 /* with OSA2015 and M7 add'ns.  */
1535a636ddcaSmrg #define bfd_mach_sparc_v9m             20 /* with OSA2015 and M7 add'ns.  */
153677cd98dfSchristos #define bfd_mach_sparc_v8plusm8        21 /* with OSA2017 and M8 add'ns.  */
153777cd98dfSchristos #define bfd_mach_sparc_v9m8            22 /* with OSA2017 and M8 add'ns.  */
1538c63b39d6Schristos /* Nonzero if MACH has the v9 instruction set.  */
1539c63b39d6Schristos #define bfd_mach_sparc_v9_p(mach) \
154077cd98dfSchristos   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \
1541c63b39d6Schristos    && (mach) != bfd_mach_sparc_sparclite_le)
1542c63b39d6Schristos /* Nonzero if MACH is a 64 bit sparc architecture.  */
1543c63b39d6Schristos #define bfd_mach_sparc_64bit_p(mach) \
1544a636ddcaSmrg   ((mach) >= bfd_mach_sparc_v9 \
1545a636ddcaSmrg    && (mach) != bfd_mach_sparc_v8plusb \
1546a636ddcaSmrg    && (mach) != bfd_mach_sparc_v8plusc \
1547a636ddcaSmrg    && (mach) != bfd_mach_sparc_v8plusd \
1548a636ddcaSmrg    && (mach) != bfd_mach_sparc_v8pluse \
1549a636ddcaSmrg    && (mach) != bfd_mach_sparc_v8plusv \
155077cd98dfSchristos    && (mach) != bfd_mach_sparc_v8plusm \
155177cd98dfSchristos    && (mach) != bfd_mach_sparc_v8plusm8)
155277cd98dfSchristos   bfd_arch_spu,       /* PowerPC SPU.  */
1553c63b39d6Schristos #define bfd_mach_spu           256
155477cd98dfSchristos   bfd_arch_mips,      /* MIPS Rxxxx.  */
1555c63b39d6Schristos #define bfd_mach_mips3000              3000
1556c63b39d6Schristos #define bfd_mach_mips3900              3900
1557c63b39d6Schristos #define bfd_mach_mips4000              4000
1558c63b39d6Schristos #define bfd_mach_mips4010              4010
1559c63b39d6Schristos #define bfd_mach_mips4100              4100
1560c63b39d6Schristos #define bfd_mach_mips4111              4111
1561c63b39d6Schristos #define bfd_mach_mips4120              4120
1562c63b39d6Schristos #define bfd_mach_mips4300              4300
1563c63b39d6Schristos #define bfd_mach_mips4400              4400
1564c63b39d6Schristos #define bfd_mach_mips4600              4600
1565c63b39d6Schristos #define bfd_mach_mips4650              4650
1566c63b39d6Schristos #define bfd_mach_mips5000              5000
1567c63b39d6Schristos #define bfd_mach_mips5400              5400
1568c63b39d6Schristos #define bfd_mach_mips5500              5500
1569fdeb0babSchristos #define bfd_mach_mips5900              5900
1570c63b39d6Schristos #define bfd_mach_mips6000              6000
1571c63b39d6Schristos #define bfd_mach_mips7000              7000
1572c63b39d6Schristos #define bfd_mach_mips8000              8000
1573c63b39d6Schristos #define bfd_mach_mips9000              9000
1574c63b39d6Schristos #define bfd_mach_mips10000             10000
1575c63b39d6Schristos #define bfd_mach_mips12000             12000
1576c63b39d6Schristos #define bfd_mach_mips14000             14000
1577c63b39d6Schristos #define bfd_mach_mips16000             16000
1578c63b39d6Schristos #define bfd_mach_mips16                16
1579c63b39d6Schristos #define bfd_mach_mips5                 5
1580c63b39d6Schristos #define bfd_mach_mips_loongson_2e      3001
1581c63b39d6Schristos #define bfd_mach_mips_loongson_2f      3002
158277cd98dfSchristos #define bfd_mach_mips_gs464            3003
158377cd98dfSchristos #define bfd_mach_mips_gs464e           3004
158477cd98dfSchristos #define bfd_mach_mips_gs264e           3005
158577cd98dfSchristos #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01.  */
1586c63b39d6Schristos #define bfd_mach_mips_octeon           6501
1587fdeb0babSchristos #define bfd_mach_mips_octeonp          6601
1588fdeb0babSchristos #define bfd_mach_mips_octeon2          6502
1589b511d482Schristos #define bfd_mach_mips_octeon3          6503
159077cd98dfSchristos #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'.  */
159177cd98dfSchristos #define bfd_mach_mips_interaptiv_mr2   736550   /* decimal 'IA2'.  */
1592c63b39d6Schristos #define bfd_mach_mipsisa32             32
1593c63b39d6Schristos #define bfd_mach_mipsisa32r2           33
1594b511d482Schristos #define bfd_mach_mipsisa32r3           34
1595b511d482Schristos #define bfd_mach_mipsisa32r5           36
1596b511d482Schristos #define bfd_mach_mipsisa32r6           37
1597c63b39d6Schristos #define bfd_mach_mipsisa64             64
1598c63b39d6Schristos #define bfd_mach_mipsisa64r2           65
1599b511d482Schristos #define bfd_mach_mipsisa64r3           66
1600b511d482Schristos #define bfd_mach_mipsisa64r5           68
1601b511d482Schristos #define bfd_mach_mipsisa64r6           69
1602fdeb0babSchristos #define bfd_mach_mips_micromips        96
160377cd98dfSchristos   bfd_arch_i386,      /* Intel 386.  */
1604fdeb0babSchristos #define bfd_mach_i386_intel_syntax     (1 << 0)
1605fdeb0babSchristos #define bfd_mach_i386_i8086            (1 << 1)
1606fdeb0babSchristos #define bfd_mach_i386_i386             (1 << 2)
1607fdeb0babSchristos #define bfd_mach_x86_64                (1 << 3)
1608fdeb0babSchristos #define bfd_mach_x64_32                (1 << 4)
1609fdeb0babSchristos #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
1610fdeb0babSchristos #define bfd_mach_x86_64_intel_syntax   (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
1611fdeb0babSchristos #define bfd_mach_x64_32_intel_syntax   (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
161277cd98dfSchristos   bfd_arch_l1om,      /* Intel L1OM.  */
1613fdeb0babSchristos #define bfd_mach_l1om                  (1 << 5)
1614fdeb0babSchristos #define bfd_mach_l1om_intel_syntax     (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
161577cd98dfSchristos   bfd_arch_k1om,      /* Intel K1OM.  */
1616fdeb0babSchristos #define bfd_mach_k1om                  (1 << 6)
1617fdeb0babSchristos #define bfd_mach_k1om_intel_syntax     (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
161877cd98dfSchristos   bfd_arch_iamcu,     /* Intel MCU.  */
1619e8beca2cSchristos #define bfd_mach_iamcu                 (1 << 8)
1620e8beca2cSchristos #define bfd_mach_i386_iamcu            (bfd_mach_i386_i386 | bfd_mach_iamcu)
1621e8beca2cSchristos #define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
162277cd98dfSchristos   bfd_arch_romp,      /* IBM ROMP PC/RT.  */
162377cd98dfSchristos   bfd_arch_convex,    /* Convex.  */
162477cd98dfSchristos   bfd_arch_m98k,      /* Motorola 98xxx.  */
162577cd98dfSchristos   bfd_arch_pyramid,   /* Pyramid Technology.  */
162677cd98dfSchristos   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300).  */
1627c63b39d6Schristos #define bfd_mach_h8300         1
1628c63b39d6Schristos #define bfd_mach_h8300h        2
1629c63b39d6Schristos #define bfd_mach_h8300s        3
1630c63b39d6Schristos #define bfd_mach_h8300hn       4
1631c63b39d6Schristos #define bfd_mach_h8300sn       5
1632c63b39d6Schristos #define bfd_mach_h8300sx       6
1633c63b39d6Schristos #define bfd_mach_h8300sxn      7
163477cd98dfSchristos   bfd_arch_pdp11,     /* DEC PDP-11.  */
163577cd98dfSchristos   bfd_arch_powerpc,   /* PowerPC.  */
1636c63b39d6Schristos #define bfd_mach_ppc           32
1637c63b39d6Schristos #define bfd_mach_ppc64         64
1638c63b39d6Schristos #define bfd_mach_ppc_403       403
1639c63b39d6Schristos #define bfd_mach_ppc_403gc     4030
1640c63b39d6Schristos #define bfd_mach_ppc_405       405
1641c63b39d6Schristos #define bfd_mach_ppc_505       505
1642c63b39d6Schristos #define bfd_mach_ppc_601       601
1643c63b39d6Schristos #define bfd_mach_ppc_602       602
1644c63b39d6Schristos #define bfd_mach_ppc_603       603
1645c63b39d6Schristos #define bfd_mach_ppc_ec603e    6031
1646c63b39d6Schristos #define bfd_mach_ppc_604       604
1647c63b39d6Schristos #define bfd_mach_ppc_620       620
1648c63b39d6Schristos #define bfd_mach_ppc_630       630
1649c63b39d6Schristos #define bfd_mach_ppc_750       750
1650c63b39d6Schristos #define bfd_mach_ppc_860       860
1651c63b39d6Schristos #define bfd_mach_ppc_a35       35
1652c63b39d6Schristos #define bfd_mach_ppc_rs64ii    642
1653c63b39d6Schristos #define bfd_mach_ppc_rs64iii   643
1654c63b39d6Schristos #define bfd_mach_ppc_7400      7400
1655c63b39d6Schristos #define bfd_mach_ppc_e500      500
1656c63b39d6Schristos #define bfd_mach_ppc_e500mc    5001
1657c63b39d6Schristos #define bfd_mach_ppc_e500mc64  5005
1658fdeb0babSchristos #define bfd_mach_ppc_e5500     5006
1659fdeb0babSchristos #define bfd_mach_ppc_e6500     5007
1660c63b39d6Schristos #define bfd_mach_ppc_titan     83
1661fdeb0babSchristos #define bfd_mach_ppc_vle       84
166277cd98dfSchristos   bfd_arch_rs6000,    /* IBM RS/6000.  */
1663c63b39d6Schristos #define bfd_mach_rs6k          6000
1664c63b39d6Schristos #define bfd_mach_rs6k_rs1      6001
1665c63b39d6Schristos #define bfd_mach_rs6k_rsc      6003
1666c63b39d6Schristos #define bfd_mach_rs6k_rs2      6002
166777cd98dfSchristos   bfd_arch_hppa,      /* HP PA RISC.  */
1668c63b39d6Schristos #define bfd_mach_hppa10        10
1669c63b39d6Schristos #define bfd_mach_hppa11        11
1670c63b39d6Schristos #define bfd_mach_hppa20        20
1671c63b39d6Schristos #define bfd_mach_hppa20w       25
167277cd98dfSchristos   bfd_arch_d10v,      /* Mitsubishi D10V.  */
1673c63b39d6Schristos #define bfd_mach_d10v          1
1674c63b39d6Schristos #define bfd_mach_d10v_ts2      2
1675c63b39d6Schristos #define bfd_mach_d10v_ts3      3
167677cd98dfSchristos   bfd_arch_d30v,      /* Mitsubishi D30V.  */
167777cd98dfSchristos   bfd_arch_dlx,       /* DLX.  */
167877cd98dfSchristos   bfd_arch_m68hc11,   /* Motorola 68HC11.  */
167977cd98dfSchristos   bfd_arch_m68hc12,   /* Motorola 68HC12.  */
1680c63b39d6Schristos #define bfd_mach_m6812_default 0
1681c63b39d6Schristos #define bfd_mach_m6812         1
1682c63b39d6Schristos #define bfd_mach_m6812s        2
168377cd98dfSchristos   bfd_arch_m9s12x,    /* Freescale S12X.  */
168477cd98dfSchristos   bfd_arch_m9s12xg,   /* Freescale XGATE.  */
168577cd98dfSchristos   bfd_arch_s12z,    /* Freescale S12Z.  */
168677cd98dfSchristos #define bfd_mach_s12z_default 0
168777cd98dfSchristos   bfd_arch_z8k,       /* Zilog Z8000.  */
1688c63b39d6Schristos #define bfd_mach_z8001         1
1689c63b39d6Schristos #define bfd_mach_z8002         2
169077cd98dfSchristos   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH).  */
1691c63b39d6Schristos #define bfd_mach_sh                            1
1692c63b39d6Schristos #define bfd_mach_sh2                           0x20
1693c63b39d6Schristos #define bfd_mach_sh_dsp                        0x2d
1694c63b39d6Schristos #define bfd_mach_sh2a                          0x2a
1695c63b39d6Schristos #define bfd_mach_sh2a_nofpu                    0x2b
1696c63b39d6Schristos #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
1697c63b39d6Schristos #define bfd_mach_sh2a_nofpu_or_sh3_nommu       0x2a2
1698c63b39d6Schristos #define bfd_mach_sh2a_or_sh4                   0x2a3
1699c63b39d6Schristos #define bfd_mach_sh2a_or_sh3e                  0x2a4
1700c63b39d6Schristos #define bfd_mach_sh2e                          0x2e
1701c63b39d6Schristos #define bfd_mach_sh3                           0x30
1702c63b39d6Schristos #define bfd_mach_sh3_nommu                     0x31
1703c63b39d6Schristos #define bfd_mach_sh3_dsp                       0x3d
1704c63b39d6Schristos #define bfd_mach_sh3e                          0x3e
1705c63b39d6Schristos #define bfd_mach_sh4                           0x40
1706c63b39d6Schristos #define bfd_mach_sh4_nofpu                     0x41
1707c63b39d6Schristos #define bfd_mach_sh4_nommu_nofpu               0x42
1708c63b39d6Schristos #define bfd_mach_sh4a                          0x4a
1709c63b39d6Schristos #define bfd_mach_sh4a_nofpu                    0x4b
1710c63b39d6Schristos #define bfd_mach_sh4al_dsp                     0x4d
171177cd98dfSchristos   bfd_arch_alpha,     /* Dec Alpha.  */
1712c63b39d6Schristos #define bfd_mach_alpha_ev4     0x10
1713c63b39d6Schristos #define bfd_mach_alpha_ev5     0x20
1714c63b39d6Schristos #define bfd_mach_alpha_ev6     0x30
1715c63b39d6Schristos   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
1716c63b39d6Schristos #define bfd_mach_arm_unknown   0
1717c63b39d6Schristos #define bfd_mach_arm_2         1
1718c63b39d6Schristos #define bfd_mach_arm_2a        2
1719c63b39d6Schristos #define bfd_mach_arm_3         3
1720c63b39d6Schristos #define bfd_mach_arm_3M        4
1721c63b39d6Schristos #define bfd_mach_arm_4         5
1722c63b39d6Schristos #define bfd_mach_arm_4T        6
1723c63b39d6Schristos #define bfd_mach_arm_5         7
1724c63b39d6Schristos #define bfd_mach_arm_5T        8
1725c63b39d6Schristos #define bfd_mach_arm_5TE       9
1726c63b39d6Schristos #define bfd_mach_arm_XScale    10
1727c63b39d6Schristos #define bfd_mach_arm_ep9312    11
1728c63b39d6Schristos #define bfd_mach_arm_iWMMXt    12
1729c63b39d6Schristos #define bfd_mach_arm_iWMMXt2   13
173077cd98dfSchristos #define bfd_mach_arm_5TEJ      14
173177cd98dfSchristos #define bfd_mach_arm_6         15
173277cd98dfSchristos #define bfd_mach_arm_6KZ       16
173377cd98dfSchristos #define bfd_mach_arm_6T2       17
173477cd98dfSchristos #define bfd_mach_arm_6K        18
173577cd98dfSchristos #define bfd_mach_arm_7         19
173677cd98dfSchristos #define bfd_mach_arm_6M        20
173777cd98dfSchristos #define bfd_mach_arm_6SM       21
173877cd98dfSchristos #define bfd_mach_arm_7EM       22
173977cd98dfSchristos #define bfd_mach_arm_8         23
174077cd98dfSchristos #define bfd_mach_arm_8R        24
174177cd98dfSchristos #define bfd_mach_arm_8M_BASE   25
174277cd98dfSchristos #define bfd_mach_arm_8M_MAIN   26
1743*fd82c4c4Schristos #define bfd_mach_arm_8_1M_MAIN 27
174477cd98dfSchristos   bfd_arch_nds32,     /* Andes NDS32.  */
174544a21023Schristos #define bfd_mach_n1            1
174644a21023Schristos #define bfd_mach_n1h           2
174744a21023Schristos #define bfd_mach_n1h_v2        3
174844a21023Schristos #define bfd_mach_n1h_v3        4
174944a21023Schristos #define bfd_mach_n1h_v3m       5
175077cd98dfSchristos   bfd_arch_ns32k,     /* National Semiconductors ns32000.  */
175177cd98dfSchristos   bfd_arch_tic30,     /* Texas Instruments TMS320C30.  */
175277cd98dfSchristos   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X.  */
1753c63b39d6Schristos #define bfd_mach_tic3x         30
1754c63b39d6Schristos #define bfd_mach_tic4x         40
175577cd98dfSchristos   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X.  */
175677cd98dfSchristos   bfd_arch_tic6x,     /* Texas Instruments TMS320C6X.  */
175777cd98dfSchristos   bfd_arch_v850,      /* NEC V850.  */
175877cd98dfSchristos   bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI).  */
1759c63b39d6Schristos #define bfd_mach_v850          1
1760c63b39d6Schristos #define bfd_mach_v850e         'E'
1761c63b39d6Schristos #define bfd_mach_v850e1        '1'
1762c63b39d6Schristos #define bfd_mach_v850e2        0x4532
1763c63b39d6Schristos #define bfd_mach_v850e2v3      0x45325633
176477cd98dfSchristos #define bfd_mach_v850e3v5      0x45335635 /* ('E'|'3'|'V'|'5').  */
176577cd98dfSchristos   bfd_arch_arc,       /* ARC Cores.  */
1766a636ddcaSmrg #define bfd_mach_arc_a4        0
1767a636ddcaSmrg #define bfd_mach_arc_a5        1
1768a636ddcaSmrg #define bfd_mach_arc_arc600    2
1769a636ddcaSmrg #define bfd_mach_arc_arc601    4
1770a636ddcaSmrg #define bfd_mach_arc_arc700    3
1771a636ddcaSmrg #define bfd_mach_arc_arcv2     5
1772c63b39d6Schristos  bfd_arch_m32c,       /* Renesas M16C/M32C.  */
1773c63b39d6Schristos #define bfd_mach_m16c          0x75
1774c63b39d6Schristos #define bfd_mach_m32c          0x78
177577cd98dfSchristos   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D).  */
1776c63b39d6Schristos #define bfd_mach_m32r          1 /* For backwards compatibility.  */
1777c63b39d6Schristos #define bfd_mach_m32rx         'x'
1778c63b39d6Schristos #define bfd_mach_m32r2         '2'
177977cd98dfSchristos   bfd_arch_mn10200,   /* Matsushita MN10200.  */
178077cd98dfSchristos   bfd_arch_mn10300,   /* Matsushita MN10300.  */
1781c63b39d6Schristos #define bfd_mach_mn10300       300
1782c63b39d6Schristos #define bfd_mach_am33          330
1783c63b39d6Schristos #define bfd_mach_am33_2        332
1784c63b39d6Schristos   bfd_arch_fr30,
1785c63b39d6Schristos #define bfd_mach_fr30          0x46523330
1786c63b39d6Schristos   bfd_arch_frv,
1787c63b39d6Schristos #define bfd_mach_frv           1
1788c63b39d6Schristos #define bfd_mach_frvsimple     2
1789c63b39d6Schristos #define bfd_mach_fr300         300
1790c63b39d6Schristos #define bfd_mach_fr400         400
1791c63b39d6Schristos #define bfd_mach_fr450         450
179277cd98dfSchristos #define bfd_mach_frvtomcat     499     /* fr500 prototype.  */
1793c63b39d6Schristos #define bfd_mach_fr500         500
1794c63b39d6Schristos #define bfd_mach_fr550         550
179577cd98dfSchristos   bfd_arch_moxie,     /* The moxie processor.  */
1796c63b39d6Schristos #define bfd_mach_moxie         1
179777cd98dfSchristos   bfd_arch_ft32,      /* The ft32 processor.  */
1798e8beca2cSchristos #define bfd_mach_ft32          1
179977cd98dfSchristos #define bfd_mach_ft32b         2
1800c63b39d6Schristos   bfd_arch_mcore,
1801c63b39d6Schristos   bfd_arch_mep,
1802c63b39d6Schristos #define bfd_mach_mep           1
1803c63b39d6Schristos #define bfd_mach_mep_h1        0x6831
1804c63b39d6Schristos #define bfd_mach_mep_c5        0x6335
1805fdeb0babSchristos   bfd_arch_metag,
1806fdeb0babSchristos #define bfd_mach_metag         1
180777cd98dfSchristos   bfd_arch_ia64,      /* HP/Intel ia64.  */
1808c63b39d6Schristos #define bfd_mach_ia64_elf64    64
1809c63b39d6Schristos #define bfd_mach_ia64_elf32    32
1810c63b39d6Schristos   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
1811c63b39d6Schristos #define bfd_mach_ip2022        1
1812c63b39d6Schristos #define bfd_mach_ip2022ext     2
1813c63b39d6Schristos  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
1814c63b39d6Schristos #define bfd_mach_iq2000        1
1815c63b39d6Schristos #define bfd_mach_iq10          2
1816*fd82c4c4Schristos   bfd_arch_bpf,       /* Linux eBPF.  */
1817*fd82c4c4Schristos #define bfd_mach_bpf           1
1818*fd82c4c4Schristos #define bfd_mach_xbpf          2
181977cd98dfSchristos   bfd_arch_epiphany,  /* Adapteva EPIPHANY.  */
1820fdeb0babSchristos #define bfd_mach_epiphany16    1
1821fdeb0babSchristos #define bfd_mach_epiphany32    2
1822c63b39d6Schristos   bfd_arch_mt,
1823c63b39d6Schristos #define bfd_mach_ms1           1
1824c63b39d6Schristos #define bfd_mach_mrisc2        2
1825c63b39d6Schristos #define bfd_mach_ms2           3
1826c63b39d6Schristos   bfd_arch_pj,
1827c63b39d6Schristos   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
1828c63b39d6Schristos #define bfd_mach_avr1          1
1829c63b39d6Schristos #define bfd_mach_avr2          2
1830c63b39d6Schristos #define bfd_mach_avr25         25
1831c63b39d6Schristos #define bfd_mach_avr3          3
1832c63b39d6Schristos #define bfd_mach_avr31         31
1833c63b39d6Schristos #define bfd_mach_avr35         35
1834c63b39d6Schristos #define bfd_mach_avr4          4
1835c63b39d6Schristos #define bfd_mach_avr5          5
1836c63b39d6Schristos #define bfd_mach_avr51         51
1837c63b39d6Schristos #define bfd_mach_avr6          6
1838b511d482Schristos #define bfd_mach_avrtiny       100
1839c63b39d6Schristos #define bfd_mach_avrxmega1     101
1840c63b39d6Schristos #define bfd_mach_avrxmega2     102
1841c63b39d6Schristos #define bfd_mach_avrxmega3     103
1842c63b39d6Schristos #define bfd_mach_avrxmega4     104
1843c63b39d6Schristos #define bfd_mach_avrxmega5     105
1844c63b39d6Schristos #define bfd_mach_avrxmega6     106
1845c63b39d6Schristos #define bfd_mach_avrxmega7     107
184677cd98dfSchristos   bfd_arch_bfin,      /* ADI Blackfin.  */
1847c63b39d6Schristos #define bfd_mach_bfin          1
1848c63b39d6Schristos   bfd_arch_cr16,      /* National Semiconductor CompactRISC (ie CR16).  */
1849c63b39d6Schristos #define bfd_mach_cr16          1
1850c63b39d6Schristos   bfd_arch_crx,       /*  National Semiconductor CRX.  */
1851c63b39d6Schristos #define bfd_mach_crx           1
185277cd98dfSchristos   bfd_arch_cris,      /* Axis CRIS.  */
1853c63b39d6Schristos #define bfd_mach_cris_v0_v10   255
1854c63b39d6Schristos #define bfd_mach_cris_v32      32
1855c63b39d6Schristos #define bfd_mach_cris_v10_v32  1032
18569bc6a05dSchristos   bfd_arch_riscv,
18579bc6a05dSchristos #define bfd_mach_riscv32       132
18589bc6a05dSchristos #define bfd_mach_riscv64       164
1859fdeb0babSchristos   bfd_arch_rl78,
1860fdeb0babSchristos #define bfd_mach_rl78          0x75
1861c63b39d6Schristos   bfd_arch_rx,        /* Renesas RX.  */
1862c63b39d6Schristos #define bfd_mach_rx            0x75
186377cd98dfSchristos #define bfd_mach_rx_v2         0x76
186477cd98dfSchristos #define bfd_mach_rx_v3         0x77
186577cd98dfSchristos   bfd_arch_s390,      /* IBM s390.  */
1866c63b39d6Schristos #define bfd_mach_s390_31       31
1867c63b39d6Schristos #define bfd_mach_s390_64       64
186877cd98dfSchristos   bfd_arch_score,     /* Sunplus score.  */
1869c63b39d6Schristos #define bfd_mach_score3        3
1870c63b39d6Schristos #define bfd_mach_score7        7
1871c63b39d6Schristos   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
1872c63b39d6Schristos   bfd_arch_xstormy16,
1873c63b39d6Schristos #define bfd_mach_xstormy16     1
1874c63b39d6Schristos   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
1875c63b39d6Schristos #define bfd_mach_msp11         11
1876c63b39d6Schristos #define bfd_mach_msp110        110
1877c63b39d6Schristos #define bfd_mach_msp12         12
1878c63b39d6Schristos #define bfd_mach_msp13         13
1879c63b39d6Schristos #define bfd_mach_msp14         14
1880c63b39d6Schristos #define bfd_mach_msp15         15
1881c63b39d6Schristos #define bfd_mach_msp16         16
188244a21023Schristos #define bfd_mach_msp20         20
1883c63b39d6Schristos #define bfd_mach_msp21         21
188444a21023Schristos #define bfd_mach_msp22         22
188544a21023Schristos #define bfd_mach_msp23         23
188644a21023Schristos #define bfd_mach_msp24         24
188744a21023Schristos #define bfd_mach_msp26         26
1888c63b39d6Schristos #define bfd_mach_msp31         31
1889c63b39d6Schristos #define bfd_mach_msp32         32
1890c63b39d6Schristos #define bfd_mach_msp33         33
1891c63b39d6Schristos #define bfd_mach_msp41         41
1892c63b39d6Schristos #define bfd_mach_msp42         42
1893c63b39d6Schristos #define bfd_mach_msp43         43
1894c63b39d6Schristos #define bfd_mach_msp44         44
189544a21023Schristos #define bfd_mach_msp430x       45
189644a21023Schristos #define bfd_mach_msp46         46
189744a21023Schristos #define bfd_mach_msp47         47
189844a21023Schristos #define bfd_mach_msp54         54
1899c63b39d6Schristos   bfd_arch_xc16x,     /* Infineon's XC16X Series.  */
1900c63b39d6Schristos #define bfd_mach_xc16x         1
1901c63b39d6Schristos #define bfd_mach_xc16xl        2
1902c63b39d6Schristos #define bfd_mach_xc16xs        3
190377cd98dfSchristos   bfd_arch_xgate,     /* Freescale XGATE.  */
1904fdeb0babSchristos #define bfd_mach_xgate         1
1905c63b39d6Schristos   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
1906c63b39d6Schristos #define bfd_mach_xtensa        1
1907c63b39d6Schristos   bfd_arch_z80,
1908*fd82c4c4Schristos /* Zilog Z80 without undocumented opcodes.  */
1909*fd82c4c4Schristos #define bfd_mach_z80strict     1
1910*fd82c4c4Schristos /* Zilog Z180: successor with additional instructions, but without
1911*fd82c4c4Schristos  halves of ix and iy.  */
1912*fd82c4c4Schristos #define bfd_mach_z180          2
1913*fd82c4c4Schristos /* Zilog Z80 with ixl, ixh, iyl, and iyh.  */
1914*fd82c4c4Schristos #define bfd_mach_z80           3
1915*fd82c4c4Schristos /* Zilog eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode.  */
1916*fd82c4c4Schristos #define bfd_mach_ez80_z80      4
1917*fd82c4c4Schristos /* Zilog eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode.  */
1918*fd82c4c4Schristos #define bfd_mach_ez80_adl      5
1919*fd82c4c4Schristos /* Z80N */
1920*fd82c4c4Schristos #define bfd_mach_z80n          6
1921*fd82c4c4Schristos /* Zilog Z80 with all undocumented instructions.  */
1922*fd82c4c4Schristos #define bfd_mach_z80full       7
1923*fd82c4c4Schristos /* GameBoy Z80 (reduced instruction set).  */
1924*fd82c4c4Schristos #define bfd_mach_gbz80         8
1925*fd82c4c4Schristos /* ASCII R800: successor with multiplication.  */
1926*fd82c4c4Schristos #define bfd_mach_r800          11
192777cd98dfSchristos   bfd_arch_lm32,      /* Lattice Mico32.  */
1928c63b39d6Schristos #define bfd_mach_lm32          1
1929c63b39d6Schristos   bfd_arch_microblaze,/* Xilinx MicroBlaze.  */
193077cd98dfSchristos   bfd_arch_tilepro,   /* Tilera TILEPro.  */
193177cd98dfSchristos   bfd_arch_tilegx,    /* Tilera TILE-Gx.  */
1932fdeb0babSchristos #define bfd_mach_tilepro       1
1933fdeb0babSchristos #define bfd_mach_tilegx        1
1934fdeb0babSchristos #define bfd_mach_tilegx32      2
193577cd98dfSchristos   bfd_arch_aarch64,   /* AArch64.  */
1936fdeb0babSchristos #define bfd_mach_aarch64 0
1937*fd82c4c4Schristos #define bfd_mach_aarch64_8R    1
193844a21023Schristos #define bfd_mach_aarch64_ilp32 32
193977cd98dfSchristos   bfd_arch_nios2,     /* Nios II.  */
1940fdeb0babSchristos #define bfd_mach_nios2         0
1941e8beca2cSchristos #define bfd_mach_nios2r1       1
1942e8beca2cSchristos #define bfd_mach_nios2r2       2
194377cd98dfSchristos   bfd_arch_visium,    /* Visium.  */
1944b511d482Schristos #define bfd_mach_visium        1
194577cd98dfSchristos   bfd_arch_wasm32,    /* WebAssembly.  */
19469bc6a05dSchristos #define bfd_mach_wasm32        1
194777cd98dfSchristos   bfd_arch_pru,       /* PRU.  */
19489bc6a05dSchristos #define bfd_mach_pru           0
194977cd98dfSchristos   bfd_arch_nfp,       /* Netronome Flow Processor */
195077cd98dfSchristos #define bfd_mach_nfp3200       0x3200
195177cd98dfSchristos #define bfd_mach_nfp6000       0x6000
195277cd98dfSchristos   bfd_arch_csky,      /* C-SKY.  */
195377cd98dfSchristos #define bfd_mach_ck_unknown    0
195477cd98dfSchristos #define bfd_mach_ck510         1
195577cd98dfSchristos #define bfd_mach_ck610         2
195677cd98dfSchristos #define bfd_mach_ck801         3
195777cd98dfSchristos #define bfd_mach_ck802         4
195877cd98dfSchristos #define bfd_mach_ck803         5
195977cd98dfSchristos #define bfd_mach_ck807         6
196077cd98dfSchristos #define bfd_mach_ck810         7
1961*fd82c4c4Schristos #define bfd_mach_ck860         8
1962c63b39d6Schristos   bfd_arch_last
1963c63b39d6Schristos   };
1964c63b39d6Schristos 
1965c63b39d6Schristos typedef struct bfd_arch_info
1966c63b39d6Schristos {
1967c63b39d6Schristos   int bits_per_word;
1968c63b39d6Schristos   int bits_per_address;
1969c63b39d6Schristos   int bits_per_byte;
1970c63b39d6Schristos   enum bfd_architecture arch;
1971c63b39d6Schristos   unsigned long mach;
1972c63b39d6Schristos   const char *arch_name;
1973c63b39d6Schristos   const char *printable_name;
1974c63b39d6Schristos   unsigned int section_align_power;
1975c63b39d6Schristos   /* TRUE if this is the default machine for the architecture.
1976c63b39d6Schristos      The default arch should be the first entry for an arch so that
1977c63b39d6Schristos      all the entries for that arch can be accessed via <<next>>.  */
1978c63b39d6Schristos   bfd_boolean the_default;
197977cd98dfSchristos   const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
198077cd98dfSchristos                                               const struct bfd_arch_info *);
1981c63b39d6Schristos 
1982c63b39d6Schristos   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
1983c63b39d6Schristos 
1984fdeb0babSchristos   /* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
1985fdeb0babSchristos      IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
1986fdeb0babSchristos      TRUE, the buffer contains code.  */
1987fdeb0babSchristos   void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
1988fdeb0babSchristos                  bfd_boolean code);
1989fdeb0babSchristos 
1990c63b39d6Schristos   const struct bfd_arch_info *next;
1991*fd82c4c4Schristos 
1992*fd82c4c4Schristos   /* On some architectures the offset for a relocation can point into
1993*fd82c4c4Schristos      the middle of an instruction.  This field specifies the maximum
1994*fd82c4c4Schristos      offset such a relocation can have (in octets).  This affects the
1995*fd82c4c4Schristos      behaviour of the disassembler, since a value greater than zero
1996*fd82c4c4Schristos      means that it may need to disassemble an instruction twice, once
1997*fd82c4c4Schristos      to get its length and then a second time to display it.  If the
1998*fd82c4c4Schristos      value is negative then this has to be done for every single
1999*fd82c4c4Schristos      instruction, regardless of the offset of the reloc.  */
2000*fd82c4c4Schristos   signed int max_reloc_offset_into_insn;
2001c63b39d6Schristos }
2002c63b39d6Schristos bfd_arch_info_type;
2003c63b39d6Schristos 
2004c63b39d6Schristos const char *bfd_printable_name (bfd *abfd);
2005c63b39d6Schristos 
2006c63b39d6Schristos const bfd_arch_info_type *bfd_scan_arch (const char *string);
2007c63b39d6Schristos 
2008c63b39d6Schristos const char **bfd_arch_list (void);
2009c63b39d6Schristos 
2010c63b39d6Schristos const bfd_arch_info_type *bfd_arch_get_compatible
2011c63b39d6Schristos    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
2012c63b39d6Schristos 
2013c63b39d6Schristos void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
2014c63b39d6Schristos 
2015a636ddcaSmrg bfd_boolean bfd_default_set_arch_mach
2016a636ddcaSmrg    (bfd *abfd, enum bfd_architecture arch, unsigned long mach);
2017a636ddcaSmrg 
2018*fd82c4c4Schristos enum bfd_architecture bfd_get_arch (const bfd *abfd);
2019c63b39d6Schristos 
2020*fd82c4c4Schristos unsigned long bfd_get_mach (const bfd *abfd);
2021c63b39d6Schristos 
2022*fd82c4c4Schristos unsigned int bfd_arch_bits_per_byte (const bfd *abfd);
2023c63b39d6Schristos 
2024*fd82c4c4Schristos unsigned int bfd_arch_bits_per_address (const bfd *abfd);
2025c63b39d6Schristos 
2026c63b39d6Schristos const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
2027c63b39d6Schristos 
2028c63b39d6Schristos const bfd_arch_info_type *bfd_lookup_arch
2029c63b39d6Schristos    (enum bfd_architecture arch, unsigned long machine);
2030c63b39d6Schristos 
2031c63b39d6Schristos const char *bfd_printable_arch_mach
2032c63b39d6Schristos    (enum bfd_architecture arch, unsigned long machine);
2033c63b39d6Schristos 
2034*fd82c4c4Schristos unsigned int bfd_octets_per_byte (const bfd *abfd,
2035*fd82c4c4Schristos     const asection *sec);
2036c63b39d6Schristos 
2037c63b39d6Schristos unsigned int bfd_arch_mach_octets_per_byte
2038c63b39d6Schristos    (enum bfd_architecture arch, unsigned long machine);
2039c63b39d6Schristos 
2040c63b39d6Schristos /* Extracted from reloc.c.  */
2041b511d482Schristos 
2042c63b39d6Schristos typedef enum bfd_reloc_status
2043c63b39d6Schristos {
204477cd98dfSchristos   /* No errors detected.  Note - the value 2 is used so that it
204577cd98dfSchristos      will not be mistaken for the boolean TRUE or FALSE values.  */
204677cd98dfSchristos   bfd_reloc_ok = 2,
2047c63b39d6Schristos 
2048c63b39d6Schristos   /* The relocation was performed, but there was an overflow.  */
2049c63b39d6Schristos   bfd_reloc_overflow,
2050c63b39d6Schristos 
2051c63b39d6Schristos   /* The address to relocate was not within the section supplied.  */
2052c63b39d6Schristos   bfd_reloc_outofrange,
2053c63b39d6Schristos 
2054c63b39d6Schristos   /* Used by special functions.  */
2055c63b39d6Schristos   bfd_reloc_continue,
2056c63b39d6Schristos 
2057c63b39d6Schristos   /* Unsupported relocation size requested.  */
2058c63b39d6Schristos   bfd_reloc_notsupported,
2059c63b39d6Schristos 
2060c63b39d6Schristos   /* Unused.  */
2061c63b39d6Schristos   bfd_reloc_other,
2062c63b39d6Schristos 
2063c63b39d6Schristos   /* The symbol to relocate against was undefined.  */
2064c63b39d6Schristos   bfd_reloc_undefined,
2065c63b39d6Schristos 
206677cd98dfSchristos   /* The relocation was performed, but may not be ok.  If this type is
206777cd98dfSchristos      returned, the error_message argument to bfd_perform_relocation
206877cd98dfSchristos      will be set.  */
2069c63b39d6Schristos   bfd_reloc_dangerous
2070c63b39d6Schristos  }
2071c63b39d6Schristos  bfd_reloc_status_type;
2072c63b39d6Schristos 
207377cd98dfSchristos typedef const struct reloc_howto_struct reloc_howto_type;
2074c63b39d6Schristos 
2075c63b39d6Schristos typedef struct reloc_cache_entry
2076c63b39d6Schristos {
2077c63b39d6Schristos   /* A pointer into the canonical table of pointers.  */
2078c63b39d6Schristos   struct bfd_symbol **sym_ptr_ptr;
2079c63b39d6Schristos 
2080c63b39d6Schristos   /* offset in section.  */
2081c63b39d6Schristos   bfd_size_type address;
2082c63b39d6Schristos 
2083c63b39d6Schristos   /* addend for relocation value.  */
2084c63b39d6Schristos   bfd_vma addend;
2085c63b39d6Schristos 
2086c63b39d6Schristos   /* Pointer to how to perform the required relocation.  */
2087c63b39d6Schristos   reloc_howto_type *howto;
2088c63b39d6Schristos 
2089c63b39d6Schristos }
2090c63b39d6Schristos arelent;
2091c63b39d6Schristos 
2092b511d482Schristos 
2093c63b39d6Schristos enum complain_overflow
2094c63b39d6Schristos {
2095c63b39d6Schristos   /* Do not complain on overflow.  */
2096c63b39d6Schristos   complain_overflow_dont,
2097c63b39d6Schristos 
2098c63b39d6Schristos   /* Complain if the value overflows when considered as a signed
2099c63b39d6Schristos      number one bit larger than the field.  ie. A bitfield of N bits
2100c63b39d6Schristos      is allowed to represent -2**n to 2**n-1.  */
2101c63b39d6Schristos   complain_overflow_bitfield,
2102c63b39d6Schristos 
2103c63b39d6Schristos   /* Complain if the value overflows when considered as a signed
2104c63b39d6Schristos      number.  */
2105c63b39d6Schristos   complain_overflow_signed,
2106c63b39d6Schristos 
2107c63b39d6Schristos   /* Complain if the value overflows when considered as an
2108c63b39d6Schristos      unsigned number.  */
2109c63b39d6Schristos   complain_overflow_unsigned
2110c63b39d6Schristos };
2111c63b39d6Schristos struct reloc_howto_struct
2112c63b39d6Schristos {
2113c63b39d6Schristos   /* The type field has mainly a documentary use - the back end can
211477cd98dfSchristos      do what it wants with it, though normally the back end's idea of
211577cd98dfSchristos      an external reloc number is stored in this field.  */
2116c63b39d6Schristos   unsigned int type;
2117c63b39d6Schristos 
211877cd98dfSchristos   /* The encoded size of the item to be relocated.  This is *not* a
211977cd98dfSchristos      power-of-two measure.  Use bfd_get_reloc_size to find the size
212077cd98dfSchristos      of the item in bytes.  */
212177cd98dfSchristos   unsigned int size:3;
212277cd98dfSchristos 
212377cd98dfSchristos   /* The number of bits in the field to be relocated.  This is used
212477cd98dfSchristos      when doing overflow checking.  */
212577cd98dfSchristos   unsigned int bitsize:7;
212677cd98dfSchristos 
2127c63b39d6Schristos   /* The value the final relocation is shifted right by.  This drops
2128c63b39d6Schristos      unwanted data from the relocation.  */
212977cd98dfSchristos   unsigned int rightshift:6;
2130c63b39d6Schristos 
2131c63b39d6Schristos   /* The bit position of the reloc value in the destination.
2132c63b39d6Schristos      The relocated value is left shifted by this amount.  */
213377cd98dfSchristos   unsigned int bitpos:6;
2134c63b39d6Schristos 
2135c63b39d6Schristos   /* What type of overflow error should be checked for when
2136c63b39d6Schristos      relocating.  */
213777cd98dfSchristos   ENUM_BITFIELD (complain_overflow) complain_on_overflow:2;
2138c63b39d6Schristos 
213977cd98dfSchristos   /* The relocation value should be negated before applying.  */
214077cd98dfSchristos   unsigned int negate:1;
2141c63b39d6Schristos 
214277cd98dfSchristos   /* The relocation is relative to the item being relocated.  */
214377cd98dfSchristos   unsigned int pc_relative:1;
2144c63b39d6Schristos 
2145c63b39d6Schristos   /* Some formats record a relocation addend in the section contents
2146c63b39d6Schristos      rather than with the relocation.  For ELF formats this is the
2147c63b39d6Schristos      distinction between USE_REL and USE_RELA (though the code checks
2148c63b39d6Schristos      for USE_REL == 1/0).  The value of this field is TRUE if the
2149c63b39d6Schristos      addend is recorded with the section contents; when performing a
2150c63b39d6Schristos      partial link (ld -r) the section contents (the data) will be
2151c63b39d6Schristos      modified.  The value of this field is FALSE if addends are
2152c63b39d6Schristos      recorded with the relocation (in arelent.addend); when performing
2153c63b39d6Schristos      a partial link the relocation will be modified.
2154c63b39d6Schristos      All relocations for all ELF USE_RELA targets should set this field
2155c63b39d6Schristos      to FALSE (values of TRUE should be looked on with suspicion).
2156c63b39d6Schristos      However, the converse is not true: not all relocations of all ELF
2157c63b39d6Schristos      USE_REL targets set this field to TRUE.  Why this is so is peculiar
2158c63b39d6Schristos      to each particular target.  For relocs that aren't used in partial
2159c63b39d6Schristos      links (e.g. GOT stuff) it doesn't matter what this is set to.  */
216077cd98dfSchristos   unsigned int partial_inplace:1;
2161c63b39d6Schristos 
2162c63b39d6Schristos   /* When some formats create PC relative instructions, they leave
2163c63b39d6Schristos      the value of the pc of the place being relocated in the offset
2164c63b39d6Schristos      slot of the instruction, so that a PC relative relocation can
2165c63b39d6Schristos      be made just by adding in an ordinary offset (e.g., sun3 a.out).
2166c63b39d6Schristos      Some formats leave the displacement part of an instruction
216777cd98dfSchristos      empty (e.g., ELF); this flag signals the fact.  */
216877cd98dfSchristos   unsigned int pcrel_offset:1;
216977cd98dfSchristos 
217077cd98dfSchristos   /* src_mask selects the part of the instruction (or data) to be used
217177cd98dfSchristos      in the relocation sum.  If the target relocations don't have an
217277cd98dfSchristos      addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
217377cd98dfSchristos      dst_mask to extract the addend from the section contents.  If
217477cd98dfSchristos      relocations do have an addend in the reloc, eg. ELF USE_RELA, this
217577cd98dfSchristos      field should normally be zero.  Non-zero values for ELF USE_RELA
217677cd98dfSchristos      targets should be viewed with suspicion as normally the value in
217777cd98dfSchristos      the dst_mask part of the section contents should be ignored.  */
217877cd98dfSchristos   bfd_vma src_mask;
217977cd98dfSchristos 
218077cd98dfSchristos   /* dst_mask selects which parts of the instruction (or data) are
218177cd98dfSchristos      replaced with a relocated value.  */
218277cd98dfSchristos   bfd_vma dst_mask;
218377cd98dfSchristos 
218477cd98dfSchristos   /* If this field is non null, then the supplied function is
218577cd98dfSchristos      called rather than the normal function.  This allows really
218677cd98dfSchristos      strange relocation methods to be accommodated.  */
218777cd98dfSchristos   bfd_reloc_status_type (*special_function)
218877cd98dfSchristos     (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
218977cd98dfSchristos      bfd *, char **);
219077cd98dfSchristos 
219177cd98dfSchristos   /* The textual name of the relocation type.  */
2192*fd82c4c4Schristos   const char *name;
2193c63b39d6Schristos };
2194c63b39d6Schristos 
219577cd98dfSchristos #define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name,   \
219677cd98dfSchristos               inplace, src_mask, dst_mask, pcrel_off)                  \
219777cd98dfSchristos   { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf,  \
219877cd98dfSchristos     size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
2199c63b39d6Schristos #define EMPTY_HOWTO(C) \
2200c63b39d6Schristos   HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
2201c63b39d6Schristos          NULL, FALSE, 0, 0, FALSE)
2202c63b39d6Schristos 
2203c63b39d6Schristos unsigned int bfd_get_reloc_size (reloc_howto_type *);
2204c63b39d6Schristos 
2205c63b39d6Schristos typedef struct relent_chain
2206c63b39d6Schristos {
2207c63b39d6Schristos   arelent relent;
2208c63b39d6Schristos   struct relent_chain *next;
2209c63b39d6Schristos }
2210c63b39d6Schristos arelent_chain;
2211c63b39d6Schristos 
2212c63b39d6Schristos bfd_reloc_status_type bfd_check_overflow
2213c63b39d6Schristos    (enum complain_overflow how,
2214c63b39d6Schristos     unsigned int bitsize,
2215c63b39d6Schristos     unsigned int rightshift,
2216c63b39d6Schristos     unsigned int addrsize,
2217c63b39d6Schristos     bfd_vma relocation);
2218c63b39d6Schristos 
221977cd98dfSchristos bfd_boolean bfd_reloc_offset_in_range
222077cd98dfSchristos    (reloc_howto_type *howto,
222177cd98dfSchristos     bfd *abfd,
222277cd98dfSchristos     asection *section,
222377cd98dfSchristos     bfd_size_type offset);
222477cd98dfSchristos 
2225c63b39d6Schristos bfd_reloc_status_type bfd_perform_relocation
2226c63b39d6Schristos    (bfd *abfd,
2227c63b39d6Schristos     arelent *reloc_entry,
2228c63b39d6Schristos     void *data,
2229c63b39d6Schristos     asection *input_section,
2230c63b39d6Schristos     bfd *output_bfd,
2231c63b39d6Schristos     char **error_message);
2232c63b39d6Schristos 
2233c63b39d6Schristos bfd_reloc_status_type bfd_install_relocation
2234c63b39d6Schristos    (bfd *abfd,
2235c63b39d6Schristos     arelent *reloc_entry,
2236c63b39d6Schristos     void *data, bfd_vma data_start,
2237c63b39d6Schristos     asection *input_section,
2238c63b39d6Schristos     char **error_message);
2239c63b39d6Schristos 
2240c63b39d6Schristos enum bfd_reloc_code_real {
2241c63b39d6Schristos   _dummy_first_bfd_reloc_code_real,
2242c63b39d6Schristos 
2243c63b39d6Schristos 
2244c63b39d6Schristos /* Basic absolute relocations of N bits.  */
2245c63b39d6Schristos   BFD_RELOC_64,
2246c63b39d6Schristos   BFD_RELOC_32,
2247c63b39d6Schristos   BFD_RELOC_26,
2248c63b39d6Schristos   BFD_RELOC_24,
2249c63b39d6Schristos   BFD_RELOC_16,
2250c63b39d6Schristos   BFD_RELOC_14,
2251c63b39d6Schristos   BFD_RELOC_8,
2252c63b39d6Schristos 
2253c63b39d6Schristos /* PC-relative relocations.  Sometimes these are relative to the address
2254c63b39d6Schristos of the relocation itself; sometimes they are relative to the start of
225577cd98dfSchristos the section containing the relocation.  It depends on the specific target.  */
2256c63b39d6Schristos   BFD_RELOC_64_PCREL,
2257c63b39d6Schristos   BFD_RELOC_32_PCREL,
2258c63b39d6Schristos   BFD_RELOC_24_PCREL,
2259c63b39d6Schristos   BFD_RELOC_16_PCREL,
2260c63b39d6Schristos   BFD_RELOC_12_PCREL,
2261c63b39d6Schristos   BFD_RELOC_8_PCREL,
2262c63b39d6Schristos 
2263c63b39d6Schristos /* Section relative relocations.  Some targets need this for DWARF2.  */
2264c63b39d6Schristos   BFD_RELOC_32_SECREL,
2265c63b39d6Schristos 
2266c63b39d6Schristos /* For ELF.  */
2267c63b39d6Schristos   BFD_RELOC_32_GOT_PCREL,
2268c63b39d6Schristos   BFD_RELOC_16_GOT_PCREL,
2269c63b39d6Schristos   BFD_RELOC_8_GOT_PCREL,
2270c63b39d6Schristos   BFD_RELOC_32_GOTOFF,
2271c63b39d6Schristos   BFD_RELOC_16_GOTOFF,
2272c63b39d6Schristos   BFD_RELOC_LO16_GOTOFF,
2273c63b39d6Schristos   BFD_RELOC_HI16_GOTOFF,
2274c63b39d6Schristos   BFD_RELOC_HI16_S_GOTOFF,
2275c63b39d6Schristos   BFD_RELOC_8_GOTOFF,
2276c63b39d6Schristos   BFD_RELOC_64_PLT_PCREL,
2277c63b39d6Schristos   BFD_RELOC_32_PLT_PCREL,
2278c63b39d6Schristos   BFD_RELOC_24_PLT_PCREL,
2279c63b39d6Schristos   BFD_RELOC_16_PLT_PCREL,
2280c63b39d6Schristos   BFD_RELOC_8_PLT_PCREL,
2281c63b39d6Schristos   BFD_RELOC_64_PLTOFF,
2282c63b39d6Schristos   BFD_RELOC_32_PLTOFF,
2283c63b39d6Schristos   BFD_RELOC_16_PLTOFF,
2284c63b39d6Schristos   BFD_RELOC_LO16_PLTOFF,
2285c63b39d6Schristos   BFD_RELOC_HI16_PLTOFF,
2286c63b39d6Schristos   BFD_RELOC_HI16_S_PLTOFF,
2287c63b39d6Schristos   BFD_RELOC_8_PLTOFF,
2288c63b39d6Schristos 
2289fdeb0babSchristos /* Size relocations.  */
2290fdeb0babSchristos   BFD_RELOC_SIZE32,
2291fdeb0babSchristos   BFD_RELOC_SIZE64,
2292fdeb0babSchristos 
2293c63b39d6Schristos /* Relocations used by 68K ELF.  */
2294c63b39d6Schristos   BFD_RELOC_68K_GLOB_DAT,
2295c63b39d6Schristos   BFD_RELOC_68K_JMP_SLOT,
2296c63b39d6Schristos   BFD_RELOC_68K_RELATIVE,
2297c63b39d6Schristos   BFD_RELOC_68K_TLS_GD32,
2298c63b39d6Schristos   BFD_RELOC_68K_TLS_GD16,
2299c63b39d6Schristos   BFD_RELOC_68K_TLS_GD8,
2300c63b39d6Schristos   BFD_RELOC_68K_TLS_LDM32,
2301c63b39d6Schristos   BFD_RELOC_68K_TLS_LDM16,
2302c63b39d6Schristos   BFD_RELOC_68K_TLS_LDM8,
2303c63b39d6Schristos   BFD_RELOC_68K_TLS_LDO32,
2304c63b39d6Schristos   BFD_RELOC_68K_TLS_LDO16,
2305c63b39d6Schristos   BFD_RELOC_68K_TLS_LDO8,
2306c63b39d6Schristos   BFD_RELOC_68K_TLS_IE32,
2307c63b39d6Schristos   BFD_RELOC_68K_TLS_IE16,
2308c63b39d6Schristos   BFD_RELOC_68K_TLS_IE8,
2309c63b39d6Schristos   BFD_RELOC_68K_TLS_LE32,
2310c63b39d6Schristos   BFD_RELOC_68K_TLS_LE16,
2311c63b39d6Schristos   BFD_RELOC_68K_TLS_LE8,
2312c63b39d6Schristos 
2313c63b39d6Schristos /* Linkage-table relative.  */
2314c63b39d6Schristos   BFD_RELOC_32_BASEREL,
2315c63b39d6Schristos   BFD_RELOC_16_BASEREL,
2316c63b39d6Schristos   BFD_RELOC_LO16_BASEREL,
2317c63b39d6Schristos   BFD_RELOC_HI16_BASEREL,
2318c63b39d6Schristos   BFD_RELOC_HI16_S_BASEREL,
2319c63b39d6Schristos   BFD_RELOC_8_BASEREL,
2320c63b39d6Schristos   BFD_RELOC_RVA,
2321c63b39d6Schristos 
2322c63b39d6Schristos /* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
2323c63b39d6Schristos   BFD_RELOC_8_FFnn,
2324c63b39d6Schristos 
2325c63b39d6Schristos /* These PC-relative relocations are stored as word displacements --
2326c63b39d6Schristos i.e., byte displacements shifted right two bits.  The 30-bit word
2327c63b39d6Schristos displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
2328c63b39d6Schristos SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
2329c63b39d6Schristos signed 16-bit displacement is used on the MIPS, and the 23-bit
2330c63b39d6Schristos displacement is used on the Alpha.  */
2331c63b39d6Schristos   BFD_RELOC_32_PCREL_S2,
2332c63b39d6Schristos   BFD_RELOC_16_PCREL_S2,
2333c63b39d6Schristos   BFD_RELOC_23_PCREL_S2,
2334c63b39d6Schristos 
2335c63b39d6Schristos /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
2336c63b39d6Schristos the target word.  These are used on the SPARC.  */
2337c63b39d6Schristos   BFD_RELOC_HI22,
2338c63b39d6Schristos   BFD_RELOC_LO10,
2339c63b39d6Schristos 
2340c63b39d6Schristos /* For systems that allocate a Global Pointer register, these are
2341c63b39d6Schristos displacements off that register.  These relocation types are
2342c63b39d6Schristos handled specially, because the value the register will have is
2343c63b39d6Schristos decided relatively late.  */
2344c63b39d6Schristos   BFD_RELOC_GPREL16,
2345c63b39d6Schristos   BFD_RELOC_GPREL32,
2346c63b39d6Schristos 
2347c63b39d6Schristos /* SPARC ELF relocations.  There is probably some overlap with other
2348c63b39d6Schristos relocation types already defined.  */
2349c63b39d6Schristos   BFD_RELOC_NONE,
2350c63b39d6Schristos   BFD_RELOC_SPARC_WDISP22,
2351c63b39d6Schristos   BFD_RELOC_SPARC22,
2352c63b39d6Schristos   BFD_RELOC_SPARC13,
2353c63b39d6Schristos   BFD_RELOC_SPARC_GOT10,
2354c63b39d6Schristos   BFD_RELOC_SPARC_GOT13,
2355c63b39d6Schristos   BFD_RELOC_SPARC_GOT22,
2356c63b39d6Schristos   BFD_RELOC_SPARC_PC10,
2357c63b39d6Schristos   BFD_RELOC_SPARC_PC22,
2358c63b39d6Schristos   BFD_RELOC_SPARC_WPLT30,
2359c63b39d6Schristos   BFD_RELOC_SPARC_COPY,
2360c63b39d6Schristos   BFD_RELOC_SPARC_GLOB_DAT,
2361c63b39d6Schristos   BFD_RELOC_SPARC_JMP_SLOT,
2362c63b39d6Schristos   BFD_RELOC_SPARC_RELATIVE,
2363c63b39d6Schristos   BFD_RELOC_SPARC_UA16,
2364c63b39d6Schristos   BFD_RELOC_SPARC_UA32,
2365c63b39d6Schristos   BFD_RELOC_SPARC_UA64,
2366c63b39d6Schristos   BFD_RELOC_SPARC_GOTDATA_HIX22,
2367c63b39d6Schristos   BFD_RELOC_SPARC_GOTDATA_LOX10,
2368c63b39d6Schristos   BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2369c63b39d6Schristos   BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
2370c63b39d6Schristos   BFD_RELOC_SPARC_GOTDATA_OP,
2371c63b39d6Schristos   BFD_RELOC_SPARC_JMP_IREL,
2372c63b39d6Schristos   BFD_RELOC_SPARC_IRELATIVE,
2373c63b39d6Schristos 
2374c63b39d6Schristos /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
2375c63b39d6Schristos   BFD_RELOC_SPARC_BASE13,
2376c63b39d6Schristos   BFD_RELOC_SPARC_BASE22,
2377c63b39d6Schristos 
2378c63b39d6Schristos /* SPARC64 relocations  */
2379c63b39d6Schristos #define BFD_RELOC_SPARC_64 BFD_RELOC_64
2380c63b39d6Schristos   BFD_RELOC_SPARC_10,
2381c63b39d6Schristos   BFD_RELOC_SPARC_11,
2382c63b39d6Schristos   BFD_RELOC_SPARC_OLO10,
2383c63b39d6Schristos   BFD_RELOC_SPARC_HH22,
2384c63b39d6Schristos   BFD_RELOC_SPARC_HM10,
2385c63b39d6Schristos   BFD_RELOC_SPARC_LM22,
2386c63b39d6Schristos   BFD_RELOC_SPARC_PC_HH22,
2387c63b39d6Schristos   BFD_RELOC_SPARC_PC_HM10,
2388c63b39d6Schristos   BFD_RELOC_SPARC_PC_LM22,
2389c63b39d6Schristos   BFD_RELOC_SPARC_WDISP16,
2390c63b39d6Schristos   BFD_RELOC_SPARC_WDISP19,
2391c63b39d6Schristos   BFD_RELOC_SPARC_7,
2392c63b39d6Schristos   BFD_RELOC_SPARC_6,
2393c63b39d6Schristos   BFD_RELOC_SPARC_5,
2394c63b39d6Schristos #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
2395c63b39d6Schristos   BFD_RELOC_SPARC_PLT32,
2396c63b39d6Schristos   BFD_RELOC_SPARC_PLT64,
2397c63b39d6Schristos   BFD_RELOC_SPARC_HIX22,
2398c63b39d6Schristos   BFD_RELOC_SPARC_LOX10,
2399c63b39d6Schristos   BFD_RELOC_SPARC_H44,
2400c63b39d6Schristos   BFD_RELOC_SPARC_M44,
2401c63b39d6Schristos   BFD_RELOC_SPARC_L44,
2402c63b39d6Schristos   BFD_RELOC_SPARC_REGISTER,
2403fdeb0babSchristos   BFD_RELOC_SPARC_H34,
2404fdeb0babSchristos   BFD_RELOC_SPARC_SIZE32,
2405fdeb0babSchristos   BFD_RELOC_SPARC_SIZE64,
2406fdeb0babSchristos   BFD_RELOC_SPARC_WDISP10,
2407c63b39d6Schristos 
2408c63b39d6Schristos /* SPARC little endian relocation  */
2409c63b39d6Schristos   BFD_RELOC_SPARC_REV32,
2410c63b39d6Schristos 
2411c63b39d6Schristos /* SPARC TLS relocations  */
2412c63b39d6Schristos   BFD_RELOC_SPARC_TLS_GD_HI22,
2413c63b39d6Schristos   BFD_RELOC_SPARC_TLS_GD_LO10,
2414c63b39d6Schristos   BFD_RELOC_SPARC_TLS_GD_ADD,
2415c63b39d6Schristos   BFD_RELOC_SPARC_TLS_GD_CALL,
2416c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDM_HI22,
2417c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDM_LO10,
2418c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDM_ADD,
2419c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDM_CALL,
2420c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDO_HIX22,
2421c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDO_LOX10,
2422c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LDO_ADD,
2423c63b39d6Schristos   BFD_RELOC_SPARC_TLS_IE_HI22,
2424c63b39d6Schristos   BFD_RELOC_SPARC_TLS_IE_LO10,
2425c63b39d6Schristos   BFD_RELOC_SPARC_TLS_IE_LD,
2426c63b39d6Schristos   BFD_RELOC_SPARC_TLS_IE_LDX,
2427c63b39d6Schristos   BFD_RELOC_SPARC_TLS_IE_ADD,
2428c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LE_HIX22,
2429c63b39d6Schristos   BFD_RELOC_SPARC_TLS_LE_LOX10,
2430c63b39d6Schristos   BFD_RELOC_SPARC_TLS_DTPMOD32,
2431c63b39d6Schristos   BFD_RELOC_SPARC_TLS_DTPMOD64,
2432c63b39d6Schristos   BFD_RELOC_SPARC_TLS_DTPOFF32,
2433c63b39d6Schristos   BFD_RELOC_SPARC_TLS_DTPOFF64,
2434c63b39d6Schristos   BFD_RELOC_SPARC_TLS_TPOFF32,
2435c63b39d6Schristos   BFD_RELOC_SPARC_TLS_TPOFF64,
2436c63b39d6Schristos 
2437c63b39d6Schristos /* SPU Relocations.  */
2438c63b39d6Schristos   BFD_RELOC_SPU_IMM7,
2439c63b39d6Schristos   BFD_RELOC_SPU_IMM8,
2440c63b39d6Schristos   BFD_RELOC_SPU_IMM10,
2441c63b39d6Schristos   BFD_RELOC_SPU_IMM10W,
2442c63b39d6Schristos   BFD_RELOC_SPU_IMM16,
2443c63b39d6Schristos   BFD_RELOC_SPU_IMM16W,
2444c63b39d6Schristos   BFD_RELOC_SPU_IMM18,
2445c63b39d6Schristos   BFD_RELOC_SPU_PCREL9a,
2446c63b39d6Schristos   BFD_RELOC_SPU_PCREL9b,
2447c63b39d6Schristos   BFD_RELOC_SPU_PCREL16,
2448c63b39d6Schristos   BFD_RELOC_SPU_LO16,
2449c63b39d6Schristos   BFD_RELOC_SPU_HI16,
2450c63b39d6Schristos   BFD_RELOC_SPU_PPU32,
2451c63b39d6Schristos   BFD_RELOC_SPU_PPU64,
2452c63b39d6Schristos   BFD_RELOC_SPU_ADD_PIC,
2453c63b39d6Schristos 
2454c63b39d6Schristos /* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
2455c63b39d6Schristos "addend" in some special way.
2456c63b39d6Schristos For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2457c63b39d6Schristos writing; when reading, it will be the absolute section symbol.  The
2458c63b39d6Schristos addend is the displacement in bytes of the "lda" instruction from
2459c63b39d6Schristos the "ldah" instruction (which is at the address of this reloc).  */
2460c63b39d6Schristos   BFD_RELOC_ALPHA_GPDISP_HI16,
2461c63b39d6Schristos 
2462c63b39d6Schristos /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
2463c63b39d6Schristos with GPDISP_HI16 relocs.  The addend is ignored when writing the
2464c63b39d6Schristos relocations out, and is filled in with the file's GP value on
2465c63b39d6Schristos reading, for convenience.  */
2466c63b39d6Schristos   BFD_RELOC_ALPHA_GPDISP_LO16,
2467c63b39d6Schristos 
2468c63b39d6Schristos /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
2469c63b39d6Schristos relocation except that there is no accompanying GPDISP_LO16
2470c63b39d6Schristos relocation.  */
2471c63b39d6Schristos   BFD_RELOC_ALPHA_GPDISP,
2472c63b39d6Schristos 
2473c63b39d6Schristos /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
2474c63b39d6Schristos the assembler turns it into a LDQ instruction to load the address of
2475c63b39d6Schristos the symbol, and then fills in a register in the real instruction.
2476c63b39d6Schristos 
2477c63b39d6Schristos The LITERAL reloc, at the LDQ instruction, refers to the .lita
2478c63b39d6Schristos section symbol.  The addend is ignored when writing, but is filled
2479c63b39d6Schristos in with the file's GP value on reading, for convenience, as with the
2480c63b39d6Schristos GPDISP_LO16 reloc.
2481c63b39d6Schristos 
2482c63b39d6Schristos The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
2483c63b39d6Schristos It should refer to the symbol to be referenced, as with 16_GOTOFF,
2484c63b39d6Schristos but it generates output not based on the position within the .got
2485c63b39d6Schristos section, but relative to the GP value chosen for the file during the
2486c63b39d6Schristos final link stage.
2487c63b39d6Schristos 
2488c63b39d6Schristos The LITUSE reloc, on the instruction using the loaded address, gives
2489c63b39d6Schristos information to the linker that it might be able to use to optimize
2490c63b39d6Schristos away some literal section references.  The symbol is ignored (read
2491c63b39d6Schristos as the absolute section symbol), and the "addend" indicates the type
2492c63b39d6Schristos of instruction using the register:
2493c63b39d6Schristos 1 - "memory" fmt insn
2494c63b39d6Schristos 2 - byte-manipulation (byte offset reg)
2495c63b39d6Schristos 3 - jsr (target of branch)  */
2496c63b39d6Schristos   BFD_RELOC_ALPHA_LITERAL,
2497c63b39d6Schristos   BFD_RELOC_ALPHA_ELF_LITERAL,
2498c63b39d6Schristos   BFD_RELOC_ALPHA_LITUSE,
2499c63b39d6Schristos 
2500c63b39d6Schristos /* The HINT relocation indicates a value that should be filled into the
2501c63b39d6Schristos "hint" field of a jmp/jsr/ret instruction, for possible branch-
2502c63b39d6Schristos prediction logic which may be provided on some processors.  */
2503c63b39d6Schristos   BFD_RELOC_ALPHA_HINT,
2504c63b39d6Schristos 
2505c63b39d6Schristos /* The LINKAGE relocation outputs a linkage pair in the object file,
2506c63b39d6Schristos which is filled by the linker.  */
2507c63b39d6Schristos   BFD_RELOC_ALPHA_LINKAGE,
2508c63b39d6Schristos 
2509c63b39d6Schristos /* The CODEADDR relocation outputs a STO_CA in the object file,
2510c63b39d6Schristos which is filled by the linker.  */
2511c63b39d6Schristos   BFD_RELOC_ALPHA_CODEADDR,
2512c63b39d6Schristos 
2513c63b39d6Schristos /* The GPREL_HI/LO relocations together form a 32-bit offset from the
2514c63b39d6Schristos GP register.  */
2515c63b39d6Schristos   BFD_RELOC_ALPHA_GPREL_HI16,
2516c63b39d6Schristos   BFD_RELOC_ALPHA_GPREL_LO16,
2517c63b39d6Schristos 
2518c63b39d6Schristos /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2519c63b39d6Schristos share a common GP, and the target address is adjusted for
2520c63b39d6Schristos STO_ALPHA_STD_GPLOAD.  */
2521c63b39d6Schristos   BFD_RELOC_ALPHA_BRSGP,
2522c63b39d6Schristos 
2523c63b39d6Schristos /* The NOP relocation outputs a NOP if the longword displacement
2524c63b39d6Schristos between two procedure entry points is < 2^21.  */
2525c63b39d6Schristos   BFD_RELOC_ALPHA_NOP,
2526c63b39d6Schristos 
2527c63b39d6Schristos /* The BSR relocation outputs a BSR if the longword displacement
2528c63b39d6Schristos between two procedure entry points is < 2^21.  */
2529c63b39d6Schristos   BFD_RELOC_ALPHA_BSR,
2530c63b39d6Schristos 
2531c63b39d6Schristos /* The LDA relocation outputs a LDA if the longword displacement
2532c63b39d6Schristos between two procedure entry points is < 2^16.  */
2533c63b39d6Schristos   BFD_RELOC_ALPHA_LDA,
2534c63b39d6Schristos 
2535c63b39d6Schristos /* The BOH relocation outputs a BSR if the longword displacement
2536c63b39d6Schristos between two procedure entry points is < 2^21, or else a hint.  */
2537c63b39d6Schristos   BFD_RELOC_ALPHA_BOH,
2538c63b39d6Schristos 
2539c63b39d6Schristos /* Alpha thread-local storage relocations.  */
2540c63b39d6Schristos   BFD_RELOC_ALPHA_TLSGD,
2541c63b39d6Schristos   BFD_RELOC_ALPHA_TLSLDM,
2542c63b39d6Schristos   BFD_RELOC_ALPHA_DTPMOD64,
2543c63b39d6Schristos   BFD_RELOC_ALPHA_GOTDTPREL16,
2544c63b39d6Schristos   BFD_RELOC_ALPHA_DTPREL64,
2545c63b39d6Schristos   BFD_RELOC_ALPHA_DTPREL_HI16,
2546c63b39d6Schristos   BFD_RELOC_ALPHA_DTPREL_LO16,
2547c63b39d6Schristos   BFD_RELOC_ALPHA_DTPREL16,
2548c63b39d6Schristos   BFD_RELOC_ALPHA_GOTTPREL16,
2549c63b39d6Schristos   BFD_RELOC_ALPHA_TPREL64,
2550c63b39d6Schristos   BFD_RELOC_ALPHA_TPREL_HI16,
2551c63b39d6Schristos   BFD_RELOC_ALPHA_TPREL_LO16,
2552c63b39d6Schristos   BFD_RELOC_ALPHA_TPREL16,
2553c63b39d6Schristos 
2554fdeb0babSchristos /* The MIPS jump instruction.  */
2555c63b39d6Schristos   BFD_RELOC_MIPS_JMP,
2556fdeb0babSchristos   BFD_RELOC_MICROMIPS_JMP,
2557c63b39d6Schristos 
2558c63b39d6Schristos /* The MIPS16 jump instruction.  */
2559c63b39d6Schristos   BFD_RELOC_MIPS16_JMP,
2560c63b39d6Schristos 
2561c63b39d6Schristos /* MIPS16 GP relative reloc.  */
2562c63b39d6Schristos   BFD_RELOC_MIPS16_GPREL,
2563c63b39d6Schristos 
2564c63b39d6Schristos /* High 16 bits of 32-bit value; simple reloc.  */
2565c63b39d6Schristos   BFD_RELOC_HI16,
2566c63b39d6Schristos 
2567c63b39d6Schristos /* High 16 bits of 32-bit value but the low 16 bits will be sign
2568c63b39d6Schristos extended and added to form the final result.  If the low 16
2569c63b39d6Schristos bits form a negative number, we need to add one to the high value
2570c63b39d6Schristos to compensate for the borrow when the low bits are added.  */
2571c63b39d6Schristos   BFD_RELOC_HI16_S,
2572c63b39d6Schristos 
2573c63b39d6Schristos /* Low 16 bits.  */
2574c63b39d6Schristos   BFD_RELOC_LO16,
2575c63b39d6Schristos 
2576c63b39d6Schristos /* High 16 bits of 32-bit pc-relative value  */
2577c63b39d6Schristos   BFD_RELOC_HI16_PCREL,
2578c63b39d6Schristos 
2579c63b39d6Schristos /* High 16 bits of 32-bit pc-relative value, adjusted  */
2580c63b39d6Schristos   BFD_RELOC_HI16_S_PCREL,
2581c63b39d6Schristos 
2582c63b39d6Schristos /* Low 16 bits of pc-relative value  */
2583c63b39d6Schristos   BFD_RELOC_LO16_PCREL,
2584c63b39d6Schristos 
2585c63b39d6Schristos /* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
2586c63b39d6Schristos 16-bit immediate fields  */
2587c63b39d6Schristos   BFD_RELOC_MIPS16_GOT16,
2588c63b39d6Schristos   BFD_RELOC_MIPS16_CALL16,
2589c63b39d6Schristos 
2590c63b39d6Schristos /* MIPS16 high 16 bits of 32-bit value.  */
2591c63b39d6Schristos   BFD_RELOC_MIPS16_HI16,
2592c63b39d6Schristos 
2593c63b39d6Schristos /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
2594c63b39d6Schristos extended and added to form the final result.  If the low 16
2595c63b39d6Schristos bits form a negative number, we need to add one to the high value
2596c63b39d6Schristos to compensate for the borrow when the low bits are added.  */
2597c63b39d6Schristos   BFD_RELOC_MIPS16_HI16_S,
2598c63b39d6Schristos 
2599c63b39d6Schristos /* MIPS16 low 16 bits.  */
2600c63b39d6Schristos   BFD_RELOC_MIPS16_LO16,
2601c63b39d6Schristos 
2602fdeb0babSchristos /* MIPS16 TLS relocations  */
2603fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_GD,
2604fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_LDM,
2605fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
2606fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
2607fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_GOTTPREL,
2608fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_TPREL_HI16,
2609fdeb0babSchristos   BFD_RELOC_MIPS16_TLS_TPREL_LO16,
2610fdeb0babSchristos 
2611c63b39d6Schristos /* Relocation against a MIPS literal section.  */
2612c63b39d6Schristos   BFD_RELOC_MIPS_LITERAL,
2613fdeb0babSchristos   BFD_RELOC_MICROMIPS_LITERAL,
2614fdeb0babSchristos 
2615fdeb0babSchristos /* microMIPS PC-relative relocations.  */
2616fdeb0babSchristos   BFD_RELOC_MICROMIPS_7_PCREL_S1,
2617fdeb0babSchristos   BFD_RELOC_MICROMIPS_10_PCREL_S1,
2618fdeb0babSchristos   BFD_RELOC_MICROMIPS_16_PCREL_S1,
2619fdeb0babSchristos 
2620a636ddcaSmrg /* MIPS16 PC-relative relocation.  */
2621a636ddcaSmrg   BFD_RELOC_MIPS16_16_PCREL_S1,
2622a636ddcaSmrg 
2623b511d482Schristos /* MIPS PC-relative relocations.  */
2624b511d482Schristos   BFD_RELOC_MIPS_21_PCREL_S2,
2625b511d482Schristos   BFD_RELOC_MIPS_26_PCREL_S2,
2626b511d482Schristos   BFD_RELOC_MIPS_18_PCREL_S3,
2627b511d482Schristos   BFD_RELOC_MIPS_19_PCREL_S2,
2628b511d482Schristos 
2629fdeb0babSchristos /* microMIPS versions of generic BFD relocs.  */
2630fdeb0babSchristos   BFD_RELOC_MICROMIPS_GPREL16,
2631fdeb0babSchristos   BFD_RELOC_MICROMIPS_HI16,
2632fdeb0babSchristos   BFD_RELOC_MICROMIPS_HI16_S,
2633fdeb0babSchristos   BFD_RELOC_MICROMIPS_LO16,
2634c63b39d6Schristos 
2635c63b39d6Schristos /* MIPS ELF relocations.  */
2636c63b39d6Schristos   BFD_RELOC_MIPS_GOT16,
2637fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT16,
2638c63b39d6Schristos   BFD_RELOC_MIPS_CALL16,
2639fdeb0babSchristos   BFD_RELOC_MICROMIPS_CALL16,
2640c63b39d6Schristos   BFD_RELOC_MIPS_GOT_HI16,
2641fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT_HI16,
2642c63b39d6Schristos   BFD_RELOC_MIPS_GOT_LO16,
2643fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT_LO16,
2644c63b39d6Schristos   BFD_RELOC_MIPS_CALL_HI16,
2645fdeb0babSchristos   BFD_RELOC_MICROMIPS_CALL_HI16,
2646c63b39d6Schristos   BFD_RELOC_MIPS_CALL_LO16,
2647fdeb0babSchristos   BFD_RELOC_MICROMIPS_CALL_LO16,
2648c63b39d6Schristos   BFD_RELOC_MIPS_SUB,
2649fdeb0babSchristos   BFD_RELOC_MICROMIPS_SUB,
2650c63b39d6Schristos   BFD_RELOC_MIPS_GOT_PAGE,
2651fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT_PAGE,
2652c63b39d6Schristos   BFD_RELOC_MIPS_GOT_OFST,
2653fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT_OFST,
2654c63b39d6Schristos   BFD_RELOC_MIPS_GOT_DISP,
2655fdeb0babSchristos   BFD_RELOC_MICROMIPS_GOT_DISP,
2656c63b39d6Schristos   BFD_RELOC_MIPS_SHIFT5,
2657c63b39d6Schristos   BFD_RELOC_MIPS_SHIFT6,
2658c63b39d6Schristos   BFD_RELOC_MIPS_INSERT_A,
2659c63b39d6Schristos   BFD_RELOC_MIPS_INSERT_B,
2660c63b39d6Schristos   BFD_RELOC_MIPS_DELETE,
2661c63b39d6Schristos   BFD_RELOC_MIPS_HIGHEST,
2662fdeb0babSchristos   BFD_RELOC_MICROMIPS_HIGHEST,
2663c63b39d6Schristos   BFD_RELOC_MIPS_HIGHER,
2664fdeb0babSchristos   BFD_RELOC_MICROMIPS_HIGHER,
2665c63b39d6Schristos   BFD_RELOC_MIPS_SCN_DISP,
2666fdeb0babSchristos   BFD_RELOC_MICROMIPS_SCN_DISP,
2667c63b39d6Schristos   BFD_RELOC_MIPS_REL16,
2668c63b39d6Schristos   BFD_RELOC_MIPS_RELGOT,
2669c63b39d6Schristos   BFD_RELOC_MIPS_JALR,
2670fdeb0babSchristos   BFD_RELOC_MICROMIPS_JALR,
2671c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPMOD32,
2672c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPREL32,
2673c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPMOD64,
2674c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPREL64,
2675c63b39d6Schristos   BFD_RELOC_MIPS_TLS_GD,
2676fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_GD,
2677c63b39d6Schristos   BFD_RELOC_MIPS_TLS_LDM,
2678fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_LDM,
2679c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPREL_HI16,
2680fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
2681c63b39d6Schristos   BFD_RELOC_MIPS_TLS_DTPREL_LO16,
2682fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
2683c63b39d6Schristos   BFD_RELOC_MIPS_TLS_GOTTPREL,
2684fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
2685c63b39d6Schristos   BFD_RELOC_MIPS_TLS_TPREL32,
2686c63b39d6Schristos   BFD_RELOC_MIPS_TLS_TPREL64,
2687c63b39d6Schristos   BFD_RELOC_MIPS_TLS_TPREL_HI16,
2688fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
2689c63b39d6Schristos   BFD_RELOC_MIPS_TLS_TPREL_LO16,
2690fdeb0babSchristos   BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
269144a21023Schristos   BFD_RELOC_MIPS_EH,
2692c63b39d6Schristos 
2693c63b39d6Schristos 
2694c63b39d6Schristos /* MIPS ELF relocations (VxWorks and PLT extensions).  */
2695c63b39d6Schristos   BFD_RELOC_MIPS_COPY,
2696c63b39d6Schristos   BFD_RELOC_MIPS_JUMP_SLOT,
2697c63b39d6Schristos 
2698c63b39d6Schristos 
2699c63b39d6Schristos /* Moxie ELF relocations.  */
2700c63b39d6Schristos   BFD_RELOC_MOXIE_10_PCREL,
2701c63b39d6Schristos 
2702c63b39d6Schristos 
2703e8beca2cSchristos /* FT32 ELF relocations.  */
2704e8beca2cSchristos   BFD_RELOC_FT32_10,
2705e8beca2cSchristos   BFD_RELOC_FT32_20,
2706e8beca2cSchristos   BFD_RELOC_FT32_17,
2707e8beca2cSchristos   BFD_RELOC_FT32_18,
270877cd98dfSchristos   BFD_RELOC_FT32_RELAX,
270977cd98dfSchristos   BFD_RELOC_FT32_SC0,
271077cd98dfSchristos   BFD_RELOC_FT32_SC1,
271177cd98dfSchristos   BFD_RELOC_FT32_15,
271277cd98dfSchristos   BFD_RELOC_FT32_DIFF32,
2713e8beca2cSchristos 
2714e8beca2cSchristos 
2715c63b39d6Schristos /* Fujitsu Frv Relocations.  */
2716c63b39d6Schristos   BFD_RELOC_FRV_LABEL16,
2717c63b39d6Schristos   BFD_RELOC_FRV_LABEL24,
2718c63b39d6Schristos   BFD_RELOC_FRV_LO16,
2719c63b39d6Schristos   BFD_RELOC_FRV_HI16,
2720c63b39d6Schristos   BFD_RELOC_FRV_GPREL12,
2721c63b39d6Schristos   BFD_RELOC_FRV_GPRELU12,
2722c63b39d6Schristos   BFD_RELOC_FRV_GPREL32,
2723c63b39d6Schristos   BFD_RELOC_FRV_GPRELHI,
2724c63b39d6Schristos   BFD_RELOC_FRV_GPRELLO,
2725c63b39d6Schristos   BFD_RELOC_FRV_GOT12,
2726c63b39d6Schristos   BFD_RELOC_FRV_GOTHI,
2727c63b39d6Schristos   BFD_RELOC_FRV_GOTLO,
2728c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC,
2729c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOT12,
2730c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOTHI,
2731c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOTLO,
2732c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_VALUE,
2733c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
2734c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
2735c63b39d6Schristos   BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
2736c63b39d6Schristos   BFD_RELOC_FRV_GOTOFF12,
2737c63b39d6Schristos   BFD_RELOC_FRV_GOTOFFHI,
2738c63b39d6Schristos   BFD_RELOC_FRV_GOTOFFLO,
2739c63b39d6Schristos   BFD_RELOC_FRV_GETTLSOFF,
2740c63b39d6Schristos   BFD_RELOC_FRV_TLSDESC_VALUE,
2741c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSDESC12,
2742c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSDESCHI,
2743c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSDESCLO,
2744c63b39d6Schristos   BFD_RELOC_FRV_TLSMOFF12,
2745c63b39d6Schristos   BFD_RELOC_FRV_TLSMOFFHI,
2746c63b39d6Schristos   BFD_RELOC_FRV_TLSMOFFLO,
2747c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSOFF12,
2748c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSOFFHI,
2749c63b39d6Schristos   BFD_RELOC_FRV_GOTTLSOFFLO,
2750c63b39d6Schristos   BFD_RELOC_FRV_TLSOFF,
2751c63b39d6Schristos   BFD_RELOC_FRV_TLSDESC_RELAX,
2752c63b39d6Schristos   BFD_RELOC_FRV_GETTLSOFF_RELAX,
2753c63b39d6Schristos   BFD_RELOC_FRV_TLSOFF_RELAX,
2754c63b39d6Schristos   BFD_RELOC_FRV_TLSMOFF,
2755c63b39d6Schristos 
2756c63b39d6Schristos 
2757c63b39d6Schristos /* This is a 24bit GOT-relative reloc for the mn10300.  */
2758c63b39d6Schristos   BFD_RELOC_MN10300_GOTOFF24,
2759c63b39d6Schristos 
2760c63b39d6Schristos /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
2761c63b39d6Schristos in the instruction.  */
2762c63b39d6Schristos   BFD_RELOC_MN10300_GOT32,
2763c63b39d6Schristos 
2764c63b39d6Schristos /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
2765c63b39d6Schristos in the instruction.  */
2766c63b39d6Schristos   BFD_RELOC_MN10300_GOT24,
2767c63b39d6Schristos 
2768c63b39d6Schristos /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
2769c63b39d6Schristos in the instruction.  */
2770c63b39d6Schristos   BFD_RELOC_MN10300_GOT16,
2771c63b39d6Schristos 
2772c63b39d6Schristos /* Copy symbol at runtime.  */
2773c63b39d6Schristos   BFD_RELOC_MN10300_COPY,
2774c63b39d6Schristos 
2775c63b39d6Schristos /* Create GOT entry.  */
2776c63b39d6Schristos   BFD_RELOC_MN10300_GLOB_DAT,
2777c63b39d6Schristos 
2778c63b39d6Schristos /* Create PLT entry.  */
2779c63b39d6Schristos   BFD_RELOC_MN10300_JMP_SLOT,
2780c63b39d6Schristos 
2781c63b39d6Schristos /* Adjust by program base.  */
2782c63b39d6Schristos   BFD_RELOC_MN10300_RELATIVE,
2783c63b39d6Schristos 
2784c63b39d6Schristos /* Together with another reloc targeted at the same location,
2785c63b39d6Schristos allows for a value that is the difference of two symbols
2786c63b39d6Schristos in the same section.  */
2787c63b39d6Schristos   BFD_RELOC_MN10300_SYM_DIFF,
2788c63b39d6Schristos 
2789c63b39d6Schristos /* The addend of this reloc is an alignment power that must
2790c63b39d6Schristos be honoured at the offset's location, regardless of linker
2791c63b39d6Schristos relaxation.  */
2792c63b39d6Schristos   BFD_RELOC_MN10300_ALIGN,
2793c63b39d6Schristos 
2794fdeb0babSchristos /* Various TLS-related relocations.  */
2795fdeb0babSchristos   BFD_RELOC_MN10300_TLS_GD,
2796fdeb0babSchristos   BFD_RELOC_MN10300_TLS_LD,
2797fdeb0babSchristos   BFD_RELOC_MN10300_TLS_LDO,
2798fdeb0babSchristos   BFD_RELOC_MN10300_TLS_GOTIE,
2799fdeb0babSchristos   BFD_RELOC_MN10300_TLS_IE,
2800fdeb0babSchristos   BFD_RELOC_MN10300_TLS_LE,
2801fdeb0babSchristos   BFD_RELOC_MN10300_TLS_DTPMOD,
2802fdeb0babSchristos   BFD_RELOC_MN10300_TLS_DTPOFF,
2803fdeb0babSchristos   BFD_RELOC_MN10300_TLS_TPOFF,
2804fdeb0babSchristos 
2805fdeb0babSchristos /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
2806fdeb0babSchristos instruction.  */
2807fdeb0babSchristos   BFD_RELOC_MN10300_32_PCREL,
2808fdeb0babSchristos 
2809fdeb0babSchristos /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
2810fdeb0babSchristos instruction.  */
2811fdeb0babSchristos   BFD_RELOC_MN10300_16_PCREL,
2812fdeb0babSchristos 
2813c63b39d6Schristos 
2814c63b39d6Schristos /* i386/elf relocations  */
2815c63b39d6Schristos   BFD_RELOC_386_GOT32,
2816c63b39d6Schristos   BFD_RELOC_386_PLT32,
2817c63b39d6Schristos   BFD_RELOC_386_COPY,
2818c63b39d6Schristos   BFD_RELOC_386_GLOB_DAT,
2819c63b39d6Schristos   BFD_RELOC_386_JUMP_SLOT,
2820c63b39d6Schristos   BFD_RELOC_386_RELATIVE,
2821c63b39d6Schristos   BFD_RELOC_386_GOTOFF,
2822c63b39d6Schristos   BFD_RELOC_386_GOTPC,
2823c63b39d6Schristos   BFD_RELOC_386_TLS_TPOFF,
2824c63b39d6Schristos   BFD_RELOC_386_TLS_IE,
2825c63b39d6Schristos   BFD_RELOC_386_TLS_GOTIE,
2826c63b39d6Schristos   BFD_RELOC_386_TLS_LE,
2827c63b39d6Schristos   BFD_RELOC_386_TLS_GD,
2828c63b39d6Schristos   BFD_RELOC_386_TLS_LDM,
2829c63b39d6Schristos   BFD_RELOC_386_TLS_LDO_32,
2830c63b39d6Schristos   BFD_RELOC_386_TLS_IE_32,
2831c63b39d6Schristos   BFD_RELOC_386_TLS_LE_32,
2832c63b39d6Schristos   BFD_RELOC_386_TLS_DTPMOD32,
2833c63b39d6Schristos   BFD_RELOC_386_TLS_DTPOFF32,
2834c63b39d6Schristos   BFD_RELOC_386_TLS_TPOFF32,
2835c63b39d6Schristos   BFD_RELOC_386_TLS_GOTDESC,
2836c63b39d6Schristos   BFD_RELOC_386_TLS_DESC_CALL,
2837c63b39d6Schristos   BFD_RELOC_386_TLS_DESC,
2838c63b39d6Schristos   BFD_RELOC_386_IRELATIVE,
2839a636ddcaSmrg   BFD_RELOC_386_GOT32X,
2840c63b39d6Schristos 
2841c63b39d6Schristos /* x86-64/elf relocations  */
2842c63b39d6Schristos   BFD_RELOC_X86_64_GOT32,
2843c63b39d6Schristos   BFD_RELOC_X86_64_PLT32,
2844c63b39d6Schristos   BFD_RELOC_X86_64_COPY,
2845c63b39d6Schristos   BFD_RELOC_X86_64_GLOB_DAT,
2846c63b39d6Schristos   BFD_RELOC_X86_64_JUMP_SLOT,
2847c63b39d6Schristos   BFD_RELOC_X86_64_RELATIVE,
2848c63b39d6Schristos   BFD_RELOC_X86_64_GOTPCREL,
2849c63b39d6Schristos   BFD_RELOC_X86_64_32S,
2850c63b39d6Schristos   BFD_RELOC_X86_64_DTPMOD64,
2851c63b39d6Schristos   BFD_RELOC_X86_64_DTPOFF64,
2852c63b39d6Schristos   BFD_RELOC_X86_64_TPOFF64,
2853c63b39d6Schristos   BFD_RELOC_X86_64_TLSGD,
2854c63b39d6Schristos   BFD_RELOC_X86_64_TLSLD,
2855c63b39d6Schristos   BFD_RELOC_X86_64_DTPOFF32,
2856c63b39d6Schristos   BFD_RELOC_X86_64_GOTTPOFF,
2857c63b39d6Schristos   BFD_RELOC_X86_64_TPOFF32,
2858c63b39d6Schristos   BFD_RELOC_X86_64_GOTOFF64,
2859c63b39d6Schristos   BFD_RELOC_X86_64_GOTPC32,
2860c63b39d6Schristos   BFD_RELOC_X86_64_GOT64,
2861c63b39d6Schristos   BFD_RELOC_X86_64_GOTPCREL64,
2862c63b39d6Schristos   BFD_RELOC_X86_64_GOTPC64,
2863c63b39d6Schristos   BFD_RELOC_X86_64_GOTPLT64,
2864c63b39d6Schristos   BFD_RELOC_X86_64_PLTOFF64,
2865c63b39d6Schristos   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
2866c63b39d6Schristos   BFD_RELOC_X86_64_TLSDESC_CALL,
2867c63b39d6Schristos   BFD_RELOC_X86_64_TLSDESC,
2868c63b39d6Schristos   BFD_RELOC_X86_64_IRELATIVE,
286944a21023Schristos   BFD_RELOC_X86_64_PC32_BND,
287044a21023Schristos   BFD_RELOC_X86_64_PLT32_BND,
2871a636ddcaSmrg   BFD_RELOC_X86_64_GOTPCRELX,
2872a636ddcaSmrg   BFD_RELOC_X86_64_REX_GOTPCRELX,
2873c63b39d6Schristos 
2874c63b39d6Schristos /* ns32k relocations  */
2875c63b39d6Schristos   BFD_RELOC_NS32K_IMM_8,
2876c63b39d6Schristos   BFD_RELOC_NS32K_IMM_16,
2877c63b39d6Schristos   BFD_RELOC_NS32K_IMM_32,
2878c63b39d6Schristos   BFD_RELOC_NS32K_IMM_8_PCREL,
2879c63b39d6Schristos   BFD_RELOC_NS32K_IMM_16_PCREL,
2880c63b39d6Schristos   BFD_RELOC_NS32K_IMM_32_PCREL,
2881c63b39d6Schristos   BFD_RELOC_NS32K_DISP_8,
2882c63b39d6Schristos   BFD_RELOC_NS32K_DISP_16,
2883c63b39d6Schristos   BFD_RELOC_NS32K_DISP_32,
2884c63b39d6Schristos   BFD_RELOC_NS32K_DISP_8_PCREL,
2885c63b39d6Schristos   BFD_RELOC_NS32K_DISP_16_PCREL,
2886c63b39d6Schristos   BFD_RELOC_NS32K_DISP_32_PCREL,
2887c63b39d6Schristos 
2888c63b39d6Schristos /* PDP11 relocations  */
2889c63b39d6Schristos   BFD_RELOC_PDP11_DISP_8_PCREL,
2890c63b39d6Schristos   BFD_RELOC_PDP11_DISP_6_PCREL,
2891c63b39d6Schristos 
2892c63b39d6Schristos /* Picojava relocs.  Not all of these appear in object files.  */
2893c63b39d6Schristos   BFD_RELOC_PJ_CODE_HI16,
2894c63b39d6Schristos   BFD_RELOC_PJ_CODE_LO16,
2895c63b39d6Schristos   BFD_RELOC_PJ_CODE_DIR16,
2896c63b39d6Schristos   BFD_RELOC_PJ_CODE_DIR32,
2897c63b39d6Schristos   BFD_RELOC_PJ_CODE_REL16,
2898c63b39d6Schristos   BFD_RELOC_PJ_CODE_REL32,
2899c63b39d6Schristos 
2900c63b39d6Schristos /* Power(rs6000) and PowerPC relocations.  */
2901c63b39d6Schristos   BFD_RELOC_PPC_B26,
2902c63b39d6Schristos   BFD_RELOC_PPC_BA26,
2903c63b39d6Schristos   BFD_RELOC_PPC_TOC16,
2904c63b39d6Schristos   BFD_RELOC_PPC_B16,
2905c63b39d6Schristos   BFD_RELOC_PPC_B16_BRTAKEN,
2906c63b39d6Schristos   BFD_RELOC_PPC_B16_BRNTAKEN,
2907c63b39d6Schristos   BFD_RELOC_PPC_BA16,
2908c63b39d6Schristos   BFD_RELOC_PPC_BA16_BRTAKEN,
2909c63b39d6Schristos   BFD_RELOC_PPC_BA16_BRNTAKEN,
2910c63b39d6Schristos   BFD_RELOC_PPC_COPY,
2911c63b39d6Schristos   BFD_RELOC_PPC_GLOB_DAT,
2912c63b39d6Schristos   BFD_RELOC_PPC_JMP_SLOT,
2913c63b39d6Schristos   BFD_RELOC_PPC_RELATIVE,
2914c63b39d6Schristos   BFD_RELOC_PPC_LOCAL24PC,
2915c63b39d6Schristos   BFD_RELOC_PPC_EMB_NADDR32,
2916c63b39d6Schristos   BFD_RELOC_PPC_EMB_NADDR16,
2917c63b39d6Schristos   BFD_RELOC_PPC_EMB_NADDR16_LO,
2918c63b39d6Schristos   BFD_RELOC_PPC_EMB_NADDR16_HI,
2919c63b39d6Schristos   BFD_RELOC_PPC_EMB_NADDR16_HA,
2920c63b39d6Schristos   BFD_RELOC_PPC_EMB_SDAI16,
2921c63b39d6Schristos   BFD_RELOC_PPC_EMB_SDA2I16,
2922c63b39d6Schristos   BFD_RELOC_PPC_EMB_SDA2REL,
2923c63b39d6Schristos   BFD_RELOC_PPC_EMB_SDA21,
2924c63b39d6Schristos   BFD_RELOC_PPC_EMB_MRKREF,
2925c63b39d6Schristos   BFD_RELOC_PPC_EMB_RELSEC16,
2926c63b39d6Schristos   BFD_RELOC_PPC_EMB_RELST_LO,
2927c63b39d6Schristos   BFD_RELOC_PPC_EMB_RELST_HI,
2928c63b39d6Schristos   BFD_RELOC_PPC_EMB_RELST_HA,
2929c63b39d6Schristos   BFD_RELOC_PPC_EMB_BIT_FLD,
2930c63b39d6Schristos   BFD_RELOC_PPC_EMB_RELSDA,
2931fdeb0babSchristos   BFD_RELOC_PPC_VLE_REL8,
2932fdeb0babSchristos   BFD_RELOC_PPC_VLE_REL15,
2933fdeb0babSchristos   BFD_RELOC_PPC_VLE_REL24,
2934fdeb0babSchristos   BFD_RELOC_PPC_VLE_LO16A,
2935fdeb0babSchristos   BFD_RELOC_PPC_VLE_LO16D,
2936fdeb0babSchristos   BFD_RELOC_PPC_VLE_HI16A,
2937fdeb0babSchristos   BFD_RELOC_PPC_VLE_HI16D,
2938fdeb0babSchristos   BFD_RELOC_PPC_VLE_HA16A,
2939fdeb0babSchristos   BFD_RELOC_PPC_VLE_HA16D,
2940fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDA21,
2941fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDA21_LO,
2942fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_LO16A,
2943fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_LO16D,
2944fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_HI16A,
2945fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_HI16D,
2946fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_HA16A,
2947fdeb0babSchristos   BFD_RELOC_PPC_VLE_SDAREL_HA16D,
29489bc6a05dSchristos   BFD_RELOC_PPC_16DX_HA,
2949a636ddcaSmrg   BFD_RELOC_PPC_REL16DX_HA,
2950c63b39d6Schristos   BFD_RELOC_PPC64_HIGHER,
2951c63b39d6Schristos   BFD_RELOC_PPC64_HIGHER_S,
2952c63b39d6Schristos   BFD_RELOC_PPC64_HIGHEST,
2953c63b39d6Schristos   BFD_RELOC_PPC64_HIGHEST_S,
2954c63b39d6Schristos   BFD_RELOC_PPC64_TOC16_LO,
2955c63b39d6Schristos   BFD_RELOC_PPC64_TOC16_HI,
2956c63b39d6Schristos   BFD_RELOC_PPC64_TOC16_HA,
2957c63b39d6Schristos   BFD_RELOC_PPC64_TOC,
2958c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16,
2959c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16_LO,
2960c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16_HI,
2961c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16_HA,
2962c63b39d6Schristos   BFD_RELOC_PPC64_ADDR16_DS,
2963c63b39d6Schristos   BFD_RELOC_PPC64_ADDR16_LO_DS,
2964c63b39d6Schristos   BFD_RELOC_PPC64_GOT16_DS,
2965c63b39d6Schristos   BFD_RELOC_PPC64_GOT16_LO_DS,
2966c63b39d6Schristos   BFD_RELOC_PPC64_PLT16_LO_DS,
2967c63b39d6Schristos   BFD_RELOC_PPC64_SECTOFF_DS,
2968c63b39d6Schristos   BFD_RELOC_PPC64_SECTOFF_LO_DS,
2969c63b39d6Schristos   BFD_RELOC_PPC64_TOC16_DS,
2970c63b39d6Schristos   BFD_RELOC_PPC64_TOC16_LO_DS,
2971c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16_DS,
2972c63b39d6Schristos   BFD_RELOC_PPC64_PLTGOT16_LO_DS,
297344a21023Schristos   BFD_RELOC_PPC64_ADDR16_HIGH,
297444a21023Schristos   BFD_RELOC_PPC64_ADDR16_HIGHA,
297577cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGH,
297677cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGHA,
297777cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGHER,
297877cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGHERA,
297977cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGHEST,
298077cd98dfSchristos   BFD_RELOC_PPC64_REL16_HIGHESTA,
2981b511d482Schristos   BFD_RELOC_PPC64_ADDR64_LOCAL,
2982a636ddcaSmrg   BFD_RELOC_PPC64_ENTRY,
298377cd98dfSchristos   BFD_RELOC_PPC64_REL24_NOTOC,
2984*fd82c4c4Schristos   BFD_RELOC_PPC64_D34,
2985*fd82c4c4Schristos   BFD_RELOC_PPC64_D34_LO,
2986*fd82c4c4Schristos   BFD_RELOC_PPC64_D34_HI30,
2987*fd82c4c4Schristos   BFD_RELOC_PPC64_D34_HA30,
2988*fd82c4c4Schristos   BFD_RELOC_PPC64_PCREL34,
2989*fd82c4c4Schristos   BFD_RELOC_PPC64_GOT_PCREL34,
2990*fd82c4c4Schristos   BFD_RELOC_PPC64_PLT_PCREL34,
2991*fd82c4c4Schristos   BFD_RELOC_PPC64_ADDR16_HIGHER34,
2992*fd82c4c4Schristos   BFD_RELOC_PPC64_ADDR16_HIGHERA34,
2993*fd82c4c4Schristos   BFD_RELOC_PPC64_ADDR16_HIGHEST34,
2994*fd82c4c4Schristos   BFD_RELOC_PPC64_ADDR16_HIGHESTA34,
2995*fd82c4c4Schristos   BFD_RELOC_PPC64_REL16_HIGHER34,
2996*fd82c4c4Schristos   BFD_RELOC_PPC64_REL16_HIGHERA34,
2997*fd82c4c4Schristos   BFD_RELOC_PPC64_REL16_HIGHEST34,
2998*fd82c4c4Schristos   BFD_RELOC_PPC64_REL16_HIGHESTA34,
2999*fd82c4c4Schristos   BFD_RELOC_PPC64_D28,
3000*fd82c4c4Schristos   BFD_RELOC_PPC64_PCREL28,
3001c63b39d6Schristos 
3002c63b39d6Schristos /* PowerPC and PowerPC64 thread-local storage relocations.  */
3003c63b39d6Schristos   BFD_RELOC_PPC_TLS,
3004c63b39d6Schristos   BFD_RELOC_PPC_TLSGD,
3005c63b39d6Schristos   BFD_RELOC_PPC_TLSLD,
3006c63b39d6Schristos   BFD_RELOC_PPC_DTPMOD,
3007c63b39d6Schristos   BFD_RELOC_PPC_TPREL16,
3008c63b39d6Schristos   BFD_RELOC_PPC_TPREL16_LO,
3009c63b39d6Schristos   BFD_RELOC_PPC_TPREL16_HI,
3010c63b39d6Schristos   BFD_RELOC_PPC_TPREL16_HA,
3011c63b39d6Schristos   BFD_RELOC_PPC_TPREL,
3012c63b39d6Schristos   BFD_RELOC_PPC_DTPREL16,
3013c63b39d6Schristos   BFD_RELOC_PPC_DTPREL16_LO,
3014c63b39d6Schristos   BFD_RELOC_PPC_DTPREL16_HI,
3015c63b39d6Schristos   BFD_RELOC_PPC_DTPREL16_HA,
3016c63b39d6Schristos   BFD_RELOC_PPC_DTPREL,
3017c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSGD16,
3018c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSGD16_LO,
3019c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSGD16_HI,
3020c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSGD16_HA,
3021c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSLD16,
3022c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSLD16_LO,
3023c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSLD16_HI,
3024c63b39d6Schristos   BFD_RELOC_PPC_GOT_TLSLD16_HA,
3025c63b39d6Schristos   BFD_RELOC_PPC_GOT_TPREL16,
3026c63b39d6Schristos   BFD_RELOC_PPC_GOT_TPREL16_LO,
3027c63b39d6Schristos   BFD_RELOC_PPC_GOT_TPREL16_HI,
3028c63b39d6Schristos   BFD_RELOC_PPC_GOT_TPREL16_HA,
3029c63b39d6Schristos   BFD_RELOC_PPC_GOT_DTPREL16,
3030c63b39d6Schristos   BFD_RELOC_PPC_GOT_DTPREL16_LO,
3031c63b39d6Schristos   BFD_RELOC_PPC_GOT_DTPREL16_HI,
3032c63b39d6Schristos   BFD_RELOC_PPC_GOT_DTPREL16_HA,
3033c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_DS,
3034c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_LO_DS,
3035*fd82c4c4Schristos   BFD_RELOC_PPC64_TPREL16_HIGH,
3036*fd82c4c4Schristos   BFD_RELOC_PPC64_TPREL16_HIGHA,
3037c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_HIGHER,
3038c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_HIGHERA,
3039c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_HIGHEST,
3040c63b39d6Schristos   BFD_RELOC_PPC64_TPREL16_HIGHESTA,
3041c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_DS,
3042c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_LO_DS,
3043*fd82c4c4Schristos   BFD_RELOC_PPC64_DTPREL16_HIGH,
3044*fd82c4c4Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHA,
3045c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHER,
3046c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHERA,
3047c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHEST,
3048c63b39d6Schristos   BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
3049*fd82c4c4Schristos   BFD_RELOC_PPC64_TPREL34,
3050*fd82c4c4Schristos   BFD_RELOC_PPC64_DTPREL34,
3051*fd82c4c4Schristos   BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
3052*fd82c4c4Schristos   BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
3053*fd82c4c4Schristos   BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
3054*fd82c4c4Schristos   BFD_RELOC_PPC64_GOT_DTPREL_PCREL34,
3055*fd82c4c4Schristos   BFD_RELOC_PPC64_TLS_PCREL,
3056c63b39d6Schristos 
3057c63b39d6Schristos /* IBM 370/390 relocations  */
3058c63b39d6Schristos   BFD_RELOC_I370_D12,
3059c63b39d6Schristos 
3060c63b39d6Schristos /* The type of reloc used to build a constructor table - at the moment
3061c63b39d6Schristos probably a 32 bit wide absolute relocation, but the target can choose.
3062c63b39d6Schristos It generally does map to one of the other relocation types.  */
3063c63b39d6Schristos   BFD_RELOC_CTOR,
3064c63b39d6Schristos 
3065c63b39d6Schristos /* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
3066c63b39d6Schristos not stored in the instruction.  */
3067c63b39d6Schristos   BFD_RELOC_ARM_PCREL_BRANCH,
3068c63b39d6Schristos 
3069c63b39d6Schristos /* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
3070c63b39d6Schristos not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
3071c63b39d6Schristos field in the instruction.  */
3072c63b39d6Schristos   BFD_RELOC_ARM_PCREL_BLX,
3073c63b39d6Schristos 
3074c63b39d6Schristos /* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
3075c63b39d6Schristos not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
3076c63b39d6Schristos field in the instruction.  */
3077c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BLX,
3078c63b39d6Schristos 
3079c63b39d6Schristos /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
3080c63b39d6Schristos   BFD_RELOC_ARM_PCREL_CALL,
3081c63b39d6Schristos 
3082c63b39d6Schristos /* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
3083c63b39d6Schristos   BFD_RELOC_ARM_PCREL_JUMP,
3084c63b39d6Schristos 
3085*fd82c4c4Schristos /* ARM 5-bit pc-relative branch for Branch Future instructions.  */
3086*fd82c4c4Schristos   BFD_RELOC_THUMB_PCREL_BRANCH5,
3087*fd82c4c4Schristos 
3088*fd82c4c4Schristos /* ARM 6-bit pc-relative branch for BFCSEL instruction.  */
3089*fd82c4c4Schristos   BFD_RELOC_THUMB_PCREL_BFCSEL,
3090*fd82c4c4Schristos 
3091*fd82c4c4Schristos /* ARM 17-bit pc-relative branch for Branch Future instructions.  */
3092*fd82c4c4Schristos   BFD_RELOC_ARM_THUMB_BF17,
3093*fd82c4c4Schristos 
3094*fd82c4c4Schristos /* ARM 13-bit pc-relative branch for BFCSEL instruction.  */
3095*fd82c4c4Schristos   BFD_RELOC_ARM_THUMB_BF13,
3096*fd82c4c4Schristos 
3097*fd82c4c4Schristos /* ARM 19-bit pc-relative branch for Branch Future Link instruction.  */
3098*fd82c4c4Schristos   BFD_RELOC_ARM_THUMB_BF19,
3099*fd82c4c4Schristos 
3100*fd82c4c4Schristos /* ARM 12-bit pc-relative branch for Low Overhead Loop instructions.  */
3101*fd82c4c4Schristos   BFD_RELOC_ARM_THUMB_LOOP12,
3102*fd82c4c4Schristos 
3103c63b39d6Schristos /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
3104c63b39d6Schristos The lowest bit must be zero and is not stored in the instruction.
3105c63b39d6Schristos Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
3106c63b39d6Schristos "nn" one smaller in all cases.  Note further that BRANCH23
3107c63b39d6Schristos corresponds to R_ARM_THM_CALL.  */
3108c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH7,
3109c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH9,
3110c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH12,
3111c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH20,
3112c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH23,
3113c63b39d6Schristos   BFD_RELOC_THUMB_PCREL_BRANCH25,
3114c63b39d6Schristos 
3115c63b39d6Schristos /* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
3116c63b39d6Schristos   BFD_RELOC_ARM_OFFSET_IMM,
3117c63b39d6Schristos 
3118c63b39d6Schristos /* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
3119c63b39d6Schristos   BFD_RELOC_ARM_THUMB_OFFSET,
3120c63b39d6Schristos 
3121c63b39d6Schristos /* Pc-relative or absolute relocation depending on target.  Used for
3122c63b39d6Schristos entries in .init_array sections.  */
3123c63b39d6Schristos   BFD_RELOC_ARM_TARGET1,
3124c63b39d6Schristos 
3125c63b39d6Schristos /* Read-only segment base relative address.  */
3126c63b39d6Schristos   BFD_RELOC_ARM_ROSEGREL32,
3127c63b39d6Schristos 
3128c63b39d6Schristos /* Data segment base relative address.  */
3129c63b39d6Schristos   BFD_RELOC_ARM_SBREL32,
3130c63b39d6Schristos 
3131c63b39d6Schristos /* This reloc is used for references to RTTI data from exception handling
3132c63b39d6Schristos tables.  The actual definition depends on the target.  It may be a
3133c63b39d6Schristos pc-relative or some form of GOT-indirect relocation.  */
3134c63b39d6Schristos   BFD_RELOC_ARM_TARGET2,
3135c63b39d6Schristos 
3136c63b39d6Schristos /* 31-bit PC relative address.  */
3137c63b39d6Schristos   BFD_RELOC_ARM_PREL31,
3138c63b39d6Schristos 
3139c63b39d6Schristos /* Low and High halfword relocations for MOVW and MOVT instructions.  */
3140c63b39d6Schristos   BFD_RELOC_ARM_MOVW,
3141c63b39d6Schristos   BFD_RELOC_ARM_MOVT,
3142c63b39d6Schristos   BFD_RELOC_ARM_MOVW_PCREL,
3143c63b39d6Schristos   BFD_RELOC_ARM_MOVT_PCREL,
3144c63b39d6Schristos   BFD_RELOC_ARM_THUMB_MOVW,
3145c63b39d6Schristos   BFD_RELOC_ARM_THUMB_MOVT,
3146c63b39d6Schristos   BFD_RELOC_ARM_THUMB_MOVW_PCREL,
3147c63b39d6Schristos   BFD_RELOC_ARM_THUMB_MOVT_PCREL,
3148c63b39d6Schristos 
314977cd98dfSchristos /* ARM FDPIC specific relocations.  */
315077cd98dfSchristos   BFD_RELOC_ARM_GOTFUNCDESC,
315177cd98dfSchristos   BFD_RELOC_ARM_GOTOFFFUNCDESC,
315277cd98dfSchristos   BFD_RELOC_ARM_FUNCDESC,
315377cd98dfSchristos   BFD_RELOC_ARM_FUNCDESC_VALUE,
315477cd98dfSchristos   BFD_RELOC_ARM_TLS_GD32_FDPIC,
315577cd98dfSchristos   BFD_RELOC_ARM_TLS_LDM32_FDPIC,
315677cd98dfSchristos   BFD_RELOC_ARM_TLS_IE32_FDPIC,
315777cd98dfSchristos 
3158c63b39d6Schristos /* Relocations for setting up GOTs and PLTs for shared libraries.  */
3159c63b39d6Schristos   BFD_RELOC_ARM_JUMP_SLOT,
3160c63b39d6Schristos   BFD_RELOC_ARM_GLOB_DAT,
3161c63b39d6Schristos   BFD_RELOC_ARM_GOT32,
3162c63b39d6Schristos   BFD_RELOC_ARM_PLT32,
3163c63b39d6Schristos   BFD_RELOC_ARM_RELATIVE,
3164c63b39d6Schristos   BFD_RELOC_ARM_GOTOFF,
3165c63b39d6Schristos   BFD_RELOC_ARM_GOTPC,
3166c63b39d6Schristos   BFD_RELOC_ARM_GOT_PREL,
3167c63b39d6Schristos 
3168c63b39d6Schristos /* ARM thread-local storage relocations.  */
3169c63b39d6Schristos   BFD_RELOC_ARM_TLS_GD32,
3170c63b39d6Schristos   BFD_RELOC_ARM_TLS_LDO32,
3171c63b39d6Schristos   BFD_RELOC_ARM_TLS_LDM32,
3172c63b39d6Schristos   BFD_RELOC_ARM_TLS_DTPOFF32,
3173c63b39d6Schristos   BFD_RELOC_ARM_TLS_DTPMOD32,
3174c63b39d6Schristos   BFD_RELOC_ARM_TLS_TPOFF32,
3175c63b39d6Schristos   BFD_RELOC_ARM_TLS_IE32,
3176c63b39d6Schristos   BFD_RELOC_ARM_TLS_LE32,
3177c63b39d6Schristos   BFD_RELOC_ARM_TLS_GOTDESC,
3178c63b39d6Schristos   BFD_RELOC_ARM_TLS_CALL,
3179c63b39d6Schristos   BFD_RELOC_ARM_THM_TLS_CALL,
3180c63b39d6Schristos   BFD_RELOC_ARM_TLS_DESCSEQ,
3181c63b39d6Schristos   BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3182c63b39d6Schristos   BFD_RELOC_ARM_TLS_DESC,
3183c63b39d6Schristos 
3184c63b39d6Schristos /* ARM group relocations.  */
3185c63b39d6Schristos   BFD_RELOC_ARM_ALU_PC_G0_NC,
3186c63b39d6Schristos   BFD_RELOC_ARM_ALU_PC_G0,
3187c63b39d6Schristos   BFD_RELOC_ARM_ALU_PC_G1_NC,
3188c63b39d6Schristos   BFD_RELOC_ARM_ALU_PC_G1,
3189c63b39d6Schristos   BFD_RELOC_ARM_ALU_PC_G2,
3190c63b39d6Schristos   BFD_RELOC_ARM_LDR_PC_G0,
3191c63b39d6Schristos   BFD_RELOC_ARM_LDR_PC_G1,
3192c63b39d6Schristos   BFD_RELOC_ARM_LDR_PC_G2,
3193c63b39d6Schristos   BFD_RELOC_ARM_LDRS_PC_G0,
3194c63b39d6Schristos   BFD_RELOC_ARM_LDRS_PC_G1,
3195c63b39d6Schristos   BFD_RELOC_ARM_LDRS_PC_G2,
3196c63b39d6Schristos   BFD_RELOC_ARM_LDC_PC_G0,
3197c63b39d6Schristos   BFD_RELOC_ARM_LDC_PC_G1,
3198c63b39d6Schristos   BFD_RELOC_ARM_LDC_PC_G2,
3199c63b39d6Schristos   BFD_RELOC_ARM_ALU_SB_G0_NC,
3200c63b39d6Schristos   BFD_RELOC_ARM_ALU_SB_G0,
3201c63b39d6Schristos   BFD_RELOC_ARM_ALU_SB_G1_NC,
3202c63b39d6Schristos   BFD_RELOC_ARM_ALU_SB_G1,
3203c63b39d6Schristos   BFD_RELOC_ARM_ALU_SB_G2,
3204c63b39d6Schristos   BFD_RELOC_ARM_LDR_SB_G0,
3205c63b39d6Schristos   BFD_RELOC_ARM_LDR_SB_G1,
3206c63b39d6Schristos   BFD_RELOC_ARM_LDR_SB_G2,
3207c63b39d6Schristos   BFD_RELOC_ARM_LDRS_SB_G0,
3208c63b39d6Schristos   BFD_RELOC_ARM_LDRS_SB_G1,
3209c63b39d6Schristos   BFD_RELOC_ARM_LDRS_SB_G2,
3210c63b39d6Schristos   BFD_RELOC_ARM_LDC_SB_G0,
3211c63b39d6Schristos   BFD_RELOC_ARM_LDC_SB_G1,
3212c63b39d6Schristos   BFD_RELOC_ARM_LDC_SB_G2,
3213c63b39d6Schristos 
3214c63b39d6Schristos /* Annotation of BX instructions.  */
3215c63b39d6Schristos   BFD_RELOC_ARM_V4BX,
3216c63b39d6Schristos 
3217c63b39d6Schristos /* ARM support for STT_GNU_IFUNC.  */
3218c63b39d6Schristos   BFD_RELOC_ARM_IRELATIVE,
3219c63b39d6Schristos 
3220a636ddcaSmrg /* Thumb1 relocations to support execute-only code.  */
3221a636ddcaSmrg   BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
3222a636ddcaSmrg   BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
3223a636ddcaSmrg   BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC,
3224a636ddcaSmrg   BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC,
3225a636ddcaSmrg 
3226c63b39d6Schristos /* These relocs are only used within the ARM assembler.  They are not
3227c63b39d6Schristos (at present) written to any object files.  */
3228c63b39d6Schristos   BFD_RELOC_ARM_IMMEDIATE,
3229c63b39d6Schristos   BFD_RELOC_ARM_ADRL_IMMEDIATE,
3230c63b39d6Schristos   BFD_RELOC_ARM_T32_IMMEDIATE,
3231c63b39d6Schristos   BFD_RELOC_ARM_T32_ADD_IMM,
3232c63b39d6Schristos   BFD_RELOC_ARM_T32_IMM12,
3233c63b39d6Schristos   BFD_RELOC_ARM_T32_ADD_PC12,
3234c63b39d6Schristos   BFD_RELOC_ARM_SHIFT_IMM,
3235c63b39d6Schristos   BFD_RELOC_ARM_SMC,
3236c63b39d6Schristos   BFD_RELOC_ARM_HVC,
3237c63b39d6Schristos   BFD_RELOC_ARM_SWI,
3238c63b39d6Schristos   BFD_RELOC_ARM_MULTI,
3239c63b39d6Schristos   BFD_RELOC_ARM_CP_OFF_IMM,
3240c63b39d6Schristos   BFD_RELOC_ARM_CP_OFF_IMM_S2,
3241c63b39d6Schristos   BFD_RELOC_ARM_T32_CP_OFF_IMM,
3242c63b39d6Schristos   BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
3243*fd82c4c4Schristos   BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM,
3244c63b39d6Schristos   BFD_RELOC_ARM_ADR_IMM,
3245c63b39d6Schristos   BFD_RELOC_ARM_LDR_IMM,
3246c63b39d6Schristos   BFD_RELOC_ARM_LITERAL,
3247c63b39d6Schristos   BFD_RELOC_ARM_IN_POOL,
3248c63b39d6Schristos   BFD_RELOC_ARM_OFFSET_IMM8,
3249c63b39d6Schristos   BFD_RELOC_ARM_T32_OFFSET_U8,
3250c63b39d6Schristos   BFD_RELOC_ARM_T32_OFFSET_IMM,
3251c63b39d6Schristos   BFD_RELOC_ARM_HWLITERAL,
3252c63b39d6Schristos   BFD_RELOC_ARM_THUMB_ADD,
3253c63b39d6Schristos   BFD_RELOC_ARM_THUMB_IMM,
3254c63b39d6Schristos   BFD_RELOC_ARM_THUMB_SHIFT,
3255c63b39d6Schristos 
3256c63b39d6Schristos /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
3257c63b39d6Schristos   BFD_RELOC_SH_PCDISP8BY2,
3258c63b39d6Schristos   BFD_RELOC_SH_PCDISP12BY2,
3259c63b39d6Schristos   BFD_RELOC_SH_IMM3,
3260c63b39d6Schristos   BFD_RELOC_SH_IMM3U,
3261c63b39d6Schristos   BFD_RELOC_SH_DISP12,
3262c63b39d6Schristos   BFD_RELOC_SH_DISP12BY2,
3263c63b39d6Schristos   BFD_RELOC_SH_DISP12BY4,
3264c63b39d6Schristos   BFD_RELOC_SH_DISP12BY8,
3265c63b39d6Schristos   BFD_RELOC_SH_DISP20,
3266c63b39d6Schristos   BFD_RELOC_SH_DISP20BY8,
3267c63b39d6Schristos   BFD_RELOC_SH_IMM4,
3268c63b39d6Schristos   BFD_RELOC_SH_IMM4BY2,
3269c63b39d6Schristos   BFD_RELOC_SH_IMM4BY4,
3270c63b39d6Schristos   BFD_RELOC_SH_IMM8,
3271c63b39d6Schristos   BFD_RELOC_SH_IMM8BY2,
3272c63b39d6Schristos   BFD_RELOC_SH_IMM8BY4,
3273c63b39d6Schristos   BFD_RELOC_SH_PCRELIMM8BY2,
3274c63b39d6Schristos   BFD_RELOC_SH_PCRELIMM8BY4,
3275c63b39d6Schristos   BFD_RELOC_SH_SWITCH16,
3276c63b39d6Schristos   BFD_RELOC_SH_SWITCH32,
3277c63b39d6Schristos   BFD_RELOC_SH_USES,
3278c63b39d6Schristos   BFD_RELOC_SH_COUNT,
3279c63b39d6Schristos   BFD_RELOC_SH_ALIGN,
3280c63b39d6Schristos   BFD_RELOC_SH_CODE,
3281c63b39d6Schristos   BFD_RELOC_SH_DATA,
3282c63b39d6Schristos   BFD_RELOC_SH_LABEL,
3283c63b39d6Schristos   BFD_RELOC_SH_LOOP_START,
3284c63b39d6Schristos   BFD_RELOC_SH_LOOP_END,
3285c63b39d6Schristos   BFD_RELOC_SH_COPY,
3286c63b39d6Schristos   BFD_RELOC_SH_GLOB_DAT,
3287c63b39d6Schristos   BFD_RELOC_SH_JMP_SLOT,
3288c63b39d6Schristos   BFD_RELOC_SH_RELATIVE,
3289c63b39d6Schristos   BFD_RELOC_SH_GOTPC,
3290c63b39d6Schristos   BFD_RELOC_SH_GOT_LOW16,
3291c63b39d6Schristos   BFD_RELOC_SH_GOT_MEDLOW16,
3292c63b39d6Schristos   BFD_RELOC_SH_GOT_MEDHI16,
3293c63b39d6Schristos   BFD_RELOC_SH_GOT_HI16,
3294c63b39d6Schristos   BFD_RELOC_SH_GOTPLT_LOW16,
3295c63b39d6Schristos   BFD_RELOC_SH_GOTPLT_MEDLOW16,
3296c63b39d6Schristos   BFD_RELOC_SH_GOTPLT_MEDHI16,
3297c63b39d6Schristos   BFD_RELOC_SH_GOTPLT_HI16,
3298c63b39d6Schristos   BFD_RELOC_SH_PLT_LOW16,
3299c63b39d6Schristos   BFD_RELOC_SH_PLT_MEDLOW16,
3300c63b39d6Schristos   BFD_RELOC_SH_PLT_MEDHI16,
3301c63b39d6Schristos   BFD_RELOC_SH_PLT_HI16,
3302c63b39d6Schristos   BFD_RELOC_SH_GOTOFF_LOW16,
3303c63b39d6Schristos   BFD_RELOC_SH_GOTOFF_MEDLOW16,
3304c63b39d6Schristos   BFD_RELOC_SH_GOTOFF_MEDHI16,
3305c63b39d6Schristos   BFD_RELOC_SH_GOTOFF_HI16,
3306c63b39d6Schristos   BFD_RELOC_SH_GOTPC_LOW16,
3307c63b39d6Schristos   BFD_RELOC_SH_GOTPC_MEDLOW16,
3308c63b39d6Schristos   BFD_RELOC_SH_GOTPC_MEDHI16,
3309c63b39d6Schristos   BFD_RELOC_SH_GOTPC_HI16,
3310c63b39d6Schristos   BFD_RELOC_SH_COPY64,
3311c63b39d6Schristos   BFD_RELOC_SH_GLOB_DAT64,
3312c63b39d6Schristos   BFD_RELOC_SH_JMP_SLOT64,
3313c63b39d6Schristos   BFD_RELOC_SH_RELATIVE64,
3314c63b39d6Schristos   BFD_RELOC_SH_GOT10BY4,
3315c63b39d6Schristos   BFD_RELOC_SH_GOT10BY8,
3316c63b39d6Schristos   BFD_RELOC_SH_GOTPLT10BY4,
3317c63b39d6Schristos   BFD_RELOC_SH_GOTPLT10BY8,
3318c63b39d6Schristos   BFD_RELOC_SH_GOTPLT32,
3319c63b39d6Schristos   BFD_RELOC_SH_SHMEDIA_CODE,
3320c63b39d6Schristos   BFD_RELOC_SH_IMMU5,
3321c63b39d6Schristos   BFD_RELOC_SH_IMMS6,
3322c63b39d6Schristos   BFD_RELOC_SH_IMMS6BY32,
3323c63b39d6Schristos   BFD_RELOC_SH_IMMU6,
3324c63b39d6Schristos   BFD_RELOC_SH_IMMS10,
3325c63b39d6Schristos   BFD_RELOC_SH_IMMS10BY2,
3326c63b39d6Schristos   BFD_RELOC_SH_IMMS10BY4,
3327c63b39d6Schristos   BFD_RELOC_SH_IMMS10BY8,
3328c63b39d6Schristos   BFD_RELOC_SH_IMMS16,
3329c63b39d6Schristos   BFD_RELOC_SH_IMMU16,
3330c63b39d6Schristos   BFD_RELOC_SH_IMM_LOW16,
3331c63b39d6Schristos   BFD_RELOC_SH_IMM_LOW16_PCREL,
3332c63b39d6Schristos   BFD_RELOC_SH_IMM_MEDLOW16,
3333c63b39d6Schristos   BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
3334c63b39d6Schristos   BFD_RELOC_SH_IMM_MEDHI16,
3335c63b39d6Schristos   BFD_RELOC_SH_IMM_MEDHI16_PCREL,
3336c63b39d6Schristos   BFD_RELOC_SH_IMM_HI16,
3337c63b39d6Schristos   BFD_RELOC_SH_IMM_HI16_PCREL,
3338c63b39d6Schristos   BFD_RELOC_SH_PT_16,
3339c63b39d6Schristos   BFD_RELOC_SH_TLS_GD_32,
3340c63b39d6Schristos   BFD_RELOC_SH_TLS_LD_32,
3341c63b39d6Schristos   BFD_RELOC_SH_TLS_LDO_32,
3342c63b39d6Schristos   BFD_RELOC_SH_TLS_IE_32,
3343c63b39d6Schristos   BFD_RELOC_SH_TLS_LE_32,
3344c63b39d6Schristos   BFD_RELOC_SH_TLS_DTPMOD32,
3345c63b39d6Schristos   BFD_RELOC_SH_TLS_DTPOFF32,
3346c63b39d6Schristos   BFD_RELOC_SH_TLS_TPOFF32,
3347c63b39d6Schristos   BFD_RELOC_SH_GOT20,
3348c63b39d6Schristos   BFD_RELOC_SH_GOTOFF20,
3349c63b39d6Schristos   BFD_RELOC_SH_GOTFUNCDESC,
3350c63b39d6Schristos   BFD_RELOC_SH_GOTFUNCDESC20,
3351c63b39d6Schristos   BFD_RELOC_SH_GOTOFFFUNCDESC,
3352c63b39d6Schristos   BFD_RELOC_SH_GOTOFFFUNCDESC20,
3353c63b39d6Schristos   BFD_RELOC_SH_FUNCDESC,
3354c63b39d6Schristos 
3355a636ddcaSmrg /* ARC relocs.  */
3356a636ddcaSmrg   BFD_RELOC_ARC_NONE,
3357a636ddcaSmrg   BFD_RELOC_ARC_8,
3358a636ddcaSmrg   BFD_RELOC_ARC_16,
3359a636ddcaSmrg   BFD_RELOC_ARC_24,
3360a636ddcaSmrg   BFD_RELOC_ARC_32,
3361a636ddcaSmrg   BFD_RELOC_ARC_N8,
3362a636ddcaSmrg   BFD_RELOC_ARC_N16,
3363a636ddcaSmrg   BFD_RELOC_ARC_N24,
3364a636ddcaSmrg   BFD_RELOC_ARC_N32,
3365a636ddcaSmrg   BFD_RELOC_ARC_SDA,
3366a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF,
3367a636ddcaSmrg   BFD_RELOC_ARC_S21H_PCREL,
3368a636ddcaSmrg   BFD_RELOC_ARC_S21W_PCREL,
3369a636ddcaSmrg   BFD_RELOC_ARC_S25H_PCREL,
3370a636ddcaSmrg   BFD_RELOC_ARC_S25W_PCREL,
3371a636ddcaSmrg   BFD_RELOC_ARC_SDA32,
3372a636ddcaSmrg   BFD_RELOC_ARC_SDA_LDST,
3373a636ddcaSmrg   BFD_RELOC_ARC_SDA_LDST1,
3374a636ddcaSmrg   BFD_RELOC_ARC_SDA_LDST2,
3375a636ddcaSmrg   BFD_RELOC_ARC_SDA16_LD,
3376a636ddcaSmrg   BFD_RELOC_ARC_SDA16_LD1,
3377a636ddcaSmrg   BFD_RELOC_ARC_SDA16_LD2,
3378a636ddcaSmrg   BFD_RELOC_ARC_S13_PCREL,
3379a636ddcaSmrg   BFD_RELOC_ARC_W,
3380a636ddcaSmrg   BFD_RELOC_ARC_32_ME,
3381a636ddcaSmrg   BFD_RELOC_ARC_32_ME_S,
3382a636ddcaSmrg   BFD_RELOC_ARC_N32_ME,
3383a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF_ME,
3384a636ddcaSmrg   BFD_RELOC_ARC_SDA32_ME,
3385a636ddcaSmrg   BFD_RELOC_ARC_W_ME,
3386a636ddcaSmrg   BFD_RELOC_AC_SECTOFF_U8,
3387a636ddcaSmrg   BFD_RELOC_AC_SECTOFF_U8_1,
3388a636ddcaSmrg   BFD_RELOC_AC_SECTOFF_U8_2,
33899bc6a05dSchristos   BFD_RELOC_AC_SECTOFF_S9,
33909bc6a05dSchristos   BFD_RELOC_AC_SECTOFF_S9_1,
33919bc6a05dSchristos   BFD_RELOC_AC_SECTOFF_S9_2,
3392a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF_ME_1,
3393a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF_ME_2,
3394a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF_1,
3395a636ddcaSmrg   BFD_RELOC_ARC_SECTOFF_2,
33969bc6a05dSchristos   BFD_RELOC_ARC_SDA_12,
3397a636ddcaSmrg   BFD_RELOC_ARC_SDA16_ST2,
3398a636ddcaSmrg   BFD_RELOC_ARC_32_PCREL,
3399a636ddcaSmrg   BFD_RELOC_ARC_PC32,
3400a636ddcaSmrg   BFD_RELOC_ARC_GOT32,
3401a636ddcaSmrg   BFD_RELOC_ARC_GOTPC32,
3402a636ddcaSmrg   BFD_RELOC_ARC_PLT32,
3403a636ddcaSmrg   BFD_RELOC_ARC_COPY,
3404a636ddcaSmrg   BFD_RELOC_ARC_GLOB_DAT,
3405a636ddcaSmrg   BFD_RELOC_ARC_JMP_SLOT,
3406a636ddcaSmrg   BFD_RELOC_ARC_RELATIVE,
3407a636ddcaSmrg   BFD_RELOC_ARC_GOTOFF,
3408a636ddcaSmrg   BFD_RELOC_ARC_GOTPC,
3409a636ddcaSmrg   BFD_RELOC_ARC_S21W_PCREL_PLT,
3410a636ddcaSmrg   BFD_RELOC_ARC_S25H_PCREL_PLT,
3411a636ddcaSmrg   BFD_RELOC_ARC_TLS_DTPMOD,
3412a636ddcaSmrg   BFD_RELOC_ARC_TLS_TPOFF,
3413a636ddcaSmrg   BFD_RELOC_ARC_TLS_GD_GOT,
3414a636ddcaSmrg   BFD_RELOC_ARC_TLS_GD_LD,
3415a636ddcaSmrg   BFD_RELOC_ARC_TLS_GD_CALL,
3416a636ddcaSmrg   BFD_RELOC_ARC_TLS_IE_GOT,
3417a636ddcaSmrg   BFD_RELOC_ARC_TLS_DTPOFF,
3418a636ddcaSmrg   BFD_RELOC_ARC_TLS_DTPOFF_S9,
3419a636ddcaSmrg   BFD_RELOC_ARC_TLS_LE_S9,
3420a636ddcaSmrg   BFD_RELOC_ARC_TLS_LE_32,
3421a636ddcaSmrg   BFD_RELOC_ARC_S25W_PCREL_PLT,
3422a636ddcaSmrg   BFD_RELOC_ARC_S21H_PCREL_PLT,
3423a636ddcaSmrg   BFD_RELOC_ARC_NPS_CMEM16,
342477cd98dfSchristos   BFD_RELOC_ARC_JLI_SECTOFF,
3425c63b39d6Schristos 
3426c63b39d6Schristos /* ADI Blackfin 16 bit immediate absolute reloc.  */
3427c63b39d6Schristos   BFD_RELOC_BFIN_16_IMM,
3428c63b39d6Schristos 
3429c63b39d6Schristos /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
3430c63b39d6Schristos   BFD_RELOC_BFIN_16_HIGH,
3431c63b39d6Schristos 
3432c63b39d6Schristos /* ADI Blackfin 'a' part of LSETUP.  */
3433c63b39d6Schristos   BFD_RELOC_BFIN_4_PCREL,
3434c63b39d6Schristos 
3435c63b39d6Schristos /* ADI Blackfin.  */
3436c63b39d6Schristos   BFD_RELOC_BFIN_5_PCREL,
3437c63b39d6Schristos 
3438c63b39d6Schristos /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
3439c63b39d6Schristos   BFD_RELOC_BFIN_16_LOW,
3440c63b39d6Schristos 
3441c63b39d6Schristos /* ADI Blackfin.  */
3442c63b39d6Schristos   BFD_RELOC_BFIN_10_PCREL,
3443c63b39d6Schristos 
3444c63b39d6Schristos /* ADI Blackfin 'b' part of LSETUP.  */
3445c63b39d6Schristos   BFD_RELOC_BFIN_11_PCREL,
3446c63b39d6Schristos 
3447c63b39d6Schristos /* ADI Blackfin.  */
3448c63b39d6Schristos   BFD_RELOC_BFIN_12_PCREL_JUMP,
3449c63b39d6Schristos 
3450c63b39d6Schristos /* ADI Blackfin Short jump, pcrel.  */
3451c63b39d6Schristos   BFD_RELOC_BFIN_12_PCREL_JUMP_S,
3452c63b39d6Schristos 
3453c63b39d6Schristos /* ADI Blackfin Call.x not implemented.  */
3454c63b39d6Schristos   BFD_RELOC_BFIN_24_PCREL_CALL_X,
3455c63b39d6Schristos 
3456c63b39d6Schristos /* ADI Blackfin Long Jump pcrel.  */
3457c63b39d6Schristos   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
3458c63b39d6Schristos 
3459c63b39d6Schristos /* ADI Blackfin FD-PIC relocations.  */
3460c63b39d6Schristos   BFD_RELOC_BFIN_GOT17M4,
3461c63b39d6Schristos   BFD_RELOC_BFIN_GOTHI,
3462c63b39d6Schristos   BFD_RELOC_BFIN_GOTLO,
3463c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC,
3464c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
3465c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOTHI,
3466c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOTLO,
3467c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_VALUE,
3468c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
3469c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
3470c63b39d6Schristos   BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
3471c63b39d6Schristos   BFD_RELOC_BFIN_GOTOFF17M4,
3472c63b39d6Schristos   BFD_RELOC_BFIN_GOTOFFHI,
3473c63b39d6Schristos   BFD_RELOC_BFIN_GOTOFFLO,
3474c63b39d6Schristos 
3475c63b39d6Schristos /* ADI Blackfin GOT relocation.  */
3476c63b39d6Schristos   BFD_RELOC_BFIN_GOT,
3477c63b39d6Schristos 
3478c63b39d6Schristos /* ADI Blackfin PLTPC relocation.  */
3479c63b39d6Schristos   BFD_RELOC_BFIN_PLTPC,
3480c63b39d6Schristos 
3481c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3482c63b39d6Schristos   BFD_ARELOC_BFIN_PUSH,
3483c63b39d6Schristos 
3484c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3485c63b39d6Schristos   BFD_ARELOC_BFIN_CONST,
3486c63b39d6Schristos 
3487c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3488c63b39d6Schristos   BFD_ARELOC_BFIN_ADD,
3489c63b39d6Schristos 
3490c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3491c63b39d6Schristos   BFD_ARELOC_BFIN_SUB,
3492c63b39d6Schristos 
3493c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3494c63b39d6Schristos   BFD_ARELOC_BFIN_MULT,
3495c63b39d6Schristos 
3496c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3497c63b39d6Schristos   BFD_ARELOC_BFIN_DIV,
3498c63b39d6Schristos 
3499c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3500c63b39d6Schristos   BFD_ARELOC_BFIN_MOD,
3501c63b39d6Schristos 
3502c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3503c63b39d6Schristos   BFD_ARELOC_BFIN_LSHIFT,
3504c63b39d6Schristos 
3505c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3506c63b39d6Schristos   BFD_ARELOC_BFIN_RSHIFT,
3507c63b39d6Schristos 
3508c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3509c63b39d6Schristos   BFD_ARELOC_BFIN_AND,
3510c63b39d6Schristos 
3511c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3512c63b39d6Schristos   BFD_ARELOC_BFIN_OR,
3513c63b39d6Schristos 
3514c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3515c63b39d6Schristos   BFD_ARELOC_BFIN_XOR,
3516c63b39d6Schristos 
3517c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3518c63b39d6Schristos   BFD_ARELOC_BFIN_LAND,
3519c63b39d6Schristos 
3520c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3521c63b39d6Schristos   BFD_ARELOC_BFIN_LOR,
3522c63b39d6Schristos 
3523c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3524c63b39d6Schristos   BFD_ARELOC_BFIN_LEN,
3525c63b39d6Schristos 
3526c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3527c63b39d6Schristos   BFD_ARELOC_BFIN_NEG,
3528c63b39d6Schristos 
3529c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3530c63b39d6Schristos   BFD_ARELOC_BFIN_COMP,
3531c63b39d6Schristos 
3532c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3533c63b39d6Schristos   BFD_ARELOC_BFIN_PAGE,
3534c63b39d6Schristos 
3535c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3536c63b39d6Schristos   BFD_ARELOC_BFIN_HWPAGE,
3537c63b39d6Schristos 
3538c63b39d6Schristos /* ADI Blackfin arithmetic relocation.  */
3539c63b39d6Schristos   BFD_ARELOC_BFIN_ADDR,
3540c63b39d6Schristos 
3541c63b39d6Schristos /* Mitsubishi D10V relocs.
3542c63b39d6Schristos This is a 10-bit reloc with the right 2 bits
3543c63b39d6Schristos assumed to be 0.  */
3544c63b39d6Schristos   BFD_RELOC_D10V_10_PCREL_R,
3545c63b39d6Schristos 
3546c63b39d6Schristos /* Mitsubishi D10V relocs.
3547c63b39d6Schristos This is a 10-bit reloc with the right 2 bits
3548c63b39d6Schristos assumed to be 0.  This is the same as the previous reloc
3549c63b39d6Schristos except it is in the left container, i.e.,
3550c63b39d6Schristos shifted left 15 bits.  */
3551c63b39d6Schristos   BFD_RELOC_D10V_10_PCREL_L,
3552c63b39d6Schristos 
3553c63b39d6Schristos /* This is an 18-bit reloc with the right 2 bits
3554c63b39d6Schristos assumed to be 0.  */
3555c63b39d6Schristos   BFD_RELOC_D10V_18,
3556c63b39d6Schristos 
3557c63b39d6Schristos /* This is an 18-bit reloc with the right 2 bits
3558c63b39d6Schristos assumed to be 0.  */
3559c63b39d6Schristos   BFD_RELOC_D10V_18_PCREL,
3560c63b39d6Schristos 
3561c63b39d6Schristos /* Mitsubishi D30V relocs.
3562c63b39d6Schristos This is a 6-bit absolute reloc.  */
3563c63b39d6Schristos   BFD_RELOC_D30V_6,
3564c63b39d6Schristos 
3565c63b39d6Schristos /* This is a 6-bit pc-relative reloc with
3566c63b39d6Schristos the right 3 bits assumed to be 0.  */
3567c63b39d6Schristos   BFD_RELOC_D30V_9_PCREL,
3568c63b39d6Schristos 
3569c63b39d6Schristos /* This is a 6-bit pc-relative reloc with
3570c63b39d6Schristos the right 3 bits assumed to be 0. Same
3571c63b39d6Schristos as the previous reloc but on the right side
3572c63b39d6Schristos of the container.  */
3573c63b39d6Schristos   BFD_RELOC_D30V_9_PCREL_R,
3574c63b39d6Schristos 
3575c63b39d6Schristos /* This is a 12-bit absolute reloc with the
3576c63b39d6Schristos right 3 bitsassumed to be 0.  */
3577c63b39d6Schristos   BFD_RELOC_D30V_15,
3578c63b39d6Schristos 
3579c63b39d6Schristos /* This is a 12-bit pc-relative reloc with
3580c63b39d6Schristos the right 3 bits assumed to be 0.  */
3581c63b39d6Schristos   BFD_RELOC_D30V_15_PCREL,
3582c63b39d6Schristos 
3583c63b39d6Schristos /* This is a 12-bit pc-relative reloc with
3584c63b39d6Schristos the right 3 bits assumed to be 0. Same
3585c63b39d6Schristos as the previous reloc but on the right side
3586c63b39d6Schristos of the container.  */
3587c63b39d6Schristos   BFD_RELOC_D30V_15_PCREL_R,
3588c63b39d6Schristos 
3589c63b39d6Schristos /* This is an 18-bit absolute reloc with
3590c63b39d6Schristos the right 3 bits assumed to be 0.  */
3591c63b39d6Schristos   BFD_RELOC_D30V_21,
3592c63b39d6Schristos 
3593c63b39d6Schristos /* This is an 18-bit pc-relative reloc with
3594c63b39d6Schristos the right 3 bits assumed to be 0.  */
3595c63b39d6Schristos   BFD_RELOC_D30V_21_PCREL,
3596c63b39d6Schristos 
3597c63b39d6Schristos /* This is an 18-bit pc-relative reloc with
3598c63b39d6Schristos the right 3 bits assumed to be 0. Same
3599c63b39d6Schristos as the previous reloc but on the right side
3600c63b39d6Schristos of the container.  */
3601c63b39d6Schristos   BFD_RELOC_D30V_21_PCREL_R,
3602c63b39d6Schristos 
3603c63b39d6Schristos /* This is a 32-bit absolute reloc.  */
3604c63b39d6Schristos   BFD_RELOC_D30V_32,
3605c63b39d6Schristos 
3606c63b39d6Schristos /* This is a 32-bit pc-relative reloc.  */
3607c63b39d6Schristos   BFD_RELOC_D30V_32_PCREL,
3608c63b39d6Schristos 
3609c63b39d6Schristos /* DLX relocs  */
3610c63b39d6Schristos   BFD_RELOC_DLX_HI16_S,
3611c63b39d6Schristos 
3612c63b39d6Schristos /* DLX relocs  */
3613c63b39d6Schristos   BFD_RELOC_DLX_LO16,
3614c63b39d6Schristos 
3615c63b39d6Schristos /* DLX relocs  */
3616c63b39d6Schristos   BFD_RELOC_DLX_JMP26,
3617c63b39d6Schristos 
3618c63b39d6Schristos /* Renesas M16C/M32C Relocations.  */
3619c63b39d6Schristos   BFD_RELOC_M32C_HI8,
3620c63b39d6Schristos   BFD_RELOC_M32C_RL_JUMP,
3621c63b39d6Schristos   BFD_RELOC_M32C_RL_1ADDR,
3622c63b39d6Schristos   BFD_RELOC_M32C_RL_2ADDR,
3623c63b39d6Schristos 
3624c63b39d6Schristos /* Renesas M32R (formerly Mitsubishi M32R) relocs.
3625c63b39d6Schristos This is a 24 bit absolute address.  */
3626c63b39d6Schristos   BFD_RELOC_M32R_24,
3627c63b39d6Schristos 
3628c63b39d6Schristos /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
3629c63b39d6Schristos   BFD_RELOC_M32R_10_PCREL,
3630c63b39d6Schristos 
3631c63b39d6Schristos /* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
3632c63b39d6Schristos   BFD_RELOC_M32R_18_PCREL,
3633c63b39d6Schristos 
3634c63b39d6Schristos /* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
3635c63b39d6Schristos   BFD_RELOC_M32R_26_PCREL,
3636c63b39d6Schristos 
3637c63b39d6Schristos /* This is a 16-bit reloc containing the high 16 bits of an address
3638c63b39d6Schristos used when the lower 16 bits are treated as unsigned.  */
3639c63b39d6Schristos   BFD_RELOC_M32R_HI16_ULO,
3640c63b39d6Schristos 
3641c63b39d6Schristos /* This is a 16-bit reloc containing the high 16 bits of an address
3642c63b39d6Schristos used when the lower 16 bits are treated as signed.  */
3643c63b39d6Schristos   BFD_RELOC_M32R_HI16_SLO,
3644c63b39d6Schristos 
3645c63b39d6Schristos /* This is a 16-bit reloc containing the lower 16 bits of an address.  */
3646c63b39d6Schristos   BFD_RELOC_M32R_LO16,
3647c63b39d6Schristos 
3648c63b39d6Schristos /* This is a 16-bit reloc containing the small data area offset for use in
3649c63b39d6Schristos add3, load, and store instructions.  */
3650c63b39d6Schristos   BFD_RELOC_M32R_SDA16,
3651c63b39d6Schristos 
3652c63b39d6Schristos /* For PIC.  */
3653c63b39d6Schristos   BFD_RELOC_M32R_GOT24,
3654c63b39d6Schristos   BFD_RELOC_M32R_26_PLTREL,
3655c63b39d6Schristos   BFD_RELOC_M32R_COPY,
3656c63b39d6Schristos   BFD_RELOC_M32R_GLOB_DAT,
3657c63b39d6Schristos   BFD_RELOC_M32R_JMP_SLOT,
3658c63b39d6Schristos   BFD_RELOC_M32R_RELATIVE,
3659c63b39d6Schristos   BFD_RELOC_M32R_GOTOFF,
3660c63b39d6Schristos   BFD_RELOC_M32R_GOTOFF_HI_ULO,
3661c63b39d6Schristos   BFD_RELOC_M32R_GOTOFF_HI_SLO,
3662c63b39d6Schristos   BFD_RELOC_M32R_GOTOFF_LO,
3663c63b39d6Schristos   BFD_RELOC_M32R_GOTPC24,
3664c63b39d6Schristos   BFD_RELOC_M32R_GOT16_HI_ULO,
3665c63b39d6Schristos   BFD_RELOC_M32R_GOT16_HI_SLO,
3666c63b39d6Schristos   BFD_RELOC_M32R_GOT16_LO,
3667c63b39d6Schristos   BFD_RELOC_M32R_GOTPC_HI_ULO,
3668c63b39d6Schristos   BFD_RELOC_M32R_GOTPC_HI_SLO,
3669c63b39d6Schristos   BFD_RELOC_M32R_GOTPC_LO,
3670c63b39d6Schristos 
367144a21023Schristos /* NDS32 relocs.
367244a21023Schristos This is a 20 bit absolute address.  */
367344a21023Schristos   BFD_RELOC_NDS32_20,
367444a21023Schristos 
367544a21023Schristos /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.  */
367644a21023Schristos   BFD_RELOC_NDS32_9_PCREL,
367744a21023Schristos 
367844a21023Schristos /* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0.  */
367944a21023Schristos   BFD_RELOC_NDS32_WORD_9_PCREL,
368044a21023Schristos 
368144a21023Schristos /* This is an 15-bit reloc with the right 1 bit assumed to be 0.  */
368244a21023Schristos   BFD_RELOC_NDS32_15_PCREL,
368344a21023Schristos 
368444a21023Schristos /* This is an 17-bit reloc with the right 1 bit assumed to be 0.  */
368544a21023Schristos   BFD_RELOC_NDS32_17_PCREL,
368644a21023Schristos 
368744a21023Schristos /* This is a 25-bit reloc with the right 1 bit assumed to be 0.  */
368844a21023Schristos   BFD_RELOC_NDS32_25_PCREL,
368944a21023Schristos 
369044a21023Schristos /* This is a 20-bit reloc containing the high 20 bits of an address
369144a21023Schristos used with the lower 12 bits  */
369244a21023Schristos   BFD_RELOC_NDS32_HI20,
369344a21023Schristos 
369444a21023Schristos /* This is a 12-bit reloc containing the lower 12 bits of an address
369544a21023Schristos then shift right by 3. This is used with ldi,sdi...  */
369644a21023Schristos   BFD_RELOC_NDS32_LO12S3,
369744a21023Schristos 
369844a21023Schristos /* This is a 12-bit reloc containing the lower 12 bits of an address
369944a21023Schristos then shift left by 2. This is used with lwi,swi...  */
370044a21023Schristos   BFD_RELOC_NDS32_LO12S2,
370144a21023Schristos 
370244a21023Schristos /* This is a 12-bit reloc containing the lower 12 bits of an address
370344a21023Schristos then shift left by 1. This is used with lhi,shi...  */
370444a21023Schristos   BFD_RELOC_NDS32_LO12S1,
370544a21023Schristos 
370644a21023Schristos /* This is a 12-bit reloc containing the lower 12 bits of an address
370744a21023Schristos then shift left by 0. This is used with lbisbi...  */
370844a21023Schristos   BFD_RELOC_NDS32_LO12S0,
370944a21023Schristos 
371044a21023Schristos /* This is a 12-bit reloc containing the lower 12 bits of an address
371144a21023Schristos then shift left by 0. This is only used with branch relaxations  */
371244a21023Schristos   BFD_RELOC_NDS32_LO12S0_ORI,
371344a21023Schristos 
371444a21023Schristos /* This is a 15-bit reloc containing the small data area 18-bit signed offset
371544a21023Schristos and shift left by 3 for use in ldi, sdi...  */
371644a21023Schristos   BFD_RELOC_NDS32_SDA15S3,
371744a21023Schristos 
371844a21023Schristos /* This is a 15-bit reloc containing the small data area 17-bit signed offset
371944a21023Schristos and shift left by 2 for use in lwi, swi...  */
372044a21023Schristos   BFD_RELOC_NDS32_SDA15S2,
372144a21023Schristos 
372244a21023Schristos /* This is a 15-bit reloc containing the small data area 16-bit signed offset
372344a21023Schristos and shift left by 1 for use in lhi, shi...  */
372444a21023Schristos   BFD_RELOC_NDS32_SDA15S1,
372544a21023Schristos 
372644a21023Schristos /* This is a 15-bit reloc containing the small data area 15-bit signed offset
372744a21023Schristos and shift left by 0 for use in lbi, sbi...  */
372844a21023Schristos   BFD_RELOC_NDS32_SDA15S0,
372944a21023Schristos 
373044a21023Schristos /* This is a 16-bit reloc containing the small data area 16-bit signed offset
373144a21023Schristos and shift left by 3  */
373244a21023Schristos   BFD_RELOC_NDS32_SDA16S3,
373344a21023Schristos 
373444a21023Schristos /* This is a 17-bit reloc containing the small data area 17-bit signed offset
373544a21023Schristos and shift left by 2 for use in lwi.gp, swi.gp...  */
373644a21023Schristos   BFD_RELOC_NDS32_SDA17S2,
373744a21023Schristos 
373844a21023Schristos /* This is a 18-bit reloc containing the small data area 18-bit signed offset
373944a21023Schristos and shift left by 1 for use in lhi.gp, shi.gp...  */
374044a21023Schristos   BFD_RELOC_NDS32_SDA18S1,
374144a21023Schristos 
374244a21023Schristos /* This is a 19-bit reloc containing the small data area 19-bit signed offset
374344a21023Schristos and shift left by 0 for use in lbi.gp, sbi.gp...  */
374444a21023Schristos   BFD_RELOC_NDS32_SDA19S0,
374544a21023Schristos 
374644a21023Schristos /* for PIC  */
374744a21023Schristos   BFD_RELOC_NDS32_GOT20,
374844a21023Schristos   BFD_RELOC_NDS32_9_PLTREL,
374944a21023Schristos   BFD_RELOC_NDS32_25_PLTREL,
375044a21023Schristos   BFD_RELOC_NDS32_COPY,
375144a21023Schristos   BFD_RELOC_NDS32_GLOB_DAT,
375244a21023Schristos   BFD_RELOC_NDS32_JMP_SLOT,
375344a21023Schristos   BFD_RELOC_NDS32_RELATIVE,
375444a21023Schristos   BFD_RELOC_NDS32_GOTOFF,
375544a21023Schristos   BFD_RELOC_NDS32_GOTOFF_HI20,
375644a21023Schristos   BFD_RELOC_NDS32_GOTOFF_LO12,
375744a21023Schristos   BFD_RELOC_NDS32_GOTPC20,
375844a21023Schristos   BFD_RELOC_NDS32_GOT_HI20,
375944a21023Schristos   BFD_RELOC_NDS32_GOT_LO12,
376044a21023Schristos   BFD_RELOC_NDS32_GOTPC_HI20,
376144a21023Schristos   BFD_RELOC_NDS32_GOTPC_LO12,
376244a21023Schristos 
376344a21023Schristos /* for relax  */
376444a21023Schristos   BFD_RELOC_NDS32_INSN16,
376544a21023Schristos   BFD_RELOC_NDS32_LABEL,
376644a21023Schristos   BFD_RELOC_NDS32_LONGCALL1,
376744a21023Schristos   BFD_RELOC_NDS32_LONGCALL2,
376844a21023Schristos   BFD_RELOC_NDS32_LONGCALL3,
376944a21023Schristos   BFD_RELOC_NDS32_LONGJUMP1,
377044a21023Schristos   BFD_RELOC_NDS32_LONGJUMP2,
377144a21023Schristos   BFD_RELOC_NDS32_LONGJUMP3,
377244a21023Schristos   BFD_RELOC_NDS32_LOADSTORE,
377344a21023Schristos   BFD_RELOC_NDS32_9_FIXED,
377444a21023Schristos   BFD_RELOC_NDS32_15_FIXED,
377544a21023Schristos   BFD_RELOC_NDS32_17_FIXED,
377644a21023Schristos   BFD_RELOC_NDS32_25_FIXED,
3777b511d482Schristos   BFD_RELOC_NDS32_LONGCALL4,
3778b511d482Schristos   BFD_RELOC_NDS32_LONGCALL5,
3779b511d482Schristos   BFD_RELOC_NDS32_LONGCALL6,
3780b511d482Schristos   BFD_RELOC_NDS32_LONGJUMP4,
3781b511d482Schristos   BFD_RELOC_NDS32_LONGJUMP5,
3782b511d482Schristos   BFD_RELOC_NDS32_LONGJUMP6,
3783b511d482Schristos   BFD_RELOC_NDS32_LONGJUMP7,
378444a21023Schristos 
378544a21023Schristos /* for PIC  */
378644a21023Schristos   BFD_RELOC_NDS32_PLTREL_HI20,
378744a21023Schristos   BFD_RELOC_NDS32_PLTREL_LO12,
378844a21023Schristos   BFD_RELOC_NDS32_PLT_GOTREL_HI20,
378944a21023Schristos   BFD_RELOC_NDS32_PLT_GOTREL_LO12,
379044a21023Schristos 
379144a21023Schristos /* for floating point  */
379244a21023Schristos   BFD_RELOC_NDS32_SDA12S2_DP,
379344a21023Schristos   BFD_RELOC_NDS32_SDA12S2_SP,
379444a21023Schristos   BFD_RELOC_NDS32_LO12S2_DP,
379544a21023Schristos   BFD_RELOC_NDS32_LO12S2_SP,
379644a21023Schristos 
379744a21023Schristos /* for dwarf2 debug_line.  */
379844a21023Schristos   BFD_RELOC_NDS32_DWARF2_OP1,
379944a21023Schristos   BFD_RELOC_NDS32_DWARF2_OP2,
380044a21023Schristos   BFD_RELOC_NDS32_DWARF2_LEB,
380144a21023Schristos 
380244a21023Schristos /* for eliminate 16-bit instructions  */
380344a21023Schristos   BFD_RELOC_NDS32_UPDATE_TA,
380444a21023Schristos 
380544a21023Schristos /* for PIC object relaxation  */
380644a21023Schristos   BFD_RELOC_NDS32_PLT_GOTREL_LO20,
380744a21023Schristos   BFD_RELOC_NDS32_PLT_GOTREL_LO15,
380844a21023Schristos   BFD_RELOC_NDS32_PLT_GOTREL_LO19,
380944a21023Schristos   BFD_RELOC_NDS32_GOT_LO15,
381044a21023Schristos   BFD_RELOC_NDS32_GOT_LO19,
381144a21023Schristos   BFD_RELOC_NDS32_GOTOFF_LO15,
381244a21023Schristos   BFD_RELOC_NDS32_GOTOFF_LO19,
381344a21023Schristos   BFD_RELOC_NDS32_GOT15S2,
381444a21023Schristos   BFD_RELOC_NDS32_GOT17S2,
381544a21023Schristos 
381644a21023Schristos /* NDS32 relocs.
381744a21023Schristos This is a 5 bit absolute address.  */
381844a21023Schristos   BFD_RELOC_NDS32_5,
381944a21023Schristos 
382044a21023Schristos /* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0.  */
382144a21023Schristos   BFD_RELOC_NDS32_10_UPCREL,
382244a21023Schristos 
382344a21023Schristos /* If fp were omitted, fp can used as another gp.  */
382444a21023Schristos   BFD_RELOC_NDS32_SDA_FP7U2_RELA,
382544a21023Schristos 
382644a21023Schristos /* relaxation relative relocation types  */
382744a21023Schristos   BFD_RELOC_NDS32_RELAX_ENTRY,
382844a21023Schristos   BFD_RELOC_NDS32_GOT_SUFF,
382944a21023Schristos   BFD_RELOC_NDS32_GOTOFF_SUFF,
383044a21023Schristos   BFD_RELOC_NDS32_PLT_GOT_SUFF,
383144a21023Schristos   BFD_RELOC_NDS32_MULCALL_SUFF,
383244a21023Schristos   BFD_RELOC_NDS32_PTR,
383344a21023Schristos   BFD_RELOC_NDS32_PTR_COUNT,
383444a21023Schristos   BFD_RELOC_NDS32_PTR_RESOLVED,
383544a21023Schristos   BFD_RELOC_NDS32_PLTBLOCK,
383644a21023Schristos   BFD_RELOC_NDS32_RELAX_REGION_BEGIN,
383744a21023Schristos   BFD_RELOC_NDS32_RELAX_REGION_END,
383844a21023Schristos   BFD_RELOC_NDS32_MINUEND,
383944a21023Schristos   BFD_RELOC_NDS32_SUBTRAHEND,
384044a21023Schristos   BFD_RELOC_NDS32_DIFF8,
384144a21023Schristos   BFD_RELOC_NDS32_DIFF16,
384244a21023Schristos   BFD_RELOC_NDS32_DIFF32,
384344a21023Schristos   BFD_RELOC_NDS32_DIFF_ULEB128,
3844b511d482Schristos   BFD_RELOC_NDS32_EMPTY,
3845b511d482Schristos 
3846b511d482Schristos /* This is a 25 bit absolute address.  */
384744a21023Schristos   BFD_RELOC_NDS32_25_ABS,
3848b511d482Schristos 
3849b511d482Schristos /* For ex9 and ifc using.  */
385044a21023Schristos   BFD_RELOC_NDS32_DATA,
385144a21023Schristos   BFD_RELOC_NDS32_TRAN,
385244a21023Schristos   BFD_RELOC_NDS32_17IFC_PCREL,
385344a21023Schristos   BFD_RELOC_NDS32_10IFCU_PCREL,
385444a21023Schristos 
3855b511d482Schristos /* For TLS.  */
3856b511d482Schristos   BFD_RELOC_NDS32_TPOFF,
385777cd98dfSchristos   BFD_RELOC_NDS32_GOTTPOFF,
3858b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_HI20,
3859b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_LO12,
3860b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_20,
3861b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_15S0,
3862b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_15S1,
3863b511d482Schristos   BFD_RELOC_NDS32_TLS_LE_15S2,
386477cd98dfSchristos   BFD_RELOC_NDS32_TLS_LE_ADD,
386577cd98dfSchristos   BFD_RELOC_NDS32_TLS_LE_LS,
386677cd98dfSchristos   BFD_RELOC_NDS32_TLS_IE_HI20,
386777cd98dfSchristos   BFD_RELOC_NDS32_TLS_IE_LO12,
386877cd98dfSchristos   BFD_RELOC_NDS32_TLS_IE_LO12S2,
386977cd98dfSchristos   BFD_RELOC_NDS32_TLS_IEGP_HI20,
387077cd98dfSchristos   BFD_RELOC_NDS32_TLS_IEGP_LO12,
387177cd98dfSchristos   BFD_RELOC_NDS32_TLS_IEGP_LO12S2,
387277cd98dfSchristos   BFD_RELOC_NDS32_TLS_IEGP_LW,
387377cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC,
387477cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_HI20,
387577cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_LO12,
387677cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_20,
387777cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_SDA17S2,
387877cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_ADD,
387977cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_FUNC,
388077cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_CALL,
388177cd98dfSchristos   BFD_RELOC_NDS32_TLS_DESC_MEM,
388277cd98dfSchristos   BFD_RELOC_NDS32_REMOVE,
388377cd98dfSchristos   BFD_RELOC_NDS32_GROUP,
388477cd98dfSchristos 
388577cd98dfSchristos /* For floating load store relaxation.  */
388677cd98dfSchristos   BFD_RELOC_NDS32_LSI,
3887b511d482Schristos 
3888c63b39d6Schristos /* This is a 9-bit reloc  */
3889c63b39d6Schristos   BFD_RELOC_V850_9_PCREL,
3890c63b39d6Schristos 
3891c63b39d6Schristos /* This is a 22-bit reloc  */
3892c63b39d6Schristos   BFD_RELOC_V850_22_PCREL,
3893c63b39d6Schristos 
3894c63b39d6Schristos /* This is a 16 bit offset from the short data area pointer.  */
3895c63b39d6Schristos   BFD_RELOC_V850_SDA_16_16_OFFSET,
3896c63b39d6Schristos 
3897c63b39d6Schristos /* This is a 16 bit offset (of which only 15 bits are used) from the
3898c63b39d6Schristos short data area pointer.  */
3899c63b39d6Schristos   BFD_RELOC_V850_SDA_15_16_OFFSET,
3900c63b39d6Schristos 
3901c63b39d6Schristos /* This is a 16 bit offset from the zero data area pointer.  */
3902c63b39d6Schristos   BFD_RELOC_V850_ZDA_16_16_OFFSET,
3903c63b39d6Schristos 
3904c63b39d6Schristos /* This is a 16 bit offset (of which only 15 bits are used) from the
3905c63b39d6Schristos zero data area pointer.  */
3906c63b39d6Schristos   BFD_RELOC_V850_ZDA_15_16_OFFSET,
3907c63b39d6Schristos 
3908c63b39d6Schristos /* This is an 8 bit offset (of which only 6 bits are used) from the
3909c63b39d6Schristos tiny data area pointer.  */
3910c63b39d6Schristos   BFD_RELOC_V850_TDA_6_8_OFFSET,
3911c63b39d6Schristos 
3912c63b39d6Schristos /* This is an 8bit offset (of which only 7 bits are used) from the tiny
3913c63b39d6Schristos data area pointer.  */
3914c63b39d6Schristos   BFD_RELOC_V850_TDA_7_8_OFFSET,
3915c63b39d6Schristos 
3916c63b39d6Schristos /* This is a 7 bit offset from the tiny data area pointer.  */
3917c63b39d6Schristos   BFD_RELOC_V850_TDA_7_7_OFFSET,
3918c63b39d6Schristos 
3919c63b39d6Schristos /* This is a 16 bit offset from the tiny data area pointer.  */
3920c63b39d6Schristos   BFD_RELOC_V850_TDA_16_16_OFFSET,
3921c63b39d6Schristos 
3922c63b39d6Schristos /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
3923c63b39d6Schristos data area pointer.  */
3924c63b39d6Schristos   BFD_RELOC_V850_TDA_4_5_OFFSET,
3925c63b39d6Schristos 
3926c63b39d6Schristos /* This is a 4 bit offset from the tiny data area pointer.  */
3927c63b39d6Schristos   BFD_RELOC_V850_TDA_4_4_OFFSET,
3928c63b39d6Schristos 
3929c63b39d6Schristos /* This is a 16 bit offset from the short data area pointer, with the
3930c63b39d6Schristos bits placed non-contiguously in the instruction.  */
3931c63b39d6Schristos   BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
3932c63b39d6Schristos 
3933c63b39d6Schristos /* This is a 16 bit offset from the zero data area pointer, with the
3934c63b39d6Schristos bits placed non-contiguously in the instruction.  */
3935c63b39d6Schristos   BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
3936c63b39d6Schristos 
3937c63b39d6Schristos /* This is a 6 bit offset from the call table base pointer.  */
3938c63b39d6Schristos   BFD_RELOC_V850_CALLT_6_7_OFFSET,
3939c63b39d6Schristos 
3940c63b39d6Schristos /* This is a 16 bit offset from the call table base pointer.  */
3941c63b39d6Schristos   BFD_RELOC_V850_CALLT_16_16_OFFSET,
3942c63b39d6Schristos 
3943c63b39d6Schristos /* Used for relaxing indirect function calls.  */
3944c63b39d6Schristos   BFD_RELOC_V850_LONGCALL,
3945c63b39d6Schristos 
3946c63b39d6Schristos /* Used for relaxing indirect jumps.  */
3947c63b39d6Schristos   BFD_RELOC_V850_LONGJUMP,
3948c63b39d6Schristos 
3949c63b39d6Schristos /* Used to maintain alignment whilst relaxing.  */
3950c63b39d6Schristos   BFD_RELOC_V850_ALIGN,
3951c63b39d6Schristos 
3952c63b39d6Schristos /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
3953c63b39d6Schristos instructions.  */
3954c63b39d6Schristos   BFD_RELOC_V850_LO16_SPLIT_OFFSET,
3955c63b39d6Schristos 
3956c63b39d6Schristos /* This is a 16-bit reloc.  */
3957c63b39d6Schristos   BFD_RELOC_V850_16_PCREL,
3958c63b39d6Schristos 
3959c63b39d6Schristos /* This is a 17-bit reloc.  */
3960c63b39d6Schristos   BFD_RELOC_V850_17_PCREL,
3961c63b39d6Schristos 
3962c63b39d6Schristos /* This is a 23-bit reloc.  */
3963c63b39d6Schristos   BFD_RELOC_V850_23,
3964c63b39d6Schristos 
3965c63b39d6Schristos /* This is a 32-bit reloc.  */
3966c63b39d6Schristos   BFD_RELOC_V850_32_PCREL,
3967c63b39d6Schristos 
3968c63b39d6Schristos /* This is a 32-bit reloc.  */
3969c63b39d6Schristos   BFD_RELOC_V850_32_ABS,
3970c63b39d6Schristos 
3971c63b39d6Schristos /* This is a 16-bit reloc.  */
3972c63b39d6Schristos   BFD_RELOC_V850_16_SPLIT_OFFSET,
3973c63b39d6Schristos 
3974c63b39d6Schristos /* This is a 16-bit reloc.  */
3975c63b39d6Schristos   BFD_RELOC_V850_16_S1,
3976c63b39d6Schristos 
3977c63b39d6Schristos /* Low 16 bits. 16 bit shifted by 1.  */
3978c63b39d6Schristos   BFD_RELOC_V850_LO16_S1,
3979c63b39d6Schristos 
3980c63b39d6Schristos /* This is a 16 bit offset from the call table base pointer.  */
3981c63b39d6Schristos   BFD_RELOC_V850_CALLT_15_16_OFFSET,
3982c63b39d6Schristos 
3983c63b39d6Schristos /* DSO relocations.  */
3984c63b39d6Schristos   BFD_RELOC_V850_32_GOTPCREL,
3985c63b39d6Schristos 
3986c63b39d6Schristos /* DSO relocations.  */
3987c63b39d6Schristos   BFD_RELOC_V850_16_GOT,
3988c63b39d6Schristos 
3989c63b39d6Schristos /* DSO relocations.  */
3990c63b39d6Schristos   BFD_RELOC_V850_32_GOT,
3991c63b39d6Schristos 
3992c63b39d6Schristos /* DSO relocations.  */
3993c63b39d6Schristos   BFD_RELOC_V850_22_PLT_PCREL,
3994c63b39d6Schristos 
3995c63b39d6Schristos /* DSO relocations.  */
3996c63b39d6Schristos   BFD_RELOC_V850_32_PLT_PCREL,
3997c63b39d6Schristos 
3998c63b39d6Schristos /* DSO relocations.  */
3999c63b39d6Schristos   BFD_RELOC_V850_COPY,
4000c63b39d6Schristos 
4001c63b39d6Schristos /* DSO relocations.  */
4002c63b39d6Schristos   BFD_RELOC_V850_GLOB_DAT,
4003c63b39d6Schristos 
4004c63b39d6Schristos /* DSO relocations.  */
4005c63b39d6Schristos   BFD_RELOC_V850_JMP_SLOT,
4006c63b39d6Schristos 
4007c63b39d6Schristos /* DSO relocations.  */
4008c63b39d6Schristos   BFD_RELOC_V850_RELATIVE,
4009c63b39d6Schristos 
4010c63b39d6Schristos /* DSO relocations.  */
4011c63b39d6Schristos   BFD_RELOC_V850_16_GOTOFF,
4012c63b39d6Schristos 
4013c63b39d6Schristos /* DSO relocations.  */
4014c63b39d6Schristos   BFD_RELOC_V850_32_GOTOFF,
4015c63b39d6Schristos 
4016c63b39d6Schristos /* start code.  */
4017c63b39d6Schristos   BFD_RELOC_V850_CODE,
4018c63b39d6Schristos 
4019c63b39d6Schristos /* start data in text.  */
4020c63b39d6Schristos   BFD_RELOC_V850_DATA,
4021c63b39d6Schristos 
4022c63b39d6Schristos /* This is a 8bit DP reloc for the tms320c30, where the most
4023c63b39d6Schristos significant 8 bits of a 24 bit word are placed into the least
4024c63b39d6Schristos significant 8 bits of the opcode.  */
4025c63b39d6Schristos   BFD_RELOC_TIC30_LDP,
4026c63b39d6Schristos 
4027c63b39d6Schristos /* This is a 7bit reloc for the tms320c54x, where the least
4028c63b39d6Schristos significant 7 bits of a 16 bit word are placed into the least
4029c63b39d6Schristos significant 7 bits of the opcode.  */
4030c63b39d6Schristos   BFD_RELOC_TIC54X_PARTLS7,
4031c63b39d6Schristos 
4032c63b39d6Schristos /* This is a 9bit DP reloc for the tms320c54x, where the most
4033c63b39d6Schristos significant 9 bits of a 16 bit word are placed into the least
4034c63b39d6Schristos significant 9 bits of the opcode.  */
4035c63b39d6Schristos   BFD_RELOC_TIC54X_PARTMS9,
4036c63b39d6Schristos 
4037c63b39d6Schristos /* This is an extended address 23-bit reloc for the tms320c54x.  */
4038c63b39d6Schristos   BFD_RELOC_TIC54X_23,
4039c63b39d6Schristos 
4040c63b39d6Schristos /* This is a 16-bit reloc for the tms320c54x, where the least
4041c63b39d6Schristos significant 16 bits of a 23-bit extended address are placed into
4042c63b39d6Schristos the opcode.  */
4043c63b39d6Schristos   BFD_RELOC_TIC54X_16_OF_23,
4044c63b39d6Schristos 
4045c63b39d6Schristos /* This is a reloc for the tms320c54x, where the most
4046c63b39d6Schristos significant 7 bits of a 23-bit extended address are placed into
4047c63b39d6Schristos the opcode.  */
4048c63b39d6Schristos   BFD_RELOC_TIC54X_MS7_OF_23,
4049c63b39d6Schristos 
4050c63b39d6Schristos /* TMS320C6000 relocations.  */
4051c63b39d6Schristos   BFD_RELOC_C6000_PCR_S21,
4052c63b39d6Schristos   BFD_RELOC_C6000_PCR_S12,
4053c63b39d6Schristos   BFD_RELOC_C6000_PCR_S10,
4054c63b39d6Schristos   BFD_RELOC_C6000_PCR_S7,
4055c63b39d6Schristos   BFD_RELOC_C6000_ABS_S16,
4056c63b39d6Schristos   BFD_RELOC_C6000_ABS_L16,
4057c63b39d6Schristos   BFD_RELOC_C6000_ABS_H16,
4058c63b39d6Schristos   BFD_RELOC_C6000_SBR_U15_B,
4059c63b39d6Schristos   BFD_RELOC_C6000_SBR_U15_H,
4060c63b39d6Schristos   BFD_RELOC_C6000_SBR_U15_W,
4061c63b39d6Schristos   BFD_RELOC_C6000_SBR_S16,
4062c63b39d6Schristos   BFD_RELOC_C6000_SBR_L16_B,
4063c63b39d6Schristos   BFD_RELOC_C6000_SBR_L16_H,
4064c63b39d6Schristos   BFD_RELOC_C6000_SBR_L16_W,
4065c63b39d6Schristos   BFD_RELOC_C6000_SBR_H16_B,
4066c63b39d6Schristos   BFD_RELOC_C6000_SBR_H16_H,
4067c63b39d6Schristos   BFD_RELOC_C6000_SBR_H16_W,
4068c63b39d6Schristos   BFD_RELOC_C6000_SBR_GOT_U15_W,
4069c63b39d6Schristos   BFD_RELOC_C6000_SBR_GOT_L16_W,
4070c63b39d6Schristos   BFD_RELOC_C6000_SBR_GOT_H16_W,
4071c63b39d6Schristos   BFD_RELOC_C6000_DSBT_INDEX,
4072c63b39d6Schristos   BFD_RELOC_C6000_PREL31,
4073c63b39d6Schristos   BFD_RELOC_C6000_COPY,
4074c63b39d6Schristos   BFD_RELOC_C6000_JUMP_SLOT,
4075c63b39d6Schristos   BFD_RELOC_C6000_EHTYPE,
4076c63b39d6Schristos   BFD_RELOC_C6000_PCR_H16,
4077c63b39d6Schristos   BFD_RELOC_C6000_PCR_L16,
4078c63b39d6Schristos   BFD_RELOC_C6000_ALIGN,
4079c63b39d6Schristos   BFD_RELOC_C6000_FPHEAD,
4080c63b39d6Schristos   BFD_RELOC_C6000_NOCMP,
4081c63b39d6Schristos 
4082c63b39d6Schristos /* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
4083c63b39d6Schristos   BFD_RELOC_FR30_48,
4084c63b39d6Schristos 
4085c63b39d6Schristos /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
4086c63b39d6Schristos two sections.  */
4087c63b39d6Schristos   BFD_RELOC_FR30_20,
4088c63b39d6Schristos 
4089c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
4090c63b39d6Schristos 4 bits.  */
4091c63b39d6Schristos   BFD_RELOC_FR30_6_IN_4,
4092c63b39d6Schristos 
4093c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
4094c63b39d6Schristos into 8 bits.  */
4095c63b39d6Schristos   BFD_RELOC_FR30_8_IN_8,
4096c63b39d6Schristos 
4097c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
4098c63b39d6Schristos into 8 bits.  */
4099c63b39d6Schristos   BFD_RELOC_FR30_9_IN_8,
4100c63b39d6Schristos 
4101c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
4102c63b39d6Schristos into 8 bits.  */
4103c63b39d6Schristos   BFD_RELOC_FR30_10_IN_8,
4104c63b39d6Schristos 
4105c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
4106c63b39d6Schristos short offset into 8 bits.  */
4107c63b39d6Schristos   BFD_RELOC_FR30_9_PCREL,
4108c63b39d6Schristos 
4109c63b39d6Schristos /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
4110c63b39d6Schristos short offset into 11 bits.  */
4111c63b39d6Schristos   BFD_RELOC_FR30_12_PCREL,
4112c63b39d6Schristos 
4113c63b39d6Schristos /* Motorola Mcore relocations.  */
4114c63b39d6Schristos   BFD_RELOC_MCORE_PCREL_IMM8BY4,
4115c63b39d6Schristos   BFD_RELOC_MCORE_PCREL_IMM11BY2,
4116c63b39d6Schristos   BFD_RELOC_MCORE_PCREL_IMM4BY2,
4117c63b39d6Schristos   BFD_RELOC_MCORE_PCREL_32,
4118c63b39d6Schristos   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
4119c63b39d6Schristos   BFD_RELOC_MCORE_RVA,
4120c63b39d6Schristos 
4121c63b39d6Schristos /* Toshiba Media Processor Relocations.  */
4122c63b39d6Schristos   BFD_RELOC_MEP_8,
4123c63b39d6Schristos   BFD_RELOC_MEP_16,
4124c63b39d6Schristos   BFD_RELOC_MEP_32,
4125c63b39d6Schristos   BFD_RELOC_MEP_PCREL8A2,
4126c63b39d6Schristos   BFD_RELOC_MEP_PCREL12A2,
4127c63b39d6Schristos   BFD_RELOC_MEP_PCREL17A2,
4128c63b39d6Schristos   BFD_RELOC_MEP_PCREL24A2,
4129c63b39d6Schristos   BFD_RELOC_MEP_PCABS24A2,
4130c63b39d6Schristos   BFD_RELOC_MEP_LOW16,
4131c63b39d6Schristos   BFD_RELOC_MEP_HI16U,
4132c63b39d6Schristos   BFD_RELOC_MEP_HI16S,
4133c63b39d6Schristos   BFD_RELOC_MEP_GPREL,
4134c63b39d6Schristos   BFD_RELOC_MEP_TPREL,
4135c63b39d6Schristos   BFD_RELOC_MEP_TPREL7,
4136c63b39d6Schristos   BFD_RELOC_MEP_TPREL7A2,
4137c63b39d6Schristos   BFD_RELOC_MEP_TPREL7A4,
4138c63b39d6Schristos   BFD_RELOC_MEP_UIMM24,
4139c63b39d6Schristos   BFD_RELOC_MEP_ADDR24A4,
4140c63b39d6Schristos   BFD_RELOC_MEP_GNU_VTINHERIT,
4141c63b39d6Schristos   BFD_RELOC_MEP_GNU_VTENTRY,
4142c63b39d6Schristos 
4143c63b39d6Schristos 
4144fdeb0babSchristos /* Imagination Technologies Meta relocations.  */
4145fdeb0babSchristos   BFD_RELOC_METAG_HIADDR16,
4146fdeb0babSchristos   BFD_RELOC_METAG_LOADDR16,
4147fdeb0babSchristos   BFD_RELOC_METAG_RELBRANCH,
4148fdeb0babSchristos   BFD_RELOC_METAG_GETSETOFF,
4149fdeb0babSchristos   BFD_RELOC_METAG_HIOG,
4150fdeb0babSchristos   BFD_RELOC_METAG_LOOG,
4151fdeb0babSchristos   BFD_RELOC_METAG_REL8,
4152fdeb0babSchristos   BFD_RELOC_METAG_REL16,
4153fdeb0babSchristos   BFD_RELOC_METAG_HI16_GOTOFF,
4154fdeb0babSchristos   BFD_RELOC_METAG_LO16_GOTOFF,
4155fdeb0babSchristos   BFD_RELOC_METAG_GETSET_GOTOFF,
4156fdeb0babSchristos   BFD_RELOC_METAG_GETSET_GOT,
4157fdeb0babSchristos   BFD_RELOC_METAG_HI16_GOTPC,
4158fdeb0babSchristos   BFD_RELOC_METAG_LO16_GOTPC,
4159fdeb0babSchristos   BFD_RELOC_METAG_HI16_PLT,
4160fdeb0babSchristos   BFD_RELOC_METAG_LO16_PLT,
4161fdeb0babSchristos   BFD_RELOC_METAG_RELBRANCH_PLT,
4162fdeb0babSchristos   BFD_RELOC_METAG_GOTOFF,
4163fdeb0babSchristos   BFD_RELOC_METAG_PLT,
4164fdeb0babSchristos   BFD_RELOC_METAG_COPY,
4165fdeb0babSchristos   BFD_RELOC_METAG_JMP_SLOT,
4166fdeb0babSchristos   BFD_RELOC_METAG_RELATIVE,
4167fdeb0babSchristos   BFD_RELOC_METAG_GLOB_DAT,
4168fdeb0babSchristos   BFD_RELOC_METAG_TLS_GD,
4169fdeb0babSchristos   BFD_RELOC_METAG_TLS_LDM,
4170fdeb0babSchristos   BFD_RELOC_METAG_TLS_LDO_HI16,
4171fdeb0babSchristos   BFD_RELOC_METAG_TLS_LDO_LO16,
4172fdeb0babSchristos   BFD_RELOC_METAG_TLS_LDO,
4173fdeb0babSchristos   BFD_RELOC_METAG_TLS_IE,
4174fdeb0babSchristos   BFD_RELOC_METAG_TLS_IENONPIC,
4175fdeb0babSchristos   BFD_RELOC_METAG_TLS_IENONPIC_HI16,
4176fdeb0babSchristos   BFD_RELOC_METAG_TLS_IENONPIC_LO16,
4177fdeb0babSchristos   BFD_RELOC_METAG_TLS_TPOFF,
4178fdeb0babSchristos   BFD_RELOC_METAG_TLS_DTPMOD,
4179fdeb0babSchristos   BFD_RELOC_METAG_TLS_DTPOFF,
4180fdeb0babSchristos   BFD_RELOC_METAG_TLS_LE,
4181fdeb0babSchristos   BFD_RELOC_METAG_TLS_LE_HI16,
4182fdeb0babSchristos   BFD_RELOC_METAG_TLS_LE_LO16,
4183fdeb0babSchristos 
4184c63b39d6Schristos /* These are relocations for the GETA instruction.  */
4185c63b39d6Schristos   BFD_RELOC_MMIX_GETA,
4186c63b39d6Schristos   BFD_RELOC_MMIX_GETA_1,
4187c63b39d6Schristos   BFD_RELOC_MMIX_GETA_2,
4188c63b39d6Schristos   BFD_RELOC_MMIX_GETA_3,
4189c63b39d6Schristos 
4190c63b39d6Schristos /* These are relocations for a conditional branch instruction.  */
4191c63b39d6Schristos   BFD_RELOC_MMIX_CBRANCH,
4192c63b39d6Schristos   BFD_RELOC_MMIX_CBRANCH_J,
4193c63b39d6Schristos   BFD_RELOC_MMIX_CBRANCH_1,
4194c63b39d6Schristos   BFD_RELOC_MMIX_CBRANCH_2,
4195c63b39d6Schristos   BFD_RELOC_MMIX_CBRANCH_3,
4196c63b39d6Schristos 
4197c63b39d6Schristos /* These are relocations for the PUSHJ instruction.  */
4198c63b39d6Schristos   BFD_RELOC_MMIX_PUSHJ,
4199c63b39d6Schristos   BFD_RELOC_MMIX_PUSHJ_1,
4200c63b39d6Schristos   BFD_RELOC_MMIX_PUSHJ_2,
4201c63b39d6Schristos   BFD_RELOC_MMIX_PUSHJ_3,
4202c63b39d6Schristos   BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
4203c63b39d6Schristos 
4204c63b39d6Schristos /* These are relocations for the JMP instruction.  */
4205c63b39d6Schristos   BFD_RELOC_MMIX_JMP,
4206c63b39d6Schristos   BFD_RELOC_MMIX_JMP_1,
4207c63b39d6Schristos   BFD_RELOC_MMIX_JMP_2,
4208c63b39d6Schristos   BFD_RELOC_MMIX_JMP_3,
4209c63b39d6Schristos 
4210c63b39d6Schristos /* This is a relocation for a relative address as in a GETA instruction or
4211c63b39d6Schristos a branch.  */
4212c63b39d6Schristos   BFD_RELOC_MMIX_ADDR19,
4213c63b39d6Schristos 
4214c63b39d6Schristos /* This is a relocation for a relative address as in a JMP instruction.  */
4215c63b39d6Schristos   BFD_RELOC_MMIX_ADDR27,
4216c63b39d6Schristos 
4217c63b39d6Schristos /* This is a relocation for an instruction field that may be a general
4218c63b39d6Schristos register or a value 0..255.  */
4219c63b39d6Schristos   BFD_RELOC_MMIX_REG_OR_BYTE,
4220c63b39d6Schristos 
4221c63b39d6Schristos /* This is a relocation for an instruction field that may be a general
4222c63b39d6Schristos register.  */
4223c63b39d6Schristos   BFD_RELOC_MMIX_REG,
4224c63b39d6Schristos 
4225c63b39d6Schristos /* This is a relocation for two instruction fields holding a register and
4226c63b39d6Schristos an offset, the equivalent of the relocation.  */
4227c63b39d6Schristos   BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
4228c63b39d6Schristos 
4229c63b39d6Schristos /* This relocation is an assertion that the expression is not allocated as
4230c63b39d6Schristos a global register.  It does not modify contents.  */
4231c63b39d6Schristos   BFD_RELOC_MMIX_LOCAL,
4232c63b39d6Schristos 
4233c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
4234c63b39d6Schristos short offset into 7 bits.  */
4235c63b39d6Schristos   BFD_RELOC_AVR_7_PCREL,
4236c63b39d6Schristos 
4237c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
4238c63b39d6Schristos short offset into 12 bits.  */
4239c63b39d6Schristos   BFD_RELOC_AVR_13_PCREL,
4240c63b39d6Schristos 
4241c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
4242c63b39d6Schristos program memory address) into 16 bits.  */
4243c63b39d6Schristos   BFD_RELOC_AVR_16_PM,
4244c63b39d6Schristos 
4245c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4246c63b39d6Schristos data memory address) into 8 bit immediate value of LDI insn.  */
4247c63b39d6Schristos   BFD_RELOC_AVR_LO8_LDI,
4248c63b39d6Schristos 
4249c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4250c63b39d6Schristos of data memory address) into 8 bit immediate value of LDI insn.  */
4251c63b39d6Schristos   BFD_RELOC_AVR_HI8_LDI,
4252c63b39d6Schristos 
4253c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4254c63b39d6Schristos of program memory address) into 8 bit immediate value of LDI insn.  */
4255c63b39d6Schristos   BFD_RELOC_AVR_HH8_LDI,
4256c63b39d6Schristos 
4257c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4258c63b39d6Schristos of 32 bit value) into 8 bit immediate value of LDI insn.  */
4259c63b39d6Schristos   BFD_RELOC_AVR_MS8_LDI,
4260c63b39d6Schristos 
4261c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4262c63b39d6Schristos (usually data memory address) into 8 bit immediate value of SUBI insn.  */
4263c63b39d6Schristos   BFD_RELOC_AVR_LO8_LDI_NEG,
4264c63b39d6Schristos 
4265c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4266c63b39d6Schristos (high 8 bit of data memory address) into 8 bit immediate value of
4267c63b39d6Schristos SUBI insn.  */
4268c63b39d6Schristos   BFD_RELOC_AVR_HI8_LDI_NEG,
4269c63b39d6Schristos 
4270c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4271c63b39d6Schristos (most high 8 bit of program memory address) into 8 bit immediate value
4272c63b39d6Schristos of LDI or SUBI insn.  */
4273c63b39d6Schristos   BFD_RELOC_AVR_HH8_LDI_NEG,
4274c63b39d6Schristos 
4275c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
4276c63b39d6Schristos of 32 bit value) into 8 bit immediate value of LDI insn.  */
4277c63b39d6Schristos   BFD_RELOC_AVR_MS8_LDI_NEG,
4278c63b39d6Schristos 
4279c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
4280c63b39d6Schristos command address) into 8 bit immediate value of LDI insn.  */
4281c63b39d6Schristos   BFD_RELOC_AVR_LO8_LDI_PM,
4282c63b39d6Schristos 
4283c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value
4284c63b39d6Schristos (command address) into 8 bit immediate value of LDI insn. If the address
4285c63b39d6Schristos is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4286c63b39d6Schristos in the lower 128k.  */
4287c63b39d6Schristos   BFD_RELOC_AVR_LO8_LDI_GS,
4288c63b39d6Schristos 
4289c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4290c63b39d6Schristos of command address) into 8 bit immediate value of LDI insn.  */
4291c63b39d6Schristos   BFD_RELOC_AVR_HI8_LDI_PM,
4292c63b39d6Schristos 
4293c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
4294c63b39d6Schristos of command address) into 8 bit immediate value of LDI insn.  If the address
4295c63b39d6Schristos is beyond the 128k boundary, the linker inserts a jump stub for this reloc
4296c63b39d6Schristos below 128k.  */
4297c63b39d6Schristos   BFD_RELOC_AVR_HI8_LDI_GS,
4298c63b39d6Schristos 
4299c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
4300c63b39d6Schristos of command address) into 8 bit immediate value of LDI insn.  */
4301c63b39d6Schristos   BFD_RELOC_AVR_HH8_LDI_PM,
4302c63b39d6Schristos 
4303c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4304c63b39d6Schristos (usually command address) into 8 bit immediate value of SUBI insn.  */
4305c63b39d6Schristos   BFD_RELOC_AVR_LO8_LDI_PM_NEG,
4306c63b39d6Schristos 
4307c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4308c63b39d6Schristos (high 8 bit of 16 bit command address) into 8 bit immediate value
4309c63b39d6Schristos of SUBI insn.  */
4310c63b39d6Schristos   BFD_RELOC_AVR_HI8_LDI_PM_NEG,
4311c63b39d6Schristos 
4312c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
4313c63b39d6Schristos (high 6 bit of 22 bit command address) into 8 bit immediate
4314c63b39d6Schristos value of SUBI insn.  */
4315c63b39d6Schristos   BFD_RELOC_AVR_HH8_LDI_PM_NEG,
4316c63b39d6Schristos 
4317c63b39d6Schristos /* This is a 32 bit reloc for the AVR that stores 23 bit value
4318c63b39d6Schristos into 22 bits.  */
4319c63b39d6Schristos   BFD_RELOC_AVR_CALL,
4320c63b39d6Schristos 
4321c63b39d6Schristos /* This is a 16 bit reloc for the AVR that stores all needed bits
4322c63b39d6Schristos for absolute addressing with ldi with overflow check to linktime  */
4323c63b39d6Schristos   BFD_RELOC_AVR_LDI,
4324c63b39d6Schristos 
4325c63b39d6Schristos /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
4326c63b39d6Schristos instructions  */
4327c63b39d6Schristos   BFD_RELOC_AVR_6,
4328c63b39d6Schristos 
4329c63b39d6Schristos /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
4330c63b39d6Schristos instructions  */
4331c63b39d6Schristos   BFD_RELOC_AVR_6_ADIW,
4332c63b39d6Schristos 
4333fdeb0babSchristos /* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4334fdeb0babSchristos in .byte lo8(symbol)  */
4335fdeb0babSchristos   BFD_RELOC_AVR_8_LO,
4336fdeb0babSchristos 
4337fdeb0babSchristos /* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4338fdeb0babSchristos in .byte hi8(symbol)  */
4339fdeb0babSchristos   BFD_RELOC_AVR_8_HI,
4340fdeb0babSchristos 
4341fdeb0babSchristos /* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4342fdeb0babSchristos in .byte hlo8(symbol)  */
4343fdeb0babSchristos   BFD_RELOC_AVR_8_HLO,
4344fdeb0babSchristos 
4345b511d482Schristos /* AVR relocations to mark the difference of two local symbols.
4346b511d482Schristos These are only needed to support linker relaxation and can be ignored
4347b511d482Schristos when not relaxing.  The field is set to the value of the difference
4348b511d482Schristos assuming no relaxation.  The relocation encodes the position of the
4349b511d482Schristos second symbol so the linker can determine whether to adjust the field
4350b511d482Schristos value.  */
4351b511d482Schristos   BFD_RELOC_AVR_DIFF8,
4352b511d482Schristos   BFD_RELOC_AVR_DIFF16,
4353b511d482Schristos   BFD_RELOC_AVR_DIFF32,
4354b511d482Schristos 
4355b511d482Schristos /* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit
4356b511d482Schristos lds and sts instructions supported only tiny core.  */
4357b511d482Schristos   BFD_RELOC_AVR_LDS_STS_16,
4358b511d482Schristos 
4359b511d482Schristos /* This is a 6 bit reloc for the AVR that stores an I/O register
4360b511d482Schristos number for the IN and OUT instructions  */
4361b511d482Schristos   BFD_RELOC_AVR_PORT6,
4362b511d482Schristos 
4363b511d482Schristos /* This is a 5 bit reloc for the AVR that stores an I/O register
4364b511d482Schristos number for the SBIC, SBIS, SBI and CBI instructions  */
4365b511d482Schristos   BFD_RELOC_AVR_PORT5,
4366b511d482Schristos 
43679bc6a05dSchristos /* RISC-V relocations.  */
43689bc6a05dSchristos   BFD_RELOC_RISCV_HI20,
43699bc6a05dSchristos   BFD_RELOC_RISCV_PCREL_HI20,
43709bc6a05dSchristos   BFD_RELOC_RISCV_PCREL_LO12_I,
43719bc6a05dSchristos   BFD_RELOC_RISCV_PCREL_LO12_S,
43729bc6a05dSchristos   BFD_RELOC_RISCV_LO12_I,
43739bc6a05dSchristos   BFD_RELOC_RISCV_LO12_S,
43749bc6a05dSchristos   BFD_RELOC_RISCV_GPREL12_I,
43759bc6a05dSchristos   BFD_RELOC_RISCV_GPREL12_S,
43769bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_HI20,
43779bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_LO12_I,
43789bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_LO12_S,
43799bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_ADD,
43809bc6a05dSchristos   BFD_RELOC_RISCV_CALL,
43819bc6a05dSchristos   BFD_RELOC_RISCV_CALL_PLT,
43829bc6a05dSchristos   BFD_RELOC_RISCV_ADD8,
43839bc6a05dSchristos   BFD_RELOC_RISCV_ADD16,
43849bc6a05dSchristos   BFD_RELOC_RISCV_ADD32,
43859bc6a05dSchristos   BFD_RELOC_RISCV_ADD64,
43869bc6a05dSchristos   BFD_RELOC_RISCV_SUB8,
43879bc6a05dSchristos   BFD_RELOC_RISCV_SUB16,
43889bc6a05dSchristos   BFD_RELOC_RISCV_SUB32,
43899bc6a05dSchristos   BFD_RELOC_RISCV_SUB64,
43909bc6a05dSchristos   BFD_RELOC_RISCV_GOT_HI20,
43919bc6a05dSchristos   BFD_RELOC_RISCV_TLS_GOT_HI20,
43929bc6a05dSchristos   BFD_RELOC_RISCV_TLS_GD_HI20,
43939bc6a05dSchristos   BFD_RELOC_RISCV_JMP,
43949bc6a05dSchristos   BFD_RELOC_RISCV_TLS_DTPMOD32,
43959bc6a05dSchristos   BFD_RELOC_RISCV_TLS_DTPREL32,
43969bc6a05dSchristos   BFD_RELOC_RISCV_TLS_DTPMOD64,
43979bc6a05dSchristos   BFD_RELOC_RISCV_TLS_DTPREL64,
43989bc6a05dSchristos   BFD_RELOC_RISCV_TLS_TPREL32,
43999bc6a05dSchristos   BFD_RELOC_RISCV_TLS_TPREL64,
44009bc6a05dSchristos   BFD_RELOC_RISCV_ALIGN,
44019bc6a05dSchristos   BFD_RELOC_RISCV_RVC_BRANCH,
44029bc6a05dSchristos   BFD_RELOC_RISCV_RVC_JUMP,
44039bc6a05dSchristos   BFD_RELOC_RISCV_RVC_LUI,
44049bc6a05dSchristos   BFD_RELOC_RISCV_GPREL_I,
44059bc6a05dSchristos   BFD_RELOC_RISCV_GPREL_S,
44069bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_I,
44079bc6a05dSchristos   BFD_RELOC_RISCV_TPREL_S,
44089bc6a05dSchristos   BFD_RELOC_RISCV_RELAX,
44099bc6a05dSchristos   BFD_RELOC_RISCV_CFA,
44109bc6a05dSchristos   BFD_RELOC_RISCV_SUB6,
44119bc6a05dSchristos   BFD_RELOC_RISCV_SET6,
44129bc6a05dSchristos   BFD_RELOC_RISCV_SET8,
44139bc6a05dSchristos   BFD_RELOC_RISCV_SET16,
44149bc6a05dSchristos   BFD_RELOC_RISCV_SET32,
441577cd98dfSchristos   BFD_RELOC_RISCV_32_PCREL,
44169bc6a05dSchristos 
4417fdeb0babSchristos /* Renesas RL78 Relocations.  */
4418fdeb0babSchristos   BFD_RELOC_RL78_NEG8,
4419fdeb0babSchristos   BFD_RELOC_RL78_NEG16,
4420fdeb0babSchristos   BFD_RELOC_RL78_NEG24,
4421fdeb0babSchristos   BFD_RELOC_RL78_NEG32,
4422fdeb0babSchristos   BFD_RELOC_RL78_16_OP,
4423fdeb0babSchristos   BFD_RELOC_RL78_24_OP,
4424fdeb0babSchristos   BFD_RELOC_RL78_32_OP,
4425fdeb0babSchristos   BFD_RELOC_RL78_8U,
4426fdeb0babSchristos   BFD_RELOC_RL78_16U,
4427fdeb0babSchristos   BFD_RELOC_RL78_24U,
4428fdeb0babSchristos   BFD_RELOC_RL78_DIR3U_PCREL,
4429fdeb0babSchristos   BFD_RELOC_RL78_DIFF,
4430fdeb0babSchristos   BFD_RELOC_RL78_GPRELB,
4431fdeb0babSchristos   BFD_RELOC_RL78_GPRELW,
4432fdeb0babSchristos   BFD_RELOC_RL78_GPRELL,
4433fdeb0babSchristos   BFD_RELOC_RL78_SYM,
4434fdeb0babSchristos   BFD_RELOC_RL78_OP_SUBTRACT,
4435fdeb0babSchristos   BFD_RELOC_RL78_OP_NEG,
4436fdeb0babSchristos   BFD_RELOC_RL78_OP_AND,
4437fdeb0babSchristos   BFD_RELOC_RL78_OP_SHRA,
4438fdeb0babSchristos   BFD_RELOC_RL78_ABS8,
4439fdeb0babSchristos   BFD_RELOC_RL78_ABS16,
4440fdeb0babSchristos   BFD_RELOC_RL78_ABS16_REV,
4441fdeb0babSchristos   BFD_RELOC_RL78_ABS32,
4442fdeb0babSchristos   BFD_RELOC_RL78_ABS32_REV,
4443fdeb0babSchristos   BFD_RELOC_RL78_ABS16U,
4444fdeb0babSchristos   BFD_RELOC_RL78_ABS16UW,
4445fdeb0babSchristos   BFD_RELOC_RL78_ABS16UL,
4446fdeb0babSchristos   BFD_RELOC_RL78_RELAX,
4447fdeb0babSchristos   BFD_RELOC_RL78_HI16,
4448fdeb0babSchristos   BFD_RELOC_RL78_HI8,
4449fdeb0babSchristos   BFD_RELOC_RL78_LO16,
4450fdeb0babSchristos   BFD_RELOC_RL78_CODE,
4451e8beca2cSchristos   BFD_RELOC_RL78_SADDR,
4452fdeb0babSchristos 
4453c63b39d6Schristos /* Renesas RX Relocations.  */
4454c63b39d6Schristos   BFD_RELOC_RX_NEG8,
4455c63b39d6Schristos   BFD_RELOC_RX_NEG16,
4456c63b39d6Schristos   BFD_RELOC_RX_NEG24,
4457c63b39d6Schristos   BFD_RELOC_RX_NEG32,
4458c63b39d6Schristos   BFD_RELOC_RX_16_OP,
4459c63b39d6Schristos   BFD_RELOC_RX_24_OP,
4460c63b39d6Schristos   BFD_RELOC_RX_32_OP,
4461c63b39d6Schristos   BFD_RELOC_RX_8U,
4462c63b39d6Schristos   BFD_RELOC_RX_16U,
4463c63b39d6Schristos   BFD_RELOC_RX_24U,
4464c63b39d6Schristos   BFD_RELOC_RX_DIR3U_PCREL,
4465c63b39d6Schristos   BFD_RELOC_RX_DIFF,
4466c63b39d6Schristos   BFD_RELOC_RX_GPRELB,
4467c63b39d6Schristos   BFD_RELOC_RX_GPRELW,
4468c63b39d6Schristos   BFD_RELOC_RX_GPRELL,
4469c63b39d6Schristos   BFD_RELOC_RX_SYM,
4470c63b39d6Schristos   BFD_RELOC_RX_OP_SUBTRACT,
4471c63b39d6Schristos   BFD_RELOC_RX_OP_NEG,
4472c63b39d6Schristos   BFD_RELOC_RX_ABS8,
4473c63b39d6Schristos   BFD_RELOC_RX_ABS16,
4474c63b39d6Schristos   BFD_RELOC_RX_ABS16_REV,
4475c63b39d6Schristos   BFD_RELOC_RX_ABS32,
4476c63b39d6Schristos   BFD_RELOC_RX_ABS32_REV,
4477c63b39d6Schristos   BFD_RELOC_RX_ABS16U,
4478c63b39d6Schristos   BFD_RELOC_RX_ABS16UW,
4479c63b39d6Schristos   BFD_RELOC_RX_ABS16UL,
4480c63b39d6Schristos   BFD_RELOC_RX_RELAX,
4481c63b39d6Schristos 
4482c63b39d6Schristos /* Direct 12 bit.  */
4483c63b39d6Schristos   BFD_RELOC_390_12,
4484c63b39d6Schristos 
4485c63b39d6Schristos /* 12 bit GOT offset.  */
4486c63b39d6Schristos   BFD_RELOC_390_GOT12,
4487c63b39d6Schristos 
4488c63b39d6Schristos /* 32 bit PC relative PLT address.  */
4489c63b39d6Schristos   BFD_RELOC_390_PLT32,
4490c63b39d6Schristos 
4491c63b39d6Schristos /* Copy symbol at runtime.  */
4492c63b39d6Schristos   BFD_RELOC_390_COPY,
4493c63b39d6Schristos 
4494c63b39d6Schristos /* Create GOT entry.  */
4495c63b39d6Schristos   BFD_RELOC_390_GLOB_DAT,
4496c63b39d6Schristos 
4497c63b39d6Schristos /* Create PLT entry.  */
4498c63b39d6Schristos   BFD_RELOC_390_JMP_SLOT,
4499c63b39d6Schristos 
4500c63b39d6Schristos /* Adjust by program base.  */
4501c63b39d6Schristos   BFD_RELOC_390_RELATIVE,
4502c63b39d6Schristos 
4503c63b39d6Schristos /* 32 bit PC relative offset to GOT.  */
4504c63b39d6Schristos   BFD_RELOC_390_GOTPC,
4505c63b39d6Schristos 
4506c63b39d6Schristos /* 16 bit GOT offset.  */
4507c63b39d6Schristos   BFD_RELOC_390_GOT16,
4508c63b39d6Schristos 
450944a21023Schristos /* PC relative 12 bit shifted by 1.  */
451044a21023Schristos   BFD_RELOC_390_PC12DBL,
451144a21023Schristos 
451244a21023Schristos /* 12 bit PC rel. PLT shifted by 1.  */
451344a21023Schristos   BFD_RELOC_390_PLT12DBL,
451444a21023Schristos 
4515c63b39d6Schristos /* PC relative 16 bit shifted by 1.  */
4516c63b39d6Schristos   BFD_RELOC_390_PC16DBL,
4517c63b39d6Schristos 
4518c63b39d6Schristos /* 16 bit PC rel. PLT shifted by 1.  */
4519c63b39d6Schristos   BFD_RELOC_390_PLT16DBL,
4520c63b39d6Schristos 
452144a21023Schristos /* PC relative 24 bit shifted by 1.  */
452244a21023Schristos   BFD_RELOC_390_PC24DBL,
452344a21023Schristos 
452444a21023Schristos /* 24 bit PC rel. PLT shifted by 1.  */
452544a21023Schristos   BFD_RELOC_390_PLT24DBL,
452644a21023Schristos 
4527c63b39d6Schristos /* PC relative 32 bit shifted by 1.  */
4528c63b39d6Schristos   BFD_RELOC_390_PC32DBL,
4529c63b39d6Schristos 
4530c63b39d6Schristos /* 32 bit PC rel. PLT shifted by 1.  */
4531c63b39d6Schristos   BFD_RELOC_390_PLT32DBL,
4532c63b39d6Schristos 
4533c63b39d6Schristos /* 32 bit PC rel. GOT shifted by 1.  */
4534c63b39d6Schristos   BFD_RELOC_390_GOTPCDBL,
4535c63b39d6Schristos 
4536c63b39d6Schristos /* 64 bit GOT offset.  */
4537c63b39d6Schristos   BFD_RELOC_390_GOT64,
4538c63b39d6Schristos 
4539c63b39d6Schristos /* 64 bit PC relative PLT address.  */
4540c63b39d6Schristos   BFD_RELOC_390_PLT64,
4541c63b39d6Schristos 
4542c63b39d6Schristos /* 32 bit rel. offset to GOT entry.  */
4543c63b39d6Schristos   BFD_RELOC_390_GOTENT,
4544c63b39d6Schristos 
4545c63b39d6Schristos /* 64 bit offset to GOT.  */
4546c63b39d6Schristos   BFD_RELOC_390_GOTOFF64,
4547c63b39d6Schristos 
4548c63b39d6Schristos /* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
4549c63b39d6Schristos   BFD_RELOC_390_GOTPLT12,
4550c63b39d6Schristos 
4551c63b39d6Schristos /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
4552c63b39d6Schristos   BFD_RELOC_390_GOTPLT16,
4553c63b39d6Schristos 
4554c63b39d6Schristos /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
4555c63b39d6Schristos   BFD_RELOC_390_GOTPLT32,
4556c63b39d6Schristos 
4557c63b39d6Schristos /* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
4558c63b39d6Schristos   BFD_RELOC_390_GOTPLT64,
4559c63b39d6Schristos 
4560c63b39d6Schristos /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
4561c63b39d6Schristos   BFD_RELOC_390_GOTPLTENT,
4562c63b39d6Schristos 
4563c63b39d6Schristos /* 16-bit rel. offset from the GOT to a PLT entry.  */
4564c63b39d6Schristos   BFD_RELOC_390_PLTOFF16,
4565c63b39d6Schristos 
4566c63b39d6Schristos /* 32-bit rel. offset from the GOT to a PLT entry.  */
4567c63b39d6Schristos   BFD_RELOC_390_PLTOFF32,
4568c63b39d6Schristos 
4569c63b39d6Schristos /* 64-bit rel. offset from the GOT to a PLT entry.  */
4570c63b39d6Schristos   BFD_RELOC_390_PLTOFF64,
4571c63b39d6Schristos 
4572c63b39d6Schristos /* s390 tls relocations.  */
4573c63b39d6Schristos   BFD_RELOC_390_TLS_LOAD,
4574c63b39d6Schristos   BFD_RELOC_390_TLS_GDCALL,
4575c63b39d6Schristos   BFD_RELOC_390_TLS_LDCALL,
4576c63b39d6Schristos   BFD_RELOC_390_TLS_GD32,
4577c63b39d6Schristos   BFD_RELOC_390_TLS_GD64,
4578c63b39d6Schristos   BFD_RELOC_390_TLS_GOTIE12,
4579c63b39d6Schristos   BFD_RELOC_390_TLS_GOTIE32,
4580c63b39d6Schristos   BFD_RELOC_390_TLS_GOTIE64,
4581c63b39d6Schristos   BFD_RELOC_390_TLS_LDM32,
4582c63b39d6Schristos   BFD_RELOC_390_TLS_LDM64,
4583c63b39d6Schristos   BFD_RELOC_390_TLS_IE32,
4584c63b39d6Schristos   BFD_RELOC_390_TLS_IE64,
4585c63b39d6Schristos   BFD_RELOC_390_TLS_IEENT,
4586c63b39d6Schristos   BFD_RELOC_390_TLS_LE32,
4587c63b39d6Schristos   BFD_RELOC_390_TLS_LE64,
4588c63b39d6Schristos   BFD_RELOC_390_TLS_LDO32,
4589c63b39d6Schristos   BFD_RELOC_390_TLS_LDO64,
4590c63b39d6Schristos   BFD_RELOC_390_TLS_DTPMOD,
4591c63b39d6Schristos   BFD_RELOC_390_TLS_DTPOFF,
4592c63b39d6Schristos   BFD_RELOC_390_TLS_TPOFF,
4593c63b39d6Schristos 
4594c63b39d6Schristos /* Long displacement extension.  */
4595c63b39d6Schristos   BFD_RELOC_390_20,
4596c63b39d6Schristos   BFD_RELOC_390_GOT20,
4597c63b39d6Schristos   BFD_RELOC_390_GOTPLT20,
4598c63b39d6Schristos   BFD_RELOC_390_TLS_GOTIE20,
4599c63b39d6Schristos 
4600fdeb0babSchristos /* STT_GNU_IFUNC relocation.  */
4601fdeb0babSchristos   BFD_RELOC_390_IRELATIVE,
4602fdeb0babSchristos 
4603c63b39d6Schristos /* Score relocations
4604c63b39d6Schristos Low 16 bit for load/store  */
4605c63b39d6Schristos   BFD_RELOC_SCORE_GPREL15,
4606c63b39d6Schristos 
4607c63b39d6Schristos /* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
4608c63b39d6Schristos   BFD_RELOC_SCORE_DUMMY2,
4609c63b39d6Schristos   BFD_RELOC_SCORE_JMP,
4610c63b39d6Schristos 
4611c63b39d6Schristos /* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
4612c63b39d6Schristos   BFD_RELOC_SCORE_BRANCH,
4613c63b39d6Schristos 
4614c63b39d6Schristos /* This is a 32-bit reloc for 48-bit instructions.  */
4615c63b39d6Schristos   BFD_RELOC_SCORE_IMM30,
4616c63b39d6Schristos 
4617c63b39d6Schristos /* This is a 32-bit reloc for 48-bit instructions.  */
4618c63b39d6Schristos   BFD_RELOC_SCORE_IMM32,
4619c63b39d6Schristos 
4620c63b39d6Schristos /* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
4621c63b39d6Schristos   BFD_RELOC_SCORE16_JMP,
4622c63b39d6Schristos 
4623c63b39d6Schristos /* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
4624c63b39d6Schristos   BFD_RELOC_SCORE16_BRANCH,
4625c63b39d6Schristos 
4626c63b39d6Schristos /* This is a 9-bit reloc with the right 1 bit assumed to be 0  */
4627c63b39d6Schristos   BFD_RELOC_SCORE_BCMP,
4628c63b39d6Schristos 
4629c63b39d6Schristos /* Undocumented Score relocs  */
4630c63b39d6Schristos   BFD_RELOC_SCORE_GOT15,
4631c63b39d6Schristos   BFD_RELOC_SCORE_GOT_LO16,
4632c63b39d6Schristos   BFD_RELOC_SCORE_CALL15,
4633c63b39d6Schristos   BFD_RELOC_SCORE_DUMMY_HI16,
4634c63b39d6Schristos 
4635c63b39d6Schristos /* Scenix IP2K - 9-bit register number / data address  */
4636c63b39d6Schristos   BFD_RELOC_IP2K_FR9,
4637c63b39d6Schristos 
4638c63b39d6Schristos /* Scenix IP2K - 4-bit register/data bank number  */
4639c63b39d6Schristos   BFD_RELOC_IP2K_BANK,
4640c63b39d6Schristos 
4641c63b39d6Schristos /* Scenix IP2K - low 13 bits of instruction word address  */
4642c63b39d6Schristos   BFD_RELOC_IP2K_ADDR16CJP,
4643c63b39d6Schristos 
4644c63b39d6Schristos /* Scenix IP2K - high 3 bits of instruction word address  */
4645c63b39d6Schristos   BFD_RELOC_IP2K_PAGE3,
4646c63b39d6Schristos 
4647c63b39d6Schristos /* Scenix IP2K - ext/low/high 8 bits of data address  */
4648c63b39d6Schristos   BFD_RELOC_IP2K_LO8DATA,
4649c63b39d6Schristos   BFD_RELOC_IP2K_HI8DATA,
4650c63b39d6Schristos   BFD_RELOC_IP2K_EX8DATA,
4651c63b39d6Schristos 
4652c63b39d6Schristos /* Scenix IP2K - low/high 8 bits of instruction word address  */
4653c63b39d6Schristos   BFD_RELOC_IP2K_LO8INSN,
4654c63b39d6Schristos   BFD_RELOC_IP2K_HI8INSN,
4655c63b39d6Schristos 
4656c63b39d6Schristos /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
4657c63b39d6Schristos   BFD_RELOC_IP2K_PC_SKIP,
4658c63b39d6Schristos 
4659c63b39d6Schristos /* Scenix IP2K - 16 bit word address in text section.  */
4660c63b39d6Schristos   BFD_RELOC_IP2K_TEXT,
4661c63b39d6Schristos 
4662c63b39d6Schristos /* Scenix IP2K - 7-bit sp or dp offset  */
4663c63b39d6Schristos   BFD_RELOC_IP2K_FR_OFFSET,
4664c63b39d6Schristos 
4665c63b39d6Schristos /* Scenix VPE4K coprocessor - data/insn-space addressing  */
4666c63b39d6Schristos   BFD_RELOC_VPE4KMATH_DATA,
4667c63b39d6Schristos   BFD_RELOC_VPE4KMATH_INSN,
4668c63b39d6Schristos 
4669c63b39d6Schristos /* These two relocations are used by the linker to determine which of
4670c63b39d6Schristos the entries in a C++ virtual function table are actually used.  When
4671c63b39d6Schristos the --gc-sections option is given, the linker will zero out the entries
4672c63b39d6Schristos that are not used, so that the code for those functions need not be
4673c63b39d6Schristos included in the output.
4674c63b39d6Schristos 
4675c63b39d6Schristos VTABLE_INHERIT is a zero-space relocation used to describe to the
4676c63b39d6Schristos linker the inheritance tree of a C++ virtual function table.  The
4677c63b39d6Schristos relocation's symbol should be the parent class' vtable, and the
4678c63b39d6Schristos relocation should be located at the child vtable.
4679c63b39d6Schristos 
4680c63b39d6Schristos VTABLE_ENTRY is a zero-space relocation that describes the use of a
4681c63b39d6Schristos virtual function table entry.  The reloc's symbol should refer to the
4682c63b39d6Schristos table of the class mentioned in the code.  Off of that base, an offset
4683c63b39d6Schristos describes the entry that is being used.  For Rela hosts, this offset
4684c63b39d6Schristos is stored in the reloc's addend.  For Rel hosts, we are forced to put
4685c63b39d6Schristos this offset in the reloc's section offset.  */
4686c63b39d6Schristos   BFD_RELOC_VTABLE_INHERIT,
4687c63b39d6Schristos   BFD_RELOC_VTABLE_ENTRY,
4688c63b39d6Schristos 
4689c63b39d6Schristos /* Intel IA64 Relocations.  */
4690c63b39d6Schristos   BFD_RELOC_IA64_IMM14,
4691c63b39d6Schristos   BFD_RELOC_IA64_IMM22,
4692c63b39d6Schristos   BFD_RELOC_IA64_IMM64,
4693c63b39d6Schristos   BFD_RELOC_IA64_DIR32MSB,
4694c63b39d6Schristos   BFD_RELOC_IA64_DIR32LSB,
4695c63b39d6Schristos   BFD_RELOC_IA64_DIR64MSB,
4696c63b39d6Schristos   BFD_RELOC_IA64_DIR64LSB,
4697c63b39d6Schristos   BFD_RELOC_IA64_GPREL22,
4698c63b39d6Schristos   BFD_RELOC_IA64_GPREL64I,
4699c63b39d6Schristos   BFD_RELOC_IA64_GPREL32MSB,
4700c63b39d6Schristos   BFD_RELOC_IA64_GPREL32LSB,
4701c63b39d6Schristos   BFD_RELOC_IA64_GPREL64MSB,
4702c63b39d6Schristos   BFD_RELOC_IA64_GPREL64LSB,
4703c63b39d6Schristos   BFD_RELOC_IA64_LTOFF22,
4704c63b39d6Schristos   BFD_RELOC_IA64_LTOFF64I,
4705c63b39d6Schristos   BFD_RELOC_IA64_PLTOFF22,
4706c63b39d6Schristos   BFD_RELOC_IA64_PLTOFF64I,
4707c63b39d6Schristos   BFD_RELOC_IA64_PLTOFF64MSB,
4708c63b39d6Schristos   BFD_RELOC_IA64_PLTOFF64LSB,
4709c63b39d6Schristos   BFD_RELOC_IA64_FPTR64I,
4710c63b39d6Schristos   BFD_RELOC_IA64_FPTR32MSB,
4711c63b39d6Schristos   BFD_RELOC_IA64_FPTR32LSB,
4712c63b39d6Schristos   BFD_RELOC_IA64_FPTR64MSB,
4713c63b39d6Schristos   BFD_RELOC_IA64_FPTR64LSB,
4714c63b39d6Schristos   BFD_RELOC_IA64_PCREL21B,
4715c63b39d6Schristos   BFD_RELOC_IA64_PCREL21BI,
4716c63b39d6Schristos   BFD_RELOC_IA64_PCREL21M,
4717c63b39d6Schristos   BFD_RELOC_IA64_PCREL21F,
4718c63b39d6Schristos   BFD_RELOC_IA64_PCREL22,
4719c63b39d6Schristos   BFD_RELOC_IA64_PCREL60B,
4720c63b39d6Schristos   BFD_RELOC_IA64_PCREL64I,
4721c63b39d6Schristos   BFD_RELOC_IA64_PCREL32MSB,
4722c63b39d6Schristos   BFD_RELOC_IA64_PCREL32LSB,
4723c63b39d6Schristos   BFD_RELOC_IA64_PCREL64MSB,
4724c63b39d6Schristos   BFD_RELOC_IA64_PCREL64LSB,
4725c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR22,
4726c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR64I,
4727c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR32MSB,
4728c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR32LSB,
4729c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR64MSB,
4730c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_FPTR64LSB,
4731c63b39d6Schristos   BFD_RELOC_IA64_SEGREL32MSB,
4732c63b39d6Schristos   BFD_RELOC_IA64_SEGREL32LSB,
4733c63b39d6Schristos   BFD_RELOC_IA64_SEGREL64MSB,
4734c63b39d6Schristos   BFD_RELOC_IA64_SEGREL64LSB,
4735c63b39d6Schristos   BFD_RELOC_IA64_SECREL32MSB,
4736c63b39d6Schristos   BFD_RELOC_IA64_SECREL32LSB,
4737c63b39d6Schristos   BFD_RELOC_IA64_SECREL64MSB,
4738c63b39d6Schristos   BFD_RELOC_IA64_SECREL64LSB,
4739c63b39d6Schristos   BFD_RELOC_IA64_REL32MSB,
4740c63b39d6Schristos   BFD_RELOC_IA64_REL32LSB,
4741c63b39d6Schristos   BFD_RELOC_IA64_REL64MSB,
4742c63b39d6Schristos   BFD_RELOC_IA64_REL64LSB,
4743c63b39d6Schristos   BFD_RELOC_IA64_LTV32MSB,
4744c63b39d6Schristos   BFD_RELOC_IA64_LTV32LSB,
4745c63b39d6Schristos   BFD_RELOC_IA64_LTV64MSB,
4746c63b39d6Schristos   BFD_RELOC_IA64_LTV64LSB,
4747c63b39d6Schristos   BFD_RELOC_IA64_IPLTMSB,
4748c63b39d6Schristos   BFD_RELOC_IA64_IPLTLSB,
4749c63b39d6Schristos   BFD_RELOC_IA64_COPY,
4750c63b39d6Schristos   BFD_RELOC_IA64_LTOFF22X,
4751c63b39d6Schristos   BFD_RELOC_IA64_LDXMOV,
4752c63b39d6Schristos   BFD_RELOC_IA64_TPREL14,
4753c63b39d6Schristos   BFD_RELOC_IA64_TPREL22,
4754c63b39d6Schristos   BFD_RELOC_IA64_TPREL64I,
4755c63b39d6Schristos   BFD_RELOC_IA64_TPREL64MSB,
4756c63b39d6Schristos   BFD_RELOC_IA64_TPREL64LSB,
4757c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_TPREL22,
4758c63b39d6Schristos   BFD_RELOC_IA64_DTPMOD64MSB,
4759c63b39d6Schristos   BFD_RELOC_IA64_DTPMOD64LSB,
4760c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_DTPMOD22,
4761c63b39d6Schristos   BFD_RELOC_IA64_DTPREL14,
4762c63b39d6Schristos   BFD_RELOC_IA64_DTPREL22,
4763c63b39d6Schristos   BFD_RELOC_IA64_DTPREL64I,
4764c63b39d6Schristos   BFD_RELOC_IA64_DTPREL32MSB,
4765c63b39d6Schristos   BFD_RELOC_IA64_DTPREL32LSB,
4766c63b39d6Schristos   BFD_RELOC_IA64_DTPREL64MSB,
4767c63b39d6Schristos   BFD_RELOC_IA64_DTPREL64LSB,
4768c63b39d6Schristos   BFD_RELOC_IA64_LTOFF_DTPREL22,
4769c63b39d6Schristos 
4770c63b39d6Schristos /* Motorola 68HC11 reloc.
4771c63b39d6Schristos This is the 8 bit high part of an absolute address.  */
4772c63b39d6Schristos   BFD_RELOC_M68HC11_HI8,
4773c63b39d6Schristos 
4774c63b39d6Schristos /* Motorola 68HC11 reloc.
4775c63b39d6Schristos This is the 8 bit low part of an absolute address.  */
4776c63b39d6Schristos   BFD_RELOC_M68HC11_LO8,
4777c63b39d6Schristos 
4778c63b39d6Schristos /* Motorola 68HC11 reloc.
4779c63b39d6Schristos This is the 3 bit of a value.  */
4780c63b39d6Schristos   BFD_RELOC_M68HC11_3B,
4781c63b39d6Schristos 
4782c63b39d6Schristos /* Motorola 68HC11 reloc.
4783c63b39d6Schristos This reloc marks the beginning of a jump/call instruction.
4784c63b39d6Schristos It is used for linker relaxation to correctly identify beginning
4785c63b39d6Schristos of instruction and change some branches to use PC-relative
4786c63b39d6Schristos addressing mode.  */
4787c63b39d6Schristos   BFD_RELOC_M68HC11_RL_JUMP,
4788c63b39d6Schristos 
4789c63b39d6Schristos /* Motorola 68HC11 reloc.
4790c63b39d6Schristos This reloc marks a group of several instructions that gcc generates
4791c63b39d6Schristos and for which the linker relaxation pass can modify and/or remove
4792c63b39d6Schristos some of them.  */
4793c63b39d6Schristos   BFD_RELOC_M68HC11_RL_GROUP,
4794c63b39d6Schristos 
4795c63b39d6Schristos /* Motorola 68HC11 reloc.
4796c63b39d6Schristos This is the 16-bit lower part of an address.  It is used for 'call'
4797c63b39d6Schristos instruction to specify the symbol address without any special
4798c63b39d6Schristos transformation (due to memory bank window).  */
4799c63b39d6Schristos   BFD_RELOC_M68HC11_LO16,
4800c63b39d6Schristos 
4801c63b39d6Schristos /* Motorola 68HC11 reloc.
4802c63b39d6Schristos This is a 8-bit reloc that specifies the page number of an address.
4803c63b39d6Schristos It is used by 'call' instruction to specify the page number of
4804c63b39d6Schristos the symbol.  */
4805c63b39d6Schristos   BFD_RELOC_M68HC11_PAGE,
4806c63b39d6Schristos 
4807c63b39d6Schristos /* Motorola 68HC11 reloc.
4808c63b39d6Schristos This is a 24-bit reloc that represents the address with a 16-bit
4809c63b39d6Schristos value and a 8-bit page number.  The symbol address is transformed
4810c63b39d6Schristos to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
4811c63b39d6Schristos   BFD_RELOC_M68HC11_24,
4812c63b39d6Schristos 
4813c63b39d6Schristos /* Motorola 68HC12 reloc.
4814c63b39d6Schristos This is the 5 bits of a value.  */
4815c63b39d6Schristos   BFD_RELOC_M68HC12_5B,
4816c63b39d6Schristos 
4817fdeb0babSchristos /* Freescale XGATE reloc.
4818fdeb0babSchristos This reloc marks the beginning of a bra/jal instruction.  */
4819fdeb0babSchristos   BFD_RELOC_XGATE_RL_JUMP,
4820fdeb0babSchristos 
4821fdeb0babSchristos /* Freescale XGATE reloc.
4822fdeb0babSchristos This reloc marks a group of several instructions that gcc generates
4823fdeb0babSchristos and for which the linker relaxation pass can modify and/or remove
4824fdeb0babSchristos some of them.  */
4825fdeb0babSchristos   BFD_RELOC_XGATE_RL_GROUP,
4826fdeb0babSchristos 
4827fdeb0babSchristos /* Freescale XGATE reloc.
4828fdeb0babSchristos This is the 16-bit lower part of an address.  It is used for the '16-bit'
4829fdeb0babSchristos instructions.  */
4830fdeb0babSchristos   BFD_RELOC_XGATE_LO16,
4831fdeb0babSchristos 
4832fdeb0babSchristos /* Freescale XGATE reloc.  */
4833fdeb0babSchristos   BFD_RELOC_XGATE_GPAGE,
4834fdeb0babSchristos 
4835fdeb0babSchristos /* Freescale XGATE reloc.  */
4836fdeb0babSchristos   BFD_RELOC_XGATE_24,
4837fdeb0babSchristos 
4838fdeb0babSchristos /* Freescale XGATE reloc.
4839fdeb0babSchristos This is a 9-bit pc-relative reloc.  */
4840fdeb0babSchristos   BFD_RELOC_XGATE_PCREL_9,
4841fdeb0babSchristos 
4842fdeb0babSchristos /* Freescale XGATE reloc.
4843fdeb0babSchristos This is a 10-bit pc-relative reloc.  */
4844fdeb0babSchristos   BFD_RELOC_XGATE_PCREL_10,
4845fdeb0babSchristos 
4846fdeb0babSchristos /* Freescale XGATE reloc.
4847fdeb0babSchristos This is the 16-bit lower part of an address.  It is used for the '16-bit'
4848fdeb0babSchristos instructions.  */
4849fdeb0babSchristos   BFD_RELOC_XGATE_IMM8_LO,
4850fdeb0babSchristos 
4851fdeb0babSchristos /* Freescale XGATE reloc.
4852fdeb0babSchristos This is the 16-bit higher part of an address.  It is used for the '16-bit'
4853fdeb0babSchristos instructions.  */
4854fdeb0babSchristos   BFD_RELOC_XGATE_IMM8_HI,
4855fdeb0babSchristos 
4856fdeb0babSchristos /* Freescale XGATE reloc.
4857fdeb0babSchristos This is a 3-bit pc-relative reloc.  */
4858fdeb0babSchristos   BFD_RELOC_XGATE_IMM3,
4859fdeb0babSchristos 
4860fdeb0babSchristos /* Freescale XGATE reloc.
4861fdeb0babSchristos This is a 4-bit pc-relative reloc.  */
4862fdeb0babSchristos   BFD_RELOC_XGATE_IMM4,
4863fdeb0babSchristos 
4864fdeb0babSchristos /* Freescale XGATE reloc.
4865fdeb0babSchristos This is a 5-bit pc-relative reloc.  */
4866fdeb0babSchristos   BFD_RELOC_XGATE_IMM5,
4867fdeb0babSchristos 
4868fdeb0babSchristos /* Motorola 68HC12 reloc.
4869fdeb0babSchristos This is the 9 bits of a value.  */
4870fdeb0babSchristos   BFD_RELOC_M68HC12_9B,
4871fdeb0babSchristos 
4872fdeb0babSchristos /* Motorola 68HC12 reloc.
4873fdeb0babSchristos This is the 16 bits of a value.  */
4874fdeb0babSchristos   BFD_RELOC_M68HC12_16B,
4875fdeb0babSchristos 
4876fdeb0babSchristos /* Motorola 68HC12/XGATE reloc.
4877fdeb0babSchristos This is a PCREL9 branch.  */
4878fdeb0babSchristos   BFD_RELOC_M68HC12_9_PCREL,
4879fdeb0babSchristos 
4880fdeb0babSchristos /* Motorola 68HC12/XGATE reloc.
4881fdeb0babSchristos This is a PCREL10 branch.  */
4882fdeb0babSchristos   BFD_RELOC_M68HC12_10_PCREL,
4883fdeb0babSchristos 
4884fdeb0babSchristos /* Motorola 68HC12/XGATE reloc.
4885fdeb0babSchristos This is the 8 bit low part of an absolute address and immediately precedes
4886fdeb0babSchristos a matching HI8XG part.  */
4887fdeb0babSchristos   BFD_RELOC_M68HC12_LO8XG,
4888fdeb0babSchristos 
4889fdeb0babSchristos /* Motorola 68HC12/XGATE reloc.
4890fdeb0babSchristos This is the 8 bit high part of an absolute address and immediately follows
4891fdeb0babSchristos a matching LO8XG part.  */
4892fdeb0babSchristos   BFD_RELOC_M68HC12_HI8XG,
4893fdeb0babSchristos 
489477cd98dfSchristos /* Freescale S12Z reloc.
489577cd98dfSchristos This is a 15 bit relative address.  If the most significant bits are all zero
489677cd98dfSchristos then it may be truncated to 8 bits.  */
489777cd98dfSchristos   BFD_RELOC_S12Z_15_PCREL,
489877cd98dfSchristos 
4899c63b39d6Schristos /* NS CR16 Relocations.  */
4900c63b39d6Schristos   BFD_RELOC_CR16_NUM8,
4901c63b39d6Schristos   BFD_RELOC_CR16_NUM16,
4902c63b39d6Schristos   BFD_RELOC_CR16_NUM32,
4903c63b39d6Schristos   BFD_RELOC_CR16_NUM32a,
4904c63b39d6Schristos   BFD_RELOC_CR16_REGREL0,
4905c63b39d6Schristos   BFD_RELOC_CR16_REGREL4,
4906c63b39d6Schristos   BFD_RELOC_CR16_REGREL4a,
4907c63b39d6Schristos   BFD_RELOC_CR16_REGREL14,
4908c63b39d6Schristos   BFD_RELOC_CR16_REGREL14a,
4909c63b39d6Schristos   BFD_RELOC_CR16_REGREL16,
4910c63b39d6Schristos   BFD_RELOC_CR16_REGREL20,
4911c63b39d6Schristos   BFD_RELOC_CR16_REGREL20a,
4912c63b39d6Schristos   BFD_RELOC_CR16_ABS20,
4913c63b39d6Schristos   BFD_RELOC_CR16_ABS24,
4914c63b39d6Schristos   BFD_RELOC_CR16_IMM4,
4915c63b39d6Schristos   BFD_RELOC_CR16_IMM8,
4916c63b39d6Schristos   BFD_RELOC_CR16_IMM16,
4917c63b39d6Schristos   BFD_RELOC_CR16_IMM20,
4918c63b39d6Schristos   BFD_RELOC_CR16_IMM24,
4919c63b39d6Schristos   BFD_RELOC_CR16_IMM32,
4920c63b39d6Schristos   BFD_RELOC_CR16_IMM32a,
4921c63b39d6Schristos   BFD_RELOC_CR16_DISP4,
4922c63b39d6Schristos   BFD_RELOC_CR16_DISP8,
4923c63b39d6Schristos   BFD_RELOC_CR16_DISP16,
4924c63b39d6Schristos   BFD_RELOC_CR16_DISP20,
4925c63b39d6Schristos   BFD_RELOC_CR16_DISP24,
4926c63b39d6Schristos   BFD_RELOC_CR16_DISP24a,
4927c63b39d6Schristos   BFD_RELOC_CR16_SWITCH8,
4928c63b39d6Schristos   BFD_RELOC_CR16_SWITCH16,
4929c63b39d6Schristos   BFD_RELOC_CR16_SWITCH32,
4930c63b39d6Schristos   BFD_RELOC_CR16_GOT_REGREL20,
4931c63b39d6Schristos   BFD_RELOC_CR16_GOTC_REGREL20,
4932c63b39d6Schristos   BFD_RELOC_CR16_GLOB_DAT,
4933c63b39d6Schristos 
4934c63b39d6Schristos /* NS CRX Relocations.  */
4935c63b39d6Schristos   BFD_RELOC_CRX_REL4,
4936c63b39d6Schristos   BFD_RELOC_CRX_REL8,
4937c63b39d6Schristos   BFD_RELOC_CRX_REL8_CMP,
4938c63b39d6Schristos   BFD_RELOC_CRX_REL16,
4939c63b39d6Schristos   BFD_RELOC_CRX_REL24,
4940c63b39d6Schristos   BFD_RELOC_CRX_REL32,
4941c63b39d6Schristos   BFD_RELOC_CRX_REGREL12,
4942c63b39d6Schristos   BFD_RELOC_CRX_REGREL22,
4943c63b39d6Schristos   BFD_RELOC_CRX_REGREL28,
4944c63b39d6Schristos   BFD_RELOC_CRX_REGREL32,
4945c63b39d6Schristos   BFD_RELOC_CRX_ABS16,
4946c63b39d6Schristos   BFD_RELOC_CRX_ABS32,
4947c63b39d6Schristos   BFD_RELOC_CRX_NUM8,
4948c63b39d6Schristos   BFD_RELOC_CRX_NUM16,
4949c63b39d6Schristos   BFD_RELOC_CRX_NUM32,
4950c63b39d6Schristos   BFD_RELOC_CRX_IMM16,
4951c63b39d6Schristos   BFD_RELOC_CRX_IMM32,
4952c63b39d6Schristos   BFD_RELOC_CRX_SWITCH8,
4953c63b39d6Schristos   BFD_RELOC_CRX_SWITCH16,
4954c63b39d6Schristos   BFD_RELOC_CRX_SWITCH32,
4955c63b39d6Schristos 
4956c63b39d6Schristos /* These relocs are only used within the CRIS assembler.  They are not
4957c63b39d6Schristos (at present) written to any object files.  */
4958c63b39d6Schristos   BFD_RELOC_CRIS_BDISP8,
4959c63b39d6Schristos   BFD_RELOC_CRIS_UNSIGNED_5,
4960c63b39d6Schristos   BFD_RELOC_CRIS_SIGNED_6,
4961c63b39d6Schristos   BFD_RELOC_CRIS_UNSIGNED_6,
4962c63b39d6Schristos   BFD_RELOC_CRIS_SIGNED_8,
4963c63b39d6Schristos   BFD_RELOC_CRIS_UNSIGNED_8,
4964c63b39d6Schristos   BFD_RELOC_CRIS_SIGNED_16,
4965c63b39d6Schristos   BFD_RELOC_CRIS_UNSIGNED_16,
4966c63b39d6Schristos   BFD_RELOC_CRIS_LAPCQ_OFFSET,
4967c63b39d6Schristos   BFD_RELOC_CRIS_UNSIGNED_4,
4968c63b39d6Schristos 
4969c63b39d6Schristos /* Relocs used in ELF shared libraries for CRIS.  */
4970c63b39d6Schristos   BFD_RELOC_CRIS_COPY,
4971c63b39d6Schristos   BFD_RELOC_CRIS_GLOB_DAT,
4972c63b39d6Schristos   BFD_RELOC_CRIS_JUMP_SLOT,
4973c63b39d6Schristos   BFD_RELOC_CRIS_RELATIVE,
4974c63b39d6Schristos 
4975c63b39d6Schristos /* 32-bit offset to symbol-entry within GOT.  */
4976c63b39d6Schristos   BFD_RELOC_CRIS_32_GOT,
4977c63b39d6Schristos 
4978c63b39d6Schristos /* 16-bit offset to symbol-entry within GOT.  */
4979c63b39d6Schristos   BFD_RELOC_CRIS_16_GOT,
4980c63b39d6Schristos 
4981c63b39d6Schristos /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
4982c63b39d6Schristos   BFD_RELOC_CRIS_32_GOTPLT,
4983c63b39d6Schristos 
4984c63b39d6Schristos /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
4985c63b39d6Schristos   BFD_RELOC_CRIS_16_GOTPLT,
4986c63b39d6Schristos 
4987c63b39d6Schristos /* 32-bit offset to symbol, relative to GOT.  */
4988c63b39d6Schristos   BFD_RELOC_CRIS_32_GOTREL,
4989c63b39d6Schristos 
4990c63b39d6Schristos /* 32-bit offset to symbol with PLT entry, relative to GOT.  */
4991c63b39d6Schristos   BFD_RELOC_CRIS_32_PLT_GOTREL,
4992c63b39d6Schristos 
4993c63b39d6Schristos /* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
4994c63b39d6Schristos   BFD_RELOC_CRIS_32_PLT_PCREL,
4995c63b39d6Schristos 
4996c63b39d6Schristos /* Relocs used in TLS code for CRIS.  */
4997c63b39d6Schristos   BFD_RELOC_CRIS_32_GOT_GD,
4998c63b39d6Schristos   BFD_RELOC_CRIS_16_GOT_GD,
4999c63b39d6Schristos   BFD_RELOC_CRIS_32_GD,
5000c63b39d6Schristos   BFD_RELOC_CRIS_DTP,
5001c63b39d6Schristos   BFD_RELOC_CRIS_32_DTPREL,
5002c63b39d6Schristos   BFD_RELOC_CRIS_16_DTPREL,
5003c63b39d6Schristos   BFD_RELOC_CRIS_32_GOT_TPREL,
5004c63b39d6Schristos   BFD_RELOC_CRIS_16_GOT_TPREL,
5005c63b39d6Schristos   BFD_RELOC_CRIS_32_TPREL,
5006c63b39d6Schristos   BFD_RELOC_CRIS_16_TPREL,
5007c63b39d6Schristos   BFD_RELOC_CRIS_DTPMOD,
5008c63b39d6Schristos   BFD_RELOC_CRIS_32_IE,
5009c63b39d6Schristos 
5010b511d482Schristos /* OpenRISC 1000 Relocations.  */
5011b511d482Schristos   BFD_RELOC_OR1K_REL_26,
501277cd98dfSchristos   BFD_RELOC_OR1K_SLO16,
501377cd98dfSchristos   BFD_RELOC_OR1K_PCREL_PG21,
501477cd98dfSchristos   BFD_RELOC_OR1K_LO13,
501577cd98dfSchristos   BFD_RELOC_OR1K_SLO13,
5016b511d482Schristos   BFD_RELOC_OR1K_GOTPC_HI16,
5017b511d482Schristos   BFD_RELOC_OR1K_GOTPC_LO16,
5018b511d482Schristos   BFD_RELOC_OR1K_GOT16,
501977cd98dfSchristos   BFD_RELOC_OR1K_GOT_PG21,
502077cd98dfSchristos   BFD_RELOC_OR1K_GOT_LO13,
5021b511d482Schristos   BFD_RELOC_OR1K_PLT26,
502277cd98dfSchristos   BFD_RELOC_OR1K_PLTA26,
502377cd98dfSchristos   BFD_RELOC_OR1K_GOTOFF_SLO16,
5024b511d482Schristos   BFD_RELOC_OR1K_COPY,
5025b511d482Schristos   BFD_RELOC_OR1K_GLOB_DAT,
5026b511d482Schristos   BFD_RELOC_OR1K_JMP_SLOT,
5027b511d482Schristos   BFD_RELOC_OR1K_RELATIVE,
5028b511d482Schristos   BFD_RELOC_OR1K_TLS_GD_HI16,
5029b511d482Schristos   BFD_RELOC_OR1K_TLS_GD_LO16,
503077cd98dfSchristos   BFD_RELOC_OR1K_TLS_GD_PG21,
503177cd98dfSchristos   BFD_RELOC_OR1K_TLS_GD_LO13,
5032b511d482Schristos   BFD_RELOC_OR1K_TLS_LDM_HI16,
5033b511d482Schristos   BFD_RELOC_OR1K_TLS_LDM_LO16,
503477cd98dfSchristos   BFD_RELOC_OR1K_TLS_LDM_PG21,
503577cd98dfSchristos   BFD_RELOC_OR1K_TLS_LDM_LO13,
5036b511d482Schristos   BFD_RELOC_OR1K_TLS_LDO_HI16,
5037b511d482Schristos   BFD_RELOC_OR1K_TLS_LDO_LO16,
5038b511d482Schristos   BFD_RELOC_OR1K_TLS_IE_HI16,
503977cd98dfSchristos   BFD_RELOC_OR1K_TLS_IE_AHI16,
5040b511d482Schristos   BFD_RELOC_OR1K_TLS_IE_LO16,
504177cd98dfSchristos   BFD_RELOC_OR1K_TLS_IE_PG21,
504277cd98dfSchristos   BFD_RELOC_OR1K_TLS_IE_LO13,
5043b511d482Schristos   BFD_RELOC_OR1K_TLS_LE_HI16,
504477cd98dfSchristos   BFD_RELOC_OR1K_TLS_LE_AHI16,
5045b511d482Schristos   BFD_RELOC_OR1K_TLS_LE_LO16,
504677cd98dfSchristos   BFD_RELOC_OR1K_TLS_LE_SLO16,
5047b511d482Schristos   BFD_RELOC_OR1K_TLS_TPOFF,
5048b511d482Schristos   BFD_RELOC_OR1K_TLS_DTPOFF,
5049b511d482Schristos   BFD_RELOC_OR1K_TLS_DTPMOD,
5050c63b39d6Schristos 
5051c63b39d6Schristos /* H8 elf Relocations.  */
5052c63b39d6Schristos   BFD_RELOC_H8_DIR16A8,
5053c63b39d6Schristos   BFD_RELOC_H8_DIR16R8,
5054c63b39d6Schristos   BFD_RELOC_H8_DIR24A8,
5055c63b39d6Schristos   BFD_RELOC_H8_DIR24R8,
5056c63b39d6Schristos   BFD_RELOC_H8_DIR32A16,
505744a21023Schristos   BFD_RELOC_H8_DISP32A16,
5058c63b39d6Schristos 
5059c63b39d6Schristos /* Sony Xstormy16 Relocations.  */
5060c63b39d6Schristos   BFD_RELOC_XSTORMY16_REL_12,
5061c63b39d6Schristos   BFD_RELOC_XSTORMY16_12,
5062c63b39d6Schristos   BFD_RELOC_XSTORMY16_24,
5063c63b39d6Schristos   BFD_RELOC_XSTORMY16_FPTR16,
5064c63b39d6Schristos 
5065c63b39d6Schristos /* Self-describing complex relocations.  */
5066c63b39d6Schristos   BFD_RELOC_RELC,
5067c63b39d6Schristos 
5068c63b39d6Schristos 
5069c63b39d6Schristos /* Infineon Relocations.  */
5070c63b39d6Schristos   BFD_RELOC_XC16X_PAG,
5071c63b39d6Schristos   BFD_RELOC_XC16X_POF,
5072c63b39d6Schristos   BFD_RELOC_XC16X_SEG,
5073c63b39d6Schristos   BFD_RELOC_XC16X_SOF,
5074c63b39d6Schristos 
5075c63b39d6Schristos /* Relocations used by VAX ELF.  */
5076c63b39d6Schristos   BFD_RELOC_VAX_GLOB_DAT,
5077c63b39d6Schristos   BFD_RELOC_VAX_JMP_SLOT,
5078c63b39d6Schristos   BFD_RELOC_VAX_RELATIVE,
5079c63b39d6Schristos 
5080c63b39d6Schristos /* Morpho MT - 16 bit immediate relocation.  */
5081c63b39d6Schristos   BFD_RELOC_MT_PC16,
5082c63b39d6Schristos 
5083c63b39d6Schristos /* Morpho MT - Hi 16 bits of an address.  */
5084c63b39d6Schristos   BFD_RELOC_MT_HI16,
5085c63b39d6Schristos 
5086c63b39d6Schristos /* Morpho MT - Low 16 bits of an address.  */
5087c63b39d6Schristos   BFD_RELOC_MT_LO16,
5088c63b39d6Schristos 
5089c63b39d6Schristos /* Morpho MT - Used to tell the linker which vtable entries are used.  */
5090c63b39d6Schristos   BFD_RELOC_MT_GNU_VTINHERIT,
5091c63b39d6Schristos 
5092c63b39d6Schristos /* Morpho MT - Used to tell the linker which vtable entries are used.  */
5093c63b39d6Schristos   BFD_RELOC_MT_GNU_VTENTRY,
5094c63b39d6Schristos 
5095c63b39d6Schristos /* Morpho MT - 8 bit immediate relocation.  */
5096c63b39d6Schristos   BFD_RELOC_MT_PCINSN8,
5097c63b39d6Schristos 
5098c63b39d6Schristos /* msp430 specific relocation codes  */
5099c63b39d6Schristos   BFD_RELOC_MSP430_10_PCREL,
5100c63b39d6Schristos   BFD_RELOC_MSP430_16_PCREL,
5101c63b39d6Schristos   BFD_RELOC_MSP430_16,
5102c63b39d6Schristos   BFD_RELOC_MSP430_16_PCREL_BYTE,
5103c63b39d6Schristos   BFD_RELOC_MSP430_16_BYTE,
5104c63b39d6Schristos   BFD_RELOC_MSP430_2X_PCREL,
5105c63b39d6Schristos   BFD_RELOC_MSP430_RL_PCREL,
510644a21023Schristos   BFD_RELOC_MSP430_ABS8,
510744a21023Schristos   BFD_RELOC_MSP430X_PCR20_EXT_SRC,
510844a21023Schristos   BFD_RELOC_MSP430X_PCR20_EXT_DST,
510944a21023Schristos   BFD_RELOC_MSP430X_PCR20_EXT_ODST,
511044a21023Schristos   BFD_RELOC_MSP430X_ABS20_EXT_SRC,
511144a21023Schristos   BFD_RELOC_MSP430X_ABS20_EXT_DST,
511244a21023Schristos   BFD_RELOC_MSP430X_ABS20_EXT_ODST,
511344a21023Schristos   BFD_RELOC_MSP430X_ABS20_ADR_SRC,
511444a21023Schristos   BFD_RELOC_MSP430X_ABS20_ADR_DST,
511544a21023Schristos   BFD_RELOC_MSP430X_PCR16,
511644a21023Schristos   BFD_RELOC_MSP430X_PCR20_CALL,
511744a21023Schristos   BFD_RELOC_MSP430X_ABS16,
511844a21023Schristos   BFD_RELOC_MSP430_ABS_HI16,
511944a21023Schristos   BFD_RELOC_MSP430_PREL31,
512044a21023Schristos   BFD_RELOC_MSP430_SYM_DIFF,
5121*fd82c4c4Schristos   BFD_RELOC_MSP430_SET_ULEB128,
5122*fd82c4c4Schristos   BFD_RELOC_MSP430_SUB_ULEB128,
5123c63b39d6Schristos 
5124fdeb0babSchristos /* Relocations used by the Altera Nios II core.  */
5125fdeb0babSchristos   BFD_RELOC_NIOS2_S16,
5126fdeb0babSchristos   BFD_RELOC_NIOS2_U16,
5127fdeb0babSchristos   BFD_RELOC_NIOS2_CALL26,
5128fdeb0babSchristos   BFD_RELOC_NIOS2_IMM5,
5129fdeb0babSchristos   BFD_RELOC_NIOS2_CACHE_OPX,
5130fdeb0babSchristos   BFD_RELOC_NIOS2_IMM6,
5131fdeb0babSchristos   BFD_RELOC_NIOS2_IMM8,
5132fdeb0babSchristos   BFD_RELOC_NIOS2_HI16,
5133fdeb0babSchristos   BFD_RELOC_NIOS2_LO16,
5134fdeb0babSchristos   BFD_RELOC_NIOS2_HIADJ16,
5135fdeb0babSchristos   BFD_RELOC_NIOS2_GPREL,
5136fdeb0babSchristos   BFD_RELOC_NIOS2_UJMP,
5137fdeb0babSchristos   BFD_RELOC_NIOS2_CJMP,
5138fdeb0babSchristos   BFD_RELOC_NIOS2_CALLR,
5139fdeb0babSchristos   BFD_RELOC_NIOS2_ALIGN,
5140fdeb0babSchristos   BFD_RELOC_NIOS2_GOT16,
5141fdeb0babSchristos   BFD_RELOC_NIOS2_CALL16,
5142fdeb0babSchristos   BFD_RELOC_NIOS2_GOTOFF_LO,
5143fdeb0babSchristos   BFD_RELOC_NIOS2_GOTOFF_HA,
5144fdeb0babSchristos   BFD_RELOC_NIOS2_PCREL_LO,
5145fdeb0babSchristos   BFD_RELOC_NIOS2_PCREL_HA,
5146fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_GD16,
5147fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_LDM16,
5148fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_LDO16,
5149fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_IE16,
5150fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_LE16,
5151fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_DTPMOD,
5152fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_DTPREL,
5153fdeb0babSchristos   BFD_RELOC_NIOS2_TLS_TPREL,
5154fdeb0babSchristos   BFD_RELOC_NIOS2_COPY,
5155fdeb0babSchristos   BFD_RELOC_NIOS2_GLOB_DAT,
5156fdeb0babSchristos   BFD_RELOC_NIOS2_JUMP_SLOT,
5157fdeb0babSchristos   BFD_RELOC_NIOS2_RELATIVE,
5158fdeb0babSchristos   BFD_RELOC_NIOS2_GOTOFF,
5159b511d482Schristos   BFD_RELOC_NIOS2_CALL26_NOAT,
5160b511d482Schristos   BFD_RELOC_NIOS2_GOT_LO,
5161b511d482Schristos   BFD_RELOC_NIOS2_GOT_HA,
5162b511d482Schristos   BFD_RELOC_NIOS2_CALL_LO,
5163b511d482Schristos   BFD_RELOC_NIOS2_CALL_HA,
5164e8beca2cSchristos   BFD_RELOC_NIOS2_R2_S12,
5165e8beca2cSchristos   BFD_RELOC_NIOS2_R2_I10_1_PCREL,
5166e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T1I7_1_PCREL,
5167e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T1I7_2,
5168e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T2I4,
5169e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T2I4_1,
5170e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T2I4_2,
5171e8beca2cSchristos   BFD_RELOC_NIOS2_R2_X1I7_2,
5172e8beca2cSchristos   BFD_RELOC_NIOS2_R2_X2L5,
5173e8beca2cSchristos   BFD_RELOC_NIOS2_R2_F1I5_2,
5174e8beca2cSchristos   BFD_RELOC_NIOS2_R2_L5I4X1,
5175e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T1X1I6,
5176e8beca2cSchristos   BFD_RELOC_NIOS2_R2_T1X1I6_2,
5177fdeb0babSchristos 
51789bc6a05dSchristos /* PRU LDI 16-bit unsigned data-memory relocation.  */
51799bc6a05dSchristos   BFD_RELOC_PRU_U16,
51809bc6a05dSchristos 
51819bc6a05dSchristos /* PRU LDI 16-bit unsigned instruction-memory relocation.  */
51829bc6a05dSchristos   BFD_RELOC_PRU_U16_PMEMIMM,
51839bc6a05dSchristos 
51849bc6a05dSchristos /* PRU relocation for two consecutive LDI load instructions that load a
51859bc6a05dSchristos 32 bit value into a register. If the higher bits are all zero, then
51869bc6a05dSchristos the second instruction may be relaxed.  */
51879bc6a05dSchristos   BFD_RELOC_PRU_LDI32,
51889bc6a05dSchristos 
51899bc6a05dSchristos /* PRU QBBx 10-bit signed PC-relative relocation.  */
51909bc6a05dSchristos   BFD_RELOC_PRU_S10_PCREL,
51919bc6a05dSchristos 
51929bc6a05dSchristos /* PRU 8-bit unsigned relocation used for the LOOP instruction.  */
51939bc6a05dSchristos   BFD_RELOC_PRU_U8_PCREL,
51949bc6a05dSchristos 
51959bc6a05dSchristos /* PRU Program Memory relocations.  Used to convert from byte addressing to
51969bc6a05dSchristos 32-bit word addressing.  */
51979bc6a05dSchristos   BFD_RELOC_PRU_32_PMEM,
51989bc6a05dSchristos   BFD_RELOC_PRU_16_PMEM,
51999bc6a05dSchristos 
52009bc6a05dSchristos /* PRU relocations to mark the difference of two local symbols.
52019bc6a05dSchristos These are only needed to support linker relaxation and can be ignored
52029bc6a05dSchristos when not relaxing.  The field is set to the value of the difference
52039bc6a05dSchristos assuming no relaxation.  The relocation encodes the position of the
52049bc6a05dSchristos second symbol so the linker can determine whether to adjust the field
52059bc6a05dSchristos value. The PMEM variants encode the word difference, instead of byte
52069bc6a05dSchristos difference between symbols.  */
52079bc6a05dSchristos   BFD_RELOC_PRU_GNU_DIFF8,
52089bc6a05dSchristos   BFD_RELOC_PRU_GNU_DIFF16,
52099bc6a05dSchristos   BFD_RELOC_PRU_GNU_DIFF32,
52109bc6a05dSchristos   BFD_RELOC_PRU_GNU_DIFF16_PMEM,
52119bc6a05dSchristos   BFD_RELOC_PRU_GNU_DIFF32_PMEM,
52129bc6a05dSchristos 
5213c63b39d6Schristos /* IQ2000 Relocations.  */
5214c63b39d6Schristos   BFD_RELOC_IQ2000_OFFSET_16,
5215c63b39d6Schristos   BFD_RELOC_IQ2000_OFFSET_21,
5216c63b39d6Schristos   BFD_RELOC_IQ2000_UHI16,
5217c63b39d6Schristos 
5218c63b39d6Schristos /* Special Xtensa relocation used only by PLT entries in ELF shared
5219c63b39d6Schristos objects to indicate that the runtime linker should set the value
5220c63b39d6Schristos to one of its own internal functions or data structures.  */
5221c63b39d6Schristos   BFD_RELOC_XTENSA_RTLD,
5222c63b39d6Schristos 
5223c63b39d6Schristos /* Xtensa relocations for ELF shared objects.  */
5224c63b39d6Schristos   BFD_RELOC_XTENSA_GLOB_DAT,
5225c63b39d6Schristos   BFD_RELOC_XTENSA_JMP_SLOT,
5226c63b39d6Schristos   BFD_RELOC_XTENSA_RELATIVE,
5227c63b39d6Schristos 
5228c63b39d6Schristos /* Xtensa relocation used in ELF object files for symbols that may require
5229c63b39d6Schristos PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
5230c63b39d6Schristos   BFD_RELOC_XTENSA_PLT,
5231c63b39d6Schristos 
5232*fd82c4c4Schristos /* Xtensa relocations for backward compatibility.  These have been replaced
5233*fd82c4c4Schristos by BFD_RELOC_XTENSA_PDIFF and BFD_RELOC_XTENSA_NDIFF.
5234*fd82c4c4Schristos Xtensa relocations to mark the difference of two local symbols.
5235c63b39d6Schristos These are only needed to support linker relaxation and can be ignored
5236c63b39d6Schristos when not relaxing.  The field is set to the value of the difference
5237c63b39d6Schristos assuming no relaxation.  The relocation encodes the position of the
5238c63b39d6Schristos first symbol so the linker can determine whether to adjust the field
5239c63b39d6Schristos value.  */
5240c63b39d6Schristos   BFD_RELOC_XTENSA_DIFF8,
5241c63b39d6Schristos   BFD_RELOC_XTENSA_DIFF16,
5242c63b39d6Schristos   BFD_RELOC_XTENSA_DIFF32,
5243c63b39d6Schristos 
5244c63b39d6Schristos /* Generic Xtensa relocations for instruction operands.  Only the slot
5245c63b39d6Schristos number is encoded in the relocation.  The relocation applies to the
5246c63b39d6Schristos last PC-relative immediate operand, or if there are no PC-relative
5247c63b39d6Schristos immediates, to the last immediate operand.  */
5248c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT0_OP,
5249c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT1_OP,
5250c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT2_OP,
5251c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT3_OP,
5252c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT4_OP,
5253c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT5_OP,
5254c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT6_OP,
5255c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT7_OP,
5256c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT8_OP,
5257c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT9_OP,
5258c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT10_OP,
5259c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT11_OP,
5260c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT12_OP,
5261c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT13_OP,
5262c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT14_OP,
5263c63b39d6Schristos 
5264c63b39d6Schristos /* Alternate Xtensa relocations.  Only the slot is encoded in the
5265c63b39d6Schristos relocation.  The meaning of these relocations is opcode-specific.  */
5266c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT0_ALT,
5267c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT1_ALT,
5268c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT2_ALT,
5269c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT3_ALT,
5270c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT4_ALT,
5271c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT5_ALT,
5272c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT6_ALT,
5273c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT7_ALT,
5274c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT8_ALT,
5275c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT9_ALT,
5276c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT10_ALT,
5277c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT11_ALT,
5278c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT12_ALT,
5279c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT13_ALT,
5280c63b39d6Schristos   BFD_RELOC_XTENSA_SLOT14_ALT,
5281c63b39d6Schristos 
5282c63b39d6Schristos /* Xtensa relocations for backward compatibility.  These have all been
5283c63b39d6Schristos replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
5284c63b39d6Schristos   BFD_RELOC_XTENSA_OP0,
5285c63b39d6Schristos   BFD_RELOC_XTENSA_OP1,
5286c63b39d6Schristos   BFD_RELOC_XTENSA_OP2,
5287c63b39d6Schristos 
5288c63b39d6Schristos /* Xtensa relocation to mark that the assembler expanded the
5289c63b39d6Schristos instructions from an original target.  The expansion size is
5290c63b39d6Schristos encoded in the reloc size.  */
5291c63b39d6Schristos   BFD_RELOC_XTENSA_ASM_EXPAND,
5292c63b39d6Schristos 
5293c63b39d6Schristos /* Xtensa relocation to mark that the linker should simplify
5294c63b39d6Schristos assembler-expanded instructions.  This is commonly used
5295c63b39d6Schristos internally by the linker after analysis of a
5296c63b39d6Schristos BFD_RELOC_XTENSA_ASM_EXPAND.  */
5297c63b39d6Schristos   BFD_RELOC_XTENSA_ASM_SIMPLIFY,
5298c63b39d6Schristos 
5299c63b39d6Schristos /* Xtensa TLS relocations.  */
5300c63b39d6Schristos   BFD_RELOC_XTENSA_TLSDESC_FN,
5301c63b39d6Schristos   BFD_RELOC_XTENSA_TLSDESC_ARG,
5302c63b39d6Schristos   BFD_RELOC_XTENSA_TLS_DTPOFF,
5303c63b39d6Schristos   BFD_RELOC_XTENSA_TLS_TPOFF,
5304c63b39d6Schristos   BFD_RELOC_XTENSA_TLS_FUNC,
5305c63b39d6Schristos   BFD_RELOC_XTENSA_TLS_ARG,
5306c63b39d6Schristos   BFD_RELOC_XTENSA_TLS_CALL,
5307c63b39d6Schristos 
5308*fd82c4c4Schristos /* Xtensa relocations to mark the difference of two local symbols.
5309*fd82c4c4Schristos These are only needed to support linker relaxation and can be ignored
5310*fd82c4c4Schristos when not relaxing.  The field is set to the value of the difference
5311*fd82c4c4Schristos assuming no relaxation.  The relocation encodes the position of the
5312*fd82c4c4Schristos subtracted symbol so the linker can determine whether to adjust the field
5313*fd82c4c4Schristos value.  PDIFF relocations are used for positive differences, NDIFF
5314*fd82c4c4Schristos relocations are used for negative differences.  The difference value
5315*fd82c4c4Schristos is treated as unsigned with these relocation types, giving full
5316*fd82c4c4Schristos 8/16 value ranges.  */
5317*fd82c4c4Schristos   BFD_RELOC_XTENSA_PDIFF8,
5318*fd82c4c4Schristos   BFD_RELOC_XTENSA_PDIFF16,
5319*fd82c4c4Schristos   BFD_RELOC_XTENSA_PDIFF32,
5320*fd82c4c4Schristos   BFD_RELOC_XTENSA_NDIFF8,
5321*fd82c4c4Schristos   BFD_RELOC_XTENSA_NDIFF16,
5322*fd82c4c4Schristos   BFD_RELOC_XTENSA_NDIFF32,
5323*fd82c4c4Schristos 
5324c63b39d6Schristos /* 8 bit signed offset in (ix+d) or (iy+d).  */
5325c63b39d6Schristos   BFD_RELOC_Z80_DISP8,
5326c63b39d6Schristos 
5327*fd82c4c4Schristos /* First 8 bits of multibyte (32, 24 or 16 bit) value.  */
5328*fd82c4c4Schristos   BFD_RELOC_Z80_BYTE0,
5329*fd82c4c4Schristos 
5330*fd82c4c4Schristos /* Second 8 bits of multibyte (32, 24 or 16 bit) value.  */
5331*fd82c4c4Schristos   BFD_RELOC_Z80_BYTE1,
5332*fd82c4c4Schristos 
5333*fd82c4c4Schristos /* Third 8 bits of multibyte (32 or 24 bit) value.  */
5334*fd82c4c4Schristos   BFD_RELOC_Z80_BYTE2,
5335*fd82c4c4Schristos 
5336*fd82c4c4Schristos /* Fourth 8 bits of multibyte (32 bit) value.  */
5337*fd82c4c4Schristos   BFD_RELOC_Z80_BYTE3,
5338*fd82c4c4Schristos 
5339*fd82c4c4Schristos /* Lowest 16 bits of multibyte (32 or 24 bit) value.  */
5340*fd82c4c4Schristos   BFD_RELOC_Z80_WORD0,
5341*fd82c4c4Schristos 
5342*fd82c4c4Schristos /* Highest 16 bits of multibyte (32 or 24 bit) value.  */
5343*fd82c4c4Schristos   BFD_RELOC_Z80_WORD1,
5344*fd82c4c4Schristos 
5345*fd82c4c4Schristos /* Like BFD_RELOC_16 but big-endian.  */
5346*fd82c4c4Schristos   BFD_RELOC_Z80_16_BE,
5347*fd82c4c4Schristos 
5348c63b39d6Schristos /* DJNZ offset.  */
5349c63b39d6Schristos   BFD_RELOC_Z8K_DISP7,
5350c63b39d6Schristos 
5351c63b39d6Schristos /* CALR offset.  */
5352c63b39d6Schristos   BFD_RELOC_Z8K_CALLR,
5353c63b39d6Schristos 
5354c63b39d6Schristos /* 4 bit value.  */
5355c63b39d6Schristos   BFD_RELOC_Z8K_IMM4L,
5356c63b39d6Schristos 
5357c63b39d6Schristos /* Lattice Mico32 relocations.  */
5358c63b39d6Schristos   BFD_RELOC_LM32_CALL,
5359c63b39d6Schristos   BFD_RELOC_LM32_BRANCH,
5360c63b39d6Schristos   BFD_RELOC_LM32_16_GOT,
5361c63b39d6Schristos   BFD_RELOC_LM32_GOTOFF_HI16,
5362c63b39d6Schristos   BFD_RELOC_LM32_GOTOFF_LO16,
5363c63b39d6Schristos   BFD_RELOC_LM32_COPY,
5364c63b39d6Schristos   BFD_RELOC_LM32_GLOB_DAT,
5365c63b39d6Schristos   BFD_RELOC_LM32_JMP_SLOT,
5366c63b39d6Schristos   BFD_RELOC_LM32_RELATIVE,
5367c63b39d6Schristos 
5368c63b39d6Schristos /* Difference between two section addreses.  Must be followed by a
5369c63b39d6Schristos BFD_RELOC_MACH_O_PAIR.  */
5370c63b39d6Schristos   BFD_RELOC_MACH_O_SECTDIFF,
5371c63b39d6Schristos 
5372fdeb0babSchristos /* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol.  */
5373fdeb0babSchristos   BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5374fdeb0babSchristos 
5375c63b39d6Schristos /* Pair of relocation.  Contains the first symbol.  */
5376c63b39d6Schristos   BFD_RELOC_MACH_O_PAIR,
5377c63b39d6Schristos 
5378a636ddcaSmrg /* Symbol will be substracted.  Must be followed by a BFD_RELOC_32.  */
5379a636ddcaSmrg   BFD_RELOC_MACH_O_SUBTRACTOR32,
5380a636ddcaSmrg 
5381a636ddcaSmrg /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
5382a636ddcaSmrg   BFD_RELOC_MACH_O_SUBTRACTOR64,
5383a636ddcaSmrg 
5384c63b39d6Schristos /* PCREL relocations.  They are marked as branch to create PLT entry if
5385c63b39d6Schristos required.  */
5386c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_BRANCH32,
5387c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_BRANCH8,
5388c63b39d6Schristos 
5389c63b39d6Schristos /* Used when referencing a GOT entry.  */
5390c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_GOT,
5391c63b39d6Schristos 
5392c63b39d6Schristos /* Used when loading a GOT entry with movq.  It is specially marked so that
5393c63b39d6Schristos the linker could optimize the movq to a leaq if possible.  */
5394c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
5395c63b39d6Schristos 
5396c63b39d6Schristos /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend.  */
5397c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_PCREL32_1,
5398c63b39d6Schristos 
5399c63b39d6Schristos /* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend.  */
5400c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_PCREL32_2,
5401c63b39d6Schristos 
5402c63b39d6Schristos /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend.  */
5403c63b39d6Schristos   BFD_RELOC_MACH_O_X86_64_PCREL32_4,
5404c63b39d6Schristos 
540577cd98dfSchristos /* Used when referencing a TLV entry.  */
540677cd98dfSchristos   BFD_RELOC_MACH_O_X86_64_TLV,
540777cd98dfSchristos 
5408a636ddcaSmrg /* Addend for PAGE or PAGEOFF.  */
5409a636ddcaSmrg   BFD_RELOC_MACH_O_ARM64_ADDEND,
5410a636ddcaSmrg 
5411a636ddcaSmrg /* Relative offset to page of GOT slot.  */
5412a636ddcaSmrg   BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21,
5413a636ddcaSmrg 
5414a636ddcaSmrg /* Relative offset within page of GOT slot.  */
5415a636ddcaSmrg   BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12,
5416a636ddcaSmrg 
5417a636ddcaSmrg /* Address of a GOT entry.  */
5418a636ddcaSmrg   BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT,
5419a636ddcaSmrg 
5420c63b39d6Schristos /* This is a 32 bit reloc for the microblaze that stores the
5421c63b39d6Schristos low 16 bits of a value  */
5422c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_LO,
5423c63b39d6Schristos 
5424c63b39d6Schristos /* This is a 32 bit pc-relative reloc for the microblaze that
5425c63b39d6Schristos stores the low 16 bits of a value  */
5426c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_LO_PCREL,
5427c63b39d6Schristos 
5428c63b39d6Schristos /* This is a 32 bit reloc for the microblaze that stores a
5429c63b39d6Schristos value relative to the read-only small data area anchor  */
5430c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_ROSDA,
5431c63b39d6Schristos 
5432c63b39d6Schristos /* This is a 32 bit reloc for the microblaze that stores a
5433c63b39d6Schristos value relative to the read-write small data area anchor  */
5434c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_RWSDA,
5435c63b39d6Schristos 
5436c63b39d6Schristos /* This is a 32 bit reloc for the microblaze to handle
5437c63b39d6Schristos expressions of the form "Symbol Op Symbol"  */
5438c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
5439c63b39d6Schristos 
5440c63b39d6Schristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5441c63b39d6Schristos value in two words (with an imm instruction).  No relocation is
5442c63b39d6Schristos done here - only used for relaxing  */
5443c63b39d6Schristos   BFD_RELOC_MICROBLAZE_64_NONE,
5444c63b39d6Schristos 
5445c63b39d6Schristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5446c63b39d6Schristos value in two words (with an imm instruction).  The relocation is
5447c63b39d6Schristos PC-relative GOT offset  */
5448c63b39d6Schristos   BFD_RELOC_MICROBLAZE_64_GOTPC,
5449c63b39d6Schristos 
5450c63b39d6Schristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5451c63b39d6Schristos value in two words (with an imm instruction).  The relocation is
5452c63b39d6Schristos GOT offset  */
5453c63b39d6Schristos   BFD_RELOC_MICROBLAZE_64_GOT,
5454c63b39d6Schristos 
5455c63b39d6Schristos /* This is a 64 bit reloc that stores the 32 bit pc relative
5456c63b39d6Schristos value in two words (with an imm instruction).  The relocation is
5457c63b39d6Schristos PC-relative offset into PLT  */
5458c63b39d6Schristos   BFD_RELOC_MICROBLAZE_64_PLT,
5459c63b39d6Schristos 
5460c63b39d6Schristos /* This is a 64 bit reloc that stores the 32 bit GOT relative
5461c63b39d6Schristos value in two words (with an imm instruction).  The relocation is
5462c63b39d6Schristos relative offset from _GLOBAL_OFFSET_TABLE_  */
5463c63b39d6Schristos   BFD_RELOC_MICROBLAZE_64_GOTOFF,
5464c63b39d6Schristos 
5465c63b39d6Schristos /* This is a 32 bit reloc that stores the 32 bit GOT relative
5466c63b39d6Schristos value in a word.  The relocation is relative offset from  */
5467c63b39d6Schristos   BFD_RELOC_MICROBLAZE_32_GOTOFF,
5468c63b39d6Schristos 
5469c63b39d6Schristos /* This is used to tell the dynamic linker to copy the value out of
5470c63b39d6Schristos the dynamic object into the runtime process image.  */
5471c63b39d6Schristos   BFD_RELOC_MICROBLAZE_COPY,
5472fdeb0babSchristos 
5473fdeb0babSchristos /* Unused Reloc  */
5474fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLS,
5475fdeb0babSchristos 
5476fdeb0babSchristos /* This is a 64 bit reloc that stores the 32 bit GOT relative value
5477fdeb0babSchristos of the GOT TLS GD info entry in two words (with an imm instruction). The
5478fdeb0babSchristos relocation is GOT offset.  */
5479fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLSGD,
5480fdeb0babSchristos 
5481fdeb0babSchristos /* This is a 64 bit reloc that stores the 32 bit GOT relative value
5482fdeb0babSchristos of the GOT TLS LD info entry in two words (with an imm instruction). The
5483fdeb0babSchristos relocation is GOT offset.  */
5484fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLSLD,
5485fdeb0babSchristos 
5486fdeb0babSchristos /* This is a 32 bit reloc that stores the Module ID to GOT(n).  */
5487fdeb0babSchristos   BFD_RELOC_MICROBLAZE_32_TLSDTPMOD,
5488fdeb0babSchristos 
5489fdeb0babSchristos /* This is a 32 bit reloc that stores TLS offset to GOT(n+1).  */
5490fdeb0babSchristos   BFD_RELOC_MICROBLAZE_32_TLSDTPREL,
5491fdeb0babSchristos 
5492fdeb0babSchristos /* This is a 32 bit reloc for storing TLS offset to two words (uses imm
5493fdeb0babSchristos instruction)  */
5494fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLSDTPREL,
5495fdeb0babSchristos 
5496fdeb0babSchristos /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5497fdeb0babSchristos to two words (uses imm instruction).  */
5498fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL,
5499fdeb0babSchristos 
5500fdeb0babSchristos /* This is a 64 bit reloc that stores 32-bit thread pointer relative offset
5501fdeb0babSchristos to two words (uses imm instruction).  */
5502fdeb0babSchristos   BFD_RELOC_MICROBLAZE_64_TLSTPREL,
5503fdeb0babSchristos 
550477cd98dfSchristos /* This is a 64 bit reloc that stores the 32 bit pc relative
550577cd98dfSchristos value in two words (with an imm instruction).  The relocation is
550677cd98dfSchristos PC-relative offset from start of TEXT.  */
550777cd98dfSchristos   BFD_RELOC_MICROBLAZE_64_TEXTPCREL,
550877cd98dfSchristos 
550977cd98dfSchristos /* This is a 64 bit reloc that stores the 32 bit offset
551077cd98dfSchristos value in two words (with an imm instruction).  The relocation is
551177cd98dfSchristos relative offset from start of TEXT.  */
551277cd98dfSchristos   BFD_RELOC_MICROBLAZE_64_TEXTREL,
551377cd98dfSchristos 
551444a21023Schristos /* AArch64 pseudo relocation code to mark the start of the AArch64
551544a21023Schristos relocation enumerators.  N.B. the order of the enumerators is
551644a21023Schristos important as several tables in the AArch64 bfd backend are indexed
551744a21023Schristos by these enumerators; make sure they are all synced.  */
551844a21023Schristos   BFD_RELOC_AARCH64_RELOC_START,
5519fdeb0babSchristos 
5520a636ddcaSmrg /* Deprecated AArch64 null relocation code.  */
5521a636ddcaSmrg   BFD_RELOC_AARCH64_NULL,
5522a636ddcaSmrg 
552344a21023Schristos /* AArch64 null relocation code.  */
552444a21023Schristos   BFD_RELOC_AARCH64_NONE,
5525fdeb0babSchristos 
552644a21023Schristos /* Basic absolute relocations of N bits.  These are equivalent to
552744a21023Schristos BFD_RELOC_N and they were added to assist the indexing of the howto
552844a21023Schristos table.  */
552944a21023Schristos   BFD_RELOC_AARCH64_64,
553044a21023Schristos   BFD_RELOC_AARCH64_32,
553144a21023Schristos   BFD_RELOC_AARCH64_16,
553244a21023Schristos 
553344a21023Schristos /* PC-relative relocations.  These are equivalent to BFD_RELOC_N_PCREL
553444a21023Schristos and they were added to assist the indexing of the howto table.  */
553544a21023Schristos   BFD_RELOC_AARCH64_64_PCREL,
553644a21023Schristos   BFD_RELOC_AARCH64_32_PCREL,
553744a21023Schristos   BFD_RELOC_AARCH64_16_PCREL,
553844a21023Schristos 
553944a21023Schristos /* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
554044a21023Schristos of an unsigned address/value.  */
554144a21023Schristos   BFD_RELOC_AARCH64_MOVW_G0,
554244a21023Schristos 
554344a21023Schristos /* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
554444a21023Schristos an address/value.  No overflow checking.  */
554544a21023Schristos   BFD_RELOC_AARCH64_MOVW_G0_NC,
554644a21023Schristos 
554744a21023Schristos /* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
554844a21023Schristos of an unsigned address/value.  */
554944a21023Schristos   BFD_RELOC_AARCH64_MOVW_G1,
555044a21023Schristos 
555144a21023Schristos /* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
555244a21023Schristos of an address/value.  No overflow checking.  */
555344a21023Schristos   BFD_RELOC_AARCH64_MOVW_G1_NC,
555444a21023Schristos 
555544a21023Schristos /* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
555644a21023Schristos of an unsigned address/value.  */
555744a21023Schristos   BFD_RELOC_AARCH64_MOVW_G2,
555844a21023Schristos 
555944a21023Schristos /* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
556044a21023Schristos of an address/value.  No overflow checking.  */
556144a21023Schristos   BFD_RELOC_AARCH64_MOVW_G2_NC,
556244a21023Schristos 
556344a21023Schristos /* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
556444a21023Schristos of a signed or unsigned address/value.  */
556544a21023Schristos   BFD_RELOC_AARCH64_MOVW_G3,
556644a21023Schristos 
556744a21023Schristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
556844a21023Schristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
556944a21023Schristos value's sign.  */
557044a21023Schristos   BFD_RELOC_AARCH64_MOVW_G0_S,
557144a21023Schristos 
557244a21023Schristos /* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
557344a21023Schristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
557444a21023Schristos value's sign.  */
557544a21023Schristos   BFD_RELOC_AARCH64_MOVW_G1_S,
557644a21023Schristos 
557744a21023Schristos /* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
557844a21023Schristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
557944a21023Schristos value's sign.  */
558044a21023Schristos   BFD_RELOC_AARCH64_MOVW_G2_S,
558144a21023Schristos 
558277cd98dfSchristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
558377cd98dfSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
558477cd98dfSchristos value's sign.  */
558577cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G0,
558677cd98dfSchristos 
558777cd98dfSchristos /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
558877cd98dfSchristos of a signed value.  Changes instruction to MOVZ or MOVN depending on the
558977cd98dfSchristos value's sign.  */
559077cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
559177cd98dfSchristos 
559277cd98dfSchristos /* AArch64 MOVK instruction with most significant bits 16 to 31
559377cd98dfSchristos of a signed value.  */
559477cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G1,
559577cd98dfSchristos 
559677cd98dfSchristos /* AArch64 MOVK instruction with most significant bits 16 to 31
559777cd98dfSchristos of a signed value.  */
559877cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
559977cd98dfSchristos 
560077cd98dfSchristos /* AArch64 MOVK instruction with most significant bits 32 to 47
560177cd98dfSchristos of a signed value.  */
560277cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G2,
560377cd98dfSchristos 
560477cd98dfSchristos /* AArch64 MOVK instruction with most significant bits 32 to 47
560577cd98dfSchristos of a signed value.  */
560677cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
560777cd98dfSchristos 
560877cd98dfSchristos /* AArch64 MOVK instruction with most significant bits 47 to 63
560977cd98dfSchristos of a signed value.  */
561077cd98dfSchristos   BFD_RELOC_AARCH64_MOVW_PREL_G3,
561177cd98dfSchristos 
561244a21023Schristos /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
561344a21023Schristos offset.  The lowest two bits must be zero and are not stored in the
561444a21023Schristos instruction, giving a 21 bit signed byte offset.  */
561544a21023Schristos   BFD_RELOC_AARCH64_LD_LO19_PCREL,
561644a21023Schristos 
561744a21023Schristos /* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset.  */
561844a21023Schristos   BFD_RELOC_AARCH64_ADR_LO21_PCREL,
5619fdeb0babSchristos 
5620fdeb0babSchristos /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5621fdeb0babSchristos offset, giving a 4KB aligned page base address.  */
5622fdeb0babSchristos   BFD_RELOC_AARCH64_ADR_HI21_PCREL,
5623fdeb0babSchristos 
5624fdeb0babSchristos /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5625fdeb0babSchristos offset, giving a 4KB aligned page base address, but with no overflow
5626fdeb0babSchristos checking.  */
5627fdeb0babSchristos   BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
5628fdeb0babSchristos 
562944a21023Schristos /* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
563044a21023Schristos Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
563144a21023Schristos   BFD_RELOC_AARCH64_ADD_LO12,
563244a21023Schristos 
563344a21023Schristos /* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
563444a21023Schristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
563544a21023Schristos   BFD_RELOC_AARCH64_LDST8_LO12,
563644a21023Schristos 
563744a21023Schristos /* AArch64 14 bit pc-relative test bit and branch.
563844a21023Schristos The lowest two bits must be zero and are not stored in the instruction,
563944a21023Schristos giving a 16 bit signed byte offset.  */
564044a21023Schristos   BFD_RELOC_AARCH64_TSTBR14,
5641fdeb0babSchristos 
5642fdeb0babSchristos /* AArch64 19 bit pc-relative conditional branch and compare & branch.
5643fdeb0babSchristos The lowest two bits must be zero and are not stored in the instruction,
5644fdeb0babSchristos giving a 21 bit signed byte offset.  */
5645fdeb0babSchristos   BFD_RELOC_AARCH64_BRANCH19,
5646fdeb0babSchristos 
5647fdeb0babSchristos /* AArch64 26 bit pc-relative unconditional branch.
5648fdeb0babSchristos The lowest two bits must be zero and are not stored in the instruction,
5649fdeb0babSchristos giving a 28 bit signed byte offset.  */
5650fdeb0babSchristos   BFD_RELOC_AARCH64_JUMP26,
5651fdeb0babSchristos 
565244a21023Schristos /* AArch64 26 bit pc-relative unconditional branch and link.
565344a21023Schristos The lowest two bits must be zero and are not stored in the instruction,
565444a21023Schristos giving a 28 bit signed byte offset.  */
565544a21023Schristos   BFD_RELOC_AARCH64_CALL26,
5656fdeb0babSchristos 
5657fdeb0babSchristos /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
5658fdeb0babSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5659fdeb0babSchristos   BFD_RELOC_AARCH64_LDST16_LO12,
5660fdeb0babSchristos 
5661fdeb0babSchristos /* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
5662fdeb0babSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5663fdeb0babSchristos   BFD_RELOC_AARCH64_LDST32_LO12,
5664fdeb0babSchristos 
5665fdeb0babSchristos /* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
5666fdeb0babSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5667fdeb0babSchristos   BFD_RELOC_AARCH64_LDST64_LO12,
5668fdeb0babSchristos 
5669fdeb0babSchristos /* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
5670fdeb0babSchristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5671fdeb0babSchristos   BFD_RELOC_AARCH64_LDST128_LO12,
5672fdeb0babSchristos 
567344a21023Schristos /* AArch64 Load Literal instruction, holding a 19 bit PC relative word
567444a21023Schristos offset of the global offset table entry for a symbol.  The lowest two
567544a21023Schristos bits must be zero and are not stored in the instruction, giving a 21
567644a21023Schristos bit signed byte offset.  This relocation type requires signed overflow
567744a21023Schristos checking.  */
567844a21023Schristos   BFD_RELOC_AARCH64_GOT_LD_PREL19,
5679fdeb0babSchristos 
568044a21023Schristos /* Get to the page base of the global offset table entry for a symbol as
568144a21023Schristos part of an ADRP instruction using a 21 bit PC relative value.Used in
568244a21023Schristos conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC.  */
568344a21023Schristos   BFD_RELOC_AARCH64_ADR_GOT_PAGE,
5684fdeb0babSchristos 
568544a21023Schristos /* Unsigned 12 bit byte offset for 64 bit load/store from the page of
568644a21023Schristos the GOT entry for this symbol.  Used in conjunction with
568777cd98dfSchristos BFD_RELOC_AARCH64_ADR_GOT_PAGE.  Valid in LP64 ABI only.  */
568844a21023Schristos   BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
5689fdeb0babSchristos 
569044a21023Schristos /* Unsigned 12 bit byte offset for 32 bit load/store from the page of
569144a21023Schristos the GOT entry for this symbol.  Used in conjunction with
569277cd98dfSchristos BFD_RELOC_AARCH64_ADR_GOT_PAGE.  Valid in ILP32 ABI only.  */
569344a21023Schristos   BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
5694fdeb0babSchristos 
5695a636ddcaSmrg /* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry
5696a636ddcaSmrg for this symbol.  Valid in LP64 ABI only.  */
5697a636ddcaSmrg   BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
5698a636ddcaSmrg 
5699a636ddcaSmrg /* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry
5700a636ddcaSmrg for this symbol.  Valid in LP64 ABI only.  */
5701a636ddcaSmrg   BFD_RELOC_AARCH64_MOVW_GOTOFF_G1,
5702a636ddcaSmrg 
5703e8beca2cSchristos /* Unsigned 15 bit byte offset for 64 bit load/store from the page of
5704a636ddcaSmrg the GOT entry for this symbol.  Valid in LP64 ABI only.  */
5705e8beca2cSchristos   BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
5706e8beca2cSchristos 
5707e8beca2cSchristos /* Scaled 14 bit byte offset to the page base of the global offset table.  */
5708e8beca2cSchristos   BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14,
5709e8beca2cSchristos 
5710e8beca2cSchristos /* Scaled 15 bit byte offset to the page base of the global offset table.  */
5711e8beca2cSchristos   BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15,
5712e8beca2cSchristos 
5713fdeb0babSchristos /* Get to the page base of the global offset table entry for a symbols
5714fdeb0babSchristos tls_index structure as part of an adrp instruction using a 21 bit PC
5715fdeb0babSchristos relative value.  Used in conjunction with
5716fdeb0babSchristos BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC.  */
5717fdeb0babSchristos   BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
5718fdeb0babSchristos 
5719e8beca2cSchristos /* AArch64 TLS General Dynamic  */
5720e8beca2cSchristos   BFD_RELOC_AARCH64_TLSGD_ADR_PREL21,
5721e8beca2cSchristos 
572244a21023Schristos /* Unsigned 12 bit byte offset to global offset table entry for a symbols
572344a21023Schristos tls_index structure.  Used in conjunction with
572444a21023Schristos BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
572544a21023Schristos   BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
5726fdeb0babSchristos 
5727a636ddcaSmrg /* AArch64 TLS General Dynamic relocation.  */
5728a636ddcaSmrg   BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC,
5729fdeb0babSchristos 
5730a636ddcaSmrg /* AArch64 TLS General Dynamic relocation.  */
5731a636ddcaSmrg   BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
5732fdeb0babSchristos 
5733fdeb0babSchristos /* AArch64 TLS INITIAL EXEC relocation.  */
573444a21023Schristos   BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
573544a21023Schristos 
573644a21023Schristos /* AArch64 TLS INITIAL EXEC relocation.  */
573744a21023Schristos   BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
573844a21023Schristos 
573944a21023Schristos /* AArch64 TLS INITIAL EXEC relocation.  */
574044a21023Schristos   BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC,
574144a21023Schristos 
574244a21023Schristos /* AArch64 TLS INITIAL EXEC relocation.  */
574344a21023Schristos   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
574444a21023Schristos 
5745a636ddcaSmrg /* AArch64 TLS INITIAL EXEC relocation.  */
5746a636ddcaSmrg   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
5747a636ddcaSmrg 
5748a636ddcaSmrg /* AArch64 TLS INITIAL EXEC relocation.  */
5749a636ddcaSmrg   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
5750a636ddcaSmrg 
5751a636ddcaSmrg /* bit[23:12] of byte offset to module TLS base address.  */
5752a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
5753a636ddcaSmrg 
5754a636ddcaSmrg /* Unsigned 12 bit byte offset to module TLS base address.  */
5755a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
5756a636ddcaSmrg 
5757a636ddcaSmrg /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.  */
5758a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
5759a636ddcaSmrg 
5760a636ddcaSmrg /* Unsigned 12 bit byte offset to global offset table entry for a symbols
5761a636ddcaSmrg tls_index structure.  Used in conjunction with
5762a636ddcaSmrg BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.  */
5763a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC,
5764a636ddcaSmrg 
5765a636ddcaSmrg /* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP
5766a636ddcaSmrg instruction.  */
5767a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21,
5768a636ddcaSmrg 
5769a636ddcaSmrg /* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction.  */
5770a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
5771a636ddcaSmrg 
5772a636ddcaSmrg /* bit[11:1] of byte offset to module TLS base address, encoded in ldst
5773a636ddcaSmrg instructions.  */
5774a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
5775a636ddcaSmrg 
5776a636ddcaSmrg /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check.  */
5777a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
5778a636ddcaSmrg 
5779a636ddcaSmrg /* bit[11:2] of byte offset to module TLS base address, encoded in ldst
5780a636ddcaSmrg instructions.  */
5781a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
5782a636ddcaSmrg 
5783a636ddcaSmrg /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check.  */
5784a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
5785a636ddcaSmrg 
5786a636ddcaSmrg /* bit[11:3] of byte offset to module TLS base address, encoded in ldst
5787a636ddcaSmrg instructions.  */
5788a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
5789a636ddcaSmrg 
5790a636ddcaSmrg /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check.  */
5791a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
5792a636ddcaSmrg 
5793a636ddcaSmrg /* bit[11:0] of byte offset to module TLS base address, encoded in ldst
5794a636ddcaSmrg instructions.  */
5795a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
5796a636ddcaSmrg 
5797a636ddcaSmrg /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check.  */
5798a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
5799a636ddcaSmrg 
5800a636ddcaSmrg /* bit[15:0] of byte offset to module TLS base address.  */
5801a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
5802a636ddcaSmrg 
5803a636ddcaSmrg /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0  */
5804a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
5805a636ddcaSmrg 
5806a636ddcaSmrg /* bit[31:16] of byte offset to module TLS base address.  */
5807a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
5808a636ddcaSmrg 
5809a636ddcaSmrg /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1  */
5810a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
5811a636ddcaSmrg 
5812a636ddcaSmrg /* bit[47:32] of byte offset to module TLS base address.  */
5813a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
5814a636ddcaSmrg 
581544a21023Schristos /* AArch64 TLS LOCAL EXEC relocation.  */
581644a21023Schristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
581744a21023Schristos 
581844a21023Schristos /* AArch64 TLS LOCAL EXEC relocation.  */
581944a21023Schristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
582044a21023Schristos 
582144a21023Schristos /* AArch64 TLS LOCAL EXEC relocation.  */
582244a21023Schristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
582344a21023Schristos 
582444a21023Schristos /* AArch64 TLS LOCAL EXEC relocation.  */
582544a21023Schristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
582644a21023Schristos 
582744a21023Schristos /* AArch64 TLS LOCAL EXEC relocation.  */
582844a21023Schristos   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
5829fdeb0babSchristos 
5830fdeb0babSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5831fdeb0babSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
5832fdeb0babSchristos 
5833fdeb0babSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5834fdeb0babSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
5835fdeb0babSchristos 
5836fdeb0babSchristos /* AArch64 TLS LOCAL EXEC relocation.  */
5837fdeb0babSchristos   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
5838fdeb0babSchristos 
583977cd98dfSchristos /* bit[11:1] of byte offset to module TLS base address, encoded in ldst
584077cd98dfSchristos instructions.  */
584177cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
584277cd98dfSchristos 
584377cd98dfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check.  */
584477cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
584577cd98dfSchristos 
584677cd98dfSchristos /* bit[11:2] of byte offset to module TLS base address, encoded in ldst
584777cd98dfSchristos instructions.  */
584877cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
584977cd98dfSchristos 
585077cd98dfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check.  */
585177cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
585277cd98dfSchristos 
585377cd98dfSchristos /* bit[11:3] of byte offset to module TLS base address, encoded in ldst
585477cd98dfSchristos instructions.  */
585577cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
585677cd98dfSchristos 
585777cd98dfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check.  */
585877cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
585977cd98dfSchristos 
586077cd98dfSchristos /* bit[11:0] of byte offset to module TLS base address, encoded in ldst
586177cd98dfSchristos instructions.  */
586277cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
586377cd98dfSchristos 
586477cd98dfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check.  */
586577cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,
586677cd98dfSchristos 
586744a21023Schristos /* AArch64 TLS DESC relocation.  */
586844a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
5869fdeb0babSchristos 
587044a21023Schristos /* AArch64 TLS DESC relocation.  */
587144a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
5872fdeb0babSchristos 
587344a21023Schristos /* AArch64 TLS DESC relocation.  */
587444a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
5875fdeb0babSchristos 
587644a21023Schristos /* AArch64 TLS DESC relocation.  */
58779bc6a05dSchristos   BFD_RELOC_AARCH64_TLSDESC_LD64_LO12,
5878fdeb0babSchristos 
587944a21023Schristos /* AArch64 TLS DESC relocation.  */
588044a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC,
588144a21023Schristos 
588244a21023Schristos /* AArch64 TLS DESC relocation.  */
58839bc6a05dSchristos   BFD_RELOC_AARCH64_TLSDESC_ADD_LO12,
588444a21023Schristos 
588544a21023Schristos /* AArch64 TLS DESC relocation.  */
588644a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
588744a21023Schristos 
588844a21023Schristos /* AArch64 TLS DESC relocation.  */
588944a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
589044a21023Schristos 
589144a21023Schristos /* AArch64 TLS DESC relocation.  */
589244a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_LDR,
589344a21023Schristos 
589444a21023Schristos /* AArch64 TLS DESC relocation.  */
589544a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_ADD,
589644a21023Schristos 
589744a21023Schristos /* AArch64 TLS DESC relocation.  */
589844a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_CALL,
5899fdeb0babSchristos 
5900fdeb0babSchristos /* AArch64 TLS relocation.  */
590144a21023Schristos   BFD_RELOC_AARCH64_COPY,
5902fdeb0babSchristos 
5903fdeb0babSchristos /* AArch64 TLS relocation.  */
590444a21023Schristos   BFD_RELOC_AARCH64_GLOB_DAT,
5905fdeb0babSchristos 
5906fdeb0babSchristos /* AArch64 TLS relocation.  */
590744a21023Schristos   BFD_RELOC_AARCH64_JUMP_SLOT,
5908fdeb0babSchristos 
590944a21023Schristos /* AArch64 TLS relocation.  */
591044a21023Schristos   BFD_RELOC_AARCH64_RELATIVE,
591144a21023Schristos 
591244a21023Schristos /* AArch64 TLS relocation.  */
591344a21023Schristos   BFD_RELOC_AARCH64_TLS_DTPMOD,
591444a21023Schristos 
591544a21023Schristos /* AArch64 TLS relocation.  */
591644a21023Schristos   BFD_RELOC_AARCH64_TLS_DTPREL,
591744a21023Schristos 
591844a21023Schristos /* AArch64 TLS relocation.  */
591944a21023Schristos   BFD_RELOC_AARCH64_TLS_TPREL,
592044a21023Schristos 
592144a21023Schristos /* AArch64 TLS relocation.  */
592244a21023Schristos   BFD_RELOC_AARCH64_TLSDESC,
592344a21023Schristos 
592444a21023Schristos /* AArch64 support for STT_GNU_IFUNC.  */
592544a21023Schristos   BFD_RELOC_AARCH64_IRELATIVE,
592644a21023Schristos 
592744a21023Schristos /* AArch64 pseudo relocation code to mark the end of the AArch64
592844a21023Schristos relocation enumerators that have direct mapping to ELF reloc codes.
592944a21023Schristos There are a few more enumerators after this one; those are mainly
593044a21023Schristos used by the AArch64 assembler for the internal fixup or to select
593144a21023Schristos one of the above enumerators.  */
593244a21023Schristos   BFD_RELOC_AARCH64_RELOC_END,
593344a21023Schristos 
593444a21023Schristos /* AArch64 pseudo relocation code to be used internally by the AArch64
593544a21023Schristos assembler and not (currently) written to any object files.  */
593644a21023Schristos   BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
593744a21023Schristos 
593844a21023Schristos /* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
593944a21023Schristos address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
594044a21023Schristos   BFD_RELOC_AARCH64_LDST_LO12,
594144a21023Schristos 
5942a636ddcaSmrg /* AArch64 pseudo relocation code for TLS local dynamic mode.  It's to be
5943a636ddcaSmrg used internally by the AArch64 assembler and not (currently) written to
5944a636ddcaSmrg any object files.  */
5945a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
5946a636ddcaSmrg 
5947a636ddcaSmrg /* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check.  */
5948a636ddcaSmrg   BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
5949a636ddcaSmrg 
595077cd98dfSchristos /* AArch64 pseudo relocation code for TLS local exec mode.  It's to be
595177cd98dfSchristos used internally by the AArch64 assembler and not (currently) written to
595277cd98dfSchristos any object files.  */
595377cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12,
595477cd98dfSchristos 
595577cd98dfSchristos /* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check.  */
595677cd98dfSchristos   BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
595777cd98dfSchristos 
595844a21023Schristos /* AArch64 pseudo relocation code to be used internally by the AArch64
595944a21023Schristos assembler and not (currently) written to any object files.  */
596044a21023Schristos   BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
596144a21023Schristos 
596244a21023Schristos /* AArch64 pseudo relocation code to be used internally by the AArch64
596344a21023Schristos assembler and not (currently) written to any object files.  */
596444a21023Schristos   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC,
596544a21023Schristos 
596644a21023Schristos /* AArch64 pseudo relocation code to be used internally by the AArch64
596744a21023Schristos assembler and not (currently) written to any object files.  */
596844a21023Schristos   BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC,
5969fdeb0babSchristos 
5970fdeb0babSchristos /* Tilera TILEPro Relocations.  */
5971fdeb0babSchristos   BFD_RELOC_TILEPRO_COPY,
5972fdeb0babSchristos   BFD_RELOC_TILEPRO_GLOB_DAT,
5973fdeb0babSchristos   BFD_RELOC_TILEPRO_JMP_SLOT,
5974fdeb0babSchristos   BFD_RELOC_TILEPRO_RELATIVE,
5975fdeb0babSchristos   BFD_RELOC_TILEPRO_BROFF_X1,
5976fdeb0babSchristos   BFD_RELOC_TILEPRO_JOFFLONG_X1,
5977fdeb0babSchristos   BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
5978fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_X0,
5979fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_Y0,
5980fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_X1,
5981fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_Y1,
5982fdeb0babSchristos   BFD_RELOC_TILEPRO_DEST_IMM8_X1,
5983fdeb0babSchristos   BFD_RELOC_TILEPRO_MT_IMM15_X1,
5984fdeb0babSchristos   BFD_RELOC_TILEPRO_MF_IMM15_X1,
5985fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0,
5986fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1,
5987fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_LO,
5988fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_LO,
5989fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HI,
5990fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HI,
5991fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HA,
5992fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HA,
5993fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
5994fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
5995fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
5996fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
5997fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
5998fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
5999fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
6000fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
6001fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT,
6002fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT,
6003fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
6004fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
6005fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
6006fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
6007fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
6008fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
6009fdeb0babSchristos   BFD_RELOC_TILEPRO_MMSTART_X0,
6010fdeb0babSchristos   BFD_RELOC_TILEPRO_MMEND_X0,
6011fdeb0babSchristos   BFD_RELOC_TILEPRO_MMSTART_X1,
6012fdeb0babSchristos   BFD_RELOC_TILEPRO_MMEND_X1,
6013fdeb0babSchristos   BFD_RELOC_TILEPRO_SHAMT_X0,
6014fdeb0babSchristos   BFD_RELOC_TILEPRO_SHAMT_X1,
6015fdeb0babSchristos   BFD_RELOC_TILEPRO_SHAMT_Y0,
6016fdeb0babSchristos   BFD_RELOC_TILEPRO_SHAMT_Y1,
6017fdeb0babSchristos   BFD_RELOC_TILEPRO_TLS_GD_CALL,
6018fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
6019fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
6020fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
6021fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
6022fdeb0babSchristos   BFD_RELOC_TILEPRO_TLS_IE_LOAD,
6023fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
6024fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
6025fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
6026fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
6027fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
6028fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
6029fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
6030fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
6031fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
6032fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
6033fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
6034fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
6035fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
6036fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
6037fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
6038fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
6039fdeb0babSchristos   BFD_RELOC_TILEPRO_TLS_DTPMOD32,
6040fdeb0babSchristos   BFD_RELOC_TILEPRO_TLS_DTPOFF32,
6041fdeb0babSchristos   BFD_RELOC_TILEPRO_TLS_TPOFF32,
6042fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
6043fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
6044fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
6045fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
6046fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
6047fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
6048fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
6049fdeb0babSchristos   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
6050fdeb0babSchristos 
6051fdeb0babSchristos /* Tilera TILE-Gx Relocations.  */
6052fdeb0babSchristos   BFD_RELOC_TILEGX_HW0,
6053fdeb0babSchristos   BFD_RELOC_TILEGX_HW1,
6054fdeb0babSchristos   BFD_RELOC_TILEGX_HW2,
6055fdeb0babSchristos   BFD_RELOC_TILEGX_HW3,
6056fdeb0babSchristos   BFD_RELOC_TILEGX_HW0_LAST,
6057fdeb0babSchristos   BFD_RELOC_TILEGX_HW1_LAST,
6058fdeb0babSchristos   BFD_RELOC_TILEGX_HW2_LAST,
6059fdeb0babSchristos   BFD_RELOC_TILEGX_COPY,
6060fdeb0babSchristos   BFD_RELOC_TILEGX_GLOB_DAT,
6061fdeb0babSchristos   BFD_RELOC_TILEGX_JMP_SLOT,
6062fdeb0babSchristos   BFD_RELOC_TILEGX_RELATIVE,
6063fdeb0babSchristos   BFD_RELOC_TILEGX_BROFF_X1,
6064fdeb0babSchristos   BFD_RELOC_TILEGX_JUMPOFF_X1,
6065fdeb0babSchristos   BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
6066fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X0,
6067fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y0,
6068fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X1,
6069fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y1,
6070fdeb0babSchristos   BFD_RELOC_TILEGX_DEST_IMM8_X1,
6071fdeb0babSchristos   BFD_RELOC_TILEGX_MT_IMM14_X1,
6072fdeb0babSchristos   BFD_RELOC_TILEGX_MF_IMM14_X1,
6073fdeb0babSchristos   BFD_RELOC_TILEGX_MMSTART_X0,
6074fdeb0babSchristos   BFD_RELOC_TILEGX_MMEND_X0,
6075fdeb0babSchristos   BFD_RELOC_TILEGX_SHAMT_X0,
6076fdeb0babSchristos   BFD_RELOC_TILEGX_SHAMT_X1,
6077fdeb0babSchristos   BFD_RELOC_TILEGX_SHAMT_Y0,
6078fdeb0babSchristos   BFD_RELOC_TILEGX_SHAMT_Y1,
6079fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0,
6080fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0,
6081fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1,
6082fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1,
6083fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2,
6084fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2,
6085fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3,
6086fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3,
6087fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
6088fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
6089fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
6090fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
6091fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
6092fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
6093fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
6094fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
6095fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
6096fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
6097fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
6098fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
6099fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
6100fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
6101fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
6102fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
6103fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
6104fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
6105fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
6106fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
6107fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
6108fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
6109fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL,
6110fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL,
6111fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL,
6112fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL,
6113fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL,
6114fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL,
6115fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
6116fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
6117fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
6118fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
6119fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL,
6120fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL,
6121fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
6122fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
6123fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
6124fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
6125fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
6126fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
6127fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
6128fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
6129fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
6130fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
6131fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
6132fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
6133fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
6134fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
6135fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL,
6136fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL,
6137fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL,
6138fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL,
6139fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL,
6140fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL,
6141fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
6142fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
6143fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
6144fdeb0babSchristos   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
6145fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_DTPMOD64,
6146fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_DTPOFF64,
6147fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_TPOFF64,
6148fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_DTPMOD32,
6149fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_DTPOFF32,
6150fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_TPOFF32,
6151fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_GD_CALL,
6152fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
6153fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
6154fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
6155fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
6156fdeb0babSchristos   BFD_RELOC_TILEGX_TLS_IE_LOAD,
6157fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
6158fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
6159fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
6160fdeb0babSchristos   BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
6161fdeb0babSchristos 
6162*fd82c4c4Schristos /* Linux eBPF relocations.  */
6163*fd82c4c4Schristos   BFD_RELOC_BPF_64,
6164*fd82c4c4Schristos   BFD_RELOC_BPF_32,
6165*fd82c4c4Schristos   BFD_RELOC_BPF_16,
6166*fd82c4c4Schristos   BFD_RELOC_BPF_DISP16,
6167*fd82c4c4Schristos   BFD_RELOC_BPF_DISP32,
6168*fd82c4c4Schristos 
6169fdeb0babSchristos /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement  */
6170fdeb0babSchristos   BFD_RELOC_EPIPHANY_SIMM8,
6171fdeb0babSchristos 
6172fdeb0babSchristos /* Adapteva EPIPHANY - 24 bit signed pc-relative displacement  */
6173fdeb0babSchristos   BFD_RELOC_EPIPHANY_SIMM24,
6174fdeb0babSchristos 
6175fdeb0babSchristos /* Adapteva EPIPHANY - 16 most-significant bits of absolute address  */
6176fdeb0babSchristos   BFD_RELOC_EPIPHANY_HIGH,
6177fdeb0babSchristos 
6178fdeb0babSchristos /* Adapteva EPIPHANY - 16 least-significant bits of absolute address  */
6179fdeb0babSchristos   BFD_RELOC_EPIPHANY_LOW,
6180fdeb0babSchristos 
6181fdeb0babSchristos /* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate  */
6182fdeb0babSchristos   BFD_RELOC_EPIPHANY_SIMM11,
6183fdeb0babSchristos 
6184fdeb0babSchristos /* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement)  */
6185fdeb0babSchristos   BFD_RELOC_EPIPHANY_IMM11,
6186fdeb0babSchristos 
6187fdeb0babSchristos /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction.  */
6188fdeb0babSchristos   BFD_RELOC_EPIPHANY_IMM8,
6189b511d482Schristos 
6190b511d482Schristos /* Visium Relocations.  */
6191b511d482Schristos   BFD_RELOC_VISIUM_HI16,
6192b511d482Schristos   BFD_RELOC_VISIUM_LO16,
6193b511d482Schristos   BFD_RELOC_VISIUM_IM16,
6194b511d482Schristos   BFD_RELOC_VISIUM_REL16,
6195b511d482Schristos   BFD_RELOC_VISIUM_HI16_PCREL,
6196b511d482Schristos   BFD_RELOC_VISIUM_LO16_PCREL,
6197b511d482Schristos   BFD_RELOC_VISIUM_IM16_PCREL,
61989bc6a05dSchristos 
61999bc6a05dSchristos /* WebAssembly relocations.  */
62009bc6a05dSchristos   BFD_RELOC_WASM32_LEB128,
62019bc6a05dSchristos   BFD_RELOC_WASM32_LEB128_GOT,
62029bc6a05dSchristos   BFD_RELOC_WASM32_LEB128_GOT_CODE,
62039bc6a05dSchristos   BFD_RELOC_WASM32_LEB128_PLT,
62049bc6a05dSchristos   BFD_RELOC_WASM32_PLT_INDEX,
62059bc6a05dSchristos   BFD_RELOC_WASM32_ABS32_CODE,
62069bc6a05dSchristos   BFD_RELOC_WASM32_COPY,
62079bc6a05dSchristos   BFD_RELOC_WASM32_CODE_POINTER,
62089bc6a05dSchristos   BFD_RELOC_WASM32_INDEX,
62099bc6a05dSchristos   BFD_RELOC_WASM32_PLT_SIG,
621077cd98dfSchristos 
621177cd98dfSchristos /* C-SKY relocations.  */
621277cd98dfSchristos   BFD_RELOC_CKCORE_NONE,
621377cd98dfSchristos   BFD_RELOC_CKCORE_ADDR32,
621477cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM8BY4,
621577cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM11BY2,
621677cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM4BY2,
621777cd98dfSchristos   BFD_RELOC_CKCORE_PCREL32,
621877cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2,
621977cd98dfSchristos   BFD_RELOC_CKCORE_GNU_VTINHERIT,
622077cd98dfSchristos   BFD_RELOC_CKCORE_GNU_VTENTRY,
622177cd98dfSchristos   BFD_RELOC_CKCORE_RELATIVE,
622277cd98dfSchristos   BFD_RELOC_CKCORE_COPY,
622377cd98dfSchristos   BFD_RELOC_CKCORE_GLOB_DAT,
622477cd98dfSchristos   BFD_RELOC_CKCORE_JUMP_SLOT,
622577cd98dfSchristos   BFD_RELOC_CKCORE_GOTOFF,
622677cd98dfSchristos   BFD_RELOC_CKCORE_GOTPC,
622777cd98dfSchristos   BFD_RELOC_CKCORE_GOT32,
622877cd98dfSchristos   BFD_RELOC_CKCORE_PLT32,
622977cd98dfSchristos   BFD_RELOC_CKCORE_ADDRGOT,
623077cd98dfSchristos   BFD_RELOC_CKCORE_ADDRPLT,
623177cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM26BY2,
623277cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM16BY2,
623377cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM16BY4,
623477cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM10BY2,
623577cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM10BY4,
623677cd98dfSchristos   BFD_RELOC_CKCORE_ADDR_HI16,
623777cd98dfSchristos   BFD_RELOC_CKCORE_ADDR_LO16,
623877cd98dfSchristos   BFD_RELOC_CKCORE_GOTPC_HI16,
623977cd98dfSchristos   BFD_RELOC_CKCORE_GOTPC_LO16,
624077cd98dfSchristos   BFD_RELOC_CKCORE_GOTOFF_HI16,
624177cd98dfSchristos   BFD_RELOC_CKCORE_GOTOFF_LO16,
624277cd98dfSchristos   BFD_RELOC_CKCORE_GOT12,
624377cd98dfSchristos   BFD_RELOC_CKCORE_GOT_HI16,
624477cd98dfSchristos   BFD_RELOC_CKCORE_GOT_LO16,
624577cd98dfSchristos   BFD_RELOC_CKCORE_PLT12,
624677cd98dfSchristos   BFD_RELOC_CKCORE_PLT_HI16,
624777cd98dfSchristos   BFD_RELOC_CKCORE_PLT_LO16,
624877cd98dfSchristos   BFD_RELOC_CKCORE_ADDRGOT_HI16,
624977cd98dfSchristos   BFD_RELOC_CKCORE_ADDRGOT_LO16,
625077cd98dfSchristos   BFD_RELOC_CKCORE_ADDRPLT_HI16,
625177cd98dfSchristos   BFD_RELOC_CKCORE_ADDRPLT_LO16,
625277cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2,
625377cd98dfSchristos   BFD_RELOC_CKCORE_TOFFSET_LO16,
625477cd98dfSchristos   BFD_RELOC_CKCORE_DOFFSET_LO16,
625577cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM18BY2,
625677cd98dfSchristos   BFD_RELOC_CKCORE_DOFFSET_IMM18,
625777cd98dfSchristos   BFD_RELOC_CKCORE_DOFFSET_IMM18BY2,
625877cd98dfSchristos   BFD_RELOC_CKCORE_DOFFSET_IMM18BY4,
625977cd98dfSchristos   BFD_RELOC_CKCORE_GOTOFF_IMM18,
626077cd98dfSchristos   BFD_RELOC_CKCORE_GOT_IMM18BY4,
626177cd98dfSchristos   BFD_RELOC_CKCORE_PLT_IMM18BY4,
626277cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_IMM7BY4,
626377cd98dfSchristos   BFD_RELOC_CKCORE_TLS_LE32,
626477cd98dfSchristos   BFD_RELOC_CKCORE_TLS_IE32,
626577cd98dfSchristos   BFD_RELOC_CKCORE_TLS_GD32,
626677cd98dfSchristos   BFD_RELOC_CKCORE_TLS_LDM32,
626777cd98dfSchristos   BFD_RELOC_CKCORE_TLS_LDO32,
626877cd98dfSchristos   BFD_RELOC_CKCORE_TLS_DTPMOD32,
626977cd98dfSchristos   BFD_RELOC_CKCORE_TLS_DTPOFF32,
627077cd98dfSchristos   BFD_RELOC_CKCORE_TLS_TPOFF32,
627177cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4,
627277cd98dfSchristos   BFD_RELOC_CKCORE_NOJSRI,
627377cd98dfSchristos   BFD_RELOC_CKCORE_CALLGRAPH,
627477cd98dfSchristos   BFD_RELOC_CKCORE_IRELATIVE,
627577cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4,
627677cd98dfSchristos   BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4,
627777cd98dfSchristos 
627877cd98dfSchristos /* S12Z relocations.  */
627977cd98dfSchristos   BFD_RELOC_S12Z_OPR,
6280c63b39d6Schristos   BFD_RELOC_UNUSED };
6281b511d482Schristos 
6282c63b39d6Schristos typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
6283c63b39d6Schristos reloc_howto_type *bfd_reloc_type_lookup
6284c63b39d6Schristos    (bfd *abfd, bfd_reloc_code_real_type code);
6285c63b39d6Schristos reloc_howto_type *bfd_reloc_name_lookup
6286c63b39d6Schristos    (bfd *abfd, const char *reloc_name);
6287c63b39d6Schristos 
6288c63b39d6Schristos const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
6289c63b39d6Schristos 
6290c63b39d6Schristos /* Extracted from syms.c.  */
6291c63b39d6Schristos 
6292c63b39d6Schristos typedef struct bfd_symbol
6293c63b39d6Schristos {
6294c63b39d6Schristos   /* A pointer to the BFD which owns the symbol. This information
6295c63b39d6Schristos      is necessary so that a back end can work out what additional
6296c63b39d6Schristos      information (invisible to the application writer) is carried
6297c63b39d6Schristos      with the symbol.
6298c63b39d6Schristos 
6299c63b39d6Schristos      This field is *almost* redundant, since you can use section->owner
6300c63b39d6Schristos      instead, except that some symbols point to the global sections
6301c63b39d6Schristos      bfd_{abs,com,und}_section.  This could be fixed by making
6302c63b39d6Schristos      these globals be per-bfd (or per-target-flavor).  FIXME.  */
6303c63b39d6Schristos   struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
6304c63b39d6Schristos 
6305c63b39d6Schristos   /* The text of the symbol. The name is left alone, and not copied; the
6306c63b39d6Schristos      application may not alter it.  */
6307c63b39d6Schristos   const char *name;
6308c63b39d6Schristos 
6309c63b39d6Schristos   /* The value of the symbol.  This really should be a union of a
6310c63b39d6Schristos      numeric value with a pointer, since some flags indicate that
6311c63b39d6Schristos      a pointer to another symbol is stored here.  */
6312c63b39d6Schristos   symvalue value;
6313c63b39d6Schristos 
6314c63b39d6Schristos   /* Attributes of a symbol.  */
631577cd98dfSchristos #define BSF_NO_FLAGS            0
6316c63b39d6Schristos 
6317c63b39d6Schristos   /* The symbol has local scope; <<static>> in <<C>>. The value
6318c63b39d6Schristos      is the offset into the section of the data.  */
6319c63b39d6Schristos #define BSF_LOCAL               (1 << 0)
6320c63b39d6Schristos 
6321c63b39d6Schristos   /* The symbol has global scope; initialized data in <<C>>. The
6322c63b39d6Schristos      value is the offset into the section of the data.  */
6323c63b39d6Schristos #define BSF_GLOBAL              (1 << 1)
6324c63b39d6Schristos 
6325c63b39d6Schristos   /* The symbol has global scope and is exported. The value is
6326c63b39d6Schristos      the offset into the section of the data.  */
6327c63b39d6Schristos #define BSF_EXPORT              BSF_GLOBAL /* No real difference.  */
6328c63b39d6Schristos 
6329c63b39d6Schristos   /* A normal C symbol would be one of:
6330a636ddcaSmrg      <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>.  */
6331c63b39d6Schristos 
6332c63b39d6Schristos   /* The symbol is a debugging record. The value has an arbitrary
6333c63b39d6Schristos      meaning, unless BSF_DEBUGGING_RELOC is also set.  */
6334c63b39d6Schristos #define BSF_DEBUGGING           (1 << 2)
6335c63b39d6Schristos 
6336c63b39d6Schristos   /* The symbol denotes a function entry point.  Used in ELF,
6337c63b39d6Schristos      perhaps others someday.  */
6338c63b39d6Schristos #define BSF_FUNCTION            (1 << 3)
6339c63b39d6Schristos 
6340c63b39d6Schristos   /* Used by the linker.  */
6341c63b39d6Schristos #define BSF_KEEP                (1 << 5)
6342a636ddcaSmrg 
6343a636ddcaSmrg   /* An ELF common symbol.  */
6344a636ddcaSmrg #define BSF_ELF_COMMON          (1 << 6)
6345c63b39d6Schristos 
6346c63b39d6Schristos   /* A weak global symbol, overridable without warnings by
6347c63b39d6Schristos      a regular global symbol of the same name.  */
6348c63b39d6Schristos #define BSF_WEAK                (1 << 7)
6349c63b39d6Schristos 
6350c63b39d6Schristos   /* This symbol was created to point to a section, e.g. ELF's
6351c63b39d6Schristos      STT_SECTION symbols.  */
6352c63b39d6Schristos #define BSF_SECTION_SYM         (1 << 8)
6353c63b39d6Schristos 
6354c63b39d6Schristos   /* The symbol used to be a common symbol, but now it is
6355c63b39d6Schristos      allocated.  */
6356c63b39d6Schristos #define BSF_OLD_COMMON          (1 << 9)
6357c63b39d6Schristos 
6358c63b39d6Schristos   /* In some files the type of a symbol sometimes alters its
6359c63b39d6Schristos      location in an output file - ie in coff a <<ISFCN>> symbol
6360c63b39d6Schristos      which is also <<C_EXT>> symbol appears where it was
6361c63b39d6Schristos      declared and not at the end of a section.  This bit is set
6362c63b39d6Schristos      by the target BFD part to convey this information.  */
6363c63b39d6Schristos #define BSF_NOT_AT_END          (1 << 10)
6364c63b39d6Schristos 
6365c63b39d6Schristos   /* Signal that the symbol is the label of constructor section.  */
6366c63b39d6Schristos #define BSF_CONSTRUCTOR         (1 << 11)
6367c63b39d6Schristos 
6368c63b39d6Schristos   /* Signal that the symbol is a warning symbol.  The name is a
6369c63b39d6Schristos      warning.  The name of the next symbol is the one to warn about;
6370c63b39d6Schristos      if a reference is made to a symbol with the same name as the next
6371c63b39d6Schristos      symbol, a warning is issued by the linker.  */
6372c63b39d6Schristos #define BSF_WARNING             (1 << 12)
6373c63b39d6Schristos 
6374c63b39d6Schristos   /* Signal that the symbol is indirect.  This symbol is an indirect
6375c63b39d6Schristos      pointer to the symbol with the same name as the next symbol.  */
6376c63b39d6Schristos #define BSF_INDIRECT            (1 << 13)
6377c63b39d6Schristos 
6378c63b39d6Schristos   /* BSF_FILE marks symbols that contain a file name.  This is used
6379c63b39d6Schristos      for ELF STT_FILE symbols.  */
6380c63b39d6Schristos #define BSF_FILE                (1 << 14)
6381c63b39d6Schristos 
6382c63b39d6Schristos   /* Symbol is from dynamic linking information.  */
6383c63b39d6Schristos #define BSF_DYNAMIC             (1 << 15)
6384c63b39d6Schristos 
6385c63b39d6Schristos   /* The symbol denotes a data object.  Used in ELF, and perhaps
6386c63b39d6Schristos      others someday.  */
6387c63b39d6Schristos #define BSF_OBJECT              (1 << 16)
6388c63b39d6Schristos 
6389c63b39d6Schristos   /* This symbol is a debugging symbol.  The value is the offset
6390c63b39d6Schristos      into the section of the data.  BSF_DEBUGGING should be set
6391c63b39d6Schristos      as well.  */
6392c63b39d6Schristos #define BSF_DEBUGGING_RELOC     (1 << 17)
6393c63b39d6Schristos 
6394c63b39d6Schristos   /* This symbol is thread local.  Used in ELF.  */
6395c63b39d6Schristos #define BSF_THREAD_LOCAL        (1 << 18)
6396c63b39d6Schristos 
6397c63b39d6Schristos   /* This symbol represents a complex relocation expression,
6398c63b39d6Schristos      with the expression tree serialized in the symbol name.  */
6399c63b39d6Schristos #define BSF_RELC                (1 << 19)
6400c63b39d6Schristos 
6401c63b39d6Schristos   /* This symbol represents a signed complex relocation expression,
6402c63b39d6Schristos      with the expression tree serialized in the symbol name.  */
6403c63b39d6Schristos #define BSF_SRELC               (1 << 20)
6404c63b39d6Schristos 
6405c63b39d6Schristos   /* This symbol was created by bfd_get_synthetic_symtab.  */
6406c63b39d6Schristos #define BSF_SYNTHETIC           (1 << 21)
6407c63b39d6Schristos 
6408c63b39d6Schristos   /* This symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
6409c63b39d6Schristos      The dynamic linker will compute the value of this symbol by
6410c63b39d6Schristos      calling the function that it points to.  BSF_FUNCTION must
6411c63b39d6Schristos      also be also set.  */
6412c63b39d6Schristos #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
6413c63b39d6Schristos   /* This symbol is a globally unique data object.  The dynamic linker
6414c63b39d6Schristos      will make sure that in the entire process there is just one symbol
6415c63b39d6Schristos      with this name and type in use.  BSF_OBJECT must also be set.  */
6416c63b39d6Schristos #define BSF_GNU_UNIQUE          (1 << 23)
6417c63b39d6Schristos 
6418c63b39d6Schristos   flagword flags;
6419c63b39d6Schristos 
6420c63b39d6Schristos   /* A pointer to the section to which this symbol is
6421c63b39d6Schristos      relative.  This will always be non NULL, there are special
6422c63b39d6Schristos      sections for undefined and absolute symbols.  */
6423c63b39d6Schristos   struct bfd_section *section;
6424c63b39d6Schristos 
6425c63b39d6Schristos   /* Back end special data.  */
6426c63b39d6Schristos   union
6427c63b39d6Schristos     {
6428c63b39d6Schristos       void *p;
6429c63b39d6Schristos       bfd_vma i;
6430c63b39d6Schristos     }
6431c63b39d6Schristos   udata;
6432c63b39d6Schristos }
6433c63b39d6Schristos asymbol;
6434c63b39d6Schristos 
6435c63b39d6Schristos #define bfd_get_symtab_upper_bound(abfd) \
6436c63b39d6Schristos        BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
6437c63b39d6Schristos 
6438c63b39d6Schristos bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
6439c63b39d6Schristos 
6440c63b39d6Schristos bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
6441c63b39d6Schristos 
6442c63b39d6Schristos #define bfd_is_local_label_name(abfd, name) \
6443c63b39d6Schristos        BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
6444c63b39d6Schristos 
6445c63b39d6Schristos bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
6446c63b39d6Schristos 
6447c63b39d6Schristos #define bfd_is_target_special_symbol(abfd, sym) \
6448c63b39d6Schristos        BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
6449c63b39d6Schristos 
6450c63b39d6Schristos #define bfd_canonicalize_symtab(abfd, location) \
6451c63b39d6Schristos        BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
6452c63b39d6Schristos 
6453c63b39d6Schristos bfd_boolean bfd_set_symtab
6454c63b39d6Schristos    (bfd *abfd, asymbol **location, unsigned int count);
6455c63b39d6Schristos 
6456c63b39d6Schristos void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
6457c63b39d6Schristos 
6458c63b39d6Schristos #define bfd_make_empty_symbol(abfd) \
6459c63b39d6Schristos        BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
6460c63b39d6Schristos 
6461c63b39d6Schristos asymbol *_bfd_generic_make_empty_symbol (bfd *);
6462c63b39d6Schristos 
6463c63b39d6Schristos #define bfd_make_debug_symbol(abfd,ptr,size) \
6464c63b39d6Schristos        BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
6465c63b39d6Schristos 
6466c63b39d6Schristos int bfd_decode_symclass (asymbol *symbol);
6467c63b39d6Schristos 
6468c63b39d6Schristos bfd_boolean bfd_is_undefined_symclass (int symclass);
6469c63b39d6Schristos 
6470c63b39d6Schristos void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
6471c63b39d6Schristos 
6472c63b39d6Schristos bfd_boolean bfd_copy_private_symbol_data
6473c63b39d6Schristos    (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
6474c63b39d6Schristos 
6475c63b39d6Schristos #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
6476c63b39d6Schristos        BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
6477c63b39d6Schristos                  (ibfd, isymbol, obfd, osymbol))
6478c63b39d6Schristos 
6479c63b39d6Schristos /* Extracted from bfd.c.  */
6480b511d482Schristos 
6481c63b39d6Schristos enum bfd_direction
6482c63b39d6Schristos   {
6483c63b39d6Schristos     no_direction = 0,
6484c63b39d6Schristos     read_direction = 1,
6485c63b39d6Schristos     write_direction = 2,
6486c63b39d6Schristos     both_direction = 3
6487c63b39d6Schristos   };
6488c63b39d6Schristos 
6489e8beca2cSchristos enum bfd_plugin_format
6490e8beca2cSchristos   {
6491a636ddcaSmrg     bfd_plugin_unknown = 0,
6492e8beca2cSchristos     bfd_plugin_yes = 1,
6493e8beca2cSchristos     bfd_plugin_no = 2
6494e8beca2cSchristos   };
6495e8beca2cSchristos 
6496e8beca2cSchristos struct bfd_build_id
6497e8beca2cSchristos   {
6498e8beca2cSchristos     bfd_size_type size;
6499e8beca2cSchristos     bfd_byte data[1];
6500e8beca2cSchristos   };
6501e8beca2cSchristos 
6502c63b39d6Schristos struct bfd
6503c63b39d6Schristos {
6504c63b39d6Schristos   /* The filename the application opened the BFD with.  */
6505c63b39d6Schristos   const char *filename;
6506c63b39d6Schristos 
6507c63b39d6Schristos   /* A pointer to the target jump table.  */
6508c63b39d6Schristos   const struct bfd_target *xvec;
6509c63b39d6Schristos 
6510c63b39d6Schristos   /* The IOSTREAM, and corresponding IO vector that provide access
6511c63b39d6Schristos      to the file backing the BFD.  */
6512c63b39d6Schristos   void *iostream;
6513c63b39d6Schristos   const struct bfd_iovec *iovec;
6514c63b39d6Schristos 
6515c63b39d6Schristos   /* The caching routines use these to maintain a
6516c63b39d6Schristos      least-recently-used list of BFDs.  */
6517c63b39d6Schristos   struct bfd *lru_prev, *lru_next;
6518c63b39d6Schristos 
651977cd98dfSchristos   /* Track current file position (or current buffer offset for
652077cd98dfSchristos      in-memory BFDs).  When a file is closed by the caching routines,
652177cd98dfSchristos      BFD retains state information on the file here.  */
6522c63b39d6Schristos   ufile_ptr where;
6523c63b39d6Schristos 
6524c63b39d6Schristos   /* File modified time, if mtime_set is TRUE.  */
6525c63b39d6Schristos   long mtime;
6526c63b39d6Schristos 
6527b511d482Schristos   /* A unique identifier of the BFD  */
6528b511d482Schristos   unsigned int id;
6529c63b39d6Schristos 
6530c63b39d6Schristos   /* Format_specific flags.  */
6531*fd82c4c4Schristos   flagword flags;
6532c63b39d6Schristos 
6533c63b39d6Schristos   /* Values that may appear in the flags field of a BFD.  These also
6534c63b39d6Schristos      appear in the object_flags field of the bfd_target structure, where
6535c63b39d6Schristos      they indicate the set of flags used by that backend (not all flags
6536c63b39d6Schristos      are meaningful for all object file formats) (FIXME: at the moment,
6537c63b39d6Schristos      the object_flags values have mostly just been copied from backend
6538c63b39d6Schristos      to another, and are not necessarily correct).  */
6539c63b39d6Schristos 
654077cd98dfSchristos #define BFD_NO_FLAGS                0x0
6541c63b39d6Schristos 
6542c63b39d6Schristos   /* BFD contains relocation entries.  */
654377cd98dfSchristos #define HAS_RELOC                   0x1
6544c63b39d6Schristos 
6545c63b39d6Schristos   /* BFD is directly executable.  */
654677cd98dfSchristos #define EXEC_P                      0x2
6547c63b39d6Schristos 
6548c63b39d6Schristos   /* BFD has line number information (basically used for F_LNNO in a
6549c63b39d6Schristos      COFF header).  */
655077cd98dfSchristos #define HAS_LINENO                  0x4
6551c63b39d6Schristos 
6552c63b39d6Schristos   /* BFD has debugging information.  */
6553c63b39d6Schristos #define HAS_DEBUG                  0x08
6554c63b39d6Schristos 
6555c63b39d6Schristos   /* BFD has symbols.  */
6556c63b39d6Schristos #define HAS_SYMS                   0x10
6557c63b39d6Schristos 
6558c63b39d6Schristos   /* BFD has local symbols (basically used for F_LSYMS in a COFF
6559c63b39d6Schristos      header).  */
6560c63b39d6Schristos #define HAS_LOCALS                 0x20
6561c63b39d6Schristos 
6562c63b39d6Schristos   /* BFD is a dynamic object.  */
6563c63b39d6Schristos #define DYNAMIC                    0x40
6564c63b39d6Schristos 
6565c63b39d6Schristos   /* Text section is write protected (if D_PAGED is not set, this is
6566c63b39d6Schristos      like an a.out NMAGIC file) (the linker sets this by default, but
6567c63b39d6Schristos      clears it for -r or -N).  */
6568c63b39d6Schristos #define WP_TEXT                    0x80
6569c63b39d6Schristos 
6570c63b39d6Schristos   /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
6571c63b39d6Schristos      linker sets this by default, but clears it for -r or -n or -N).  */
6572c63b39d6Schristos #define D_PAGED                   0x100
6573c63b39d6Schristos 
6574c63b39d6Schristos   /* BFD is relaxable (this means that bfd_relax_section may be able to
6575c63b39d6Schristos      do something) (sometimes bfd_relax_section can do something even if
6576c63b39d6Schristos      this is not set).  */
6577c63b39d6Schristos #define BFD_IS_RELAXABLE          0x200
6578c63b39d6Schristos 
6579c63b39d6Schristos   /* This may be set before writing out a BFD to request using a
6580c63b39d6Schristos      traditional format.  For example, this is used to request that when
6581c63b39d6Schristos      writing out an a.out object the symbols not be hashed to eliminate
6582c63b39d6Schristos      duplicates.  */
6583c63b39d6Schristos #define BFD_TRADITIONAL_FORMAT    0x400
6584c63b39d6Schristos 
6585c63b39d6Schristos   /* This flag indicates that the BFD contents are actually cached
6586c63b39d6Schristos      in memory.  If this is set, iostream points to a bfd_in_memory
6587c63b39d6Schristos      struct.  */
6588c63b39d6Schristos #define BFD_IN_MEMORY             0x800
6589c63b39d6Schristos 
6590c63b39d6Schristos   /* This BFD has been created by the linker and doesn't correspond
6591c63b39d6Schristos      to any input file.  */
6592b511d482Schristos #define BFD_LINKER_CREATED       0x1000
6593c63b39d6Schristos 
6594c63b39d6Schristos   /* This may be set before writing out a BFD to request that it
6595c63b39d6Schristos      be written using values for UIDs, GIDs, timestamps, etc. that
6596c63b39d6Schristos      will be consistent from run to run.  */
6597b511d482Schristos #define BFD_DETERMINISTIC_OUTPUT 0x2000
6598c63b39d6Schristos 
6599c63b39d6Schristos   /* Compress sections in this BFD.  */
6600b511d482Schristos #define BFD_COMPRESS             0x4000
6601c63b39d6Schristos 
6602c63b39d6Schristos   /* Decompress sections in this BFD.  */
6603b511d482Schristos #define BFD_DECOMPRESS           0x8000
6604c63b39d6Schristos 
6605fdeb0babSchristos   /* BFD is a dummy, for plugins.  */
6606b511d482Schristos #define BFD_PLUGIN              0x10000
6607fdeb0babSchristos 
6608e8beca2cSchristos   /* Compress sections in this BFD with SHF_COMPRESSED from gABI.  */
6609e8beca2cSchristos #define BFD_COMPRESS_GABI       0x20000
6610e8beca2cSchristos 
6611a636ddcaSmrg   /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
6612a636ddcaSmrg      BFD.  */
6613a636ddcaSmrg #define BFD_CONVERT_ELF_COMMON  0x40000
6614a636ddcaSmrg 
6615a636ddcaSmrg   /* Use the ELF STT_COMMON type in this BFD.  */
6616a636ddcaSmrg #define BFD_USE_ELF_STT_COMMON  0x80000
6617a636ddcaSmrg 
6618*fd82c4c4Schristos   /* Put pathnames into archives (non-POSIX).  */
6619*fd82c4c4Schristos #define BFD_ARCHIVE_FULL_PATH  0x100000
6620*fd82c4c4Schristos 
6621c63b39d6Schristos   /* Flags bits to be saved in bfd_preserve_save.  */
6622c63b39d6Schristos #define BFD_FLAGS_SAVED \
66239bc6a05dSchristos   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
66249bc6a05dSchristos    | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \
66259bc6a05dSchristos    | BFD_USE_ELF_STT_COMMON)
6626c63b39d6Schristos 
6627c63b39d6Schristos   /* Flags bits which are for BFD use only.  */
6628c63b39d6Schristos #define BFD_FLAGS_FOR_BFD_USE_MASK \
6629c63b39d6Schristos   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
6630e8beca2cSchristos    | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \
6631a636ddcaSmrg    | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON)
6632c63b39d6Schristos 
6633*fd82c4c4Schristos   /* The format which belongs to the BFD. (object, core, etc.)  */
6634*fd82c4c4Schristos   ENUM_BITFIELD (bfd_format) format : 3;
6635*fd82c4c4Schristos 
6636*fd82c4c4Schristos   /* The direction with which the BFD was opened.  */
6637*fd82c4c4Schristos   ENUM_BITFIELD (bfd_direction) direction : 2;
6638*fd82c4c4Schristos 
6639b511d482Schristos   /* Is the file descriptor being cached?  That is, can it be closed as
6640b511d482Schristos      needed, and re-opened when accessed later?  */
6641b511d482Schristos   unsigned int cacheable : 1;
6642b511d482Schristos 
6643b511d482Schristos   /* Marks whether there was a default target specified when the
6644b511d482Schristos      BFD was opened. This is used to select which matching algorithm
6645b511d482Schristos      to use to choose the back end.  */
6646b511d482Schristos   unsigned int target_defaulted : 1;
6647b511d482Schristos 
6648b511d482Schristos   /* ... and here: (``once'' means at least once).  */
6649b511d482Schristos   unsigned int opened_once : 1;
6650b511d482Schristos 
6651b511d482Schristos   /* Set if we have a locally maintained mtime value, rather than
6652b511d482Schristos      getting it from the file each time.  */
6653b511d482Schristos   unsigned int mtime_set : 1;
6654b511d482Schristos 
6655b511d482Schristos   /* Flag set if symbols from this BFD should not be exported.  */
6656b511d482Schristos   unsigned int no_export : 1;
6657b511d482Schristos 
6658b511d482Schristos   /* Remember when output has begun, to stop strange things
6659b511d482Schristos      from happening.  */
6660b511d482Schristos   unsigned int output_has_begun : 1;
6661b511d482Schristos 
6662b511d482Schristos   /* Have archive map.  */
6663b511d482Schristos   unsigned int has_armap : 1;
6664b511d482Schristos 
6665b511d482Schristos   /* Set if this is a thin archive.  */
6666b511d482Schristos   unsigned int is_thin_archive : 1;
6667b511d482Schristos 
6668*fd82c4c4Schristos   /* Set if this archive should not cache element positions.  */
6669*fd82c4c4Schristos   unsigned int no_element_cache : 1;
6670*fd82c4c4Schristos 
6671b511d482Schristos   /* Set if only required symbols should be added in the link hash table for
6672b511d482Schristos      this object.  Used by VMS linkers.  */
6673b511d482Schristos   unsigned int selective_search : 1;
6674b511d482Schristos 
6675b511d482Schristos   /* Set if this is the linker output BFD.  */
6676b511d482Schristos   unsigned int is_linker_output : 1;
6677b511d482Schristos 
6678e8beca2cSchristos   /* Set if this is the linker input BFD.  */
6679e8beca2cSchristos   unsigned int is_linker_input : 1;
6680e8beca2cSchristos 
6681e8beca2cSchristos   /* If this is an input for a compiler plug-in library.  */
6682e8beca2cSchristos   ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2;
6683e8beca2cSchristos 
6684e8beca2cSchristos   /* Set if this is a plugin output file.  */
6685e8beca2cSchristos   unsigned int lto_output : 1;
6686e8beca2cSchristos 
6687*fd82c4c4Schristos   /* Set if this is a slim LTO object not loaded with a compiler plugin.  */
6688*fd82c4c4Schristos   unsigned int lto_slim_object : 1;
6689*fd82c4c4Schristos 
6690*fd82c4c4Schristos   /* Do not attempt to modify this file.  Set when detecting errors
6691*fd82c4c4Schristos      that BFD is not prepared to handle for objcopy/strip.  */
6692*fd82c4c4Schristos   unsigned int read_only : 1;
6693*fd82c4c4Schristos 
6694e8beca2cSchristos   /* Set to dummy BFD created when claimed by a compiler plug-in
6695e8beca2cSchristos      library.  */
6696e8beca2cSchristos   bfd *plugin_dummy_bfd;
6697e8beca2cSchristos 
6698*fd82c4c4Schristos   /* The offset of this bfd in the file, typically 0 if it is not
6699*fd82c4c4Schristos      contained in an archive.  */
6700c63b39d6Schristos   ufile_ptr origin;
6701c63b39d6Schristos 
6702c63b39d6Schristos   /* The origin in the archive of the proxy entry.  This will
6703c63b39d6Schristos      normally be the same as origin, except for thin archives,
6704c63b39d6Schristos      when it will contain the current offset of the proxy in the
6705c63b39d6Schristos      thin archive rather than the offset of the bfd in its actual
6706c63b39d6Schristos      container.  */
6707c63b39d6Schristos   ufile_ptr proxy_origin;
6708c63b39d6Schristos 
6709c63b39d6Schristos   /* A hash table for section names.  */
6710c63b39d6Schristos   struct bfd_hash_table section_htab;
6711c63b39d6Schristos 
6712c63b39d6Schristos   /* Pointer to linked list of sections.  */
6713c63b39d6Schristos   struct bfd_section *sections;
6714c63b39d6Schristos 
6715c63b39d6Schristos   /* The last section on the section list.  */
6716c63b39d6Schristos   struct bfd_section *section_last;
6717c63b39d6Schristos 
6718c63b39d6Schristos   /* The number of sections.  */
6719c63b39d6Schristos   unsigned int section_count;
6720c63b39d6Schristos 
6721b511d482Schristos   /* A field used by _bfd_generic_link_add_archive_symbols.  This will
6722b511d482Schristos      be used only for archive elements.  */
6723b511d482Schristos   int archive_pass;
6724b511d482Schristos 
6725c63b39d6Schristos   /* Stuff only useful for object files:
6726c63b39d6Schristos      The start address.  */
6727c63b39d6Schristos   bfd_vma start_address;
6728c63b39d6Schristos 
6729c63b39d6Schristos   /* Symbol table for output BFD (with symcount entries).
6730c63b39d6Schristos      Also used by the linker to cache input BFD symbols.  */
6731c63b39d6Schristos   struct bfd_symbol **outsymbols;
6732c63b39d6Schristos 
6733b511d482Schristos   /* Used for input and output.  */
6734b511d482Schristos   unsigned int symcount;
6735b511d482Schristos 
6736c63b39d6Schristos   /* Used for slurped dynamic symbol tables.  */
6737c63b39d6Schristos   unsigned int dynsymcount;
6738c63b39d6Schristos 
6739c63b39d6Schristos   /* Pointer to structure which contains architecture information.  */
6740c63b39d6Schristos   const struct bfd_arch_info *arch_info;
6741c63b39d6Schristos 
6742*fd82c4c4Schristos   /* Cached length of file for bfd_get_size.  0 until bfd_get_size is
6743*fd82c4c4Schristos      called, 1 if stat returns an error or the file size is too large to
6744*fd82c4c4Schristos      return in ufile_ptr.  Both 0 and 1 should be treated as "unknown".  */
6745*fd82c4c4Schristos   ufile_ptr size;
6746*fd82c4c4Schristos 
6747c63b39d6Schristos   /* Stuff only useful for archives.  */
6748c63b39d6Schristos   void *arelt_data;
6749c63b39d6Schristos   struct bfd *my_archive;      /* The containing archive BFD.  */
6750c63b39d6Schristos   struct bfd *archive_next;    /* The next BFD in the archive.  */
6751c63b39d6Schristos   struct bfd *archive_head;    /* The first BFD in the archive.  */
6752c63b39d6Schristos   struct bfd *nested_archives; /* List of nested archive in a flattened
6753c63b39d6Schristos                                   thin archive.  */
6754c63b39d6Schristos 
6755b511d482Schristos   union {
6756b511d482Schristos     /* For input BFDs, a chain of BFDs involved in a link.  */
6757b511d482Schristos     struct bfd *next;
6758b511d482Schristos     /* For output BFD, the linker hash table.  */
6759b511d482Schristos     struct bfd_link_hash_table *hash;
6760b511d482Schristos   } link;
6761c63b39d6Schristos 
6762c63b39d6Schristos   /* Used by the back end to hold private data.  */
6763c63b39d6Schristos   union
6764c63b39d6Schristos     {
6765c63b39d6Schristos       struct aout_data_struct *aout_data;
6766c63b39d6Schristos       struct artdata *aout_ar_data;
6767c63b39d6Schristos       struct coff_tdata *coff_obj_data;
6768c63b39d6Schristos       struct pe_tdata *pe_obj_data;
6769c63b39d6Schristos       struct xcoff_tdata *xcoff_obj_data;
6770c63b39d6Schristos       struct ecoff_tdata *ecoff_obj_data;
6771c63b39d6Schristos       struct srec_data_struct *srec_data;
6772c63b39d6Schristos       struct verilog_data_struct *verilog_data;
6773c63b39d6Schristos       struct ihex_data_struct *ihex_data;
6774c63b39d6Schristos       struct tekhex_data_struct *tekhex_data;
6775c63b39d6Schristos       struct elf_obj_tdata *elf_obj_data;
6776c63b39d6Schristos       struct mmo_data_struct *mmo_data;
6777c63b39d6Schristos       struct sun_core_struct *sun_core_data;
6778c63b39d6Schristos       struct sco5_core_struct *sco5_core_data;
6779c63b39d6Schristos       struct trad_core_struct *trad_core_data;
6780c63b39d6Schristos       struct som_data_struct *som_data;
6781c63b39d6Schristos       struct hpux_core_struct *hpux_core_data;
6782c63b39d6Schristos       struct hppabsd_core_struct *hppabsd_core_data;
6783c63b39d6Schristos       struct sgi_core_struct *sgi_core_data;
6784c63b39d6Schristos       struct lynx_core_struct *lynx_core_data;
6785c63b39d6Schristos       struct osf_core_struct *osf_core_data;
6786c63b39d6Schristos       struct cisco_core_struct *cisco_core_data;
6787c63b39d6Schristos       struct versados_data_struct *versados_data;
6788c63b39d6Schristos       struct netbsd_core_struct *netbsd_core_data;
6789c63b39d6Schristos       struct mach_o_data_struct *mach_o_data;
6790c63b39d6Schristos       struct mach_o_fat_data_struct *mach_o_fat_data;
6791c63b39d6Schristos       struct plugin_data_struct *plugin_data;
6792c63b39d6Schristos       struct bfd_pef_data_struct *pef_data;
6793c63b39d6Schristos       struct bfd_pef_xlib_data_struct *pef_xlib_data;
6794c63b39d6Schristos       struct bfd_sym_data_struct *sym_data;
6795c63b39d6Schristos       void *any;
6796c63b39d6Schristos     }
6797c63b39d6Schristos   tdata;
6798c63b39d6Schristos 
6799c63b39d6Schristos   /* Used by the application to hold private data.  */
6800c63b39d6Schristos   void *usrdata;
6801c63b39d6Schristos 
6802c63b39d6Schristos   /* Where all the allocated stuff under this BFD goes.  This is a
6803c63b39d6Schristos      struct objalloc *, but we use void * to avoid requiring the inclusion
6804c63b39d6Schristos      of objalloc.h.  */
6805c63b39d6Schristos   void *memory;
6806e8beca2cSchristos 
6807e8beca2cSchristos   /* For input BFDs, the build ID, if the object has one. */
6808e8beca2cSchristos   const struct bfd_build_id *build_id;
6809c63b39d6Schristos };
6810c63b39d6Schristos 
6811*fd82c4c4Schristos static inline const char *
bfd_get_filename(const bfd * abfd)6812*fd82c4c4Schristos bfd_get_filename (const bfd *abfd)
6813*fd82c4c4Schristos {
6814*fd82c4c4Schristos   return abfd->filename;
6815*fd82c4c4Schristos }
6816*fd82c4c4Schristos 
6817*fd82c4c4Schristos static inline bfd_boolean
bfd_get_cacheable(const bfd * abfd)6818*fd82c4c4Schristos bfd_get_cacheable (const bfd *abfd)
6819*fd82c4c4Schristos {
6820*fd82c4c4Schristos   return abfd->cacheable;
6821*fd82c4c4Schristos }
6822*fd82c4c4Schristos 
6823*fd82c4c4Schristos static inline enum bfd_format
bfd_get_format(const bfd * abfd)6824*fd82c4c4Schristos bfd_get_format (const bfd *abfd)
6825*fd82c4c4Schristos {
6826*fd82c4c4Schristos   return abfd->format;
6827*fd82c4c4Schristos }
6828*fd82c4c4Schristos 
6829*fd82c4c4Schristos static inline flagword
bfd_get_file_flags(const bfd * abfd)6830*fd82c4c4Schristos bfd_get_file_flags (const bfd *abfd)
6831*fd82c4c4Schristos {
6832*fd82c4c4Schristos   return abfd->flags;
6833*fd82c4c4Schristos }
6834*fd82c4c4Schristos 
6835*fd82c4c4Schristos static inline bfd_vma
bfd_get_start_address(const bfd * abfd)6836*fd82c4c4Schristos bfd_get_start_address (const bfd *abfd)
6837*fd82c4c4Schristos {
6838*fd82c4c4Schristos   return abfd->start_address;
6839*fd82c4c4Schristos }
6840*fd82c4c4Schristos 
6841*fd82c4c4Schristos static inline unsigned int
bfd_get_symcount(const bfd * abfd)6842*fd82c4c4Schristos bfd_get_symcount (const bfd *abfd)
6843*fd82c4c4Schristos {
6844*fd82c4c4Schristos   return abfd->symcount;
6845*fd82c4c4Schristos }
6846*fd82c4c4Schristos 
6847*fd82c4c4Schristos static inline unsigned int
bfd_get_dynamic_symcount(const bfd * abfd)6848*fd82c4c4Schristos bfd_get_dynamic_symcount (const bfd *abfd)
6849*fd82c4c4Schristos {
6850*fd82c4c4Schristos   return abfd->dynsymcount;
6851*fd82c4c4Schristos }
6852*fd82c4c4Schristos 
6853*fd82c4c4Schristos static inline struct bfd_symbol **
bfd_get_outsymbols(const bfd * abfd)6854*fd82c4c4Schristos bfd_get_outsymbols (const bfd *abfd)
6855*fd82c4c4Schristos {
6856*fd82c4c4Schristos   return abfd->outsymbols;
6857*fd82c4c4Schristos }
6858*fd82c4c4Schristos 
6859*fd82c4c4Schristos static inline unsigned int
bfd_count_sections(const bfd * abfd)6860*fd82c4c4Schristos bfd_count_sections (const bfd *abfd)
6861*fd82c4c4Schristos {
6862*fd82c4c4Schristos   return abfd->section_count;
6863*fd82c4c4Schristos }
6864*fd82c4c4Schristos 
6865*fd82c4c4Schristos static inline bfd_boolean
bfd_has_map(const bfd * abfd)6866*fd82c4c4Schristos bfd_has_map (const bfd *abfd)
6867*fd82c4c4Schristos {
6868*fd82c4c4Schristos   return abfd->has_armap;
6869*fd82c4c4Schristos }
6870*fd82c4c4Schristos 
6871*fd82c4c4Schristos static inline bfd_boolean
bfd_is_thin_archive(const bfd * abfd)6872*fd82c4c4Schristos bfd_is_thin_archive (const bfd *abfd)
6873*fd82c4c4Schristos {
6874*fd82c4c4Schristos   return abfd->is_thin_archive;
6875*fd82c4c4Schristos }
6876*fd82c4c4Schristos 
6877*fd82c4c4Schristos static inline void *
bfd_usrdata(const bfd * abfd)6878*fd82c4c4Schristos bfd_usrdata (const bfd *abfd)
6879*fd82c4c4Schristos {
6880*fd82c4c4Schristos   return abfd->usrdata;
6881*fd82c4c4Schristos }
6882*fd82c4c4Schristos 
688344a21023Schristos /* See note beside bfd_set_section_userdata.  */
688444a21023Schristos static inline bfd_boolean
bfd_set_cacheable(bfd * abfd,bfd_boolean val)688544a21023Schristos bfd_set_cacheable (bfd * abfd, bfd_boolean val)
688644a21023Schristos {
688744a21023Schristos   abfd->cacheable = val;
688844a21023Schristos   return TRUE;
688944a21023Schristos }
689044a21023Schristos 
6891*fd82c4c4Schristos static inline void
bfd_set_thin_archive(bfd * abfd,bfd_boolean val)6892*fd82c4c4Schristos bfd_set_thin_archive (bfd *abfd, bfd_boolean val)
6893*fd82c4c4Schristos {
6894*fd82c4c4Schristos   abfd->is_thin_archive = val;
6895*fd82c4c4Schristos }
6896*fd82c4c4Schristos 
6897*fd82c4c4Schristos static inline void
bfd_set_usrdata(bfd * abfd,void * val)6898*fd82c4c4Schristos bfd_set_usrdata (bfd *abfd, void *val)
6899*fd82c4c4Schristos {
6900*fd82c4c4Schristos   abfd->usrdata = val;
6901*fd82c4c4Schristos }
6902*fd82c4c4Schristos 
6903*fd82c4c4Schristos static inline asection *
bfd_asymbol_section(const asymbol * sy)6904*fd82c4c4Schristos bfd_asymbol_section (const asymbol *sy)
6905*fd82c4c4Schristos {
6906*fd82c4c4Schristos   return sy->section;
6907*fd82c4c4Schristos }
6908*fd82c4c4Schristos 
6909*fd82c4c4Schristos static inline bfd_vma
bfd_asymbol_value(const asymbol * sy)6910*fd82c4c4Schristos bfd_asymbol_value (const asymbol *sy)
6911*fd82c4c4Schristos {
6912*fd82c4c4Schristos   return sy->section->vma + sy->value;
6913*fd82c4c4Schristos }
6914*fd82c4c4Schristos 
6915*fd82c4c4Schristos static inline const char *
bfd_asymbol_name(const asymbol * sy)6916*fd82c4c4Schristos bfd_asymbol_name (const asymbol *sy)
6917*fd82c4c4Schristos {
6918*fd82c4c4Schristos   return sy->name;
6919*fd82c4c4Schristos }
6920*fd82c4c4Schristos 
6921*fd82c4c4Schristos static inline struct bfd *
bfd_asymbol_bfd(const asymbol * sy)6922*fd82c4c4Schristos bfd_asymbol_bfd (const asymbol *sy)
6923*fd82c4c4Schristos {
6924*fd82c4c4Schristos   return sy->the_bfd;
6925*fd82c4c4Schristos }
6926*fd82c4c4Schristos 
6927*fd82c4c4Schristos static inline void
bfd_set_asymbol_name(asymbol * sy,const char * name)6928*fd82c4c4Schristos bfd_set_asymbol_name (asymbol *sy, const char *name)
6929*fd82c4c4Schristos {
6930*fd82c4c4Schristos   sy->name = name;
6931*fd82c4c4Schristos }
6932*fd82c4c4Schristos 
6933*fd82c4c4Schristos static inline bfd_size_type
bfd_get_section_limit_octets(const bfd * abfd,const asection * sec)6934*fd82c4c4Schristos bfd_get_section_limit_octets (const bfd *abfd, const asection *sec)
6935*fd82c4c4Schristos {
6936*fd82c4c4Schristos   if (abfd->direction != write_direction && sec->rawsize != 0)
6937*fd82c4c4Schristos     return sec->rawsize;
6938*fd82c4c4Schristos   return sec->size;
6939*fd82c4c4Schristos }
6940*fd82c4c4Schristos 
6941*fd82c4c4Schristos /* Find the address one past the end of SEC.  */
6942*fd82c4c4Schristos static inline bfd_size_type
bfd_get_section_limit(const bfd * abfd,const asection * sec)6943*fd82c4c4Schristos bfd_get_section_limit (const bfd *abfd, const asection *sec)
6944*fd82c4c4Schristos {
6945*fd82c4c4Schristos   return (bfd_get_section_limit_octets (abfd, sec)
6946*fd82c4c4Schristos           / bfd_octets_per_byte (abfd, sec));
6947*fd82c4c4Schristos }
6948*fd82c4c4Schristos 
6949*fd82c4c4Schristos /* Functions to handle insertion and deletion of a bfd's sections.  These
6950*fd82c4c4Schristos    only handle the list pointers, ie. do not adjust section_count,
6951*fd82c4c4Schristos    target_index etc.  */
6952*fd82c4c4Schristos static inline void
bfd_section_list_remove(bfd * abfd,asection * s)6953*fd82c4c4Schristos bfd_section_list_remove (bfd *abfd, asection *s)
6954*fd82c4c4Schristos {
6955*fd82c4c4Schristos   asection *next = s->next;
6956*fd82c4c4Schristos   asection *prev = s->prev;
6957*fd82c4c4Schristos   if (prev)
6958*fd82c4c4Schristos     prev->next = next;
6959*fd82c4c4Schristos   else
6960*fd82c4c4Schristos     abfd->sections = next;
6961*fd82c4c4Schristos   if (next)
6962*fd82c4c4Schristos     next->prev = prev;
6963*fd82c4c4Schristos   else
6964*fd82c4c4Schristos     abfd->section_last = prev;
6965*fd82c4c4Schristos }
6966*fd82c4c4Schristos 
6967*fd82c4c4Schristos static inline void
bfd_section_list_append(bfd * abfd,asection * s)6968*fd82c4c4Schristos bfd_section_list_append (bfd *abfd, asection *s)
6969*fd82c4c4Schristos {
6970*fd82c4c4Schristos   s->next = 0;
6971*fd82c4c4Schristos   if (abfd->section_last)
6972*fd82c4c4Schristos     {
6973*fd82c4c4Schristos       s->prev = abfd->section_last;
6974*fd82c4c4Schristos       abfd->section_last->next = s;
6975*fd82c4c4Schristos     }
6976*fd82c4c4Schristos   else
6977*fd82c4c4Schristos     {
6978*fd82c4c4Schristos       s->prev = 0;
6979*fd82c4c4Schristos       abfd->sections = s;
6980*fd82c4c4Schristos     }
6981*fd82c4c4Schristos   abfd->section_last = s;
6982*fd82c4c4Schristos }
6983*fd82c4c4Schristos 
6984*fd82c4c4Schristos static inline void
bfd_section_list_prepend(bfd * abfd,asection * s)6985*fd82c4c4Schristos bfd_section_list_prepend (bfd *abfd, asection *s)
6986*fd82c4c4Schristos {
6987*fd82c4c4Schristos   s->prev = 0;
6988*fd82c4c4Schristos   if (abfd->sections)
6989*fd82c4c4Schristos     {
6990*fd82c4c4Schristos       s->next = abfd->sections;
6991*fd82c4c4Schristos       abfd->sections->prev = s;
6992*fd82c4c4Schristos     }
6993*fd82c4c4Schristos   else
6994*fd82c4c4Schristos     {
6995*fd82c4c4Schristos       s->next = 0;
6996*fd82c4c4Schristos       abfd->section_last = s;
6997*fd82c4c4Schristos     }
6998*fd82c4c4Schristos   abfd->sections = s;
6999*fd82c4c4Schristos }
7000*fd82c4c4Schristos 
7001*fd82c4c4Schristos static inline void
bfd_section_list_insert_after(bfd * abfd,asection * a,asection * s)7002*fd82c4c4Schristos bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s)
7003*fd82c4c4Schristos {
7004*fd82c4c4Schristos   asection *next = a->next;
7005*fd82c4c4Schristos   s->next = next;
7006*fd82c4c4Schristos   s->prev = a;
7007*fd82c4c4Schristos   a->next = s;
7008*fd82c4c4Schristos   if (next)
7009*fd82c4c4Schristos     next->prev = s;
7010*fd82c4c4Schristos   else
7011*fd82c4c4Schristos     abfd->section_last = s;
7012*fd82c4c4Schristos }
7013*fd82c4c4Schristos 
7014*fd82c4c4Schristos static inline void
bfd_section_list_insert_before(bfd * abfd,asection * b,asection * s)7015*fd82c4c4Schristos bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s)
7016*fd82c4c4Schristos {
7017*fd82c4c4Schristos   asection *prev = b->prev;
7018*fd82c4c4Schristos   s->prev = prev;
7019*fd82c4c4Schristos   s->next = b;
7020*fd82c4c4Schristos   b->prev = s;
7021*fd82c4c4Schristos   if (prev)
7022*fd82c4c4Schristos     prev->next = s;
7023*fd82c4c4Schristos   else
7024*fd82c4c4Schristos     abfd->sections = s;
7025*fd82c4c4Schristos }
7026*fd82c4c4Schristos 
7027*fd82c4c4Schristos static inline bfd_boolean
bfd_section_removed_from_list(const bfd * abfd,const asection * s)7028*fd82c4c4Schristos bfd_section_removed_from_list (const bfd *abfd, const asection *s)
7029*fd82c4c4Schristos {
7030*fd82c4c4Schristos   return s->next ? s->next->prev != s : abfd->section_last != s;
7031*fd82c4c4Schristos }
7032*fd82c4c4Schristos 
7033b511d482Schristos 
7034c63b39d6Schristos typedef enum bfd_error
7035c63b39d6Schristos {
7036c63b39d6Schristos   bfd_error_no_error = 0,
7037c63b39d6Schristos   bfd_error_system_call,
7038c63b39d6Schristos   bfd_error_invalid_target,
7039c63b39d6Schristos   bfd_error_wrong_format,
7040c63b39d6Schristos   bfd_error_wrong_object_format,
7041c63b39d6Schristos   bfd_error_invalid_operation,
7042c63b39d6Schristos   bfd_error_no_memory,
7043c63b39d6Schristos   bfd_error_no_symbols,
7044c63b39d6Schristos   bfd_error_no_armap,
7045c63b39d6Schristos   bfd_error_no_more_archived_files,
7046c63b39d6Schristos   bfd_error_malformed_archive,
704744a21023Schristos   bfd_error_missing_dso,
7048c63b39d6Schristos   bfd_error_file_not_recognized,
7049c63b39d6Schristos   bfd_error_file_ambiguously_recognized,
7050c63b39d6Schristos   bfd_error_no_contents,
7051c63b39d6Schristos   bfd_error_nonrepresentable_section,
7052c63b39d6Schristos   bfd_error_no_debug_section,
7053c63b39d6Schristos   bfd_error_bad_value,
7054c63b39d6Schristos   bfd_error_file_truncated,
7055c63b39d6Schristos   bfd_error_file_too_big,
7056*fd82c4c4Schristos   bfd_error_sorry,
7057c63b39d6Schristos   bfd_error_on_input,
7058c63b39d6Schristos   bfd_error_invalid_error_code
7059c63b39d6Schristos }
7060c63b39d6Schristos bfd_error_type;
7061c63b39d6Schristos 
7062c63b39d6Schristos bfd_error_type bfd_get_error (void);
7063c63b39d6Schristos 
706477cd98dfSchristos void bfd_set_error (bfd_error_type error_tag);
706577cd98dfSchristos 
706677cd98dfSchristos void bfd_set_input_error (bfd *input, bfd_error_type error_tag);
7067c63b39d6Schristos 
7068c63b39d6Schristos const char *bfd_errmsg (bfd_error_type error_tag);
7069c63b39d6Schristos 
7070c63b39d6Schristos void bfd_perror (const char *message);
7071c63b39d6Schristos 
7072b511d482Schristos 
70739bc6a05dSchristos typedef void (*bfd_error_handler_type) (const char *, va_list);
7074c63b39d6Schristos 
707577cd98dfSchristos void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
707677cd98dfSchristos 
7077c63b39d6Schristos bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
7078c63b39d6Schristos 
7079c63b39d6Schristos void bfd_set_error_program_name (const char *);
7080c63b39d6Schristos 
7081b511d482Schristos 
7082fdeb0babSchristos typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
7083fdeb0babSchristos                                          const char *bfd_version,
7084fdeb0babSchristos                                          const char *bfd_file,
7085fdeb0babSchristos                                          int bfd_line);
7086fdeb0babSchristos 
7087fdeb0babSchristos bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
7088fdeb0babSchristos 
7089c63b39d6Schristos long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
7090c63b39d6Schristos 
7091c63b39d6Schristos long bfd_canonicalize_reloc
7092c63b39d6Schristos    (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
7093c63b39d6Schristos 
7094c63b39d6Schristos void bfd_set_reloc
7095c63b39d6Schristos    (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
7096c63b39d6Schristos 
709777cd98dfSchristos #define bfd_set_reloc(abfd, asect, location, count) \
709877cd98dfSchristos        BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
7099c63b39d6Schristos bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
7100c63b39d6Schristos 
7101c63b39d6Schristos int bfd_get_arch_size (bfd *abfd);
7102c63b39d6Schristos 
7103c63b39d6Schristos int bfd_get_sign_extend_vma (bfd *abfd);
7104c63b39d6Schristos 
7105c63b39d6Schristos bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
7106c63b39d6Schristos 
7107c63b39d6Schristos unsigned int bfd_get_gp_size (bfd *abfd);
7108c63b39d6Schristos 
7109c63b39d6Schristos void bfd_set_gp_size (bfd *abfd, unsigned int i);
7110c63b39d6Schristos 
7111c63b39d6Schristos bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
7112c63b39d6Schristos 
7113c63b39d6Schristos bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
7114c63b39d6Schristos 
7115c63b39d6Schristos #define bfd_copy_private_header_data(ibfd, obfd) \
7116c63b39d6Schristos        BFD_SEND (obfd, _bfd_copy_private_header_data, \
7117c63b39d6Schristos                  (ibfd, obfd))
7118c63b39d6Schristos bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
7119c63b39d6Schristos 
7120c63b39d6Schristos #define bfd_copy_private_bfd_data(ibfd, obfd) \
7121c63b39d6Schristos        BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
7122c63b39d6Schristos                  (ibfd, obfd))
7123c63b39d6Schristos bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
7124c63b39d6Schristos 
7125c63b39d6Schristos #define bfd_set_private_flags(abfd, flags) \
7126c63b39d6Schristos        BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
7127c63b39d6Schristos #define bfd_sizeof_headers(abfd, info) \
7128c63b39d6Schristos        BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
7129c63b39d6Schristos 
7130c63b39d6Schristos #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
7131c63b39d6Schristos        BFD_SEND (abfd, _bfd_find_nearest_line, \
7132b511d482Schristos                  (abfd, syms, sec, off, file, func, line, NULL))
7133c63b39d6Schristos 
7134fdeb0babSchristos #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
7135fdeb0babSchristos                                            line, disc) \
7136b511d482Schristos        BFD_SEND (abfd, _bfd_find_nearest_line, \
7137b511d482Schristos                  (abfd, syms, sec, off, file, func, line, disc))
7138fdeb0babSchristos 
7139c63b39d6Schristos #define bfd_find_line(abfd, syms, sym, file, line) \
7140c63b39d6Schristos        BFD_SEND (abfd, _bfd_find_line, \
7141c63b39d6Schristos                  (abfd, syms, sym, file, line))
7142c63b39d6Schristos 
7143c63b39d6Schristos #define bfd_find_inliner_info(abfd, file, func, line) \
7144c63b39d6Schristos        BFD_SEND (abfd, _bfd_find_inliner_info, \
7145c63b39d6Schristos                  (abfd, file, func, line))
7146c63b39d6Schristos 
7147c63b39d6Schristos #define bfd_debug_info_start(abfd) \
7148c63b39d6Schristos        BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
7149c63b39d6Schristos 
7150c63b39d6Schristos #define bfd_debug_info_end(abfd) \
7151c63b39d6Schristos        BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
7152c63b39d6Schristos 
7153c63b39d6Schristos #define bfd_debug_info_accumulate(abfd, section) \
7154c63b39d6Schristos        BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
7155c63b39d6Schristos 
7156c63b39d6Schristos #define bfd_stat_arch_elt(abfd, stat) \
7157*fd82c4c4Schristos        BFD_SEND (abfd->my_archive ? abfd->my_archive : abfd, \
7158*fd82c4c4Schristos                  _bfd_stat_arch_elt, (abfd, stat))
7159c63b39d6Schristos 
7160c63b39d6Schristos #define bfd_update_armap_timestamp(abfd) \
7161c63b39d6Schristos        BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
7162c63b39d6Schristos 
7163c63b39d6Schristos #define bfd_set_arch_mach(abfd, arch, mach)\
7164c63b39d6Schristos        BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
7165c63b39d6Schristos 
7166c63b39d6Schristos #define bfd_relax_section(abfd, section, link_info, again) \
7167c63b39d6Schristos        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
7168c63b39d6Schristos 
7169c63b39d6Schristos #define bfd_gc_sections(abfd, link_info) \
7170c63b39d6Schristos        BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
7171c63b39d6Schristos 
7172fdeb0babSchristos #define bfd_lookup_section_flags(link_info, flag_info, section) \
7173fdeb0babSchristos        BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
7174fdeb0babSchristos 
7175c63b39d6Schristos #define bfd_merge_sections(abfd, link_info) \
7176c63b39d6Schristos        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
7177c63b39d6Schristos 
7178c63b39d6Schristos #define bfd_is_group_section(abfd, sec) \
7179c63b39d6Schristos        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
7180c63b39d6Schristos 
7181*fd82c4c4Schristos #define bfd_group_name(abfd, sec) \
7182*fd82c4c4Schristos        BFD_SEND (abfd, _bfd_group_name, (abfd, sec))
7183*fd82c4c4Schristos 
7184c63b39d6Schristos #define bfd_discard_group(abfd, sec) \
7185c63b39d6Schristos        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
7186c63b39d6Schristos 
7187c63b39d6Schristos #define bfd_link_hash_table_create(abfd) \
7188c63b39d6Schristos        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
7189c63b39d6Schristos 
7190c63b39d6Schristos #define bfd_link_add_symbols(abfd, info) \
7191c63b39d6Schristos        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
7192c63b39d6Schristos 
7193c63b39d6Schristos #define bfd_link_just_syms(abfd, sec, info) \
7194c63b39d6Schristos        BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
7195c63b39d6Schristos 
7196c63b39d6Schristos #define bfd_final_link(abfd, info) \
7197c63b39d6Schristos        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
7198c63b39d6Schristos 
7199c63b39d6Schristos #define bfd_free_cached_info(abfd) \
7200c63b39d6Schristos        BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
7201c63b39d6Schristos 
7202c63b39d6Schristos #define bfd_get_dynamic_symtab_upper_bound(abfd) \
7203c63b39d6Schristos        BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
7204c63b39d6Schristos 
7205c63b39d6Schristos #define bfd_print_private_bfd_data(abfd, file)\
7206c63b39d6Schristos        BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
7207c63b39d6Schristos 
7208c63b39d6Schristos #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
7209c63b39d6Schristos        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
7210c63b39d6Schristos 
7211c63b39d6Schristos #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
7212c63b39d6Schristos        BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
7213c63b39d6Schristos                                                    dyncount, dynsyms, ret))
7214c63b39d6Schristos 
7215c63b39d6Schristos #define bfd_get_dynamic_reloc_upper_bound(abfd) \
7216c63b39d6Schristos        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
7217c63b39d6Schristos 
7218c63b39d6Schristos #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
7219c63b39d6Schristos        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
7220c63b39d6Schristos 
7221c63b39d6Schristos extern bfd_byte *bfd_get_relocated_section_contents
7222c63b39d6Schristos   (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
7223c63b39d6Schristos    bfd_boolean, asymbol **);
7224c63b39d6Schristos 
7225c63b39d6Schristos bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
7226c63b39d6Schristos 
7227c63b39d6Schristos bfd_vma bfd_emul_get_maxpagesize (const char *);
7228c63b39d6Schristos 
7229c63b39d6Schristos void bfd_emul_set_maxpagesize (const char *, bfd_vma);
7230c63b39d6Schristos 
723177cd98dfSchristos bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean);
7232c63b39d6Schristos 
7233c63b39d6Schristos void bfd_emul_set_commonpagesize (const char *, bfd_vma);
7234c63b39d6Schristos 
7235c63b39d6Schristos char *bfd_demangle (bfd *, const char *, int);
7236c63b39d6Schristos 
7237e8beca2cSchristos void bfd_update_compression_header
7238e8beca2cSchristos    (bfd *abfd, bfd_byte *contents, asection *sec);
7239e8beca2cSchristos 
7240e8beca2cSchristos bfd_boolean bfd_check_compression_header
7241e8beca2cSchristos    (bfd *abfd, bfd_byte *contents, asection *sec,
724277cd98dfSchristos     bfd_size_type *uncompressed_size,
724377cd98dfSchristos     unsigned int *uncompressed_alignment_power);
7244e8beca2cSchristos 
7245e8beca2cSchristos int bfd_get_compression_header_size (bfd *abfd, asection *sec);
7246e8beca2cSchristos 
7247a636ddcaSmrg bfd_size_type bfd_convert_section_size
7248a636ddcaSmrg    (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size);
7249a636ddcaSmrg 
7250a636ddcaSmrg bfd_boolean bfd_convert_section_contents
7251a636ddcaSmrg    (bfd *ibfd, asection *isec, bfd *obfd,
7252a636ddcaSmrg     bfd_byte **ptr, bfd_size_type *ptr_size);
7253a636ddcaSmrg 
7254c63b39d6Schristos /* Extracted from archive.c.  */
7255c63b39d6Schristos symindex bfd_get_next_mapent
7256c63b39d6Schristos    (bfd *abfd, symindex previous, carsym **sym);
7257c63b39d6Schristos 
7258c63b39d6Schristos bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
7259c63b39d6Schristos 
7260c63b39d6Schristos bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
7261c63b39d6Schristos 
7262c63b39d6Schristos /* Extracted from corefile.c.  */
7263c63b39d6Schristos const char *bfd_core_file_failing_command (bfd *abfd);
7264c63b39d6Schristos 
7265c63b39d6Schristos int bfd_core_file_failing_signal (bfd *abfd);
7266c63b39d6Schristos 
7267c63b39d6Schristos int bfd_core_file_pid (bfd *abfd);
7268c63b39d6Schristos 
7269c63b39d6Schristos bfd_boolean core_file_matches_executable_p
7270c63b39d6Schristos    (bfd *core_bfd, bfd *exec_bfd);
7271c63b39d6Schristos 
7272c63b39d6Schristos bfd_boolean generic_core_file_matches_executable_p
7273c63b39d6Schristos    (bfd *core_bfd, bfd *exec_bfd);
7274c63b39d6Schristos 
7275c63b39d6Schristos /* Extracted from targets.c.  */
7276c63b39d6Schristos #define BFD_SEND(bfd, message, arglist) \
7277c63b39d6Schristos   ((*((bfd)->xvec->message)) arglist)
7278c63b39d6Schristos 
7279c63b39d6Schristos #ifdef DEBUG_BFD_SEND
7280c63b39d6Schristos #undef BFD_SEND
7281c63b39d6Schristos #define BFD_SEND(bfd, message, arglist) \
7282c63b39d6Schristos   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7283c63b39d6Schristos     ((*((bfd)->xvec->message)) arglist) : \
7284c63b39d6Schristos     (bfd_assert (__FILE__,__LINE__), NULL))
7285c63b39d6Schristos #endif
7286c63b39d6Schristos #define BFD_SEND_FMT(bfd, message, arglist) \
7287c63b39d6Schristos   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
7288c63b39d6Schristos 
7289c63b39d6Schristos #ifdef DEBUG_BFD_SEND
7290c63b39d6Schristos #undef BFD_SEND_FMT
7291c63b39d6Schristos #define BFD_SEND_FMT(bfd, message, arglist) \
7292c63b39d6Schristos   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
7293c63b39d6Schristos    (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
7294c63b39d6Schristos    (bfd_assert (__FILE__,__LINE__), NULL))
7295c63b39d6Schristos #endif
7296c63b39d6Schristos 
7297c63b39d6Schristos enum bfd_flavour
7298c63b39d6Schristos {
7299a636ddcaSmrg   /* N.B. Update bfd_flavour_name if you change this.  */
7300c63b39d6Schristos   bfd_target_unknown_flavour,
7301c63b39d6Schristos   bfd_target_aout_flavour,
7302c63b39d6Schristos   bfd_target_coff_flavour,
7303c63b39d6Schristos   bfd_target_ecoff_flavour,
7304c63b39d6Schristos   bfd_target_xcoff_flavour,
7305c63b39d6Schristos   bfd_target_elf_flavour,
7306c63b39d6Schristos   bfd_target_tekhex_flavour,
7307c63b39d6Schristos   bfd_target_srec_flavour,
7308c63b39d6Schristos   bfd_target_verilog_flavour,
7309c63b39d6Schristos   bfd_target_ihex_flavour,
7310c63b39d6Schristos   bfd_target_som_flavour,
7311c63b39d6Schristos   bfd_target_os9k_flavour,
7312c63b39d6Schristos   bfd_target_versados_flavour,
7313c63b39d6Schristos   bfd_target_msdos_flavour,
7314c63b39d6Schristos   bfd_target_ovax_flavour,
7315c63b39d6Schristos   bfd_target_evax_flavour,
7316c63b39d6Schristos   bfd_target_mmo_flavour,
7317c63b39d6Schristos   bfd_target_mach_o_flavour,
7318c63b39d6Schristos   bfd_target_pef_flavour,
7319c63b39d6Schristos   bfd_target_pef_xlib_flavour,
7320c63b39d6Schristos   bfd_target_sym_flavour
7321c63b39d6Schristos };
7322c63b39d6Schristos 
7323c63b39d6Schristos enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
7324c63b39d6Schristos 
7325c63b39d6Schristos /* Forward declaration.  */
7326c63b39d6Schristos typedef struct bfd_link_info _bfd_link_info;
7327c63b39d6Schristos 
7328fdeb0babSchristos /* Forward declaration.  */
7329fdeb0babSchristos typedef struct flag_info flag_info;
7330fdeb0babSchristos 
7331*fd82c4c4Schristos typedef void (*bfd_cleanup) (bfd *);
7332*fd82c4c4Schristos 
7333c63b39d6Schristos typedef struct bfd_target
7334c63b39d6Schristos {
7335c63b39d6Schristos   /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
7336*fd82c4c4Schristos   const char *name;
7337c63b39d6Schristos 
7338c63b39d6Schristos  /* The "flavour" of a back end is a general indication about
7339c63b39d6Schristos     the contents of a file.  */
7340c63b39d6Schristos   enum bfd_flavour flavour;
7341c63b39d6Schristos 
7342c63b39d6Schristos   /* The order of bytes within the data area of a file.  */
7343c63b39d6Schristos   enum bfd_endian byteorder;
7344c63b39d6Schristos 
7345c63b39d6Schristos  /* The order of bytes within the header parts of a file.  */
7346c63b39d6Schristos   enum bfd_endian header_byteorder;
7347c63b39d6Schristos 
7348c63b39d6Schristos   /* A mask of all the flags which an executable may have set -
7349c63b39d6Schristos      from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
7350c63b39d6Schristos   flagword object_flags;
7351c63b39d6Schristos 
7352c63b39d6Schristos  /* A mask of all the flags which a section may have set - from
7353c63b39d6Schristos     the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
7354c63b39d6Schristos   flagword section_flags;
7355c63b39d6Schristos 
7356c63b39d6Schristos  /* The character normally found at the front of a symbol.
7357c63b39d6Schristos     (if any), perhaps `_'.  */
7358c63b39d6Schristos   char symbol_leading_char;
7359c63b39d6Schristos 
7360c63b39d6Schristos  /* The pad character for file names within an archive header.  */
7361c63b39d6Schristos   char ar_pad_char;
7362c63b39d6Schristos 
7363c63b39d6Schristos   /* The maximum number of characters in an archive header.  */
7364fdeb0babSchristos   unsigned char ar_max_namelen;
7365fdeb0babSchristos 
7366fdeb0babSchristos   /* How well this target matches, used to select between various
7367fdeb0babSchristos      possible targets when more than one target matches.  */
7368fdeb0babSchristos   unsigned char match_priority;
7369c63b39d6Schristos 
7370c63b39d6Schristos   /* Entries for byte swapping for data. These are different from the
7371c63b39d6Schristos      other entry points, since they don't take a BFD as the first argument.
7372c63b39d6Schristos      Certain other handlers could do the same.  */
7373c63b39d6Schristos   bfd_uint64_t   (*bfd_getx64) (const void *);
7374c63b39d6Schristos   bfd_int64_t    (*bfd_getx_signed_64) (const void *);
7375c63b39d6Schristos   void           (*bfd_putx64) (bfd_uint64_t, void *);
7376c63b39d6Schristos   bfd_vma        (*bfd_getx32) (const void *);
7377c63b39d6Schristos   bfd_signed_vma (*bfd_getx_signed_32) (const void *);
7378c63b39d6Schristos   void           (*bfd_putx32) (bfd_vma, void *);
7379c63b39d6Schristos   bfd_vma        (*bfd_getx16) (const void *);
7380c63b39d6Schristos   bfd_signed_vma (*bfd_getx_signed_16) (const void *);
7381c63b39d6Schristos   void           (*bfd_putx16) (bfd_vma, void *);
7382c63b39d6Schristos 
7383c63b39d6Schristos   /* Byte swapping for the headers.  */
7384c63b39d6Schristos   bfd_uint64_t   (*bfd_h_getx64) (const void *);
7385c63b39d6Schristos   bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
7386c63b39d6Schristos   void           (*bfd_h_putx64) (bfd_uint64_t, void *);
7387c63b39d6Schristos   bfd_vma        (*bfd_h_getx32) (const void *);
7388c63b39d6Schristos   bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
7389c63b39d6Schristos   void           (*bfd_h_putx32) (bfd_vma, void *);
7390c63b39d6Schristos   bfd_vma        (*bfd_h_getx16) (const void *);
7391c63b39d6Schristos   bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
7392c63b39d6Schristos   void           (*bfd_h_putx16) (bfd_vma, void *);
7393c63b39d6Schristos 
7394c63b39d6Schristos   /* Format dependent routines: these are vectors of entry points
7395c63b39d6Schristos      within the target vector structure, one for each format to check.  */
7396c63b39d6Schristos 
7397*fd82c4c4Schristos   /* Check the format of a file being read.  Return a <<bfd_cleanup>> on
7398*fd82c4c4Schristos      success or zero on failure.  */
7399*fd82c4c4Schristos   bfd_cleanup (*_bfd_check_format[bfd_type_end]) (bfd *);
7400c63b39d6Schristos 
7401c63b39d6Schristos   /* Set the format of a file being written.  */
7402c63b39d6Schristos   bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
7403c63b39d6Schristos 
7404c63b39d6Schristos   /* Write cached information into a file being written, at <<bfd_close>>.  */
7405c63b39d6Schristos   bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
7406c63b39d6Schristos 
7407c63b39d6Schristos 
7408c63b39d6Schristos   /* Generic entry points.  */
7409c63b39d6Schristos #define BFD_JUMP_TABLE_GENERIC(NAME) \
7410c63b39d6Schristos   NAME##_close_and_cleanup, \
7411c63b39d6Schristos   NAME##_bfd_free_cached_info, \
7412c63b39d6Schristos   NAME##_new_section_hook, \
7413c63b39d6Schristos   NAME##_get_section_contents, \
7414c63b39d6Schristos   NAME##_get_section_contents_in_window
7415c63b39d6Schristos 
7416c63b39d6Schristos   /* Called when the BFD is being closed to do any necessary cleanup.  */
7417c63b39d6Schristos   bfd_boolean (*_close_and_cleanup) (bfd *);
7418c63b39d6Schristos   /* Ask the BFD to free all cached information.  */
7419c63b39d6Schristos   bfd_boolean (*_bfd_free_cached_info) (bfd *);
7420c63b39d6Schristos   /* Called when a new section is created.  */
7421c63b39d6Schristos   bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
7422c63b39d6Schristos   /* Read the contents of a section.  */
742377cd98dfSchristos   bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
742477cd98dfSchristos                                             bfd_size_type);
742577cd98dfSchristos   bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
742677cd98dfSchristos                                                       bfd_window *, file_ptr,
742777cd98dfSchristos                                                       bfd_size_type);
7428c63b39d6Schristos 
7429c63b39d6Schristos   /* Entry points to copy private data.  */
7430c63b39d6Schristos #define BFD_JUMP_TABLE_COPY(NAME) \
7431c63b39d6Schristos   NAME##_bfd_copy_private_bfd_data, \
7432c63b39d6Schristos   NAME##_bfd_merge_private_bfd_data, \
7433c63b39d6Schristos   _bfd_generic_init_private_section_data, \
7434c63b39d6Schristos   NAME##_bfd_copy_private_section_data, \
7435c63b39d6Schristos   NAME##_bfd_copy_private_symbol_data, \
7436c63b39d6Schristos   NAME##_bfd_copy_private_header_data, \
7437c63b39d6Schristos   NAME##_bfd_set_private_flags, \
7438c63b39d6Schristos   NAME##_bfd_print_private_bfd_data
7439c63b39d6Schristos 
7440c63b39d6Schristos   /* Called to copy BFD general private data from one object file
7441c63b39d6Schristos      to another.  */
7442c63b39d6Schristos   bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
7443c63b39d6Schristos   /* Called to merge BFD general private data from one object file
7444c63b39d6Schristos      to a common output file when linking.  */
74459bc6a05dSchristos   bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *);
7446c63b39d6Schristos   /* Called to initialize BFD private section data from one object file
7447c63b39d6Schristos      to another.  */
7448c63b39d6Schristos #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
744977cd98dfSchristos        BFD_SEND (obfd, _bfd_init_private_section_data, \
745077cd98dfSchristos                  (ibfd, isec, obfd, osec, link_info))
745177cd98dfSchristos   bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
745277cd98dfSchristos                                                  sec_ptr,
745377cd98dfSchristos                                                  struct bfd_link_info *);
7454c63b39d6Schristos   /* Called to copy BFD private section data from one object file
7455c63b39d6Schristos      to another.  */
745677cd98dfSchristos   bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
745777cd98dfSchristos                                                  sec_ptr);
7458c63b39d6Schristos   /* Called to copy BFD private symbol data from one symbol
7459c63b39d6Schristos      to another.  */
746077cd98dfSchristos   bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
746177cd98dfSchristos                                                 asymbol *);
7462c63b39d6Schristos   /* Called to copy BFD private header data from one object file
7463c63b39d6Schristos      to another.  */
746477cd98dfSchristos   bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
7465c63b39d6Schristos   /* Called to set private backend flags.  */
7466c63b39d6Schristos   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
7467c63b39d6Schristos 
7468c63b39d6Schristos   /* Called to print private BFD data.  */
7469c63b39d6Schristos   bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
7470c63b39d6Schristos 
7471c63b39d6Schristos   /* Core file entry points.  */
7472c63b39d6Schristos #define BFD_JUMP_TABLE_CORE(NAME) \
7473c63b39d6Schristos   NAME##_core_file_failing_command, \
7474c63b39d6Schristos   NAME##_core_file_failing_signal, \
7475c63b39d6Schristos   NAME##_core_file_matches_executable_p, \
7476c63b39d6Schristos   NAME##_core_file_pid
7477c63b39d6Schristos 
7478c63b39d6Schristos   char *      (*_core_file_failing_command) (bfd *);
7479c63b39d6Schristos   int         (*_core_file_failing_signal) (bfd *);
7480c63b39d6Schristos   bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
7481c63b39d6Schristos   int         (*_core_file_pid) (bfd *);
7482c63b39d6Schristos 
7483c63b39d6Schristos   /* Archive entry points.  */
7484c63b39d6Schristos #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
7485c63b39d6Schristos   NAME##_slurp_armap, \
7486c63b39d6Schristos   NAME##_slurp_extended_name_table, \
7487c63b39d6Schristos   NAME##_construct_extended_name_table, \
7488c63b39d6Schristos   NAME##_truncate_arname, \
7489c63b39d6Schristos   NAME##_write_armap, \
7490c63b39d6Schristos   NAME##_read_ar_hdr, \
7491c63b39d6Schristos   NAME##_write_ar_hdr, \
7492c63b39d6Schristos   NAME##_openr_next_archived_file, \
7493c63b39d6Schristos   NAME##_get_elt_at_index, \
7494c63b39d6Schristos   NAME##_generic_stat_arch_elt, \
7495c63b39d6Schristos   NAME##_update_armap_timestamp
7496c63b39d6Schristos 
7497c63b39d6Schristos   bfd_boolean (*_bfd_slurp_armap) (bfd *);
7498c63b39d6Schristos   bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
749977cd98dfSchristos   bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
750077cd98dfSchristos                                                      bfd_size_type *,
750177cd98dfSchristos                                                      const char **);
7502c63b39d6Schristos   void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
750377cd98dfSchristos   bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
750477cd98dfSchristos                               unsigned int, int);
7505c63b39d6Schristos   void *      (*_bfd_read_ar_hdr_fn) (bfd *);
7506c63b39d6Schristos   bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
7507c63b39d6Schristos   bfd *       (*openr_next_archived_file) (bfd *, bfd *);
750877cd98dfSchristos #define bfd_get_elt_at_index(b,i) \
750977cd98dfSchristos        BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
7510c63b39d6Schristos   bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
7511c63b39d6Schristos   int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
7512c63b39d6Schristos   bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
7513c63b39d6Schristos 
7514c63b39d6Schristos   /* Entry points used for symbols.  */
7515c63b39d6Schristos #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
7516c63b39d6Schristos   NAME##_get_symtab_upper_bound, \
7517c63b39d6Schristos   NAME##_canonicalize_symtab, \
7518c63b39d6Schristos   NAME##_make_empty_symbol, \
7519c63b39d6Schristos   NAME##_print_symbol, \
7520c63b39d6Schristos   NAME##_get_symbol_info, \
7521b511d482Schristos   NAME##_get_symbol_version_string, \
7522c63b39d6Schristos   NAME##_bfd_is_local_label_name, \
7523c63b39d6Schristos   NAME##_bfd_is_target_special_symbol, \
7524c63b39d6Schristos   NAME##_get_lineno, \
7525c63b39d6Schristos   NAME##_find_nearest_line, \
7526b511d482Schristos   NAME##_find_line, \
7527c63b39d6Schristos   NAME##_find_inliner_info, \
7528c63b39d6Schristos   NAME##_bfd_make_debug_symbol, \
7529c63b39d6Schristos   NAME##_read_minisymbols, \
7530c63b39d6Schristos   NAME##_minisymbol_to_symbol
7531c63b39d6Schristos 
7532c63b39d6Schristos   long        (*_bfd_get_symtab_upper_bound) (bfd *);
753377cd98dfSchristos   long        (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
7534c63b39d6Schristos   struct bfd_symbol *
7535c63b39d6Schristos               (*_bfd_make_empty_symbol) (bfd *);
753677cd98dfSchristos   void        (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
753777cd98dfSchristos                                     bfd_print_symbol_type);
753877cd98dfSchristos #define bfd_print_symbol(b,p,s,e) \
753977cd98dfSchristos        BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
754077cd98dfSchristos   void        (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
754177cd98dfSchristos                                        symbol_info *);
754277cd98dfSchristos #define bfd_get_symbol_info(b,p,e) \
754377cd98dfSchristos        BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
754477cd98dfSchristos   const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
7545*fd82c4c4Schristos                                                  bfd_boolean,
754677cd98dfSchristos                                                  bfd_boolean *);
7547*fd82c4c4Schristos #define bfd_get_symbol_version_string(b,s,p,h) \
7548*fd82c4c4Schristos        BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,p,h))
7549c63b39d6Schristos   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
7550c63b39d6Schristos   bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
7551c63b39d6Schristos   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
755277cd98dfSchristos   bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
755377cd98dfSchristos                                          struct bfd_section *, bfd_vma,
755477cd98dfSchristos                                          const char **, const char **,
755577cd98dfSchristos                                          unsigned int *, unsigned int *);
755677cd98dfSchristos   bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
755777cd98dfSchristos                                  struct bfd_symbol *, const char **,
755877cd98dfSchristos                                  unsigned int *);
7559c63b39d6Schristos   bfd_boolean (*_bfd_find_inliner_info)
7560c63b39d6Schristos     (bfd *, const char **, const char **, unsigned int *);
7561c63b39d6Schristos  /* Back-door to allow format-aware applications to create debug symbols
7562c63b39d6Schristos     while using BFD for everything else.  Currently used by the assembler
7563c63b39d6Schristos     when creating COFF files.  */
756477cd98dfSchristos   asymbol *   (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
7565c63b39d6Schristos #define bfd_read_minisymbols(b, d, m, s) \
7566c63b39d6Schristos        BFD_SEND (b, _read_minisymbols, (b, d, m, s))
756777cd98dfSchristos   long        (*_read_minisymbols) (bfd *, bfd_boolean, void **,
756877cd98dfSchristos                                     unsigned int *);
7569c63b39d6Schristos #define bfd_minisymbol_to_symbol(b, d, m, f) \
7570c63b39d6Schristos        BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
757177cd98dfSchristos   asymbol *   (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
757277cd98dfSchristos                                         asymbol *);
7573c63b39d6Schristos 
7574c63b39d6Schristos   /* Routines for relocs.  */
7575c63b39d6Schristos #define BFD_JUMP_TABLE_RELOCS(NAME) \
7576c63b39d6Schristos   NAME##_get_reloc_upper_bound, \
7577c63b39d6Schristos   NAME##_canonicalize_reloc, \
757877cd98dfSchristos   NAME##_set_reloc, \
7579c63b39d6Schristos   NAME##_bfd_reloc_type_lookup, \
7580c63b39d6Schristos   NAME##_bfd_reloc_name_lookup
7581c63b39d6Schristos 
7582c63b39d6Schristos   long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
758377cd98dfSchristos   long        (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
758477cd98dfSchristos                                           struct bfd_symbol **);
758577cd98dfSchristos   void        (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
7586c63b39d6Schristos   /* See documentation on reloc types.  */
7587c63b39d6Schristos   reloc_howto_type *
7588c63b39d6Schristos               (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
7589c63b39d6Schristos   reloc_howto_type *
7590c63b39d6Schristos               (*reloc_name_lookup) (bfd *, const char *);
7591c63b39d6Schristos 
7592c63b39d6Schristos   /* Routines used when writing an object file.  */
7593c63b39d6Schristos #define BFD_JUMP_TABLE_WRITE(NAME) \
7594c63b39d6Schristos   NAME##_set_arch_mach, \
7595c63b39d6Schristos   NAME##_set_section_contents
7596c63b39d6Schristos 
759777cd98dfSchristos   bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
759877cd98dfSchristos                                      unsigned long);
759977cd98dfSchristos   bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
760077cd98dfSchristos                                             file_ptr, bfd_size_type);
7601c63b39d6Schristos 
7602c63b39d6Schristos   /* Routines used by the linker.  */
7603c63b39d6Schristos #define BFD_JUMP_TABLE_LINK(NAME) \
7604c63b39d6Schristos   NAME##_sizeof_headers, \
7605c63b39d6Schristos   NAME##_bfd_get_relocated_section_contents, \
7606c63b39d6Schristos   NAME##_bfd_relax_section, \
7607c63b39d6Schristos   NAME##_bfd_link_hash_table_create, \
7608c63b39d6Schristos   NAME##_bfd_link_add_symbols, \
7609c63b39d6Schristos   NAME##_bfd_link_just_syms, \
7610c63b39d6Schristos   NAME##_bfd_copy_link_hash_symbol_type, \
7611c63b39d6Schristos   NAME##_bfd_final_link, \
7612c63b39d6Schristos   NAME##_bfd_link_split_section, \
7613a636ddcaSmrg   NAME##_bfd_link_check_relocs, \
7614c63b39d6Schristos   NAME##_bfd_gc_sections, \
7615fdeb0babSchristos   NAME##_bfd_lookup_section_flags, \
7616c63b39d6Schristos   NAME##_bfd_merge_sections, \
7617c63b39d6Schristos   NAME##_bfd_is_group_section, \
7618*fd82c4c4Schristos   NAME##_bfd_group_name, \
7619c63b39d6Schristos   NAME##_bfd_discard_group, \
7620c63b39d6Schristos   NAME##_section_already_linked, \
762177cd98dfSchristos   NAME##_bfd_define_common_symbol, \
762277cd98dfSchristos   NAME##_bfd_link_hide_symbol, \
762377cd98dfSchristos   NAME##_bfd_define_start_stop
7624c63b39d6Schristos 
7625c63b39d6Schristos   int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
762677cd98dfSchristos   bfd_byte *  (*_bfd_get_relocated_section_contents) (bfd *,
762777cd98dfSchristos                                                       struct bfd_link_info *,
762877cd98dfSchristos                                                       struct bfd_link_order *,
762977cd98dfSchristos                                                       bfd_byte *, bfd_boolean,
763077cd98dfSchristos                                                       struct bfd_symbol **);
7631c63b39d6Schristos 
763277cd98dfSchristos   bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
763377cd98dfSchristos                                      struct bfd_link_info *, bfd_boolean *);
7634c63b39d6Schristos 
7635c63b39d6Schristos   /* Create a hash table for the linker.  Different backends store
7636c63b39d6Schristos      different information in this table.  */
7637c63b39d6Schristos   struct bfd_link_hash_table *
7638c63b39d6Schristos               (*_bfd_link_hash_table_create) (bfd *);
7639c63b39d6Schristos 
7640c63b39d6Schristos   /* Add symbols from this object file into the hash table.  */
7641c63b39d6Schristos   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
7642c63b39d6Schristos 
7643c63b39d6Schristos   /* Indicate that we are only retrieving symbol values from this section.  */
7644c63b39d6Schristos   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
7645c63b39d6Schristos 
7646b511d482Schristos   /* Copy the symbol type and other attributes for a linker script
7647b511d482Schristos      assignment of one symbol to another.  */
7648c63b39d6Schristos #define bfd_copy_link_hash_symbol_type(b, t, f) \
7649c63b39d6Schristos        BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
765077cd98dfSchristos   void        (*_bfd_copy_link_hash_symbol_type) (bfd *,
765177cd98dfSchristos                                                   struct bfd_link_hash_entry *,
765277cd98dfSchristos                                                   struct bfd_link_hash_entry *);
7653c63b39d6Schristos 
7654c63b39d6Schristos   /* Do a link based on the link_order structures attached to each
7655c63b39d6Schristos      section of the BFD.  */
7656c63b39d6Schristos   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
7657c63b39d6Schristos 
7658c63b39d6Schristos   /* Should this section be split up into smaller pieces during linking.  */
7659c63b39d6Schristos   bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
7660c63b39d6Schristos 
7661a636ddcaSmrg   /* Check the relocations in the bfd for validity.  */
7662a636ddcaSmrg   bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *);
7663a636ddcaSmrg 
7664c63b39d6Schristos   /* Remove sections that are not referenced from the output.  */
7665c63b39d6Schristos   bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
7666c63b39d6Schristos 
7667fdeb0babSchristos   /* Sets the bitmask of allowed and disallowed section flags.  */
7668fdeb0babSchristos   bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
766977cd98dfSchristos                                             struct flag_info *, asection *);
7670fdeb0babSchristos 
7671c63b39d6Schristos   /* Attempt to merge SEC_MERGE sections.  */
7672c63b39d6Schristos   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
7673c63b39d6Schristos 
7674c63b39d6Schristos   /* Is this section a member of a group?  */
7675c63b39d6Schristos   bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
7676c63b39d6Schristos 
7677*fd82c4c4Schristos   /* The group name, if section is a member of a group.  */
7678*fd82c4c4Schristos   const char *(*_bfd_group_name) (bfd *, const struct bfd_section *);
7679*fd82c4c4Schristos 
7680c63b39d6Schristos   /* Discard members of a group.  */
7681c63b39d6Schristos   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
7682c63b39d6Schristos 
7683c63b39d6Schristos   /* Check if SEC has been already linked during a reloceatable or
7684c63b39d6Schristos      final link.  */
7685fdeb0babSchristos   bfd_boolean (*_section_already_linked) (bfd *, asection *,
7686c63b39d6Schristos                                           struct bfd_link_info *);
7687c63b39d6Schristos 
7688c63b39d6Schristos   /* Define a common symbol.  */
7689c63b39d6Schristos   bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
7690c63b39d6Schristos                                             struct bfd_link_hash_entry *);
7691c63b39d6Schristos 
769277cd98dfSchristos   /* Hide a symbol.  */
769377cd98dfSchristos   void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *,
769477cd98dfSchristos                                  struct bfd_link_hash_entry *);
769577cd98dfSchristos 
769677cd98dfSchristos   /* Define a __start, __stop, .startof. or .sizeof. symbol.  */
769777cd98dfSchristos   struct bfd_link_hash_entry *
769877cd98dfSchristos               (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
769977cd98dfSchristos                                          asection *);
770077cd98dfSchristos 
7701c63b39d6Schristos   /* Routines to handle dynamic symbols and relocs.  */
7702c63b39d6Schristos #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
7703c63b39d6Schristos   NAME##_get_dynamic_symtab_upper_bound, \
7704c63b39d6Schristos   NAME##_canonicalize_dynamic_symtab, \
7705c63b39d6Schristos   NAME##_get_synthetic_symtab, \
7706c63b39d6Schristos   NAME##_get_dynamic_reloc_upper_bound, \
7707c63b39d6Schristos   NAME##_canonicalize_dynamic_reloc
7708c63b39d6Schristos 
7709c63b39d6Schristos   /* Get the amount of memory required to hold the dynamic symbols.  */
7710c63b39d6Schristos   long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
7711c63b39d6Schristos   /* Read in the dynamic symbols.  */
771277cd98dfSchristos   long        (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
7713c63b39d6Schristos   /* Create synthetized symbols.  */
771477cd98dfSchristos   long        (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
771577cd98dfSchristos                                             long, struct bfd_symbol **,
7716c63b39d6Schristos                                             struct bfd_symbol **);
7717c63b39d6Schristos   /* Get the amount of memory required to hold the dynamic relocs.  */
7718c63b39d6Schristos   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
7719c63b39d6Schristos   /* Read in the dynamic relocs.  */
772077cd98dfSchristos   long        (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
772177cd98dfSchristos                                                   struct bfd_symbol **);
7722c63b39d6Schristos 
7723c63b39d6Schristos   /* Opposite endian version of this target.  */
7724c63b39d6Schristos   const struct bfd_target *alternative_target;
7725c63b39d6Schristos 
7726c63b39d6Schristos   /* Data for use by back-end routines, which isn't
7727c63b39d6Schristos      generic enough to belong in this structure.  */
7728c63b39d6Schristos   const void *backend_data;
7729c63b39d6Schristos 
7730c63b39d6Schristos } bfd_target;
7731c63b39d6Schristos 
7732*fd82c4c4Schristos static inline const char *
bfd_get_target(const bfd * abfd)7733*fd82c4c4Schristos bfd_get_target (const bfd *abfd)
7734*fd82c4c4Schristos {
7735*fd82c4c4Schristos   return abfd->xvec->name;
7736*fd82c4c4Schristos }
7737*fd82c4c4Schristos 
7738*fd82c4c4Schristos static inline enum bfd_flavour
bfd_get_flavour(const bfd * abfd)7739*fd82c4c4Schristos bfd_get_flavour (const bfd *abfd)
7740*fd82c4c4Schristos {
7741*fd82c4c4Schristos   return abfd->xvec->flavour;
7742*fd82c4c4Schristos }
7743*fd82c4c4Schristos 
7744*fd82c4c4Schristos static inline flagword
bfd_applicable_file_flags(const bfd * abfd)7745*fd82c4c4Schristos bfd_applicable_file_flags (const bfd *abfd)
7746*fd82c4c4Schristos {
7747*fd82c4c4Schristos   return abfd->xvec->object_flags;
7748*fd82c4c4Schristos }
7749*fd82c4c4Schristos 
7750*fd82c4c4Schristos static inline bfd_boolean
bfd_family_coff(const bfd * abfd)7751*fd82c4c4Schristos bfd_family_coff (const bfd *abfd)
7752*fd82c4c4Schristos {
7753*fd82c4c4Schristos   return (bfd_get_flavour (abfd) == bfd_target_coff_flavour
7754*fd82c4c4Schristos           || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
7755*fd82c4c4Schristos }
7756*fd82c4c4Schristos 
7757*fd82c4c4Schristos static inline bfd_boolean
bfd_big_endian(const bfd * abfd)7758*fd82c4c4Schristos bfd_big_endian (const bfd *abfd)
7759*fd82c4c4Schristos {
7760*fd82c4c4Schristos   return abfd->xvec->byteorder == BFD_ENDIAN_BIG;
7761*fd82c4c4Schristos }
7762*fd82c4c4Schristos static inline bfd_boolean
bfd_little_endian(const bfd * abfd)7763*fd82c4c4Schristos bfd_little_endian (const bfd *abfd)
7764*fd82c4c4Schristos {
7765*fd82c4c4Schristos   return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE;
7766*fd82c4c4Schristos }
7767*fd82c4c4Schristos 
7768*fd82c4c4Schristos static inline bfd_boolean
bfd_header_big_endian(const bfd * abfd)7769*fd82c4c4Schristos bfd_header_big_endian (const bfd *abfd)
7770*fd82c4c4Schristos {
7771*fd82c4c4Schristos   return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG;
7772*fd82c4c4Schristos }
7773*fd82c4c4Schristos 
7774*fd82c4c4Schristos static inline bfd_boolean
bfd_header_little_endian(const bfd * abfd)7775*fd82c4c4Schristos bfd_header_little_endian (const bfd *abfd)
7776*fd82c4c4Schristos {
7777*fd82c4c4Schristos   return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE;
7778*fd82c4c4Schristos }
7779*fd82c4c4Schristos 
7780*fd82c4c4Schristos static inline flagword
bfd_applicable_section_flags(const bfd * abfd)7781*fd82c4c4Schristos bfd_applicable_section_flags (const bfd *abfd)
7782*fd82c4c4Schristos {
7783*fd82c4c4Schristos   return abfd->xvec->section_flags;
7784*fd82c4c4Schristos }
7785*fd82c4c4Schristos 
7786*fd82c4c4Schristos static inline char
bfd_get_symbol_leading_char(const bfd * abfd)7787*fd82c4c4Schristos bfd_get_symbol_leading_char (const bfd *abfd)
7788*fd82c4c4Schristos {
7789*fd82c4c4Schristos   return abfd->xvec->symbol_leading_char;
7790*fd82c4c4Schristos }
7791*fd82c4c4Schristos 
7792*fd82c4c4Schristos static inline enum bfd_flavour
bfd_asymbol_flavour(const asymbol * sy)7793*fd82c4c4Schristos bfd_asymbol_flavour (const asymbol *sy)
7794*fd82c4c4Schristos {
7795*fd82c4c4Schristos   if ((sy->flags & BSF_SYNTHETIC) != 0)
7796*fd82c4c4Schristos     return bfd_target_unknown_flavour;
7797*fd82c4c4Schristos   return sy->the_bfd->xvec->flavour;
7798*fd82c4c4Schristos }
7799*fd82c4c4Schristos 
7800c63b39d6Schristos bfd_boolean bfd_set_default_target (const char *name);
7801c63b39d6Schristos 
7802c63b39d6Schristos const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
7803c63b39d6Schristos 
7804c63b39d6Schristos const bfd_target *bfd_get_target_info (const char *target_name,
7805c63b39d6Schristos     bfd *abfd,
7806c63b39d6Schristos     bfd_boolean *is_bigendian,
7807c63b39d6Schristos     int *underscoring,
7808c63b39d6Schristos     const char **def_target_arch);
7809c63b39d6Schristos const char ** bfd_target_list (void);
7810c63b39d6Schristos 
7811a636ddcaSmrg const bfd_target *bfd_iterate_over_targets
7812a636ddcaSmrg    (int (*func) (const bfd_target *, void *),
7813a636ddcaSmrg     void *data);
7814a636ddcaSmrg 
7815a636ddcaSmrg const char *bfd_flavour_name (enum bfd_flavour flavour);
7816c63b39d6Schristos 
7817c63b39d6Schristos /* Extracted from format.c.  */
7818c63b39d6Schristos bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
7819c63b39d6Schristos 
7820c63b39d6Schristos bfd_boolean bfd_check_format_matches
7821c63b39d6Schristos    (bfd *abfd, bfd_format format, char ***matching);
7822c63b39d6Schristos 
7823c63b39d6Schristos bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
7824c63b39d6Schristos 
7825c63b39d6Schristos const char *bfd_format_string (bfd_format format);
7826c63b39d6Schristos 
7827c63b39d6Schristos /* Extracted from linker.c.  */
782877cd98dfSchristos /* Return TRUE if the symbol described by a linker hash entry H
782977cd98dfSchristos    is going to be absolute.  Linker-script defined symbols can be
783077cd98dfSchristos    converted from absolute to section-relative ones late in the
783177cd98dfSchristos    link.  Use this macro to correctly determine whether the symbol
783277cd98dfSchristos    will actually end up absolute in output.  */
783377cd98dfSchristos #define bfd_is_abs_symbol(H) \
783477cd98dfSchristos   (((H)->type == bfd_link_hash_defined \
783577cd98dfSchristos     || (H)->type == bfd_link_hash_defweak) \
783677cd98dfSchristos    && bfd_is_abs_section ((H)->u.def.section) \
783777cd98dfSchristos    && !(H)->rel_from_abs)
783877cd98dfSchristos 
7839c63b39d6Schristos bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
7840c63b39d6Schristos 
7841c63b39d6Schristos #define bfd_link_split_section(abfd, sec) \
7842c63b39d6Schristos        BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
7843c63b39d6Schristos 
7844fdeb0babSchristos bfd_boolean bfd_section_already_linked (bfd *abfd,
7845fdeb0babSchristos     asection *sec,
7846c63b39d6Schristos     struct bfd_link_info *info);
7847c63b39d6Schristos 
7848c63b39d6Schristos #define bfd_section_already_linked(abfd, sec, info) \
7849c63b39d6Schristos        BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
7850c63b39d6Schristos 
7851c63b39d6Schristos bfd_boolean bfd_generic_define_common_symbol
7852c63b39d6Schristos    (bfd *output_bfd, struct bfd_link_info *info,
7853c63b39d6Schristos     struct bfd_link_hash_entry *h);
7854c63b39d6Schristos 
7855c63b39d6Schristos #define bfd_define_common_symbol(output_bfd, info, h) \
7856c63b39d6Schristos        BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
7857c63b39d6Schristos 
785877cd98dfSchristos void _bfd_generic_link_hide_symbol
785977cd98dfSchristos    (bfd *output_bfd, struct bfd_link_info *info,
786077cd98dfSchristos     struct bfd_link_hash_entry *h);
786177cd98dfSchristos 
786277cd98dfSchristos #define bfd_link_hide_symbol(output_bfd, info, h) \
786377cd98dfSchristos        BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h))
786477cd98dfSchristos 
786577cd98dfSchristos struct bfd_link_hash_entry *bfd_generic_define_start_stop
786677cd98dfSchristos    (struct bfd_link_info *info,
786777cd98dfSchristos     const char *symbol, asection *sec);
786877cd98dfSchristos 
786977cd98dfSchristos #define bfd_define_start_stop(output_bfd, info, symbol, sec) \
787077cd98dfSchristos        BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
787177cd98dfSchristos 
7872c63b39d6Schristos struct bfd_elf_version_tree * bfd_find_version_for_sym
7873c63b39d6Schristos    (struct bfd_elf_version_tree *verdefs,
7874c63b39d6Schristos     const char *sym_name, bfd_boolean *hide);
7875c63b39d6Schristos 
7876fdeb0babSchristos bfd_boolean bfd_hide_sym_by_version
7877fdeb0babSchristos    (struct bfd_elf_version_tree *verdefs, const char *sym_name);
7878fdeb0babSchristos 
7879a636ddcaSmrg bfd_boolean bfd_link_check_relocs
7880a636ddcaSmrg    (bfd *abfd, struct bfd_link_info *info);
7881a636ddcaSmrg 
7882a636ddcaSmrg bfd_boolean _bfd_generic_link_check_relocs
7883a636ddcaSmrg    (bfd *abfd, struct bfd_link_info *info);
7884a636ddcaSmrg 
78859bc6a05dSchristos bfd_boolean bfd_merge_private_bfd_data
78869bc6a05dSchristos    (bfd *ibfd, struct bfd_link_info *info);
78879bc6a05dSchristos 
78889bc6a05dSchristos #define bfd_merge_private_bfd_data(ibfd, info) \
78899bc6a05dSchristos        BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
78909bc6a05dSchristos                  (ibfd, info))
7891c63b39d6Schristos /* Extracted from simple.c.  */
7892c63b39d6Schristos bfd_byte *bfd_simple_get_relocated_section_contents
7893c63b39d6Schristos    (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
7894c63b39d6Schristos 
7895c63b39d6Schristos /* Extracted from compress.c.  */
7896c63b39d6Schristos bfd_boolean bfd_get_full_section_contents
7897c63b39d6Schristos    (bfd *abfd, asection *section, bfd_byte **ptr);
7898c63b39d6Schristos 
7899fdeb0babSchristos void bfd_cache_section_contents
7900fdeb0babSchristos    (asection *sec, void *contents);
7901fdeb0babSchristos 
7902e8beca2cSchristos bfd_boolean bfd_is_section_compressed_with_header
7903e8beca2cSchristos    (bfd *abfd, asection *section,
7904e8beca2cSchristos     int *compression_header_size_p,
790577cd98dfSchristos     bfd_size_type *uncompressed_size_p,
790677cd98dfSchristos     unsigned int *uncompressed_alignment_power_p);
7907e8beca2cSchristos 
7908c63b39d6Schristos bfd_boolean bfd_is_section_compressed
7909c63b39d6Schristos    (bfd *abfd, asection *section);
7910c63b39d6Schristos 
7911c63b39d6Schristos bfd_boolean bfd_init_section_decompress_status
7912c63b39d6Schristos    (bfd *abfd, asection *section);
7913c63b39d6Schristos 
7914c63b39d6Schristos bfd_boolean bfd_init_section_compress_status
7915c63b39d6Schristos    (bfd *abfd, asection *section);
7916c63b39d6Schristos 
7917e8beca2cSchristos bfd_boolean bfd_compress_section
7918e8beca2cSchristos    (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer);
7919e8beca2cSchristos 
7920c63b39d6Schristos #ifdef __cplusplus
7921c63b39d6Schristos }
7922c63b39d6Schristos #endif
7923c63b39d6Schristos #endif
7924