xref: /minix3/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
118a5822eSThomas Veerman /* This file is automatically generated.  DO NOT EDIT! */
2*0a6a1f1dSLionel Sambuc /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp  */
3*0a6a1f1dSLionel Sambuc /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp  */
418a5822eSThomas Veerman 
518a5822eSThomas Veerman /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
618a5822eSThomas Veerman    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
718a5822eSThomas Veerman    "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
818a5822eSThomas Veerman    "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
918a5822eSThomas Veerman    "linker.c", "simple.c" and "compress.c".
1018a5822eSThomas Veerman    Run "make headers" in your build bfd/ to regenerate.  */
1118a5822eSThomas Veerman 
1218a5822eSThomas Veerman /* Main header file for the bfd library -- portable access to object files.
1318a5822eSThomas Veerman 
14c9ea9e7aSLionel Sambuc    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
15c9ea9e7aSLionel Sambuc    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
16c9ea9e7aSLionel Sambuc    2012 Free Software Foundation, Inc.
1718a5822eSThomas Veerman 
1818a5822eSThomas Veerman    Contributed by Cygnus Support.
1918a5822eSThomas Veerman 
2018a5822eSThomas Veerman    This file is part of BFD, the Binary File Descriptor library.
2118a5822eSThomas Veerman 
2218a5822eSThomas Veerman    This program is free software; you can redistribute it and/or modify
2318a5822eSThomas Veerman    it under the terms of the GNU General Public License as published by
2418a5822eSThomas Veerman    the Free Software Foundation; either version 3 of the License, or
2518a5822eSThomas Veerman    (at your option) any later version.
2618a5822eSThomas Veerman 
2718a5822eSThomas Veerman    This program is distributed in the hope that it will be useful,
2818a5822eSThomas Veerman    but WITHOUT ANY WARRANTY; without even the implied warranty of
2918a5822eSThomas Veerman    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3018a5822eSThomas Veerman    GNU General Public License for more details.
3118a5822eSThomas Veerman 
3218a5822eSThomas Veerman    You should have received a copy of the GNU General Public License
3318a5822eSThomas Veerman    along with this program; if not, write to the Free Software
3418a5822eSThomas Veerman    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
3518a5822eSThomas Veerman 
3618a5822eSThomas Veerman #ifndef __BFD_H_SEEN__
3718a5822eSThomas Veerman #define __BFD_H_SEEN__
3818a5822eSThomas Veerman 
39c9ea9e7aSLionel Sambuc /* PR 14072: Ensure that config.h is included first.  */
40c9ea9e7aSLionel Sambuc #if !defined PACKAGE && !defined PACKAGE_VERSION
41c9ea9e7aSLionel Sambuc #error config.h must be included before this header
42c9ea9e7aSLionel Sambuc #endif
43c9ea9e7aSLionel Sambuc 
4418a5822eSThomas Veerman #ifdef __cplusplus
4518a5822eSThomas Veerman extern "C" {
4618a5822eSThomas Veerman #endif
4718a5822eSThomas Veerman 
4818a5822eSThomas Veerman #include "ansidecl.h"
4918a5822eSThomas Veerman #include "symcat.h"
50c9ea9e7aSLionel Sambuc #include <sys/stat.h>
51c9ea9e7aSLionel Sambuc 
5218a5822eSThomas Veerman #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
5318a5822eSThomas Veerman #ifndef SABER
5418a5822eSThomas Veerman /* This hack is to avoid a problem with some strict ANSI C preprocessors.
5518a5822eSThomas Veerman    The problem is, "32_" is not a valid preprocessing token, and we don't
5618a5822eSThomas Veerman    want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
5718a5822eSThomas Veerman    cause the inner CONCAT2 macros to be evaluated first, producing
5818a5822eSThomas Veerman    still-valid pp-tokens.  Then the final concatenation can be done.  */
5918a5822eSThomas Veerman #undef CONCAT4
6018a5822eSThomas Veerman #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
6118a5822eSThomas Veerman #endif
6218a5822eSThomas Veerman #endif
6318a5822eSThomas Veerman 
6418a5822eSThomas Veerman /* This is a utility macro to handle the situation where the code
6518a5822eSThomas Veerman    wants to place a constant string into the code, followed by a
6618a5822eSThomas Veerman    comma and then the length of the string.  Doing this by hand
6718a5822eSThomas Veerman    is error prone, so using this macro is safer.  */
6818a5822eSThomas Veerman #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
6918a5822eSThomas Veerman /* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
7018a5822eSThomas Veerman    to create the arguments to another macro, since the preprocessor
7118a5822eSThomas Veerman    will mis-count the number of arguments to the outer macro (by not
7218a5822eSThomas Veerman    evaluating STRING_COMMA_LEN and so missing the comma).  This is a
7318a5822eSThomas Veerman    problem for example when trying to use STRING_COMMA_LEN to build
7418a5822eSThomas Veerman    the arguments to the strncmp() macro.  Hence this alternative
7518a5822eSThomas Veerman    definition of strncmp is provided here.
7618a5822eSThomas Veerman 
7718a5822eSThomas Veerman    Note - these macros do NOT work if STR2 is not a constant string.  */
7818a5822eSThomas Veerman #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
7918a5822eSThomas Veerman   /* strcpy() can have a similar problem, but since we know we are
8018a5822eSThomas Veerman      copying a constant string, we can use memcpy which will be faster
8118a5822eSThomas Veerman      since there is no need to check for a NUL byte inside STR.  We
8218a5822eSThomas Veerman      can also save time if we do not need to copy the terminating NUL.  */
8318a5822eSThomas Veerman #define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
8418a5822eSThomas Veerman #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
8518a5822eSThomas Veerman 
8618a5822eSThomas Veerman 
8718a5822eSThomas Veerman #define BFD_SUPPORTS_PLUGINS 0
8818a5822eSThomas Veerman 
8918a5822eSThomas Veerman /* The word size used by BFD on the host.  This may be 64 with a 32
9018a5822eSThomas Veerman    bit target if the host is 64 bit, or if other 64 bit targets have
9118a5822eSThomas Veerman    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
9218a5822eSThomas Veerman #define BFD_ARCH_SIZE 32
9318a5822eSThomas Veerman 
9418a5822eSThomas Veerman /* The word size of the default bfd target.  */
9518a5822eSThomas Veerman #define BFD_DEFAULT_TARGET_SIZE 32
9618a5822eSThomas Veerman 
9718a5822eSThomas Veerman #define BFD_HOST_64BIT_LONG 0
9818a5822eSThomas Veerman #define BFD_HOST_64BIT_LONG_LONG 1
9918a5822eSThomas Veerman #if 1
10018a5822eSThomas Veerman #define BFD_HOST_64_BIT long long
10118a5822eSThomas Veerman #define BFD_HOST_U_64_BIT unsigned long long
10218a5822eSThomas Veerman typedef BFD_HOST_64_BIT bfd_int64_t;
10318a5822eSThomas Veerman typedef BFD_HOST_U_64_BIT bfd_uint64_t;
10418a5822eSThomas Veerman #endif
10518a5822eSThomas Veerman 
10618a5822eSThomas Veerman #if BFD_ARCH_SIZE >= 64
10718a5822eSThomas Veerman #define BFD64
10818a5822eSThomas Veerman #endif
10918a5822eSThomas Veerman 
11018a5822eSThomas Veerman #ifndef INLINE
11118a5822eSThomas Veerman #if __GNUC__ >= 2
11218a5822eSThomas Veerman #define INLINE __inline__
11318a5822eSThomas Veerman #else
11418a5822eSThomas Veerman #define INLINE
11518a5822eSThomas Veerman #endif
11618a5822eSThomas Veerman #endif
11718a5822eSThomas Veerman 
11818a5822eSThomas Veerman /* Declaring a type wide enough to hold a host long and a host pointer.  */
11918a5822eSThomas Veerman #define BFD_HOSTPTR_T	unsigned long
12018a5822eSThomas Veerman typedef BFD_HOSTPTR_T bfd_hostptr_t;
12118a5822eSThomas Veerman 
12218a5822eSThomas Veerman /* Forward declaration.  */
12318a5822eSThomas Veerman typedef struct bfd bfd;
12418a5822eSThomas Veerman 
12518a5822eSThomas Veerman /* Boolean type used in bfd.  Too many systems define their own
12618a5822eSThomas Veerman    versions of "boolean" for us to safely typedef a "boolean" of
12718a5822eSThomas Veerman    our own.  Using an enum for "bfd_boolean" has its own set of
12818a5822eSThomas Veerman    problems, with strange looking casts required to avoid warnings
12918a5822eSThomas Veerman    on some older compilers.  Thus we just use an int.
13018a5822eSThomas Veerman 
13118a5822eSThomas Veerman    General rule: Functions which are bfd_boolean return TRUE on
13218a5822eSThomas Veerman    success and FALSE on failure (unless they're a predicate).  */
13318a5822eSThomas Veerman 
13418a5822eSThomas Veerman typedef int bfd_boolean;
13518a5822eSThomas Veerman #undef FALSE
13618a5822eSThomas Veerman #undef TRUE
13718a5822eSThomas Veerman #define FALSE 0
13818a5822eSThomas Veerman #define TRUE 1
13918a5822eSThomas Veerman 
14018a5822eSThomas Veerman #ifdef BFD64
14118a5822eSThomas Veerman 
14218a5822eSThomas Veerman #ifndef BFD_HOST_64_BIT
14318a5822eSThomas Veerman  #error No 64 bit integer type available
14418a5822eSThomas Veerman #endif /* ! defined (BFD_HOST_64_BIT) */
14518a5822eSThomas Veerman 
14618a5822eSThomas Veerman typedef BFD_HOST_U_64_BIT bfd_vma;
14718a5822eSThomas Veerman typedef BFD_HOST_64_BIT bfd_signed_vma;
14818a5822eSThomas Veerman typedef BFD_HOST_U_64_BIT bfd_size_type;
14918a5822eSThomas Veerman typedef BFD_HOST_U_64_BIT symvalue;
15018a5822eSThomas Veerman 
15118a5822eSThomas Veerman #if BFD_HOST_64BIT_LONG
15218a5822eSThomas Veerman #define BFD_VMA_FMT "l"
15318a5822eSThomas Veerman #elif defined (__MSVCRT__)
15418a5822eSThomas Veerman #define BFD_VMA_FMT "I64"
15518a5822eSThomas Veerman #else
15618a5822eSThomas Veerman #define BFD_VMA_FMT "ll"
15718a5822eSThomas Veerman #endif
15818a5822eSThomas Veerman 
15918a5822eSThomas Veerman #ifndef fprintf_vma
16018a5822eSThomas Veerman #define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
16118a5822eSThomas Veerman #define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
16218a5822eSThomas Veerman #endif
16318a5822eSThomas Veerman 
16418a5822eSThomas Veerman #else /* not BFD64  */
16518a5822eSThomas Veerman 
16618a5822eSThomas Veerman /* Represent a target address.  Also used as a generic unsigned type
16718a5822eSThomas Veerman    which is guaranteed to be big enough to hold any arithmetic types
16818a5822eSThomas Veerman    we need to deal with.  */
16918a5822eSThomas Veerman typedef unsigned long bfd_vma;
17018a5822eSThomas Veerman 
17118a5822eSThomas Veerman /* A generic signed type which is guaranteed to be big enough to hold any
17218a5822eSThomas Veerman    arithmetic types we need to deal with.  Can be assumed to be compatible
17318a5822eSThomas Veerman    with bfd_vma in the same way that signed and unsigned ints are compatible
17418a5822eSThomas Veerman    (as parameters, in assignment, etc).  */
17518a5822eSThomas Veerman typedef long bfd_signed_vma;
17618a5822eSThomas Veerman 
17718a5822eSThomas Veerman typedef unsigned long symvalue;
17818a5822eSThomas Veerman typedef unsigned long bfd_size_type;
17918a5822eSThomas Veerman 
18018a5822eSThomas Veerman /* Print a bfd_vma x on stream s.  */
18118a5822eSThomas Veerman #define BFD_VMA_FMT "l"
18218a5822eSThomas Veerman #define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
18318a5822eSThomas Veerman #define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
18418a5822eSThomas Veerman 
18518a5822eSThomas Veerman #endif /* not BFD64  */
18618a5822eSThomas Veerman 
18718a5822eSThomas Veerman #define HALF_BFD_SIZE_TYPE \
18818a5822eSThomas Veerman   (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
18918a5822eSThomas Veerman 
19018a5822eSThomas Veerman #ifndef BFD_HOST_64_BIT
19118a5822eSThomas Veerman /* Fall back on a 32 bit type.  The idea is to make these types always
19218a5822eSThomas Veerman    available for function return types, but in the case that
19318a5822eSThomas Veerman    BFD_HOST_64_BIT is undefined such a function should abort or
19418a5822eSThomas Veerman    otherwise signal an error.  */
19518a5822eSThomas Veerman typedef bfd_signed_vma bfd_int64_t;
19618a5822eSThomas Veerman typedef bfd_vma bfd_uint64_t;
19718a5822eSThomas Veerman #endif
19818a5822eSThomas Veerman 
19918a5822eSThomas Veerman /* An offset into a file.  BFD always uses the largest possible offset
20018a5822eSThomas Veerman    based on the build time availability of fseek, fseeko, or fseeko64.  */
20118a5822eSThomas Veerman typedef BFD_HOST_64_BIT file_ptr;
20218a5822eSThomas Veerman typedef unsigned BFD_HOST_64_BIT ufile_ptr;
20318a5822eSThomas Veerman 
20418a5822eSThomas Veerman extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
20518a5822eSThomas Veerman extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
20618a5822eSThomas Veerman 
20718a5822eSThomas Veerman #define printf_vma(x) fprintf_vma(stdout,x)
20818a5822eSThomas Veerman #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
20918a5822eSThomas Veerman 
21018a5822eSThomas Veerman typedef unsigned int flagword;	/* 32 bits of flags */
21118a5822eSThomas Veerman typedef unsigned char bfd_byte;
21218a5822eSThomas Veerman 
21318a5822eSThomas Veerman /* File formats.  */
21418a5822eSThomas Veerman 
21518a5822eSThomas Veerman typedef enum bfd_format
21618a5822eSThomas Veerman {
21718a5822eSThomas Veerman   bfd_unknown = 0,	/* File format is unknown.  */
21818a5822eSThomas Veerman   bfd_object,		/* Linker/assembler/compiler output.  */
21918a5822eSThomas Veerman   bfd_archive,		/* Object archive file.  */
22018a5822eSThomas Veerman   bfd_core,		/* Core dump.  */
22118a5822eSThomas Veerman   bfd_type_end		/* Marks the end; don't use it!  */
22218a5822eSThomas Veerman }
22318a5822eSThomas Veerman bfd_format;
22418a5822eSThomas Veerman 
22518a5822eSThomas Veerman /* Symbols and relocation.  */
22618a5822eSThomas Veerman 
22718a5822eSThomas Veerman /* A count of carsyms (canonical archive symbols).  */
22818a5822eSThomas Veerman typedef unsigned long symindex;
22918a5822eSThomas Veerman 
23018a5822eSThomas Veerman /* How to perform a relocation.  */
23118a5822eSThomas Veerman typedef const struct reloc_howto_struct reloc_howto_type;
23218a5822eSThomas Veerman 
23318a5822eSThomas Veerman #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
23418a5822eSThomas Veerman 
23518a5822eSThomas Veerman /* General purpose part of a symbol X;
23618a5822eSThomas Veerman    target specific parts are in libcoff.h, libaout.h, etc.  */
23718a5822eSThomas Veerman 
23818a5822eSThomas Veerman #define bfd_get_section(x) ((x)->section)
23918a5822eSThomas Veerman #define bfd_get_output_section(x) ((x)->section->output_section)
24018a5822eSThomas Veerman #define bfd_set_section(x,y) ((x)->section) = (y)
24118a5822eSThomas Veerman #define bfd_asymbol_base(x) ((x)->section->vma)
24218a5822eSThomas Veerman #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
24318a5822eSThomas Veerman #define bfd_asymbol_name(x) ((x)->name)
24418a5822eSThomas Veerman /*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
24518a5822eSThomas Veerman #define bfd_asymbol_bfd(x) ((x)->the_bfd)
24618a5822eSThomas Veerman #define bfd_asymbol_flavour(x)			\
24718a5822eSThomas Veerman   (((x)->flags & BSF_SYNTHETIC) != 0		\
24818a5822eSThomas Veerman    ? bfd_target_unknown_flavour			\
24918a5822eSThomas Veerman    : bfd_asymbol_bfd (x)->xvec->flavour)
25018a5822eSThomas Veerman 
25118a5822eSThomas Veerman /* A canonical archive symbol.  */
25218a5822eSThomas Veerman /* This is a type pun with struct ranlib on purpose!  */
25318a5822eSThomas Veerman typedef struct carsym
25418a5822eSThomas Veerman {
25518a5822eSThomas Veerman   char *name;
25618a5822eSThomas Veerman   file_ptr file_offset;	/* Look here to find the file.  */
25718a5822eSThomas Veerman }
25818a5822eSThomas Veerman carsym;			/* To make these you call a carsymogen.  */
25918a5822eSThomas Veerman 
26018a5822eSThomas Veerman /* Used in generating armaps (archive tables of contents).
26118a5822eSThomas Veerman    Perhaps just a forward definition would do?  */
26218a5822eSThomas Veerman struct orl 			/* Output ranlib.  */
26318a5822eSThomas Veerman {
26418a5822eSThomas Veerman   char **name;		/* Symbol name.  */
26518a5822eSThomas Veerman   union
26618a5822eSThomas Veerman   {
26718a5822eSThomas Veerman     file_ptr pos;
26818a5822eSThomas Veerman     bfd *abfd;
26918a5822eSThomas Veerman   } u;			/* bfd* or file position.  */
27018a5822eSThomas Veerman   int namidx;		/* Index into string table.  */
27118a5822eSThomas Veerman };
27218a5822eSThomas Veerman 
27318a5822eSThomas Veerman /* Linenumber stuff.  */
27418a5822eSThomas Veerman typedef struct lineno_cache_entry
27518a5822eSThomas Veerman {
27618a5822eSThomas Veerman   unsigned int line_number;	/* Linenumber from start of function.  */
27718a5822eSThomas Veerman   union
27818a5822eSThomas Veerman   {
27918a5822eSThomas Veerman     struct bfd_symbol *sym;	/* Function name.  */
28018a5822eSThomas Veerman     bfd_vma offset;	    		/* Offset into section.  */
28118a5822eSThomas Veerman   } u;
28218a5822eSThomas Veerman }
28318a5822eSThomas Veerman alent;
28418a5822eSThomas Veerman 
28518a5822eSThomas Veerman /* Object and core file sections.  */
28618a5822eSThomas Veerman 
28718a5822eSThomas Veerman #define	align_power(addr, align)	\
28818a5822eSThomas Veerman   (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
28918a5822eSThomas Veerman 
29018a5822eSThomas Veerman typedef struct bfd_section *sec_ptr;
29118a5822eSThomas Veerman 
292c9ea9e7aSLionel Sambuc #define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
293c9ea9e7aSLionel Sambuc #define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
294c9ea9e7aSLionel Sambuc #define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
295c9ea9e7aSLionel Sambuc #define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
296c9ea9e7aSLionel Sambuc 					     (ptr)->alignment_power)
29718a5822eSThomas Veerman #define bfd_section_name(bfd, ptr) ((ptr)->name)
29818a5822eSThomas Veerman #define bfd_section_size(bfd, ptr) ((ptr)->size)
29918a5822eSThomas Veerman #define bfd_get_section_size(ptr) ((ptr)->size)
30018a5822eSThomas Veerman #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
30118a5822eSThomas Veerman #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
30218a5822eSThomas Veerman #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
303c9ea9e7aSLionel Sambuc #define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
304c9ea9e7aSLionel Sambuc #define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
30518a5822eSThomas Veerman 
30618a5822eSThomas Veerman #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
30718a5822eSThomas Veerman 
30818a5822eSThomas Veerman #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
30918a5822eSThomas Veerman #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
31018a5822eSThomas Veerman #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
31118a5822eSThomas Veerman /* Find the address one past the end of SEC.  */
31218a5822eSThomas Veerman #define bfd_get_section_limit(bfd, sec) \
313c9ea9e7aSLionel Sambuc   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
314c9ea9e7aSLionel Sambuc     ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
31518a5822eSThomas Veerman 
31618a5822eSThomas Veerman /* Return TRUE if input section SEC has been discarded.  */
317c9ea9e7aSLionel Sambuc #define discarded_section(sec)				\
31818a5822eSThomas Veerman   (!bfd_is_abs_section (sec)					\
31918a5822eSThomas Veerman    && bfd_is_abs_section ((sec)->output_section)		\
320c9ea9e7aSLionel Sambuc    && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE		\
321c9ea9e7aSLionel Sambuc    && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS)
32218a5822eSThomas Veerman 
32318a5822eSThomas Veerman typedef enum bfd_print_symbol
32418a5822eSThomas Veerman {
32518a5822eSThomas Veerman   bfd_print_symbol_name,
32618a5822eSThomas Veerman   bfd_print_symbol_more,
32718a5822eSThomas Veerman   bfd_print_symbol_all
32818a5822eSThomas Veerman } bfd_print_symbol_type;
32918a5822eSThomas Veerman 
33018a5822eSThomas Veerman /* Information about a symbol that nm needs.  */
33118a5822eSThomas Veerman 
33218a5822eSThomas Veerman typedef struct _symbol_info
33318a5822eSThomas Veerman {
33418a5822eSThomas Veerman   symvalue value;
33518a5822eSThomas Veerman   char type;
33618a5822eSThomas Veerman   const char *name;            /* Symbol name.  */
33718a5822eSThomas Veerman   unsigned char stab_type;     /* Stab type.  */
33818a5822eSThomas Veerman   char stab_other;             /* Stab other.  */
33918a5822eSThomas Veerman   short stab_desc;             /* Stab desc.  */
34018a5822eSThomas Veerman   const char *stab_name;       /* String for stab type.  */
34118a5822eSThomas Veerman } symbol_info;
34218a5822eSThomas Veerman 
34318a5822eSThomas Veerman /* Get the name of a stabs type code.  */
34418a5822eSThomas Veerman 
34518a5822eSThomas Veerman extern const char *bfd_get_stab_name (int);
34618a5822eSThomas Veerman 
34718a5822eSThomas Veerman /* Hash table routines.  There is no way to free up a hash table.  */
34818a5822eSThomas Veerman 
34918a5822eSThomas Veerman /* An element in the hash table.  Most uses will actually use a larger
35018a5822eSThomas Veerman    structure, and an instance of this will be the first field.  */
35118a5822eSThomas Veerman 
35218a5822eSThomas Veerman struct bfd_hash_entry
35318a5822eSThomas Veerman {
35418a5822eSThomas Veerman   /* Next entry for this hash code.  */
35518a5822eSThomas Veerman   struct bfd_hash_entry *next;
35618a5822eSThomas Veerman   /* String being hashed.  */
35718a5822eSThomas Veerman   const char *string;
35818a5822eSThomas Veerman   /* Hash code.  This is the full hash code, not the index into the
35918a5822eSThomas Veerman      table.  */
36018a5822eSThomas Veerman   unsigned long hash;
36118a5822eSThomas Veerman };
36218a5822eSThomas Veerman 
36318a5822eSThomas Veerman /* A hash table.  */
36418a5822eSThomas Veerman 
36518a5822eSThomas Veerman struct bfd_hash_table
36618a5822eSThomas Veerman {
36718a5822eSThomas Veerman   /* The hash array.  */
36818a5822eSThomas Veerman   struct bfd_hash_entry **table;
36918a5822eSThomas Veerman   /* A function used to create new elements in the hash table.  The
37018a5822eSThomas Veerman      first entry is itself a pointer to an element.  When this
37118a5822eSThomas Veerman      function is first invoked, this pointer will be NULL.  However,
37218a5822eSThomas Veerman      having the pointer permits a hierarchy of method functions to be
37318a5822eSThomas Veerman      built each of which calls the function in the superclass.  Thus
37418a5822eSThomas Veerman      each function should be written to allocate a new block of memory
37518a5822eSThomas Veerman      only if the argument is NULL.  */
37618a5822eSThomas Veerman   struct bfd_hash_entry *(*newfunc)
37718a5822eSThomas Veerman     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
37818a5822eSThomas Veerman    /* An objalloc for this hash table.  This is a struct objalloc *,
37918a5822eSThomas Veerman      but we use void * to avoid requiring the inclusion of objalloc.h.  */
38018a5822eSThomas Veerman   void *memory;
38118a5822eSThomas Veerman   /* The number of slots in the hash table.  */
38218a5822eSThomas Veerman   unsigned int size;
38318a5822eSThomas Veerman   /* The number of entries in the hash table.  */
38418a5822eSThomas Veerman   unsigned int count;
38518a5822eSThomas Veerman   /* The size of elements.  */
38618a5822eSThomas Veerman   unsigned int entsize;
38718a5822eSThomas Veerman   /* If non-zero, don't grow the hash table.  */
38818a5822eSThomas Veerman   unsigned int frozen:1;
38918a5822eSThomas Veerman };
39018a5822eSThomas Veerman 
39118a5822eSThomas Veerman /* Initialize a hash table.  */
39218a5822eSThomas Veerman extern bfd_boolean bfd_hash_table_init
39318a5822eSThomas Veerman   (struct bfd_hash_table *,
39418a5822eSThomas Veerman    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
39518a5822eSThomas Veerman 			       struct bfd_hash_table *,
39618a5822eSThomas Veerman 			       const char *),
39718a5822eSThomas Veerman    unsigned int);
39818a5822eSThomas Veerman 
39918a5822eSThomas Veerman /* Initialize a hash table specifying a size.  */
40018a5822eSThomas Veerman extern bfd_boolean bfd_hash_table_init_n
40118a5822eSThomas Veerman   (struct bfd_hash_table *,
40218a5822eSThomas Veerman    struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
40318a5822eSThomas Veerman 			       struct bfd_hash_table *,
40418a5822eSThomas Veerman 			       const char *),
40518a5822eSThomas Veerman    unsigned int, unsigned int);
40618a5822eSThomas Veerman 
40718a5822eSThomas Veerman /* Free up a hash table.  */
40818a5822eSThomas Veerman extern void bfd_hash_table_free
40918a5822eSThomas Veerman   (struct bfd_hash_table *);
41018a5822eSThomas Veerman 
41118a5822eSThomas Veerman /* Look up a string in a hash table.  If CREATE is TRUE, a new entry
41218a5822eSThomas Veerman    will be created for this string if one does not already exist.  The
41318a5822eSThomas Veerman    COPY argument must be TRUE if this routine should copy the string
41418a5822eSThomas Veerman    into newly allocated memory when adding an entry.  */
41518a5822eSThomas Veerman extern struct bfd_hash_entry *bfd_hash_lookup
41618a5822eSThomas Veerman   (struct bfd_hash_table *, const char *, bfd_boolean create,
41718a5822eSThomas Veerman    bfd_boolean copy);
41818a5822eSThomas Veerman 
41918a5822eSThomas Veerman /* Insert an entry in a hash table.  */
42018a5822eSThomas Veerman extern struct bfd_hash_entry *bfd_hash_insert
42118a5822eSThomas Veerman   (struct bfd_hash_table *, const char *, unsigned long);
42218a5822eSThomas Veerman 
42318a5822eSThomas Veerman /* Rename an entry in a hash table.  */
42418a5822eSThomas Veerman extern void bfd_hash_rename
42518a5822eSThomas Veerman   (struct bfd_hash_table *, const char *, struct bfd_hash_entry *);
42618a5822eSThomas Veerman 
42718a5822eSThomas Veerman /* Replace an entry in a hash table.  */
42818a5822eSThomas Veerman extern void bfd_hash_replace
42918a5822eSThomas Veerman   (struct bfd_hash_table *, struct bfd_hash_entry *old,
43018a5822eSThomas Veerman    struct bfd_hash_entry *nw);
43118a5822eSThomas Veerman 
43218a5822eSThomas Veerman /* Base method for creating a hash table entry.  */
43318a5822eSThomas Veerman extern struct bfd_hash_entry *bfd_hash_newfunc
43418a5822eSThomas Veerman   (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
43518a5822eSThomas Veerman 
43618a5822eSThomas Veerman /* Grab some space for a hash table entry.  */
43718a5822eSThomas Veerman extern void *bfd_hash_allocate
43818a5822eSThomas Veerman   (struct bfd_hash_table *, unsigned int);
43918a5822eSThomas Veerman 
44018a5822eSThomas Veerman /* Traverse a hash table in a random order, calling a function on each
44118a5822eSThomas Veerman    element.  If the function returns FALSE, the traversal stops.  The
44218a5822eSThomas Veerman    INFO argument is passed to the function.  */
44318a5822eSThomas Veerman extern void bfd_hash_traverse
44418a5822eSThomas Veerman   (struct bfd_hash_table *,
44518a5822eSThomas Veerman    bfd_boolean (*) (struct bfd_hash_entry *, void *),
44618a5822eSThomas Veerman    void *info);
44718a5822eSThomas Veerman 
44818a5822eSThomas Veerman /* Allows the default size of a hash table to be configured. New hash
44918a5822eSThomas Veerman    tables allocated using bfd_hash_table_init will be created with
45018a5822eSThomas Veerman    this size.  */
451c9ea9e7aSLionel Sambuc extern unsigned long bfd_hash_set_default_size (unsigned long);
45218a5822eSThomas Veerman 
45318a5822eSThomas Veerman /* This structure is used to keep track of stabs in sections
45418a5822eSThomas Veerman    information while linking.  */
45518a5822eSThomas Veerman 
45618a5822eSThomas Veerman struct stab_info
45718a5822eSThomas Veerman {
45818a5822eSThomas Veerman   /* A hash table used to hold stabs strings.  */
45918a5822eSThomas Veerman   struct bfd_strtab_hash *strings;
46018a5822eSThomas Veerman   /* The header file hash table.  */
46118a5822eSThomas Veerman   struct bfd_hash_table includes;
46218a5822eSThomas Veerman   /* The first .stabstr section.  */
46318a5822eSThomas Veerman   struct bfd_section *stabstr;
46418a5822eSThomas Veerman };
46518a5822eSThomas Veerman 
46618a5822eSThomas Veerman #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
46718a5822eSThomas Veerman 
46818a5822eSThomas Veerman /* User program access to BFD facilities.  */
46918a5822eSThomas Veerman 
47018a5822eSThomas Veerman /* Direct I/O routines, for programs which know more about the object
47118a5822eSThomas Veerman    file than BFD does.  Use higher level routines if possible.  */
47218a5822eSThomas Veerman 
47318a5822eSThomas Veerman extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
47418a5822eSThomas Veerman extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
47518a5822eSThomas Veerman extern int bfd_seek (bfd *, file_ptr, int);
47618a5822eSThomas Veerman extern file_ptr bfd_tell (bfd *);
47718a5822eSThomas Veerman extern int bfd_flush (bfd *);
47818a5822eSThomas Veerman extern int bfd_stat (bfd *, struct stat *);
47918a5822eSThomas Veerman 
48018a5822eSThomas Veerman /* Deprecated old routines.  */
48118a5822eSThomas Veerman #if __GNUC__
48218a5822eSThomas Veerman #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
48318a5822eSThomas Veerman   (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),	\
48418a5822eSThomas Veerman    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
48518a5822eSThomas Veerman #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
48618a5822eSThomas Veerman   (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),	\
48718a5822eSThomas Veerman    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
48818a5822eSThomas Veerman #else
48918a5822eSThomas Veerman #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
49018a5822eSThomas Veerman   (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
49118a5822eSThomas Veerman    bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
49218a5822eSThomas Veerman #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
49318a5822eSThomas Veerman   (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
49418a5822eSThomas Veerman    bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
49518a5822eSThomas Veerman #endif
49618a5822eSThomas Veerman extern void warn_deprecated (const char *, const char *, int, const char *);
49718a5822eSThomas Veerman 
49818a5822eSThomas Veerman /* Cast from const char * to char * so that caller can assign to
49918a5822eSThomas Veerman    a char * without a warning.  */
50018a5822eSThomas Veerman #define bfd_get_filename(abfd) ((char *) (abfd)->filename)
50118a5822eSThomas Veerman #define bfd_get_cacheable(abfd) ((abfd)->cacheable)
50218a5822eSThomas Veerman #define bfd_get_format(abfd) ((abfd)->format)
50318a5822eSThomas Veerman #define bfd_get_target(abfd) ((abfd)->xvec->name)
50418a5822eSThomas Veerman #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
50518a5822eSThomas Veerman #define bfd_family_coff(abfd) \
50618a5822eSThomas Veerman   (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
50718a5822eSThomas Veerman    bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
50818a5822eSThomas Veerman #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
50918a5822eSThomas Veerman #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
51018a5822eSThomas Veerman #define bfd_header_big_endian(abfd) \
51118a5822eSThomas Veerman   ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
51218a5822eSThomas Veerman #define bfd_header_little_endian(abfd) \
51318a5822eSThomas Veerman   ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
51418a5822eSThomas Veerman #define bfd_get_file_flags(abfd) ((abfd)->flags)
51518a5822eSThomas Veerman #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
51618a5822eSThomas Veerman #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
51718a5822eSThomas Veerman #define bfd_my_archive(abfd) ((abfd)->my_archive)
51818a5822eSThomas Veerman #define bfd_has_map(abfd) ((abfd)->has_armap)
51918a5822eSThomas Veerman #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
52018a5822eSThomas Veerman 
52118a5822eSThomas Veerman #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
52218a5822eSThomas Veerman #define bfd_usrdata(abfd) ((abfd)->usrdata)
52318a5822eSThomas Veerman 
52418a5822eSThomas Veerman #define bfd_get_start_address(abfd) ((abfd)->start_address)
52518a5822eSThomas Veerman #define bfd_get_symcount(abfd) ((abfd)->symcount)
52618a5822eSThomas Veerman #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
52718a5822eSThomas Veerman #define bfd_count_sections(abfd) ((abfd)->section_count)
52818a5822eSThomas Veerman 
52918a5822eSThomas Veerman #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
53018a5822eSThomas Veerman 
53118a5822eSThomas Veerman #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
53218a5822eSThomas Veerman 
53318a5822eSThomas Veerman #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
53418a5822eSThomas Veerman 
53518a5822eSThomas Veerman extern bfd_boolean bfd_cache_close
53618a5822eSThomas Veerman   (bfd *abfd);
53718a5822eSThomas Veerman /* NB: This declaration should match the autogenerated one in libbfd.h.  */
53818a5822eSThomas Veerman 
53918a5822eSThomas Veerman extern bfd_boolean bfd_cache_close_all (void);
54018a5822eSThomas Veerman 
54118a5822eSThomas Veerman extern bfd_boolean bfd_record_phdr
54218a5822eSThomas Veerman   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
54318a5822eSThomas Veerman    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
54418a5822eSThomas Veerman 
54518a5822eSThomas Veerman /* Byte swapping routines.  */
54618a5822eSThomas Veerman 
54718a5822eSThomas Veerman bfd_uint64_t bfd_getb64 (const void *);
54818a5822eSThomas Veerman bfd_uint64_t bfd_getl64 (const void *);
54918a5822eSThomas Veerman bfd_int64_t bfd_getb_signed_64 (const void *);
55018a5822eSThomas Veerman bfd_int64_t bfd_getl_signed_64 (const void *);
55118a5822eSThomas Veerman bfd_vma bfd_getb32 (const void *);
55218a5822eSThomas Veerman bfd_vma bfd_getl32 (const void *);
55318a5822eSThomas Veerman bfd_signed_vma bfd_getb_signed_32 (const void *);
55418a5822eSThomas Veerman bfd_signed_vma bfd_getl_signed_32 (const void *);
55518a5822eSThomas Veerman bfd_vma bfd_getb16 (const void *);
55618a5822eSThomas Veerman bfd_vma bfd_getl16 (const void *);
55718a5822eSThomas Veerman bfd_signed_vma bfd_getb_signed_16 (const void *);
55818a5822eSThomas Veerman bfd_signed_vma bfd_getl_signed_16 (const void *);
55918a5822eSThomas Veerman void bfd_putb64 (bfd_uint64_t, void *);
56018a5822eSThomas Veerman void bfd_putl64 (bfd_uint64_t, void *);
56118a5822eSThomas Veerman void bfd_putb32 (bfd_vma, void *);
56218a5822eSThomas Veerman void bfd_putl32 (bfd_vma, void *);
56318a5822eSThomas Veerman void bfd_putb16 (bfd_vma, void *);
56418a5822eSThomas Veerman void bfd_putl16 (bfd_vma, void *);
56518a5822eSThomas Veerman 
56618a5822eSThomas Veerman /* Byte swapping routines which take size and endiannes as arguments.  */
56718a5822eSThomas Veerman 
56818a5822eSThomas Veerman bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
56918a5822eSThomas Veerman void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
57018a5822eSThomas Veerman 
57118a5822eSThomas Veerman #if defined(__STDC__) || defined(ALMOST_STDC)
57218a5822eSThomas Veerman struct ecoff_debug_info;
57318a5822eSThomas Veerman struct ecoff_debug_swap;
57418a5822eSThomas Veerman struct ecoff_extr;
57518a5822eSThomas Veerman struct bfd_symbol;
57618a5822eSThomas Veerman struct bfd_link_info;
57718a5822eSThomas Veerman struct bfd_link_hash_entry;
578c9ea9e7aSLionel Sambuc struct bfd_section_already_linked;
57918a5822eSThomas Veerman struct bfd_elf_version_tree;
58018a5822eSThomas Veerman #endif
581c9ea9e7aSLionel Sambuc 
582c9ea9e7aSLionel Sambuc extern bfd_boolean bfd_section_already_linked_table_init (void);
583c9ea9e7aSLionel Sambuc extern void bfd_section_already_linked_table_free (void);
584c9ea9e7aSLionel Sambuc extern bfd_boolean _bfd_handle_already_linked
585c9ea9e7aSLionel Sambuc   (struct bfd_section *, struct bfd_section_already_linked *,
586c9ea9e7aSLionel Sambuc    struct bfd_link_info *);
587c9ea9e7aSLionel Sambuc 
588c9ea9e7aSLionel Sambuc /* Externally visible ECOFF routines.  */
589c9ea9e7aSLionel Sambuc 
59018a5822eSThomas Veerman extern bfd_vma bfd_ecoff_get_gp_value
59118a5822eSThomas Veerman   (bfd * abfd);
59218a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_set_gp_value
59318a5822eSThomas Veerman   (bfd *abfd, bfd_vma gp_value);
59418a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_set_regmasks
59518a5822eSThomas Veerman   (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
59618a5822eSThomas Veerman    unsigned long *cprmask);
59718a5822eSThomas Veerman extern void *bfd_ecoff_debug_init
59818a5822eSThomas Veerman   (bfd *output_bfd, struct ecoff_debug_info *output_debug,
59918a5822eSThomas Veerman    const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
60018a5822eSThomas Veerman extern void bfd_ecoff_debug_free
60118a5822eSThomas Veerman   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
60218a5822eSThomas Veerman    const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
60318a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_debug_accumulate
60418a5822eSThomas Veerman   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
60518a5822eSThomas Veerman    const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
60618a5822eSThomas Veerman    struct ecoff_debug_info *input_debug,
60718a5822eSThomas Veerman    const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
60818a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_debug_accumulate_other
60918a5822eSThomas Veerman   (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
61018a5822eSThomas Veerman    const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
61118a5822eSThomas Veerman    struct bfd_link_info *);
61218a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_debug_externals
61318a5822eSThomas Veerman   (bfd *abfd, struct ecoff_debug_info *debug,
61418a5822eSThomas Veerman    const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
61518a5822eSThomas Veerman    bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
61618a5822eSThomas Veerman    void (*set_index) (struct bfd_symbol *, bfd_size_type));
61718a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_debug_one_external
61818a5822eSThomas Veerman   (bfd *abfd, struct ecoff_debug_info *debug,
61918a5822eSThomas Veerman    const struct ecoff_debug_swap *swap, const char *name,
62018a5822eSThomas Veerman    struct ecoff_extr *esym);
62118a5822eSThomas Veerman extern bfd_size_type bfd_ecoff_debug_size
62218a5822eSThomas Veerman   (bfd *abfd, struct ecoff_debug_info *debug,
62318a5822eSThomas Veerman    const struct ecoff_debug_swap *swap);
62418a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_write_debug
62518a5822eSThomas Veerman   (bfd *abfd, struct ecoff_debug_info *debug,
62618a5822eSThomas Veerman    const struct ecoff_debug_swap *swap, file_ptr where);
62718a5822eSThomas Veerman extern bfd_boolean bfd_ecoff_write_accumulated_debug
62818a5822eSThomas Veerman   (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
62918a5822eSThomas Veerman    const struct ecoff_debug_swap *swap,
63018a5822eSThomas Veerman    struct bfd_link_info *info, file_ptr where);
63118a5822eSThomas Veerman 
63218a5822eSThomas Veerman /* Externally visible ELF routines.  */
63318a5822eSThomas Veerman 
63418a5822eSThomas Veerman struct bfd_link_needed_list
63518a5822eSThomas Veerman {
63618a5822eSThomas Veerman   struct bfd_link_needed_list *next;
63718a5822eSThomas Veerman   bfd *by;
63818a5822eSThomas Veerman   const char *name;
63918a5822eSThomas Veerman };
64018a5822eSThomas Veerman 
64118a5822eSThomas Veerman enum dynamic_lib_link_class {
64218a5822eSThomas Veerman   DYN_NORMAL = 0,
64318a5822eSThomas Veerman   DYN_AS_NEEDED = 1,
64418a5822eSThomas Veerman   DYN_DT_NEEDED = 2,
64518a5822eSThomas Veerman   DYN_NO_ADD_NEEDED = 4,
64618a5822eSThomas Veerman   DYN_NO_NEEDED = 8
64718a5822eSThomas Veerman };
64818a5822eSThomas Veerman 
64918a5822eSThomas Veerman enum notice_asneeded_action {
65018a5822eSThomas Veerman   notice_as_needed,
65118a5822eSThomas Veerman   notice_not_needed,
65218a5822eSThomas Veerman   notice_needed
65318a5822eSThomas Veerman };
65418a5822eSThomas Veerman 
65518a5822eSThomas Veerman extern bfd_boolean bfd_elf_record_link_assignment
65618a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
65718a5822eSThomas Veerman    bfd_boolean);
65818a5822eSThomas Veerman extern struct bfd_link_needed_list *bfd_elf_get_needed_list
65918a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
66018a5822eSThomas Veerman extern bfd_boolean bfd_elf_get_bfd_needed_list
66118a5822eSThomas Veerman   (bfd *, struct bfd_link_needed_list **);
66218a5822eSThomas Veerman extern bfd_boolean bfd_elf_size_dynamic_sections
66318a5822eSThomas Veerman   (bfd *, const char *, const char *, const char *, const char *, const char *,
664c9ea9e7aSLionel Sambuc    const char * const *, struct bfd_link_info *, struct bfd_section **);
66518a5822eSThomas Veerman extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
66618a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
66718a5822eSThomas Veerman extern void bfd_elf_set_dt_needed_name
66818a5822eSThomas Veerman   (bfd *, const char *);
66918a5822eSThomas Veerman extern const char *bfd_elf_get_dt_soname
67018a5822eSThomas Veerman   (bfd *);
67118a5822eSThomas Veerman extern void bfd_elf_set_dyn_lib_class
67218a5822eSThomas Veerman   (bfd *, enum dynamic_lib_link_class);
67318a5822eSThomas Veerman extern int bfd_elf_get_dyn_lib_class
67418a5822eSThomas Veerman   (bfd *);
67518a5822eSThomas Veerman extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
67618a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
67718a5822eSThomas Veerman extern bfd_boolean bfd_elf_discard_info
67818a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
67918a5822eSThomas Veerman extern unsigned int _bfd_elf_default_action_discarded
68018a5822eSThomas Veerman   (struct bfd_section *);
68118a5822eSThomas Veerman 
68218a5822eSThomas Veerman /* Return an upper bound on the number of bytes required to store a
68318a5822eSThomas Veerman    copy of ABFD's program header table entries.  Return -1 if an error
68418a5822eSThomas Veerman    occurs; bfd_get_error will return an appropriate code.  */
68518a5822eSThomas Veerman extern long bfd_get_elf_phdr_upper_bound
68618a5822eSThomas Veerman   (bfd *abfd);
68718a5822eSThomas Veerman 
68818a5822eSThomas Veerman /* Copy ABFD's program header table entries to *PHDRS.  The entries
68918a5822eSThomas Veerman    will be stored as an array of Elf_Internal_Phdr structures, as
69018a5822eSThomas Veerman    defined in include/elf/internal.h.  To find out how large the
69118a5822eSThomas Veerman    buffer needs to be, call bfd_get_elf_phdr_upper_bound.
69218a5822eSThomas Veerman 
69318a5822eSThomas Veerman    Return the number of program header table entries read, or -1 if an
69418a5822eSThomas Veerman    error occurs; bfd_get_error will return an appropriate code.  */
69518a5822eSThomas Veerman extern int bfd_get_elf_phdrs
69618a5822eSThomas Veerman   (bfd *abfd, void *phdrs);
69718a5822eSThomas Veerman 
69818a5822eSThomas Veerman /* Create a new BFD as if by bfd_openr.  Rather than opening a file,
69918a5822eSThomas Veerman    reconstruct an ELF file by reading the segments out of remote memory
70018a5822eSThomas Veerman    based on the ELF file header at EHDR_VMA and the ELF program headers it
70118a5822eSThomas Veerman    points to.  If not null, *LOADBASEP is filled in with the difference
70218a5822eSThomas Veerman    between the VMAs from which the segments were read, and the VMAs the
70318a5822eSThomas Veerman    file headers (and hence BFD's idea of each section's VMA) put them at.
70418a5822eSThomas Veerman 
70518a5822eSThomas Veerman    The function TARGET_READ_MEMORY is called to copy LEN bytes from the
70618a5822eSThomas Veerman    remote memory at target address VMA into the local buffer at MYADDR; it
70718a5822eSThomas Veerman    should return zero on success or an `errno' code on failure.  TEMPL must
70818a5822eSThomas Veerman    be a BFD for an ELF target with the word size and byte order found in
70918a5822eSThomas Veerman    the remote memory.  */
71018a5822eSThomas Veerman extern bfd *bfd_elf_bfd_from_remote_memory
71118a5822eSThomas Veerman   (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
712c9ea9e7aSLionel Sambuc    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
713c9ea9e7aSLionel Sambuc 			      bfd_size_type len));
71418a5822eSThomas Veerman 
71518a5822eSThomas Veerman extern struct bfd_section *_bfd_elf_tls_setup
71618a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
71718a5822eSThomas Veerman 
718c9ea9e7aSLionel Sambuc extern struct bfd_section *
719c9ea9e7aSLionel Sambuc _bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
720c9ea9e7aSLionel Sambuc 
72118a5822eSThomas Veerman extern void _bfd_fix_excluded_sec_syms
72218a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
72318a5822eSThomas Veerman 
72418a5822eSThomas Veerman extern unsigned bfd_m68k_mach_to_features (int);
72518a5822eSThomas Veerman 
72618a5822eSThomas Veerman extern int bfd_m68k_features_to_mach (unsigned);
72718a5822eSThomas Veerman 
72818a5822eSThomas Veerman extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
72918a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
73018a5822eSThomas Veerman    char **);
73118a5822eSThomas Veerman 
73218a5822eSThomas Veerman extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int);
73318a5822eSThomas Veerman 
73418a5822eSThomas Veerman extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
73518a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
73618a5822eSThomas Veerman    char **);
73718a5822eSThomas Veerman 
73818a5822eSThomas Veerman extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
73918a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
74018a5822eSThomas Veerman    char **);
74118a5822eSThomas Veerman 
74218a5822eSThomas Veerman /* SunOS shared library support routines for the linker.  */
74318a5822eSThomas Veerman 
74418a5822eSThomas Veerman extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
74518a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
74618a5822eSThomas Veerman extern bfd_boolean bfd_sunos_record_link_assignment
74718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, const char *);
74818a5822eSThomas Veerman extern bfd_boolean bfd_sunos_size_dynamic_sections
74918a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_section **,
75018a5822eSThomas Veerman    struct bfd_section **, struct bfd_section **);
75118a5822eSThomas Veerman 
75218a5822eSThomas Veerman /* Linux shared library support routines for the linker.  */
75318a5822eSThomas Veerman 
75418a5822eSThomas Veerman extern bfd_boolean bfd_i386linux_size_dynamic_sections
75518a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
75618a5822eSThomas Veerman extern bfd_boolean bfd_m68klinux_size_dynamic_sections
75718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
75818a5822eSThomas Veerman extern bfd_boolean bfd_sparclinux_size_dynamic_sections
75918a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
76018a5822eSThomas Veerman 
76118a5822eSThomas Veerman /* mmap hacks */
76218a5822eSThomas Veerman 
76318a5822eSThomas Veerman struct _bfd_window_internal;
76418a5822eSThomas Veerman typedef struct _bfd_window_internal bfd_window_internal;
76518a5822eSThomas Veerman 
76618a5822eSThomas Veerman typedef struct _bfd_window
76718a5822eSThomas Veerman {
76818a5822eSThomas Veerman   /* What the user asked for.  */
76918a5822eSThomas Veerman   void *data;
77018a5822eSThomas Veerman   bfd_size_type size;
77118a5822eSThomas Veerman   /* The actual window used by BFD.  Small user-requested read-only
77218a5822eSThomas Veerman      regions sharing a page may share a single window into the object
77318a5822eSThomas Veerman      file.  Read-write versions shouldn't until I've fixed things to
77418a5822eSThomas Veerman      keep track of which portions have been claimed by the
77518a5822eSThomas Veerman      application; don't want to give the same region back when the
77618a5822eSThomas Veerman      application wants two writable copies!  */
77718a5822eSThomas Veerman   struct _bfd_window_internal *i;
77818a5822eSThomas Veerman }
77918a5822eSThomas Veerman bfd_window;
78018a5822eSThomas Veerman 
78118a5822eSThomas Veerman extern void bfd_init_window
78218a5822eSThomas Veerman   (bfd_window *);
78318a5822eSThomas Veerman extern void bfd_free_window
78418a5822eSThomas Veerman   (bfd_window *);
78518a5822eSThomas Veerman extern bfd_boolean bfd_get_file_window
78618a5822eSThomas Veerman   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
78718a5822eSThomas Veerman 
78818a5822eSThomas Veerman /* XCOFF support routines for the linker.  */
78918a5822eSThomas Veerman 
79018a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_split_import_path
79118a5822eSThomas Veerman   (bfd *, const char *, const char **, const char **);
79218a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_set_archive_import_path
79318a5822eSThomas Veerman   (struct bfd_link_info *, bfd *, const char *);
79418a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_link_record_set
79518a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
79618a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_import_symbol
79718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
79818a5822eSThomas Veerman    const char *, const char *, const char *, unsigned int);
79918a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_export_symbol
80018a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
80118a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_link_count_reloc
80218a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, const char *);
80318a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_record_link_assignment
80418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, const char *);
80518a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_size_dynamic_sections
80618a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, const char *, const char *,
80718a5822eSThomas Veerman    unsigned long, unsigned long, unsigned long, bfd_boolean,
80818a5822eSThomas Veerman    int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean);
80918a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_link_generate_rtinit
81018a5822eSThomas Veerman   (bfd *, const char *, const char *, bfd_boolean);
81118a5822eSThomas Veerman 
81218a5822eSThomas Veerman /* XCOFF support routines for ar.  */
81318a5822eSThomas Veerman extern bfd_boolean bfd_xcoff_ar_archive_set_magic
81418a5822eSThomas Veerman   (bfd *, char *);
81518a5822eSThomas Veerman 
81618a5822eSThomas Veerman /* Externally visible COFF routines.  */
81718a5822eSThomas Veerman 
81818a5822eSThomas Veerman #if defined(__STDC__) || defined(ALMOST_STDC)
81918a5822eSThomas Veerman struct internal_syment;
82018a5822eSThomas Veerman union internal_auxent;
82118a5822eSThomas Veerman #endif
82218a5822eSThomas Veerman 
82318a5822eSThomas Veerman extern bfd_boolean bfd_coff_get_syment
82418a5822eSThomas Veerman   (bfd *, struct bfd_symbol *, struct internal_syment *);
82518a5822eSThomas Veerman 
82618a5822eSThomas Veerman extern bfd_boolean bfd_coff_get_auxent
82718a5822eSThomas Veerman   (bfd *, struct bfd_symbol *, int, union internal_auxent *);
82818a5822eSThomas Veerman 
82918a5822eSThomas Veerman extern bfd_boolean bfd_coff_set_symbol_class
83018a5822eSThomas Veerman   (bfd *, struct bfd_symbol *, unsigned int);
83118a5822eSThomas Veerman 
83218a5822eSThomas Veerman extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
83318a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
83418a5822eSThomas Veerman 
83518a5822eSThomas Veerman /* ARM VFP11 erratum workaround support.  */
83618a5822eSThomas Veerman typedef enum
83718a5822eSThomas Veerman {
83818a5822eSThomas Veerman   BFD_ARM_VFP11_FIX_DEFAULT,
83918a5822eSThomas Veerman   BFD_ARM_VFP11_FIX_NONE,
84018a5822eSThomas Veerman   BFD_ARM_VFP11_FIX_SCALAR,
84118a5822eSThomas Veerman   BFD_ARM_VFP11_FIX_VECTOR
84218a5822eSThomas Veerman } bfd_arm_vfp11_fix;
84318a5822eSThomas Veerman 
84418a5822eSThomas Veerman extern void bfd_elf32_arm_init_maps
84518a5822eSThomas Veerman   (bfd *);
84618a5822eSThomas Veerman 
84718a5822eSThomas Veerman extern void bfd_elf32_arm_set_vfp11_fix
84818a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
84918a5822eSThomas Veerman 
85018a5822eSThomas Veerman extern void bfd_elf32_arm_set_cortex_a8_fix
85118a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
85218a5822eSThomas Veerman 
85318a5822eSThomas Veerman extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
85418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
85518a5822eSThomas Veerman 
85618a5822eSThomas Veerman extern void bfd_elf32_arm_vfp11_fix_veneer_locations
85718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
85818a5822eSThomas Veerman 
85918a5822eSThomas Veerman /* ARM Interworking support.  Called from linker.  */
86018a5822eSThomas Veerman extern bfd_boolean bfd_arm_allocate_interworking_sections
86118a5822eSThomas Veerman   (struct bfd_link_info *);
86218a5822eSThomas Veerman 
86318a5822eSThomas Veerman extern bfd_boolean bfd_arm_process_before_allocation
86418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, int);
86518a5822eSThomas Veerman 
86618a5822eSThomas Veerman extern bfd_boolean bfd_arm_get_bfd_for_interworking
86718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
86818a5822eSThomas Veerman 
86918a5822eSThomas Veerman /* PE ARM Interworking support.  Called from linker.  */
87018a5822eSThomas Veerman extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
87118a5822eSThomas Veerman   (struct bfd_link_info *);
87218a5822eSThomas Veerman 
87318a5822eSThomas Veerman extern bfd_boolean bfd_arm_pe_process_before_allocation
87418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, int);
87518a5822eSThomas Veerman 
87618a5822eSThomas Veerman extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
87718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
87818a5822eSThomas Veerman 
87918a5822eSThomas Veerman /* ELF ARM Interworking support.  Called from linker.  */
88018a5822eSThomas Veerman extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
88118a5822eSThomas Veerman   (struct bfd_link_info *);
88218a5822eSThomas Veerman 
88318a5822eSThomas Veerman extern bfd_boolean bfd_elf32_arm_process_before_allocation
88418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
88518a5822eSThomas Veerman 
88618a5822eSThomas Veerman void bfd_elf32_arm_set_target_relocs
88718a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
888c9ea9e7aSLionel Sambuc    int, int, int, int, int);
88918a5822eSThomas Veerman 
89018a5822eSThomas Veerman extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
89118a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
89218a5822eSThomas Veerman 
89318a5822eSThomas Veerman extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
89418a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
89518a5822eSThomas Veerman 
89618a5822eSThomas Veerman /* ELF ARM mapping symbol support */
89718a5822eSThomas Veerman #define BFD_ARM_SPECIAL_SYM_TYPE_MAP	(1 << 0)
89818a5822eSThomas Veerman #define BFD_ARM_SPECIAL_SYM_TYPE_TAG	(1 << 1)
89918a5822eSThomas Veerman #define BFD_ARM_SPECIAL_SYM_TYPE_OTHER  (1 << 2)
90018a5822eSThomas Veerman #define BFD_ARM_SPECIAL_SYM_TYPE_ANY	(~0)
90118a5822eSThomas Veerman extern bfd_boolean bfd_is_arm_special_symbol_name
90218a5822eSThomas Veerman   (const char * name, int type);
90318a5822eSThomas Veerman 
90418a5822eSThomas Veerman extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
90518a5822eSThomas Veerman 
90618a5822eSThomas Veerman /* ARM Note section processing.  */
90718a5822eSThomas Veerman extern bfd_boolean bfd_arm_merge_machines
90818a5822eSThomas Veerman   (bfd *, bfd *);
90918a5822eSThomas Veerman 
91018a5822eSThomas Veerman extern bfd_boolean bfd_arm_update_notes
91118a5822eSThomas Veerman   (bfd *, const char *);
91218a5822eSThomas Veerman 
91318a5822eSThomas Veerman extern unsigned int bfd_arm_get_mach_from_notes
91418a5822eSThomas Veerman   (bfd *, const char *);
91518a5822eSThomas Veerman 
91618a5822eSThomas Veerman /* ARM stub generation support.  Called from the linker.  */
91718a5822eSThomas Veerman extern int elf32_arm_setup_section_lists
91818a5822eSThomas Veerman   (bfd *, struct bfd_link_info *);
91918a5822eSThomas Veerman extern void elf32_arm_next_input_section
92018a5822eSThomas Veerman   (struct bfd_link_info *, struct bfd_section *);
92118a5822eSThomas Veerman extern bfd_boolean elf32_arm_size_stubs
92218a5822eSThomas Veerman   (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
92318a5822eSThomas Veerman    struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
92418a5822eSThomas Veerman extern bfd_boolean elf32_arm_build_stubs
92518a5822eSThomas Veerman   (struct bfd_link_info *);
92618a5822eSThomas Veerman 
92718a5822eSThomas Veerman /* ARM unwind section editing support.  */
92818a5822eSThomas Veerman extern bfd_boolean elf32_arm_fix_exidx_coverage
92918a5822eSThomas Veerman (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
93018a5822eSThomas Veerman 
931c9ea9e7aSLionel Sambuc /* C6x unwind section editing support.  */
932c9ea9e7aSLionel Sambuc extern bfd_boolean elf32_tic6x_fix_exidx_coverage
933c9ea9e7aSLionel Sambuc (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
934c9ea9e7aSLionel Sambuc 
93518a5822eSThomas Veerman /* PowerPC @tls opcode transform/validate.  */
93618a5822eSThomas Veerman extern unsigned int _bfd_elf_ppc_at_tls_transform
93718a5822eSThomas Veerman   (unsigned int, unsigned int);
93818a5822eSThomas Veerman /* PowerPC @tprel opcode transform/validate.  */
93918a5822eSThomas Veerman extern unsigned int _bfd_elf_ppc_at_tprel_transform
94018a5822eSThomas Veerman   (unsigned int, unsigned int);
94118a5822eSThomas Veerman 
942c9ea9e7aSLionel Sambuc extern void bfd_elf64_aarch64_init_maps
943c9ea9e7aSLionel Sambuc   (bfd *);
944c9ea9e7aSLionel Sambuc 
945c9ea9e7aSLionel Sambuc void bfd_elf64_aarch64_set_options
946c9ea9e7aSLionel Sambuc   (bfd *, struct bfd_link_info *, int, int, int);
947c9ea9e7aSLionel Sambuc 
948c9ea9e7aSLionel Sambuc /* ELF AArch64 mapping symbol support.  */
949c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP	(1 << 0)
950c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG	(1 << 1)
951c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER	(1 << 2)
952c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY	(~0)
953c9ea9e7aSLionel Sambuc extern bfd_boolean bfd_is_aarch64_special_symbol_name
954c9ea9e7aSLionel Sambuc   (const char * name, int type);
955c9ea9e7aSLionel Sambuc 
956c9ea9e7aSLionel Sambuc /* AArch64 stub generation support.  Called from the linker.  */
957c9ea9e7aSLionel Sambuc extern int elf64_aarch64_setup_section_lists
958c9ea9e7aSLionel Sambuc   (bfd *, struct bfd_link_info *);
959c9ea9e7aSLionel Sambuc extern void elf64_aarch64_next_input_section
960c9ea9e7aSLionel Sambuc   (struct bfd_link_info *, struct bfd_section *);
961c9ea9e7aSLionel Sambuc extern bfd_boolean elf64_aarch64_size_stubs
962c9ea9e7aSLionel Sambuc   (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
963c9ea9e7aSLionel Sambuc    struct bfd_section * (*) (const char *, struct bfd_section *),
964c9ea9e7aSLionel Sambuc    void (*) (void));
965c9ea9e7aSLionel Sambuc extern bfd_boolean elf64_aarch64_build_stubs
966c9ea9e7aSLionel Sambuc   (struct bfd_link_info *);
967c9ea9e7aSLionel Sambuc 
96818a5822eSThomas Veerman /* TI COFF load page support.  */
96918a5822eSThomas Veerman extern void bfd_ticoff_set_section_load_page
97018a5822eSThomas Veerman   (struct bfd_section *, int);
97118a5822eSThomas Veerman 
97218a5822eSThomas Veerman extern int bfd_ticoff_get_section_load_page
97318a5822eSThomas Veerman   (struct bfd_section *);
97418a5822eSThomas Veerman 
97518a5822eSThomas Veerman /* H8/300 functions.  */
97618a5822eSThomas Veerman extern bfd_vma bfd_h8300_pad_address
97718a5822eSThomas Veerman   (bfd *, bfd_vma);
97818a5822eSThomas Veerman 
97918a5822eSThomas Veerman /* IA64 Itanium code generation.  Called from linker.  */
98018a5822eSThomas Veerman extern void bfd_elf32_ia64_after_parse
98118a5822eSThomas Veerman   (int);
98218a5822eSThomas Veerman 
98318a5822eSThomas Veerman extern void bfd_elf64_ia64_after_parse
98418a5822eSThomas Veerman   (int);
98518a5822eSThomas Veerman 
98618a5822eSThomas Veerman /* This structure is used for a comdat section, as in PE.  A comdat
98718a5822eSThomas Veerman    section is associated with a particular symbol.  When the linker
98818a5822eSThomas Veerman    sees a comdat section, it keeps only one of the sections with a
98918a5822eSThomas Veerman    given name and associated with a given symbol.  */
99018a5822eSThomas Veerman 
99118a5822eSThomas Veerman struct coff_comdat_info
99218a5822eSThomas Veerman {
99318a5822eSThomas Veerman   /* The name of the symbol associated with a comdat section.  */
99418a5822eSThomas Veerman   const char *name;
99518a5822eSThomas Veerman 
99618a5822eSThomas Veerman   /* The local symbol table index of the symbol associated with a
99718a5822eSThomas Veerman      comdat section.  This is only meaningful to the object file format
99818a5822eSThomas Veerman      specific code; it is not an index into the list returned by
99918a5822eSThomas Veerman      bfd_canonicalize_symtab.  */
100018a5822eSThomas Veerman   long symbol;
100118a5822eSThomas Veerman };
100218a5822eSThomas Veerman 
100318a5822eSThomas Veerman extern struct coff_comdat_info *bfd_coff_get_comdat_section
100418a5822eSThomas Veerman   (bfd *, struct bfd_section *);
100518a5822eSThomas Veerman 
100618a5822eSThomas Veerman /* Extracted from init.c.  */
100718a5822eSThomas Veerman void bfd_init (void);
100818a5822eSThomas Veerman 
100918a5822eSThomas Veerman /* Extracted from opncls.c.  */
101018a5822eSThomas Veerman extern unsigned int bfd_use_reserved_id;
101118a5822eSThomas Veerman bfd *bfd_fopen (const char *filename, const char *target,
101218a5822eSThomas Veerman     const char *mode, int fd);
101318a5822eSThomas Veerman 
101418a5822eSThomas Veerman bfd *bfd_openr (const char *filename, const char *target);
101518a5822eSThomas Veerman 
101618a5822eSThomas Veerman bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
101718a5822eSThomas Veerman 
101818a5822eSThomas Veerman bfd *bfd_openstreamr (const char *, const char *, void *);
101918a5822eSThomas Veerman 
102018a5822eSThomas Veerman bfd *bfd_openr_iovec (const char *filename, const char *target,
102118a5822eSThomas Veerman     void *(*open_func) (struct bfd *nbfd,
102218a5822eSThomas Veerman     void *open_closure),
102318a5822eSThomas Veerman     void *open_closure,
102418a5822eSThomas Veerman     file_ptr (*pread_func) (struct bfd *nbfd,
102518a5822eSThomas Veerman     void *stream,
102618a5822eSThomas Veerman     void *buf,
102718a5822eSThomas Veerman     file_ptr nbytes,
102818a5822eSThomas Veerman     file_ptr offset),
102918a5822eSThomas Veerman     int (*close_func) (struct bfd *nbfd,
103018a5822eSThomas Veerman     void *stream),
103118a5822eSThomas Veerman     int (*stat_func) (struct bfd *abfd,
103218a5822eSThomas Veerman     void *stream,
103318a5822eSThomas Veerman     struct stat *sb));
103418a5822eSThomas Veerman 
103518a5822eSThomas Veerman bfd *bfd_openw (const char *filename, const char *target);
103618a5822eSThomas Veerman 
103718a5822eSThomas Veerman bfd_boolean bfd_close (bfd *abfd);
103818a5822eSThomas Veerman 
103918a5822eSThomas Veerman bfd_boolean bfd_close_all_done (bfd *);
104018a5822eSThomas Veerman 
104118a5822eSThomas Veerman bfd *bfd_create (const char *filename, bfd *templ);
104218a5822eSThomas Veerman 
104318a5822eSThomas Veerman bfd_boolean bfd_make_writable (bfd *abfd);
104418a5822eSThomas Veerman 
104518a5822eSThomas Veerman bfd_boolean bfd_make_readable (bfd *abfd);
104618a5822eSThomas Veerman 
104718a5822eSThomas Veerman void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
104818a5822eSThomas Veerman 
104918a5822eSThomas Veerman void *bfd_zalloc (bfd *abfd, bfd_size_type wanted);
105018a5822eSThomas Veerman 
105118a5822eSThomas Veerman unsigned long bfd_calc_gnu_debuglink_crc32
105218a5822eSThomas Veerman    (unsigned long crc, const unsigned char *buf, bfd_size_type len);
105318a5822eSThomas Veerman 
105418a5822eSThomas Veerman char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
105518a5822eSThomas Veerman 
105618a5822eSThomas Veerman struct bfd_section *bfd_create_gnu_debuglink_section
105718a5822eSThomas Veerman    (bfd *abfd, const char *filename);
105818a5822eSThomas Veerman 
105918a5822eSThomas Veerman bfd_boolean bfd_fill_in_gnu_debuglink_section
106018a5822eSThomas Veerman    (bfd *abfd, struct bfd_section *sect, const char *filename);
106118a5822eSThomas Veerman 
106218a5822eSThomas Veerman /* Extracted from libbfd.c.  */
106318a5822eSThomas Veerman 
106418a5822eSThomas Veerman /* Byte swapping macros for user section data.  */
106518a5822eSThomas Veerman 
106618a5822eSThomas Veerman #define bfd_put_8(abfd, val, ptr) \
106718a5822eSThomas Veerman   ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
106818a5822eSThomas Veerman #define bfd_put_signed_8 \
106918a5822eSThomas Veerman   bfd_put_8
107018a5822eSThomas Veerman #define bfd_get_8(abfd, ptr) \
107118a5822eSThomas Veerman   (*(const unsigned char *) (ptr) & 0xff)
107218a5822eSThomas Veerman #define bfd_get_signed_8(abfd, ptr) \
107318a5822eSThomas Veerman   (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
107418a5822eSThomas Veerman 
107518a5822eSThomas Veerman #define bfd_put_16(abfd, val, ptr) \
107618a5822eSThomas Veerman   BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
107718a5822eSThomas Veerman #define bfd_put_signed_16 \
107818a5822eSThomas Veerman   bfd_put_16
107918a5822eSThomas Veerman #define bfd_get_16(abfd, ptr) \
108018a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx16, (ptr))
108118a5822eSThomas Veerman #define bfd_get_signed_16(abfd, ptr) \
108218a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
108318a5822eSThomas Veerman 
108418a5822eSThomas Veerman #define bfd_put_32(abfd, val, ptr) \
108518a5822eSThomas Veerman   BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
108618a5822eSThomas Veerman #define bfd_put_signed_32 \
108718a5822eSThomas Veerman   bfd_put_32
108818a5822eSThomas Veerman #define bfd_get_32(abfd, ptr) \
108918a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx32, (ptr))
109018a5822eSThomas Veerman #define bfd_get_signed_32(abfd, ptr) \
109118a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
109218a5822eSThomas Veerman 
109318a5822eSThomas Veerman #define bfd_put_64(abfd, val, ptr) \
109418a5822eSThomas Veerman   BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
109518a5822eSThomas Veerman #define bfd_put_signed_64 \
109618a5822eSThomas Veerman   bfd_put_64
109718a5822eSThomas Veerman #define bfd_get_64(abfd, ptr) \
109818a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx64, (ptr))
109918a5822eSThomas Veerman #define bfd_get_signed_64(abfd, ptr) \
110018a5822eSThomas Veerman   BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
110118a5822eSThomas Veerman 
110218a5822eSThomas Veerman #define bfd_get(bits, abfd, ptr)                       \
110318a5822eSThomas Veerman   ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr)       \
110418a5822eSThomas Veerman    : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
110518a5822eSThomas Veerman    : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
110618a5822eSThomas Veerman    : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
110718a5822eSThomas Veerman    : (abort (), (bfd_vma) - 1))
110818a5822eSThomas Veerman 
110918a5822eSThomas Veerman #define bfd_put(bits, abfd, val, ptr)                  \
111018a5822eSThomas Veerman   ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
111118a5822eSThomas Veerman    : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)                \
111218a5822eSThomas Veerman    : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)                \
111318a5822eSThomas Veerman    : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)                \
111418a5822eSThomas Veerman    : (abort (), (void) 0))
111518a5822eSThomas Veerman 
111618a5822eSThomas Veerman 
111718a5822eSThomas Veerman /* Byte swapping macros for file header data.  */
111818a5822eSThomas Veerman 
111918a5822eSThomas Veerman #define bfd_h_put_8(abfd, val, ptr) \
112018a5822eSThomas Veerman   bfd_put_8 (abfd, val, ptr)
112118a5822eSThomas Veerman #define bfd_h_put_signed_8(abfd, val, ptr) \
112218a5822eSThomas Veerman   bfd_put_8 (abfd, val, ptr)
112318a5822eSThomas Veerman #define bfd_h_get_8(abfd, ptr) \
112418a5822eSThomas Veerman   bfd_get_8 (abfd, ptr)
112518a5822eSThomas Veerman #define bfd_h_get_signed_8(abfd, ptr) \
112618a5822eSThomas Veerman   bfd_get_signed_8 (abfd, ptr)
112718a5822eSThomas Veerman 
112818a5822eSThomas Veerman #define bfd_h_put_16(abfd, val, ptr) \
112918a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
113018a5822eSThomas Veerman #define bfd_h_put_signed_16 \
113118a5822eSThomas Veerman   bfd_h_put_16
113218a5822eSThomas Veerman #define bfd_h_get_16(abfd, ptr) \
113318a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx16, (ptr))
113418a5822eSThomas Veerman #define bfd_h_get_signed_16(abfd, ptr) \
113518a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
113618a5822eSThomas Veerman 
113718a5822eSThomas Veerman #define bfd_h_put_32(abfd, val, ptr) \
113818a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
113918a5822eSThomas Veerman #define bfd_h_put_signed_32 \
114018a5822eSThomas Veerman   bfd_h_put_32
114118a5822eSThomas Veerman #define bfd_h_get_32(abfd, ptr) \
114218a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx32, (ptr))
114318a5822eSThomas Veerman #define bfd_h_get_signed_32(abfd, ptr) \
114418a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
114518a5822eSThomas Veerman 
114618a5822eSThomas Veerman #define bfd_h_put_64(abfd, val, ptr) \
114718a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
114818a5822eSThomas Veerman #define bfd_h_put_signed_64 \
114918a5822eSThomas Veerman   bfd_h_put_64
115018a5822eSThomas Veerman #define bfd_h_get_64(abfd, ptr) \
115118a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx64, (ptr))
115218a5822eSThomas Veerman #define bfd_h_get_signed_64(abfd, ptr) \
115318a5822eSThomas Veerman   BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
115418a5822eSThomas Veerman 
115518a5822eSThomas Veerman /* Aliases for the above, which should eventually go away.  */
115618a5822eSThomas Veerman 
115718a5822eSThomas Veerman #define H_PUT_64  bfd_h_put_64
115818a5822eSThomas Veerman #define H_PUT_32  bfd_h_put_32
115918a5822eSThomas Veerman #define H_PUT_16  bfd_h_put_16
116018a5822eSThomas Veerman #define H_PUT_8   bfd_h_put_8
116118a5822eSThomas Veerman #define H_PUT_S64 bfd_h_put_signed_64
116218a5822eSThomas Veerman #define H_PUT_S32 bfd_h_put_signed_32
116318a5822eSThomas Veerman #define H_PUT_S16 bfd_h_put_signed_16
116418a5822eSThomas Veerman #define H_PUT_S8  bfd_h_put_signed_8
116518a5822eSThomas Veerman #define H_GET_64  bfd_h_get_64
116618a5822eSThomas Veerman #define H_GET_32  bfd_h_get_32
116718a5822eSThomas Veerman #define H_GET_16  bfd_h_get_16
116818a5822eSThomas Veerman #define H_GET_8   bfd_h_get_8
116918a5822eSThomas Veerman #define H_GET_S64 bfd_h_get_signed_64
117018a5822eSThomas Veerman #define H_GET_S32 bfd_h_get_signed_32
117118a5822eSThomas Veerman #define H_GET_S16 bfd_h_get_signed_16
117218a5822eSThomas Veerman #define H_GET_S8  bfd_h_get_signed_8
117318a5822eSThomas Veerman 
117418a5822eSThomas Veerman 
117518a5822eSThomas Veerman /* Extracted from bfdio.c.  */
117618a5822eSThomas Veerman long bfd_get_mtime (bfd *abfd);
117718a5822eSThomas Veerman 
117818a5822eSThomas Veerman file_ptr bfd_get_size (bfd *abfd);
117918a5822eSThomas Veerman 
118018a5822eSThomas Veerman void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
1181c9ea9e7aSLionel Sambuc     int prot, int flags, file_ptr offset,
1182c9ea9e7aSLionel Sambuc     void **map_addr, bfd_size_type *map_len);
118318a5822eSThomas Veerman 
118418a5822eSThomas Veerman /* Extracted from bfdwin.c.  */
118518a5822eSThomas Veerman /* Extracted from section.c.  */
118618a5822eSThomas Veerman typedef struct bfd_section
118718a5822eSThomas Veerman {
118818a5822eSThomas Veerman   /* The name of the section; the name isn't a copy, the pointer is
118918a5822eSThomas Veerman      the same as that passed to bfd_make_section.  */
119018a5822eSThomas Veerman   const char *name;
119118a5822eSThomas Veerman 
119218a5822eSThomas Veerman   /* A unique sequence number.  */
119318a5822eSThomas Veerman   int id;
119418a5822eSThomas Veerman 
119518a5822eSThomas Veerman   /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
119618a5822eSThomas Veerman   int index;
119718a5822eSThomas Veerman 
119818a5822eSThomas Veerman   /* The next section in the list belonging to the BFD, or NULL.  */
119918a5822eSThomas Veerman   struct bfd_section *next;
120018a5822eSThomas Veerman 
120118a5822eSThomas Veerman   /* The previous section in the list belonging to the BFD, or NULL.  */
120218a5822eSThomas Veerman   struct bfd_section *prev;
120318a5822eSThomas Veerman 
120418a5822eSThomas Veerman   /* The field flags contains attributes of the section. Some
120518a5822eSThomas Veerman      flags are read in from the object file, and some are
120618a5822eSThomas Veerman      synthesized from other information.  */
120718a5822eSThomas Veerman   flagword flags;
120818a5822eSThomas Veerman 
120918a5822eSThomas Veerman #define SEC_NO_FLAGS   0x000
121018a5822eSThomas Veerman 
121118a5822eSThomas Veerman   /* Tells the OS to allocate space for this section when loading.
121218a5822eSThomas Veerman      This is clear for a section containing debug information only.  */
121318a5822eSThomas Veerman #define SEC_ALLOC      0x001
121418a5822eSThomas Veerman 
121518a5822eSThomas Veerman   /* Tells the OS to load the section from the file when loading.
121618a5822eSThomas Veerman      This is clear for a .bss section.  */
121718a5822eSThomas Veerman #define SEC_LOAD       0x002
121818a5822eSThomas Veerman 
121918a5822eSThomas Veerman   /* The section contains data still to be relocated, so there is
122018a5822eSThomas Veerman      some relocation information too.  */
122118a5822eSThomas Veerman #define SEC_RELOC      0x004
122218a5822eSThomas Veerman 
122318a5822eSThomas Veerman   /* A signal to the OS that the section contains read only data.  */
122418a5822eSThomas Veerman #define SEC_READONLY   0x008
122518a5822eSThomas Veerman 
122618a5822eSThomas Veerman   /* The section contains code only.  */
122718a5822eSThomas Veerman #define SEC_CODE       0x010
122818a5822eSThomas Veerman 
122918a5822eSThomas Veerman   /* The section contains data only.  */
123018a5822eSThomas Veerman #define SEC_DATA       0x020
123118a5822eSThomas Veerman 
123218a5822eSThomas Veerman   /* The section will reside in ROM.  */
123318a5822eSThomas Veerman #define SEC_ROM        0x040
123418a5822eSThomas Veerman 
123518a5822eSThomas Veerman   /* The section contains constructor information. This section
123618a5822eSThomas Veerman      type is used by the linker to create lists of constructors and
123718a5822eSThomas Veerman      destructors used by <<g++>>. When a back end sees a symbol
123818a5822eSThomas Veerman      which should be used in a constructor list, it creates a new
123918a5822eSThomas Veerman      section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
124018a5822eSThomas Veerman      the symbol to it, and builds a relocation. To build the lists
124118a5822eSThomas Veerman      of constructors, all the linker has to do is catenate all the
124218a5822eSThomas Veerman      sections called <<__CTOR_LIST__>> and relocate the data
124318a5822eSThomas Veerman      contained within - exactly the operations it would peform on
124418a5822eSThomas Veerman      standard data.  */
124518a5822eSThomas Veerman #define SEC_CONSTRUCTOR 0x080
124618a5822eSThomas Veerman 
124718a5822eSThomas Veerman   /* The section has contents - a data section could be
124818a5822eSThomas Veerman      <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
124918a5822eSThomas Veerman      <<SEC_HAS_CONTENTS>>  */
125018a5822eSThomas Veerman #define SEC_HAS_CONTENTS 0x100
125118a5822eSThomas Veerman 
125218a5822eSThomas Veerman   /* An instruction to the linker to not output the section
125318a5822eSThomas Veerman      even if it has information which would normally be written.  */
125418a5822eSThomas Veerman #define SEC_NEVER_LOAD 0x200
125518a5822eSThomas Veerman 
125618a5822eSThomas Veerman   /* The section contains thread local data.  */
125718a5822eSThomas Veerman #define SEC_THREAD_LOCAL 0x400
125818a5822eSThomas Veerman 
125918a5822eSThomas Veerman   /* The section has GOT references.  This flag is only for the
126018a5822eSThomas Veerman      linker, and is currently only used by the elf32-hppa back end.
126118a5822eSThomas Veerman      It will be set if global offset table references were detected
126218a5822eSThomas Veerman      in this section, which indicate to the linker that the section
126318a5822eSThomas Veerman      contains PIC code, and must be handled specially when doing a
126418a5822eSThomas Veerman      static link.  */
126518a5822eSThomas Veerman #define SEC_HAS_GOT_REF 0x800
126618a5822eSThomas Veerman 
126718a5822eSThomas Veerman   /* The section contains common symbols (symbols may be defined
126818a5822eSThomas Veerman      multiple times, the value of a symbol is the amount of
126918a5822eSThomas Veerman      space it requires, and the largest symbol value is the one
127018a5822eSThomas Veerman      used).  Most targets have exactly one of these (which we
127118a5822eSThomas Veerman      translate to bfd_com_section_ptr), but ECOFF has two.  */
127218a5822eSThomas Veerman #define SEC_IS_COMMON 0x1000
127318a5822eSThomas Veerman 
127418a5822eSThomas Veerman   /* The section contains only debugging information.  For
127518a5822eSThomas Veerman      example, this is set for ELF .debug and .stab sections.
127618a5822eSThomas Veerman      strip tests this flag to see if a section can be
127718a5822eSThomas Veerman      discarded.  */
127818a5822eSThomas Veerman #define SEC_DEBUGGING 0x2000
127918a5822eSThomas Veerman 
128018a5822eSThomas Veerman   /* The contents of this section are held in memory pointed to
128118a5822eSThomas Veerman      by the contents field.  This is checked by bfd_get_section_contents,
128218a5822eSThomas Veerman      and the data is retrieved from memory if appropriate.  */
128318a5822eSThomas Veerman #define SEC_IN_MEMORY 0x4000
128418a5822eSThomas Veerman 
128518a5822eSThomas Veerman   /* The contents of this section are to be excluded by the
128618a5822eSThomas Veerman      linker for executable and shared objects unless those
128718a5822eSThomas Veerman      objects are to be further relocated.  */
128818a5822eSThomas Veerman #define SEC_EXCLUDE 0x8000
128918a5822eSThomas Veerman 
129018a5822eSThomas Veerman   /* The contents of this section are to be sorted based on the sum of
129118a5822eSThomas Veerman      the symbol and addend values specified by the associated relocation
129218a5822eSThomas Veerman      entries.  Entries without associated relocation entries will be
129318a5822eSThomas Veerman      appended to the end of the section in an unspecified order.  */
129418a5822eSThomas Veerman #define SEC_SORT_ENTRIES 0x10000
129518a5822eSThomas Veerman 
129618a5822eSThomas Veerman   /* When linking, duplicate sections of the same name should be
129718a5822eSThomas Veerman      discarded, rather than being combined into a single section as
129818a5822eSThomas Veerman      is usually done.  This is similar to how common symbols are
129918a5822eSThomas Veerman      handled.  See SEC_LINK_DUPLICATES below.  */
130018a5822eSThomas Veerman #define SEC_LINK_ONCE 0x20000
130118a5822eSThomas Veerman 
130218a5822eSThomas Veerman   /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
130318a5822eSThomas Veerman      should handle duplicate sections.  */
130418a5822eSThomas Veerman #define SEC_LINK_DUPLICATES 0xc0000
130518a5822eSThomas Veerman 
130618a5822eSThomas Veerman   /* This value for SEC_LINK_DUPLICATES means that duplicate
130718a5822eSThomas Veerman      sections with the same name should simply be discarded.  */
130818a5822eSThomas Veerman #define SEC_LINK_DUPLICATES_DISCARD 0x0
130918a5822eSThomas Veerman 
131018a5822eSThomas Veerman   /* This value for SEC_LINK_DUPLICATES means that the linker
131118a5822eSThomas Veerman      should warn if there are any duplicate sections, although
131218a5822eSThomas Veerman      it should still only link one copy.  */
131318a5822eSThomas Veerman #define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
131418a5822eSThomas Veerman 
131518a5822eSThomas Veerman   /* This value for SEC_LINK_DUPLICATES means that the linker
131618a5822eSThomas Veerman      should warn if any duplicate sections are a different size.  */
131718a5822eSThomas Veerman #define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000
131818a5822eSThomas Veerman 
131918a5822eSThomas Veerman   /* This value for SEC_LINK_DUPLICATES means that the linker
132018a5822eSThomas Veerman      should warn if any duplicate sections contain different
132118a5822eSThomas Veerman      contents.  */
132218a5822eSThomas Veerman #define SEC_LINK_DUPLICATES_SAME_CONTENTS \
132318a5822eSThomas Veerman   (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
132418a5822eSThomas Veerman 
132518a5822eSThomas Veerman   /* This section was created by the linker as part of dynamic
132618a5822eSThomas Veerman      relocation or other arcane processing.  It is skipped when
132718a5822eSThomas Veerman      going through the first-pass output, trusting that someone
132818a5822eSThomas Veerman      else up the line will take care of it later.  */
132918a5822eSThomas Veerman #define SEC_LINKER_CREATED 0x100000
133018a5822eSThomas Veerman 
133118a5822eSThomas Veerman   /* This section should not be subject to garbage collection.
133218a5822eSThomas Veerman      Also set to inform the linker that this section should not be
133318a5822eSThomas Veerman      listed in the link map as discarded.  */
133418a5822eSThomas Veerman #define SEC_KEEP 0x200000
133518a5822eSThomas Veerman 
133618a5822eSThomas Veerman   /* This section contains "short" data, and should be placed
133718a5822eSThomas Veerman      "near" the GP.  */
133818a5822eSThomas Veerman #define SEC_SMALL_DATA 0x400000
133918a5822eSThomas Veerman 
134018a5822eSThomas Veerman   /* Attempt to merge identical entities in the section.
134118a5822eSThomas Veerman      Entity size is given in the entsize field.  */
134218a5822eSThomas Veerman #define SEC_MERGE 0x800000
134318a5822eSThomas Veerman 
134418a5822eSThomas Veerman   /* If given with SEC_MERGE, entities to merge are zero terminated
134518a5822eSThomas Veerman      strings where entsize specifies character size instead of fixed
134618a5822eSThomas Veerman      size entries.  */
134718a5822eSThomas Veerman #define SEC_STRINGS 0x1000000
134818a5822eSThomas Veerman 
134918a5822eSThomas Veerman   /* This section contains data about section groups.  */
135018a5822eSThomas Veerman #define SEC_GROUP 0x2000000
135118a5822eSThomas Veerman 
135218a5822eSThomas Veerman   /* The section is a COFF shared library section.  This flag is
135318a5822eSThomas Veerman      only for the linker.  If this type of section appears in
135418a5822eSThomas Veerman      the input file, the linker must copy it to the output file
135518a5822eSThomas Veerman      without changing the vma or size.  FIXME: Although this
135618a5822eSThomas Veerman      was originally intended to be general, it really is COFF
135718a5822eSThomas Veerman      specific (and the flag was renamed to indicate this).  It
135818a5822eSThomas Veerman      might be cleaner to have some more general mechanism to
135918a5822eSThomas Veerman      allow the back end to control what the linker does with
136018a5822eSThomas Veerman      sections.  */
136118a5822eSThomas Veerman #define SEC_COFF_SHARED_LIBRARY 0x4000000
136218a5822eSThomas Veerman 
1363c9ea9e7aSLionel Sambuc   /* This input section should be copied to output in reverse order
1364c9ea9e7aSLionel Sambuc      as an array of pointers.  This is for ELF linker internal use
1365c9ea9e7aSLionel Sambuc      only.  */
1366c9ea9e7aSLionel Sambuc #define SEC_ELF_REVERSE_COPY 0x4000000
1367c9ea9e7aSLionel Sambuc 
136818a5822eSThomas Veerman   /* This section contains data which may be shared with other
136918a5822eSThomas Veerman      executables or shared objects. This is for COFF only.  */
137018a5822eSThomas Veerman #define SEC_COFF_SHARED 0x8000000
137118a5822eSThomas Veerman 
137218a5822eSThomas Veerman   /* When a section with this flag is being linked, then if the size of
137318a5822eSThomas Veerman      the input section is less than a page, it should not cross a page
137418a5822eSThomas Veerman      boundary.  If the size of the input section is one page or more,
137518a5822eSThomas Veerman      it should be aligned on a page boundary.  This is for TI
137618a5822eSThomas Veerman      TMS320C54X only.  */
137718a5822eSThomas Veerman #define SEC_TIC54X_BLOCK 0x10000000
137818a5822eSThomas Veerman 
137918a5822eSThomas Veerman   /* Conditionally link this section; do not link if there are no
138018a5822eSThomas Veerman      references found to any symbol in the section.  This is for TI
138118a5822eSThomas Veerman      TMS320C54X only.  */
138218a5822eSThomas Veerman #define SEC_TIC54X_CLINK 0x20000000
138318a5822eSThomas Veerman 
138418a5822eSThomas Veerman   /* Indicate that section has the no read flag set. This happens
138518a5822eSThomas Veerman      when memory read flag isn't set. */
138618a5822eSThomas Veerman #define SEC_COFF_NOREAD 0x40000000
138718a5822eSThomas Veerman 
138818a5822eSThomas Veerman   /*  End of section flags.  */
138918a5822eSThomas Veerman 
139018a5822eSThomas Veerman   /* Some internal packed boolean fields.  */
139118a5822eSThomas Veerman 
139218a5822eSThomas Veerman   /* See the vma field.  */
139318a5822eSThomas Veerman   unsigned int user_set_vma : 1;
139418a5822eSThomas Veerman 
139518a5822eSThomas Veerman   /* A mark flag used by some of the linker backends.  */
139618a5822eSThomas Veerman   unsigned int linker_mark : 1;
139718a5822eSThomas Veerman 
139818a5822eSThomas Veerman   /* Another mark flag used by some of the linker backends.  Set for
139918a5822eSThomas Veerman      output sections that have an input section.  */
140018a5822eSThomas Veerman   unsigned int linker_has_input : 1;
140118a5822eSThomas Veerman 
140218a5822eSThomas Veerman   /* Mark flag used by some linker backends for garbage collection.  */
140318a5822eSThomas Veerman   unsigned int gc_mark : 1;
140418a5822eSThomas Veerman 
140518a5822eSThomas Veerman   /* Section compression status.  */
140618a5822eSThomas Veerman   unsigned int compress_status : 2;
140718a5822eSThomas Veerman #define COMPRESS_SECTION_NONE    0
140818a5822eSThomas Veerman #define COMPRESS_SECTION_DONE    1
140918a5822eSThomas Veerman #define DECOMPRESS_SECTION_SIZED 2
141018a5822eSThomas Veerman 
141118a5822eSThomas Veerman   /* The following flags are used by the ELF linker. */
141218a5822eSThomas Veerman 
141318a5822eSThomas Veerman   /* Mark sections which have been allocated to segments.  */
141418a5822eSThomas Veerman   unsigned int segment_mark : 1;
141518a5822eSThomas Veerman 
141618a5822eSThomas Veerman   /* Type of sec_info information.  */
141718a5822eSThomas Veerman   unsigned int sec_info_type:3;
1418c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_NONE      0
1419c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_STABS     1
1420c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_MERGE     2
1421c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_EH_FRAME  3
1422c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_JUST_SYMS 4
142318a5822eSThomas Veerman 
142418a5822eSThomas Veerman   /* Nonzero if this section uses RELA relocations, rather than REL.  */
142518a5822eSThomas Veerman   unsigned int use_rela_p:1;
142618a5822eSThomas Veerman 
142718a5822eSThomas Veerman   /* Bits used by various backends.  The generic code doesn't touch
142818a5822eSThomas Veerman      these fields.  */
142918a5822eSThomas Veerman 
143018a5822eSThomas Veerman   unsigned int sec_flg0:1;
143118a5822eSThomas Veerman   unsigned int sec_flg1:1;
143218a5822eSThomas Veerman   unsigned int sec_flg2:1;
143318a5822eSThomas Veerman   unsigned int sec_flg3:1;
143418a5822eSThomas Veerman   unsigned int sec_flg4:1;
143518a5822eSThomas Veerman   unsigned int sec_flg5:1;
143618a5822eSThomas Veerman 
143718a5822eSThomas Veerman   /* End of internal packed boolean fields.  */
143818a5822eSThomas Veerman 
143918a5822eSThomas Veerman   /*  The virtual memory address of the section - where it will be
144018a5822eSThomas Veerman       at run time.  The symbols are relocated against this.  The
144118a5822eSThomas Veerman       user_set_vma flag is maintained by bfd; if it's not set, the
144218a5822eSThomas Veerman       backend can assign addresses (for example, in <<a.out>>, where
144318a5822eSThomas Veerman       the default address for <<.data>> is dependent on the specific
144418a5822eSThomas Veerman       target and various flags).  */
144518a5822eSThomas Veerman   bfd_vma vma;
144618a5822eSThomas Veerman 
144718a5822eSThomas Veerman   /*  The load address of the section - where it would be in a
144818a5822eSThomas Veerman       rom image; really only used for writing section header
144918a5822eSThomas Veerman       information.  */
145018a5822eSThomas Veerman   bfd_vma lma;
145118a5822eSThomas Veerman 
145218a5822eSThomas Veerman   /* The size of the section in octets, as it will be output.
145318a5822eSThomas Veerman      Contains a value even if the section has no contents (e.g., the
145418a5822eSThomas Veerman      size of <<.bss>>).  */
145518a5822eSThomas Veerman   bfd_size_type size;
145618a5822eSThomas Veerman 
145718a5822eSThomas Veerman   /* For input sections, the original size on disk of the section, in
145818a5822eSThomas Veerman      octets.  This field should be set for any section whose size is
145918a5822eSThomas Veerman      changed by linker relaxation.  It is required for sections where
146018a5822eSThomas Veerman      the linker relaxation scheme doesn't cache altered section and
146118a5822eSThomas Veerman      reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing
146218a5822eSThomas Veerman      targets), and thus the original size needs to be kept to read the
146318a5822eSThomas Veerman      section multiple times.  For output sections, rawsize holds the
146418a5822eSThomas Veerman      section size calculated on a previous linker relaxation pass.  */
146518a5822eSThomas Veerman   bfd_size_type rawsize;
146618a5822eSThomas Veerman 
146718a5822eSThomas Veerman   /* The compressed size of the section in octets.  */
146818a5822eSThomas Veerman   bfd_size_type compressed_size;
146918a5822eSThomas Veerman 
147018a5822eSThomas Veerman   /* Relaxation table. */
147118a5822eSThomas Veerman   struct relax_table *relax;
147218a5822eSThomas Veerman 
147318a5822eSThomas Veerman   /* Count of used relaxation table entries. */
147418a5822eSThomas Veerman   int relax_count;
147518a5822eSThomas Veerman 
147618a5822eSThomas Veerman 
147718a5822eSThomas Veerman   /* If this section is going to be output, then this value is the
147818a5822eSThomas Veerman      offset in *bytes* into the output section of the first byte in the
147918a5822eSThomas Veerman      input section (byte ==> smallest addressable unit on the
148018a5822eSThomas Veerman      target).  In most cases, if this was going to start at the
148118a5822eSThomas Veerman      100th octet (8-bit quantity) in the output section, this value
148218a5822eSThomas Veerman      would be 100.  However, if the target byte size is 16 bits
148318a5822eSThomas Veerman      (bfd_octets_per_byte is "2"), this value would be 50.  */
148418a5822eSThomas Veerman   bfd_vma output_offset;
148518a5822eSThomas Veerman 
148618a5822eSThomas Veerman   /* The output section through which to map on output.  */
148718a5822eSThomas Veerman   struct bfd_section *output_section;
148818a5822eSThomas Veerman 
148918a5822eSThomas Veerman   /* The alignment requirement of the section, as an exponent of 2 -
149018a5822eSThomas Veerman      e.g., 3 aligns to 2^3 (or 8).  */
149118a5822eSThomas Veerman   unsigned int alignment_power;
149218a5822eSThomas Veerman 
149318a5822eSThomas Veerman   /* If an input section, a pointer to a vector of relocation
149418a5822eSThomas Veerman      records for the data in this section.  */
149518a5822eSThomas Veerman   struct reloc_cache_entry *relocation;
149618a5822eSThomas Veerman 
149718a5822eSThomas Veerman   /* If an output section, a pointer to a vector of pointers to
149818a5822eSThomas Veerman      relocation records for the data in this section.  */
149918a5822eSThomas Veerman   struct reloc_cache_entry **orelocation;
150018a5822eSThomas Veerman 
150118a5822eSThomas Veerman   /* The number of relocation records in one of the above.  */
150218a5822eSThomas Veerman   unsigned reloc_count;
150318a5822eSThomas Veerman 
150418a5822eSThomas Veerman   /* Information below is back end specific - and not always used
150518a5822eSThomas Veerman      or updated.  */
150618a5822eSThomas Veerman 
150718a5822eSThomas Veerman   /* File position of section data.  */
150818a5822eSThomas Veerman   file_ptr filepos;
150918a5822eSThomas Veerman 
151018a5822eSThomas Veerman   /* File position of relocation info.  */
151118a5822eSThomas Veerman   file_ptr rel_filepos;
151218a5822eSThomas Veerman 
151318a5822eSThomas Veerman   /* File position of line data.  */
151418a5822eSThomas Veerman   file_ptr line_filepos;
151518a5822eSThomas Veerman 
151618a5822eSThomas Veerman   /* Pointer to data for applications.  */
151718a5822eSThomas Veerman   void *userdata;
151818a5822eSThomas Veerman 
151918a5822eSThomas Veerman   /* If the SEC_IN_MEMORY flag is set, this points to the actual
152018a5822eSThomas Veerman      contents.  */
152118a5822eSThomas Veerman   unsigned char *contents;
152218a5822eSThomas Veerman 
152318a5822eSThomas Veerman   /* Attached line number information.  */
152418a5822eSThomas Veerman   alent *lineno;
152518a5822eSThomas Veerman 
152618a5822eSThomas Veerman   /* Number of line number records.  */
152718a5822eSThomas Veerman   unsigned int lineno_count;
152818a5822eSThomas Veerman 
152918a5822eSThomas Veerman   /* Entity size for merging purposes.  */
153018a5822eSThomas Veerman   unsigned int entsize;
153118a5822eSThomas Veerman 
153218a5822eSThomas Veerman   /* Points to the kept section if this section is a link-once section,
153318a5822eSThomas Veerman      and is discarded.  */
153418a5822eSThomas Veerman   struct bfd_section *kept_section;
153518a5822eSThomas Veerman 
153618a5822eSThomas Veerman   /* When a section is being output, this value changes as more
153718a5822eSThomas Veerman      linenumbers are written out.  */
153818a5822eSThomas Veerman   file_ptr moving_line_filepos;
153918a5822eSThomas Veerman 
154018a5822eSThomas Veerman   /* What the section number is in the target world.  */
154118a5822eSThomas Veerman   int target_index;
154218a5822eSThomas Veerman 
154318a5822eSThomas Veerman   void *used_by_bfd;
154418a5822eSThomas Veerman 
154518a5822eSThomas Veerman   /* If this is a constructor section then here is a list of the
154618a5822eSThomas Veerman      relocations created to relocate items within it.  */
154718a5822eSThomas Veerman   struct relent_chain *constructor_chain;
154818a5822eSThomas Veerman 
154918a5822eSThomas Veerman   /* The BFD which owns the section.  */
155018a5822eSThomas Veerman   bfd *owner;
155118a5822eSThomas Veerman 
155218a5822eSThomas Veerman   /* A symbol which points at this section only.  */
155318a5822eSThomas Veerman   struct bfd_symbol *symbol;
155418a5822eSThomas Veerman   struct bfd_symbol **symbol_ptr_ptr;
155518a5822eSThomas Veerman 
155618a5822eSThomas Veerman   /* Early in the link process, map_head and map_tail are used to build
155718a5822eSThomas Veerman      a list of input sections attached to an output section.  Later,
155818a5822eSThomas Veerman      output sections use these fields for a list of bfd_link_order
155918a5822eSThomas Veerman      structs.  */
156018a5822eSThomas Veerman   union {
156118a5822eSThomas Veerman     struct bfd_link_order *link_order;
156218a5822eSThomas Veerman     struct bfd_section *s;
156318a5822eSThomas Veerman   } map_head, map_tail;
156418a5822eSThomas Veerman } asection;
156518a5822eSThomas Veerman 
156618a5822eSThomas Veerman /* Relax table contains information about instructions which can
156718a5822eSThomas Veerman    be removed by relaxation -- replacing a long address with a
156818a5822eSThomas Veerman    short address.  */
156918a5822eSThomas Veerman struct relax_table {
157018a5822eSThomas Veerman   /* Address where bytes may be deleted. */
157118a5822eSThomas Veerman   bfd_vma addr;
157218a5822eSThomas Veerman 
157318a5822eSThomas Veerman   /* Number of bytes to be deleted.  */
157418a5822eSThomas Veerman   int size;
157518a5822eSThomas Veerman };
157618a5822eSThomas Veerman 
157718a5822eSThomas Veerman /* These sections are global, and are managed by BFD.  The application
157818a5822eSThomas Veerman    and target back end are not permitted to change the values in
1579c9ea9e7aSLionel Sambuc    these sections.  */
1580c9ea9e7aSLionel Sambuc extern asection std_section[4];
1581c9ea9e7aSLionel Sambuc 
158218a5822eSThomas Veerman #define BFD_ABS_SECTION_NAME "*ABS*"
158318a5822eSThomas Veerman #define BFD_UND_SECTION_NAME "*UND*"
158418a5822eSThomas Veerman #define BFD_COM_SECTION_NAME "*COM*"
158518a5822eSThomas Veerman #define BFD_IND_SECTION_NAME "*IND*"
158618a5822eSThomas Veerman 
158718a5822eSThomas Veerman /* Pointer to the common section.  */
1588c9ea9e7aSLionel Sambuc #define bfd_com_section_ptr (&std_section[0])
1589c9ea9e7aSLionel Sambuc /* Pointer to the undefined section.  */
1590c9ea9e7aSLionel Sambuc #define bfd_und_section_ptr (&std_section[1])
1591c9ea9e7aSLionel Sambuc /* Pointer to the absolute section.  */
1592c9ea9e7aSLionel Sambuc #define bfd_abs_section_ptr (&std_section[2])
159318a5822eSThomas Veerman /* Pointer to the indirect section.  */
1594c9ea9e7aSLionel Sambuc #define bfd_ind_section_ptr (&std_section[3])
1595c9ea9e7aSLionel Sambuc 
1596c9ea9e7aSLionel Sambuc #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1597c9ea9e7aSLionel Sambuc #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
159818a5822eSThomas Veerman #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
159918a5822eSThomas Veerman 
160018a5822eSThomas Veerman #define bfd_is_const_section(SEC)              \
160118a5822eSThomas Veerman  (   ((SEC) == bfd_abs_section_ptr)            \
160218a5822eSThomas Veerman   || ((SEC) == bfd_und_section_ptr)            \
160318a5822eSThomas Veerman   || ((SEC) == bfd_com_section_ptr)            \
160418a5822eSThomas Veerman   || ((SEC) == bfd_ind_section_ptr))
160518a5822eSThomas Veerman 
160618a5822eSThomas Veerman /* Macros to handle insertion and deletion of a bfd's sections.  These
160718a5822eSThomas Veerman    only handle the list pointers, ie. do not adjust section_count,
160818a5822eSThomas Veerman    target_index etc.  */
160918a5822eSThomas Veerman #define bfd_section_list_remove(ABFD, S) \
161018a5822eSThomas Veerman   do                                                   \
161118a5822eSThomas Veerman     {                                                  \
161218a5822eSThomas Veerman       asection *_s = S;                                \
161318a5822eSThomas Veerman       asection *_next = _s->next;                      \
161418a5822eSThomas Veerman       asection *_prev = _s->prev;                      \
161518a5822eSThomas Veerman       if (_prev)                                       \
161618a5822eSThomas Veerman         _prev->next = _next;                           \
161718a5822eSThomas Veerman       else                                             \
161818a5822eSThomas Veerman         (ABFD)->sections = _next;                      \
161918a5822eSThomas Veerman       if (_next)                                       \
162018a5822eSThomas Veerman         _next->prev = _prev;                           \
162118a5822eSThomas Veerman       else                                             \
162218a5822eSThomas Veerman         (ABFD)->section_last = _prev;                  \
162318a5822eSThomas Veerman     }                                                  \
162418a5822eSThomas Veerman   while (0)
162518a5822eSThomas Veerman #define bfd_section_list_append(ABFD, S) \
162618a5822eSThomas Veerman   do                                                   \
162718a5822eSThomas Veerman     {                                                  \
162818a5822eSThomas Veerman       asection *_s = S;                                \
162918a5822eSThomas Veerman       bfd *_abfd = ABFD;                               \
163018a5822eSThomas Veerman       _s->next = NULL;                                 \
163118a5822eSThomas Veerman       if (_abfd->section_last)                         \
163218a5822eSThomas Veerman         {                                              \
163318a5822eSThomas Veerman           _s->prev = _abfd->section_last;              \
163418a5822eSThomas Veerman           _abfd->section_last->next = _s;              \
163518a5822eSThomas Veerman         }                                              \
163618a5822eSThomas Veerman       else                                             \
163718a5822eSThomas Veerman         {                                              \
163818a5822eSThomas Veerman           _s->prev = NULL;                             \
163918a5822eSThomas Veerman           _abfd->sections = _s;                        \
164018a5822eSThomas Veerman         }                                              \
164118a5822eSThomas Veerman       _abfd->section_last = _s;                        \
164218a5822eSThomas Veerman     }                                                  \
164318a5822eSThomas Veerman   while (0)
164418a5822eSThomas Veerman #define bfd_section_list_prepend(ABFD, S) \
164518a5822eSThomas Veerman   do                                                   \
164618a5822eSThomas Veerman     {                                                  \
164718a5822eSThomas Veerman       asection *_s = S;                                \
164818a5822eSThomas Veerman       bfd *_abfd = ABFD;                               \
164918a5822eSThomas Veerman       _s->prev = NULL;                                 \
165018a5822eSThomas Veerman       if (_abfd->sections)                             \
165118a5822eSThomas Veerman         {                                              \
165218a5822eSThomas Veerman           _s->next = _abfd->sections;                  \
165318a5822eSThomas Veerman           _abfd->sections->prev = _s;                  \
165418a5822eSThomas Veerman         }                                              \
165518a5822eSThomas Veerman       else                                             \
165618a5822eSThomas Veerman         {                                              \
165718a5822eSThomas Veerman           _s->next = NULL;                             \
165818a5822eSThomas Veerman           _abfd->section_last = _s;                    \
165918a5822eSThomas Veerman         }                                              \
166018a5822eSThomas Veerman       _abfd->sections = _s;                            \
166118a5822eSThomas Veerman     }                                                  \
166218a5822eSThomas Veerman   while (0)
166318a5822eSThomas Veerman #define bfd_section_list_insert_after(ABFD, A, S) \
166418a5822eSThomas Veerman   do                                                   \
166518a5822eSThomas Veerman     {                                                  \
166618a5822eSThomas Veerman       asection *_a = A;                                \
166718a5822eSThomas Veerman       asection *_s = S;                                \
166818a5822eSThomas Veerman       asection *_next = _a->next;                      \
166918a5822eSThomas Veerman       _s->next = _next;                                \
167018a5822eSThomas Veerman       _s->prev = _a;                                   \
167118a5822eSThomas Veerman       _a->next = _s;                                   \
167218a5822eSThomas Veerman       if (_next)                                       \
167318a5822eSThomas Veerman         _next->prev = _s;                              \
167418a5822eSThomas Veerman       else                                             \
167518a5822eSThomas Veerman         (ABFD)->section_last = _s;                     \
167618a5822eSThomas Veerman     }                                                  \
167718a5822eSThomas Veerman   while (0)
167818a5822eSThomas Veerman #define bfd_section_list_insert_before(ABFD, B, S) \
167918a5822eSThomas Veerman   do                                                   \
168018a5822eSThomas Veerman     {                                                  \
168118a5822eSThomas Veerman       asection *_b = B;                                \
168218a5822eSThomas Veerman       asection *_s = S;                                \
168318a5822eSThomas Veerman       asection *_prev = _b->prev;                      \
168418a5822eSThomas Veerman       _s->prev = _prev;                                \
168518a5822eSThomas Veerman       _s->next = _b;                                   \
168618a5822eSThomas Veerman       _b->prev = _s;                                   \
168718a5822eSThomas Veerman       if (_prev)                                       \
168818a5822eSThomas Veerman         _prev->next = _s;                              \
168918a5822eSThomas Veerman       else                                             \
169018a5822eSThomas Veerman         (ABFD)->sections = _s;                         \
169118a5822eSThomas Veerman     }                                                  \
169218a5822eSThomas Veerman   while (0)
169318a5822eSThomas Veerman #define bfd_section_removed_from_list(ABFD, S) \
169418a5822eSThomas Veerman   ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
169518a5822eSThomas Veerman 
169618a5822eSThomas Veerman #define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX)                   \
169718a5822eSThomas Veerman   /* name, id,  index, next, prev, flags, user_set_vma,            */  \
169818a5822eSThomas Veerman   { NAME,  IDX, 0,     NULL, NULL, FLAGS, 0,                           \
169918a5822eSThomas Veerman                                                                        \
170018a5822eSThomas Veerman   /* linker_mark, linker_has_input, gc_mark, decompress_status,    */  \
170118a5822eSThomas Veerman      0,           0,                1,       0,                        \
170218a5822eSThomas Veerman                                                                        \
170318a5822eSThomas Veerman   /* segment_mark, sec_info_type, use_rela_p,                      */  \
170418a5822eSThomas Veerman      0,            0,             0,                                   \
170518a5822eSThomas Veerman                                                                        \
170618a5822eSThomas Veerman   /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5,   */  \
170718a5822eSThomas Veerman      0,        0,        0,        0,        0,        0,              \
170818a5822eSThomas Veerman                                                                        \
170918a5822eSThomas Veerman   /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */  \
171018a5822eSThomas Veerman      0,   0,   0,    0,       0,               0,     0,               \
171118a5822eSThomas Veerman                                                                        \
171218a5822eSThomas Veerman   /* output_offset, output_section, alignment_power,               */  \
1713c9ea9e7aSLionel Sambuc      0,             &SEC,           0,                                 \
171418a5822eSThomas Veerman                                                                        \
171518a5822eSThomas Veerman   /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */  \
171618a5822eSThomas Veerman      NULL,       NULL,        0,           0,       0,                 \
171718a5822eSThomas Veerman                                                                        \
171818a5822eSThomas Veerman   /* line_filepos, userdata, contents, lineno, lineno_count,       */  \
171918a5822eSThomas Veerman      0,            NULL,     NULL,     NULL,   0,                      \
172018a5822eSThomas Veerman                                                                        \
172118a5822eSThomas Veerman   /* entsize, kept_section, moving_line_filepos,                    */ \
172218a5822eSThomas Veerman      0,       NULL,          0,                                        \
172318a5822eSThomas Veerman                                                                        \
172418a5822eSThomas Veerman   /* target_index, used_by_bfd, constructor_chain, owner,          */  \
172518a5822eSThomas Veerman      0,            NULL,        NULL,              NULL,               \
172618a5822eSThomas Veerman                                                                        \
172718a5822eSThomas Veerman   /* symbol,                    symbol_ptr_ptr,                    */  \
172818a5822eSThomas Veerman      (struct bfd_symbol *) SYM, &SEC.symbol,                           \
172918a5822eSThomas Veerman                                                                        \
173018a5822eSThomas Veerman   /* map_head, map_tail                                            */  \
173118a5822eSThomas Veerman      { NULL }, { NULL }                                                \
173218a5822eSThomas Veerman     }
173318a5822eSThomas Veerman 
173418a5822eSThomas Veerman void bfd_section_list_clear (bfd *);
173518a5822eSThomas Veerman 
173618a5822eSThomas Veerman asection *bfd_get_section_by_name (bfd *abfd, const char *name);
173718a5822eSThomas Veerman 
1738c9ea9e7aSLionel Sambuc asection *bfd_get_next_section_by_name (asection *sec);
1739c9ea9e7aSLionel Sambuc 
1740c9ea9e7aSLionel Sambuc asection *bfd_get_linker_section (bfd *abfd, const char *name);
1741c9ea9e7aSLionel Sambuc 
174218a5822eSThomas Veerman asection *bfd_get_section_by_name_if
174318a5822eSThomas Veerman    (bfd *abfd,
174418a5822eSThomas Veerman     const char *name,
174518a5822eSThomas Veerman     bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
174618a5822eSThomas Veerman     void *obj);
174718a5822eSThomas Veerman 
174818a5822eSThomas Veerman char *bfd_get_unique_section_name
174918a5822eSThomas Veerman    (bfd *abfd, const char *templat, int *count);
175018a5822eSThomas Veerman 
175118a5822eSThomas Veerman asection *bfd_make_section_old_way (bfd *abfd, const char *name);
175218a5822eSThomas Veerman 
175318a5822eSThomas Veerman asection *bfd_make_section_anyway_with_flags
175418a5822eSThomas Veerman    (bfd *abfd, const char *name, flagword flags);
175518a5822eSThomas Veerman 
175618a5822eSThomas Veerman asection *bfd_make_section_anyway (bfd *abfd, const char *name);
175718a5822eSThomas Veerman 
175818a5822eSThomas Veerman asection *bfd_make_section_with_flags
175918a5822eSThomas Veerman    (bfd *, const char *name, flagword flags);
176018a5822eSThomas Veerman 
176118a5822eSThomas Veerman asection *bfd_make_section (bfd *, const char *name);
176218a5822eSThomas Veerman 
176318a5822eSThomas Veerman bfd_boolean bfd_set_section_flags
176418a5822eSThomas Veerman    (bfd *abfd, asection *sec, flagword flags);
176518a5822eSThomas Veerman 
176618a5822eSThomas Veerman void bfd_rename_section
176718a5822eSThomas Veerman    (bfd *abfd, asection *sec, const char *newname);
176818a5822eSThomas Veerman 
176918a5822eSThomas Veerman void bfd_map_over_sections
177018a5822eSThomas Veerman    (bfd *abfd,
177118a5822eSThomas Veerman     void (*func) (bfd *abfd, asection *sect, void *obj),
177218a5822eSThomas Veerman     void *obj);
177318a5822eSThomas Veerman 
177418a5822eSThomas Veerman asection *bfd_sections_find_if
177518a5822eSThomas Veerman    (bfd *abfd,
177618a5822eSThomas Veerman     bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
177718a5822eSThomas Veerman     void *obj);
177818a5822eSThomas Veerman 
177918a5822eSThomas Veerman bfd_boolean bfd_set_section_size
178018a5822eSThomas Veerman    (bfd *abfd, asection *sec, bfd_size_type val);
178118a5822eSThomas Veerman 
178218a5822eSThomas Veerman bfd_boolean bfd_set_section_contents
178318a5822eSThomas Veerman    (bfd *abfd, asection *section, const void *data,
178418a5822eSThomas Veerman     file_ptr offset, bfd_size_type count);
178518a5822eSThomas Veerman 
178618a5822eSThomas Veerman bfd_boolean bfd_get_section_contents
178718a5822eSThomas Veerman    (bfd *abfd, asection *section, void *location, file_ptr offset,
178818a5822eSThomas Veerman     bfd_size_type count);
178918a5822eSThomas Veerman 
179018a5822eSThomas Veerman bfd_boolean bfd_malloc_and_get_section
179118a5822eSThomas Veerman    (bfd *abfd, asection *section, bfd_byte **buf);
179218a5822eSThomas Veerman 
179318a5822eSThomas Veerman bfd_boolean bfd_copy_private_section_data
179418a5822eSThomas Veerman    (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
179518a5822eSThomas Veerman 
179618a5822eSThomas Veerman #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
179718a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_copy_private_section_data, \
179818a5822eSThomas Veerman                (ibfd, isection, obfd, osection))
179918a5822eSThomas Veerman bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
180018a5822eSThomas Veerman 
180118a5822eSThomas Veerman bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
180218a5822eSThomas Veerman 
180318a5822eSThomas Veerman /* Extracted from archures.c.  */
180418a5822eSThomas Veerman enum bfd_architecture
180518a5822eSThomas Veerman {
180618a5822eSThomas Veerman   bfd_arch_unknown,   /* File arch not known.  */
180718a5822eSThomas Veerman   bfd_arch_obscure,   /* Arch known, not one of these.  */
180818a5822eSThomas Veerman   bfd_arch_m68k,      /* Motorola 68xxx */
180918a5822eSThomas Veerman #define bfd_mach_m68000 1
181018a5822eSThomas Veerman #define bfd_mach_m68008 2
181118a5822eSThomas Veerman #define bfd_mach_m68010 3
181218a5822eSThomas Veerman #define bfd_mach_m68020 4
181318a5822eSThomas Veerman #define bfd_mach_m68030 5
181418a5822eSThomas Veerman #define bfd_mach_m68040 6
181518a5822eSThomas Veerman #define bfd_mach_m68060 7
181618a5822eSThomas Veerman #define bfd_mach_cpu32  8
181718a5822eSThomas Veerman #define bfd_mach_fido   9
181818a5822eSThomas Veerman #define bfd_mach_mcf_isa_a_nodiv 10
181918a5822eSThomas Veerman #define bfd_mach_mcf_isa_a 11
182018a5822eSThomas Veerman #define bfd_mach_mcf_isa_a_mac 12
182118a5822eSThomas Veerman #define bfd_mach_mcf_isa_a_emac 13
182218a5822eSThomas Veerman #define bfd_mach_mcf_isa_aplus 14
182318a5822eSThomas Veerman #define bfd_mach_mcf_isa_aplus_mac 15
182418a5822eSThomas Veerman #define bfd_mach_mcf_isa_aplus_emac 16
182518a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_nousp 17
182618a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_nousp_mac 18
182718a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_nousp_emac 19
182818a5822eSThomas Veerman #define bfd_mach_mcf_isa_b 20
182918a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_mac 21
183018a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_emac 22
183118a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_float 23
183218a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_float_mac 24
183318a5822eSThomas Veerman #define bfd_mach_mcf_isa_b_float_emac 25
183418a5822eSThomas Veerman #define bfd_mach_mcf_isa_c 26
183518a5822eSThomas Veerman #define bfd_mach_mcf_isa_c_mac 27
183618a5822eSThomas Veerman #define bfd_mach_mcf_isa_c_emac 28
183718a5822eSThomas Veerman #define bfd_mach_mcf_isa_c_nodiv 29
183818a5822eSThomas Veerman #define bfd_mach_mcf_isa_c_nodiv_mac 30
183918a5822eSThomas Veerman #define bfd_mach_mcf_isa_c_nodiv_emac 31
184018a5822eSThomas Veerman   bfd_arch_vax,       /* DEC Vax */
184118a5822eSThomas Veerman   bfd_arch_i960,      /* Intel 960 */
184218a5822eSThomas Veerman     /* The order of the following is important.
184318a5822eSThomas Veerman        lower number indicates a machine type that
184418a5822eSThomas Veerman        only accepts a subset of the instructions
184518a5822eSThomas Veerman        available to machines with higher numbers.
184618a5822eSThomas Veerman        The exception is the "ca", which is
184718a5822eSThomas Veerman        incompatible with all other machines except
184818a5822eSThomas Veerman        "core".  */
184918a5822eSThomas Veerman 
185018a5822eSThomas Veerman #define bfd_mach_i960_core      1
185118a5822eSThomas Veerman #define bfd_mach_i960_ka_sa     2
185218a5822eSThomas Veerman #define bfd_mach_i960_kb_sb     3
185318a5822eSThomas Veerman #define bfd_mach_i960_mc        4
185418a5822eSThomas Veerman #define bfd_mach_i960_xa        5
185518a5822eSThomas Veerman #define bfd_mach_i960_ca        6
185618a5822eSThomas Veerman #define bfd_mach_i960_jx        7
185718a5822eSThomas Veerman #define bfd_mach_i960_hx        8
185818a5822eSThomas Veerman 
1859*0a6a1f1dSLionel Sambuc   bfd_arch_or1k,      /* OpenRISC 1000 */
1860*0a6a1f1dSLionel Sambuc #define bfd_mach_or1k		1
1861*0a6a1f1dSLionel Sambuc #define bfd_mach_or1knd		2
186218a5822eSThomas Veerman 
186318a5822eSThomas Veerman   bfd_arch_sparc,     /* SPARC */
186418a5822eSThomas Veerman #define bfd_mach_sparc                 1
186518a5822eSThomas Veerman /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
186618a5822eSThomas Veerman #define bfd_mach_sparc_sparclet        2
186718a5822eSThomas Veerman #define bfd_mach_sparc_sparclite       3
186818a5822eSThomas Veerman #define bfd_mach_sparc_v8plus          4
186918a5822eSThomas Veerman #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
187018a5822eSThomas Veerman #define bfd_mach_sparc_sparclite_le    6
187118a5822eSThomas Veerman #define bfd_mach_sparc_v9              7
187218a5822eSThomas Veerman #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
187318a5822eSThomas Veerman #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
187418a5822eSThomas Veerman #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
187518a5822eSThomas Veerman /* Nonzero if MACH has the v9 instruction set.  */
187618a5822eSThomas Veerman #define bfd_mach_sparc_v9_p(mach) \
187718a5822eSThomas Veerman   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
187818a5822eSThomas Veerman    && (mach) != bfd_mach_sparc_sparclite_le)
187918a5822eSThomas Veerman /* Nonzero if MACH is a 64 bit sparc architecture.  */
188018a5822eSThomas Veerman #define bfd_mach_sparc_64bit_p(mach) \
188118a5822eSThomas Veerman   ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
188218a5822eSThomas Veerman   bfd_arch_spu,       /* PowerPC SPU */
188318a5822eSThomas Veerman #define bfd_mach_spu           256
188418a5822eSThomas Veerman   bfd_arch_mips,      /* MIPS Rxxxx */
188518a5822eSThomas Veerman #define bfd_mach_mips3000              3000
188618a5822eSThomas Veerman #define bfd_mach_mips3900              3900
188718a5822eSThomas Veerman #define bfd_mach_mips4000              4000
188818a5822eSThomas Veerman #define bfd_mach_mips4010              4010
188918a5822eSThomas Veerman #define bfd_mach_mips4100              4100
189018a5822eSThomas Veerman #define bfd_mach_mips4111              4111
189118a5822eSThomas Veerman #define bfd_mach_mips4120              4120
189218a5822eSThomas Veerman #define bfd_mach_mips4300              4300
189318a5822eSThomas Veerman #define bfd_mach_mips4400              4400
189418a5822eSThomas Veerman #define bfd_mach_mips4600              4600
189518a5822eSThomas Veerman #define bfd_mach_mips4650              4650
189618a5822eSThomas Veerman #define bfd_mach_mips5000              5000
189718a5822eSThomas Veerman #define bfd_mach_mips5400              5400
189818a5822eSThomas Veerman #define bfd_mach_mips5500              5500
189918a5822eSThomas Veerman #define bfd_mach_mips6000              6000
190018a5822eSThomas Veerman #define bfd_mach_mips7000              7000
190118a5822eSThomas Veerman #define bfd_mach_mips8000              8000
190218a5822eSThomas Veerman #define bfd_mach_mips9000              9000
190318a5822eSThomas Veerman #define bfd_mach_mips10000             10000
190418a5822eSThomas Veerman #define bfd_mach_mips12000             12000
190518a5822eSThomas Veerman #define bfd_mach_mips14000             14000
190618a5822eSThomas Veerman #define bfd_mach_mips16000             16000
190718a5822eSThomas Veerman #define bfd_mach_mips16                16
190818a5822eSThomas Veerman #define bfd_mach_mips5                 5
190918a5822eSThomas Veerman #define bfd_mach_mips_loongson_2e      3001
191018a5822eSThomas Veerman #define bfd_mach_mips_loongson_2f      3002
1911c9ea9e7aSLionel Sambuc #define bfd_mach_mips_loongson_3a      3003
191218a5822eSThomas Veerman #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
191318a5822eSThomas Veerman #define bfd_mach_mips_octeon           6501
1914c9ea9e7aSLionel Sambuc #define bfd_mach_mips_octeonp          6601
1915c9ea9e7aSLionel Sambuc #define bfd_mach_mips_octeon2          6502
191618a5822eSThomas Veerman #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
191718a5822eSThomas Veerman #define bfd_mach_mipsisa32             32
191818a5822eSThomas Veerman #define bfd_mach_mipsisa32r2           33
191918a5822eSThomas Veerman #define bfd_mach_mipsisa64             64
192018a5822eSThomas Veerman #define bfd_mach_mipsisa64r2           65
1921c9ea9e7aSLionel Sambuc #define bfd_mach_mips_micromips        96
192218a5822eSThomas Veerman   bfd_arch_i386,      /* Intel 386 */
1923c9ea9e7aSLionel Sambuc #define bfd_mach_i386_intel_syntax     (1 << 0)
1924c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i8086            (1 << 1)
1925c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i386             (1 << 2)
1926c9ea9e7aSLionel Sambuc #define bfd_mach_x86_64                (1 << 3)
1927c9ea9e7aSLionel Sambuc #define bfd_mach_x64_32                (1 << 4)
1928c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
1929c9ea9e7aSLionel Sambuc #define bfd_mach_x86_64_intel_syntax   (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
1930c9ea9e7aSLionel Sambuc #define bfd_mach_x64_32_intel_syntax   (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
193118a5822eSThomas Veerman   bfd_arch_l1om,   /* Intel L1OM */
1932c9ea9e7aSLionel Sambuc #define bfd_mach_l1om                  (1 << 5)
1933c9ea9e7aSLionel Sambuc #define bfd_mach_l1om_intel_syntax     (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
1934c9ea9e7aSLionel Sambuc   bfd_arch_k1om,   /* Intel K1OM */
1935c9ea9e7aSLionel Sambuc #define bfd_mach_k1om                  (1 << 6)
1936c9ea9e7aSLionel Sambuc #define bfd_mach_k1om_intel_syntax     (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
193718a5822eSThomas Veerman   bfd_arch_we32k,     /* AT&T WE32xxx */
193818a5822eSThomas Veerman   bfd_arch_tahoe,     /* CCI/Harris Tahoe */
193918a5822eSThomas Veerman   bfd_arch_i860,      /* Intel 860 */
194018a5822eSThomas Veerman   bfd_arch_i370,      /* IBM 360/370 Mainframes */
194118a5822eSThomas Veerman   bfd_arch_romp,      /* IBM ROMP PC/RT */
194218a5822eSThomas Veerman   bfd_arch_convex,    /* Convex */
194318a5822eSThomas Veerman   bfd_arch_m88k,      /* Motorola 88xxx */
194418a5822eSThomas Veerman   bfd_arch_m98k,      /* Motorola 98xxx */
194518a5822eSThomas Veerman   bfd_arch_pyramid,   /* Pyramid Technology */
194618a5822eSThomas Veerman   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
194718a5822eSThomas Veerman #define bfd_mach_h8300    1
194818a5822eSThomas Veerman #define bfd_mach_h8300h   2
194918a5822eSThomas Veerman #define bfd_mach_h8300s   3
195018a5822eSThomas Veerman #define bfd_mach_h8300hn  4
195118a5822eSThomas Veerman #define bfd_mach_h8300sn  5
195218a5822eSThomas Veerman #define bfd_mach_h8300sx  6
195318a5822eSThomas Veerman #define bfd_mach_h8300sxn 7
195418a5822eSThomas Veerman   bfd_arch_pdp11,     /* DEC PDP-11 */
195518a5822eSThomas Veerman   bfd_arch_plugin,
195618a5822eSThomas Veerman   bfd_arch_powerpc,   /* PowerPC */
195718a5822eSThomas Veerman #define bfd_mach_ppc           32
195818a5822eSThomas Veerman #define bfd_mach_ppc64         64
195918a5822eSThomas Veerman #define bfd_mach_ppc_403       403
196018a5822eSThomas Veerman #define bfd_mach_ppc_403gc     4030
196118a5822eSThomas Veerman #define bfd_mach_ppc_405       405
196218a5822eSThomas Veerman #define bfd_mach_ppc_505       505
196318a5822eSThomas Veerman #define bfd_mach_ppc_601       601
196418a5822eSThomas Veerman #define bfd_mach_ppc_602       602
196518a5822eSThomas Veerman #define bfd_mach_ppc_603       603
196618a5822eSThomas Veerman #define bfd_mach_ppc_ec603e    6031
196718a5822eSThomas Veerman #define bfd_mach_ppc_604       604
196818a5822eSThomas Veerman #define bfd_mach_ppc_620       620
196918a5822eSThomas Veerman #define bfd_mach_ppc_630       630
197018a5822eSThomas Veerman #define bfd_mach_ppc_750       750
197118a5822eSThomas Veerman #define bfd_mach_ppc_860       860
197218a5822eSThomas Veerman #define bfd_mach_ppc_a35       35
197318a5822eSThomas Veerman #define bfd_mach_ppc_rs64ii    642
197418a5822eSThomas Veerman #define bfd_mach_ppc_rs64iii   643
197518a5822eSThomas Veerman #define bfd_mach_ppc_7400      7400
197618a5822eSThomas Veerman #define bfd_mach_ppc_e500      500
197718a5822eSThomas Veerman #define bfd_mach_ppc_e500mc    5001
197818a5822eSThomas Veerman #define bfd_mach_ppc_e500mc64  5005
1979c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_e5500     5006
1980c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_e6500     5007
198118a5822eSThomas Veerman #define bfd_mach_ppc_titan     83
1982c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_vle       84
1983*0a6a1f1dSLionel Sambuc   bfd_arch_riscv,     /* RISC-V */
1984*0a6a1f1dSLionel Sambuc #define bfd_mach_riscv32       132
1985*0a6a1f1dSLionel Sambuc #define bfd_mach_riscv64       164
198618a5822eSThomas Veerman   bfd_arch_rs6000,    /* IBM RS/6000 */
198718a5822eSThomas Veerman #define bfd_mach_rs6k          6000
198818a5822eSThomas Veerman #define bfd_mach_rs6k_rs1      6001
198918a5822eSThomas Veerman #define bfd_mach_rs6k_rsc      6003
199018a5822eSThomas Veerman #define bfd_mach_rs6k_rs2      6002
199118a5822eSThomas Veerman   bfd_arch_hppa,      /* HP PA RISC */
199218a5822eSThomas Veerman #define bfd_mach_hppa10        10
199318a5822eSThomas Veerman #define bfd_mach_hppa11        11
199418a5822eSThomas Veerman #define bfd_mach_hppa20        20
199518a5822eSThomas Veerman #define bfd_mach_hppa20w       25
199618a5822eSThomas Veerman   bfd_arch_d10v,      /* Mitsubishi D10V */
199718a5822eSThomas Veerman #define bfd_mach_d10v          1
199818a5822eSThomas Veerman #define bfd_mach_d10v_ts2      2
199918a5822eSThomas Veerman #define bfd_mach_d10v_ts3      3
200018a5822eSThomas Veerman   bfd_arch_d30v,      /* Mitsubishi D30V */
200118a5822eSThomas Veerman   bfd_arch_dlx,       /* DLX */
200218a5822eSThomas Veerman   bfd_arch_m68hc11,   /* Motorola 68HC11 */
200318a5822eSThomas Veerman   bfd_arch_m68hc12,   /* Motorola 68HC12 */
200418a5822eSThomas Veerman #define bfd_mach_m6812_default 0
200518a5822eSThomas Veerman #define bfd_mach_m6812         1
200618a5822eSThomas Veerman #define bfd_mach_m6812s        2
2007c9ea9e7aSLionel Sambuc   bfd_arch_m9s12x,   /* Freescale S12X */
2008c9ea9e7aSLionel Sambuc   bfd_arch_m9s12xg,  /* Freescale XGATE */
200918a5822eSThomas Veerman   bfd_arch_z8k,       /* Zilog Z8000 */
201018a5822eSThomas Veerman #define bfd_mach_z8001         1
201118a5822eSThomas Veerman #define bfd_mach_z8002         2
201218a5822eSThomas Veerman   bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
201318a5822eSThomas Veerman   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
201418a5822eSThomas Veerman #define bfd_mach_sh            1
201518a5822eSThomas Veerman #define bfd_mach_sh2        0x20
201618a5822eSThomas Veerman #define bfd_mach_sh_dsp     0x2d
201718a5822eSThomas Veerman #define bfd_mach_sh2a       0x2a
201818a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu 0x2b
201918a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
202018a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
202118a5822eSThomas Veerman #define bfd_mach_sh2a_or_sh4  0x2a3
202218a5822eSThomas Veerman #define bfd_mach_sh2a_or_sh3e 0x2a4
202318a5822eSThomas Veerman #define bfd_mach_sh2e       0x2e
202418a5822eSThomas Veerman #define bfd_mach_sh3        0x30
202518a5822eSThomas Veerman #define bfd_mach_sh3_nommu  0x31
202618a5822eSThomas Veerman #define bfd_mach_sh3_dsp    0x3d
202718a5822eSThomas Veerman #define bfd_mach_sh3e       0x3e
202818a5822eSThomas Veerman #define bfd_mach_sh4        0x40
202918a5822eSThomas Veerman #define bfd_mach_sh4_nofpu  0x41
203018a5822eSThomas Veerman #define bfd_mach_sh4_nommu_nofpu  0x42
203118a5822eSThomas Veerman #define bfd_mach_sh4a       0x4a
203218a5822eSThomas Veerman #define bfd_mach_sh4a_nofpu 0x4b
203318a5822eSThomas Veerman #define bfd_mach_sh4al_dsp  0x4d
203418a5822eSThomas Veerman #define bfd_mach_sh5        0x50
203518a5822eSThomas Veerman   bfd_arch_alpha,     /* Dec Alpha */
203618a5822eSThomas Veerman #define bfd_mach_alpha_ev4  0x10
203718a5822eSThomas Veerman #define bfd_mach_alpha_ev5  0x20
203818a5822eSThomas Veerman #define bfd_mach_alpha_ev6  0x30
203918a5822eSThomas Veerman   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
204018a5822eSThomas Veerman #define bfd_mach_arm_unknown   0
204118a5822eSThomas Veerman #define bfd_mach_arm_2         1
204218a5822eSThomas Veerman #define bfd_mach_arm_2a        2
204318a5822eSThomas Veerman #define bfd_mach_arm_3         3
204418a5822eSThomas Veerman #define bfd_mach_arm_3M        4
204518a5822eSThomas Veerman #define bfd_mach_arm_4         5
204618a5822eSThomas Veerman #define bfd_mach_arm_4T        6
204718a5822eSThomas Veerman #define bfd_mach_arm_5         7
204818a5822eSThomas Veerman #define bfd_mach_arm_5T        8
204918a5822eSThomas Veerman #define bfd_mach_arm_5TE       9
205018a5822eSThomas Veerman #define bfd_mach_arm_XScale    10
205118a5822eSThomas Veerman #define bfd_mach_arm_ep9312    11
205218a5822eSThomas Veerman #define bfd_mach_arm_iWMMXt    12
205318a5822eSThomas Veerman #define bfd_mach_arm_iWMMXt2   13
205418a5822eSThomas Veerman   bfd_arch_ns32k,     /* National Semiconductors ns32000 */
205518a5822eSThomas Veerman   bfd_arch_w65,       /* WDC 65816 */
205618a5822eSThomas Veerman   bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
205718a5822eSThomas Veerman   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
205818a5822eSThomas Veerman #define bfd_mach_tic3x         30
205918a5822eSThomas Veerman #define bfd_mach_tic4x         40
206018a5822eSThomas Veerman   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
206118a5822eSThomas Veerman   bfd_arch_tic6x,     /* Texas Instruments TMS320C6X */
206218a5822eSThomas Veerman   bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
206318a5822eSThomas Veerman   bfd_arch_v850,      /* NEC V850 */
206418a5822eSThomas Veerman #define bfd_mach_v850          1
206518a5822eSThomas Veerman #define bfd_mach_v850e         'E'
206618a5822eSThomas Veerman #define bfd_mach_v850e1        '1'
206718a5822eSThomas Veerman #define bfd_mach_v850e2        0x4532
206818a5822eSThomas Veerman #define bfd_mach_v850e2v3      0x45325633
206918a5822eSThomas Veerman   bfd_arch_arc,       /* ARC Cores */
207018a5822eSThomas Veerman #define bfd_mach_arc_5         5
207118a5822eSThomas Veerman #define bfd_mach_arc_6         6
207218a5822eSThomas Veerman #define bfd_mach_arc_7         7
207318a5822eSThomas Veerman #define bfd_mach_arc_8         8
207418a5822eSThomas Veerman  bfd_arch_m32c,     /* Renesas M16C/M32C.  */
207518a5822eSThomas Veerman #define bfd_mach_m16c        0x75
207618a5822eSThomas Veerman #define bfd_mach_m32c        0x78
207718a5822eSThomas Veerman   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
207818a5822eSThomas Veerman #define bfd_mach_m32r          1 /* For backwards compatibility.  */
207918a5822eSThomas Veerman #define bfd_mach_m32rx         'x'
208018a5822eSThomas Veerman #define bfd_mach_m32r2         '2'
208118a5822eSThomas Veerman   bfd_arch_mn10200,   /* Matsushita MN10200 */
208218a5822eSThomas Veerman   bfd_arch_mn10300,   /* Matsushita MN10300 */
208318a5822eSThomas Veerman #define bfd_mach_mn10300               300
208418a5822eSThomas Veerman #define bfd_mach_am33          330
208518a5822eSThomas Veerman #define bfd_mach_am33_2        332
208618a5822eSThomas Veerman   bfd_arch_fr30,
208718a5822eSThomas Veerman #define bfd_mach_fr30          0x46523330
208818a5822eSThomas Veerman   bfd_arch_frv,
208918a5822eSThomas Veerman #define bfd_mach_frv           1
209018a5822eSThomas Veerman #define bfd_mach_frvsimple     2
209118a5822eSThomas Veerman #define bfd_mach_fr300         300
209218a5822eSThomas Veerman #define bfd_mach_fr400         400
209318a5822eSThomas Veerman #define bfd_mach_fr450         450
209418a5822eSThomas Veerman #define bfd_mach_frvtomcat     499     /* fr500 prototype */
209518a5822eSThomas Veerman #define bfd_mach_fr500         500
209618a5822eSThomas Veerman #define bfd_mach_fr550         550
209718a5822eSThomas Veerman   bfd_arch_moxie,       /* The moxie processor */
209818a5822eSThomas Veerman #define bfd_mach_moxie         1
209918a5822eSThomas Veerman   bfd_arch_mcore,
210018a5822eSThomas Veerman   bfd_arch_mep,
210118a5822eSThomas Veerman #define bfd_mach_mep           1
210218a5822eSThomas Veerman #define bfd_mach_mep_h1        0x6831
210318a5822eSThomas Veerman #define bfd_mach_mep_c5        0x6335
210418a5822eSThomas Veerman   bfd_arch_ia64,      /* HP/Intel ia64 */
210518a5822eSThomas Veerman #define bfd_mach_ia64_elf64    64
210618a5822eSThomas Veerman #define bfd_mach_ia64_elf32    32
210718a5822eSThomas Veerman   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
210818a5822eSThomas Veerman #define bfd_mach_ip2022        1
210918a5822eSThomas Veerman #define bfd_mach_ip2022ext     2
211018a5822eSThomas Veerman  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
211118a5822eSThomas Veerman #define bfd_mach_iq2000        1
211218a5822eSThomas Veerman #define bfd_mach_iq10          2
2113c9ea9e7aSLionel Sambuc   bfd_arch_epiphany,   /* Adapteva EPIPHANY */
2114c9ea9e7aSLionel Sambuc #define bfd_mach_epiphany16    1
2115c9ea9e7aSLionel Sambuc #define bfd_mach_epiphany32    2
211618a5822eSThomas Veerman   bfd_arch_mt,
211718a5822eSThomas Veerman #define bfd_mach_ms1           1
211818a5822eSThomas Veerman #define bfd_mach_mrisc2        2
211918a5822eSThomas Veerman #define bfd_mach_ms2           3
212018a5822eSThomas Veerman   bfd_arch_pj,
212118a5822eSThomas Veerman   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
212218a5822eSThomas Veerman #define bfd_mach_avr1          1
212318a5822eSThomas Veerman #define bfd_mach_avr2          2
212418a5822eSThomas Veerman #define bfd_mach_avr25         25
212518a5822eSThomas Veerman #define bfd_mach_avr3          3
212618a5822eSThomas Veerman #define bfd_mach_avr31         31
212718a5822eSThomas Veerman #define bfd_mach_avr35         35
212818a5822eSThomas Veerman #define bfd_mach_avr4          4
212918a5822eSThomas Veerman #define bfd_mach_avr5          5
213018a5822eSThomas Veerman #define bfd_mach_avr51         51
213118a5822eSThomas Veerman #define bfd_mach_avr6          6
2132c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega1 101
2133c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega2 102
2134c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega3 103
2135c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega4 104
2136c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega5 105
2137c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega6 106
2138c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega7 107
213918a5822eSThomas Veerman   bfd_arch_bfin,        /* ADI Blackfin */
214018a5822eSThomas Veerman #define bfd_mach_bfin          1
214118a5822eSThomas Veerman   bfd_arch_cr16,       /* National Semiconductor CompactRISC (ie CR16). */
214218a5822eSThomas Veerman #define bfd_mach_cr16          1
214318a5822eSThomas Veerman   bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
214418a5822eSThomas Veerman #define bfd_mach_cr16c         1
214518a5822eSThomas Veerman   bfd_arch_crx,       /*  National Semiconductor CRX.  */
214618a5822eSThomas Veerman #define bfd_mach_crx           1
214718a5822eSThomas Veerman   bfd_arch_cris,      /* Axis CRIS */
214818a5822eSThomas Veerman #define bfd_mach_cris_v0_v10   255
214918a5822eSThomas Veerman #define bfd_mach_cris_v32      32
215018a5822eSThomas Veerman #define bfd_mach_cris_v10_v32  1032
2151c9ea9e7aSLionel Sambuc   bfd_arch_rl78,
2152c9ea9e7aSLionel Sambuc #define bfd_mach_rl78  0x75
215318a5822eSThomas Veerman   bfd_arch_rx,        /* Renesas RX.  */
215418a5822eSThomas Veerman #define bfd_mach_rx            0x75
215518a5822eSThomas Veerman   bfd_arch_s390,      /* IBM s390 */
215618a5822eSThomas Veerman #define bfd_mach_s390_31       31
215718a5822eSThomas Veerman #define bfd_mach_s390_64       64
215818a5822eSThomas Veerman   bfd_arch_score,     /* Sunplus score */
215918a5822eSThomas Veerman #define bfd_mach_score3         3
216018a5822eSThomas Veerman #define bfd_mach_score7         7
216118a5822eSThomas Veerman   bfd_arch_openrisc,  /* OpenRISC */
216218a5822eSThomas Veerman   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
216318a5822eSThomas Veerman   bfd_arch_xstormy16,
216418a5822eSThomas Veerman #define bfd_mach_xstormy16     1
216518a5822eSThomas Veerman   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
216618a5822eSThomas Veerman #define bfd_mach_msp11          11
216718a5822eSThomas Veerman #define bfd_mach_msp110         110
216818a5822eSThomas Veerman #define bfd_mach_msp12          12
216918a5822eSThomas Veerman #define bfd_mach_msp13          13
217018a5822eSThomas Veerman #define bfd_mach_msp14          14
217118a5822eSThomas Veerman #define bfd_mach_msp15          15
217218a5822eSThomas Veerman #define bfd_mach_msp16          16
217318a5822eSThomas Veerman #define bfd_mach_msp21          21
217418a5822eSThomas Veerman #define bfd_mach_msp31          31
217518a5822eSThomas Veerman #define bfd_mach_msp32          32
217618a5822eSThomas Veerman #define bfd_mach_msp33          33
217718a5822eSThomas Veerman #define bfd_mach_msp41          41
217818a5822eSThomas Veerman #define bfd_mach_msp42          42
217918a5822eSThomas Veerman #define bfd_mach_msp43          43
218018a5822eSThomas Veerman #define bfd_mach_msp44          44
218118a5822eSThomas Veerman   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
218218a5822eSThomas Veerman #define bfd_mach_xc16x         1
218318a5822eSThomas Veerman #define bfd_mach_xc16xl        2
218418a5822eSThomas Veerman #define bfd_mach_xc16xs        3
2185c9ea9e7aSLionel Sambuc   bfd_arch_xgate,   /* Freescale XGATE */
2186c9ea9e7aSLionel Sambuc #define bfd_mach_xgate         1
218718a5822eSThomas Veerman   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
218818a5822eSThomas Veerman #define bfd_mach_xtensa        1
218918a5822eSThomas Veerman   bfd_arch_z80,
219018a5822eSThomas Veerman #define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
219118a5822eSThomas Veerman #define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
219218a5822eSThomas Veerman #define bfd_mach_z80full        7 /* All undocumented instructions.  */
219318a5822eSThomas Veerman #define bfd_mach_r800           11 /* R800: successor with multiplication.  */
219418a5822eSThomas Veerman   bfd_arch_lm32,      /* Lattice Mico32 */
219518a5822eSThomas Veerman #define bfd_mach_lm32      1
219618a5822eSThomas Veerman   bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2197c9ea9e7aSLionel Sambuc   bfd_arch_tilepro,   /* Tilera TILEPro */
2198c9ea9e7aSLionel Sambuc   bfd_arch_tilegx, /* Tilera TILE-Gx */
2199c9ea9e7aSLionel Sambuc #define bfd_mach_tilepro   1
2200c9ea9e7aSLionel Sambuc #define bfd_mach_tilegx    1
2201c9ea9e7aSLionel Sambuc #define bfd_mach_tilegx32  2
2202c9ea9e7aSLionel Sambuc   bfd_arch_aarch64,   /* AArch64  */
2203c9ea9e7aSLionel Sambuc #define bfd_mach_aarch64 0
220418a5822eSThomas Veerman   bfd_arch_last
220518a5822eSThomas Veerman   };
220618a5822eSThomas Veerman 
220718a5822eSThomas Veerman typedef struct bfd_arch_info
220818a5822eSThomas Veerman {
220918a5822eSThomas Veerman   int bits_per_word;
221018a5822eSThomas Veerman   int bits_per_address;
221118a5822eSThomas Veerman   int bits_per_byte;
221218a5822eSThomas Veerman   enum bfd_architecture arch;
221318a5822eSThomas Veerman   unsigned long mach;
221418a5822eSThomas Veerman   const char *arch_name;
221518a5822eSThomas Veerman   const char *printable_name;
221618a5822eSThomas Veerman   unsigned int section_align_power;
221718a5822eSThomas Veerman   /* TRUE if this is the default machine for the architecture.
221818a5822eSThomas Veerman      The default arch should be the first entry for an arch so that
221918a5822eSThomas Veerman      all the entries for that arch can be accessed via <<next>>.  */
222018a5822eSThomas Veerman   bfd_boolean the_default;
222118a5822eSThomas Veerman   const struct bfd_arch_info * (*compatible)
222218a5822eSThomas Veerman     (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
222318a5822eSThomas Veerman 
222418a5822eSThomas Veerman   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
222518a5822eSThomas Veerman 
2226c9ea9e7aSLionel Sambuc   /* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
2227c9ea9e7aSLionel Sambuc      IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
2228c9ea9e7aSLionel Sambuc      TRUE, the buffer contains code.  */
2229c9ea9e7aSLionel Sambuc   void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2230c9ea9e7aSLionel Sambuc                  bfd_boolean code);
2231c9ea9e7aSLionel Sambuc 
223218a5822eSThomas Veerman   const struct bfd_arch_info *next;
223318a5822eSThomas Veerman }
223418a5822eSThomas Veerman bfd_arch_info_type;
223518a5822eSThomas Veerman 
223618a5822eSThomas Veerman const char *bfd_printable_name (bfd *abfd);
223718a5822eSThomas Veerman 
223818a5822eSThomas Veerman const bfd_arch_info_type *bfd_scan_arch (const char *string);
223918a5822eSThomas Veerman 
224018a5822eSThomas Veerman const char **bfd_arch_list (void);
224118a5822eSThomas Veerman 
224218a5822eSThomas Veerman const bfd_arch_info_type *bfd_arch_get_compatible
224318a5822eSThomas Veerman    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
224418a5822eSThomas Veerman 
224518a5822eSThomas Veerman void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
224618a5822eSThomas Veerman 
224718a5822eSThomas Veerman enum bfd_architecture bfd_get_arch (bfd *abfd);
224818a5822eSThomas Veerman 
224918a5822eSThomas Veerman unsigned long bfd_get_mach (bfd *abfd);
225018a5822eSThomas Veerman 
225118a5822eSThomas Veerman unsigned int bfd_arch_bits_per_byte (bfd *abfd);
225218a5822eSThomas Veerman 
225318a5822eSThomas Veerman unsigned int bfd_arch_bits_per_address (bfd *abfd);
225418a5822eSThomas Veerman 
225518a5822eSThomas Veerman const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
225618a5822eSThomas Veerman 
225718a5822eSThomas Veerman const bfd_arch_info_type *bfd_lookup_arch
225818a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
225918a5822eSThomas Veerman 
226018a5822eSThomas Veerman const char *bfd_printable_arch_mach
226118a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
226218a5822eSThomas Veerman 
226318a5822eSThomas Veerman unsigned int bfd_octets_per_byte (bfd *abfd);
226418a5822eSThomas Veerman 
226518a5822eSThomas Veerman unsigned int bfd_arch_mach_octets_per_byte
226618a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
226718a5822eSThomas Veerman 
226818a5822eSThomas Veerman /* Extracted from reloc.c.  */
226918a5822eSThomas Veerman typedef enum bfd_reloc_status
227018a5822eSThomas Veerman {
227118a5822eSThomas Veerman   /* No errors detected.  */
227218a5822eSThomas Veerman   bfd_reloc_ok,
227318a5822eSThomas Veerman 
227418a5822eSThomas Veerman   /* The relocation was performed, but there was an overflow.  */
227518a5822eSThomas Veerman   bfd_reloc_overflow,
227618a5822eSThomas Veerman 
227718a5822eSThomas Veerman   /* The address to relocate was not within the section supplied.  */
227818a5822eSThomas Veerman   bfd_reloc_outofrange,
227918a5822eSThomas Veerman 
228018a5822eSThomas Veerman   /* Used by special functions.  */
228118a5822eSThomas Veerman   bfd_reloc_continue,
228218a5822eSThomas Veerman 
228318a5822eSThomas Veerman   /* Unsupported relocation size requested.  */
228418a5822eSThomas Veerman   bfd_reloc_notsupported,
228518a5822eSThomas Veerman 
228618a5822eSThomas Veerman   /* Unused.  */
228718a5822eSThomas Veerman   bfd_reloc_other,
228818a5822eSThomas Veerman 
228918a5822eSThomas Veerman   /* The symbol to relocate against was undefined.  */
229018a5822eSThomas Veerman   bfd_reloc_undefined,
229118a5822eSThomas Veerman 
229218a5822eSThomas Veerman   /* The relocation was performed, but may not be ok - presently
229318a5822eSThomas Veerman      generated only when linking i960 coff files with i960 b.out
229418a5822eSThomas Veerman      symbols.  If this type is returned, the error_message argument
229518a5822eSThomas Veerman      to bfd_perform_relocation will be set.  */
229618a5822eSThomas Veerman   bfd_reloc_dangerous
229718a5822eSThomas Veerman  }
229818a5822eSThomas Veerman  bfd_reloc_status_type;
229918a5822eSThomas Veerman 
230018a5822eSThomas Veerman 
230118a5822eSThomas Veerman typedef struct reloc_cache_entry
230218a5822eSThomas Veerman {
230318a5822eSThomas Veerman   /* A pointer into the canonical table of pointers.  */
230418a5822eSThomas Veerman   struct bfd_symbol **sym_ptr_ptr;
230518a5822eSThomas Veerman 
230618a5822eSThomas Veerman   /* offset in section.  */
230718a5822eSThomas Veerman   bfd_size_type address;
230818a5822eSThomas Veerman 
230918a5822eSThomas Veerman   /* addend for relocation value.  */
231018a5822eSThomas Veerman   bfd_vma addend;
231118a5822eSThomas Veerman 
231218a5822eSThomas Veerman   /* Pointer to how to perform the required relocation.  */
231318a5822eSThomas Veerman   reloc_howto_type *howto;
231418a5822eSThomas Veerman 
231518a5822eSThomas Veerman }
231618a5822eSThomas Veerman arelent;
231718a5822eSThomas Veerman 
231818a5822eSThomas Veerman enum complain_overflow
231918a5822eSThomas Veerman {
232018a5822eSThomas Veerman   /* Do not complain on overflow.  */
232118a5822eSThomas Veerman   complain_overflow_dont,
232218a5822eSThomas Veerman 
232318a5822eSThomas Veerman   /* Complain if the value overflows when considered as a signed
232418a5822eSThomas Veerman      number one bit larger than the field.  ie. A bitfield of N bits
232518a5822eSThomas Veerman      is allowed to represent -2**n to 2**n-1.  */
232618a5822eSThomas Veerman   complain_overflow_bitfield,
232718a5822eSThomas Veerman 
232818a5822eSThomas Veerman   /* Complain if the value overflows when considered as a signed
232918a5822eSThomas Veerman      number.  */
233018a5822eSThomas Veerman   complain_overflow_signed,
233118a5822eSThomas Veerman 
233218a5822eSThomas Veerman   /* Complain if the value overflows when considered as an
233318a5822eSThomas Veerman      unsigned number.  */
233418a5822eSThomas Veerman   complain_overflow_unsigned
233518a5822eSThomas Veerman };
233618a5822eSThomas Veerman 
233718a5822eSThomas Veerman struct reloc_howto_struct
233818a5822eSThomas Veerman {
233918a5822eSThomas Veerman   /*  The type field has mainly a documentary use - the back end can
234018a5822eSThomas Veerman       do what it wants with it, though normally the back end's
234118a5822eSThomas Veerman       external idea of what a reloc number is stored
234218a5822eSThomas Veerman       in this field.  For example, a PC relative word relocation
234318a5822eSThomas Veerman       in a coff environment has the type 023 - because that's
234418a5822eSThomas Veerman       what the outside world calls a R_PCRWORD reloc.  */
234518a5822eSThomas Veerman   unsigned int type;
234618a5822eSThomas Veerman 
234718a5822eSThomas Veerman   /*  The value the final relocation is shifted right by.  This drops
234818a5822eSThomas Veerman       unwanted data from the relocation.  */
234918a5822eSThomas Veerman   unsigned int rightshift;
235018a5822eSThomas Veerman 
235118a5822eSThomas Veerman   /*  The size of the item to be relocated.  This is *not* a
235218a5822eSThomas Veerman       power-of-two measure.  To get the number of bytes operated
235318a5822eSThomas Veerman       on by a type of relocation, use bfd_get_reloc_size.  */
235418a5822eSThomas Veerman   int size;
235518a5822eSThomas Veerman 
235618a5822eSThomas Veerman   /*  The number of bits in the item to be relocated.  This is used
235718a5822eSThomas Veerman       when doing overflow checking.  */
235818a5822eSThomas Veerman   unsigned int bitsize;
235918a5822eSThomas Veerman 
236018a5822eSThomas Veerman   /*  The relocation is relative to the field being relocated.  */
236118a5822eSThomas Veerman   bfd_boolean pc_relative;
236218a5822eSThomas Veerman 
236318a5822eSThomas Veerman   /*  The bit position of the reloc value in the destination.
236418a5822eSThomas Veerman       The relocated value is left shifted by this amount.  */
236518a5822eSThomas Veerman   unsigned int bitpos;
236618a5822eSThomas Veerman 
236718a5822eSThomas Veerman   /* What type of overflow error should be checked for when
236818a5822eSThomas Veerman      relocating.  */
236918a5822eSThomas Veerman   enum complain_overflow complain_on_overflow;
237018a5822eSThomas Veerman 
237118a5822eSThomas Veerman   /* If this field is non null, then the supplied function is
237218a5822eSThomas Veerman      called rather than the normal function.  This allows really
237318a5822eSThomas Veerman      strange relocation methods to be accommodated (e.g., i960 callj
237418a5822eSThomas Veerman      instructions).  */
237518a5822eSThomas Veerman   bfd_reloc_status_type (*special_function)
237618a5822eSThomas Veerman     (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
237718a5822eSThomas Veerman      bfd *, char **);
237818a5822eSThomas Veerman 
237918a5822eSThomas Veerman   /* The textual name of the relocation type.  */
238018a5822eSThomas Veerman   char *name;
238118a5822eSThomas Veerman 
238218a5822eSThomas Veerman   /* Some formats record a relocation addend in the section contents
238318a5822eSThomas Veerman      rather than with the relocation.  For ELF formats this is the
238418a5822eSThomas Veerman      distinction between USE_REL and USE_RELA (though the code checks
238518a5822eSThomas Veerman      for USE_REL == 1/0).  The value of this field is TRUE if the
238618a5822eSThomas Veerman      addend is recorded with the section contents; when performing a
238718a5822eSThomas Veerman      partial link (ld -r) the section contents (the data) will be
238818a5822eSThomas Veerman      modified.  The value of this field is FALSE if addends are
238918a5822eSThomas Veerman      recorded with the relocation (in arelent.addend); when performing
239018a5822eSThomas Veerman      a partial link the relocation will be modified.
239118a5822eSThomas Veerman      All relocations for all ELF USE_RELA targets should set this field
239218a5822eSThomas Veerman      to FALSE (values of TRUE should be looked on with suspicion).
239318a5822eSThomas Veerman      However, the converse is not true: not all relocations of all ELF
239418a5822eSThomas Veerman      USE_REL targets set this field to TRUE.  Why this is so is peculiar
239518a5822eSThomas Veerman      to each particular target.  For relocs that aren't used in partial
239618a5822eSThomas Veerman      links (e.g. GOT stuff) it doesn't matter what this is set to.  */
239718a5822eSThomas Veerman   bfd_boolean partial_inplace;
239818a5822eSThomas Veerman 
239918a5822eSThomas Veerman   /* src_mask selects the part of the instruction (or data) to be used
240018a5822eSThomas Veerman      in the relocation sum.  If the target relocations don't have an
240118a5822eSThomas Veerman      addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
240218a5822eSThomas Veerman      dst_mask to extract the addend from the section contents.  If
240318a5822eSThomas Veerman      relocations do have an addend in the reloc, eg. ELF USE_RELA, this
240418a5822eSThomas Veerman      field should be zero.  Non-zero values for ELF USE_RELA targets are
240518a5822eSThomas Veerman      bogus as in those cases the value in the dst_mask part of the
240618a5822eSThomas Veerman      section contents should be treated as garbage.  */
240718a5822eSThomas Veerman   bfd_vma src_mask;
240818a5822eSThomas Veerman 
240918a5822eSThomas Veerman   /* dst_mask selects which parts of the instruction (or data) are
241018a5822eSThomas Veerman      replaced with a relocated value.  */
241118a5822eSThomas Veerman   bfd_vma dst_mask;
241218a5822eSThomas Veerman 
241318a5822eSThomas Veerman   /* When some formats create PC relative instructions, they leave
241418a5822eSThomas Veerman      the value of the pc of the place being relocated in the offset
241518a5822eSThomas Veerman      slot of the instruction, so that a PC relative relocation can
241618a5822eSThomas Veerman      be made just by adding in an ordinary offset (e.g., sun3 a.out).
241718a5822eSThomas Veerman      Some formats leave the displacement part of an instruction
241818a5822eSThomas Veerman      empty (e.g., m88k bcs); this flag signals the fact.  */
241918a5822eSThomas Veerman   bfd_boolean pcrel_offset;
242018a5822eSThomas Veerman };
242118a5822eSThomas Veerman 
242218a5822eSThomas Veerman #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
242318a5822eSThomas Veerman   { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
242418a5822eSThomas Veerman #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
242518a5822eSThomas Veerman   HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
242618a5822eSThomas Veerman          NAME, FALSE, 0, 0, IN)
242718a5822eSThomas Veerman 
242818a5822eSThomas Veerman #define EMPTY_HOWTO(C) \
242918a5822eSThomas Veerman   HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
243018a5822eSThomas Veerman          NULL, FALSE, 0, 0, FALSE)
243118a5822eSThomas Veerman 
243218a5822eSThomas Veerman #define HOWTO_PREPARE(relocation, symbol)               \
243318a5822eSThomas Veerman   {                                                     \
243418a5822eSThomas Veerman     if (symbol != NULL)                                 \
243518a5822eSThomas Veerman       {                                                 \
243618a5822eSThomas Veerman         if (bfd_is_com_section (symbol->section))       \
243718a5822eSThomas Veerman           {                                             \
243818a5822eSThomas Veerman             relocation = 0;                             \
243918a5822eSThomas Veerman           }                                             \
244018a5822eSThomas Veerman         else                                            \
244118a5822eSThomas Veerman           {                                             \
244218a5822eSThomas Veerman             relocation = symbol->value;                 \
244318a5822eSThomas Veerman           }                                             \
244418a5822eSThomas Veerman       }                                                 \
244518a5822eSThomas Veerman   }
244618a5822eSThomas Veerman 
244718a5822eSThomas Veerman unsigned int bfd_get_reloc_size (reloc_howto_type *);
244818a5822eSThomas Veerman 
244918a5822eSThomas Veerman typedef struct relent_chain
245018a5822eSThomas Veerman {
245118a5822eSThomas Veerman   arelent relent;
245218a5822eSThomas Veerman   struct relent_chain *next;
245318a5822eSThomas Veerman }
245418a5822eSThomas Veerman arelent_chain;
245518a5822eSThomas Veerman 
245618a5822eSThomas Veerman bfd_reloc_status_type bfd_check_overflow
245718a5822eSThomas Veerman    (enum complain_overflow how,
245818a5822eSThomas Veerman     unsigned int bitsize,
245918a5822eSThomas Veerman     unsigned int rightshift,
246018a5822eSThomas Veerman     unsigned int addrsize,
246118a5822eSThomas Veerman     bfd_vma relocation);
246218a5822eSThomas Veerman 
246318a5822eSThomas Veerman bfd_reloc_status_type bfd_perform_relocation
246418a5822eSThomas Veerman    (bfd *abfd,
246518a5822eSThomas Veerman     arelent *reloc_entry,
246618a5822eSThomas Veerman     void *data,
246718a5822eSThomas Veerman     asection *input_section,
246818a5822eSThomas Veerman     bfd *output_bfd,
246918a5822eSThomas Veerman     char **error_message);
247018a5822eSThomas Veerman 
247118a5822eSThomas Veerman bfd_reloc_status_type bfd_install_relocation
247218a5822eSThomas Veerman    (bfd *abfd,
247318a5822eSThomas Veerman     arelent *reloc_entry,
247418a5822eSThomas Veerman     void *data, bfd_vma data_start,
247518a5822eSThomas Veerman     asection *input_section,
247618a5822eSThomas Veerman     char **error_message);
247718a5822eSThomas Veerman 
247818a5822eSThomas Veerman enum bfd_reloc_code_real {
247918a5822eSThomas Veerman   _dummy_first_bfd_reloc_code_real,
248018a5822eSThomas Veerman 
248118a5822eSThomas Veerman 
248218a5822eSThomas Veerman /* Basic absolute relocations of N bits.  */
248318a5822eSThomas Veerman   BFD_RELOC_64,
248418a5822eSThomas Veerman   BFD_RELOC_32,
248518a5822eSThomas Veerman   BFD_RELOC_26,
248618a5822eSThomas Veerman   BFD_RELOC_24,
248718a5822eSThomas Veerman   BFD_RELOC_16,
248818a5822eSThomas Veerman   BFD_RELOC_14,
248918a5822eSThomas Veerman   BFD_RELOC_8,
249018a5822eSThomas Veerman 
249118a5822eSThomas Veerman /* PC-relative relocations.  Sometimes these are relative to the address
249218a5822eSThomas Veerman of the relocation itself; sometimes they are relative to the start of
249318a5822eSThomas Veerman the section containing the relocation.  It depends on the specific target.
249418a5822eSThomas Veerman 
249518a5822eSThomas Veerman The 24-bit relocation is used in some Intel 960 configurations.  */
249618a5822eSThomas Veerman   BFD_RELOC_64_PCREL,
249718a5822eSThomas Veerman   BFD_RELOC_32_PCREL,
249818a5822eSThomas Veerman   BFD_RELOC_24_PCREL,
249918a5822eSThomas Veerman   BFD_RELOC_16_PCREL,
250018a5822eSThomas Veerman   BFD_RELOC_12_PCREL,
250118a5822eSThomas Veerman   BFD_RELOC_8_PCREL,
250218a5822eSThomas Veerman 
250318a5822eSThomas Veerman /* Section relative relocations.  Some targets need this for DWARF2.  */
250418a5822eSThomas Veerman   BFD_RELOC_32_SECREL,
250518a5822eSThomas Veerman 
250618a5822eSThomas Veerman /* For ELF.  */
250718a5822eSThomas Veerman   BFD_RELOC_32_GOT_PCREL,
250818a5822eSThomas Veerman   BFD_RELOC_16_GOT_PCREL,
250918a5822eSThomas Veerman   BFD_RELOC_8_GOT_PCREL,
251018a5822eSThomas Veerman   BFD_RELOC_32_GOTOFF,
251118a5822eSThomas Veerman   BFD_RELOC_16_GOTOFF,
251218a5822eSThomas Veerman   BFD_RELOC_LO16_GOTOFF,
251318a5822eSThomas Veerman   BFD_RELOC_HI16_GOTOFF,
251418a5822eSThomas Veerman   BFD_RELOC_HI16_S_GOTOFF,
251518a5822eSThomas Veerman   BFD_RELOC_8_GOTOFF,
251618a5822eSThomas Veerman   BFD_RELOC_64_PLT_PCREL,
251718a5822eSThomas Veerman   BFD_RELOC_32_PLT_PCREL,
251818a5822eSThomas Veerman   BFD_RELOC_24_PLT_PCREL,
251918a5822eSThomas Veerman   BFD_RELOC_16_PLT_PCREL,
252018a5822eSThomas Veerman   BFD_RELOC_8_PLT_PCREL,
252118a5822eSThomas Veerman   BFD_RELOC_64_PLTOFF,
252218a5822eSThomas Veerman   BFD_RELOC_32_PLTOFF,
252318a5822eSThomas Veerman   BFD_RELOC_16_PLTOFF,
252418a5822eSThomas Veerman   BFD_RELOC_LO16_PLTOFF,
252518a5822eSThomas Veerman   BFD_RELOC_HI16_PLTOFF,
252618a5822eSThomas Veerman   BFD_RELOC_HI16_S_PLTOFF,
252718a5822eSThomas Veerman   BFD_RELOC_8_PLTOFF,
252818a5822eSThomas Veerman 
252918a5822eSThomas Veerman /* Relocations used by 68K ELF.  */
253018a5822eSThomas Veerman   BFD_RELOC_68K_GLOB_DAT,
253118a5822eSThomas Veerman   BFD_RELOC_68K_JMP_SLOT,
253218a5822eSThomas Veerman   BFD_RELOC_68K_RELATIVE,
253318a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD32,
253418a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD16,
253518a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD8,
253618a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM32,
253718a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM16,
253818a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM8,
253918a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO32,
254018a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO16,
254118a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO8,
254218a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE32,
254318a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE16,
254418a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE8,
254518a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE32,
254618a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE16,
254718a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE8,
254818a5822eSThomas Veerman 
254918a5822eSThomas Veerman /* Linkage-table relative.  */
255018a5822eSThomas Veerman   BFD_RELOC_32_BASEREL,
255118a5822eSThomas Veerman   BFD_RELOC_16_BASEREL,
255218a5822eSThomas Veerman   BFD_RELOC_LO16_BASEREL,
255318a5822eSThomas Veerman   BFD_RELOC_HI16_BASEREL,
255418a5822eSThomas Veerman   BFD_RELOC_HI16_S_BASEREL,
255518a5822eSThomas Veerman   BFD_RELOC_8_BASEREL,
255618a5822eSThomas Veerman   BFD_RELOC_RVA,
255718a5822eSThomas Veerman 
255818a5822eSThomas Veerman /* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
255918a5822eSThomas Veerman   BFD_RELOC_8_FFnn,
256018a5822eSThomas Veerman 
256118a5822eSThomas Veerman /* These PC-relative relocations are stored as word displacements --
256218a5822eSThomas Veerman i.e., byte displacements shifted right two bits.  The 30-bit word
256318a5822eSThomas Veerman displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
256418a5822eSThomas Veerman SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
256518a5822eSThomas Veerman signed 16-bit displacement is used on the MIPS, and the 23-bit
256618a5822eSThomas Veerman displacement is used on the Alpha.  */
256718a5822eSThomas Veerman   BFD_RELOC_32_PCREL_S2,
256818a5822eSThomas Veerman   BFD_RELOC_16_PCREL_S2,
256918a5822eSThomas Veerman   BFD_RELOC_23_PCREL_S2,
257018a5822eSThomas Veerman 
257118a5822eSThomas Veerman /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
257218a5822eSThomas Veerman the target word.  These are used on the SPARC.  */
257318a5822eSThomas Veerman   BFD_RELOC_HI22,
257418a5822eSThomas Veerman   BFD_RELOC_LO10,
257518a5822eSThomas Veerman 
257618a5822eSThomas Veerman /* For systems that allocate a Global Pointer register, these are
257718a5822eSThomas Veerman displacements off that register.  These relocation types are
257818a5822eSThomas Veerman handled specially, because the value the register will have is
257918a5822eSThomas Veerman decided relatively late.  */
258018a5822eSThomas Veerman   BFD_RELOC_GPREL16,
258118a5822eSThomas Veerman   BFD_RELOC_GPREL32,
258218a5822eSThomas Veerman 
258318a5822eSThomas Veerman /* Reloc types used for i960/b.out.  */
258418a5822eSThomas Veerman   BFD_RELOC_I960_CALLJ,
258518a5822eSThomas Veerman 
258618a5822eSThomas Veerman /* SPARC ELF relocations.  There is probably some overlap with other
258718a5822eSThomas Veerman relocation types already defined.  */
258818a5822eSThomas Veerman   BFD_RELOC_NONE,
258918a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP22,
259018a5822eSThomas Veerman   BFD_RELOC_SPARC22,
259118a5822eSThomas Veerman   BFD_RELOC_SPARC13,
259218a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT10,
259318a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT13,
259418a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT22,
259518a5822eSThomas Veerman   BFD_RELOC_SPARC_PC10,
259618a5822eSThomas Veerman   BFD_RELOC_SPARC_PC22,
259718a5822eSThomas Veerman   BFD_RELOC_SPARC_WPLT30,
259818a5822eSThomas Veerman   BFD_RELOC_SPARC_COPY,
259918a5822eSThomas Veerman   BFD_RELOC_SPARC_GLOB_DAT,
260018a5822eSThomas Veerman   BFD_RELOC_SPARC_JMP_SLOT,
260118a5822eSThomas Veerman   BFD_RELOC_SPARC_RELATIVE,
260218a5822eSThomas Veerman   BFD_RELOC_SPARC_UA16,
260318a5822eSThomas Veerman   BFD_RELOC_SPARC_UA32,
260418a5822eSThomas Veerman   BFD_RELOC_SPARC_UA64,
260518a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_HIX22,
260618a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_LOX10,
260718a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
260818a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
260918a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP,
261018a5822eSThomas Veerman   BFD_RELOC_SPARC_JMP_IREL,
261118a5822eSThomas Veerman   BFD_RELOC_SPARC_IRELATIVE,
261218a5822eSThomas Veerman 
261318a5822eSThomas Veerman /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
261418a5822eSThomas Veerman   BFD_RELOC_SPARC_BASE13,
261518a5822eSThomas Veerman   BFD_RELOC_SPARC_BASE22,
261618a5822eSThomas Veerman 
261718a5822eSThomas Veerman /* SPARC64 relocations  */
261818a5822eSThomas Veerman #define BFD_RELOC_SPARC_64 BFD_RELOC_64
261918a5822eSThomas Veerman   BFD_RELOC_SPARC_10,
262018a5822eSThomas Veerman   BFD_RELOC_SPARC_11,
262118a5822eSThomas Veerman   BFD_RELOC_SPARC_OLO10,
262218a5822eSThomas Veerman   BFD_RELOC_SPARC_HH22,
262318a5822eSThomas Veerman   BFD_RELOC_SPARC_HM10,
262418a5822eSThomas Veerman   BFD_RELOC_SPARC_LM22,
262518a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_HH22,
262618a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_HM10,
262718a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_LM22,
262818a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP16,
262918a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP19,
263018a5822eSThomas Veerman   BFD_RELOC_SPARC_7,
263118a5822eSThomas Veerman   BFD_RELOC_SPARC_6,
263218a5822eSThomas Veerman   BFD_RELOC_SPARC_5,
263318a5822eSThomas Veerman #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
263418a5822eSThomas Veerman   BFD_RELOC_SPARC_PLT32,
263518a5822eSThomas Veerman   BFD_RELOC_SPARC_PLT64,
263618a5822eSThomas Veerman   BFD_RELOC_SPARC_HIX22,
263718a5822eSThomas Veerman   BFD_RELOC_SPARC_LOX10,
263818a5822eSThomas Veerman   BFD_RELOC_SPARC_H44,
263918a5822eSThomas Veerman   BFD_RELOC_SPARC_M44,
264018a5822eSThomas Veerman   BFD_RELOC_SPARC_L44,
264118a5822eSThomas Veerman   BFD_RELOC_SPARC_REGISTER,
2642c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_H34,
2643c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_SIZE32,
2644c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_SIZE64,
2645c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_WDISP10,
264618a5822eSThomas Veerman 
264718a5822eSThomas Veerman /* SPARC little endian relocation  */
264818a5822eSThomas Veerman   BFD_RELOC_SPARC_REV32,
264918a5822eSThomas Veerman 
265018a5822eSThomas Veerman /* SPARC TLS relocations  */
265118a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_HI22,
265218a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_LO10,
265318a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_ADD,
265418a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_CALL,
265518a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_HI22,
265618a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_LO10,
265718a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_ADD,
265818a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_CALL,
265918a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_HIX22,
266018a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_LOX10,
266118a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_ADD,
266218a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_HI22,
266318a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LO10,
266418a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LD,
266518a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LDX,
266618a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_ADD,
266718a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LE_HIX22,
266818a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LE_LOX10,
266918a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPMOD32,
267018a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPMOD64,
267118a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPOFF32,
267218a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPOFF64,
267318a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_TPOFF32,
267418a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_TPOFF64,
267518a5822eSThomas Veerman 
267618a5822eSThomas Veerman /* SPU Relocations.  */
267718a5822eSThomas Veerman   BFD_RELOC_SPU_IMM7,
267818a5822eSThomas Veerman   BFD_RELOC_SPU_IMM8,
267918a5822eSThomas Veerman   BFD_RELOC_SPU_IMM10,
268018a5822eSThomas Veerman   BFD_RELOC_SPU_IMM10W,
268118a5822eSThomas Veerman   BFD_RELOC_SPU_IMM16,
268218a5822eSThomas Veerman   BFD_RELOC_SPU_IMM16W,
268318a5822eSThomas Veerman   BFD_RELOC_SPU_IMM18,
268418a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL9a,
268518a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL9b,
268618a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL16,
268718a5822eSThomas Veerman   BFD_RELOC_SPU_LO16,
268818a5822eSThomas Veerman   BFD_RELOC_SPU_HI16,
268918a5822eSThomas Veerman   BFD_RELOC_SPU_PPU32,
269018a5822eSThomas Veerman   BFD_RELOC_SPU_PPU64,
269118a5822eSThomas Veerman   BFD_RELOC_SPU_ADD_PIC,
269218a5822eSThomas Veerman 
269318a5822eSThomas Veerman /* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
269418a5822eSThomas Veerman "addend" in some special way.
269518a5822eSThomas Veerman For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
269618a5822eSThomas Veerman writing; when reading, it will be the absolute section symbol.  The
269718a5822eSThomas Veerman addend is the displacement in bytes of the "lda" instruction from
269818a5822eSThomas Veerman the "ldah" instruction (which is at the address of this reloc).  */
269918a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP_HI16,
270018a5822eSThomas Veerman 
270118a5822eSThomas Veerman /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
270218a5822eSThomas Veerman with GPDISP_HI16 relocs.  The addend is ignored when writing the
270318a5822eSThomas Veerman relocations out, and is filled in with the file's GP value on
270418a5822eSThomas Veerman reading, for convenience.  */
270518a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP_LO16,
270618a5822eSThomas Veerman 
270718a5822eSThomas Veerman /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
270818a5822eSThomas Veerman relocation except that there is no accompanying GPDISP_LO16
270918a5822eSThomas Veerman relocation.  */
271018a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP,
271118a5822eSThomas Veerman 
271218a5822eSThomas Veerman /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
271318a5822eSThomas Veerman the assembler turns it into a LDQ instruction to load the address of
271418a5822eSThomas Veerman the symbol, and then fills in a register in the real instruction.
271518a5822eSThomas Veerman 
271618a5822eSThomas Veerman The LITERAL reloc, at the LDQ instruction, refers to the .lita
271718a5822eSThomas Veerman section symbol.  The addend is ignored when writing, but is filled
271818a5822eSThomas Veerman in with the file's GP value on reading, for convenience, as with the
271918a5822eSThomas Veerman GPDISP_LO16 reloc.
272018a5822eSThomas Veerman 
272118a5822eSThomas Veerman The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
272218a5822eSThomas Veerman It should refer to the symbol to be referenced, as with 16_GOTOFF,
272318a5822eSThomas Veerman but it generates output not based on the position within the .got
272418a5822eSThomas Veerman section, but relative to the GP value chosen for the file during the
272518a5822eSThomas Veerman final link stage.
272618a5822eSThomas Veerman 
272718a5822eSThomas Veerman The LITUSE reloc, on the instruction using the loaded address, gives
272818a5822eSThomas Veerman information to the linker that it might be able to use to optimize
272918a5822eSThomas Veerman away some literal section references.  The symbol is ignored (read
273018a5822eSThomas Veerman as the absolute section symbol), and the "addend" indicates the type
273118a5822eSThomas Veerman of instruction using the register:
273218a5822eSThomas Veerman 1 - "memory" fmt insn
273318a5822eSThomas Veerman 2 - byte-manipulation (byte offset reg)
273418a5822eSThomas Veerman 3 - jsr (target of branch)  */
273518a5822eSThomas Veerman   BFD_RELOC_ALPHA_LITERAL,
273618a5822eSThomas Veerman   BFD_RELOC_ALPHA_ELF_LITERAL,
273718a5822eSThomas Veerman   BFD_RELOC_ALPHA_LITUSE,
273818a5822eSThomas Veerman 
273918a5822eSThomas Veerman /* The HINT relocation indicates a value that should be filled into the
274018a5822eSThomas Veerman "hint" field of a jmp/jsr/ret instruction, for possible branch-
274118a5822eSThomas Veerman prediction logic which may be provided on some processors.  */
274218a5822eSThomas Veerman   BFD_RELOC_ALPHA_HINT,
274318a5822eSThomas Veerman 
274418a5822eSThomas Veerman /* The LINKAGE relocation outputs a linkage pair in the object file,
274518a5822eSThomas Veerman which is filled by the linker.  */
274618a5822eSThomas Veerman   BFD_RELOC_ALPHA_LINKAGE,
274718a5822eSThomas Veerman 
274818a5822eSThomas Veerman /* The CODEADDR relocation outputs a STO_CA in the object file,
274918a5822eSThomas Veerman which is filled by the linker.  */
275018a5822eSThomas Veerman   BFD_RELOC_ALPHA_CODEADDR,
275118a5822eSThomas Veerman 
275218a5822eSThomas Veerman /* The GPREL_HI/LO relocations together form a 32-bit offset from the
275318a5822eSThomas Veerman GP register.  */
275418a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPREL_HI16,
275518a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPREL_LO16,
275618a5822eSThomas Veerman 
275718a5822eSThomas Veerman /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
275818a5822eSThomas Veerman share a common GP, and the target address is adjusted for
275918a5822eSThomas Veerman STO_ALPHA_STD_GPLOAD.  */
276018a5822eSThomas Veerman   BFD_RELOC_ALPHA_BRSGP,
276118a5822eSThomas Veerman 
276218a5822eSThomas Veerman /* The NOP relocation outputs a NOP if the longword displacement
276318a5822eSThomas Veerman between two procedure entry points is < 2^21.  */
276418a5822eSThomas Veerman   BFD_RELOC_ALPHA_NOP,
276518a5822eSThomas Veerman 
276618a5822eSThomas Veerman /* The BSR relocation outputs a BSR if the longword displacement
276718a5822eSThomas Veerman between two procedure entry points is < 2^21.  */
276818a5822eSThomas Veerman   BFD_RELOC_ALPHA_BSR,
276918a5822eSThomas Veerman 
277018a5822eSThomas Veerman /* The LDA relocation outputs a LDA if the longword displacement
277118a5822eSThomas Veerman between two procedure entry points is < 2^16.  */
277218a5822eSThomas Veerman   BFD_RELOC_ALPHA_LDA,
277318a5822eSThomas Veerman 
277418a5822eSThomas Veerman /* The BOH relocation outputs a BSR if the longword displacement
277518a5822eSThomas Veerman between two procedure entry points is < 2^21, or else a hint.  */
277618a5822eSThomas Veerman   BFD_RELOC_ALPHA_BOH,
277718a5822eSThomas Veerman 
277818a5822eSThomas Veerman /* Alpha thread-local storage relocations.  */
277918a5822eSThomas Veerman   BFD_RELOC_ALPHA_TLSGD,
278018a5822eSThomas Veerman   BFD_RELOC_ALPHA_TLSLDM,
278118a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPMOD64,
278218a5822eSThomas Veerman   BFD_RELOC_ALPHA_GOTDTPREL16,
278318a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL64,
278418a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL_HI16,
278518a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL_LO16,
278618a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL16,
278718a5822eSThomas Veerman   BFD_RELOC_ALPHA_GOTTPREL16,
278818a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL64,
278918a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL_HI16,
279018a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL_LO16,
279118a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL16,
279218a5822eSThomas Veerman 
2793c9ea9e7aSLionel Sambuc /* The MIPS jump instruction.  */
279418a5822eSThomas Veerman   BFD_RELOC_MIPS_JMP,
2795c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_JMP,
279618a5822eSThomas Veerman 
279718a5822eSThomas Veerman /* The MIPS16 jump instruction.  */
279818a5822eSThomas Veerman   BFD_RELOC_MIPS16_JMP,
279918a5822eSThomas Veerman 
280018a5822eSThomas Veerman /* MIPS16 GP relative reloc.  */
280118a5822eSThomas Veerman   BFD_RELOC_MIPS16_GPREL,
280218a5822eSThomas Veerman 
280318a5822eSThomas Veerman /* High 16 bits of 32-bit value; simple reloc.  */
280418a5822eSThomas Veerman   BFD_RELOC_HI16,
280518a5822eSThomas Veerman 
280618a5822eSThomas Veerman /* High 16 bits of 32-bit value but the low 16 bits will be sign
280718a5822eSThomas Veerman extended and added to form the final result.  If the low 16
280818a5822eSThomas Veerman bits form a negative number, we need to add one to the high value
280918a5822eSThomas Veerman to compensate for the borrow when the low bits are added.  */
281018a5822eSThomas Veerman   BFD_RELOC_HI16_S,
281118a5822eSThomas Veerman 
281218a5822eSThomas Veerman /* Low 16 bits.  */
281318a5822eSThomas Veerman   BFD_RELOC_LO16,
281418a5822eSThomas Veerman 
281518a5822eSThomas Veerman /* High 16 bits of 32-bit pc-relative value  */
281618a5822eSThomas Veerman   BFD_RELOC_HI16_PCREL,
281718a5822eSThomas Veerman 
281818a5822eSThomas Veerman /* High 16 bits of 32-bit pc-relative value, adjusted  */
281918a5822eSThomas Veerman   BFD_RELOC_HI16_S_PCREL,
282018a5822eSThomas Veerman 
282118a5822eSThomas Veerman /* Low 16 bits of pc-relative value  */
282218a5822eSThomas Veerman   BFD_RELOC_LO16_PCREL,
282318a5822eSThomas Veerman 
282418a5822eSThomas Veerman /* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
282518a5822eSThomas Veerman 16-bit immediate fields  */
282618a5822eSThomas Veerman   BFD_RELOC_MIPS16_GOT16,
282718a5822eSThomas Veerman   BFD_RELOC_MIPS16_CALL16,
282818a5822eSThomas Veerman 
282918a5822eSThomas Veerman /* MIPS16 high 16 bits of 32-bit value.  */
283018a5822eSThomas Veerman   BFD_RELOC_MIPS16_HI16,
283118a5822eSThomas Veerman 
283218a5822eSThomas Veerman /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
283318a5822eSThomas Veerman extended and added to form the final result.  If the low 16
283418a5822eSThomas Veerman bits form a negative number, we need to add one to the high value
283518a5822eSThomas Veerman to compensate for the borrow when the low bits are added.  */
283618a5822eSThomas Veerman   BFD_RELOC_MIPS16_HI16_S,
283718a5822eSThomas Veerman 
283818a5822eSThomas Veerman /* MIPS16 low 16 bits.  */
283918a5822eSThomas Veerman   BFD_RELOC_MIPS16_LO16,
284018a5822eSThomas Veerman 
2841c9ea9e7aSLionel Sambuc /* MIPS16 TLS relocations  */
2842c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_GD,
2843c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_LDM,
2844c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
2845c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
2846c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_GOTTPREL,
2847c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_TPREL_HI16,
2848c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_TPREL_LO16,
2849c9ea9e7aSLionel Sambuc 
285018a5822eSThomas Veerman /* Relocation against a MIPS literal section.  */
285118a5822eSThomas Veerman   BFD_RELOC_MIPS_LITERAL,
2852c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_LITERAL,
2853c9ea9e7aSLionel Sambuc 
2854c9ea9e7aSLionel Sambuc /* microMIPS PC-relative relocations.  */
2855c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_7_PCREL_S1,
2856c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_10_PCREL_S1,
2857c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_16_PCREL_S1,
2858c9ea9e7aSLionel Sambuc 
2859c9ea9e7aSLionel Sambuc /* microMIPS versions of generic BFD relocs.  */
2860c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GPREL16,
2861c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HI16,
2862c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HI16_S,
2863c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_LO16,
286418a5822eSThomas Veerman 
286518a5822eSThomas Veerman /* MIPS ELF relocations.  */
286618a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT16,
2867c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT16,
286818a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL16,
2869c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL16,
287018a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_HI16,
2871c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_HI16,
287218a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_LO16,
2873c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_LO16,
287418a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL_HI16,
2875c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL_HI16,
287618a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL_LO16,
2877c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL_LO16,
287818a5822eSThomas Veerman   BFD_RELOC_MIPS_SUB,
2879c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_SUB,
288018a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_PAGE,
2881c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_PAGE,
288218a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_OFST,
2883c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_OFST,
288418a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_DISP,
2885c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_DISP,
288618a5822eSThomas Veerman   BFD_RELOC_MIPS_SHIFT5,
288718a5822eSThomas Veerman   BFD_RELOC_MIPS_SHIFT6,
288818a5822eSThomas Veerman   BFD_RELOC_MIPS_INSERT_A,
288918a5822eSThomas Veerman   BFD_RELOC_MIPS_INSERT_B,
289018a5822eSThomas Veerman   BFD_RELOC_MIPS_DELETE,
289118a5822eSThomas Veerman   BFD_RELOC_MIPS_HIGHEST,
2892c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HIGHEST,
289318a5822eSThomas Veerman   BFD_RELOC_MIPS_HIGHER,
2894c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HIGHER,
289518a5822eSThomas Veerman   BFD_RELOC_MIPS_SCN_DISP,
2896c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_SCN_DISP,
289718a5822eSThomas Veerman   BFD_RELOC_MIPS_REL16,
289818a5822eSThomas Veerman   BFD_RELOC_MIPS_RELGOT,
289918a5822eSThomas Veerman   BFD_RELOC_MIPS_JALR,
2900c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_JALR,
290118a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPMOD32,
290218a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL32,
290318a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPMOD64,
290418a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL64,
290518a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_GD,
2906c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_GD,
290718a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_LDM,
2908c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_LDM,
290918a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL_HI16,
2910c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
291118a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL_LO16,
2912c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
291318a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_GOTTPREL,
2914c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
291518a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL32,
291618a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL64,
291718a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL_HI16,
2918c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
291918a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL_LO16,
2920c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
292118a5822eSThomas Veerman 
292218a5822eSThomas Veerman 
292318a5822eSThomas Veerman /* MIPS ELF relocations (VxWorks and PLT extensions).  */
292418a5822eSThomas Veerman   BFD_RELOC_MIPS_COPY,
292518a5822eSThomas Veerman   BFD_RELOC_MIPS_JUMP_SLOT,
292618a5822eSThomas Veerman 
292718a5822eSThomas Veerman 
292818a5822eSThomas Veerman /* Moxie ELF relocations.  */
292918a5822eSThomas Veerman   BFD_RELOC_MOXIE_10_PCREL,
293018a5822eSThomas Veerman 
293118a5822eSThomas Veerman 
293218a5822eSThomas Veerman /* Fujitsu Frv Relocations.  */
293318a5822eSThomas Veerman   BFD_RELOC_FRV_LABEL16,
293418a5822eSThomas Veerman   BFD_RELOC_FRV_LABEL24,
293518a5822eSThomas Veerman   BFD_RELOC_FRV_LO16,
293618a5822eSThomas Veerman   BFD_RELOC_FRV_HI16,
293718a5822eSThomas Veerman   BFD_RELOC_FRV_GPREL12,
293818a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELU12,
293918a5822eSThomas Veerman   BFD_RELOC_FRV_GPREL32,
294018a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELHI,
294118a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELLO,
294218a5822eSThomas Veerman   BFD_RELOC_FRV_GOT12,
294318a5822eSThomas Veerman   BFD_RELOC_FRV_GOTHI,
294418a5822eSThomas Veerman   BFD_RELOC_FRV_GOTLO,
294518a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC,
294618a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOT12,
294718a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTHI,
294818a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTLO,
294918a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_VALUE,
295018a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
295118a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
295218a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
295318a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFF12,
295418a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFFHI,
295518a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFFLO,
295618a5822eSThomas Veerman   BFD_RELOC_FRV_GETTLSOFF,
295718a5822eSThomas Veerman   BFD_RELOC_FRV_TLSDESC_VALUE,
295818a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESC12,
295918a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESCHI,
296018a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESCLO,
296118a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFF12,
296218a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFFHI,
296318a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFFLO,
296418a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFF12,
296518a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFFHI,
296618a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFFLO,
296718a5822eSThomas Veerman   BFD_RELOC_FRV_TLSOFF,
296818a5822eSThomas Veerman   BFD_RELOC_FRV_TLSDESC_RELAX,
296918a5822eSThomas Veerman   BFD_RELOC_FRV_GETTLSOFF_RELAX,
297018a5822eSThomas Veerman   BFD_RELOC_FRV_TLSOFF_RELAX,
297118a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFF,
297218a5822eSThomas Veerman 
297318a5822eSThomas Veerman 
297418a5822eSThomas Veerman /* This is a 24bit GOT-relative reloc for the mn10300.  */
297518a5822eSThomas Veerman   BFD_RELOC_MN10300_GOTOFF24,
297618a5822eSThomas Veerman 
297718a5822eSThomas Veerman /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
297818a5822eSThomas Veerman in the instruction.  */
297918a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT32,
298018a5822eSThomas Veerman 
298118a5822eSThomas Veerman /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
298218a5822eSThomas Veerman in the instruction.  */
298318a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT24,
298418a5822eSThomas Veerman 
298518a5822eSThomas Veerman /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
298618a5822eSThomas Veerman in the instruction.  */
298718a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT16,
298818a5822eSThomas Veerman 
298918a5822eSThomas Veerman /* Copy symbol at runtime.  */
299018a5822eSThomas Veerman   BFD_RELOC_MN10300_COPY,
299118a5822eSThomas Veerman 
299218a5822eSThomas Veerman /* Create GOT entry.  */
299318a5822eSThomas Veerman   BFD_RELOC_MN10300_GLOB_DAT,
299418a5822eSThomas Veerman 
299518a5822eSThomas Veerman /* Create PLT entry.  */
299618a5822eSThomas Veerman   BFD_RELOC_MN10300_JMP_SLOT,
299718a5822eSThomas Veerman 
299818a5822eSThomas Veerman /* Adjust by program base.  */
299918a5822eSThomas Veerman   BFD_RELOC_MN10300_RELATIVE,
300018a5822eSThomas Veerman 
300118a5822eSThomas Veerman /* Together with another reloc targeted at the same location,
300218a5822eSThomas Veerman allows for a value that is the difference of two symbols
300318a5822eSThomas Veerman in the same section.  */
300418a5822eSThomas Veerman   BFD_RELOC_MN10300_SYM_DIFF,
300518a5822eSThomas Veerman 
300618a5822eSThomas Veerman /* The addend of this reloc is an alignment power that must
300718a5822eSThomas Veerman be honoured at the offset's location, regardless of linker
300818a5822eSThomas Veerman relaxation.  */
300918a5822eSThomas Veerman   BFD_RELOC_MN10300_ALIGN,
301018a5822eSThomas Veerman 
3011c9ea9e7aSLionel Sambuc /* Various TLS-related relocations.  */
3012c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_GD,
3013c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LD,
3014c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LDO,
3015c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_GOTIE,
3016c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_IE,
3017c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LE,
3018c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_DTPMOD,
3019c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_DTPOFF,
3020c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_TPOFF,
3021c9ea9e7aSLionel Sambuc 
3022c9ea9e7aSLionel Sambuc /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3023c9ea9e7aSLionel Sambuc instruction.  */
3024c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_32_PCREL,
3025c9ea9e7aSLionel Sambuc 
3026c9ea9e7aSLionel Sambuc /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3027c9ea9e7aSLionel Sambuc instruction.  */
3028c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_16_PCREL,
3029c9ea9e7aSLionel Sambuc 
303018a5822eSThomas Veerman 
303118a5822eSThomas Veerman /* i386/elf relocations  */
303218a5822eSThomas Veerman   BFD_RELOC_386_GOT32,
303318a5822eSThomas Veerman   BFD_RELOC_386_PLT32,
303418a5822eSThomas Veerman   BFD_RELOC_386_COPY,
303518a5822eSThomas Veerman   BFD_RELOC_386_GLOB_DAT,
303618a5822eSThomas Veerman   BFD_RELOC_386_JUMP_SLOT,
303718a5822eSThomas Veerman   BFD_RELOC_386_RELATIVE,
303818a5822eSThomas Veerman   BFD_RELOC_386_GOTOFF,
303918a5822eSThomas Veerman   BFD_RELOC_386_GOTPC,
304018a5822eSThomas Veerman   BFD_RELOC_386_TLS_TPOFF,
304118a5822eSThomas Veerman   BFD_RELOC_386_TLS_IE,
304218a5822eSThomas Veerman   BFD_RELOC_386_TLS_GOTIE,
304318a5822eSThomas Veerman   BFD_RELOC_386_TLS_LE,
304418a5822eSThomas Veerman   BFD_RELOC_386_TLS_GD,
304518a5822eSThomas Veerman   BFD_RELOC_386_TLS_LDM,
304618a5822eSThomas Veerman   BFD_RELOC_386_TLS_LDO_32,
304718a5822eSThomas Veerman   BFD_RELOC_386_TLS_IE_32,
304818a5822eSThomas Veerman   BFD_RELOC_386_TLS_LE_32,
304918a5822eSThomas Veerman   BFD_RELOC_386_TLS_DTPMOD32,
305018a5822eSThomas Veerman   BFD_RELOC_386_TLS_DTPOFF32,
305118a5822eSThomas Veerman   BFD_RELOC_386_TLS_TPOFF32,
305218a5822eSThomas Veerman   BFD_RELOC_386_TLS_GOTDESC,
305318a5822eSThomas Veerman   BFD_RELOC_386_TLS_DESC_CALL,
305418a5822eSThomas Veerman   BFD_RELOC_386_TLS_DESC,
305518a5822eSThomas Veerman   BFD_RELOC_386_IRELATIVE,
305618a5822eSThomas Veerman 
305718a5822eSThomas Veerman /* x86-64/elf relocations  */
305818a5822eSThomas Veerman   BFD_RELOC_X86_64_GOT32,
305918a5822eSThomas Veerman   BFD_RELOC_X86_64_PLT32,
306018a5822eSThomas Veerman   BFD_RELOC_X86_64_COPY,
306118a5822eSThomas Veerman   BFD_RELOC_X86_64_GLOB_DAT,
306218a5822eSThomas Veerman   BFD_RELOC_X86_64_JUMP_SLOT,
306318a5822eSThomas Veerman   BFD_RELOC_X86_64_RELATIVE,
306418a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPCREL,
306518a5822eSThomas Veerman   BFD_RELOC_X86_64_32S,
306618a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPMOD64,
306718a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPOFF64,
306818a5822eSThomas Veerman   BFD_RELOC_X86_64_TPOFF64,
306918a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSGD,
307018a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSLD,
307118a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPOFF32,
307218a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTTPOFF,
307318a5822eSThomas Veerman   BFD_RELOC_X86_64_TPOFF32,
307418a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTOFF64,
307518a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC32,
307618a5822eSThomas Veerman   BFD_RELOC_X86_64_GOT64,
307718a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPCREL64,
307818a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC64,
307918a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPLT64,
308018a5822eSThomas Veerman   BFD_RELOC_X86_64_PLTOFF64,
308118a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
308218a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSDESC_CALL,
308318a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSDESC,
308418a5822eSThomas Veerman   BFD_RELOC_X86_64_IRELATIVE,
308518a5822eSThomas Veerman 
308618a5822eSThomas Veerman /* ns32k relocations  */
308718a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_8,
308818a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_16,
308918a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_32,
309018a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_8_PCREL,
309118a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_16_PCREL,
309218a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_32_PCREL,
309318a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_8,
309418a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_16,
309518a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_32,
309618a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_8_PCREL,
309718a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_16_PCREL,
309818a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_32_PCREL,
309918a5822eSThomas Veerman 
310018a5822eSThomas Veerman /* PDP11 relocations  */
310118a5822eSThomas Veerman   BFD_RELOC_PDP11_DISP_8_PCREL,
310218a5822eSThomas Veerman   BFD_RELOC_PDP11_DISP_6_PCREL,
310318a5822eSThomas Veerman 
310418a5822eSThomas Veerman /* Picojava relocs.  Not all of these appear in object files.  */
310518a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_HI16,
310618a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_LO16,
310718a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_DIR16,
310818a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_DIR32,
310918a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_REL16,
311018a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_REL32,
311118a5822eSThomas Veerman 
311218a5822eSThomas Veerman /* Power(rs6000) and PowerPC relocations.  */
311318a5822eSThomas Veerman   BFD_RELOC_PPC_B26,
311418a5822eSThomas Veerman   BFD_RELOC_PPC_BA26,
311518a5822eSThomas Veerman   BFD_RELOC_PPC_TOC16,
311618a5822eSThomas Veerman   BFD_RELOC_PPC_B16,
311718a5822eSThomas Veerman   BFD_RELOC_PPC_B16_BRTAKEN,
311818a5822eSThomas Veerman   BFD_RELOC_PPC_B16_BRNTAKEN,
311918a5822eSThomas Veerman   BFD_RELOC_PPC_BA16,
312018a5822eSThomas Veerman   BFD_RELOC_PPC_BA16_BRTAKEN,
312118a5822eSThomas Veerman   BFD_RELOC_PPC_BA16_BRNTAKEN,
312218a5822eSThomas Veerman   BFD_RELOC_PPC_COPY,
312318a5822eSThomas Veerman   BFD_RELOC_PPC_GLOB_DAT,
312418a5822eSThomas Veerman   BFD_RELOC_PPC_JMP_SLOT,
312518a5822eSThomas Veerman   BFD_RELOC_PPC_RELATIVE,
312618a5822eSThomas Veerman   BFD_RELOC_PPC_LOCAL24PC,
312718a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR32,
312818a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16,
312918a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_LO,
313018a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_HI,
313118a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_HA,
313218a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDAI16,
313318a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA2I16,
313418a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA2REL,
313518a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA21,
313618a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_MRKREF,
313718a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELSEC16,
313818a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_LO,
313918a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_HI,
314018a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_HA,
314118a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_BIT_FLD,
314218a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELSDA,
3143c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL8,
3144c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL15,
3145c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL24,
3146c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_LO16A,
3147c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_LO16D,
3148c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HI16A,
3149c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HI16D,
3150c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HA16A,
3151c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HA16D,
3152c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDA21,
3153c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDA21_LO,
3154c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3155c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3156c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3157c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3158c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3159c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HA16D,
316018a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHER,
316118a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHER_S,
316218a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHEST,
316318a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHEST_S,
316418a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_LO,
316518a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_HI,
316618a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_HA,
316718a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC,
316818a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16,
316918a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_LO,
317018a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_HI,
317118a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_HA,
317218a5822eSThomas Veerman   BFD_RELOC_PPC64_ADDR16_DS,
317318a5822eSThomas Veerman   BFD_RELOC_PPC64_ADDR16_LO_DS,
317418a5822eSThomas Veerman   BFD_RELOC_PPC64_GOT16_DS,
317518a5822eSThomas Veerman   BFD_RELOC_PPC64_GOT16_LO_DS,
317618a5822eSThomas Veerman   BFD_RELOC_PPC64_PLT16_LO_DS,
317718a5822eSThomas Veerman   BFD_RELOC_PPC64_SECTOFF_DS,
317818a5822eSThomas Veerman   BFD_RELOC_PPC64_SECTOFF_LO_DS,
317918a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_DS,
318018a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_LO_DS,
318118a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_DS,
318218a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_LO_DS,
318318a5822eSThomas Veerman 
318418a5822eSThomas Veerman /* PowerPC and PowerPC64 thread-local storage relocations.  */
318518a5822eSThomas Veerman   BFD_RELOC_PPC_TLS,
318618a5822eSThomas Veerman   BFD_RELOC_PPC_TLSGD,
318718a5822eSThomas Veerman   BFD_RELOC_PPC_TLSLD,
318818a5822eSThomas Veerman   BFD_RELOC_PPC_DTPMOD,
318918a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16,
319018a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_LO,
319118a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_HI,
319218a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_HA,
319318a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL,
319418a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16,
319518a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_LO,
319618a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_HI,
319718a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_HA,
319818a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL,
319918a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16,
320018a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_LO,
320118a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_HI,
320218a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_HA,
320318a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16,
320418a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_LO,
320518a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_HI,
320618a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_HA,
320718a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16,
320818a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_LO,
320918a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_HI,
321018a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_HA,
321118a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16,
321218a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_LO,
321318a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_HI,
321418a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_HA,
321518a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_DS,
321618a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_LO_DS,
321718a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHER,
321818a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHERA,
321918a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHEST,
322018a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHESTA,
322118a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_DS,
322218a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_LO_DS,
322318a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHER,
322418a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHERA,
322518a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHEST,
322618a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
322718a5822eSThomas Veerman 
322818a5822eSThomas Veerman /* IBM 370/390 relocations  */
322918a5822eSThomas Veerman   BFD_RELOC_I370_D12,
323018a5822eSThomas Veerman 
323118a5822eSThomas Veerman /* The type of reloc used to build a constructor table - at the moment
323218a5822eSThomas Veerman probably a 32 bit wide absolute relocation, but the target can choose.
323318a5822eSThomas Veerman It generally does map to one of the other relocation types.  */
323418a5822eSThomas Veerman   BFD_RELOC_CTOR,
323518a5822eSThomas Veerman 
323618a5822eSThomas Veerman /* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
323718a5822eSThomas Veerman not stored in the instruction.  */
323818a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_BRANCH,
323918a5822eSThomas Veerman 
324018a5822eSThomas Veerman /* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
324118a5822eSThomas Veerman not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
324218a5822eSThomas Veerman field in the instruction.  */
324318a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_BLX,
324418a5822eSThomas Veerman 
324518a5822eSThomas Veerman /* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
324618a5822eSThomas Veerman not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
324718a5822eSThomas Veerman field in the instruction.  */
324818a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BLX,
324918a5822eSThomas Veerman 
325018a5822eSThomas Veerman /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
325118a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_CALL,
325218a5822eSThomas Veerman 
325318a5822eSThomas Veerman /* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
325418a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_JUMP,
325518a5822eSThomas Veerman 
325618a5822eSThomas Veerman /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
325718a5822eSThomas Veerman The lowest bit must be zero and is not stored in the instruction.
325818a5822eSThomas Veerman Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
325918a5822eSThomas Veerman "nn" one smaller in all cases.  Note further that BRANCH23
326018a5822eSThomas Veerman corresponds to R_ARM_THM_CALL.  */
326118a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH7,
326218a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH9,
326318a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH12,
326418a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH20,
326518a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH23,
326618a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH25,
326718a5822eSThomas Veerman 
326818a5822eSThomas Veerman /* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
326918a5822eSThomas Veerman   BFD_RELOC_ARM_OFFSET_IMM,
327018a5822eSThomas Veerman 
327118a5822eSThomas Veerman /* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
327218a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_OFFSET,
327318a5822eSThomas Veerman 
327418a5822eSThomas Veerman /* Pc-relative or absolute relocation depending on target.  Used for
327518a5822eSThomas Veerman entries in .init_array sections.  */
327618a5822eSThomas Veerman   BFD_RELOC_ARM_TARGET1,
327718a5822eSThomas Veerman 
327818a5822eSThomas Veerman /* Read-only segment base relative address.  */
327918a5822eSThomas Veerman   BFD_RELOC_ARM_ROSEGREL32,
328018a5822eSThomas Veerman 
328118a5822eSThomas Veerman /* Data segment base relative address.  */
328218a5822eSThomas Veerman   BFD_RELOC_ARM_SBREL32,
328318a5822eSThomas Veerman 
328418a5822eSThomas Veerman /* This reloc is used for references to RTTI data from exception handling
328518a5822eSThomas Veerman tables.  The actual definition depends on the target.  It may be a
328618a5822eSThomas Veerman pc-relative or some form of GOT-indirect relocation.  */
328718a5822eSThomas Veerman   BFD_RELOC_ARM_TARGET2,
328818a5822eSThomas Veerman 
328918a5822eSThomas Veerman /* 31-bit PC relative address.  */
329018a5822eSThomas Veerman   BFD_RELOC_ARM_PREL31,
329118a5822eSThomas Veerman 
329218a5822eSThomas Veerman /* Low and High halfword relocations for MOVW and MOVT instructions.  */
329318a5822eSThomas Veerman   BFD_RELOC_ARM_MOVW,
329418a5822eSThomas Veerman   BFD_RELOC_ARM_MOVT,
329518a5822eSThomas Veerman   BFD_RELOC_ARM_MOVW_PCREL,
329618a5822eSThomas Veerman   BFD_RELOC_ARM_MOVT_PCREL,
329718a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVW,
329818a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVT,
329918a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVW_PCREL,
330018a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVT_PCREL,
330118a5822eSThomas Veerman 
330218a5822eSThomas Veerman /* Relocations for setting up GOTs and PLTs for shared libraries.  */
330318a5822eSThomas Veerman   BFD_RELOC_ARM_JUMP_SLOT,
330418a5822eSThomas Veerman   BFD_RELOC_ARM_GLOB_DAT,
330518a5822eSThomas Veerman   BFD_RELOC_ARM_GOT32,
330618a5822eSThomas Veerman   BFD_RELOC_ARM_PLT32,
330718a5822eSThomas Veerman   BFD_RELOC_ARM_RELATIVE,
330818a5822eSThomas Veerman   BFD_RELOC_ARM_GOTOFF,
330918a5822eSThomas Veerman   BFD_RELOC_ARM_GOTPC,
331018a5822eSThomas Veerman   BFD_RELOC_ARM_GOT_PREL,
331118a5822eSThomas Veerman 
331218a5822eSThomas Veerman /* ARM thread-local storage relocations.  */
331318a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_GD32,
331418a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LDO32,
331518a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LDM32,
331618a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_DTPOFF32,
331718a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_DTPMOD32,
331818a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_TPOFF32,
331918a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_IE32,
332018a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LE32,
3321c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_GOTDESC,
3322c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_CALL,
3323c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_THM_TLS_CALL,
3324c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_DESCSEQ,
3325c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3326c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_DESC,
332718a5822eSThomas Veerman 
332818a5822eSThomas Veerman /* ARM group relocations.  */
332918a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G0_NC,
333018a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G0,
333118a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G1_NC,
333218a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G1,
333318a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G2,
333418a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G0,
333518a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G1,
333618a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G2,
333718a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G0,
333818a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G1,
333918a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G2,
334018a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G0,
334118a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G1,
334218a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G2,
334318a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G0_NC,
334418a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G0,
334518a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G1_NC,
334618a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G1,
334718a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G2,
334818a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G0,
334918a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G1,
335018a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G2,
335118a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G0,
335218a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G1,
335318a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G2,
335418a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G0,
335518a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G1,
335618a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G2,
335718a5822eSThomas Veerman 
335818a5822eSThomas Veerman /* Annotation of BX instructions.  */
335918a5822eSThomas Veerman   BFD_RELOC_ARM_V4BX,
336018a5822eSThomas Veerman 
3361c9ea9e7aSLionel Sambuc /* ARM support for STT_GNU_IFUNC.  */
3362c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_IRELATIVE,
3363c9ea9e7aSLionel Sambuc 
336418a5822eSThomas Veerman /* These relocs are only used within the ARM assembler.  They are not
336518a5822eSThomas Veerman (at present) written to any object files.  */
336618a5822eSThomas Veerman   BFD_RELOC_ARM_IMMEDIATE,
336718a5822eSThomas Veerman   BFD_RELOC_ARM_ADRL_IMMEDIATE,
336818a5822eSThomas Veerman   BFD_RELOC_ARM_T32_IMMEDIATE,
336918a5822eSThomas Veerman   BFD_RELOC_ARM_T32_ADD_IMM,
337018a5822eSThomas Veerman   BFD_RELOC_ARM_T32_IMM12,
337118a5822eSThomas Veerman   BFD_RELOC_ARM_T32_ADD_PC12,
337218a5822eSThomas Veerman   BFD_RELOC_ARM_SHIFT_IMM,
337318a5822eSThomas Veerman   BFD_RELOC_ARM_SMC,
337418a5822eSThomas Veerman   BFD_RELOC_ARM_HVC,
337518a5822eSThomas Veerman   BFD_RELOC_ARM_SWI,
337618a5822eSThomas Veerman   BFD_RELOC_ARM_MULTI,
337718a5822eSThomas Veerman   BFD_RELOC_ARM_CP_OFF_IMM,
337818a5822eSThomas Veerman   BFD_RELOC_ARM_CP_OFF_IMM_S2,
337918a5822eSThomas Veerman   BFD_RELOC_ARM_T32_CP_OFF_IMM,
338018a5822eSThomas Veerman   BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
338118a5822eSThomas Veerman   BFD_RELOC_ARM_ADR_IMM,
338218a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_IMM,
338318a5822eSThomas Veerman   BFD_RELOC_ARM_LITERAL,
338418a5822eSThomas Veerman   BFD_RELOC_ARM_IN_POOL,
338518a5822eSThomas Veerman   BFD_RELOC_ARM_OFFSET_IMM8,
338618a5822eSThomas Veerman   BFD_RELOC_ARM_T32_OFFSET_U8,
338718a5822eSThomas Veerman   BFD_RELOC_ARM_T32_OFFSET_IMM,
338818a5822eSThomas Veerman   BFD_RELOC_ARM_HWLITERAL,
338918a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_ADD,
339018a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_IMM,
339118a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_SHIFT,
339218a5822eSThomas Veerman 
339318a5822eSThomas Veerman /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
339418a5822eSThomas Veerman   BFD_RELOC_SH_PCDISP8BY2,
339518a5822eSThomas Veerman   BFD_RELOC_SH_PCDISP12BY2,
339618a5822eSThomas Veerman   BFD_RELOC_SH_IMM3,
339718a5822eSThomas Veerman   BFD_RELOC_SH_IMM3U,
339818a5822eSThomas Veerman   BFD_RELOC_SH_DISP12,
339918a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY2,
340018a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY4,
340118a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY8,
340218a5822eSThomas Veerman   BFD_RELOC_SH_DISP20,
340318a5822eSThomas Veerman   BFD_RELOC_SH_DISP20BY8,
340418a5822eSThomas Veerman   BFD_RELOC_SH_IMM4,
340518a5822eSThomas Veerman   BFD_RELOC_SH_IMM4BY2,
340618a5822eSThomas Veerman   BFD_RELOC_SH_IMM4BY4,
340718a5822eSThomas Veerman   BFD_RELOC_SH_IMM8,
340818a5822eSThomas Veerman   BFD_RELOC_SH_IMM8BY2,
340918a5822eSThomas Veerman   BFD_RELOC_SH_IMM8BY4,
341018a5822eSThomas Veerman   BFD_RELOC_SH_PCRELIMM8BY2,
341118a5822eSThomas Veerman   BFD_RELOC_SH_PCRELIMM8BY4,
341218a5822eSThomas Veerman   BFD_RELOC_SH_SWITCH16,
341318a5822eSThomas Veerman   BFD_RELOC_SH_SWITCH32,
341418a5822eSThomas Veerman   BFD_RELOC_SH_USES,
341518a5822eSThomas Veerman   BFD_RELOC_SH_COUNT,
341618a5822eSThomas Veerman   BFD_RELOC_SH_ALIGN,
341718a5822eSThomas Veerman   BFD_RELOC_SH_CODE,
341818a5822eSThomas Veerman   BFD_RELOC_SH_DATA,
341918a5822eSThomas Veerman   BFD_RELOC_SH_LABEL,
342018a5822eSThomas Veerman   BFD_RELOC_SH_LOOP_START,
342118a5822eSThomas Veerman   BFD_RELOC_SH_LOOP_END,
342218a5822eSThomas Veerman   BFD_RELOC_SH_COPY,
342318a5822eSThomas Veerman   BFD_RELOC_SH_GLOB_DAT,
342418a5822eSThomas Veerman   BFD_RELOC_SH_JMP_SLOT,
342518a5822eSThomas Veerman   BFD_RELOC_SH_RELATIVE,
342618a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC,
342718a5822eSThomas Veerman   BFD_RELOC_SH_GOT_LOW16,
342818a5822eSThomas Veerman   BFD_RELOC_SH_GOT_MEDLOW16,
342918a5822eSThomas Veerman   BFD_RELOC_SH_GOT_MEDHI16,
343018a5822eSThomas Veerman   BFD_RELOC_SH_GOT_HI16,
343118a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_LOW16,
343218a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_MEDLOW16,
343318a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_MEDHI16,
343418a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_HI16,
343518a5822eSThomas Veerman   BFD_RELOC_SH_PLT_LOW16,
343618a5822eSThomas Veerman   BFD_RELOC_SH_PLT_MEDLOW16,
343718a5822eSThomas Veerman   BFD_RELOC_SH_PLT_MEDHI16,
343818a5822eSThomas Veerman   BFD_RELOC_SH_PLT_HI16,
343918a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_LOW16,
344018a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_MEDLOW16,
344118a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_MEDHI16,
344218a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_HI16,
344318a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_LOW16,
344418a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_MEDLOW16,
344518a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_MEDHI16,
344618a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_HI16,
344718a5822eSThomas Veerman   BFD_RELOC_SH_COPY64,
344818a5822eSThomas Veerman   BFD_RELOC_SH_GLOB_DAT64,
344918a5822eSThomas Veerman   BFD_RELOC_SH_JMP_SLOT64,
345018a5822eSThomas Veerman   BFD_RELOC_SH_RELATIVE64,
345118a5822eSThomas Veerman   BFD_RELOC_SH_GOT10BY4,
345218a5822eSThomas Veerman   BFD_RELOC_SH_GOT10BY8,
345318a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT10BY4,
345418a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT10BY8,
345518a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT32,
345618a5822eSThomas Veerman   BFD_RELOC_SH_SHMEDIA_CODE,
345718a5822eSThomas Veerman   BFD_RELOC_SH_IMMU5,
345818a5822eSThomas Veerman   BFD_RELOC_SH_IMMS6,
345918a5822eSThomas Veerman   BFD_RELOC_SH_IMMS6BY32,
346018a5822eSThomas Veerman   BFD_RELOC_SH_IMMU6,
346118a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10,
346218a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY2,
346318a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY4,
346418a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY8,
346518a5822eSThomas Veerman   BFD_RELOC_SH_IMMS16,
346618a5822eSThomas Veerman   BFD_RELOC_SH_IMMU16,
346718a5822eSThomas Veerman   BFD_RELOC_SH_IMM_LOW16,
346818a5822eSThomas Veerman   BFD_RELOC_SH_IMM_LOW16_PCREL,
346918a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDLOW16,
347018a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
347118a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDHI16,
347218a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDHI16_PCREL,
347318a5822eSThomas Veerman   BFD_RELOC_SH_IMM_HI16,
347418a5822eSThomas Veerman   BFD_RELOC_SH_IMM_HI16_PCREL,
347518a5822eSThomas Veerman   BFD_RELOC_SH_PT_16,
347618a5822eSThomas Veerman   BFD_RELOC_SH_TLS_GD_32,
347718a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LD_32,
347818a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LDO_32,
347918a5822eSThomas Veerman   BFD_RELOC_SH_TLS_IE_32,
348018a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LE_32,
348118a5822eSThomas Veerman   BFD_RELOC_SH_TLS_DTPMOD32,
348218a5822eSThomas Veerman   BFD_RELOC_SH_TLS_DTPOFF32,
348318a5822eSThomas Veerman   BFD_RELOC_SH_TLS_TPOFF32,
348418a5822eSThomas Veerman   BFD_RELOC_SH_GOT20,
348518a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF20,
348618a5822eSThomas Veerman   BFD_RELOC_SH_GOTFUNCDESC,
348718a5822eSThomas Veerman   BFD_RELOC_SH_GOTFUNCDESC20,
348818a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFFFUNCDESC,
348918a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFFFUNCDESC20,
349018a5822eSThomas Veerman   BFD_RELOC_SH_FUNCDESC,
349118a5822eSThomas Veerman 
349218a5822eSThomas Veerman /* ARC Cores relocs.
349318a5822eSThomas Veerman ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
349418a5822eSThomas Veerman not stored in the instruction.  The high 20 bits are installed in bits 26
349518a5822eSThomas Veerman through 7 of the instruction.  */
349618a5822eSThomas Veerman   BFD_RELOC_ARC_B22_PCREL,
349718a5822eSThomas Veerman 
349818a5822eSThomas Veerman /* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
349918a5822eSThomas Veerman stored in the instruction.  The high 24 bits are installed in bits 23
350018a5822eSThomas Veerman through 0.  */
350118a5822eSThomas Veerman   BFD_RELOC_ARC_B26,
350218a5822eSThomas Veerman 
350318a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc.  */
350418a5822eSThomas Veerman   BFD_RELOC_BFIN_16_IMM,
350518a5822eSThomas Veerman 
350618a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
350718a5822eSThomas Veerman   BFD_RELOC_BFIN_16_HIGH,
350818a5822eSThomas Veerman 
350918a5822eSThomas Veerman /* ADI Blackfin 'a' part of LSETUP.  */
351018a5822eSThomas Veerman   BFD_RELOC_BFIN_4_PCREL,
351118a5822eSThomas Veerman 
351218a5822eSThomas Veerman /* ADI Blackfin.  */
351318a5822eSThomas Veerman   BFD_RELOC_BFIN_5_PCREL,
351418a5822eSThomas Veerman 
351518a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
351618a5822eSThomas Veerman   BFD_RELOC_BFIN_16_LOW,
351718a5822eSThomas Veerman 
351818a5822eSThomas Veerman /* ADI Blackfin.  */
351918a5822eSThomas Veerman   BFD_RELOC_BFIN_10_PCREL,
352018a5822eSThomas Veerman 
352118a5822eSThomas Veerman /* ADI Blackfin 'b' part of LSETUP.  */
352218a5822eSThomas Veerman   BFD_RELOC_BFIN_11_PCREL,
352318a5822eSThomas Veerman 
352418a5822eSThomas Veerman /* ADI Blackfin.  */
352518a5822eSThomas Veerman   BFD_RELOC_BFIN_12_PCREL_JUMP,
352618a5822eSThomas Veerman 
352718a5822eSThomas Veerman /* ADI Blackfin Short jump, pcrel.  */
352818a5822eSThomas Veerman   BFD_RELOC_BFIN_12_PCREL_JUMP_S,
352918a5822eSThomas Veerman 
353018a5822eSThomas Veerman /* ADI Blackfin Call.x not implemented.  */
353118a5822eSThomas Veerman   BFD_RELOC_BFIN_24_PCREL_CALL_X,
353218a5822eSThomas Veerman 
353318a5822eSThomas Veerman /* ADI Blackfin Long Jump pcrel.  */
353418a5822eSThomas Veerman   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
353518a5822eSThomas Veerman 
353618a5822eSThomas Veerman /* ADI Blackfin FD-PIC relocations.  */
353718a5822eSThomas Veerman   BFD_RELOC_BFIN_GOT17M4,
353818a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTHI,
353918a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTLO,
354018a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC,
354118a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
354218a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTHI,
354318a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTLO,
354418a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_VALUE,
354518a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
354618a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
354718a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
354818a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFF17M4,
354918a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFFHI,
355018a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFFLO,
355118a5822eSThomas Veerman 
355218a5822eSThomas Veerman /* ADI Blackfin GOT relocation.  */
355318a5822eSThomas Veerman   BFD_RELOC_BFIN_GOT,
355418a5822eSThomas Veerman 
355518a5822eSThomas Veerman /* ADI Blackfin PLTPC relocation.  */
355618a5822eSThomas Veerman   BFD_RELOC_BFIN_PLTPC,
355718a5822eSThomas Veerman 
355818a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
355918a5822eSThomas Veerman   BFD_ARELOC_BFIN_PUSH,
356018a5822eSThomas Veerman 
356118a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356218a5822eSThomas Veerman   BFD_ARELOC_BFIN_CONST,
356318a5822eSThomas Veerman 
356418a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356518a5822eSThomas Veerman   BFD_ARELOC_BFIN_ADD,
356618a5822eSThomas Veerman 
356718a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356818a5822eSThomas Veerman   BFD_ARELOC_BFIN_SUB,
356918a5822eSThomas Veerman 
357018a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357118a5822eSThomas Veerman   BFD_ARELOC_BFIN_MULT,
357218a5822eSThomas Veerman 
357318a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357418a5822eSThomas Veerman   BFD_ARELOC_BFIN_DIV,
357518a5822eSThomas Veerman 
357618a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357718a5822eSThomas Veerman   BFD_ARELOC_BFIN_MOD,
357818a5822eSThomas Veerman 
357918a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358018a5822eSThomas Veerman   BFD_ARELOC_BFIN_LSHIFT,
358118a5822eSThomas Veerman 
358218a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358318a5822eSThomas Veerman   BFD_ARELOC_BFIN_RSHIFT,
358418a5822eSThomas Veerman 
358518a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358618a5822eSThomas Veerman   BFD_ARELOC_BFIN_AND,
358718a5822eSThomas Veerman 
358818a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358918a5822eSThomas Veerman   BFD_ARELOC_BFIN_OR,
359018a5822eSThomas Veerman 
359118a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359218a5822eSThomas Veerman   BFD_ARELOC_BFIN_XOR,
359318a5822eSThomas Veerman 
359418a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359518a5822eSThomas Veerman   BFD_ARELOC_BFIN_LAND,
359618a5822eSThomas Veerman 
359718a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359818a5822eSThomas Veerman   BFD_ARELOC_BFIN_LOR,
359918a5822eSThomas Veerman 
360018a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360118a5822eSThomas Veerman   BFD_ARELOC_BFIN_LEN,
360218a5822eSThomas Veerman 
360318a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360418a5822eSThomas Veerman   BFD_ARELOC_BFIN_NEG,
360518a5822eSThomas Veerman 
360618a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360718a5822eSThomas Veerman   BFD_ARELOC_BFIN_COMP,
360818a5822eSThomas Veerman 
360918a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
361018a5822eSThomas Veerman   BFD_ARELOC_BFIN_PAGE,
361118a5822eSThomas Veerman 
361218a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
361318a5822eSThomas Veerman   BFD_ARELOC_BFIN_HWPAGE,
361418a5822eSThomas Veerman 
361518a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
361618a5822eSThomas Veerman   BFD_ARELOC_BFIN_ADDR,
361718a5822eSThomas Veerman 
361818a5822eSThomas Veerman /* Mitsubishi D10V relocs.
361918a5822eSThomas Veerman This is a 10-bit reloc with the right 2 bits
362018a5822eSThomas Veerman assumed to be 0.  */
362118a5822eSThomas Veerman   BFD_RELOC_D10V_10_PCREL_R,
362218a5822eSThomas Veerman 
362318a5822eSThomas Veerman /* Mitsubishi D10V relocs.
362418a5822eSThomas Veerman This is a 10-bit reloc with the right 2 bits
362518a5822eSThomas Veerman assumed to be 0.  This is the same as the previous reloc
362618a5822eSThomas Veerman except it is in the left container, i.e.,
362718a5822eSThomas Veerman shifted left 15 bits.  */
362818a5822eSThomas Veerman   BFD_RELOC_D10V_10_PCREL_L,
362918a5822eSThomas Veerman 
363018a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits
363118a5822eSThomas Veerman assumed to be 0.  */
363218a5822eSThomas Veerman   BFD_RELOC_D10V_18,
363318a5822eSThomas Veerman 
363418a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits
363518a5822eSThomas Veerman assumed to be 0.  */
363618a5822eSThomas Veerman   BFD_RELOC_D10V_18_PCREL,
363718a5822eSThomas Veerman 
363818a5822eSThomas Veerman /* Mitsubishi D30V relocs.
363918a5822eSThomas Veerman This is a 6-bit absolute reloc.  */
364018a5822eSThomas Veerman   BFD_RELOC_D30V_6,
364118a5822eSThomas Veerman 
364218a5822eSThomas Veerman /* This is a 6-bit pc-relative reloc with
364318a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
364418a5822eSThomas Veerman   BFD_RELOC_D30V_9_PCREL,
364518a5822eSThomas Veerman 
364618a5822eSThomas Veerman /* This is a 6-bit pc-relative reloc with
364718a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
364818a5822eSThomas Veerman as the previous reloc but on the right side
364918a5822eSThomas Veerman of the container.  */
365018a5822eSThomas Veerman   BFD_RELOC_D30V_9_PCREL_R,
365118a5822eSThomas Veerman 
365218a5822eSThomas Veerman /* This is a 12-bit absolute reloc with the
365318a5822eSThomas Veerman right 3 bitsassumed to be 0.  */
365418a5822eSThomas Veerman   BFD_RELOC_D30V_15,
365518a5822eSThomas Veerman 
365618a5822eSThomas Veerman /* This is a 12-bit pc-relative reloc with
365718a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
365818a5822eSThomas Veerman   BFD_RELOC_D30V_15_PCREL,
365918a5822eSThomas Veerman 
366018a5822eSThomas Veerman /* This is a 12-bit pc-relative reloc with
366118a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
366218a5822eSThomas Veerman as the previous reloc but on the right side
366318a5822eSThomas Veerman of the container.  */
366418a5822eSThomas Veerman   BFD_RELOC_D30V_15_PCREL_R,
366518a5822eSThomas Veerman 
366618a5822eSThomas Veerman /* This is an 18-bit absolute reloc with
366718a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
366818a5822eSThomas Veerman   BFD_RELOC_D30V_21,
366918a5822eSThomas Veerman 
367018a5822eSThomas Veerman /* This is an 18-bit pc-relative reloc with
367118a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
367218a5822eSThomas Veerman   BFD_RELOC_D30V_21_PCREL,
367318a5822eSThomas Veerman 
367418a5822eSThomas Veerman /* This is an 18-bit pc-relative reloc with
367518a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
367618a5822eSThomas Veerman as the previous reloc but on the right side
367718a5822eSThomas Veerman of the container.  */
367818a5822eSThomas Veerman   BFD_RELOC_D30V_21_PCREL_R,
367918a5822eSThomas Veerman 
368018a5822eSThomas Veerman /* This is a 32-bit absolute reloc.  */
368118a5822eSThomas Veerman   BFD_RELOC_D30V_32,
368218a5822eSThomas Veerman 
368318a5822eSThomas Veerman /* This is a 32-bit pc-relative reloc.  */
368418a5822eSThomas Veerman   BFD_RELOC_D30V_32_PCREL,
368518a5822eSThomas Veerman 
368618a5822eSThomas Veerman /* DLX relocs  */
368718a5822eSThomas Veerman   BFD_RELOC_DLX_HI16_S,
368818a5822eSThomas Veerman 
368918a5822eSThomas Veerman /* DLX relocs  */
369018a5822eSThomas Veerman   BFD_RELOC_DLX_LO16,
369118a5822eSThomas Veerman 
369218a5822eSThomas Veerman /* DLX relocs  */
369318a5822eSThomas Veerman   BFD_RELOC_DLX_JMP26,
369418a5822eSThomas Veerman 
369518a5822eSThomas Veerman /* Renesas M16C/M32C Relocations.  */
369618a5822eSThomas Veerman   BFD_RELOC_M32C_HI8,
369718a5822eSThomas Veerman   BFD_RELOC_M32C_RL_JUMP,
369818a5822eSThomas Veerman   BFD_RELOC_M32C_RL_1ADDR,
369918a5822eSThomas Veerman   BFD_RELOC_M32C_RL_2ADDR,
370018a5822eSThomas Veerman 
370118a5822eSThomas Veerman /* Renesas M32R (formerly Mitsubishi M32R) relocs.
370218a5822eSThomas Veerman This is a 24 bit absolute address.  */
370318a5822eSThomas Veerman   BFD_RELOC_M32R_24,
370418a5822eSThomas Veerman 
370518a5822eSThomas Veerman /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
370618a5822eSThomas Veerman   BFD_RELOC_M32R_10_PCREL,
370718a5822eSThomas Veerman 
370818a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
370918a5822eSThomas Veerman   BFD_RELOC_M32R_18_PCREL,
371018a5822eSThomas Veerman 
371118a5822eSThomas Veerman /* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
371218a5822eSThomas Veerman   BFD_RELOC_M32R_26_PCREL,
371318a5822eSThomas Veerman 
371418a5822eSThomas Veerman /* This is a 16-bit reloc containing the high 16 bits of an address
371518a5822eSThomas Veerman used when the lower 16 bits are treated as unsigned.  */
371618a5822eSThomas Veerman   BFD_RELOC_M32R_HI16_ULO,
371718a5822eSThomas Veerman 
371818a5822eSThomas Veerman /* This is a 16-bit reloc containing the high 16 bits of an address
371918a5822eSThomas Veerman used when the lower 16 bits are treated as signed.  */
372018a5822eSThomas Veerman   BFD_RELOC_M32R_HI16_SLO,
372118a5822eSThomas Veerman 
372218a5822eSThomas Veerman /* This is a 16-bit reloc containing the lower 16 bits of an address.  */
372318a5822eSThomas Veerman   BFD_RELOC_M32R_LO16,
372418a5822eSThomas Veerman 
372518a5822eSThomas Veerman /* This is a 16-bit reloc containing the small data area offset for use in
372618a5822eSThomas Veerman add3, load, and store instructions.  */
372718a5822eSThomas Veerman   BFD_RELOC_M32R_SDA16,
372818a5822eSThomas Veerman 
372918a5822eSThomas Veerman /* For PIC.  */
373018a5822eSThomas Veerman   BFD_RELOC_M32R_GOT24,
373118a5822eSThomas Veerman   BFD_RELOC_M32R_26_PLTREL,
373218a5822eSThomas Veerman   BFD_RELOC_M32R_COPY,
373318a5822eSThomas Veerman   BFD_RELOC_M32R_GLOB_DAT,
373418a5822eSThomas Veerman   BFD_RELOC_M32R_JMP_SLOT,
373518a5822eSThomas Veerman   BFD_RELOC_M32R_RELATIVE,
373618a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF,
373718a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_HI_ULO,
373818a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_HI_SLO,
373918a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_LO,
374018a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC24,
374118a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_HI_ULO,
374218a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_HI_SLO,
374318a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_LO,
374418a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_HI_ULO,
374518a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_HI_SLO,
374618a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_LO,
374718a5822eSThomas Veerman 
374818a5822eSThomas Veerman /* This is a 9-bit reloc  */
374918a5822eSThomas Veerman   BFD_RELOC_V850_9_PCREL,
375018a5822eSThomas Veerman 
375118a5822eSThomas Veerman /* This is a 22-bit reloc  */
375218a5822eSThomas Veerman   BFD_RELOC_V850_22_PCREL,
375318a5822eSThomas Veerman 
375418a5822eSThomas Veerman /* This is a 16 bit offset from the short data area pointer.  */
375518a5822eSThomas Veerman   BFD_RELOC_V850_SDA_16_16_OFFSET,
375618a5822eSThomas Veerman 
375718a5822eSThomas Veerman /* This is a 16 bit offset (of which only 15 bits are used) from the
375818a5822eSThomas Veerman short data area pointer.  */
375918a5822eSThomas Veerman   BFD_RELOC_V850_SDA_15_16_OFFSET,
376018a5822eSThomas Veerman 
376118a5822eSThomas Veerman /* This is a 16 bit offset from the zero data area pointer.  */
376218a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_16_16_OFFSET,
376318a5822eSThomas Veerman 
376418a5822eSThomas Veerman /* This is a 16 bit offset (of which only 15 bits are used) from the
376518a5822eSThomas Veerman zero data area pointer.  */
376618a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_15_16_OFFSET,
376718a5822eSThomas Veerman 
376818a5822eSThomas Veerman /* This is an 8 bit offset (of which only 6 bits are used) from the
376918a5822eSThomas Veerman tiny data area pointer.  */
377018a5822eSThomas Veerman   BFD_RELOC_V850_TDA_6_8_OFFSET,
377118a5822eSThomas Veerman 
377218a5822eSThomas Veerman /* This is an 8bit offset (of which only 7 bits are used) from the tiny
377318a5822eSThomas Veerman data area pointer.  */
377418a5822eSThomas Veerman   BFD_RELOC_V850_TDA_7_8_OFFSET,
377518a5822eSThomas Veerman 
377618a5822eSThomas Veerman /* This is a 7 bit offset from the tiny data area pointer.  */
377718a5822eSThomas Veerman   BFD_RELOC_V850_TDA_7_7_OFFSET,
377818a5822eSThomas Veerman 
377918a5822eSThomas Veerman /* This is a 16 bit offset from the tiny data area pointer.  */
378018a5822eSThomas Veerman   BFD_RELOC_V850_TDA_16_16_OFFSET,
378118a5822eSThomas Veerman 
378218a5822eSThomas Veerman /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
378318a5822eSThomas Veerman data area pointer.  */
378418a5822eSThomas Veerman   BFD_RELOC_V850_TDA_4_5_OFFSET,
378518a5822eSThomas Veerman 
378618a5822eSThomas Veerman /* This is a 4 bit offset from the tiny data area pointer.  */
378718a5822eSThomas Veerman   BFD_RELOC_V850_TDA_4_4_OFFSET,
378818a5822eSThomas Veerman 
378918a5822eSThomas Veerman /* This is a 16 bit offset from the short data area pointer, with the
379018a5822eSThomas Veerman bits placed non-contiguously in the instruction.  */
379118a5822eSThomas Veerman   BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
379218a5822eSThomas Veerman 
379318a5822eSThomas Veerman /* This is a 16 bit offset from the zero data area pointer, with the
379418a5822eSThomas Veerman bits placed non-contiguously in the instruction.  */
379518a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
379618a5822eSThomas Veerman 
379718a5822eSThomas Veerman /* This is a 6 bit offset from the call table base pointer.  */
379818a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_6_7_OFFSET,
379918a5822eSThomas Veerman 
380018a5822eSThomas Veerman /* This is a 16 bit offset from the call table base pointer.  */
380118a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_16_16_OFFSET,
380218a5822eSThomas Veerman 
380318a5822eSThomas Veerman /* Used for relaxing indirect function calls.  */
380418a5822eSThomas Veerman   BFD_RELOC_V850_LONGCALL,
380518a5822eSThomas Veerman 
380618a5822eSThomas Veerman /* Used for relaxing indirect jumps.  */
380718a5822eSThomas Veerman   BFD_RELOC_V850_LONGJUMP,
380818a5822eSThomas Veerman 
380918a5822eSThomas Veerman /* Used to maintain alignment whilst relaxing.  */
381018a5822eSThomas Veerman   BFD_RELOC_V850_ALIGN,
381118a5822eSThomas Veerman 
381218a5822eSThomas Veerman /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
381318a5822eSThomas Veerman instructions.  */
381418a5822eSThomas Veerman   BFD_RELOC_V850_LO16_SPLIT_OFFSET,
381518a5822eSThomas Veerman 
381618a5822eSThomas Veerman /* This is a 16-bit reloc.  */
381718a5822eSThomas Veerman   BFD_RELOC_V850_16_PCREL,
381818a5822eSThomas Veerman 
381918a5822eSThomas Veerman /* This is a 17-bit reloc.  */
382018a5822eSThomas Veerman   BFD_RELOC_V850_17_PCREL,
382118a5822eSThomas Veerman 
382218a5822eSThomas Veerman /* This is a 23-bit reloc.  */
382318a5822eSThomas Veerman   BFD_RELOC_V850_23,
382418a5822eSThomas Veerman 
382518a5822eSThomas Veerman /* This is a 32-bit reloc.  */
382618a5822eSThomas Veerman   BFD_RELOC_V850_32_PCREL,
382718a5822eSThomas Veerman 
382818a5822eSThomas Veerman /* This is a 32-bit reloc.  */
382918a5822eSThomas Veerman   BFD_RELOC_V850_32_ABS,
383018a5822eSThomas Veerman 
383118a5822eSThomas Veerman /* This is a 16-bit reloc.  */
383218a5822eSThomas Veerman   BFD_RELOC_V850_16_SPLIT_OFFSET,
383318a5822eSThomas Veerman 
383418a5822eSThomas Veerman /* This is a 16-bit reloc.  */
383518a5822eSThomas Veerman   BFD_RELOC_V850_16_S1,
383618a5822eSThomas Veerman 
383718a5822eSThomas Veerman /* Low 16 bits. 16 bit shifted by 1.  */
383818a5822eSThomas Veerman   BFD_RELOC_V850_LO16_S1,
383918a5822eSThomas Veerman 
384018a5822eSThomas Veerman /* This is a 16 bit offset from the call table base pointer.  */
384118a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_15_16_OFFSET,
384218a5822eSThomas Veerman 
384318a5822eSThomas Veerman /* DSO relocations.  */
384418a5822eSThomas Veerman   BFD_RELOC_V850_32_GOTPCREL,
384518a5822eSThomas Veerman 
384618a5822eSThomas Veerman /* DSO relocations.  */
384718a5822eSThomas Veerman   BFD_RELOC_V850_16_GOT,
384818a5822eSThomas Veerman 
384918a5822eSThomas Veerman /* DSO relocations.  */
385018a5822eSThomas Veerman   BFD_RELOC_V850_32_GOT,
385118a5822eSThomas Veerman 
385218a5822eSThomas Veerman /* DSO relocations.  */
385318a5822eSThomas Veerman   BFD_RELOC_V850_22_PLT_PCREL,
385418a5822eSThomas Veerman 
385518a5822eSThomas Veerman /* DSO relocations.  */
385618a5822eSThomas Veerman   BFD_RELOC_V850_32_PLT_PCREL,
385718a5822eSThomas Veerman 
385818a5822eSThomas Veerman /* DSO relocations.  */
385918a5822eSThomas Veerman   BFD_RELOC_V850_COPY,
386018a5822eSThomas Veerman 
386118a5822eSThomas Veerman /* DSO relocations.  */
386218a5822eSThomas Veerman   BFD_RELOC_V850_GLOB_DAT,
386318a5822eSThomas Veerman 
386418a5822eSThomas Veerman /* DSO relocations.  */
386518a5822eSThomas Veerman   BFD_RELOC_V850_JMP_SLOT,
386618a5822eSThomas Veerman 
386718a5822eSThomas Veerman /* DSO relocations.  */
386818a5822eSThomas Veerman   BFD_RELOC_V850_RELATIVE,
386918a5822eSThomas Veerman 
387018a5822eSThomas Veerman /* DSO relocations.  */
387118a5822eSThomas Veerman   BFD_RELOC_V850_16_GOTOFF,
387218a5822eSThomas Veerman 
387318a5822eSThomas Veerman /* DSO relocations.  */
387418a5822eSThomas Veerman   BFD_RELOC_V850_32_GOTOFF,
387518a5822eSThomas Veerman 
387618a5822eSThomas Veerman /* start code.  */
387718a5822eSThomas Veerman   BFD_RELOC_V850_CODE,
387818a5822eSThomas Veerman 
387918a5822eSThomas Veerman /* start data in text.  */
388018a5822eSThomas Veerman   BFD_RELOC_V850_DATA,
388118a5822eSThomas Veerman 
388218a5822eSThomas Veerman /* This is a 8bit DP reloc for the tms320c30, where the most
388318a5822eSThomas Veerman significant 8 bits of a 24 bit word are placed into the least
388418a5822eSThomas Veerman significant 8 bits of the opcode.  */
388518a5822eSThomas Veerman   BFD_RELOC_TIC30_LDP,
388618a5822eSThomas Veerman 
388718a5822eSThomas Veerman /* This is a 7bit reloc for the tms320c54x, where the least
388818a5822eSThomas Veerman significant 7 bits of a 16 bit word are placed into the least
388918a5822eSThomas Veerman significant 7 bits of the opcode.  */
389018a5822eSThomas Veerman   BFD_RELOC_TIC54X_PARTLS7,
389118a5822eSThomas Veerman 
389218a5822eSThomas Veerman /* This is a 9bit DP reloc for the tms320c54x, where the most
389318a5822eSThomas Veerman significant 9 bits of a 16 bit word are placed into the least
389418a5822eSThomas Veerman significant 9 bits of the opcode.  */
389518a5822eSThomas Veerman   BFD_RELOC_TIC54X_PARTMS9,
389618a5822eSThomas Veerman 
389718a5822eSThomas Veerman /* This is an extended address 23-bit reloc for the tms320c54x.  */
389818a5822eSThomas Veerman   BFD_RELOC_TIC54X_23,
389918a5822eSThomas Veerman 
390018a5822eSThomas Veerman /* This is a 16-bit reloc for the tms320c54x, where the least
390118a5822eSThomas Veerman significant 16 bits of a 23-bit extended address are placed into
390218a5822eSThomas Veerman the opcode.  */
390318a5822eSThomas Veerman   BFD_RELOC_TIC54X_16_OF_23,
390418a5822eSThomas Veerman 
390518a5822eSThomas Veerman /* This is a reloc for the tms320c54x, where the most
390618a5822eSThomas Veerman significant 7 bits of a 23-bit extended address are placed into
390718a5822eSThomas Veerman the opcode.  */
390818a5822eSThomas Veerman   BFD_RELOC_TIC54X_MS7_OF_23,
390918a5822eSThomas Veerman 
391018a5822eSThomas Veerman /* TMS320C6000 relocations.  */
391118a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S21,
391218a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S12,
391318a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S10,
391418a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S7,
391518a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_S16,
391618a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_L16,
391718a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_H16,
391818a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_B,
391918a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_H,
392018a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_W,
392118a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_S16,
392218a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_B,
392318a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_H,
392418a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_W,
392518a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_B,
392618a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_H,
392718a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_W,
392818a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_U15_W,
392918a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_L16_W,
393018a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_H16_W,
393118a5822eSThomas Veerman   BFD_RELOC_C6000_DSBT_INDEX,
393218a5822eSThomas Veerman   BFD_RELOC_C6000_PREL31,
393318a5822eSThomas Veerman   BFD_RELOC_C6000_COPY,
3934c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_JUMP_SLOT,
3935c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_EHTYPE,
3936c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_PCR_H16,
3937c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_PCR_L16,
393818a5822eSThomas Veerman   BFD_RELOC_C6000_ALIGN,
393918a5822eSThomas Veerman   BFD_RELOC_C6000_FPHEAD,
394018a5822eSThomas Veerman   BFD_RELOC_C6000_NOCMP,
394118a5822eSThomas Veerman 
394218a5822eSThomas Veerman /* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
394318a5822eSThomas Veerman   BFD_RELOC_FR30_48,
394418a5822eSThomas Veerman 
394518a5822eSThomas Veerman /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
394618a5822eSThomas Veerman two sections.  */
394718a5822eSThomas Veerman   BFD_RELOC_FR30_20,
394818a5822eSThomas Veerman 
394918a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
395018a5822eSThomas Veerman 4 bits.  */
395118a5822eSThomas Veerman   BFD_RELOC_FR30_6_IN_4,
395218a5822eSThomas Veerman 
395318a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
395418a5822eSThomas Veerman into 8 bits.  */
395518a5822eSThomas Veerman   BFD_RELOC_FR30_8_IN_8,
395618a5822eSThomas Veerman 
395718a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
395818a5822eSThomas Veerman into 8 bits.  */
395918a5822eSThomas Veerman   BFD_RELOC_FR30_9_IN_8,
396018a5822eSThomas Veerman 
396118a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
396218a5822eSThomas Veerman into 8 bits.  */
396318a5822eSThomas Veerman   BFD_RELOC_FR30_10_IN_8,
396418a5822eSThomas Veerman 
396518a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
396618a5822eSThomas Veerman short offset into 8 bits.  */
396718a5822eSThomas Veerman   BFD_RELOC_FR30_9_PCREL,
396818a5822eSThomas Veerman 
396918a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
397018a5822eSThomas Veerman short offset into 11 bits.  */
397118a5822eSThomas Veerman   BFD_RELOC_FR30_12_PCREL,
397218a5822eSThomas Veerman 
397318a5822eSThomas Veerman /* Motorola Mcore relocations.  */
397418a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM8BY4,
397518a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM11BY2,
397618a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM4BY2,
397718a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_32,
397818a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
397918a5822eSThomas Veerman   BFD_RELOC_MCORE_RVA,
398018a5822eSThomas Veerman 
398118a5822eSThomas Veerman /* Toshiba Media Processor Relocations.  */
398218a5822eSThomas Veerman   BFD_RELOC_MEP_8,
398318a5822eSThomas Veerman   BFD_RELOC_MEP_16,
398418a5822eSThomas Veerman   BFD_RELOC_MEP_32,
398518a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL8A2,
398618a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL12A2,
398718a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL17A2,
398818a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL24A2,
398918a5822eSThomas Veerman   BFD_RELOC_MEP_PCABS24A2,
399018a5822eSThomas Veerman   BFD_RELOC_MEP_LOW16,
399118a5822eSThomas Veerman   BFD_RELOC_MEP_HI16U,
399218a5822eSThomas Veerman   BFD_RELOC_MEP_HI16S,
399318a5822eSThomas Veerman   BFD_RELOC_MEP_GPREL,
399418a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL,
399518a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7,
399618a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7A2,
399718a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7A4,
399818a5822eSThomas Veerman   BFD_RELOC_MEP_UIMM24,
399918a5822eSThomas Veerman   BFD_RELOC_MEP_ADDR24A4,
400018a5822eSThomas Veerman   BFD_RELOC_MEP_GNU_VTINHERIT,
400118a5822eSThomas Veerman   BFD_RELOC_MEP_GNU_VTENTRY,
400218a5822eSThomas Veerman 
400318a5822eSThomas Veerman 
400418a5822eSThomas Veerman /* These are relocations for the GETA instruction.  */
400518a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA,
400618a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_1,
400718a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_2,
400818a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_3,
400918a5822eSThomas Veerman 
401018a5822eSThomas Veerman /* These are relocations for a conditional branch instruction.  */
401118a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH,
401218a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_J,
401318a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_1,
401418a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_2,
401518a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_3,
401618a5822eSThomas Veerman 
401718a5822eSThomas Veerman /* These are relocations for the PUSHJ instruction.  */
401818a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ,
401918a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_1,
402018a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_2,
402118a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_3,
402218a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
402318a5822eSThomas Veerman 
402418a5822eSThomas Veerman /* These are relocations for the JMP instruction.  */
402518a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP,
402618a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_1,
402718a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_2,
402818a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_3,
402918a5822eSThomas Veerman 
403018a5822eSThomas Veerman /* This is a relocation for a relative address as in a GETA instruction or
403118a5822eSThomas Veerman a branch.  */
403218a5822eSThomas Veerman   BFD_RELOC_MMIX_ADDR19,
403318a5822eSThomas Veerman 
403418a5822eSThomas Veerman /* This is a relocation for a relative address as in a JMP instruction.  */
403518a5822eSThomas Veerman   BFD_RELOC_MMIX_ADDR27,
403618a5822eSThomas Veerman 
403718a5822eSThomas Veerman /* This is a relocation for an instruction field that may be a general
403818a5822eSThomas Veerman register or a value 0..255.  */
403918a5822eSThomas Veerman   BFD_RELOC_MMIX_REG_OR_BYTE,
404018a5822eSThomas Veerman 
404118a5822eSThomas Veerman /* This is a relocation for an instruction field that may be a general
404218a5822eSThomas Veerman register.  */
404318a5822eSThomas Veerman   BFD_RELOC_MMIX_REG,
404418a5822eSThomas Veerman 
404518a5822eSThomas Veerman /* This is a relocation for two instruction fields holding a register and
404618a5822eSThomas Veerman an offset, the equivalent of the relocation.  */
404718a5822eSThomas Veerman   BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
404818a5822eSThomas Veerman 
404918a5822eSThomas Veerman /* This relocation is an assertion that the expression is not allocated as
405018a5822eSThomas Veerman a global register.  It does not modify contents.  */
405118a5822eSThomas Veerman   BFD_RELOC_MMIX_LOCAL,
405218a5822eSThomas Veerman 
405318a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
405418a5822eSThomas Veerman short offset into 7 bits.  */
405518a5822eSThomas Veerman   BFD_RELOC_AVR_7_PCREL,
405618a5822eSThomas Veerman 
405718a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
405818a5822eSThomas Veerman short offset into 12 bits.  */
405918a5822eSThomas Veerman   BFD_RELOC_AVR_13_PCREL,
406018a5822eSThomas Veerman 
406118a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
406218a5822eSThomas Veerman program memory address) into 16 bits.  */
406318a5822eSThomas Veerman   BFD_RELOC_AVR_16_PM,
406418a5822eSThomas Veerman 
406518a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
406618a5822eSThomas Veerman data memory address) into 8 bit immediate value of LDI insn.  */
406718a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI,
406818a5822eSThomas Veerman 
406918a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
407018a5822eSThomas Veerman of data memory address) into 8 bit immediate value of LDI insn.  */
407118a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI,
407218a5822eSThomas Veerman 
407318a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
407418a5822eSThomas Veerman of program memory address) into 8 bit immediate value of LDI insn.  */
407518a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI,
407618a5822eSThomas Veerman 
407718a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
407818a5822eSThomas Veerman of 32 bit value) into 8 bit immediate value of LDI insn.  */
407918a5822eSThomas Veerman   BFD_RELOC_AVR_MS8_LDI,
408018a5822eSThomas Veerman 
408118a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
408218a5822eSThomas Veerman (usually data memory address) into 8 bit immediate value of SUBI insn.  */
408318a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_NEG,
408418a5822eSThomas Veerman 
408518a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
408618a5822eSThomas Veerman (high 8 bit of data memory address) into 8 bit immediate value of
408718a5822eSThomas Veerman SUBI insn.  */
408818a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_NEG,
408918a5822eSThomas Veerman 
409018a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
409118a5822eSThomas Veerman (most high 8 bit of program memory address) into 8 bit immediate value
409218a5822eSThomas Veerman of LDI or SUBI insn.  */
409318a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_NEG,
409418a5822eSThomas Veerman 
409518a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
409618a5822eSThomas Veerman of 32 bit value) into 8 bit immediate value of LDI insn.  */
409718a5822eSThomas Veerman   BFD_RELOC_AVR_MS8_LDI_NEG,
409818a5822eSThomas Veerman 
409918a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
410018a5822eSThomas Veerman command address) into 8 bit immediate value of LDI insn.  */
410118a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_PM,
410218a5822eSThomas Veerman 
410318a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value
410418a5822eSThomas Veerman (command address) into 8 bit immediate value of LDI insn. If the address
410518a5822eSThomas Veerman is beyond the 128k boundary, the linker inserts a jump stub for this reloc
410618a5822eSThomas Veerman in the lower 128k.  */
410718a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_GS,
410818a5822eSThomas Veerman 
410918a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
411018a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  */
411118a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_PM,
411218a5822eSThomas Veerman 
411318a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
411418a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  If the address
411518a5822eSThomas Veerman is beyond the 128k boundary, the linker inserts a jump stub for this reloc
411618a5822eSThomas Veerman below 128k.  */
411718a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_GS,
411818a5822eSThomas Veerman 
411918a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
412018a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  */
412118a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_PM,
412218a5822eSThomas Veerman 
412318a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
412418a5822eSThomas Veerman (usually command address) into 8 bit immediate value of SUBI insn.  */
412518a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_PM_NEG,
412618a5822eSThomas Veerman 
412718a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
412818a5822eSThomas Veerman (high 8 bit of 16 bit command address) into 8 bit immediate value
412918a5822eSThomas Veerman of SUBI insn.  */
413018a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_PM_NEG,
413118a5822eSThomas Veerman 
413218a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
413318a5822eSThomas Veerman (high 6 bit of 22 bit command address) into 8 bit immediate
413418a5822eSThomas Veerman value of SUBI insn.  */
413518a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_PM_NEG,
413618a5822eSThomas Veerman 
413718a5822eSThomas Veerman /* This is a 32 bit reloc for the AVR that stores 23 bit value
413818a5822eSThomas Veerman into 22 bits.  */
413918a5822eSThomas Veerman   BFD_RELOC_AVR_CALL,
414018a5822eSThomas Veerman 
414118a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores all needed bits
414218a5822eSThomas Veerman for absolute addressing with ldi with overflow check to linktime  */
414318a5822eSThomas Veerman   BFD_RELOC_AVR_LDI,
414418a5822eSThomas Veerman 
414518a5822eSThomas Veerman /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
414618a5822eSThomas Veerman instructions  */
414718a5822eSThomas Veerman   BFD_RELOC_AVR_6,
414818a5822eSThomas Veerman 
414918a5822eSThomas Veerman /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
415018a5822eSThomas Veerman instructions  */
415118a5822eSThomas Veerman   BFD_RELOC_AVR_6_ADIW,
415218a5822eSThomas Veerman 
4153c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4154c9ea9e7aSLionel Sambuc in .byte lo8(symbol)  */
4155c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_LO,
4156c9ea9e7aSLionel Sambuc 
4157c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4158c9ea9e7aSLionel Sambuc in .byte hi8(symbol)  */
4159c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_HI,
4160c9ea9e7aSLionel Sambuc 
4161c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4162c9ea9e7aSLionel Sambuc in .byte hlo8(symbol)  */
4163c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_HLO,
4164c9ea9e7aSLionel Sambuc 
4165c9ea9e7aSLionel Sambuc /* Renesas RL78 Relocations.  */
4166c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG8,
4167c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG16,
4168c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG24,
4169c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG32,
4170c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_16_OP,
4171c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_24_OP,
4172c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_32_OP,
4173c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_8U,
4174c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_16U,
4175c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_24U,
4176c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_DIR3U_PCREL,
4177c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_DIFF,
4178c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELB,
4179c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELW,
4180c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELL,
4181c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_SYM,
4182c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_SUBTRACT,
4183c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_NEG,
4184c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_AND,
4185c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_SHRA,
4186c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS8,
4187c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16,
4188c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16_REV,
4189c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS32,
4190c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS32_REV,
4191c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16U,
4192c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16UW,
4193c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16UL,
4194c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_RELAX,
4195c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_HI16,
4196c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_HI8,
4197c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_LO16,
4198c9ea9e7aSLionel Sambuc 
419918a5822eSThomas Veerman /* Renesas RX Relocations.  */
420018a5822eSThomas Veerman   BFD_RELOC_RX_NEG8,
420118a5822eSThomas Veerman   BFD_RELOC_RX_NEG16,
420218a5822eSThomas Veerman   BFD_RELOC_RX_NEG24,
420318a5822eSThomas Veerman   BFD_RELOC_RX_NEG32,
420418a5822eSThomas Veerman   BFD_RELOC_RX_16_OP,
420518a5822eSThomas Veerman   BFD_RELOC_RX_24_OP,
420618a5822eSThomas Veerman   BFD_RELOC_RX_32_OP,
420718a5822eSThomas Veerman   BFD_RELOC_RX_8U,
420818a5822eSThomas Veerman   BFD_RELOC_RX_16U,
420918a5822eSThomas Veerman   BFD_RELOC_RX_24U,
421018a5822eSThomas Veerman   BFD_RELOC_RX_DIR3U_PCREL,
421118a5822eSThomas Veerman   BFD_RELOC_RX_DIFF,
421218a5822eSThomas Veerman   BFD_RELOC_RX_GPRELB,
421318a5822eSThomas Veerman   BFD_RELOC_RX_GPRELW,
421418a5822eSThomas Veerman   BFD_RELOC_RX_GPRELL,
421518a5822eSThomas Veerman   BFD_RELOC_RX_SYM,
421618a5822eSThomas Veerman   BFD_RELOC_RX_OP_SUBTRACT,
4217c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_OP_NEG,
421818a5822eSThomas Veerman   BFD_RELOC_RX_ABS8,
421918a5822eSThomas Veerman   BFD_RELOC_RX_ABS16,
4220c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_ABS16_REV,
422118a5822eSThomas Veerman   BFD_RELOC_RX_ABS32,
4222c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_ABS32_REV,
422318a5822eSThomas Veerman   BFD_RELOC_RX_ABS16U,
422418a5822eSThomas Veerman   BFD_RELOC_RX_ABS16UW,
422518a5822eSThomas Veerman   BFD_RELOC_RX_ABS16UL,
422618a5822eSThomas Veerman   BFD_RELOC_RX_RELAX,
422718a5822eSThomas Veerman 
422818a5822eSThomas Veerman /* Direct 12 bit.  */
422918a5822eSThomas Veerman   BFD_RELOC_390_12,
423018a5822eSThomas Veerman 
423118a5822eSThomas Veerman /* 12 bit GOT offset.  */
423218a5822eSThomas Veerman   BFD_RELOC_390_GOT12,
423318a5822eSThomas Veerman 
423418a5822eSThomas Veerman /* 32 bit PC relative PLT address.  */
423518a5822eSThomas Veerman   BFD_RELOC_390_PLT32,
423618a5822eSThomas Veerman 
423718a5822eSThomas Veerman /* Copy symbol at runtime.  */
423818a5822eSThomas Veerman   BFD_RELOC_390_COPY,
423918a5822eSThomas Veerman 
424018a5822eSThomas Veerman /* Create GOT entry.  */
424118a5822eSThomas Veerman   BFD_RELOC_390_GLOB_DAT,
424218a5822eSThomas Veerman 
424318a5822eSThomas Veerman /* Create PLT entry.  */
424418a5822eSThomas Veerman   BFD_RELOC_390_JMP_SLOT,
424518a5822eSThomas Veerman 
424618a5822eSThomas Veerman /* Adjust by program base.  */
424718a5822eSThomas Veerman   BFD_RELOC_390_RELATIVE,
424818a5822eSThomas Veerman 
424918a5822eSThomas Veerman /* 32 bit PC relative offset to GOT.  */
425018a5822eSThomas Veerman   BFD_RELOC_390_GOTPC,
425118a5822eSThomas Veerman 
425218a5822eSThomas Veerman /* 16 bit GOT offset.  */
425318a5822eSThomas Veerman   BFD_RELOC_390_GOT16,
425418a5822eSThomas Veerman 
425518a5822eSThomas Veerman /* PC relative 16 bit shifted by 1.  */
425618a5822eSThomas Veerman   BFD_RELOC_390_PC16DBL,
425718a5822eSThomas Veerman 
425818a5822eSThomas Veerman /* 16 bit PC rel. PLT shifted by 1.  */
425918a5822eSThomas Veerman   BFD_RELOC_390_PLT16DBL,
426018a5822eSThomas Veerman 
426118a5822eSThomas Veerman /* PC relative 32 bit shifted by 1.  */
426218a5822eSThomas Veerman   BFD_RELOC_390_PC32DBL,
426318a5822eSThomas Veerman 
426418a5822eSThomas Veerman /* 32 bit PC rel. PLT shifted by 1.  */
426518a5822eSThomas Veerman   BFD_RELOC_390_PLT32DBL,
426618a5822eSThomas Veerman 
426718a5822eSThomas Veerman /* 32 bit PC rel. GOT shifted by 1.  */
426818a5822eSThomas Veerman   BFD_RELOC_390_GOTPCDBL,
426918a5822eSThomas Veerman 
427018a5822eSThomas Veerman /* 64 bit GOT offset.  */
427118a5822eSThomas Veerman   BFD_RELOC_390_GOT64,
427218a5822eSThomas Veerman 
427318a5822eSThomas Veerman /* 64 bit PC relative PLT address.  */
427418a5822eSThomas Veerman   BFD_RELOC_390_PLT64,
427518a5822eSThomas Veerman 
427618a5822eSThomas Veerman /* 32 bit rel. offset to GOT entry.  */
427718a5822eSThomas Veerman   BFD_RELOC_390_GOTENT,
427818a5822eSThomas Veerman 
427918a5822eSThomas Veerman /* 64 bit offset to GOT.  */
428018a5822eSThomas Veerman   BFD_RELOC_390_GOTOFF64,
428118a5822eSThomas Veerman 
428218a5822eSThomas Veerman /* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
428318a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT12,
428418a5822eSThomas Veerman 
428518a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
428618a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT16,
428718a5822eSThomas Veerman 
428818a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
428918a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT32,
429018a5822eSThomas Veerman 
429118a5822eSThomas Veerman /* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
429218a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT64,
429318a5822eSThomas Veerman 
429418a5822eSThomas Veerman /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
429518a5822eSThomas Veerman   BFD_RELOC_390_GOTPLTENT,
429618a5822eSThomas Veerman 
429718a5822eSThomas Veerman /* 16-bit rel. offset from the GOT to a PLT entry.  */
429818a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF16,
429918a5822eSThomas Veerman 
430018a5822eSThomas Veerman /* 32-bit rel. offset from the GOT to a PLT entry.  */
430118a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF32,
430218a5822eSThomas Veerman 
430318a5822eSThomas Veerman /* 64-bit rel. offset from the GOT to a PLT entry.  */
430418a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF64,
430518a5822eSThomas Veerman 
430618a5822eSThomas Veerman /* s390 tls relocations.  */
430718a5822eSThomas Veerman   BFD_RELOC_390_TLS_LOAD,
430818a5822eSThomas Veerman   BFD_RELOC_390_TLS_GDCALL,
430918a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDCALL,
431018a5822eSThomas Veerman   BFD_RELOC_390_TLS_GD32,
431118a5822eSThomas Veerman   BFD_RELOC_390_TLS_GD64,
431218a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE12,
431318a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE32,
431418a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE64,
431518a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDM32,
431618a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDM64,
431718a5822eSThomas Veerman   BFD_RELOC_390_TLS_IE32,
431818a5822eSThomas Veerman   BFD_RELOC_390_TLS_IE64,
431918a5822eSThomas Veerman   BFD_RELOC_390_TLS_IEENT,
432018a5822eSThomas Veerman   BFD_RELOC_390_TLS_LE32,
432118a5822eSThomas Veerman   BFD_RELOC_390_TLS_LE64,
432218a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDO32,
432318a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDO64,
432418a5822eSThomas Veerman   BFD_RELOC_390_TLS_DTPMOD,
432518a5822eSThomas Veerman   BFD_RELOC_390_TLS_DTPOFF,
432618a5822eSThomas Veerman   BFD_RELOC_390_TLS_TPOFF,
432718a5822eSThomas Veerman 
432818a5822eSThomas Veerman /* Long displacement extension.  */
432918a5822eSThomas Veerman   BFD_RELOC_390_20,
433018a5822eSThomas Veerman   BFD_RELOC_390_GOT20,
433118a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT20,
433218a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE20,
433318a5822eSThomas Veerman 
4334c9ea9e7aSLionel Sambuc /* STT_GNU_IFUNC relocation.  */
4335c9ea9e7aSLionel Sambuc   BFD_RELOC_390_IRELATIVE,
4336c9ea9e7aSLionel Sambuc 
433718a5822eSThomas Veerman /* Score relocations
433818a5822eSThomas Veerman Low 16 bit for load/store  */
433918a5822eSThomas Veerman   BFD_RELOC_SCORE_GPREL15,
434018a5822eSThomas Veerman 
434118a5822eSThomas Veerman /* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
434218a5822eSThomas Veerman   BFD_RELOC_SCORE_DUMMY2,
434318a5822eSThomas Veerman   BFD_RELOC_SCORE_JMP,
434418a5822eSThomas Veerman 
434518a5822eSThomas Veerman /* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
434618a5822eSThomas Veerman   BFD_RELOC_SCORE_BRANCH,
434718a5822eSThomas Veerman 
434818a5822eSThomas Veerman /* This is a 32-bit reloc for 48-bit instructions.  */
434918a5822eSThomas Veerman   BFD_RELOC_SCORE_IMM30,
435018a5822eSThomas Veerman 
435118a5822eSThomas Veerman /* This is a 32-bit reloc for 48-bit instructions.  */
435218a5822eSThomas Veerman   BFD_RELOC_SCORE_IMM32,
435318a5822eSThomas Veerman 
435418a5822eSThomas Veerman /* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
435518a5822eSThomas Veerman   BFD_RELOC_SCORE16_JMP,
435618a5822eSThomas Veerman 
435718a5822eSThomas Veerman /* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
435818a5822eSThomas Veerman   BFD_RELOC_SCORE16_BRANCH,
435918a5822eSThomas Veerman 
436018a5822eSThomas Veerman /* This is a 9-bit reloc with the right 1 bit assumed to be 0  */
436118a5822eSThomas Veerman   BFD_RELOC_SCORE_BCMP,
436218a5822eSThomas Veerman 
436318a5822eSThomas Veerman /* Undocumented Score relocs  */
436418a5822eSThomas Veerman   BFD_RELOC_SCORE_GOT15,
436518a5822eSThomas Veerman   BFD_RELOC_SCORE_GOT_LO16,
436618a5822eSThomas Veerman   BFD_RELOC_SCORE_CALL15,
436718a5822eSThomas Veerman   BFD_RELOC_SCORE_DUMMY_HI16,
436818a5822eSThomas Veerman 
436918a5822eSThomas Veerman /* Scenix IP2K - 9-bit register number / data address  */
437018a5822eSThomas Veerman   BFD_RELOC_IP2K_FR9,
437118a5822eSThomas Veerman 
437218a5822eSThomas Veerman /* Scenix IP2K - 4-bit register/data bank number  */
437318a5822eSThomas Veerman   BFD_RELOC_IP2K_BANK,
437418a5822eSThomas Veerman 
437518a5822eSThomas Veerman /* Scenix IP2K - low 13 bits of instruction word address  */
437618a5822eSThomas Veerman   BFD_RELOC_IP2K_ADDR16CJP,
437718a5822eSThomas Veerman 
437818a5822eSThomas Veerman /* Scenix IP2K - high 3 bits of instruction word address  */
437918a5822eSThomas Veerman   BFD_RELOC_IP2K_PAGE3,
438018a5822eSThomas Veerman 
438118a5822eSThomas Veerman /* Scenix IP2K - ext/low/high 8 bits of data address  */
438218a5822eSThomas Veerman   BFD_RELOC_IP2K_LO8DATA,
438318a5822eSThomas Veerman   BFD_RELOC_IP2K_HI8DATA,
438418a5822eSThomas Veerman   BFD_RELOC_IP2K_EX8DATA,
438518a5822eSThomas Veerman 
438618a5822eSThomas Veerman /* Scenix IP2K - low/high 8 bits of instruction word address  */
438718a5822eSThomas Veerman   BFD_RELOC_IP2K_LO8INSN,
438818a5822eSThomas Veerman   BFD_RELOC_IP2K_HI8INSN,
438918a5822eSThomas Veerman 
439018a5822eSThomas Veerman /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
439118a5822eSThomas Veerman   BFD_RELOC_IP2K_PC_SKIP,
439218a5822eSThomas Veerman 
439318a5822eSThomas Veerman /* Scenix IP2K - 16 bit word address in text section.  */
439418a5822eSThomas Veerman   BFD_RELOC_IP2K_TEXT,
439518a5822eSThomas Veerman 
439618a5822eSThomas Veerman /* Scenix IP2K - 7-bit sp or dp offset  */
439718a5822eSThomas Veerman   BFD_RELOC_IP2K_FR_OFFSET,
439818a5822eSThomas Veerman 
439918a5822eSThomas Veerman /* Scenix VPE4K coprocessor - data/insn-space addressing  */
440018a5822eSThomas Veerman   BFD_RELOC_VPE4KMATH_DATA,
440118a5822eSThomas Veerman   BFD_RELOC_VPE4KMATH_INSN,
440218a5822eSThomas Veerman 
440318a5822eSThomas Veerman /* These two relocations are used by the linker to determine which of
440418a5822eSThomas Veerman the entries in a C++ virtual function table are actually used.  When
440518a5822eSThomas Veerman the --gc-sections option is given, the linker will zero out the entries
440618a5822eSThomas Veerman that are not used, so that the code for those functions need not be
440718a5822eSThomas Veerman included in the output.
440818a5822eSThomas Veerman 
440918a5822eSThomas Veerman VTABLE_INHERIT is a zero-space relocation used to describe to the
441018a5822eSThomas Veerman linker the inheritance tree of a C++ virtual function table.  The
441118a5822eSThomas Veerman relocation's symbol should be the parent class' vtable, and the
441218a5822eSThomas Veerman relocation should be located at the child vtable.
441318a5822eSThomas Veerman 
441418a5822eSThomas Veerman VTABLE_ENTRY is a zero-space relocation that describes the use of a
441518a5822eSThomas Veerman virtual function table entry.  The reloc's symbol should refer to the
441618a5822eSThomas Veerman table of the class mentioned in the code.  Off of that base, an offset
441718a5822eSThomas Veerman describes the entry that is being used.  For Rela hosts, this offset
441818a5822eSThomas Veerman is stored in the reloc's addend.  For Rel hosts, we are forced to put
441918a5822eSThomas Veerman this offset in the reloc's section offset.  */
442018a5822eSThomas Veerman   BFD_RELOC_VTABLE_INHERIT,
442118a5822eSThomas Veerman   BFD_RELOC_VTABLE_ENTRY,
442218a5822eSThomas Veerman 
442318a5822eSThomas Veerman /* Intel IA64 Relocations.  */
442418a5822eSThomas Veerman   BFD_RELOC_IA64_IMM14,
442518a5822eSThomas Veerman   BFD_RELOC_IA64_IMM22,
442618a5822eSThomas Veerman   BFD_RELOC_IA64_IMM64,
442718a5822eSThomas Veerman   BFD_RELOC_IA64_DIR32MSB,
442818a5822eSThomas Veerman   BFD_RELOC_IA64_DIR32LSB,
442918a5822eSThomas Veerman   BFD_RELOC_IA64_DIR64MSB,
443018a5822eSThomas Veerman   BFD_RELOC_IA64_DIR64LSB,
443118a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL22,
443218a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64I,
443318a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL32MSB,
443418a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL32LSB,
443518a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64MSB,
443618a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64LSB,
443718a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF22,
443818a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF64I,
443918a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF22,
444018a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64I,
444118a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64MSB,
444218a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64LSB,
444318a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64I,
444418a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR32MSB,
444518a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR32LSB,
444618a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64MSB,
444718a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64LSB,
444818a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21B,
444918a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21BI,
445018a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21M,
445118a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21F,
445218a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL22,
445318a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL60B,
445418a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64I,
445518a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL32MSB,
445618a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL32LSB,
445718a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64MSB,
445818a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64LSB,
445918a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR22,
446018a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64I,
446118a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR32MSB,
446218a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR32LSB,
446318a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64MSB,
446418a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64LSB,
446518a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL32MSB,
446618a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL32LSB,
446718a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL64MSB,
446818a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL64LSB,
446918a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL32MSB,
447018a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL32LSB,
447118a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL64MSB,
447218a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL64LSB,
447318a5822eSThomas Veerman   BFD_RELOC_IA64_REL32MSB,
447418a5822eSThomas Veerman   BFD_RELOC_IA64_REL32LSB,
447518a5822eSThomas Veerman   BFD_RELOC_IA64_REL64MSB,
447618a5822eSThomas Veerman   BFD_RELOC_IA64_REL64LSB,
447718a5822eSThomas Veerman   BFD_RELOC_IA64_LTV32MSB,
447818a5822eSThomas Veerman   BFD_RELOC_IA64_LTV32LSB,
447918a5822eSThomas Veerman   BFD_RELOC_IA64_LTV64MSB,
448018a5822eSThomas Veerman   BFD_RELOC_IA64_LTV64LSB,
448118a5822eSThomas Veerman   BFD_RELOC_IA64_IPLTMSB,
448218a5822eSThomas Veerman   BFD_RELOC_IA64_IPLTLSB,
448318a5822eSThomas Veerman   BFD_RELOC_IA64_COPY,
448418a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF22X,
448518a5822eSThomas Veerman   BFD_RELOC_IA64_LDXMOV,
448618a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL14,
448718a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL22,
448818a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64I,
448918a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64MSB,
449018a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64LSB,
449118a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_TPREL22,
449218a5822eSThomas Veerman   BFD_RELOC_IA64_DTPMOD64MSB,
449318a5822eSThomas Veerman   BFD_RELOC_IA64_DTPMOD64LSB,
449418a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_DTPMOD22,
449518a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL14,
449618a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL22,
449718a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64I,
449818a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL32MSB,
449918a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL32LSB,
450018a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64MSB,
450118a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64LSB,
450218a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_DTPREL22,
450318a5822eSThomas Veerman 
450418a5822eSThomas Veerman /* Motorola 68HC11 reloc.
450518a5822eSThomas Veerman This is the 8 bit high part of an absolute address.  */
450618a5822eSThomas Veerman   BFD_RELOC_M68HC11_HI8,
450718a5822eSThomas Veerman 
450818a5822eSThomas Veerman /* Motorola 68HC11 reloc.
450918a5822eSThomas Veerman This is the 8 bit low part of an absolute address.  */
451018a5822eSThomas Veerman   BFD_RELOC_M68HC11_LO8,
451118a5822eSThomas Veerman 
451218a5822eSThomas Veerman /* Motorola 68HC11 reloc.
451318a5822eSThomas Veerman This is the 3 bit of a value.  */
451418a5822eSThomas Veerman   BFD_RELOC_M68HC11_3B,
451518a5822eSThomas Veerman 
451618a5822eSThomas Veerman /* Motorola 68HC11 reloc.
451718a5822eSThomas Veerman This reloc marks the beginning of a jump/call instruction.
451818a5822eSThomas Veerman It is used for linker relaxation to correctly identify beginning
451918a5822eSThomas Veerman of instruction and change some branches to use PC-relative
452018a5822eSThomas Veerman addressing mode.  */
452118a5822eSThomas Veerman   BFD_RELOC_M68HC11_RL_JUMP,
452218a5822eSThomas Veerman 
452318a5822eSThomas Veerman /* Motorola 68HC11 reloc.
452418a5822eSThomas Veerman This reloc marks a group of several instructions that gcc generates
452518a5822eSThomas Veerman and for which the linker relaxation pass can modify and/or remove
452618a5822eSThomas Veerman some of them.  */
452718a5822eSThomas Veerman   BFD_RELOC_M68HC11_RL_GROUP,
452818a5822eSThomas Veerman 
452918a5822eSThomas Veerman /* Motorola 68HC11 reloc.
453018a5822eSThomas Veerman This is the 16-bit lower part of an address.  It is used for 'call'
453118a5822eSThomas Veerman instruction to specify the symbol address without any special
453218a5822eSThomas Veerman transformation (due to memory bank window).  */
453318a5822eSThomas Veerman   BFD_RELOC_M68HC11_LO16,
453418a5822eSThomas Veerman 
453518a5822eSThomas Veerman /* Motorola 68HC11 reloc.
453618a5822eSThomas Veerman This is a 8-bit reloc that specifies the page number of an address.
453718a5822eSThomas Veerman It is used by 'call' instruction to specify the page number of
453818a5822eSThomas Veerman the symbol.  */
453918a5822eSThomas Veerman   BFD_RELOC_M68HC11_PAGE,
454018a5822eSThomas Veerman 
454118a5822eSThomas Veerman /* Motorola 68HC11 reloc.
454218a5822eSThomas Veerman This is a 24-bit reloc that represents the address with a 16-bit
454318a5822eSThomas Veerman value and a 8-bit page number.  The symbol address is transformed
454418a5822eSThomas Veerman to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
454518a5822eSThomas Veerman   BFD_RELOC_M68HC11_24,
454618a5822eSThomas Veerman 
454718a5822eSThomas Veerman /* Motorola 68HC12 reloc.
454818a5822eSThomas Veerman This is the 5 bits of a value.  */
454918a5822eSThomas Veerman   BFD_RELOC_M68HC12_5B,
455018a5822eSThomas Veerman 
4551c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4552c9ea9e7aSLionel Sambuc This reloc marks the beginning of a bra/jal instruction.  */
4553c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_RL_JUMP,
4554c9ea9e7aSLionel Sambuc 
4555c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4556c9ea9e7aSLionel Sambuc This reloc marks a group of several instructions that gcc generates
4557c9ea9e7aSLionel Sambuc and for which the linker relaxation pass can modify and/or remove
4558c9ea9e7aSLionel Sambuc some of them.  */
4559c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_RL_GROUP,
4560c9ea9e7aSLionel Sambuc 
4561c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4562c9ea9e7aSLionel Sambuc This is the 16-bit lower part of an address.  It is used for the '16-bit'
4563c9ea9e7aSLionel Sambuc instructions.  */
4564c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_LO16,
4565c9ea9e7aSLionel Sambuc 
4566c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.  */
4567c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_GPAGE,
4568c9ea9e7aSLionel Sambuc 
4569c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.  */
4570c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_24,
4571c9ea9e7aSLionel Sambuc 
4572c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4573c9ea9e7aSLionel Sambuc This is a 9-bit pc-relative reloc.  */
4574c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_PCREL_9,
4575c9ea9e7aSLionel Sambuc 
4576c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4577c9ea9e7aSLionel Sambuc This is a 10-bit pc-relative reloc.  */
4578c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_PCREL_10,
4579c9ea9e7aSLionel Sambuc 
4580c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4581c9ea9e7aSLionel Sambuc This is the 16-bit lower part of an address.  It is used for the '16-bit'
4582c9ea9e7aSLionel Sambuc instructions.  */
4583c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM8_LO,
4584c9ea9e7aSLionel Sambuc 
4585c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4586c9ea9e7aSLionel Sambuc This is the 16-bit higher part of an address.  It is used for the '16-bit'
4587c9ea9e7aSLionel Sambuc instructions.  */
4588c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM8_HI,
4589c9ea9e7aSLionel Sambuc 
4590c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4591c9ea9e7aSLionel Sambuc This is a 3-bit pc-relative reloc.  */
4592c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM3,
4593c9ea9e7aSLionel Sambuc 
4594c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4595c9ea9e7aSLionel Sambuc This is a 4-bit pc-relative reloc.  */
4596c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM4,
4597c9ea9e7aSLionel Sambuc 
4598c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4599c9ea9e7aSLionel Sambuc This is a 5-bit pc-relative reloc.  */
4600c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM5,
4601c9ea9e7aSLionel Sambuc 
4602c9ea9e7aSLionel Sambuc /* Motorola 68HC12 reloc.
4603c9ea9e7aSLionel Sambuc This is the 9 bits of a value.  */
4604c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_9B,
4605c9ea9e7aSLionel Sambuc 
4606c9ea9e7aSLionel Sambuc /* Motorola 68HC12 reloc.
4607c9ea9e7aSLionel Sambuc This is the 16 bits of a value.  */
4608c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_16B,
4609c9ea9e7aSLionel Sambuc 
4610c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4611c9ea9e7aSLionel Sambuc This is a PCREL9 branch.  */
4612c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_9_PCREL,
4613c9ea9e7aSLionel Sambuc 
4614c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4615c9ea9e7aSLionel Sambuc This is a PCREL10 branch.  */
4616c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_10_PCREL,
4617c9ea9e7aSLionel Sambuc 
4618c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4619c9ea9e7aSLionel Sambuc This is the 8 bit low part of an absolute address and immediately precedes
4620c9ea9e7aSLionel Sambuc a matching HI8XG part.  */
4621c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_LO8XG,
4622c9ea9e7aSLionel Sambuc 
4623c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4624c9ea9e7aSLionel Sambuc This is the 8 bit high part of an absolute address and immediately follows
4625c9ea9e7aSLionel Sambuc a matching LO8XG part.  */
4626c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_HI8XG,
4627c9ea9e7aSLionel Sambuc 
462818a5822eSThomas Veerman /* NS CR16C Relocations.  */
462918a5822eSThomas Veerman   BFD_RELOC_16C_NUM08,
463018a5822eSThomas Veerman   BFD_RELOC_16C_NUM08_C,
463118a5822eSThomas Veerman   BFD_RELOC_16C_NUM16,
463218a5822eSThomas Veerman   BFD_RELOC_16C_NUM16_C,
463318a5822eSThomas Veerman   BFD_RELOC_16C_NUM32,
463418a5822eSThomas Veerman   BFD_RELOC_16C_NUM32_C,
463518a5822eSThomas Veerman   BFD_RELOC_16C_DISP04,
463618a5822eSThomas Veerman   BFD_RELOC_16C_DISP04_C,
463718a5822eSThomas Veerman   BFD_RELOC_16C_DISP08,
463818a5822eSThomas Veerman   BFD_RELOC_16C_DISP08_C,
463918a5822eSThomas Veerman   BFD_RELOC_16C_DISP16,
464018a5822eSThomas Veerman   BFD_RELOC_16C_DISP16_C,
464118a5822eSThomas Veerman   BFD_RELOC_16C_DISP24,
464218a5822eSThomas Veerman   BFD_RELOC_16C_DISP24_C,
464318a5822eSThomas Veerman   BFD_RELOC_16C_DISP24a,
464418a5822eSThomas Veerman   BFD_RELOC_16C_DISP24a_C,
464518a5822eSThomas Veerman   BFD_RELOC_16C_REG04,
464618a5822eSThomas Veerman   BFD_RELOC_16C_REG04_C,
464718a5822eSThomas Veerman   BFD_RELOC_16C_REG04a,
464818a5822eSThomas Veerman   BFD_RELOC_16C_REG04a_C,
464918a5822eSThomas Veerman   BFD_RELOC_16C_REG14,
465018a5822eSThomas Veerman   BFD_RELOC_16C_REG14_C,
465118a5822eSThomas Veerman   BFD_RELOC_16C_REG16,
465218a5822eSThomas Veerman   BFD_RELOC_16C_REG16_C,
465318a5822eSThomas Veerman   BFD_RELOC_16C_REG20,
465418a5822eSThomas Veerman   BFD_RELOC_16C_REG20_C,
465518a5822eSThomas Veerman   BFD_RELOC_16C_ABS20,
465618a5822eSThomas Veerman   BFD_RELOC_16C_ABS20_C,
465718a5822eSThomas Veerman   BFD_RELOC_16C_ABS24,
465818a5822eSThomas Veerman   BFD_RELOC_16C_ABS24_C,
465918a5822eSThomas Veerman   BFD_RELOC_16C_IMM04,
466018a5822eSThomas Veerman   BFD_RELOC_16C_IMM04_C,
466118a5822eSThomas Veerman   BFD_RELOC_16C_IMM16,
466218a5822eSThomas Veerman   BFD_RELOC_16C_IMM16_C,
466318a5822eSThomas Veerman   BFD_RELOC_16C_IMM20,
466418a5822eSThomas Veerman   BFD_RELOC_16C_IMM20_C,
466518a5822eSThomas Veerman   BFD_RELOC_16C_IMM24,
466618a5822eSThomas Veerman   BFD_RELOC_16C_IMM24_C,
466718a5822eSThomas Veerman   BFD_RELOC_16C_IMM32,
466818a5822eSThomas Veerman   BFD_RELOC_16C_IMM32_C,
466918a5822eSThomas Veerman 
467018a5822eSThomas Veerman /* NS CR16 Relocations.  */
467118a5822eSThomas Veerman   BFD_RELOC_CR16_NUM8,
467218a5822eSThomas Veerman   BFD_RELOC_CR16_NUM16,
467318a5822eSThomas Veerman   BFD_RELOC_CR16_NUM32,
467418a5822eSThomas Veerman   BFD_RELOC_CR16_NUM32a,
467518a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL0,
467618a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL4,
467718a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL4a,
467818a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL14,
467918a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL14a,
468018a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL16,
468118a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL20,
468218a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL20a,
468318a5822eSThomas Veerman   BFD_RELOC_CR16_ABS20,
468418a5822eSThomas Veerman   BFD_RELOC_CR16_ABS24,
468518a5822eSThomas Veerman   BFD_RELOC_CR16_IMM4,
468618a5822eSThomas Veerman   BFD_RELOC_CR16_IMM8,
468718a5822eSThomas Veerman   BFD_RELOC_CR16_IMM16,
468818a5822eSThomas Veerman   BFD_RELOC_CR16_IMM20,
468918a5822eSThomas Veerman   BFD_RELOC_CR16_IMM24,
469018a5822eSThomas Veerman   BFD_RELOC_CR16_IMM32,
469118a5822eSThomas Veerman   BFD_RELOC_CR16_IMM32a,
469218a5822eSThomas Veerman   BFD_RELOC_CR16_DISP4,
469318a5822eSThomas Veerman   BFD_RELOC_CR16_DISP8,
469418a5822eSThomas Veerman   BFD_RELOC_CR16_DISP16,
469518a5822eSThomas Veerman   BFD_RELOC_CR16_DISP20,
469618a5822eSThomas Veerman   BFD_RELOC_CR16_DISP24,
469718a5822eSThomas Veerman   BFD_RELOC_CR16_DISP24a,
469818a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH8,
469918a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH16,
470018a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH32,
470118a5822eSThomas Veerman   BFD_RELOC_CR16_GOT_REGREL20,
470218a5822eSThomas Veerman   BFD_RELOC_CR16_GOTC_REGREL20,
470318a5822eSThomas Veerman   BFD_RELOC_CR16_GLOB_DAT,
470418a5822eSThomas Veerman 
470518a5822eSThomas Veerman /* NS CRX Relocations.  */
470618a5822eSThomas Veerman   BFD_RELOC_CRX_REL4,
470718a5822eSThomas Veerman   BFD_RELOC_CRX_REL8,
470818a5822eSThomas Veerman   BFD_RELOC_CRX_REL8_CMP,
470918a5822eSThomas Veerman   BFD_RELOC_CRX_REL16,
471018a5822eSThomas Veerman   BFD_RELOC_CRX_REL24,
471118a5822eSThomas Veerman   BFD_RELOC_CRX_REL32,
471218a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL12,
471318a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL22,
471418a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL28,
471518a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL32,
471618a5822eSThomas Veerman   BFD_RELOC_CRX_ABS16,
471718a5822eSThomas Veerman   BFD_RELOC_CRX_ABS32,
471818a5822eSThomas Veerman   BFD_RELOC_CRX_NUM8,
471918a5822eSThomas Veerman   BFD_RELOC_CRX_NUM16,
472018a5822eSThomas Veerman   BFD_RELOC_CRX_NUM32,
472118a5822eSThomas Veerman   BFD_RELOC_CRX_IMM16,
472218a5822eSThomas Veerman   BFD_RELOC_CRX_IMM32,
472318a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH8,
472418a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH16,
472518a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH32,
472618a5822eSThomas Veerman 
472718a5822eSThomas Veerman /* These relocs are only used within the CRIS assembler.  They are not
472818a5822eSThomas Veerman (at present) written to any object files.  */
472918a5822eSThomas Veerman   BFD_RELOC_CRIS_BDISP8,
473018a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_5,
473118a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_6,
473218a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_6,
473318a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_8,
473418a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_8,
473518a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_16,
473618a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_16,
473718a5822eSThomas Veerman   BFD_RELOC_CRIS_LAPCQ_OFFSET,
473818a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_4,
473918a5822eSThomas Veerman 
474018a5822eSThomas Veerman /* Relocs used in ELF shared libraries for CRIS.  */
474118a5822eSThomas Veerman   BFD_RELOC_CRIS_COPY,
474218a5822eSThomas Veerman   BFD_RELOC_CRIS_GLOB_DAT,
474318a5822eSThomas Veerman   BFD_RELOC_CRIS_JUMP_SLOT,
474418a5822eSThomas Veerman   BFD_RELOC_CRIS_RELATIVE,
474518a5822eSThomas Veerman 
474618a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT.  */
474718a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT,
474818a5822eSThomas Veerman 
474918a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT.  */
475018a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT,
475118a5822eSThomas Veerman 
475218a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
475318a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOTPLT,
475418a5822eSThomas Veerman 
475518a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
475618a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOTPLT,
475718a5822eSThomas Veerman 
475818a5822eSThomas Veerman /* 32-bit offset to symbol, relative to GOT.  */
475918a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOTREL,
476018a5822eSThomas Veerman 
476118a5822eSThomas Veerman /* 32-bit offset to symbol with PLT entry, relative to GOT.  */
476218a5822eSThomas Veerman   BFD_RELOC_CRIS_32_PLT_GOTREL,
476318a5822eSThomas Veerman 
476418a5822eSThomas Veerman /* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
476518a5822eSThomas Veerman   BFD_RELOC_CRIS_32_PLT_PCREL,
476618a5822eSThomas Veerman 
476718a5822eSThomas Veerman /* Relocs used in TLS code for CRIS.  */
476818a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT_GD,
476918a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT_GD,
477018a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GD,
477118a5822eSThomas Veerman   BFD_RELOC_CRIS_DTP,
477218a5822eSThomas Veerman   BFD_RELOC_CRIS_32_DTPREL,
477318a5822eSThomas Veerman   BFD_RELOC_CRIS_16_DTPREL,
477418a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT_TPREL,
477518a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT_TPREL,
477618a5822eSThomas Veerman   BFD_RELOC_CRIS_32_TPREL,
477718a5822eSThomas Veerman   BFD_RELOC_CRIS_16_TPREL,
477818a5822eSThomas Veerman   BFD_RELOC_CRIS_DTPMOD,
477918a5822eSThomas Veerman   BFD_RELOC_CRIS_32_IE,
478018a5822eSThomas Veerman 
478118a5822eSThomas Veerman /* Intel i860 Relocations.  */
478218a5822eSThomas Veerman   BFD_RELOC_860_COPY,
478318a5822eSThomas Veerman   BFD_RELOC_860_GLOB_DAT,
478418a5822eSThomas Veerman   BFD_RELOC_860_JUMP_SLOT,
478518a5822eSThomas Veerman   BFD_RELOC_860_RELATIVE,
478618a5822eSThomas Veerman   BFD_RELOC_860_PC26,
478718a5822eSThomas Veerman   BFD_RELOC_860_PLT26,
478818a5822eSThomas Veerman   BFD_RELOC_860_PC16,
478918a5822eSThomas Veerman   BFD_RELOC_860_LOW0,
479018a5822eSThomas Veerman   BFD_RELOC_860_SPLIT0,
479118a5822eSThomas Veerman   BFD_RELOC_860_LOW1,
479218a5822eSThomas Veerman   BFD_RELOC_860_SPLIT1,
479318a5822eSThomas Veerman   BFD_RELOC_860_LOW2,
479418a5822eSThomas Veerman   BFD_RELOC_860_SPLIT2,
479518a5822eSThomas Veerman   BFD_RELOC_860_LOW3,
479618a5822eSThomas Veerman   BFD_RELOC_860_LOGOT0,
479718a5822eSThomas Veerman   BFD_RELOC_860_SPGOT0,
479818a5822eSThomas Veerman   BFD_RELOC_860_LOGOT1,
479918a5822eSThomas Veerman   BFD_RELOC_860_SPGOT1,
480018a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF0,
480118a5822eSThomas Veerman   BFD_RELOC_860_SPGOTOFF0,
480218a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF1,
480318a5822eSThomas Veerman   BFD_RELOC_860_SPGOTOFF1,
480418a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF2,
480518a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF3,
480618a5822eSThomas Veerman   BFD_RELOC_860_LOPC,
480718a5822eSThomas Veerman   BFD_RELOC_860_HIGHADJ,
480818a5822eSThomas Veerman   BFD_RELOC_860_HAGOT,
480918a5822eSThomas Veerman   BFD_RELOC_860_HAGOTOFF,
481018a5822eSThomas Veerman   BFD_RELOC_860_HAPC,
481118a5822eSThomas Veerman   BFD_RELOC_860_HIGH,
481218a5822eSThomas Veerman   BFD_RELOC_860_HIGOT,
481318a5822eSThomas Veerman   BFD_RELOC_860_HIGOTOFF,
481418a5822eSThomas Veerman 
4815*0a6a1f1dSLionel Sambuc /* OpenRISC 1000 Relocations.  */
4816*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_REL_26,
4817*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GOTPC_HI16,
4818*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GOTPC_LO16,
4819*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GOT16,
4820*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_PLT26,
4821*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GOTOFF_HI16,
4822*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GOTOFF_LO16,
4823*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_COPY,
4824*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_GLOB_DAT,
4825*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_JMP_SLOT,
4826*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_RELATIVE,
4827*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_GD_HI16,
4828*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_GD_LO16,
4829*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LDM_HI16,
4830*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LDM_LO16,
4831*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LDO_HI16,
4832*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LDO_LO16,
4833*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_IE_HI16,
4834*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_IE_LO16,
4835*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LE_HI16,
4836*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_LE_LO16,
4837*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_TPOFF,
4838*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_DTPOFF,
4839*0a6a1f1dSLionel Sambuc   BFD_RELOC_OR1K_TLS_DTPMOD,
4840*0a6a1f1dSLionel Sambuc 
4841*0a6a1f1dSLionel Sambuc /* RISC-V relocations.  */
4842*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_HI20,
4843*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_PCREL_HI20,
4844*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_PCREL_LO12_I,
4845*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_PCREL_LO12_S,
4846*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_LO12_I,
4847*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_LO12_S,
4848*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_GPREL12_I,
4849*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_GPREL12_S,
4850*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TPREL_HI20,
4851*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TPREL_LO12_I,
4852*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TPREL_LO12_S,
4853*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TPREL_ADD,
4854*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_CALL,
4855*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_CALL_PLT,
4856*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_ADD8,
4857*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_ADD16,
4858*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_ADD32,
4859*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_ADD64,
4860*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_SUB8,
4861*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_SUB16,
4862*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_SUB32,
4863*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_SUB64,
4864*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_GOT_HI20,
4865*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_GOT_HI20,
4866*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_GD_HI20,
4867*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_JMP,
4868*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_DTPMOD32,
4869*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_DTPREL32,
4870*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_DTPMOD64,
4871*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_DTPREL64,
4872*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_TPREL32,
4873*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_TLS_TPREL64,
4874*0a6a1f1dSLionel Sambuc   BFD_RELOC_RISCV_ALIGN,
487518a5822eSThomas Veerman 
487618a5822eSThomas Veerman /* H8 elf Relocations.  */
487718a5822eSThomas Veerman   BFD_RELOC_H8_DIR16A8,
487818a5822eSThomas Veerman   BFD_RELOC_H8_DIR16R8,
487918a5822eSThomas Veerman   BFD_RELOC_H8_DIR24A8,
488018a5822eSThomas Veerman   BFD_RELOC_H8_DIR24R8,
488118a5822eSThomas Veerman   BFD_RELOC_H8_DIR32A16,
488218a5822eSThomas Veerman 
488318a5822eSThomas Veerman /* Sony Xstormy16 Relocations.  */
488418a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_REL_12,
488518a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_12,
488618a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_24,
488718a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_FPTR16,
488818a5822eSThomas Veerman 
488918a5822eSThomas Veerman /* Self-describing complex relocations.  */
489018a5822eSThomas Veerman   BFD_RELOC_RELC,
489118a5822eSThomas Veerman 
489218a5822eSThomas Veerman 
489318a5822eSThomas Veerman /* Infineon Relocations.  */
489418a5822eSThomas Veerman   BFD_RELOC_XC16X_PAG,
489518a5822eSThomas Veerman   BFD_RELOC_XC16X_POF,
489618a5822eSThomas Veerman   BFD_RELOC_XC16X_SEG,
489718a5822eSThomas Veerman   BFD_RELOC_XC16X_SOF,
489818a5822eSThomas Veerman 
489918a5822eSThomas Veerman /* Relocations used by VAX ELF.  */
490018a5822eSThomas Veerman   BFD_RELOC_VAX_GLOB_DAT,
490118a5822eSThomas Veerman   BFD_RELOC_VAX_JMP_SLOT,
490218a5822eSThomas Veerman   BFD_RELOC_VAX_RELATIVE,
490318a5822eSThomas Veerman 
490418a5822eSThomas Veerman /* Morpho MT - 16 bit immediate relocation.  */
490518a5822eSThomas Veerman   BFD_RELOC_MT_PC16,
490618a5822eSThomas Veerman 
490718a5822eSThomas Veerman /* Morpho MT - Hi 16 bits of an address.  */
490818a5822eSThomas Veerman   BFD_RELOC_MT_HI16,
490918a5822eSThomas Veerman 
491018a5822eSThomas Veerman /* Morpho MT - Low 16 bits of an address.  */
491118a5822eSThomas Veerman   BFD_RELOC_MT_LO16,
491218a5822eSThomas Veerman 
491318a5822eSThomas Veerman /* Morpho MT - Used to tell the linker which vtable entries are used.  */
491418a5822eSThomas Veerman   BFD_RELOC_MT_GNU_VTINHERIT,
491518a5822eSThomas Veerman 
491618a5822eSThomas Veerman /* Morpho MT - Used to tell the linker which vtable entries are used.  */
491718a5822eSThomas Veerman   BFD_RELOC_MT_GNU_VTENTRY,
491818a5822eSThomas Veerman 
491918a5822eSThomas Veerman /* Morpho MT - 8 bit immediate relocation.  */
492018a5822eSThomas Veerman   BFD_RELOC_MT_PCINSN8,
492118a5822eSThomas Veerman 
492218a5822eSThomas Veerman /* msp430 specific relocation codes  */
492318a5822eSThomas Veerman   BFD_RELOC_MSP430_10_PCREL,
492418a5822eSThomas Veerman   BFD_RELOC_MSP430_16_PCREL,
492518a5822eSThomas Veerman   BFD_RELOC_MSP430_16,
492618a5822eSThomas Veerman   BFD_RELOC_MSP430_16_PCREL_BYTE,
492718a5822eSThomas Veerman   BFD_RELOC_MSP430_16_BYTE,
492818a5822eSThomas Veerman   BFD_RELOC_MSP430_2X_PCREL,
492918a5822eSThomas Veerman   BFD_RELOC_MSP430_RL_PCREL,
493018a5822eSThomas Veerman 
493118a5822eSThomas Veerman /* IQ2000 Relocations.  */
493218a5822eSThomas Veerman   BFD_RELOC_IQ2000_OFFSET_16,
493318a5822eSThomas Veerman   BFD_RELOC_IQ2000_OFFSET_21,
493418a5822eSThomas Veerman   BFD_RELOC_IQ2000_UHI16,
493518a5822eSThomas Veerman 
493618a5822eSThomas Veerman /* Special Xtensa relocation used only by PLT entries in ELF shared
493718a5822eSThomas Veerman objects to indicate that the runtime linker should set the value
493818a5822eSThomas Veerman to one of its own internal functions or data structures.  */
493918a5822eSThomas Veerman   BFD_RELOC_XTENSA_RTLD,
494018a5822eSThomas Veerman 
494118a5822eSThomas Veerman /* Xtensa relocations for ELF shared objects.  */
494218a5822eSThomas Veerman   BFD_RELOC_XTENSA_GLOB_DAT,
494318a5822eSThomas Veerman   BFD_RELOC_XTENSA_JMP_SLOT,
494418a5822eSThomas Veerman   BFD_RELOC_XTENSA_RELATIVE,
494518a5822eSThomas Veerman 
494618a5822eSThomas Veerman /* Xtensa relocation used in ELF object files for symbols that may require
494718a5822eSThomas Veerman PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
494818a5822eSThomas Veerman   BFD_RELOC_XTENSA_PLT,
494918a5822eSThomas Veerman 
495018a5822eSThomas Veerman /* Xtensa relocations to mark the difference of two local symbols.
495118a5822eSThomas Veerman These are only needed to support linker relaxation and can be ignored
495218a5822eSThomas Veerman when not relaxing.  The field is set to the value of the difference
495318a5822eSThomas Veerman assuming no relaxation.  The relocation encodes the position of the
495418a5822eSThomas Veerman first symbol so the linker can determine whether to adjust the field
495518a5822eSThomas Veerman value.  */
495618a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF8,
495718a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF16,
495818a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF32,
495918a5822eSThomas Veerman 
496018a5822eSThomas Veerman /* Generic Xtensa relocations for instruction operands.  Only the slot
496118a5822eSThomas Veerman number is encoded in the relocation.  The relocation applies to the
496218a5822eSThomas Veerman last PC-relative immediate operand, or if there are no PC-relative
496318a5822eSThomas Veerman immediates, to the last immediate operand.  */
496418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT0_OP,
496518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT1_OP,
496618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT2_OP,
496718a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT3_OP,
496818a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT4_OP,
496918a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT5_OP,
497018a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT6_OP,
497118a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT7_OP,
497218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT8_OP,
497318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT9_OP,
497418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT10_OP,
497518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT11_OP,
497618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT12_OP,
497718a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT13_OP,
497818a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT14_OP,
497918a5822eSThomas Veerman 
498018a5822eSThomas Veerman /* Alternate Xtensa relocations.  Only the slot is encoded in the
498118a5822eSThomas Veerman relocation.  The meaning of these relocations is opcode-specific.  */
498218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT0_ALT,
498318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT1_ALT,
498418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT2_ALT,
498518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT3_ALT,
498618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT4_ALT,
498718a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT5_ALT,
498818a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT6_ALT,
498918a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT7_ALT,
499018a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT8_ALT,
499118a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT9_ALT,
499218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT10_ALT,
499318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT11_ALT,
499418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT12_ALT,
499518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT13_ALT,
499618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT14_ALT,
499718a5822eSThomas Veerman 
499818a5822eSThomas Veerman /* Xtensa relocations for backward compatibility.  These have all been
499918a5822eSThomas Veerman replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
500018a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP0,
500118a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP1,
500218a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP2,
500318a5822eSThomas Veerman 
500418a5822eSThomas Veerman /* Xtensa relocation to mark that the assembler expanded the
500518a5822eSThomas Veerman instructions from an original target.  The expansion size is
500618a5822eSThomas Veerman encoded in the reloc size.  */
500718a5822eSThomas Veerman   BFD_RELOC_XTENSA_ASM_EXPAND,
500818a5822eSThomas Veerman 
500918a5822eSThomas Veerman /* Xtensa relocation to mark that the linker should simplify
501018a5822eSThomas Veerman assembler-expanded instructions.  This is commonly used
501118a5822eSThomas Veerman internally by the linker after analysis of a
501218a5822eSThomas Veerman BFD_RELOC_XTENSA_ASM_EXPAND.  */
501318a5822eSThomas Veerman   BFD_RELOC_XTENSA_ASM_SIMPLIFY,
501418a5822eSThomas Veerman 
501518a5822eSThomas Veerman /* Xtensa TLS relocations.  */
501618a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLSDESC_FN,
501718a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLSDESC_ARG,
501818a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_DTPOFF,
501918a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_TPOFF,
502018a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_FUNC,
502118a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_ARG,
502218a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_CALL,
502318a5822eSThomas Veerman 
502418a5822eSThomas Veerman /* 8 bit signed offset in (ix+d) or (iy+d).  */
502518a5822eSThomas Veerman   BFD_RELOC_Z80_DISP8,
502618a5822eSThomas Veerman 
502718a5822eSThomas Veerman /* DJNZ offset.  */
502818a5822eSThomas Veerman   BFD_RELOC_Z8K_DISP7,
502918a5822eSThomas Veerman 
503018a5822eSThomas Veerman /* CALR offset.  */
503118a5822eSThomas Veerman   BFD_RELOC_Z8K_CALLR,
503218a5822eSThomas Veerman 
503318a5822eSThomas Veerman /* 4 bit value.  */
503418a5822eSThomas Veerman   BFD_RELOC_Z8K_IMM4L,
503518a5822eSThomas Veerman 
503618a5822eSThomas Veerman /* Lattice Mico32 relocations.  */
503718a5822eSThomas Veerman   BFD_RELOC_LM32_CALL,
503818a5822eSThomas Veerman   BFD_RELOC_LM32_BRANCH,
503918a5822eSThomas Veerman   BFD_RELOC_LM32_16_GOT,
504018a5822eSThomas Veerman   BFD_RELOC_LM32_GOTOFF_HI16,
504118a5822eSThomas Veerman   BFD_RELOC_LM32_GOTOFF_LO16,
504218a5822eSThomas Veerman   BFD_RELOC_LM32_COPY,
504318a5822eSThomas Veerman   BFD_RELOC_LM32_GLOB_DAT,
504418a5822eSThomas Veerman   BFD_RELOC_LM32_JMP_SLOT,
504518a5822eSThomas Veerman   BFD_RELOC_LM32_RELATIVE,
504618a5822eSThomas Veerman 
504718a5822eSThomas Veerman /* Difference between two section addreses.  Must be followed by a
504818a5822eSThomas Veerman BFD_RELOC_MACH_O_PAIR.  */
504918a5822eSThomas Veerman   BFD_RELOC_MACH_O_SECTDIFF,
505018a5822eSThomas Veerman 
5051c9ea9e7aSLionel Sambuc /* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol.  */
5052c9ea9e7aSLionel Sambuc   BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
5053c9ea9e7aSLionel Sambuc 
505418a5822eSThomas Veerman /* Pair of relocation.  Contains the first symbol.  */
505518a5822eSThomas Veerman   BFD_RELOC_MACH_O_PAIR,
505618a5822eSThomas Veerman 
505718a5822eSThomas Veerman /* PCREL relocations.  They are marked as branch to create PLT entry if
505818a5822eSThomas Veerman required.  */
505918a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_BRANCH32,
506018a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_BRANCH8,
506118a5822eSThomas Veerman 
506218a5822eSThomas Veerman /* Used when referencing a GOT entry.  */
506318a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_GOT,
506418a5822eSThomas Veerman 
506518a5822eSThomas Veerman /* Used when loading a GOT entry with movq.  It is specially marked so that
506618a5822eSThomas Veerman the linker could optimize the movq to a leaq if possible.  */
506718a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
506818a5822eSThomas Veerman 
506918a5822eSThomas Veerman /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
507018a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
507118a5822eSThomas Veerman 
507218a5822eSThomas Veerman /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
507318a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64,
507418a5822eSThomas Veerman 
507518a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend.  */
507618a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_1,
507718a5822eSThomas Veerman 
507818a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend.  */
507918a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_2,
508018a5822eSThomas Veerman 
508118a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend.  */
508218a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_4,
508318a5822eSThomas Veerman 
508418a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores the
508518a5822eSThomas Veerman low 16 bits of a value  */
508618a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_LO,
508718a5822eSThomas Veerman 
508818a5822eSThomas Veerman /* This is a 32 bit pc-relative reloc for the microblaze that
508918a5822eSThomas Veerman stores the low 16 bits of a value  */
509018a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_LO_PCREL,
509118a5822eSThomas Veerman 
509218a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores a
509318a5822eSThomas Veerman value relative to the read-only small data area anchor  */
509418a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_ROSDA,
509518a5822eSThomas Veerman 
509618a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores a
509718a5822eSThomas Veerman value relative to the read-write small data area anchor  */
509818a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_RWSDA,
509918a5822eSThomas Veerman 
510018a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze to handle
510118a5822eSThomas Veerman expressions of the form "Symbol Op Symbol"  */
510218a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
510318a5822eSThomas Veerman 
510418a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
510518a5822eSThomas Veerman value in two words (with an imm instruction).  No relocation is
510618a5822eSThomas Veerman done here - only used for relaxing  */
510718a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_NONE,
510818a5822eSThomas Veerman 
510918a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
511018a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
511118a5822eSThomas Veerman PC-relative GOT offset  */
511218a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOTPC,
511318a5822eSThomas Veerman 
511418a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
511518a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
511618a5822eSThomas Veerman GOT offset  */
511718a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOT,
511818a5822eSThomas Veerman 
511918a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
512018a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
512118a5822eSThomas Veerman PC-relative offset into PLT  */
512218a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_PLT,
512318a5822eSThomas Veerman 
512418a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit GOT relative
512518a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
512618a5822eSThomas Veerman relative offset from _GLOBAL_OFFSET_TABLE_  */
512718a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOTOFF,
512818a5822eSThomas Veerman 
512918a5822eSThomas Veerman /* This is a 32 bit reloc that stores the 32 bit GOT relative
513018a5822eSThomas Veerman value in a word.  The relocation is relative offset from  */
513118a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_GOTOFF,
513218a5822eSThomas Veerman 
513318a5822eSThomas Veerman /* This is used to tell the dynamic linker to copy the value out of
513418a5822eSThomas Veerman the dynamic object into the runtime process image.  */
513518a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_COPY,
5136c9ea9e7aSLionel Sambuc 
5137c9ea9e7aSLionel Sambuc /* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
5138c9ea9e7aSLionel Sambuc Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5139c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADD_LO12,
5140c9ea9e7aSLionel Sambuc 
5141c9ea9e7aSLionel Sambuc /* Get to the page base of the global offset table entry for a symbol as
5142c9ea9e7aSLionel Sambuc part of an ADRP instruction using a 21 bit PC relative value.Used in
5143c9ea9e7aSLionel Sambuc conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC.  */
5144c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_GOT_PAGE,
5145c9ea9e7aSLionel Sambuc 
5146c9ea9e7aSLionel Sambuc /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5147c9ea9e7aSLionel Sambuc offset, giving a 4KB aligned page base address.  */
5148c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_HI21_PCREL,
5149c9ea9e7aSLionel Sambuc 
5150c9ea9e7aSLionel Sambuc /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5151c9ea9e7aSLionel Sambuc offset, giving a 4KB aligned page base address, but with no overflow
5152c9ea9e7aSLionel Sambuc checking.  */
5153c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
5154c9ea9e7aSLionel Sambuc 
5155c9ea9e7aSLionel Sambuc /* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset.  */
5156c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_LO21_PCREL,
5157c9ea9e7aSLionel Sambuc 
5158c9ea9e7aSLionel Sambuc /* AArch64 19 bit pc-relative conditional branch and compare & branch.
5159c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5160c9ea9e7aSLionel Sambuc giving a 21 bit signed byte offset.  */
5161c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_BRANCH19,
5162c9ea9e7aSLionel Sambuc 
5163c9ea9e7aSLionel Sambuc /* AArch64 26 bit pc-relative unconditional branch and link.
5164c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5165c9ea9e7aSLionel Sambuc giving a 28 bit signed byte offset.  */
5166c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_CALL26,
5167c9ea9e7aSLionel Sambuc 
5168c9ea9e7aSLionel Sambuc /* AArch64 pseudo relocation code to be used internally by the AArch64
5169c9ea9e7aSLionel Sambuc assembler and not (currently) written to any object files.  */
5170c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
5171c9ea9e7aSLionel Sambuc 
5172c9ea9e7aSLionel Sambuc /* AArch64 26 bit pc-relative unconditional branch.
5173c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5174c9ea9e7aSLionel Sambuc giving a 28 bit signed byte offset.  */
5175c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_JUMP26,
5176c9ea9e7aSLionel Sambuc 
5177c9ea9e7aSLionel Sambuc /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
5178c9ea9e7aSLionel Sambuc offset.  The lowest two bits must be zero and are not stored in the
5179c9ea9e7aSLionel Sambuc instruction, giving a 21 bit signed byte offset.  */
5180c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LD_LO19_PCREL,
5181c9ea9e7aSLionel Sambuc 
5182c9ea9e7aSLionel Sambuc /* Unsigned 12 bit byte offset for 64 bit load/store from the page of
5183c9ea9e7aSLionel Sambuc the GOT entry for this symbol.  Used in conjunction with
5184c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_ADR_GOTPAGE.  */
5185c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
5186c9ea9e7aSLionel Sambuc 
5187c9ea9e7aSLionel Sambuc /* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
5188c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5189c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST_LO12,
5190c9ea9e7aSLionel Sambuc 
5191c9ea9e7aSLionel Sambuc /* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
5192c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5193c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST8_LO12,
5194c9ea9e7aSLionel Sambuc 
5195c9ea9e7aSLionel Sambuc /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
5196c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5197c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST16_LO12,
5198c9ea9e7aSLionel Sambuc 
5199c9ea9e7aSLionel Sambuc /* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
5200c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5201c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST32_LO12,
5202c9ea9e7aSLionel Sambuc 
5203c9ea9e7aSLionel Sambuc /* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
5204c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5205c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST64_LO12,
5206c9ea9e7aSLionel Sambuc 
5207c9ea9e7aSLionel Sambuc /* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
5208c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5209c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST128_LO12,
5210c9ea9e7aSLionel Sambuc 
5211c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5212c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5213c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0,
5214c9ea9e7aSLionel Sambuc 
5215c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5216c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5217c9ea9e7aSLionel Sambuc value's sign.  */
5218c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0_S,
5219c9ea9e7aSLionel Sambuc 
5220c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5221c9ea9e7aSLionel Sambuc an address/value.  No overflow checking.  */
5222c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0_NC,
5223c9ea9e7aSLionel Sambuc 
5224c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5225c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5226c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1,
5227c9ea9e7aSLionel Sambuc 
5228c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5229c9ea9e7aSLionel Sambuc of an address/value.  No overflow checking.  */
5230c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1_NC,
5231c9ea9e7aSLionel Sambuc 
5232c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
5233c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5234c9ea9e7aSLionel Sambuc value's sign.  */
5235c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1_S,
5236c9ea9e7aSLionel Sambuc 
5237c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5238c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5239c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2,
5240c9ea9e7aSLionel Sambuc 
5241c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5242c9ea9e7aSLionel Sambuc of an address/value.  No overflow checking.  */
5243c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2_NC,
5244c9ea9e7aSLionel Sambuc 
5245c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
5246c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5247c9ea9e7aSLionel Sambuc value's sign.  */
5248c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2_S,
5249c9ea9e7aSLionel Sambuc 
5250c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5251c9ea9e7aSLionel Sambuc of a signed or unsigned address/value.  */
5252c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G3,
5253c9ea9e7aSLionel Sambuc 
5254c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5255c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC,
5256c9ea9e7aSLionel Sambuc 
5257c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5258c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADD,
5259c9ea9e7aSLionel Sambuc 
5260c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5261c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC,
5262c9ea9e7aSLionel Sambuc 
5263c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5264c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE,
5265c9ea9e7aSLionel Sambuc 
5266c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5267c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
5268c9ea9e7aSLionel Sambuc 
5269c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5270c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_CALL,
5271c9ea9e7aSLionel Sambuc 
5272c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5273c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC,
5274c9ea9e7aSLionel Sambuc 
5275c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5276c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19,
5277c9ea9e7aSLionel Sambuc 
5278c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5279c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LDR,
5280c9ea9e7aSLionel Sambuc 
5281c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5282c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
5283c9ea9e7aSLionel Sambuc 
5284c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5285c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
5286c9ea9e7aSLionel Sambuc 
5287c9ea9e7aSLionel Sambuc /* Unsigned 12 bit byte offset to global offset table entry for a symbols
5288c9ea9e7aSLionel Sambuc tls_index structure.  Used in conjunction with
5289c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
5290c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
5291c9ea9e7aSLionel Sambuc 
5292c9ea9e7aSLionel Sambuc /* Get to the page base of the global offset table entry for a symbols
5293c9ea9e7aSLionel Sambuc tls_index structure as part of an adrp instruction using a 21 bit PC
5294c9ea9e7aSLionel Sambuc relative value.  Used in conjunction with
5295c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC.  */
5296c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
5297c9ea9e7aSLionel Sambuc 
5298c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5299c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
5300c9ea9e7aSLionel Sambuc 
5301c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5302c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
5303c9ea9e7aSLionel Sambuc 
5304c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5305c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
5306c9ea9e7aSLionel Sambuc 
5307c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5308c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
5309c9ea9e7aSLionel Sambuc 
5310c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5311c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
5312c9ea9e7aSLionel Sambuc 
5313c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5314c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
5315c9ea9e7aSLionel Sambuc 
5316c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5317c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
5318c9ea9e7aSLionel Sambuc 
5319c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5320c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
5321c9ea9e7aSLionel Sambuc 
5322c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5323c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
5324c9ea9e7aSLionel Sambuc 
5325c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5326c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
5327c9ea9e7aSLionel Sambuc 
5328c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5329c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
5330c9ea9e7aSLionel Sambuc 
5331c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5332c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
5333c9ea9e7aSLionel Sambuc 
5334c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5335c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
5336c9ea9e7aSLionel Sambuc 
5337c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5338c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_DTPMOD64,
5339c9ea9e7aSLionel Sambuc 
5340c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5341c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_DTPREL64,
5342c9ea9e7aSLionel Sambuc 
5343c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5344c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_TPREL64,
5345c9ea9e7aSLionel Sambuc 
5346c9ea9e7aSLionel Sambuc /* AArch64 14 bit pc-relative test bit and branch.
5347c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5348c9ea9e7aSLionel Sambuc giving a 16 bit signed byte offset.  */
5349c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TSTBR14,
5350c9ea9e7aSLionel Sambuc 
5351c9ea9e7aSLionel Sambuc /* Tilera TILEPro Relocations.  */
5352c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_COPY,
5353c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_GLOB_DAT,
5354c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JMP_SLOT,
5355c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_RELATIVE,
5356c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_BROFF_X1,
5357c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JOFFLONG_X1,
5358c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
5359c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X0,
5360c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y0,
5361c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X1,
5362c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y1,
5363c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_DEST_IMM8_X1,
5364c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MT_IMM15_X1,
5365c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MF_IMM15_X1,
5366c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0,
5367c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1,
5368c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_LO,
5369c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_LO,
5370c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HI,
5371c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HI,
5372c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HA,
5373c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HA,
5374c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
5375c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
5376c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
5377c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
5378c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
5379c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
5380c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
5381c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
5382c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT,
5383c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT,
5384c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
5385c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
5386c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
5387c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
5388c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
5389c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
5390c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMSTART_X0,
5391c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMEND_X0,
5392c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMSTART_X1,
5393c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMEND_X1,
5394c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_X0,
5395c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_X1,
5396c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_Y0,
5397c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_Y1,
5398c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_GD_CALL,
5399c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
5400c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
5401c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
5402c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
5403c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_IE_LOAD,
5404c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
5405c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
5406c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
5407c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
5408c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
5409c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
5410c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
5411c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
5412c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
5413c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
5414c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
5415c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
5416c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
5417c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
5418c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
5419c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
5420c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_DTPMOD32,
5421c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_DTPOFF32,
5422c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_TPOFF32,
5423c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
5424c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
5425c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
5426c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
5427c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
5428c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
5429c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
5430c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
5431c9ea9e7aSLionel Sambuc 
5432c9ea9e7aSLionel Sambuc /* Tilera TILE-Gx Relocations.  */
5433c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW0,
5434c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW1,
5435c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW2,
5436c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW3,
5437c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW0_LAST,
5438c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW1_LAST,
5439c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW2_LAST,
5440c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_COPY,
5441c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_GLOB_DAT,
5442c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JMP_SLOT,
5443c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_RELATIVE,
5444c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_BROFF_X1,
5445c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JUMPOFF_X1,
5446c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
5447c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0,
5448c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0,
5449c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1,
5450c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1,
5451c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_DEST_IMM8_X1,
5452c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MT_IMM14_X1,
5453c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MF_IMM14_X1,
5454c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MMSTART_X0,
5455c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MMEND_X0,
5456c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_X0,
5457c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_X1,
5458c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_Y0,
5459c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_Y1,
5460c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0,
5461c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0,
5462c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1,
5463c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1,
5464c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2,
5465c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2,
5466c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW3,
5467c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW3,
5468c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
5469c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
5470c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
5471c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
5472c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
5473c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
5474c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
5475c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
5476c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
5477c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
5478c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
5479c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
5480c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
5481c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
5482c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
5483c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
5484c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
5485c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
5486c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
5487c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
5488c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
5489c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
5490c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
5491c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
5492c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
5493c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
5494c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
5495c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
5496c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
5497c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
5498c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
5499c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
5500c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
5501c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
5502c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
5503c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
5504c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
5505c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
5506c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
5507c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
5508c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
5509c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
5510c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
5511c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
5512c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPMOD64,
5513c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPOFF64,
5514c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_TPOFF64,
5515c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPMOD32,
5516c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPOFF32,
5517c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_TPOFF32,
5518c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_GD_CALL,
5519c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
5520c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
5521c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
5522c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
5523c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_IE_LOAD,
5524c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
5525c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
5526c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
5527c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
5528c9ea9e7aSLionel Sambuc 
5529c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement  */
5530c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM8,
5531c9ea9e7aSLionel Sambuc 
5532c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 24 bit signed pc-relative displacement  */
5533c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM24,
5534c9ea9e7aSLionel Sambuc 
5535c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 16 most-significant bits of absolute address  */
5536c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_HIGH,
5537c9ea9e7aSLionel Sambuc 
5538c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 16 least-significant bits of absolute address  */
5539c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_LOW,
5540c9ea9e7aSLionel Sambuc 
5541c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate  */
5542c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM11,
5543c9ea9e7aSLionel Sambuc 
5544c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement)  */
5545c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_IMM11,
5546c9ea9e7aSLionel Sambuc 
5547c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction.  */
5548c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_IMM8,
554918a5822eSThomas Veerman   BFD_RELOC_UNUSED };
555018a5822eSThomas Veerman typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
555118a5822eSThomas Veerman reloc_howto_type *bfd_reloc_type_lookup
555218a5822eSThomas Veerman    (bfd *abfd, bfd_reloc_code_real_type code);
555318a5822eSThomas Veerman reloc_howto_type *bfd_reloc_name_lookup
555418a5822eSThomas Veerman    (bfd *abfd, const char *reloc_name);
555518a5822eSThomas Veerman 
555618a5822eSThomas Veerman const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
555718a5822eSThomas Veerman 
555818a5822eSThomas Veerman /* Extracted from syms.c.  */
555918a5822eSThomas Veerman 
556018a5822eSThomas Veerman typedef struct bfd_symbol
556118a5822eSThomas Veerman {
556218a5822eSThomas Veerman   /* A pointer to the BFD which owns the symbol. This information
556318a5822eSThomas Veerman      is necessary so that a back end can work out what additional
556418a5822eSThomas Veerman      information (invisible to the application writer) is carried
556518a5822eSThomas Veerman      with the symbol.
556618a5822eSThomas Veerman 
556718a5822eSThomas Veerman      This field is *almost* redundant, since you can use section->owner
556818a5822eSThomas Veerman      instead, except that some symbols point to the global sections
556918a5822eSThomas Veerman      bfd_{abs,com,und}_section.  This could be fixed by making
557018a5822eSThomas Veerman      these globals be per-bfd (or per-target-flavor).  FIXME.  */
557118a5822eSThomas Veerman   struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
557218a5822eSThomas Veerman 
557318a5822eSThomas Veerman   /* The text of the symbol. The name is left alone, and not copied; the
557418a5822eSThomas Veerman      application may not alter it.  */
557518a5822eSThomas Veerman   const char *name;
557618a5822eSThomas Veerman 
557718a5822eSThomas Veerman   /* The value of the symbol.  This really should be a union of a
557818a5822eSThomas Veerman      numeric value with a pointer, since some flags indicate that
557918a5822eSThomas Veerman      a pointer to another symbol is stored here.  */
558018a5822eSThomas Veerman   symvalue value;
558118a5822eSThomas Veerman 
558218a5822eSThomas Veerman   /* Attributes of a symbol.  */
558318a5822eSThomas Veerman #define BSF_NO_FLAGS           0x00
558418a5822eSThomas Veerman 
558518a5822eSThomas Veerman   /* The symbol has local scope; <<static>> in <<C>>. The value
558618a5822eSThomas Veerman      is the offset into the section of the data.  */
558718a5822eSThomas Veerman #define BSF_LOCAL              (1 << 0)
558818a5822eSThomas Veerman 
558918a5822eSThomas Veerman   /* The symbol has global scope; initialized data in <<C>>. The
559018a5822eSThomas Veerman      value is the offset into the section of the data.  */
559118a5822eSThomas Veerman #define BSF_GLOBAL             (1 << 1)
559218a5822eSThomas Veerman 
559318a5822eSThomas Veerman   /* The symbol has global scope and is exported. The value is
559418a5822eSThomas Veerman      the offset into the section of the data.  */
559518a5822eSThomas Veerman #define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
559618a5822eSThomas Veerman 
559718a5822eSThomas Veerman   /* A normal C symbol would be one of:
559818a5822eSThomas Veerman      <<BSF_LOCAL>>, <<BSF_COMMON>>,  <<BSF_UNDEFINED>> or
559918a5822eSThomas Veerman      <<BSF_GLOBAL>>.  */
560018a5822eSThomas Veerman 
560118a5822eSThomas Veerman   /* The symbol is a debugging record. The value has an arbitrary
560218a5822eSThomas Veerman      meaning, unless BSF_DEBUGGING_RELOC is also set.  */
560318a5822eSThomas Veerman #define BSF_DEBUGGING          (1 << 2)
560418a5822eSThomas Veerman 
560518a5822eSThomas Veerman   /* The symbol denotes a function entry point.  Used in ELF,
560618a5822eSThomas Veerman      perhaps others someday.  */
560718a5822eSThomas Veerman #define BSF_FUNCTION           (1 << 3)
560818a5822eSThomas Veerman 
560918a5822eSThomas Veerman   /* Used by the linker.  */
561018a5822eSThomas Veerman #define BSF_KEEP               (1 << 5)
561118a5822eSThomas Veerman #define BSF_KEEP_G             (1 << 6)
561218a5822eSThomas Veerman 
561318a5822eSThomas Veerman   /* A weak global symbol, overridable without warnings by
561418a5822eSThomas Veerman      a regular global symbol of the same name.  */
561518a5822eSThomas Veerman #define BSF_WEAK               (1 << 7)
561618a5822eSThomas Veerman 
561718a5822eSThomas Veerman   /* This symbol was created to point to a section, e.g. ELF's
561818a5822eSThomas Veerman      STT_SECTION symbols.  */
561918a5822eSThomas Veerman #define BSF_SECTION_SYM        (1 << 8)
562018a5822eSThomas Veerman 
562118a5822eSThomas Veerman   /* The symbol used to be a common symbol, but now it is
562218a5822eSThomas Veerman      allocated.  */
562318a5822eSThomas Veerman #define BSF_OLD_COMMON         (1 << 9)
562418a5822eSThomas Veerman 
562518a5822eSThomas Veerman   /* In some files the type of a symbol sometimes alters its
562618a5822eSThomas Veerman      location in an output file - ie in coff a <<ISFCN>> symbol
562718a5822eSThomas Veerman      which is also <<C_EXT>> symbol appears where it was
562818a5822eSThomas Veerman      declared and not at the end of a section.  This bit is set
562918a5822eSThomas Veerman      by the target BFD part to convey this information.  */
563018a5822eSThomas Veerman #define BSF_NOT_AT_END         (1 << 10)
563118a5822eSThomas Veerman 
563218a5822eSThomas Veerman   /* Signal that the symbol is the label of constructor section.  */
563318a5822eSThomas Veerman #define BSF_CONSTRUCTOR        (1 << 11)
563418a5822eSThomas Veerman 
563518a5822eSThomas Veerman   /* Signal that the symbol is a warning symbol.  The name is a
563618a5822eSThomas Veerman      warning.  The name of the next symbol is the one to warn about;
563718a5822eSThomas Veerman      if a reference is made to a symbol with the same name as the next
563818a5822eSThomas Veerman      symbol, a warning is issued by the linker.  */
563918a5822eSThomas Veerman #define BSF_WARNING            (1 << 12)
564018a5822eSThomas Veerman 
564118a5822eSThomas Veerman   /* Signal that the symbol is indirect.  This symbol is an indirect
564218a5822eSThomas Veerman      pointer to the symbol with the same name as the next symbol.  */
564318a5822eSThomas Veerman #define BSF_INDIRECT           (1 << 13)
564418a5822eSThomas Veerman 
564518a5822eSThomas Veerman   /* BSF_FILE marks symbols that contain a file name.  This is used
564618a5822eSThomas Veerman      for ELF STT_FILE symbols.  */
564718a5822eSThomas Veerman #define BSF_FILE               (1 << 14)
564818a5822eSThomas Veerman 
564918a5822eSThomas Veerman   /* Symbol is from dynamic linking information.  */
565018a5822eSThomas Veerman #define BSF_DYNAMIC            (1 << 15)
565118a5822eSThomas Veerman 
565218a5822eSThomas Veerman   /* The symbol denotes a data object.  Used in ELF, and perhaps
565318a5822eSThomas Veerman      others someday.  */
565418a5822eSThomas Veerman #define BSF_OBJECT             (1 << 16)
565518a5822eSThomas Veerman 
565618a5822eSThomas Veerman   /* This symbol is a debugging symbol.  The value is the offset
565718a5822eSThomas Veerman      into the section of the data.  BSF_DEBUGGING should be set
565818a5822eSThomas Veerman      as well.  */
565918a5822eSThomas Veerman #define BSF_DEBUGGING_RELOC    (1 << 17)
566018a5822eSThomas Veerman 
566118a5822eSThomas Veerman   /* This symbol is thread local.  Used in ELF.  */
566218a5822eSThomas Veerman #define BSF_THREAD_LOCAL       (1 << 18)
566318a5822eSThomas Veerman 
566418a5822eSThomas Veerman   /* This symbol represents a complex relocation expression,
566518a5822eSThomas Veerman      with the expression tree serialized in the symbol name.  */
566618a5822eSThomas Veerman #define BSF_RELC               (1 << 19)
566718a5822eSThomas Veerman 
566818a5822eSThomas Veerman   /* This symbol represents a signed complex relocation expression,
566918a5822eSThomas Veerman      with the expression tree serialized in the symbol name.  */
567018a5822eSThomas Veerman #define BSF_SRELC              (1 << 20)
567118a5822eSThomas Veerman 
567218a5822eSThomas Veerman   /* This symbol was created by bfd_get_synthetic_symtab.  */
567318a5822eSThomas Veerman #define BSF_SYNTHETIC          (1 << 21)
567418a5822eSThomas Veerman 
567518a5822eSThomas Veerman   /* This symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
567618a5822eSThomas Veerman      The dynamic linker will compute the value of this symbol by
567718a5822eSThomas Veerman      calling the function that it points to.  BSF_FUNCTION must
567818a5822eSThomas Veerman      also be also set.  */
567918a5822eSThomas Veerman #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
568018a5822eSThomas Veerman   /* This symbol is a globally unique data object.  The dynamic linker
568118a5822eSThomas Veerman      will make sure that in the entire process there is just one symbol
568218a5822eSThomas Veerman      with this name and type in use.  BSF_OBJECT must also be set.  */
568318a5822eSThomas Veerman #define BSF_GNU_UNIQUE         (1 << 23)
568418a5822eSThomas Veerman 
568518a5822eSThomas Veerman   flagword flags;
568618a5822eSThomas Veerman 
568718a5822eSThomas Veerman   /* A pointer to the section to which this symbol is
568818a5822eSThomas Veerman      relative.  This will always be non NULL, there are special
568918a5822eSThomas Veerman      sections for undefined and absolute symbols.  */
569018a5822eSThomas Veerman   struct bfd_section *section;
569118a5822eSThomas Veerman 
569218a5822eSThomas Veerman   /* Back end special data.  */
569318a5822eSThomas Veerman   union
569418a5822eSThomas Veerman     {
569518a5822eSThomas Veerman       void *p;
569618a5822eSThomas Veerman       bfd_vma i;
569718a5822eSThomas Veerman     }
569818a5822eSThomas Veerman   udata;
569918a5822eSThomas Veerman }
570018a5822eSThomas Veerman asymbol;
570118a5822eSThomas Veerman 
570218a5822eSThomas Veerman #define bfd_get_symtab_upper_bound(abfd) \
570318a5822eSThomas Veerman      BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
570418a5822eSThomas Veerman 
570518a5822eSThomas Veerman bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
570618a5822eSThomas Veerman 
570718a5822eSThomas Veerman bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
570818a5822eSThomas Veerman 
570918a5822eSThomas Veerman #define bfd_is_local_label_name(abfd, name) \
571018a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
571118a5822eSThomas Veerman 
571218a5822eSThomas Veerman bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
571318a5822eSThomas Veerman 
571418a5822eSThomas Veerman #define bfd_is_target_special_symbol(abfd, sym) \
571518a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
571618a5822eSThomas Veerman 
571718a5822eSThomas Veerman #define bfd_canonicalize_symtab(abfd, location) \
571818a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
571918a5822eSThomas Veerman 
572018a5822eSThomas Veerman bfd_boolean bfd_set_symtab
572118a5822eSThomas Veerman    (bfd *abfd, asymbol **location, unsigned int count);
572218a5822eSThomas Veerman 
572318a5822eSThomas Veerman void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
572418a5822eSThomas Veerman 
572518a5822eSThomas Veerman #define bfd_make_empty_symbol(abfd) \
572618a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
572718a5822eSThomas Veerman 
572818a5822eSThomas Veerman asymbol *_bfd_generic_make_empty_symbol (bfd *);
572918a5822eSThomas Veerman 
573018a5822eSThomas Veerman #define bfd_make_debug_symbol(abfd,ptr,size) \
573118a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
573218a5822eSThomas Veerman 
573318a5822eSThomas Veerman int bfd_decode_symclass (asymbol *symbol);
573418a5822eSThomas Veerman 
573518a5822eSThomas Veerman bfd_boolean bfd_is_undefined_symclass (int symclass);
573618a5822eSThomas Veerman 
573718a5822eSThomas Veerman void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
573818a5822eSThomas Veerman 
573918a5822eSThomas Veerman bfd_boolean bfd_copy_private_symbol_data
574018a5822eSThomas Veerman    (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
574118a5822eSThomas Veerman 
574218a5822eSThomas Veerman #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
574318a5822eSThomas Veerman   BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
574418a5822eSThomas Veerman             (ibfd, isymbol, obfd, osymbol))
574518a5822eSThomas Veerman 
574618a5822eSThomas Veerman /* Extracted from bfd.c.  */
574718a5822eSThomas Veerman enum bfd_direction
574818a5822eSThomas Veerman   {
574918a5822eSThomas Veerman     no_direction = 0,
575018a5822eSThomas Veerman     read_direction = 1,
575118a5822eSThomas Veerman     write_direction = 2,
575218a5822eSThomas Veerman     both_direction = 3
575318a5822eSThomas Veerman   };
575418a5822eSThomas Veerman 
575518a5822eSThomas Veerman struct bfd
575618a5822eSThomas Veerman {
575718a5822eSThomas Veerman   /* A unique identifier of the BFD  */
575818a5822eSThomas Veerman   unsigned int id;
575918a5822eSThomas Veerman 
576018a5822eSThomas Veerman   /* The filename the application opened the BFD with.  */
576118a5822eSThomas Veerman   const char *filename;
576218a5822eSThomas Veerman 
576318a5822eSThomas Veerman   /* A pointer to the target jump table.  */
576418a5822eSThomas Veerman   const struct bfd_target *xvec;
576518a5822eSThomas Veerman 
576618a5822eSThomas Veerman   /* The IOSTREAM, and corresponding IO vector that provide access
576718a5822eSThomas Veerman      to the file backing the BFD.  */
576818a5822eSThomas Veerman   void *iostream;
576918a5822eSThomas Veerman   const struct bfd_iovec *iovec;
577018a5822eSThomas Veerman 
577118a5822eSThomas Veerman   /* The caching routines use these to maintain a
577218a5822eSThomas Veerman      least-recently-used list of BFDs.  */
577318a5822eSThomas Veerman   struct bfd *lru_prev, *lru_next;
577418a5822eSThomas Veerman 
577518a5822eSThomas Veerman   /* When a file is closed by the caching routines, BFD retains
577618a5822eSThomas Veerman      state information on the file here...  */
577718a5822eSThomas Veerman   ufile_ptr where;
577818a5822eSThomas Veerman 
577918a5822eSThomas Veerman   /* File modified time, if mtime_set is TRUE.  */
578018a5822eSThomas Veerman   long mtime;
578118a5822eSThomas Veerman 
578218a5822eSThomas Veerman   /* Reserved for an unimplemented file locking extension.  */
578318a5822eSThomas Veerman   int ifd;
578418a5822eSThomas Veerman 
578518a5822eSThomas Veerman   /* The format which belongs to the BFD. (object, core, etc.)  */
578618a5822eSThomas Veerman   bfd_format format;
578718a5822eSThomas Veerman 
578818a5822eSThomas Veerman   /* The direction with which the BFD was opened.  */
578918a5822eSThomas Veerman   enum bfd_direction direction;
579018a5822eSThomas Veerman 
579118a5822eSThomas Veerman   /* Format_specific flags.  */
579218a5822eSThomas Veerman   flagword flags;
579318a5822eSThomas Veerman 
579418a5822eSThomas Veerman   /* Values that may appear in the flags field of a BFD.  These also
579518a5822eSThomas Veerman      appear in the object_flags field of the bfd_target structure, where
579618a5822eSThomas Veerman      they indicate the set of flags used by that backend (not all flags
579718a5822eSThomas Veerman      are meaningful for all object file formats) (FIXME: at the moment,
579818a5822eSThomas Veerman      the object_flags values have mostly just been copied from backend
579918a5822eSThomas Veerman      to another, and are not necessarily correct).  */
580018a5822eSThomas Veerman 
580118a5822eSThomas Veerman #define BFD_NO_FLAGS   0x00
580218a5822eSThomas Veerman 
580318a5822eSThomas Veerman   /* BFD contains relocation entries.  */
580418a5822eSThomas Veerman #define HAS_RELOC      0x01
580518a5822eSThomas Veerman 
580618a5822eSThomas Veerman   /* BFD is directly executable.  */
580718a5822eSThomas Veerman #define EXEC_P         0x02
580818a5822eSThomas Veerman 
580918a5822eSThomas Veerman   /* BFD has line number information (basically used for F_LNNO in a
581018a5822eSThomas Veerman      COFF header).  */
581118a5822eSThomas Veerman #define HAS_LINENO     0x04
581218a5822eSThomas Veerman 
581318a5822eSThomas Veerman   /* BFD has debugging information.  */
581418a5822eSThomas Veerman #define HAS_DEBUG      0x08
581518a5822eSThomas Veerman 
581618a5822eSThomas Veerman   /* BFD has symbols.  */
581718a5822eSThomas Veerman #define HAS_SYMS       0x10
581818a5822eSThomas Veerman 
581918a5822eSThomas Veerman   /* BFD has local symbols (basically used for F_LSYMS in a COFF
582018a5822eSThomas Veerman      header).  */
582118a5822eSThomas Veerman #define HAS_LOCALS     0x20
582218a5822eSThomas Veerman 
582318a5822eSThomas Veerman   /* BFD is a dynamic object.  */
582418a5822eSThomas Veerman #define DYNAMIC        0x40
582518a5822eSThomas Veerman 
582618a5822eSThomas Veerman   /* Text section is write protected (if D_PAGED is not set, this is
582718a5822eSThomas Veerman      like an a.out NMAGIC file) (the linker sets this by default, but
582818a5822eSThomas Veerman      clears it for -r or -N).  */
582918a5822eSThomas Veerman #define WP_TEXT        0x80
583018a5822eSThomas Veerman 
583118a5822eSThomas Veerman   /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
583218a5822eSThomas Veerman      linker sets this by default, but clears it for -r or -n or -N).  */
583318a5822eSThomas Veerman #define D_PAGED        0x100
583418a5822eSThomas Veerman 
583518a5822eSThomas Veerman   /* BFD is relaxable (this means that bfd_relax_section may be able to
583618a5822eSThomas Veerman      do something) (sometimes bfd_relax_section can do something even if
583718a5822eSThomas Veerman      this is not set).  */
583818a5822eSThomas Veerman #define BFD_IS_RELAXABLE 0x200
583918a5822eSThomas Veerman 
584018a5822eSThomas Veerman   /* This may be set before writing out a BFD to request using a
584118a5822eSThomas Veerman      traditional format.  For example, this is used to request that when
584218a5822eSThomas Veerman      writing out an a.out object the symbols not be hashed to eliminate
584318a5822eSThomas Veerman      duplicates.  */
584418a5822eSThomas Veerman #define BFD_TRADITIONAL_FORMAT 0x400
584518a5822eSThomas Veerman 
584618a5822eSThomas Veerman   /* This flag indicates that the BFD contents are actually cached
584718a5822eSThomas Veerman      in memory.  If this is set, iostream points to a bfd_in_memory
584818a5822eSThomas Veerman      struct.  */
584918a5822eSThomas Veerman #define BFD_IN_MEMORY 0x800
585018a5822eSThomas Veerman 
585118a5822eSThomas Veerman   /* The sections in this BFD specify a memory page.  */
585218a5822eSThomas Veerman #define HAS_LOAD_PAGE 0x1000
585318a5822eSThomas Veerman 
585418a5822eSThomas Veerman   /* This BFD has been created by the linker and doesn't correspond
585518a5822eSThomas Veerman      to any input file.  */
585618a5822eSThomas Veerman #define BFD_LINKER_CREATED 0x2000
585718a5822eSThomas Veerman   /* This may be set before writing out a BFD to request that it
585818a5822eSThomas Veerman   be written using values for UIDs, GIDs, timestamps, etc. that
585918a5822eSThomas Veerman   will be consistent from run to run.  */
586018a5822eSThomas Veerman #define BFD_DETERMINISTIC_OUTPUT 0x4000
586118a5822eSThomas Veerman 
586218a5822eSThomas Veerman 
586318a5822eSThomas Veerman   /* This may be set before writing out a BFD to request that it
586418a5822eSThomas Veerman      be written using values for UIDs, GIDs, timestamps, etc. that
586518a5822eSThomas Veerman      will be consistent from run to run.  */
586618a5822eSThomas Veerman #define BFD_DETERMINISTIC_OUTPUT 0x4000
586718a5822eSThomas Veerman 
586818a5822eSThomas Veerman   /* Compress sections in this BFD.  */
586918a5822eSThomas Veerman #define BFD_COMPRESS 0x8000
587018a5822eSThomas Veerman 
587118a5822eSThomas Veerman   /* Decompress sections in this BFD.  */
587218a5822eSThomas Veerman #define BFD_DECOMPRESS 0x10000
587318a5822eSThomas Veerman 
587418a5822eSThomas Veerman   /* BFD is a dummy, for plugins.  */
587518a5822eSThomas Veerman #define BFD_PLUGIN 0x20000
587618a5822eSThomas Veerman 
587718a5822eSThomas Veerman   /* Flags bits to be saved in bfd_preserve_save.  */
587818a5822eSThomas Veerman #define BFD_FLAGS_SAVED \
587918a5822eSThomas Veerman   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN)
588018a5822eSThomas Veerman 
588118a5822eSThomas Veerman   /* Flags bits which are for BFD use only.  */
588218a5822eSThomas Veerman #define BFD_FLAGS_FOR_BFD_USE_MASK \
588318a5822eSThomas Veerman   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
588418a5822eSThomas Veerman    | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT)
588518a5822eSThomas Veerman 
588618a5822eSThomas Veerman   /* Currently my_archive is tested before adding origin to
588718a5822eSThomas Veerman      anything. I believe that this can become always an add of
588818a5822eSThomas Veerman      origin, with origin set to 0 for non archive files.  */
588918a5822eSThomas Veerman   ufile_ptr origin;
589018a5822eSThomas Veerman 
589118a5822eSThomas Veerman   /* The origin in the archive of the proxy entry.  This will
589218a5822eSThomas Veerman      normally be the same as origin, except for thin archives,
589318a5822eSThomas Veerman      when it will contain the current offset of the proxy in the
589418a5822eSThomas Veerman      thin archive rather than the offset of the bfd in its actual
589518a5822eSThomas Veerman      container.  */
589618a5822eSThomas Veerman   ufile_ptr proxy_origin;
589718a5822eSThomas Veerman 
589818a5822eSThomas Veerman   /* A hash table for section names.  */
589918a5822eSThomas Veerman   struct bfd_hash_table section_htab;
590018a5822eSThomas Veerman 
590118a5822eSThomas Veerman   /* Pointer to linked list of sections.  */
590218a5822eSThomas Veerman   struct bfd_section *sections;
590318a5822eSThomas Veerman 
590418a5822eSThomas Veerman   /* The last section on the section list.  */
590518a5822eSThomas Veerman   struct bfd_section *section_last;
590618a5822eSThomas Veerman 
590718a5822eSThomas Veerman   /* The number of sections.  */
590818a5822eSThomas Veerman   unsigned int section_count;
590918a5822eSThomas Veerman 
591018a5822eSThomas Veerman   /* Stuff only useful for object files:
591118a5822eSThomas Veerman      The start address.  */
591218a5822eSThomas Veerman   bfd_vma start_address;
591318a5822eSThomas Veerman 
591418a5822eSThomas Veerman   /* Used for input and output.  */
591518a5822eSThomas Veerman   unsigned int symcount;
591618a5822eSThomas Veerman 
591718a5822eSThomas Veerman   /* Symbol table for output BFD (with symcount entries).
591818a5822eSThomas Veerman      Also used by the linker to cache input BFD symbols.  */
591918a5822eSThomas Veerman   struct bfd_symbol  **outsymbols;
592018a5822eSThomas Veerman 
592118a5822eSThomas Veerman   /* Used for slurped dynamic symbol tables.  */
592218a5822eSThomas Veerman   unsigned int dynsymcount;
592318a5822eSThomas Veerman 
592418a5822eSThomas Veerman   /* Pointer to structure which contains architecture information.  */
592518a5822eSThomas Veerman   const struct bfd_arch_info *arch_info;
592618a5822eSThomas Veerman 
592718a5822eSThomas Veerman   /* Stuff only useful for archives.  */
592818a5822eSThomas Veerman   void *arelt_data;
592918a5822eSThomas Veerman   struct bfd *my_archive;      /* The containing archive BFD.  */
593018a5822eSThomas Veerman   struct bfd *archive_next;    /* The next BFD in the archive.  */
593118a5822eSThomas Veerman   struct bfd *archive_head;    /* The first BFD in the archive.  */
593218a5822eSThomas Veerman   struct bfd *nested_archives; /* List of nested archive in a flattened
593318a5822eSThomas Veerman                                   thin archive.  */
593418a5822eSThomas Veerman 
593518a5822eSThomas Veerman   /* A chain of BFD structures involved in a link.  */
593618a5822eSThomas Veerman   struct bfd *link_next;
593718a5822eSThomas Veerman 
593818a5822eSThomas Veerman   /* A field used by _bfd_generic_link_add_archive_symbols.  This will
593918a5822eSThomas Veerman      be used only for archive elements.  */
594018a5822eSThomas Veerman   int archive_pass;
594118a5822eSThomas Veerman 
594218a5822eSThomas Veerman   /* Used by the back end to hold private data.  */
594318a5822eSThomas Veerman   union
594418a5822eSThomas Veerman     {
594518a5822eSThomas Veerman       struct aout_data_struct *aout_data;
594618a5822eSThomas Veerman       struct artdata *aout_ar_data;
594718a5822eSThomas Veerman       struct _oasys_data *oasys_obj_data;
594818a5822eSThomas Veerman       struct _oasys_ar_data *oasys_ar_data;
594918a5822eSThomas Veerman       struct coff_tdata *coff_obj_data;
595018a5822eSThomas Veerman       struct pe_tdata *pe_obj_data;
595118a5822eSThomas Veerman       struct xcoff_tdata *xcoff_obj_data;
595218a5822eSThomas Veerman       struct ecoff_tdata *ecoff_obj_data;
595318a5822eSThomas Veerman       struct ieee_data_struct *ieee_data;
595418a5822eSThomas Veerman       struct ieee_ar_data_struct *ieee_ar_data;
595518a5822eSThomas Veerman       struct srec_data_struct *srec_data;
595618a5822eSThomas Veerman       struct verilog_data_struct *verilog_data;
595718a5822eSThomas Veerman       struct ihex_data_struct *ihex_data;
595818a5822eSThomas Veerman       struct tekhex_data_struct *tekhex_data;
595918a5822eSThomas Veerman       struct elf_obj_tdata *elf_obj_data;
596018a5822eSThomas Veerman       struct nlm_obj_tdata *nlm_obj_data;
596118a5822eSThomas Veerman       struct bout_data_struct *bout_data;
596218a5822eSThomas Veerman       struct mmo_data_struct *mmo_data;
596318a5822eSThomas Veerman       struct sun_core_struct *sun_core_data;
596418a5822eSThomas Veerman       struct sco5_core_struct *sco5_core_data;
596518a5822eSThomas Veerman       struct trad_core_struct *trad_core_data;
596618a5822eSThomas Veerman       struct som_data_struct *som_data;
596718a5822eSThomas Veerman       struct hpux_core_struct *hpux_core_data;
596818a5822eSThomas Veerman       struct hppabsd_core_struct *hppabsd_core_data;
596918a5822eSThomas Veerman       struct sgi_core_struct *sgi_core_data;
597018a5822eSThomas Veerman       struct lynx_core_struct *lynx_core_data;
597118a5822eSThomas Veerman       struct osf_core_struct *osf_core_data;
597218a5822eSThomas Veerman       struct cisco_core_struct *cisco_core_data;
597318a5822eSThomas Veerman       struct versados_data_struct *versados_data;
597418a5822eSThomas Veerman       struct netbsd_core_struct *netbsd_core_data;
597518a5822eSThomas Veerman       struct mach_o_data_struct *mach_o_data;
597618a5822eSThomas Veerman       struct mach_o_fat_data_struct *mach_o_fat_data;
597718a5822eSThomas Veerman       struct plugin_data_struct *plugin_data;
597818a5822eSThomas Veerman       struct bfd_pef_data_struct *pef_data;
597918a5822eSThomas Veerman       struct bfd_pef_xlib_data_struct *pef_xlib_data;
598018a5822eSThomas Veerman       struct bfd_sym_data_struct *sym_data;
598118a5822eSThomas Veerman       void *any;
598218a5822eSThomas Veerman     }
598318a5822eSThomas Veerman   tdata;
598418a5822eSThomas Veerman 
598518a5822eSThomas Veerman   /* Used by the application to hold private data.  */
598618a5822eSThomas Veerman   void *usrdata;
598718a5822eSThomas Veerman 
598818a5822eSThomas Veerman   /* Where all the allocated stuff under this BFD goes.  This is a
598918a5822eSThomas Veerman      struct objalloc *, but we use void * to avoid requiring the inclusion
599018a5822eSThomas Veerman      of objalloc.h.  */
599118a5822eSThomas Veerman   void *memory;
599218a5822eSThomas Veerman 
599318a5822eSThomas Veerman   /* Is the file descriptor being cached?  That is, can it be closed as
599418a5822eSThomas Veerman      needed, and re-opened when accessed later?  */
599518a5822eSThomas Veerman   unsigned int cacheable : 1;
599618a5822eSThomas Veerman 
599718a5822eSThomas Veerman   /* Marks whether there was a default target specified when the
599818a5822eSThomas Veerman      BFD was opened. This is used to select which matching algorithm
599918a5822eSThomas Veerman      to use to choose the back end.  */
600018a5822eSThomas Veerman   unsigned int target_defaulted : 1;
600118a5822eSThomas Veerman 
600218a5822eSThomas Veerman   /* ... and here: (``once'' means at least once).  */
600318a5822eSThomas Veerman   unsigned int opened_once : 1;
600418a5822eSThomas Veerman 
600518a5822eSThomas Veerman   /* Set if we have a locally maintained mtime value, rather than
600618a5822eSThomas Veerman      getting it from the file each time.  */
600718a5822eSThomas Veerman   unsigned int mtime_set : 1;
600818a5822eSThomas Veerman 
600918a5822eSThomas Veerman   /* Flag set if symbols from this BFD should not be exported.  */
601018a5822eSThomas Veerman   unsigned int no_export : 1;
601118a5822eSThomas Veerman 
601218a5822eSThomas Veerman   /* Remember when output has begun, to stop strange things
601318a5822eSThomas Veerman      from happening.  */
601418a5822eSThomas Veerman   unsigned int output_has_begun : 1;
601518a5822eSThomas Veerman 
601618a5822eSThomas Veerman   /* Have archive map.  */
601718a5822eSThomas Veerman   unsigned int has_armap : 1;
601818a5822eSThomas Veerman 
601918a5822eSThomas Veerman   /* Set if this is a thin archive.  */
602018a5822eSThomas Veerman   unsigned int is_thin_archive : 1;
602118a5822eSThomas Veerman 
602218a5822eSThomas Veerman   /* Set if only required symbols should be added in the link hash table for
602318a5822eSThomas Veerman      this object.  Used by VMS linkers.  */
602418a5822eSThomas Veerman   unsigned int selective_search : 1;
602518a5822eSThomas Veerman };
602618a5822eSThomas Veerman 
602718a5822eSThomas Veerman typedef enum bfd_error
602818a5822eSThomas Veerman {
602918a5822eSThomas Veerman   bfd_error_no_error = 0,
603018a5822eSThomas Veerman   bfd_error_system_call,
603118a5822eSThomas Veerman   bfd_error_invalid_target,
603218a5822eSThomas Veerman   bfd_error_wrong_format,
603318a5822eSThomas Veerman   bfd_error_wrong_object_format,
603418a5822eSThomas Veerman   bfd_error_invalid_operation,
603518a5822eSThomas Veerman   bfd_error_no_memory,
603618a5822eSThomas Veerman   bfd_error_no_symbols,
603718a5822eSThomas Veerman   bfd_error_no_armap,
603818a5822eSThomas Veerman   bfd_error_no_more_archived_files,
603918a5822eSThomas Veerman   bfd_error_malformed_archive,
604018a5822eSThomas Veerman   bfd_error_file_not_recognized,
604118a5822eSThomas Veerman   bfd_error_file_ambiguously_recognized,
604218a5822eSThomas Veerman   bfd_error_no_contents,
604318a5822eSThomas Veerman   bfd_error_nonrepresentable_section,
604418a5822eSThomas Veerman   bfd_error_no_debug_section,
604518a5822eSThomas Veerman   bfd_error_bad_value,
604618a5822eSThomas Veerman   bfd_error_file_truncated,
604718a5822eSThomas Veerman   bfd_error_file_too_big,
604818a5822eSThomas Veerman   bfd_error_on_input,
604918a5822eSThomas Veerman   bfd_error_invalid_error_code
605018a5822eSThomas Veerman }
605118a5822eSThomas Veerman bfd_error_type;
605218a5822eSThomas Veerman 
605318a5822eSThomas Veerman bfd_error_type bfd_get_error (void);
605418a5822eSThomas Veerman 
605518a5822eSThomas Veerman void bfd_set_error (bfd_error_type error_tag, ...);
605618a5822eSThomas Veerman 
605718a5822eSThomas Veerman const char *bfd_errmsg (bfd_error_type error_tag);
605818a5822eSThomas Veerman 
605918a5822eSThomas Veerman void bfd_perror (const char *message);
606018a5822eSThomas Veerman 
606118a5822eSThomas Veerman typedef void (*bfd_error_handler_type) (const char *, ...);
606218a5822eSThomas Veerman 
606318a5822eSThomas Veerman bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
606418a5822eSThomas Veerman 
606518a5822eSThomas Veerman void bfd_set_error_program_name (const char *);
606618a5822eSThomas Veerman 
606718a5822eSThomas Veerman bfd_error_handler_type bfd_get_error_handler (void);
606818a5822eSThomas Veerman 
6069c9ea9e7aSLionel Sambuc typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
6070c9ea9e7aSLionel Sambuc                                          const char *bfd_version,
6071c9ea9e7aSLionel Sambuc                                          const char *bfd_file,
6072c9ea9e7aSLionel Sambuc                                          int bfd_line);
6073c9ea9e7aSLionel Sambuc 
6074c9ea9e7aSLionel Sambuc bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
6075c9ea9e7aSLionel Sambuc 
6076c9ea9e7aSLionel Sambuc bfd_assert_handler_type bfd_get_assert_handler (void);
6077c9ea9e7aSLionel Sambuc 
607818a5822eSThomas Veerman long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
607918a5822eSThomas Veerman 
608018a5822eSThomas Veerman long bfd_canonicalize_reloc
608118a5822eSThomas Veerman    (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
608218a5822eSThomas Veerman 
608318a5822eSThomas Veerman void bfd_set_reloc
608418a5822eSThomas Veerman    (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
608518a5822eSThomas Veerman 
608618a5822eSThomas Veerman bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
608718a5822eSThomas Veerman 
608818a5822eSThomas Veerman int bfd_get_arch_size (bfd *abfd);
608918a5822eSThomas Veerman 
609018a5822eSThomas Veerman int bfd_get_sign_extend_vma (bfd *abfd);
609118a5822eSThomas Veerman 
609218a5822eSThomas Veerman bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
609318a5822eSThomas Veerman 
609418a5822eSThomas Veerman unsigned int bfd_get_gp_size (bfd *abfd);
609518a5822eSThomas Veerman 
609618a5822eSThomas Veerman void bfd_set_gp_size (bfd *abfd, unsigned int i);
609718a5822eSThomas Veerman 
609818a5822eSThomas Veerman bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
609918a5822eSThomas Veerman 
610018a5822eSThomas Veerman bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
610118a5822eSThomas Veerman 
610218a5822eSThomas Veerman #define bfd_copy_private_header_data(ibfd, obfd) \
610318a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_copy_private_header_data, \
610418a5822eSThomas Veerman                (ibfd, obfd))
610518a5822eSThomas Veerman bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
610618a5822eSThomas Veerman 
610718a5822eSThomas Veerman #define bfd_copy_private_bfd_data(ibfd, obfd) \
610818a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
610918a5822eSThomas Veerman                (ibfd, obfd))
611018a5822eSThomas Veerman bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
611118a5822eSThomas Veerman 
611218a5822eSThomas Veerman #define bfd_merge_private_bfd_data(ibfd, obfd) \
611318a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
611418a5822eSThomas Veerman                (ibfd, obfd))
611518a5822eSThomas Veerman bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
611618a5822eSThomas Veerman 
611718a5822eSThomas Veerman #define bfd_set_private_flags(abfd, flags) \
611818a5822eSThomas Veerman      BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
611918a5822eSThomas Veerman #define bfd_sizeof_headers(abfd, info) \
612018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
612118a5822eSThomas Veerman 
612218a5822eSThomas Veerman #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
612318a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_nearest_line, \
612418a5822eSThomas Veerman                  (abfd, sec, syms, off, file, func, line))
612518a5822eSThomas Veerman 
6126c9ea9e7aSLionel Sambuc #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
6127c9ea9e7aSLionel Sambuc                                             line, disc) \
6128c9ea9e7aSLionel Sambuc        BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \
6129c9ea9e7aSLionel Sambuc                  (abfd, sec, syms, off, file, func, line, disc))
6130c9ea9e7aSLionel Sambuc 
613118a5822eSThomas Veerman #define bfd_find_line(abfd, syms, sym, file, line) \
613218a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_line, \
613318a5822eSThomas Veerman                  (abfd, syms, sym, file, line))
613418a5822eSThomas Veerman 
613518a5822eSThomas Veerman #define bfd_find_inliner_info(abfd, file, func, line) \
613618a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_inliner_info, \
613718a5822eSThomas Veerman                  (abfd, file, func, line))
613818a5822eSThomas Veerman 
613918a5822eSThomas Veerman #define bfd_debug_info_start(abfd) \
614018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
614118a5822eSThomas Veerman 
614218a5822eSThomas Veerman #define bfd_debug_info_end(abfd) \
614318a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
614418a5822eSThomas Veerman 
614518a5822eSThomas Veerman #define bfd_debug_info_accumulate(abfd, section) \
614618a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
614718a5822eSThomas Veerman 
614818a5822eSThomas Veerman #define bfd_stat_arch_elt(abfd, stat) \
614918a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
615018a5822eSThomas Veerman 
615118a5822eSThomas Veerman #define bfd_update_armap_timestamp(abfd) \
615218a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
615318a5822eSThomas Veerman 
615418a5822eSThomas Veerman #define bfd_set_arch_mach(abfd, arch, mach)\
615518a5822eSThomas Veerman        BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
615618a5822eSThomas Veerman 
615718a5822eSThomas Veerman #define bfd_relax_section(abfd, section, link_info, again) \
615818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
615918a5822eSThomas Veerman 
616018a5822eSThomas Veerman #define bfd_gc_sections(abfd, link_info) \
616118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
616218a5822eSThomas Veerman 
6163c9ea9e7aSLionel Sambuc #define bfd_lookup_section_flags(link_info, flag_info, section) \
6164c9ea9e7aSLionel Sambuc        BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
6165c9ea9e7aSLionel Sambuc 
616618a5822eSThomas Veerman #define bfd_merge_sections(abfd, link_info) \
616718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
616818a5822eSThomas Veerman 
616918a5822eSThomas Veerman #define bfd_is_group_section(abfd, sec) \
617018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
617118a5822eSThomas Veerman 
617218a5822eSThomas Veerman #define bfd_discard_group(abfd, sec) \
617318a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
617418a5822eSThomas Veerman 
617518a5822eSThomas Veerman #define bfd_link_hash_table_create(abfd) \
617618a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
617718a5822eSThomas Veerman 
617818a5822eSThomas Veerman #define bfd_link_hash_table_free(abfd, hash) \
617918a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
618018a5822eSThomas Veerman 
618118a5822eSThomas Veerman #define bfd_link_add_symbols(abfd, info) \
618218a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
618318a5822eSThomas Veerman 
618418a5822eSThomas Veerman #define bfd_link_just_syms(abfd, sec, info) \
618518a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
618618a5822eSThomas Veerman 
618718a5822eSThomas Veerman #define bfd_final_link(abfd, info) \
618818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
618918a5822eSThomas Veerman 
619018a5822eSThomas Veerman #define bfd_free_cached_info(abfd) \
619118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
619218a5822eSThomas Veerman 
619318a5822eSThomas Veerman #define bfd_get_dynamic_symtab_upper_bound(abfd) \
619418a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
619518a5822eSThomas Veerman 
619618a5822eSThomas Veerman #define bfd_print_private_bfd_data(abfd, file)\
619718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
619818a5822eSThomas Veerman 
619918a5822eSThomas Veerman #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
620018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
620118a5822eSThomas Veerman 
620218a5822eSThomas Veerman #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
620318a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
620418a5822eSThomas Veerman                                                    dyncount, dynsyms, ret))
620518a5822eSThomas Veerman 
620618a5822eSThomas Veerman #define bfd_get_dynamic_reloc_upper_bound(abfd) \
620718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
620818a5822eSThomas Veerman 
620918a5822eSThomas Veerman #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
621018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
621118a5822eSThomas Veerman 
621218a5822eSThomas Veerman extern bfd_byte *bfd_get_relocated_section_contents
621318a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
621418a5822eSThomas Veerman    bfd_boolean, asymbol **);
621518a5822eSThomas Veerman 
621618a5822eSThomas Veerman bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
621718a5822eSThomas Veerman 
621818a5822eSThomas Veerman struct bfd_preserve
621918a5822eSThomas Veerman {
622018a5822eSThomas Veerman   void *marker;
622118a5822eSThomas Veerman   void *tdata;
622218a5822eSThomas Veerman   flagword flags;
622318a5822eSThomas Veerman   const struct bfd_arch_info *arch_info;
622418a5822eSThomas Veerman   struct bfd_section *sections;
622518a5822eSThomas Veerman   struct bfd_section *section_last;
622618a5822eSThomas Veerman   unsigned int section_count;
622718a5822eSThomas Veerman   struct bfd_hash_table section_htab;
622818a5822eSThomas Veerman };
622918a5822eSThomas Veerman 
623018a5822eSThomas Veerman bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
623118a5822eSThomas Veerman 
623218a5822eSThomas Veerman void bfd_preserve_restore (bfd *, struct bfd_preserve *);
623318a5822eSThomas Veerman 
623418a5822eSThomas Veerman void bfd_preserve_finish (bfd *, struct bfd_preserve *);
623518a5822eSThomas Veerman 
623618a5822eSThomas Veerman bfd_vma bfd_emul_get_maxpagesize (const char *);
623718a5822eSThomas Veerman 
623818a5822eSThomas Veerman void bfd_emul_set_maxpagesize (const char *, bfd_vma);
623918a5822eSThomas Veerman 
624018a5822eSThomas Veerman bfd_vma bfd_emul_get_commonpagesize (const char *);
624118a5822eSThomas Veerman 
624218a5822eSThomas Veerman void bfd_emul_set_commonpagesize (const char *, bfd_vma);
624318a5822eSThomas Veerman 
624418a5822eSThomas Veerman char *bfd_demangle (bfd *, const char *, int);
624518a5822eSThomas Veerman 
624618a5822eSThomas Veerman /* Extracted from archive.c.  */
624718a5822eSThomas Veerman symindex bfd_get_next_mapent
624818a5822eSThomas Veerman    (bfd *abfd, symindex previous, carsym **sym);
624918a5822eSThomas Veerman 
625018a5822eSThomas Veerman bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
625118a5822eSThomas Veerman 
625218a5822eSThomas Veerman bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
625318a5822eSThomas Veerman 
625418a5822eSThomas Veerman /* Extracted from corefile.c.  */
625518a5822eSThomas Veerman const char *bfd_core_file_failing_command (bfd *abfd);
625618a5822eSThomas Veerman 
625718a5822eSThomas Veerman int bfd_core_file_failing_signal (bfd *abfd);
625818a5822eSThomas Veerman 
625918a5822eSThomas Veerman int bfd_core_file_pid (bfd *abfd);
626018a5822eSThomas Veerman 
626118a5822eSThomas Veerman bfd_boolean core_file_matches_executable_p
626218a5822eSThomas Veerman    (bfd *core_bfd, bfd *exec_bfd);
626318a5822eSThomas Veerman 
626418a5822eSThomas Veerman bfd_boolean generic_core_file_matches_executable_p
626518a5822eSThomas Veerman    (bfd *core_bfd, bfd *exec_bfd);
626618a5822eSThomas Veerman 
626718a5822eSThomas Veerman /* Extracted from targets.c.  */
626818a5822eSThomas Veerman #define BFD_SEND(bfd, message, arglist) \
626918a5822eSThomas Veerman   ((*((bfd)->xvec->message)) arglist)
627018a5822eSThomas Veerman 
627118a5822eSThomas Veerman #ifdef DEBUG_BFD_SEND
627218a5822eSThomas Veerman #undef BFD_SEND
627318a5822eSThomas Veerman #define BFD_SEND(bfd, message, arglist) \
627418a5822eSThomas Veerman   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
627518a5822eSThomas Veerman     ((*((bfd)->xvec->message)) arglist) : \
627618a5822eSThomas Veerman     (bfd_assert (__FILE__,__LINE__), NULL))
627718a5822eSThomas Veerman #endif
627818a5822eSThomas Veerman #define BFD_SEND_FMT(bfd, message, arglist) \
627918a5822eSThomas Veerman   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
628018a5822eSThomas Veerman 
628118a5822eSThomas Veerman #ifdef DEBUG_BFD_SEND
628218a5822eSThomas Veerman #undef BFD_SEND_FMT
628318a5822eSThomas Veerman #define BFD_SEND_FMT(bfd, message, arglist) \
628418a5822eSThomas Veerman   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
628518a5822eSThomas Veerman    (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
628618a5822eSThomas Veerman    (bfd_assert (__FILE__,__LINE__), NULL))
628718a5822eSThomas Veerman #endif
628818a5822eSThomas Veerman 
628918a5822eSThomas Veerman enum bfd_flavour
629018a5822eSThomas Veerman {
629118a5822eSThomas Veerman   bfd_target_unknown_flavour,
629218a5822eSThomas Veerman   bfd_target_aout_flavour,
629318a5822eSThomas Veerman   bfd_target_coff_flavour,
629418a5822eSThomas Veerman   bfd_target_ecoff_flavour,
629518a5822eSThomas Veerman   bfd_target_xcoff_flavour,
629618a5822eSThomas Veerman   bfd_target_elf_flavour,
629718a5822eSThomas Veerman   bfd_target_ieee_flavour,
629818a5822eSThomas Veerman   bfd_target_nlm_flavour,
629918a5822eSThomas Veerman   bfd_target_oasys_flavour,
630018a5822eSThomas Veerman   bfd_target_tekhex_flavour,
630118a5822eSThomas Veerman   bfd_target_srec_flavour,
630218a5822eSThomas Veerman   bfd_target_verilog_flavour,
630318a5822eSThomas Veerman   bfd_target_ihex_flavour,
630418a5822eSThomas Veerman   bfd_target_som_flavour,
630518a5822eSThomas Veerman   bfd_target_os9k_flavour,
630618a5822eSThomas Veerman   bfd_target_versados_flavour,
630718a5822eSThomas Veerman   bfd_target_msdos_flavour,
630818a5822eSThomas Veerman   bfd_target_ovax_flavour,
630918a5822eSThomas Veerman   bfd_target_evax_flavour,
631018a5822eSThomas Veerman   bfd_target_mmo_flavour,
631118a5822eSThomas Veerman   bfd_target_mach_o_flavour,
631218a5822eSThomas Veerman   bfd_target_pef_flavour,
631318a5822eSThomas Veerman   bfd_target_pef_xlib_flavour,
631418a5822eSThomas Veerman   bfd_target_sym_flavour
631518a5822eSThomas Veerman };
631618a5822eSThomas Veerman 
631718a5822eSThomas Veerman enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
631818a5822eSThomas Veerman 
631918a5822eSThomas Veerman /* Forward declaration.  */
632018a5822eSThomas Veerman typedef struct bfd_link_info _bfd_link_info;
632118a5822eSThomas Veerman 
6322c9ea9e7aSLionel Sambuc /* Forward declaration.  */
6323c9ea9e7aSLionel Sambuc typedef struct flag_info flag_info;
6324c9ea9e7aSLionel Sambuc 
632518a5822eSThomas Veerman typedef struct bfd_target
632618a5822eSThomas Veerman {
632718a5822eSThomas Veerman   /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
632818a5822eSThomas Veerman   char *name;
632918a5822eSThomas Veerman 
633018a5822eSThomas Veerman  /* The "flavour" of a back end is a general indication about
633118a5822eSThomas Veerman     the contents of a file.  */
633218a5822eSThomas Veerman   enum bfd_flavour flavour;
633318a5822eSThomas Veerman 
633418a5822eSThomas Veerman   /* The order of bytes within the data area of a file.  */
633518a5822eSThomas Veerman   enum bfd_endian byteorder;
633618a5822eSThomas Veerman 
633718a5822eSThomas Veerman  /* The order of bytes within the header parts of a file.  */
633818a5822eSThomas Veerman   enum bfd_endian header_byteorder;
633918a5822eSThomas Veerman 
634018a5822eSThomas Veerman   /* A mask of all the flags which an executable may have set -
634118a5822eSThomas Veerman      from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
634218a5822eSThomas Veerman   flagword object_flags;
634318a5822eSThomas Veerman 
634418a5822eSThomas Veerman  /* A mask of all the flags which a section may have set - from
634518a5822eSThomas Veerman     the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
634618a5822eSThomas Veerman   flagword section_flags;
634718a5822eSThomas Veerman 
634818a5822eSThomas Veerman  /* The character normally found at the front of a symbol.
634918a5822eSThomas Veerman     (if any), perhaps `_'.  */
635018a5822eSThomas Veerman   char symbol_leading_char;
635118a5822eSThomas Veerman 
635218a5822eSThomas Veerman  /* The pad character for file names within an archive header.  */
635318a5822eSThomas Veerman   char ar_pad_char;
635418a5822eSThomas Veerman 
635518a5822eSThomas Veerman   /* The maximum number of characters in an archive header.  */
6356c9ea9e7aSLionel Sambuc   unsigned char ar_max_namelen;
6357c9ea9e7aSLionel Sambuc 
6358c9ea9e7aSLionel Sambuc   /* How well this target matches, used to select between various
6359c9ea9e7aSLionel Sambuc      possible targets when more than one target matches.  */
6360c9ea9e7aSLionel Sambuc   unsigned char match_priority;
636118a5822eSThomas Veerman 
636218a5822eSThomas Veerman   /* Entries for byte swapping for data. These are different from the
636318a5822eSThomas Veerman      other entry points, since they don't take a BFD as the first argument.
636418a5822eSThomas Veerman      Certain other handlers could do the same.  */
636518a5822eSThomas Veerman   bfd_uint64_t   (*bfd_getx64) (const void *);
636618a5822eSThomas Veerman   bfd_int64_t    (*bfd_getx_signed_64) (const void *);
636718a5822eSThomas Veerman   void           (*bfd_putx64) (bfd_uint64_t, void *);
636818a5822eSThomas Veerman   bfd_vma        (*bfd_getx32) (const void *);
636918a5822eSThomas Veerman   bfd_signed_vma (*bfd_getx_signed_32) (const void *);
637018a5822eSThomas Veerman   void           (*bfd_putx32) (bfd_vma, void *);
637118a5822eSThomas Veerman   bfd_vma        (*bfd_getx16) (const void *);
637218a5822eSThomas Veerman   bfd_signed_vma (*bfd_getx_signed_16) (const void *);
637318a5822eSThomas Veerman   void           (*bfd_putx16) (bfd_vma, void *);
637418a5822eSThomas Veerman 
637518a5822eSThomas Veerman   /* Byte swapping for the headers.  */
637618a5822eSThomas Veerman   bfd_uint64_t   (*bfd_h_getx64) (const void *);
637718a5822eSThomas Veerman   bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
637818a5822eSThomas Veerman   void           (*bfd_h_putx64) (bfd_uint64_t, void *);
637918a5822eSThomas Veerman   bfd_vma        (*bfd_h_getx32) (const void *);
638018a5822eSThomas Veerman   bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
638118a5822eSThomas Veerman   void           (*bfd_h_putx32) (bfd_vma, void *);
638218a5822eSThomas Veerman   bfd_vma        (*bfd_h_getx16) (const void *);
638318a5822eSThomas Veerman   bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
638418a5822eSThomas Veerman   void           (*bfd_h_putx16) (bfd_vma, void *);
638518a5822eSThomas Veerman 
638618a5822eSThomas Veerman   /* Format dependent routines: these are vectors of entry points
638718a5822eSThomas Veerman      within the target vector structure, one for each format to check.  */
638818a5822eSThomas Veerman 
638918a5822eSThomas Veerman   /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
639018a5822eSThomas Veerman   const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
639118a5822eSThomas Veerman 
639218a5822eSThomas Veerman   /* Set the format of a file being written.  */
639318a5822eSThomas Veerman   bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
639418a5822eSThomas Veerman 
639518a5822eSThomas Veerman   /* Write cached information into a file being written, at <<bfd_close>>.  */
639618a5822eSThomas Veerman   bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
639718a5822eSThomas Veerman 
639818a5822eSThomas Veerman 
639918a5822eSThomas Veerman   /* Generic entry points.  */
640018a5822eSThomas Veerman #define BFD_JUMP_TABLE_GENERIC(NAME) \
640118a5822eSThomas Veerman   NAME##_close_and_cleanup, \
640218a5822eSThomas Veerman   NAME##_bfd_free_cached_info, \
640318a5822eSThomas Veerman   NAME##_new_section_hook, \
640418a5822eSThomas Veerman   NAME##_get_section_contents, \
640518a5822eSThomas Veerman   NAME##_get_section_contents_in_window
640618a5822eSThomas Veerman 
640718a5822eSThomas Veerman   /* Called when the BFD is being closed to do any necessary cleanup.  */
640818a5822eSThomas Veerman   bfd_boolean (*_close_and_cleanup) (bfd *);
640918a5822eSThomas Veerman   /* Ask the BFD to free all cached information.  */
641018a5822eSThomas Veerman   bfd_boolean (*_bfd_free_cached_info) (bfd *);
641118a5822eSThomas Veerman   /* Called when a new section is created.  */
641218a5822eSThomas Veerman   bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
641318a5822eSThomas Veerman   /* Read the contents of a section.  */
641418a5822eSThomas Veerman   bfd_boolean (*_bfd_get_section_contents)
641518a5822eSThomas Veerman     (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
641618a5822eSThomas Veerman   bfd_boolean (*_bfd_get_section_contents_in_window)
641718a5822eSThomas Veerman     (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
641818a5822eSThomas Veerman 
641918a5822eSThomas Veerman   /* Entry points to copy private data.  */
642018a5822eSThomas Veerman #define BFD_JUMP_TABLE_COPY(NAME) \
642118a5822eSThomas Veerman   NAME##_bfd_copy_private_bfd_data, \
642218a5822eSThomas Veerman   NAME##_bfd_merge_private_bfd_data, \
642318a5822eSThomas Veerman   _bfd_generic_init_private_section_data, \
642418a5822eSThomas Veerman   NAME##_bfd_copy_private_section_data, \
642518a5822eSThomas Veerman   NAME##_bfd_copy_private_symbol_data, \
642618a5822eSThomas Veerman   NAME##_bfd_copy_private_header_data, \
642718a5822eSThomas Veerman   NAME##_bfd_set_private_flags, \
642818a5822eSThomas Veerman   NAME##_bfd_print_private_bfd_data
642918a5822eSThomas Veerman 
643018a5822eSThomas Veerman   /* Called to copy BFD general private data from one object file
643118a5822eSThomas Veerman      to another.  */
643218a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
643318a5822eSThomas Veerman   /* Called to merge BFD general private data from one object file
643418a5822eSThomas Veerman      to a common output file when linking.  */
643518a5822eSThomas Veerman   bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
643618a5822eSThomas Veerman   /* Called to initialize BFD private section data from one object file
643718a5822eSThomas Veerman      to another.  */
643818a5822eSThomas Veerman #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
643918a5822eSThomas Veerman   BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
644018a5822eSThomas Veerman   bfd_boolean (*_bfd_init_private_section_data)
644118a5822eSThomas Veerman     (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
644218a5822eSThomas Veerman   /* Called to copy BFD private section data from one object file
644318a5822eSThomas Veerman      to another.  */
644418a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_section_data)
644518a5822eSThomas Veerman     (bfd *, sec_ptr, bfd *, sec_ptr);
644618a5822eSThomas Veerman   /* Called to copy BFD private symbol data from one symbol
644718a5822eSThomas Veerman      to another.  */
644818a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_symbol_data)
644918a5822eSThomas Veerman     (bfd *, asymbol *, bfd *, asymbol *);
645018a5822eSThomas Veerman   /* Called to copy BFD private header data from one object file
645118a5822eSThomas Veerman      to another.  */
645218a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_header_data)
645318a5822eSThomas Veerman     (bfd *, bfd *);
645418a5822eSThomas Veerman   /* Called to set private backend flags.  */
645518a5822eSThomas Veerman   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
645618a5822eSThomas Veerman 
645718a5822eSThomas Veerman   /* Called to print private BFD data.  */
645818a5822eSThomas Veerman   bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
645918a5822eSThomas Veerman 
646018a5822eSThomas Veerman   /* Core file entry points.  */
646118a5822eSThomas Veerman #define BFD_JUMP_TABLE_CORE(NAME) \
646218a5822eSThomas Veerman   NAME##_core_file_failing_command, \
646318a5822eSThomas Veerman   NAME##_core_file_failing_signal, \
646418a5822eSThomas Veerman   NAME##_core_file_matches_executable_p, \
646518a5822eSThomas Veerman   NAME##_core_file_pid
646618a5822eSThomas Veerman 
646718a5822eSThomas Veerman   char *      (*_core_file_failing_command) (bfd *);
646818a5822eSThomas Veerman   int         (*_core_file_failing_signal) (bfd *);
646918a5822eSThomas Veerman   bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
647018a5822eSThomas Veerman   int         (*_core_file_pid) (bfd *);
647118a5822eSThomas Veerman 
647218a5822eSThomas Veerman   /* Archive entry points.  */
647318a5822eSThomas Veerman #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
647418a5822eSThomas Veerman   NAME##_slurp_armap, \
647518a5822eSThomas Veerman   NAME##_slurp_extended_name_table, \
647618a5822eSThomas Veerman   NAME##_construct_extended_name_table, \
647718a5822eSThomas Veerman   NAME##_truncate_arname, \
647818a5822eSThomas Veerman   NAME##_write_armap, \
647918a5822eSThomas Veerman   NAME##_read_ar_hdr, \
648018a5822eSThomas Veerman   NAME##_write_ar_hdr, \
648118a5822eSThomas Veerman   NAME##_openr_next_archived_file, \
648218a5822eSThomas Veerman   NAME##_get_elt_at_index, \
648318a5822eSThomas Veerman   NAME##_generic_stat_arch_elt, \
648418a5822eSThomas Veerman   NAME##_update_armap_timestamp
648518a5822eSThomas Veerman 
648618a5822eSThomas Veerman   bfd_boolean (*_bfd_slurp_armap) (bfd *);
648718a5822eSThomas Veerman   bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
648818a5822eSThomas Veerman   bfd_boolean (*_bfd_construct_extended_name_table)
648918a5822eSThomas Veerman     (bfd *, char **, bfd_size_type *, const char **);
649018a5822eSThomas Veerman   void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
649118a5822eSThomas Veerman   bfd_boolean (*write_armap)
649218a5822eSThomas Veerman     (bfd *, unsigned int, struct orl *, unsigned int, int);
649318a5822eSThomas Veerman   void *      (*_bfd_read_ar_hdr_fn) (bfd *);
649418a5822eSThomas Veerman   bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
649518a5822eSThomas Veerman   bfd *       (*openr_next_archived_file) (bfd *, bfd *);
649618a5822eSThomas Veerman #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
649718a5822eSThomas Veerman   bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
649818a5822eSThomas Veerman   int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
649918a5822eSThomas Veerman   bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
650018a5822eSThomas Veerman 
650118a5822eSThomas Veerman   /* Entry points used for symbols.  */
650218a5822eSThomas Veerman #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
650318a5822eSThomas Veerman   NAME##_get_symtab_upper_bound, \
650418a5822eSThomas Veerman   NAME##_canonicalize_symtab, \
650518a5822eSThomas Veerman   NAME##_make_empty_symbol, \
650618a5822eSThomas Veerman   NAME##_print_symbol, \
650718a5822eSThomas Veerman   NAME##_get_symbol_info, \
650818a5822eSThomas Veerman   NAME##_bfd_is_local_label_name, \
650918a5822eSThomas Veerman   NAME##_bfd_is_target_special_symbol, \
651018a5822eSThomas Veerman   NAME##_get_lineno, \
651118a5822eSThomas Veerman   NAME##_find_nearest_line, \
6512c9ea9e7aSLionel Sambuc   _bfd_generic_find_nearest_line_discriminator, \
651318a5822eSThomas Veerman   _bfd_generic_find_line, \
651418a5822eSThomas Veerman   NAME##_find_inliner_info, \
651518a5822eSThomas Veerman   NAME##_bfd_make_debug_symbol, \
651618a5822eSThomas Veerman   NAME##_read_minisymbols, \
651718a5822eSThomas Veerman   NAME##_minisymbol_to_symbol
651818a5822eSThomas Veerman 
651918a5822eSThomas Veerman   long        (*_bfd_get_symtab_upper_bound) (bfd *);
652018a5822eSThomas Veerman   long        (*_bfd_canonicalize_symtab)
652118a5822eSThomas Veerman     (bfd *, struct bfd_symbol **);
652218a5822eSThomas Veerman   struct bfd_symbol *
652318a5822eSThomas Veerman               (*_bfd_make_empty_symbol) (bfd *);
652418a5822eSThomas Veerman   void        (*_bfd_print_symbol)
652518a5822eSThomas Veerman     (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
652618a5822eSThomas Veerman #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
652718a5822eSThomas Veerman   void        (*_bfd_get_symbol_info)
652818a5822eSThomas Veerman     (bfd *, struct bfd_symbol *, symbol_info *);
652918a5822eSThomas Veerman #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
653018a5822eSThomas Veerman   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
653118a5822eSThomas Veerman   bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
653218a5822eSThomas Veerman   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
653318a5822eSThomas Veerman   bfd_boolean (*_bfd_find_nearest_line)
653418a5822eSThomas Veerman     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
653518a5822eSThomas Veerman      const char **, const char **, unsigned int *);
6536c9ea9e7aSLionel Sambuc   bfd_boolean (*_bfd_find_nearest_line_discriminator)
6537c9ea9e7aSLionel Sambuc     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
6538c9ea9e7aSLionel Sambuc      const char **, const char **, unsigned int *, unsigned int *);
653918a5822eSThomas Veerman   bfd_boolean (*_bfd_find_line)
654018a5822eSThomas Veerman     (bfd *, struct bfd_symbol **, struct bfd_symbol *,
654118a5822eSThomas Veerman      const char **, unsigned int *);
654218a5822eSThomas Veerman   bfd_boolean (*_bfd_find_inliner_info)
654318a5822eSThomas Veerman     (bfd *, const char **, const char **, unsigned int *);
654418a5822eSThomas Veerman  /* Back-door to allow format-aware applications to create debug symbols
654518a5822eSThomas Veerman     while using BFD for everything else.  Currently used by the assembler
654618a5822eSThomas Veerman     when creating COFF files.  */
654718a5822eSThomas Veerman   asymbol *   (*_bfd_make_debug_symbol)
654818a5822eSThomas Veerman     (bfd *, void *, unsigned long size);
654918a5822eSThomas Veerman #define bfd_read_minisymbols(b, d, m, s) \
655018a5822eSThomas Veerman   BFD_SEND (b, _read_minisymbols, (b, d, m, s))
655118a5822eSThomas Veerman   long        (*_read_minisymbols)
655218a5822eSThomas Veerman     (bfd *, bfd_boolean, void **, unsigned int *);
655318a5822eSThomas Veerman #define bfd_minisymbol_to_symbol(b, d, m, f) \
655418a5822eSThomas Veerman   BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
655518a5822eSThomas Veerman   asymbol *   (*_minisymbol_to_symbol)
655618a5822eSThomas Veerman     (bfd *, bfd_boolean, const void *, asymbol *);
655718a5822eSThomas Veerman 
655818a5822eSThomas Veerman   /* Routines for relocs.  */
655918a5822eSThomas Veerman #define BFD_JUMP_TABLE_RELOCS(NAME) \
656018a5822eSThomas Veerman   NAME##_get_reloc_upper_bound, \
656118a5822eSThomas Veerman   NAME##_canonicalize_reloc, \
656218a5822eSThomas Veerman   NAME##_bfd_reloc_type_lookup, \
656318a5822eSThomas Veerman   NAME##_bfd_reloc_name_lookup
656418a5822eSThomas Veerman 
656518a5822eSThomas Veerman   long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
656618a5822eSThomas Veerman   long        (*_bfd_canonicalize_reloc)
656718a5822eSThomas Veerman     (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
656818a5822eSThomas Veerman   /* See documentation on reloc types.  */
656918a5822eSThomas Veerman   reloc_howto_type *
657018a5822eSThomas Veerman               (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
657118a5822eSThomas Veerman   reloc_howto_type *
657218a5822eSThomas Veerman               (*reloc_name_lookup) (bfd *, const char *);
657318a5822eSThomas Veerman 
657418a5822eSThomas Veerman 
657518a5822eSThomas Veerman   /* Routines used when writing an object file.  */
657618a5822eSThomas Veerman #define BFD_JUMP_TABLE_WRITE(NAME) \
657718a5822eSThomas Veerman   NAME##_set_arch_mach, \
657818a5822eSThomas Veerman   NAME##_set_section_contents
657918a5822eSThomas Veerman 
658018a5822eSThomas Veerman   bfd_boolean (*_bfd_set_arch_mach)
658118a5822eSThomas Veerman     (bfd *, enum bfd_architecture, unsigned long);
658218a5822eSThomas Veerman   bfd_boolean (*_bfd_set_section_contents)
658318a5822eSThomas Veerman     (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
658418a5822eSThomas Veerman 
658518a5822eSThomas Veerman   /* Routines used by the linker.  */
658618a5822eSThomas Veerman #define BFD_JUMP_TABLE_LINK(NAME) \
658718a5822eSThomas Veerman   NAME##_sizeof_headers, \
658818a5822eSThomas Veerman   NAME##_bfd_get_relocated_section_contents, \
658918a5822eSThomas Veerman   NAME##_bfd_relax_section, \
659018a5822eSThomas Veerman   NAME##_bfd_link_hash_table_create, \
659118a5822eSThomas Veerman   NAME##_bfd_link_hash_table_free, \
659218a5822eSThomas Veerman   NAME##_bfd_link_add_symbols, \
659318a5822eSThomas Veerman   NAME##_bfd_link_just_syms, \
659418a5822eSThomas Veerman   NAME##_bfd_copy_link_hash_symbol_type, \
659518a5822eSThomas Veerman   NAME##_bfd_final_link, \
659618a5822eSThomas Veerman   NAME##_bfd_link_split_section, \
659718a5822eSThomas Veerman   NAME##_bfd_gc_sections, \
6598c9ea9e7aSLionel Sambuc   NAME##_bfd_lookup_section_flags, \
659918a5822eSThomas Veerman   NAME##_bfd_merge_sections, \
660018a5822eSThomas Veerman   NAME##_bfd_is_group_section, \
660118a5822eSThomas Veerman   NAME##_bfd_discard_group, \
660218a5822eSThomas Veerman   NAME##_section_already_linked, \
660318a5822eSThomas Veerman   NAME##_bfd_define_common_symbol
660418a5822eSThomas Veerman 
660518a5822eSThomas Veerman   int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
660618a5822eSThomas Veerman   bfd_byte *  (*_bfd_get_relocated_section_contents)
660718a5822eSThomas Veerman     (bfd *, struct bfd_link_info *, struct bfd_link_order *,
660818a5822eSThomas Veerman      bfd_byte *, bfd_boolean, struct bfd_symbol **);
660918a5822eSThomas Veerman 
661018a5822eSThomas Veerman   bfd_boolean (*_bfd_relax_section)
661118a5822eSThomas Veerman     (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
661218a5822eSThomas Veerman 
661318a5822eSThomas Veerman   /* Create a hash table for the linker.  Different backends store
661418a5822eSThomas Veerman      different information in this table.  */
661518a5822eSThomas Veerman   struct bfd_link_hash_table *
661618a5822eSThomas Veerman               (*_bfd_link_hash_table_create) (bfd *);
661718a5822eSThomas Veerman 
661818a5822eSThomas Veerman   /* Release the memory associated with the linker hash table.  */
661918a5822eSThomas Veerman   void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
662018a5822eSThomas Veerman 
662118a5822eSThomas Veerman   /* Add symbols from this object file into the hash table.  */
662218a5822eSThomas Veerman   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
662318a5822eSThomas Veerman 
662418a5822eSThomas Veerman   /* Indicate that we are only retrieving symbol values from this section.  */
662518a5822eSThomas Veerman   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
662618a5822eSThomas Veerman 
662718a5822eSThomas Veerman   /* Copy the symbol type of a linker hash table entry.  */
662818a5822eSThomas Veerman #define bfd_copy_link_hash_symbol_type(b, t, f) \
662918a5822eSThomas Veerman   BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
663018a5822eSThomas Veerman   void (*_bfd_copy_link_hash_symbol_type)
663118a5822eSThomas Veerman     (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
663218a5822eSThomas Veerman 
663318a5822eSThomas Veerman   /* Do a link based on the link_order structures attached to each
663418a5822eSThomas Veerman      section of the BFD.  */
663518a5822eSThomas Veerman   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
663618a5822eSThomas Veerman 
663718a5822eSThomas Veerman   /* Should this section be split up into smaller pieces during linking.  */
663818a5822eSThomas Veerman   bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
663918a5822eSThomas Veerman 
664018a5822eSThomas Veerman   /* Remove sections that are not referenced from the output.  */
664118a5822eSThomas Veerman   bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
664218a5822eSThomas Veerman 
6643c9ea9e7aSLionel Sambuc   /* Sets the bitmask of allowed and disallowed section flags.  */
6644c9ea9e7aSLionel Sambuc   bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
6645c9ea9e7aSLionel Sambuc                                             struct flag_info *,
6646c9ea9e7aSLionel Sambuc                                             asection *);
6647c9ea9e7aSLionel Sambuc 
664818a5822eSThomas Veerman   /* Attempt to merge SEC_MERGE sections.  */
664918a5822eSThomas Veerman   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
665018a5822eSThomas Veerman 
665118a5822eSThomas Veerman   /* Is this section a member of a group?  */
665218a5822eSThomas Veerman   bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
665318a5822eSThomas Veerman 
665418a5822eSThomas Veerman   /* Discard members of a group.  */
665518a5822eSThomas Veerman   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
665618a5822eSThomas Veerman 
665718a5822eSThomas Veerman   /* Check if SEC has been already linked during a reloceatable or
665818a5822eSThomas Veerman      final link.  */
6659c9ea9e7aSLionel Sambuc   bfd_boolean (*_section_already_linked) (bfd *, asection *,
666018a5822eSThomas Veerman                                           struct bfd_link_info *);
666118a5822eSThomas Veerman 
666218a5822eSThomas Veerman   /* Define a common symbol.  */
666318a5822eSThomas Veerman   bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
666418a5822eSThomas Veerman                                             struct bfd_link_hash_entry *);
666518a5822eSThomas Veerman 
666618a5822eSThomas Veerman   /* Routines to handle dynamic symbols and relocs.  */
666718a5822eSThomas Veerman #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
666818a5822eSThomas Veerman   NAME##_get_dynamic_symtab_upper_bound, \
666918a5822eSThomas Veerman   NAME##_canonicalize_dynamic_symtab, \
667018a5822eSThomas Veerman   NAME##_get_synthetic_symtab, \
667118a5822eSThomas Veerman   NAME##_get_dynamic_reloc_upper_bound, \
667218a5822eSThomas Veerman   NAME##_canonicalize_dynamic_reloc
667318a5822eSThomas Veerman 
667418a5822eSThomas Veerman   /* Get the amount of memory required to hold the dynamic symbols.  */
667518a5822eSThomas Veerman   long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
667618a5822eSThomas Veerman   /* Read in the dynamic symbols.  */
667718a5822eSThomas Veerman   long        (*_bfd_canonicalize_dynamic_symtab)
667818a5822eSThomas Veerman     (bfd *, struct bfd_symbol **);
667918a5822eSThomas Veerman   /* Create synthetized symbols.  */
668018a5822eSThomas Veerman   long        (*_bfd_get_synthetic_symtab)
668118a5822eSThomas Veerman     (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
668218a5822eSThomas Veerman      struct bfd_symbol **);
668318a5822eSThomas Veerman   /* Get the amount of memory required to hold the dynamic relocs.  */
668418a5822eSThomas Veerman   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
668518a5822eSThomas Veerman   /* Read in the dynamic relocs.  */
668618a5822eSThomas Veerman   long        (*_bfd_canonicalize_dynamic_reloc)
668718a5822eSThomas Veerman     (bfd *, arelent **, struct bfd_symbol **);
668818a5822eSThomas Veerman 
668918a5822eSThomas Veerman   /* Opposite endian version of this target.  */
669018a5822eSThomas Veerman   const struct bfd_target * alternative_target;
669118a5822eSThomas Veerman 
669218a5822eSThomas Veerman   /* Data for use by back-end routines, which isn't
669318a5822eSThomas Veerman      generic enough to belong in this structure.  */
669418a5822eSThomas Veerman   const void *backend_data;
669518a5822eSThomas Veerman 
669618a5822eSThomas Veerman } bfd_target;
669718a5822eSThomas Veerman 
669818a5822eSThomas Veerman bfd_boolean bfd_set_default_target (const char *name);
669918a5822eSThomas Veerman 
670018a5822eSThomas Veerman const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
670118a5822eSThomas Veerman 
670218a5822eSThomas Veerman const bfd_target *bfd_get_target_info (const char *target_name,
670318a5822eSThomas Veerman     bfd *abfd,
670418a5822eSThomas Veerman     bfd_boolean *is_bigendian,
670518a5822eSThomas Veerman     int *underscoring,
670618a5822eSThomas Veerman     const char **def_target_arch);
670718a5822eSThomas Veerman const char ** bfd_target_list (void);
670818a5822eSThomas Veerman 
670918a5822eSThomas Veerman const bfd_target *bfd_search_for_target
671018a5822eSThomas Veerman    (int (*search_func) (const bfd_target *, void *),
671118a5822eSThomas Veerman     void *);
671218a5822eSThomas Veerman 
671318a5822eSThomas Veerman /* Extracted from format.c.  */
671418a5822eSThomas Veerman bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
671518a5822eSThomas Veerman 
671618a5822eSThomas Veerman bfd_boolean bfd_check_format_matches
671718a5822eSThomas Veerman    (bfd *abfd, bfd_format format, char ***matching);
671818a5822eSThomas Veerman 
671918a5822eSThomas Veerman bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
672018a5822eSThomas Veerman 
672118a5822eSThomas Veerman const char *bfd_format_string (bfd_format format);
672218a5822eSThomas Veerman 
672318a5822eSThomas Veerman /* Extracted from linker.c.  */
672418a5822eSThomas Veerman bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
672518a5822eSThomas Veerman 
672618a5822eSThomas Veerman #define bfd_link_split_section(abfd, sec) \
672718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
672818a5822eSThomas Veerman 
6729c9ea9e7aSLionel Sambuc bfd_boolean bfd_section_already_linked (bfd *abfd,
6730c9ea9e7aSLionel Sambuc     asection *sec,
673118a5822eSThomas Veerman     struct bfd_link_info *info);
673218a5822eSThomas Veerman 
673318a5822eSThomas Veerman #define bfd_section_already_linked(abfd, sec, info) \
673418a5822eSThomas Veerman        BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
673518a5822eSThomas Veerman 
673618a5822eSThomas Veerman bfd_boolean bfd_generic_define_common_symbol
673718a5822eSThomas Veerman    (bfd *output_bfd, struct bfd_link_info *info,
673818a5822eSThomas Veerman     struct bfd_link_hash_entry *h);
673918a5822eSThomas Veerman 
674018a5822eSThomas Veerman #define bfd_define_common_symbol(output_bfd, info, h) \
674118a5822eSThomas Veerman        BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
674218a5822eSThomas Veerman 
674318a5822eSThomas Veerman struct bfd_elf_version_tree * bfd_find_version_for_sym
674418a5822eSThomas Veerman    (struct bfd_elf_version_tree *verdefs,
674518a5822eSThomas Veerman     const char *sym_name, bfd_boolean *hide);
674618a5822eSThomas Veerman 
6747c9ea9e7aSLionel Sambuc bfd_boolean bfd_hide_sym_by_version
6748c9ea9e7aSLionel Sambuc    (struct bfd_elf_version_tree *verdefs, const char *sym_name);
6749c9ea9e7aSLionel Sambuc 
675018a5822eSThomas Veerman /* Extracted from simple.c.  */
675118a5822eSThomas Veerman bfd_byte *bfd_simple_get_relocated_section_contents
675218a5822eSThomas Veerman    (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
675318a5822eSThomas Veerman 
675418a5822eSThomas Veerman /* Extracted from compress.c.  */
675518a5822eSThomas Veerman bfd_boolean bfd_compress_section_contents
675618a5822eSThomas Veerman    (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer,
675718a5822eSThomas Veerman     bfd_size_type uncompressed_size);
675818a5822eSThomas Veerman 
675918a5822eSThomas Veerman bfd_boolean bfd_get_full_section_contents
676018a5822eSThomas Veerman    (bfd *abfd, asection *section, bfd_byte **ptr);
676118a5822eSThomas Veerman 
676218a5822eSThomas Veerman bfd_boolean bfd_is_section_compressed
676318a5822eSThomas Veerman    (bfd *abfd, asection *section);
676418a5822eSThomas Veerman 
676518a5822eSThomas Veerman bfd_boolean bfd_init_section_decompress_status
676618a5822eSThomas Veerman    (bfd *abfd, asection *section);
676718a5822eSThomas Veerman 
676818a5822eSThomas Veerman bfd_boolean bfd_init_section_compress_status
676918a5822eSThomas Veerman    (bfd *abfd, asection *section);
677018a5822eSThomas Veerman 
677118a5822eSThomas Veerman #ifdef __cplusplus
677218a5822eSThomas Veerman }
677318a5822eSThomas Veerman #endif
677418a5822eSThomas Veerman #endif
6775