xref: /minix3/external/gpl3/binutils/lib/libbfd/arch/vax/bfd.h (revision c9ea9e7af84fcba485b32ccd2c85edb945b1f323)
118a5822eSThomas Veerman /* This file is automatically generated.  DO NOT EDIT! */
218a5822eSThomas Veerman /* Generated from: 	NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp  */
318a5822eSThomas Veerman /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb 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 
14*c9ea9e7aSLionel Sambuc    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
15*c9ea9e7aSLionel Sambuc    2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
16*c9ea9e7aSLionel 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 
39*c9ea9e7aSLionel Sambuc /* PR 14072: Ensure that config.h is included first.  */
40*c9ea9e7aSLionel Sambuc #if !defined PACKAGE && !defined PACKAGE_VERSION
41*c9ea9e7aSLionel Sambuc #error config.h must be included before this header
42*c9ea9e7aSLionel Sambuc #endif
43*c9ea9e7aSLionel Sambuc 
4418a5822eSThomas Veerman #ifdef __cplusplus
4518a5822eSThomas Veerman extern "C" {
4618a5822eSThomas Veerman #endif
4718a5822eSThomas Veerman 
4818a5822eSThomas Veerman #include "ansidecl.h"
4918a5822eSThomas Veerman #include "symcat.h"
50*c9ea9e7aSLionel Sambuc #include <sys/stat.h>
51*c9ea9e7aSLionel 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 
292*c9ea9e7aSLionel Sambuc #define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
293*c9ea9e7aSLionel Sambuc #define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
294*c9ea9e7aSLionel Sambuc #define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
295*c9ea9e7aSLionel Sambuc #define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
296*c9ea9e7aSLionel 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)
303*c9ea9e7aSLionel Sambuc #define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
304*c9ea9e7aSLionel 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) \
313*c9ea9e7aSLionel Sambuc   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
314*c9ea9e7aSLionel Sambuc     ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
31518a5822eSThomas Veerman 
31618a5822eSThomas Veerman /* Return TRUE if input section SEC has been discarded.  */
317*c9ea9e7aSLionel Sambuc #define discarded_section(sec)				\
31818a5822eSThomas Veerman   (!bfd_is_abs_section (sec)					\
31918a5822eSThomas Veerman    && bfd_is_abs_section ((sec)->output_section)		\
320*c9ea9e7aSLionel Sambuc    && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE		\
321*c9ea9e7aSLionel 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.  */
451*c9ea9e7aSLionel 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;
578*c9ea9e7aSLionel Sambuc struct bfd_section_already_linked;
57918a5822eSThomas Veerman struct bfd_elf_version_tree;
58018a5822eSThomas Veerman #endif
581*c9ea9e7aSLionel Sambuc 
582*c9ea9e7aSLionel Sambuc extern bfd_boolean bfd_section_already_linked_table_init (void);
583*c9ea9e7aSLionel Sambuc extern void bfd_section_already_linked_table_free (void);
584*c9ea9e7aSLionel Sambuc extern bfd_boolean _bfd_handle_already_linked
585*c9ea9e7aSLionel Sambuc   (struct bfd_section *, struct bfd_section_already_linked *,
586*c9ea9e7aSLionel Sambuc    struct bfd_link_info *);
587*c9ea9e7aSLionel Sambuc 
588*c9ea9e7aSLionel Sambuc /* Externally visible ECOFF routines.  */
589*c9ea9e7aSLionel 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 *,
664*c9ea9e7aSLionel 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,
712*c9ea9e7aSLionel Sambuc    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
713*c9ea9e7aSLionel 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 
718*c9ea9e7aSLionel Sambuc extern struct bfd_section *
719*c9ea9e7aSLionel Sambuc _bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
720*c9ea9e7aSLionel 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,
888*c9ea9e7aSLionel 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 
931*c9ea9e7aSLionel Sambuc /* C6x unwind section editing support.  */
932*c9ea9e7aSLionel Sambuc extern bfd_boolean elf32_tic6x_fix_exidx_coverage
933*c9ea9e7aSLionel Sambuc (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
934*c9ea9e7aSLionel 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 
942*c9ea9e7aSLionel Sambuc extern void bfd_elf64_aarch64_init_maps
943*c9ea9e7aSLionel Sambuc   (bfd *);
944*c9ea9e7aSLionel Sambuc 
945*c9ea9e7aSLionel Sambuc void bfd_elf64_aarch64_set_options
946*c9ea9e7aSLionel Sambuc   (bfd *, struct bfd_link_info *, int, int, int);
947*c9ea9e7aSLionel Sambuc 
948*c9ea9e7aSLionel Sambuc /* ELF AArch64 mapping symbol support.  */
949*c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP	(1 << 0)
950*c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG	(1 << 1)
951*c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER	(1 << 2)
952*c9ea9e7aSLionel Sambuc #define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY	(~0)
953*c9ea9e7aSLionel Sambuc extern bfd_boolean bfd_is_aarch64_special_symbol_name
954*c9ea9e7aSLionel Sambuc   (const char * name, int type);
955*c9ea9e7aSLionel Sambuc 
956*c9ea9e7aSLionel Sambuc /* AArch64 stub generation support.  Called from the linker.  */
957*c9ea9e7aSLionel Sambuc extern int elf64_aarch64_setup_section_lists
958*c9ea9e7aSLionel Sambuc   (bfd *, struct bfd_link_info *);
959*c9ea9e7aSLionel Sambuc extern void elf64_aarch64_next_input_section
960*c9ea9e7aSLionel Sambuc   (struct bfd_link_info *, struct bfd_section *);
961*c9ea9e7aSLionel Sambuc extern bfd_boolean elf64_aarch64_size_stubs
962*c9ea9e7aSLionel Sambuc   (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
963*c9ea9e7aSLionel Sambuc    struct bfd_section * (*) (const char *, struct bfd_section *),
964*c9ea9e7aSLionel Sambuc    void (*) (void));
965*c9ea9e7aSLionel Sambuc extern bfd_boolean elf64_aarch64_build_stubs
966*c9ea9e7aSLionel Sambuc   (struct bfd_link_info *);
967*c9ea9e7aSLionel 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,
1181*c9ea9e7aSLionel Sambuc     int prot, int flags, file_ptr offset,
1182*c9ea9e7aSLionel 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 
1363*c9ea9e7aSLionel Sambuc   /* This input section should be copied to output in reverse order
1364*c9ea9e7aSLionel Sambuc      as an array of pointers.  This is for ELF linker internal use
1365*c9ea9e7aSLionel Sambuc      only.  */
1366*c9ea9e7aSLionel Sambuc #define SEC_ELF_REVERSE_COPY 0x4000000
1367*c9ea9e7aSLionel 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;
1418*c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_NONE      0
1419*c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_STABS     1
1420*c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_MERGE     2
1421*c9ea9e7aSLionel Sambuc #define SEC_INFO_TYPE_EH_FRAME  3
1422*c9ea9e7aSLionel 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
1579*c9ea9e7aSLionel Sambuc    these sections.  */
1580*c9ea9e7aSLionel Sambuc extern asection std_section[4];
1581*c9ea9e7aSLionel 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.  */
1588*c9ea9e7aSLionel Sambuc #define bfd_com_section_ptr (&std_section[0])
1589*c9ea9e7aSLionel Sambuc /* Pointer to the undefined section.  */
1590*c9ea9e7aSLionel Sambuc #define bfd_und_section_ptr (&std_section[1])
1591*c9ea9e7aSLionel Sambuc /* Pointer to the absolute section.  */
1592*c9ea9e7aSLionel Sambuc #define bfd_abs_section_ptr (&std_section[2])
159318a5822eSThomas Veerman /* Pointer to the indirect section.  */
1594*c9ea9e7aSLionel Sambuc #define bfd_ind_section_ptr (&std_section[3])
1595*c9ea9e7aSLionel Sambuc 
1596*c9ea9e7aSLionel Sambuc #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1597*c9ea9e7aSLionel 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,               */  \
1713*c9ea9e7aSLionel 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 
1738*c9ea9e7aSLionel Sambuc asection *bfd_get_next_section_by_name (asection *sec);
1739*c9ea9e7aSLionel Sambuc 
1740*c9ea9e7aSLionel Sambuc asection *bfd_get_linker_section (bfd *abfd, const char *name);
1741*c9ea9e7aSLionel 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 
185918a5822eSThomas Veerman   bfd_arch_or32,      /* OpenRISC 32 */
186018a5822eSThomas Veerman 
186118a5822eSThomas Veerman   bfd_arch_sparc,     /* SPARC */
186218a5822eSThomas Veerman #define bfd_mach_sparc                 1
186318a5822eSThomas Veerman /* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
186418a5822eSThomas Veerman #define bfd_mach_sparc_sparclet        2
186518a5822eSThomas Veerman #define bfd_mach_sparc_sparclite       3
186618a5822eSThomas Veerman #define bfd_mach_sparc_v8plus          4
186718a5822eSThomas Veerman #define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
186818a5822eSThomas Veerman #define bfd_mach_sparc_sparclite_le    6
186918a5822eSThomas Veerman #define bfd_mach_sparc_v9              7
187018a5822eSThomas Veerman #define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
187118a5822eSThomas Veerman #define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
187218a5822eSThomas Veerman #define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
187318a5822eSThomas Veerman /* Nonzero if MACH has the v9 instruction set.  */
187418a5822eSThomas Veerman #define bfd_mach_sparc_v9_p(mach) \
187518a5822eSThomas Veerman   ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
187618a5822eSThomas Veerman    && (mach) != bfd_mach_sparc_sparclite_le)
187718a5822eSThomas Veerman /* Nonzero if MACH is a 64 bit sparc architecture.  */
187818a5822eSThomas Veerman #define bfd_mach_sparc_64bit_p(mach) \
187918a5822eSThomas Veerman   ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
188018a5822eSThomas Veerman   bfd_arch_spu,       /* PowerPC SPU */
188118a5822eSThomas Veerman #define bfd_mach_spu           256
188218a5822eSThomas Veerman   bfd_arch_mips,      /* MIPS Rxxxx */
188318a5822eSThomas Veerman #define bfd_mach_mips3000              3000
188418a5822eSThomas Veerman #define bfd_mach_mips3900              3900
188518a5822eSThomas Veerman #define bfd_mach_mips4000              4000
188618a5822eSThomas Veerman #define bfd_mach_mips4010              4010
188718a5822eSThomas Veerman #define bfd_mach_mips4100              4100
188818a5822eSThomas Veerman #define bfd_mach_mips4111              4111
188918a5822eSThomas Veerman #define bfd_mach_mips4120              4120
189018a5822eSThomas Veerman #define bfd_mach_mips4300              4300
189118a5822eSThomas Veerman #define bfd_mach_mips4400              4400
189218a5822eSThomas Veerman #define bfd_mach_mips4600              4600
189318a5822eSThomas Veerman #define bfd_mach_mips4650              4650
189418a5822eSThomas Veerman #define bfd_mach_mips5000              5000
189518a5822eSThomas Veerman #define bfd_mach_mips5400              5400
189618a5822eSThomas Veerman #define bfd_mach_mips5500              5500
189718a5822eSThomas Veerman #define bfd_mach_mips6000              6000
189818a5822eSThomas Veerman #define bfd_mach_mips7000              7000
189918a5822eSThomas Veerman #define bfd_mach_mips8000              8000
190018a5822eSThomas Veerman #define bfd_mach_mips9000              9000
190118a5822eSThomas Veerman #define bfd_mach_mips10000             10000
190218a5822eSThomas Veerman #define bfd_mach_mips12000             12000
190318a5822eSThomas Veerman #define bfd_mach_mips14000             14000
190418a5822eSThomas Veerman #define bfd_mach_mips16000             16000
190518a5822eSThomas Veerman #define bfd_mach_mips16                16
190618a5822eSThomas Veerman #define bfd_mach_mips5                 5
190718a5822eSThomas Veerman #define bfd_mach_mips_loongson_2e      3001
190818a5822eSThomas Veerman #define bfd_mach_mips_loongson_2f      3002
1909*c9ea9e7aSLionel Sambuc #define bfd_mach_mips_loongson_3a      3003
191018a5822eSThomas Veerman #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
191118a5822eSThomas Veerman #define bfd_mach_mips_octeon           6501
1912*c9ea9e7aSLionel Sambuc #define bfd_mach_mips_octeonp          6601
1913*c9ea9e7aSLionel Sambuc #define bfd_mach_mips_octeon2          6502
191418a5822eSThomas Veerman #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
191518a5822eSThomas Veerman #define bfd_mach_mipsisa32             32
191618a5822eSThomas Veerman #define bfd_mach_mipsisa32r2           33
191718a5822eSThomas Veerman #define bfd_mach_mipsisa64             64
191818a5822eSThomas Veerman #define bfd_mach_mipsisa64r2           65
1919*c9ea9e7aSLionel Sambuc #define bfd_mach_mips_micromips        96
192018a5822eSThomas Veerman   bfd_arch_i386,      /* Intel 386 */
1921*c9ea9e7aSLionel Sambuc #define bfd_mach_i386_intel_syntax     (1 << 0)
1922*c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i8086            (1 << 1)
1923*c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i386             (1 << 2)
1924*c9ea9e7aSLionel Sambuc #define bfd_mach_x86_64                (1 << 3)
1925*c9ea9e7aSLionel Sambuc #define bfd_mach_x64_32                (1 << 4)
1926*c9ea9e7aSLionel Sambuc #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
1927*c9ea9e7aSLionel Sambuc #define bfd_mach_x86_64_intel_syntax   (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
1928*c9ea9e7aSLionel Sambuc #define bfd_mach_x64_32_intel_syntax   (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
192918a5822eSThomas Veerman   bfd_arch_l1om,   /* Intel L1OM */
1930*c9ea9e7aSLionel Sambuc #define bfd_mach_l1om                  (1 << 5)
1931*c9ea9e7aSLionel Sambuc #define bfd_mach_l1om_intel_syntax     (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
1932*c9ea9e7aSLionel Sambuc   bfd_arch_k1om,   /* Intel K1OM */
1933*c9ea9e7aSLionel Sambuc #define bfd_mach_k1om                  (1 << 6)
1934*c9ea9e7aSLionel Sambuc #define bfd_mach_k1om_intel_syntax     (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
193518a5822eSThomas Veerman   bfd_arch_we32k,     /* AT&T WE32xxx */
193618a5822eSThomas Veerman   bfd_arch_tahoe,     /* CCI/Harris Tahoe */
193718a5822eSThomas Veerman   bfd_arch_i860,      /* Intel 860 */
193818a5822eSThomas Veerman   bfd_arch_i370,      /* IBM 360/370 Mainframes */
193918a5822eSThomas Veerman   bfd_arch_romp,      /* IBM ROMP PC/RT */
194018a5822eSThomas Veerman   bfd_arch_convex,    /* Convex */
194118a5822eSThomas Veerman   bfd_arch_m88k,      /* Motorola 88xxx */
194218a5822eSThomas Veerman   bfd_arch_m98k,      /* Motorola 98xxx */
194318a5822eSThomas Veerman   bfd_arch_pyramid,   /* Pyramid Technology */
194418a5822eSThomas Veerman   bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
194518a5822eSThomas Veerman #define bfd_mach_h8300    1
194618a5822eSThomas Veerman #define bfd_mach_h8300h   2
194718a5822eSThomas Veerman #define bfd_mach_h8300s   3
194818a5822eSThomas Veerman #define bfd_mach_h8300hn  4
194918a5822eSThomas Veerman #define bfd_mach_h8300sn  5
195018a5822eSThomas Veerman #define bfd_mach_h8300sx  6
195118a5822eSThomas Veerman #define bfd_mach_h8300sxn 7
195218a5822eSThomas Veerman   bfd_arch_pdp11,     /* DEC PDP-11 */
195318a5822eSThomas Veerman   bfd_arch_plugin,
195418a5822eSThomas Veerman   bfd_arch_powerpc,   /* PowerPC */
195518a5822eSThomas Veerman #define bfd_mach_ppc           32
195618a5822eSThomas Veerman #define bfd_mach_ppc64         64
195718a5822eSThomas Veerman #define bfd_mach_ppc_403       403
195818a5822eSThomas Veerman #define bfd_mach_ppc_403gc     4030
195918a5822eSThomas Veerman #define bfd_mach_ppc_405       405
196018a5822eSThomas Veerman #define bfd_mach_ppc_505       505
196118a5822eSThomas Veerman #define bfd_mach_ppc_601       601
196218a5822eSThomas Veerman #define bfd_mach_ppc_602       602
196318a5822eSThomas Veerman #define bfd_mach_ppc_603       603
196418a5822eSThomas Veerman #define bfd_mach_ppc_ec603e    6031
196518a5822eSThomas Veerman #define bfd_mach_ppc_604       604
196618a5822eSThomas Veerman #define bfd_mach_ppc_620       620
196718a5822eSThomas Veerman #define bfd_mach_ppc_630       630
196818a5822eSThomas Veerman #define bfd_mach_ppc_750       750
196918a5822eSThomas Veerman #define bfd_mach_ppc_860       860
197018a5822eSThomas Veerman #define bfd_mach_ppc_a35       35
197118a5822eSThomas Veerman #define bfd_mach_ppc_rs64ii    642
197218a5822eSThomas Veerman #define bfd_mach_ppc_rs64iii   643
197318a5822eSThomas Veerman #define bfd_mach_ppc_7400      7400
197418a5822eSThomas Veerman #define bfd_mach_ppc_e500      500
197518a5822eSThomas Veerman #define bfd_mach_ppc_e500mc    5001
197618a5822eSThomas Veerman #define bfd_mach_ppc_e500mc64  5005
1977*c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_e5500     5006
1978*c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_e6500     5007
197918a5822eSThomas Veerman #define bfd_mach_ppc_titan     83
1980*c9ea9e7aSLionel Sambuc #define bfd_mach_ppc_vle       84
198118a5822eSThomas Veerman   bfd_arch_rs6000,    /* IBM RS/6000 */
198218a5822eSThomas Veerman #define bfd_mach_rs6k          6000
198318a5822eSThomas Veerman #define bfd_mach_rs6k_rs1      6001
198418a5822eSThomas Veerman #define bfd_mach_rs6k_rsc      6003
198518a5822eSThomas Veerman #define bfd_mach_rs6k_rs2      6002
198618a5822eSThomas Veerman   bfd_arch_hppa,      /* HP PA RISC */
198718a5822eSThomas Veerman #define bfd_mach_hppa10        10
198818a5822eSThomas Veerman #define bfd_mach_hppa11        11
198918a5822eSThomas Veerman #define bfd_mach_hppa20        20
199018a5822eSThomas Veerman #define bfd_mach_hppa20w       25
199118a5822eSThomas Veerman   bfd_arch_d10v,      /* Mitsubishi D10V */
199218a5822eSThomas Veerman #define bfd_mach_d10v          1
199318a5822eSThomas Veerman #define bfd_mach_d10v_ts2      2
199418a5822eSThomas Veerman #define bfd_mach_d10v_ts3      3
199518a5822eSThomas Veerman   bfd_arch_d30v,      /* Mitsubishi D30V */
199618a5822eSThomas Veerman   bfd_arch_dlx,       /* DLX */
199718a5822eSThomas Veerman   bfd_arch_m68hc11,   /* Motorola 68HC11 */
199818a5822eSThomas Veerman   bfd_arch_m68hc12,   /* Motorola 68HC12 */
199918a5822eSThomas Veerman #define bfd_mach_m6812_default 0
200018a5822eSThomas Veerman #define bfd_mach_m6812         1
200118a5822eSThomas Veerman #define bfd_mach_m6812s        2
2002*c9ea9e7aSLionel Sambuc   bfd_arch_m9s12x,   /* Freescale S12X */
2003*c9ea9e7aSLionel Sambuc   bfd_arch_m9s12xg,  /* Freescale XGATE */
200418a5822eSThomas Veerman   bfd_arch_z8k,       /* Zilog Z8000 */
200518a5822eSThomas Veerman #define bfd_mach_z8001         1
200618a5822eSThomas Veerman #define bfd_mach_z8002         2
200718a5822eSThomas Veerman   bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
200818a5822eSThomas Veerman   bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
200918a5822eSThomas Veerman #define bfd_mach_sh            1
201018a5822eSThomas Veerman #define bfd_mach_sh2        0x20
201118a5822eSThomas Veerman #define bfd_mach_sh_dsp     0x2d
201218a5822eSThomas Veerman #define bfd_mach_sh2a       0x2a
201318a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu 0x2b
201418a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
201518a5822eSThomas Veerman #define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
201618a5822eSThomas Veerman #define bfd_mach_sh2a_or_sh4  0x2a3
201718a5822eSThomas Veerman #define bfd_mach_sh2a_or_sh3e 0x2a4
201818a5822eSThomas Veerman #define bfd_mach_sh2e       0x2e
201918a5822eSThomas Veerman #define bfd_mach_sh3        0x30
202018a5822eSThomas Veerman #define bfd_mach_sh3_nommu  0x31
202118a5822eSThomas Veerman #define bfd_mach_sh3_dsp    0x3d
202218a5822eSThomas Veerman #define bfd_mach_sh3e       0x3e
202318a5822eSThomas Veerman #define bfd_mach_sh4        0x40
202418a5822eSThomas Veerman #define bfd_mach_sh4_nofpu  0x41
202518a5822eSThomas Veerman #define bfd_mach_sh4_nommu_nofpu  0x42
202618a5822eSThomas Veerman #define bfd_mach_sh4a       0x4a
202718a5822eSThomas Veerman #define bfd_mach_sh4a_nofpu 0x4b
202818a5822eSThomas Veerman #define bfd_mach_sh4al_dsp  0x4d
202918a5822eSThomas Veerman #define bfd_mach_sh5        0x50
203018a5822eSThomas Veerman   bfd_arch_alpha,     /* Dec Alpha */
203118a5822eSThomas Veerman #define bfd_mach_alpha_ev4  0x10
203218a5822eSThomas Veerman #define bfd_mach_alpha_ev5  0x20
203318a5822eSThomas Veerman #define bfd_mach_alpha_ev6  0x30
203418a5822eSThomas Veerman   bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
203518a5822eSThomas Veerman #define bfd_mach_arm_unknown   0
203618a5822eSThomas Veerman #define bfd_mach_arm_2         1
203718a5822eSThomas Veerman #define bfd_mach_arm_2a        2
203818a5822eSThomas Veerman #define bfd_mach_arm_3         3
203918a5822eSThomas Veerman #define bfd_mach_arm_3M        4
204018a5822eSThomas Veerman #define bfd_mach_arm_4         5
204118a5822eSThomas Veerman #define bfd_mach_arm_4T        6
204218a5822eSThomas Veerman #define bfd_mach_arm_5         7
204318a5822eSThomas Veerman #define bfd_mach_arm_5T        8
204418a5822eSThomas Veerman #define bfd_mach_arm_5TE       9
204518a5822eSThomas Veerman #define bfd_mach_arm_XScale    10
204618a5822eSThomas Veerman #define bfd_mach_arm_ep9312    11
204718a5822eSThomas Veerman #define bfd_mach_arm_iWMMXt    12
204818a5822eSThomas Veerman #define bfd_mach_arm_iWMMXt2   13
204918a5822eSThomas Veerman   bfd_arch_ns32k,     /* National Semiconductors ns32000 */
205018a5822eSThomas Veerman   bfd_arch_w65,       /* WDC 65816 */
205118a5822eSThomas Veerman   bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
205218a5822eSThomas Veerman   bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
205318a5822eSThomas Veerman #define bfd_mach_tic3x         30
205418a5822eSThomas Veerman #define bfd_mach_tic4x         40
205518a5822eSThomas Veerman   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
205618a5822eSThomas Veerman   bfd_arch_tic6x,     /* Texas Instruments TMS320C6X */
205718a5822eSThomas Veerman   bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
205818a5822eSThomas Veerman   bfd_arch_v850,      /* NEC V850 */
205918a5822eSThomas Veerman #define bfd_mach_v850          1
206018a5822eSThomas Veerman #define bfd_mach_v850e         'E'
206118a5822eSThomas Veerman #define bfd_mach_v850e1        '1'
206218a5822eSThomas Veerman #define bfd_mach_v850e2        0x4532
206318a5822eSThomas Veerman #define bfd_mach_v850e2v3      0x45325633
206418a5822eSThomas Veerman   bfd_arch_arc,       /* ARC Cores */
206518a5822eSThomas Veerman #define bfd_mach_arc_5         5
206618a5822eSThomas Veerman #define bfd_mach_arc_6         6
206718a5822eSThomas Veerman #define bfd_mach_arc_7         7
206818a5822eSThomas Veerman #define bfd_mach_arc_8         8
206918a5822eSThomas Veerman  bfd_arch_m32c,     /* Renesas M16C/M32C.  */
207018a5822eSThomas Veerman #define bfd_mach_m16c        0x75
207118a5822eSThomas Veerman #define bfd_mach_m32c        0x78
207218a5822eSThomas Veerman   bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
207318a5822eSThomas Veerman #define bfd_mach_m32r          1 /* For backwards compatibility.  */
207418a5822eSThomas Veerman #define bfd_mach_m32rx         'x'
207518a5822eSThomas Veerman #define bfd_mach_m32r2         '2'
207618a5822eSThomas Veerman   bfd_arch_mn10200,   /* Matsushita MN10200 */
207718a5822eSThomas Veerman   bfd_arch_mn10300,   /* Matsushita MN10300 */
207818a5822eSThomas Veerman #define bfd_mach_mn10300               300
207918a5822eSThomas Veerman #define bfd_mach_am33          330
208018a5822eSThomas Veerman #define bfd_mach_am33_2        332
208118a5822eSThomas Veerman   bfd_arch_fr30,
208218a5822eSThomas Veerman #define bfd_mach_fr30          0x46523330
208318a5822eSThomas Veerman   bfd_arch_frv,
208418a5822eSThomas Veerman #define bfd_mach_frv           1
208518a5822eSThomas Veerman #define bfd_mach_frvsimple     2
208618a5822eSThomas Veerman #define bfd_mach_fr300         300
208718a5822eSThomas Veerman #define bfd_mach_fr400         400
208818a5822eSThomas Veerman #define bfd_mach_fr450         450
208918a5822eSThomas Veerman #define bfd_mach_frvtomcat     499     /* fr500 prototype */
209018a5822eSThomas Veerman #define bfd_mach_fr500         500
209118a5822eSThomas Veerman #define bfd_mach_fr550         550
209218a5822eSThomas Veerman   bfd_arch_moxie,       /* The moxie processor */
209318a5822eSThomas Veerman #define bfd_mach_moxie         1
209418a5822eSThomas Veerman   bfd_arch_mcore,
209518a5822eSThomas Veerman   bfd_arch_mep,
209618a5822eSThomas Veerman #define bfd_mach_mep           1
209718a5822eSThomas Veerman #define bfd_mach_mep_h1        0x6831
209818a5822eSThomas Veerman #define bfd_mach_mep_c5        0x6335
209918a5822eSThomas Veerman   bfd_arch_ia64,      /* HP/Intel ia64 */
210018a5822eSThomas Veerman #define bfd_mach_ia64_elf64    64
210118a5822eSThomas Veerman #define bfd_mach_ia64_elf32    32
210218a5822eSThomas Veerman   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
210318a5822eSThomas Veerman #define bfd_mach_ip2022        1
210418a5822eSThomas Veerman #define bfd_mach_ip2022ext     2
210518a5822eSThomas Veerman  bfd_arch_iq2000,     /* Vitesse IQ2000.  */
210618a5822eSThomas Veerman #define bfd_mach_iq2000        1
210718a5822eSThomas Veerman #define bfd_mach_iq10          2
2108*c9ea9e7aSLionel Sambuc   bfd_arch_epiphany,   /* Adapteva EPIPHANY */
2109*c9ea9e7aSLionel Sambuc #define bfd_mach_epiphany16    1
2110*c9ea9e7aSLionel Sambuc #define bfd_mach_epiphany32    2
211118a5822eSThomas Veerman   bfd_arch_mt,
211218a5822eSThomas Veerman #define bfd_mach_ms1           1
211318a5822eSThomas Veerman #define bfd_mach_mrisc2        2
211418a5822eSThomas Veerman #define bfd_mach_ms2           3
211518a5822eSThomas Veerman   bfd_arch_pj,
211618a5822eSThomas Veerman   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
211718a5822eSThomas Veerman #define bfd_mach_avr1          1
211818a5822eSThomas Veerman #define bfd_mach_avr2          2
211918a5822eSThomas Veerman #define bfd_mach_avr25         25
212018a5822eSThomas Veerman #define bfd_mach_avr3          3
212118a5822eSThomas Veerman #define bfd_mach_avr31         31
212218a5822eSThomas Veerman #define bfd_mach_avr35         35
212318a5822eSThomas Veerman #define bfd_mach_avr4          4
212418a5822eSThomas Veerman #define bfd_mach_avr5          5
212518a5822eSThomas Veerman #define bfd_mach_avr51         51
212618a5822eSThomas Veerman #define bfd_mach_avr6          6
2127*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega1 101
2128*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega2 102
2129*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega3 103
2130*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega4 104
2131*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega5 105
2132*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega6 106
2133*c9ea9e7aSLionel Sambuc #define bfd_mach_avrxmega7 107
213418a5822eSThomas Veerman   bfd_arch_bfin,        /* ADI Blackfin */
213518a5822eSThomas Veerman #define bfd_mach_bfin          1
213618a5822eSThomas Veerman   bfd_arch_cr16,       /* National Semiconductor CompactRISC (ie CR16). */
213718a5822eSThomas Veerman #define bfd_mach_cr16          1
213818a5822eSThomas Veerman   bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
213918a5822eSThomas Veerman #define bfd_mach_cr16c         1
214018a5822eSThomas Veerman   bfd_arch_crx,       /*  National Semiconductor CRX.  */
214118a5822eSThomas Veerman #define bfd_mach_crx           1
214218a5822eSThomas Veerman   bfd_arch_cris,      /* Axis CRIS */
214318a5822eSThomas Veerman #define bfd_mach_cris_v0_v10   255
214418a5822eSThomas Veerman #define bfd_mach_cris_v32      32
214518a5822eSThomas Veerman #define bfd_mach_cris_v10_v32  1032
2146*c9ea9e7aSLionel Sambuc   bfd_arch_rl78,
2147*c9ea9e7aSLionel Sambuc #define bfd_mach_rl78  0x75
214818a5822eSThomas Veerman   bfd_arch_rx,        /* Renesas RX.  */
214918a5822eSThomas Veerman #define bfd_mach_rx            0x75
215018a5822eSThomas Veerman   bfd_arch_s390,      /* IBM s390 */
215118a5822eSThomas Veerman #define bfd_mach_s390_31       31
215218a5822eSThomas Veerman #define bfd_mach_s390_64       64
215318a5822eSThomas Veerman   bfd_arch_score,     /* Sunplus score */
215418a5822eSThomas Veerman #define bfd_mach_score3         3
215518a5822eSThomas Veerman #define bfd_mach_score7         7
215618a5822eSThomas Veerman   bfd_arch_openrisc,  /* OpenRISC */
215718a5822eSThomas Veerman   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
215818a5822eSThomas Veerman   bfd_arch_xstormy16,
215918a5822eSThomas Veerman #define bfd_mach_xstormy16     1
216018a5822eSThomas Veerman   bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
216118a5822eSThomas Veerman #define bfd_mach_msp11          11
216218a5822eSThomas Veerman #define bfd_mach_msp110         110
216318a5822eSThomas Veerman #define bfd_mach_msp12          12
216418a5822eSThomas Veerman #define bfd_mach_msp13          13
216518a5822eSThomas Veerman #define bfd_mach_msp14          14
216618a5822eSThomas Veerman #define bfd_mach_msp15          15
216718a5822eSThomas Veerman #define bfd_mach_msp16          16
216818a5822eSThomas Veerman #define bfd_mach_msp21          21
216918a5822eSThomas Veerman #define bfd_mach_msp31          31
217018a5822eSThomas Veerman #define bfd_mach_msp32          32
217118a5822eSThomas Veerman #define bfd_mach_msp33          33
217218a5822eSThomas Veerman #define bfd_mach_msp41          41
217318a5822eSThomas Veerman #define bfd_mach_msp42          42
217418a5822eSThomas Veerman #define bfd_mach_msp43          43
217518a5822eSThomas Veerman #define bfd_mach_msp44          44
217618a5822eSThomas Veerman   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
217718a5822eSThomas Veerman #define bfd_mach_xc16x         1
217818a5822eSThomas Veerman #define bfd_mach_xc16xl        2
217918a5822eSThomas Veerman #define bfd_mach_xc16xs        3
2180*c9ea9e7aSLionel Sambuc   bfd_arch_xgate,   /* Freescale XGATE */
2181*c9ea9e7aSLionel Sambuc #define bfd_mach_xgate         1
218218a5822eSThomas Veerman   bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
218318a5822eSThomas Veerman #define bfd_mach_xtensa        1
218418a5822eSThomas Veerman   bfd_arch_z80,
218518a5822eSThomas Veerman #define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
218618a5822eSThomas Veerman #define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
218718a5822eSThomas Veerman #define bfd_mach_z80full        7 /* All undocumented instructions.  */
218818a5822eSThomas Veerman #define bfd_mach_r800           11 /* R800: successor with multiplication.  */
218918a5822eSThomas Veerman   bfd_arch_lm32,      /* Lattice Mico32 */
219018a5822eSThomas Veerman #define bfd_mach_lm32      1
219118a5822eSThomas Veerman   bfd_arch_microblaze,/* Xilinx MicroBlaze. */
2192*c9ea9e7aSLionel Sambuc   bfd_arch_tilepro,   /* Tilera TILEPro */
2193*c9ea9e7aSLionel Sambuc   bfd_arch_tilegx, /* Tilera TILE-Gx */
2194*c9ea9e7aSLionel Sambuc #define bfd_mach_tilepro   1
2195*c9ea9e7aSLionel Sambuc #define bfd_mach_tilegx    1
2196*c9ea9e7aSLionel Sambuc #define bfd_mach_tilegx32  2
2197*c9ea9e7aSLionel Sambuc   bfd_arch_aarch64,   /* AArch64  */
2198*c9ea9e7aSLionel Sambuc #define bfd_mach_aarch64 0
219918a5822eSThomas Veerman   bfd_arch_last
220018a5822eSThomas Veerman   };
220118a5822eSThomas Veerman 
220218a5822eSThomas Veerman typedef struct bfd_arch_info
220318a5822eSThomas Veerman {
220418a5822eSThomas Veerman   int bits_per_word;
220518a5822eSThomas Veerman   int bits_per_address;
220618a5822eSThomas Veerman   int bits_per_byte;
220718a5822eSThomas Veerman   enum bfd_architecture arch;
220818a5822eSThomas Veerman   unsigned long mach;
220918a5822eSThomas Veerman   const char *arch_name;
221018a5822eSThomas Veerman   const char *printable_name;
221118a5822eSThomas Veerman   unsigned int section_align_power;
221218a5822eSThomas Veerman   /* TRUE if this is the default machine for the architecture.
221318a5822eSThomas Veerman      The default arch should be the first entry for an arch so that
221418a5822eSThomas Veerman      all the entries for that arch can be accessed via <<next>>.  */
221518a5822eSThomas Veerman   bfd_boolean the_default;
221618a5822eSThomas Veerman   const struct bfd_arch_info * (*compatible)
221718a5822eSThomas Veerman     (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
221818a5822eSThomas Veerman 
221918a5822eSThomas Veerman   bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
222018a5822eSThomas Veerman 
2221*c9ea9e7aSLionel Sambuc   /* Allocate via bfd_malloc and return a fill buffer of size COUNT.  If
2222*c9ea9e7aSLionel Sambuc      IS_BIGENDIAN is TRUE, the order of bytes is big endian.  If CODE is
2223*c9ea9e7aSLionel Sambuc      TRUE, the buffer contains code.  */
2224*c9ea9e7aSLionel Sambuc   void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian,
2225*c9ea9e7aSLionel Sambuc                  bfd_boolean code);
2226*c9ea9e7aSLionel Sambuc 
222718a5822eSThomas Veerman   const struct bfd_arch_info *next;
222818a5822eSThomas Veerman }
222918a5822eSThomas Veerman bfd_arch_info_type;
223018a5822eSThomas Veerman 
223118a5822eSThomas Veerman const char *bfd_printable_name (bfd *abfd);
223218a5822eSThomas Veerman 
223318a5822eSThomas Veerman const bfd_arch_info_type *bfd_scan_arch (const char *string);
223418a5822eSThomas Veerman 
223518a5822eSThomas Veerman const char **bfd_arch_list (void);
223618a5822eSThomas Veerman 
223718a5822eSThomas Veerman const bfd_arch_info_type *bfd_arch_get_compatible
223818a5822eSThomas Veerman    (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
223918a5822eSThomas Veerman 
224018a5822eSThomas Veerman void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
224118a5822eSThomas Veerman 
224218a5822eSThomas Veerman enum bfd_architecture bfd_get_arch (bfd *abfd);
224318a5822eSThomas Veerman 
224418a5822eSThomas Veerman unsigned long bfd_get_mach (bfd *abfd);
224518a5822eSThomas Veerman 
224618a5822eSThomas Veerman unsigned int bfd_arch_bits_per_byte (bfd *abfd);
224718a5822eSThomas Veerman 
224818a5822eSThomas Veerman unsigned int bfd_arch_bits_per_address (bfd *abfd);
224918a5822eSThomas Veerman 
225018a5822eSThomas Veerman const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
225118a5822eSThomas Veerman 
225218a5822eSThomas Veerman const bfd_arch_info_type *bfd_lookup_arch
225318a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
225418a5822eSThomas Veerman 
225518a5822eSThomas Veerman const char *bfd_printable_arch_mach
225618a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
225718a5822eSThomas Veerman 
225818a5822eSThomas Veerman unsigned int bfd_octets_per_byte (bfd *abfd);
225918a5822eSThomas Veerman 
226018a5822eSThomas Veerman unsigned int bfd_arch_mach_octets_per_byte
226118a5822eSThomas Veerman    (enum bfd_architecture arch, unsigned long machine);
226218a5822eSThomas Veerman 
226318a5822eSThomas Veerman /* Extracted from reloc.c.  */
226418a5822eSThomas Veerman typedef enum bfd_reloc_status
226518a5822eSThomas Veerman {
226618a5822eSThomas Veerman   /* No errors detected.  */
226718a5822eSThomas Veerman   bfd_reloc_ok,
226818a5822eSThomas Veerman 
226918a5822eSThomas Veerman   /* The relocation was performed, but there was an overflow.  */
227018a5822eSThomas Veerman   bfd_reloc_overflow,
227118a5822eSThomas Veerman 
227218a5822eSThomas Veerman   /* The address to relocate was not within the section supplied.  */
227318a5822eSThomas Veerman   bfd_reloc_outofrange,
227418a5822eSThomas Veerman 
227518a5822eSThomas Veerman   /* Used by special functions.  */
227618a5822eSThomas Veerman   bfd_reloc_continue,
227718a5822eSThomas Veerman 
227818a5822eSThomas Veerman   /* Unsupported relocation size requested.  */
227918a5822eSThomas Veerman   bfd_reloc_notsupported,
228018a5822eSThomas Veerman 
228118a5822eSThomas Veerman   /* Unused.  */
228218a5822eSThomas Veerman   bfd_reloc_other,
228318a5822eSThomas Veerman 
228418a5822eSThomas Veerman   /* The symbol to relocate against was undefined.  */
228518a5822eSThomas Veerman   bfd_reloc_undefined,
228618a5822eSThomas Veerman 
228718a5822eSThomas Veerman   /* The relocation was performed, but may not be ok - presently
228818a5822eSThomas Veerman      generated only when linking i960 coff files with i960 b.out
228918a5822eSThomas Veerman      symbols.  If this type is returned, the error_message argument
229018a5822eSThomas Veerman      to bfd_perform_relocation will be set.  */
229118a5822eSThomas Veerman   bfd_reloc_dangerous
229218a5822eSThomas Veerman  }
229318a5822eSThomas Veerman  bfd_reloc_status_type;
229418a5822eSThomas Veerman 
229518a5822eSThomas Veerman 
229618a5822eSThomas Veerman typedef struct reloc_cache_entry
229718a5822eSThomas Veerman {
229818a5822eSThomas Veerman   /* A pointer into the canonical table of pointers.  */
229918a5822eSThomas Veerman   struct bfd_symbol **sym_ptr_ptr;
230018a5822eSThomas Veerman 
230118a5822eSThomas Veerman   /* offset in section.  */
230218a5822eSThomas Veerman   bfd_size_type address;
230318a5822eSThomas Veerman 
230418a5822eSThomas Veerman   /* addend for relocation value.  */
230518a5822eSThomas Veerman   bfd_vma addend;
230618a5822eSThomas Veerman 
230718a5822eSThomas Veerman   /* Pointer to how to perform the required relocation.  */
230818a5822eSThomas Veerman   reloc_howto_type *howto;
230918a5822eSThomas Veerman 
231018a5822eSThomas Veerman }
231118a5822eSThomas Veerman arelent;
231218a5822eSThomas Veerman 
231318a5822eSThomas Veerman enum complain_overflow
231418a5822eSThomas Veerman {
231518a5822eSThomas Veerman   /* Do not complain on overflow.  */
231618a5822eSThomas Veerman   complain_overflow_dont,
231718a5822eSThomas Veerman 
231818a5822eSThomas Veerman   /* Complain if the value overflows when considered as a signed
231918a5822eSThomas Veerman      number one bit larger than the field.  ie. A bitfield of N bits
232018a5822eSThomas Veerman      is allowed to represent -2**n to 2**n-1.  */
232118a5822eSThomas Veerman   complain_overflow_bitfield,
232218a5822eSThomas Veerman 
232318a5822eSThomas Veerman   /* Complain if the value overflows when considered as a signed
232418a5822eSThomas Veerman      number.  */
232518a5822eSThomas Veerman   complain_overflow_signed,
232618a5822eSThomas Veerman 
232718a5822eSThomas Veerman   /* Complain if the value overflows when considered as an
232818a5822eSThomas Veerman      unsigned number.  */
232918a5822eSThomas Veerman   complain_overflow_unsigned
233018a5822eSThomas Veerman };
233118a5822eSThomas Veerman 
233218a5822eSThomas Veerman struct reloc_howto_struct
233318a5822eSThomas Veerman {
233418a5822eSThomas Veerman   /*  The type field has mainly a documentary use - the back end can
233518a5822eSThomas Veerman       do what it wants with it, though normally the back end's
233618a5822eSThomas Veerman       external idea of what a reloc number is stored
233718a5822eSThomas Veerman       in this field.  For example, a PC relative word relocation
233818a5822eSThomas Veerman       in a coff environment has the type 023 - because that's
233918a5822eSThomas Veerman       what the outside world calls a R_PCRWORD reloc.  */
234018a5822eSThomas Veerman   unsigned int type;
234118a5822eSThomas Veerman 
234218a5822eSThomas Veerman   /*  The value the final relocation is shifted right by.  This drops
234318a5822eSThomas Veerman       unwanted data from the relocation.  */
234418a5822eSThomas Veerman   unsigned int rightshift;
234518a5822eSThomas Veerman 
234618a5822eSThomas Veerman   /*  The size of the item to be relocated.  This is *not* a
234718a5822eSThomas Veerman       power-of-two measure.  To get the number of bytes operated
234818a5822eSThomas Veerman       on by a type of relocation, use bfd_get_reloc_size.  */
234918a5822eSThomas Veerman   int size;
235018a5822eSThomas Veerman 
235118a5822eSThomas Veerman   /*  The number of bits in the item to be relocated.  This is used
235218a5822eSThomas Veerman       when doing overflow checking.  */
235318a5822eSThomas Veerman   unsigned int bitsize;
235418a5822eSThomas Veerman 
235518a5822eSThomas Veerman   /*  The relocation is relative to the field being relocated.  */
235618a5822eSThomas Veerman   bfd_boolean pc_relative;
235718a5822eSThomas Veerman 
235818a5822eSThomas Veerman   /*  The bit position of the reloc value in the destination.
235918a5822eSThomas Veerman       The relocated value is left shifted by this amount.  */
236018a5822eSThomas Veerman   unsigned int bitpos;
236118a5822eSThomas Veerman 
236218a5822eSThomas Veerman   /* What type of overflow error should be checked for when
236318a5822eSThomas Veerman      relocating.  */
236418a5822eSThomas Veerman   enum complain_overflow complain_on_overflow;
236518a5822eSThomas Veerman 
236618a5822eSThomas Veerman   /* If this field is non null, then the supplied function is
236718a5822eSThomas Veerman      called rather than the normal function.  This allows really
236818a5822eSThomas Veerman      strange relocation methods to be accommodated (e.g., i960 callj
236918a5822eSThomas Veerman      instructions).  */
237018a5822eSThomas Veerman   bfd_reloc_status_type (*special_function)
237118a5822eSThomas Veerman     (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
237218a5822eSThomas Veerman      bfd *, char **);
237318a5822eSThomas Veerman 
237418a5822eSThomas Veerman   /* The textual name of the relocation type.  */
237518a5822eSThomas Veerman   char *name;
237618a5822eSThomas Veerman 
237718a5822eSThomas Veerman   /* Some formats record a relocation addend in the section contents
237818a5822eSThomas Veerman      rather than with the relocation.  For ELF formats this is the
237918a5822eSThomas Veerman      distinction between USE_REL and USE_RELA (though the code checks
238018a5822eSThomas Veerman      for USE_REL == 1/0).  The value of this field is TRUE if the
238118a5822eSThomas Veerman      addend is recorded with the section contents; when performing a
238218a5822eSThomas Veerman      partial link (ld -r) the section contents (the data) will be
238318a5822eSThomas Veerman      modified.  The value of this field is FALSE if addends are
238418a5822eSThomas Veerman      recorded with the relocation (in arelent.addend); when performing
238518a5822eSThomas Veerman      a partial link the relocation will be modified.
238618a5822eSThomas Veerman      All relocations for all ELF USE_RELA targets should set this field
238718a5822eSThomas Veerman      to FALSE (values of TRUE should be looked on with suspicion).
238818a5822eSThomas Veerman      However, the converse is not true: not all relocations of all ELF
238918a5822eSThomas Veerman      USE_REL targets set this field to TRUE.  Why this is so is peculiar
239018a5822eSThomas Veerman      to each particular target.  For relocs that aren't used in partial
239118a5822eSThomas Veerman      links (e.g. GOT stuff) it doesn't matter what this is set to.  */
239218a5822eSThomas Veerman   bfd_boolean partial_inplace;
239318a5822eSThomas Veerman 
239418a5822eSThomas Veerman   /* src_mask selects the part of the instruction (or data) to be used
239518a5822eSThomas Veerman      in the relocation sum.  If the target relocations don't have an
239618a5822eSThomas Veerman      addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
239718a5822eSThomas Veerman      dst_mask to extract the addend from the section contents.  If
239818a5822eSThomas Veerman      relocations do have an addend in the reloc, eg. ELF USE_RELA, this
239918a5822eSThomas Veerman      field should be zero.  Non-zero values for ELF USE_RELA targets are
240018a5822eSThomas Veerman      bogus as in those cases the value in the dst_mask part of the
240118a5822eSThomas Veerman      section contents should be treated as garbage.  */
240218a5822eSThomas Veerman   bfd_vma src_mask;
240318a5822eSThomas Veerman 
240418a5822eSThomas Veerman   /* dst_mask selects which parts of the instruction (or data) are
240518a5822eSThomas Veerman      replaced with a relocated value.  */
240618a5822eSThomas Veerman   bfd_vma dst_mask;
240718a5822eSThomas Veerman 
240818a5822eSThomas Veerman   /* When some formats create PC relative instructions, they leave
240918a5822eSThomas Veerman      the value of the pc of the place being relocated in the offset
241018a5822eSThomas Veerman      slot of the instruction, so that a PC relative relocation can
241118a5822eSThomas Veerman      be made just by adding in an ordinary offset (e.g., sun3 a.out).
241218a5822eSThomas Veerman      Some formats leave the displacement part of an instruction
241318a5822eSThomas Veerman      empty (e.g., m88k bcs); this flag signals the fact.  */
241418a5822eSThomas Veerman   bfd_boolean pcrel_offset;
241518a5822eSThomas Veerman };
241618a5822eSThomas Veerman 
241718a5822eSThomas Veerman #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
241818a5822eSThomas Veerman   { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
241918a5822eSThomas Veerman #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
242018a5822eSThomas Veerman   HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
242118a5822eSThomas Veerman          NAME, FALSE, 0, 0, IN)
242218a5822eSThomas Veerman 
242318a5822eSThomas Veerman #define EMPTY_HOWTO(C) \
242418a5822eSThomas Veerman   HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
242518a5822eSThomas Veerman          NULL, FALSE, 0, 0, FALSE)
242618a5822eSThomas Veerman 
242718a5822eSThomas Veerman #define HOWTO_PREPARE(relocation, symbol)               \
242818a5822eSThomas Veerman   {                                                     \
242918a5822eSThomas Veerman     if (symbol != NULL)                                 \
243018a5822eSThomas Veerman       {                                                 \
243118a5822eSThomas Veerman         if (bfd_is_com_section (symbol->section))       \
243218a5822eSThomas Veerman           {                                             \
243318a5822eSThomas Veerman             relocation = 0;                             \
243418a5822eSThomas Veerman           }                                             \
243518a5822eSThomas Veerman         else                                            \
243618a5822eSThomas Veerman           {                                             \
243718a5822eSThomas Veerman             relocation = symbol->value;                 \
243818a5822eSThomas Veerman           }                                             \
243918a5822eSThomas Veerman       }                                                 \
244018a5822eSThomas Veerman   }
244118a5822eSThomas Veerman 
244218a5822eSThomas Veerman unsigned int bfd_get_reloc_size (reloc_howto_type *);
244318a5822eSThomas Veerman 
244418a5822eSThomas Veerman typedef struct relent_chain
244518a5822eSThomas Veerman {
244618a5822eSThomas Veerman   arelent relent;
244718a5822eSThomas Veerman   struct relent_chain *next;
244818a5822eSThomas Veerman }
244918a5822eSThomas Veerman arelent_chain;
245018a5822eSThomas Veerman 
245118a5822eSThomas Veerman bfd_reloc_status_type bfd_check_overflow
245218a5822eSThomas Veerman    (enum complain_overflow how,
245318a5822eSThomas Veerman     unsigned int bitsize,
245418a5822eSThomas Veerman     unsigned int rightshift,
245518a5822eSThomas Veerman     unsigned int addrsize,
245618a5822eSThomas Veerman     bfd_vma relocation);
245718a5822eSThomas Veerman 
245818a5822eSThomas Veerman bfd_reloc_status_type bfd_perform_relocation
245918a5822eSThomas Veerman    (bfd *abfd,
246018a5822eSThomas Veerman     arelent *reloc_entry,
246118a5822eSThomas Veerman     void *data,
246218a5822eSThomas Veerman     asection *input_section,
246318a5822eSThomas Veerman     bfd *output_bfd,
246418a5822eSThomas Veerman     char **error_message);
246518a5822eSThomas Veerman 
246618a5822eSThomas Veerman bfd_reloc_status_type bfd_install_relocation
246718a5822eSThomas Veerman    (bfd *abfd,
246818a5822eSThomas Veerman     arelent *reloc_entry,
246918a5822eSThomas Veerman     void *data, bfd_vma data_start,
247018a5822eSThomas Veerman     asection *input_section,
247118a5822eSThomas Veerman     char **error_message);
247218a5822eSThomas Veerman 
247318a5822eSThomas Veerman enum bfd_reloc_code_real {
247418a5822eSThomas Veerman   _dummy_first_bfd_reloc_code_real,
247518a5822eSThomas Veerman 
247618a5822eSThomas Veerman 
247718a5822eSThomas Veerman /* Basic absolute relocations of N bits.  */
247818a5822eSThomas Veerman   BFD_RELOC_64,
247918a5822eSThomas Veerman   BFD_RELOC_32,
248018a5822eSThomas Veerman   BFD_RELOC_26,
248118a5822eSThomas Veerman   BFD_RELOC_24,
248218a5822eSThomas Veerman   BFD_RELOC_16,
248318a5822eSThomas Veerman   BFD_RELOC_14,
248418a5822eSThomas Veerman   BFD_RELOC_8,
248518a5822eSThomas Veerman 
248618a5822eSThomas Veerman /* PC-relative relocations.  Sometimes these are relative to the address
248718a5822eSThomas Veerman of the relocation itself; sometimes they are relative to the start of
248818a5822eSThomas Veerman the section containing the relocation.  It depends on the specific target.
248918a5822eSThomas Veerman 
249018a5822eSThomas Veerman The 24-bit relocation is used in some Intel 960 configurations.  */
249118a5822eSThomas Veerman   BFD_RELOC_64_PCREL,
249218a5822eSThomas Veerman   BFD_RELOC_32_PCREL,
249318a5822eSThomas Veerman   BFD_RELOC_24_PCREL,
249418a5822eSThomas Veerman   BFD_RELOC_16_PCREL,
249518a5822eSThomas Veerman   BFD_RELOC_12_PCREL,
249618a5822eSThomas Veerman   BFD_RELOC_8_PCREL,
249718a5822eSThomas Veerman 
249818a5822eSThomas Veerman /* Section relative relocations.  Some targets need this for DWARF2.  */
249918a5822eSThomas Veerman   BFD_RELOC_32_SECREL,
250018a5822eSThomas Veerman 
250118a5822eSThomas Veerman /* For ELF.  */
250218a5822eSThomas Veerman   BFD_RELOC_32_GOT_PCREL,
250318a5822eSThomas Veerman   BFD_RELOC_16_GOT_PCREL,
250418a5822eSThomas Veerman   BFD_RELOC_8_GOT_PCREL,
250518a5822eSThomas Veerman   BFD_RELOC_32_GOTOFF,
250618a5822eSThomas Veerman   BFD_RELOC_16_GOTOFF,
250718a5822eSThomas Veerman   BFD_RELOC_LO16_GOTOFF,
250818a5822eSThomas Veerman   BFD_RELOC_HI16_GOTOFF,
250918a5822eSThomas Veerman   BFD_RELOC_HI16_S_GOTOFF,
251018a5822eSThomas Veerman   BFD_RELOC_8_GOTOFF,
251118a5822eSThomas Veerman   BFD_RELOC_64_PLT_PCREL,
251218a5822eSThomas Veerman   BFD_RELOC_32_PLT_PCREL,
251318a5822eSThomas Veerman   BFD_RELOC_24_PLT_PCREL,
251418a5822eSThomas Veerman   BFD_RELOC_16_PLT_PCREL,
251518a5822eSThomas Veerman   BFD_RELOC_8_PLT_PCREL,
251618a5822eSThomas Veerman   BFD_RELOC_64_PLTOFF,
251718a5822eSThomas Veerman   BFD_RELOC_32_PLTOFF,
251818a5822eSThomas Veerman   BFD_RELOC_16_PLTOFF,
251918a5822eSThomas Veerman   BFD_RELOC_LO16_PLTOFF,
252018a5822eSThomas Veerman   BFD_RELOC_HI16_PLTOFF,
252118a5822eSThomas Veerman   BFD_RELOC_HI16_S_PLTOFF,
252218a5822eSThomas Veerman   BFD_RELOC_8_PLTOFF,
252318a5822eSThomas Veerman 
252418a5822eSThomas Veerman /* Relocations used by 68K ELF.  */
252518a5822eSThomas Veerman   BFD_RELOC_68K_GLOB_DAT,
252618a5822eSThomas Veerman   BFD_RELOC_68K_JMP_SLOT,
252718a5822eSThomas Veerman   BFD_RELOC_68K_RELATIVE,
252818a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD32,
252918a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD16,
253018a5822eSThomas Veerman   BFD_RELOC_68K_TLS_GD8,
253118a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM32,
253218a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM16,
253318a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDM8,
253418a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO32,
253518a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO16,
253618a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LDO8,
253718a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE32,
253818a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE16,
253918a5822eSThomas Veerman   BFD_RELOC_68K_TLS_IE8,
254018a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE32,
254118a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE16,
254218a5822eSThomas Veerman   BFD_RELOC_68K_TLS_LE8,
254318a5822eSThomas Veerman 
254418a5822eSThomas Veerman /* Linkage-table relative.  */
254518a5822eSThomas Veerman   BFD_RELOC_32_BASEREL,
254618a5822eSThomas Veerman   BFD_RELOC_16_BASEREL,
254718a5822eSThomas Veerman   BFD_RELOC_LO16_BASEREL,
254818a5822eSThomas Veerman   BFD_RELOC_HI16_BASEREL,
254918a5822eSThomas Veerman   BFD_RELOC_HI16_S_BASEREL,
255018a5822eSThomas Veerman   BFD_RELOC_8_BASEREL,
255118a5822eSThomas Veerman   BFD_RELOC_RVA,
255218a5822eSThomas Veerman 
255318a5822eSThomas Veerman /* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
255418a5822eSThomas Veerman   BFD_RELOC_8_FFnn,
255518a5822eSThomas Veerman 
255618a5822eSThomas Veerman /* These PC-relative relocations are stored as word displacements --
255718a5822eSThomas Veerman i.e., byte displacements shifted right two bits.  The 30-bit word
255818a5822eSThomas Veerman displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
255918a5822eSThomas Veerman SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
256018a5822eSThomas Veerman signed 16-bit displacement is used on the MIPS, and the 23-bit
256118a5822eSThomas Veerman displacement is used on the Alpha.  */
256218a5822eSThomas Veerman   BFD_RELOC_32_PCREL_S2,
256318a5822eSThomas Veerman   BFD_RELOC_16_PCREL_S2,
256418a5822eSThomas Veerman   BFD_RELOC_23_PCREL_S2,
256518a5822eSThomas Veerman 
256618a5822eSThomas Veerman /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
256718a5822eSThomas Veerman the target word.  These are used on the SPARC.  */
256818a5822eSThomas Veerman   BFD_RELOC_HI22,
256918a5822eSThomas Veerman   BFD_RELOC_LO10,
257018a5822eSThomas Veerman 
257118a5822eSThomas Veerman /* For systems that allocate a Global Pointer register, these are
257218a5822eSThomas Veerman displacements off that register.  These relocation types are
257318a5822eSThomas Veerman handled specially, because the value the register will have is
257418a5822eSThomas Veerman decided relatively late.  */
257518a5822eSThomas Veerman   BFD_RELOC_GPREL16,
257618a5822eSThomas Veerman   BFD_RELOC_GPREL32,
257718a5822eSThomas Veerman 
257818a5822eSThomas Veerman /* Reloc types used for i960/b.out.  */
257918a5822eSThomas Veerman   BFD_RELOC_I960_CALLJ,
258018a5822eSThomas Veerman 
258118a5822eSThomas Veerman /* SPARC ELF relocations.  There is probably some overlap with other
258218a5822eSThomas Veerman relocation types already defined.  */
258318a5822eSThomas Veerman   BFD_RELOC_NONE,
258418a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP22,
258518a5822eSThomas Veerman   BFD_RELOC_SPARC22,
258618a5822eSThomas Veerman   BFD_RELOC_SPARC13,
258718a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT10,
258818a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT13,
258918a5822eSThomas Veerman   BFD_RELOC_SPARC_GOT22,
259018a5822eSThomas Veerman   BFD_RELOC_SPARC_PC10,
259118a5822eSThomas Veerman   BFD_RELOC_SPARC_PC22,
259218a5822eSThomas Veerman   BFD_RELOC_SPARC_WPLT30,
259318a5822eSThomas Veerman   BFD_RELOC_SPARC_COPY,
259418a5822eSThomas Veerman   BFD_RELOC_SPARC_GLOB_DAT,
259518a5822eSThomas Veerman   BFD_RELOC_SPARC_JMP_SLOT,
259618a5822eSThomas Veerman   BFD_RELOC_SPARC_RELATIVE,
259718a5822eSThomas Veerman   BFD_RELOC_SPARC_UA16,
259818a5822eSThomas Veerman   BFD_RELOC_SPARC_UA32,
259918a5822eSThomas Veerman   BFD_RELOC_SPARC_UA64,
260018a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_HIX22,
260118a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_LOX10,
260218a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
260318a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
260418a5822eSThomas Veerman   BFD_RELOC_SPARC_GOTDATA_OP,
260518a5822eSThomas Veerman   BFD_RELOC_SPARC_JMP_IREL,
260618a5822eSThomas Veerman   BFD_RELOC_SPARC_IRELATIVE,
260718a5822eSThomas Veerman 
260818a5822eSThomas Veerman /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
260918a5822eSThomas Veerman   BFD_RELOC_SPARC_BASE13,
261018a5822eSThomas Veerman   BFD_RELOC_SPARC_BASE22,
261118a5822eSThomas Veerman 
261218a5822eSThomas Veerman /* SPARC64 relocations  */
261318a5822eSThomas Veerman #define BFD_RELOC_SPARC_64 BFD_RELOC_64
261418a5822eSThomas Veerman   BFD_RELOC_SPARC_10,
261518a5822eSThomas Veerman   BFD_RELOC_SPARC_11,
261618a5822eSThomas Veerman   BFD_RELOC_SPARC_OLO10,
261718a5822eSThomas Veerman   BFD_RELOC_SPARC_HH22,
261818a5822eSThomas Veerman   BFD_RELOC_SPARC_HM10,
261918a5822eSThomas Veerman   BFD_RELOC_SPARC_LM22,
262018a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_HH22,
262118a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_HM10,
262218a5822eSThomas Veerman   BFD_RELOC_SPARC_PC_LM22,
262318a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP16,
262418a5822eSThomas Veerman   BFD_RELOC_SPARC_WDISP19,
262518a5822eSThomas Veerman   BFD_RELOC_SPARC_7,
262618a5822eSThomas Veerman   BFD_RELOC_SPARC_6,
262718a5822eSThomas Veerman   BFD_RELOC_SPARC_5,
262818a5822eSThomas Veerman #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
262918a5822eSThomas Veerman   BFD_RELOC_SPARC_PLT32,
263018a5822eSThomas Veerman   BFD_RELOC_SPARC_PLT64,
263118a5822eSThomas Veerman   BFD_RELOC_SPARC_HIX22,
263218a5822eSThomas Veerman   BFD_RELOC_SPARC_LOX10,
263318a5822eSThomas Veerman   BFD_RELOC_SPARC_H44,
263418a5822eSThomas Veerman   BFD_RELOC_SPARC_M44,
263518a5822eSThomas Veerman   BFD_RELOC_SPARC_L44,
263618a5822eSThomas Veerman   BFD_RELOC_SPARC_REGISTER,
2637*c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_H34,
2638*c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_SIZE32,
2639*c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_SIZE64,
2640*c9ea9e7aSLionel Sambuc   BFD_RELOC_SPARC_WDISP10,
264118a5822eSThomas Veerman 
264218a5822eSThomas Veerman /* SPARC little endian relocation  */
264318a5822eSThomas Veerman   BFD_RELOC_SPARC_REV32,
264418a5822eSThomas Veerman 
264518a5822eSThomas Veerman /* SPARC TLS relocations  */
264618a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_HI22,
264718a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_LO10,
264818a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_ADD,
264918a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_GD_CALL,
265018a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_HI22,
265118a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_LO10,
265218a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_ADD,
265318a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDM_CALL,
265418a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_HIX22,
265518a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_LOX10,
265618a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LDO_ADD,
265718a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_HI22,
265818a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LO10,
265918a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LD,
266018a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_LDX,
266118a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_IE_ADD,
266218a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LE_HIX22,
266318a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_LE_LOX10,
266418a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPMOD32,
266518a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPMOD64,
266618a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPOFF32,
266718a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_DTPOFF64,
266818a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_TPOFF32,
266918a5822eSThomas Veerman   BFD_RELOC_SPARC_TLS_TPOFF64,
267018a5822eSThomas Veerman 
267118a5822eSThomas Veerman /* SPU Relocations.  */
267218a5822eSThomas Veerman   BFD_RELOC_SPU_IMM7,
267318a5822eSThomas Veerman   BFD_RELOC_SPU_IMM8,
267418a5822eSThomas Veerman   BFD_RELOC_SPU_IMM10,
267518a5822eSThomas Veerman   BFD_RELOC_SPU_IMM10W,
267618a5822eSThomas Veerman   BFD_RELOC_SPU_IMM16,
267718a5822eSThomas Veerman   BFD_RELOC_SPU_IMM16W,
267818a5822eSThomas Veerman   BFD_RELOC_SPU_IMM18,
267918a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL9a,
268018a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL9b,
268118a5822eSThomas Veerman   BFD_RELOC_SPU_PCREL16,
268218a5822eSThomas Veerman   BFD_RELOC_SPU_LO16,
268318a5822eSThomas Veerman   BFD_RELOC_SPU_HI16,
268418a5822eSThomas Veerman   BFD_RELOC_SPU_PPU32,
268518a5822eSThomas Veerman   BFD_RELOC_SPU_PPU64,
268618a5822eSThomas Veerman   BFD_RELOC_SPU_ADD_PIC,
268718a5822eSThomas Veerman 
268818a5822eSThomas Veerman /* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
268918a5822eSThomas Veerman "addend" in some special way.
269018a5822eSThomas Veerman For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
269118a5822eSThomas Veerman writing; when reading, it will be the absolute section symbol.  The
269218a5822eSThomas Veerman addend is the displacement in bytes of the "lda" instruction from
269318a5822eSThomas Veerman the "ldah" instruction (which is at the address of this reloc).  */
269418a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP_HI16,
269518a5822eSThomas Veerman 
269618a5822eSThomas Veerman /* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
269718a5822eSThomas Veerman with GPDISP_HI16 relocs.  The addend is ignored when writing the
269818a5822eSThomas Veerman relocations out, and is filled in with the file's GP value on
269918a5822eSThomas Veerman reading, for convenience.  */
270018a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP_LO16,
270118a5822eSThomas Veerman 
270218a5822eSThomas Veerman /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
270318a5822eSThomas Veerman relocation except that there is no accompanying GPDISP_LO16
270418a5822eSThomas Veerman relocation.  */
270518a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPDISP,
270618a5822eSThomas Veerman 
270718a5822eSThomas Veerman /* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
270818a5822eSThomas Veerman the assembler turns it into a LDQ instruction to load the address of
270918a5822eSThomas Veerman the symbol, and then fills in a register in the real instruction.
271018a5822eSThomas Veerman 
271118a5822eSThomas Veerman The LITERAL reloc, at the LDQ instruction, refers to the .lita
271218a5822eSThomas Veerman section symbol.  The addend is ignored when writing, but is filled
271318a5822eSThomas Veerman in with the file's GP value on reading, for convenience, as with the
271418a5822eSThomas Veerman GPDISP_LO16 reloc.
271518a5822eSThomas Veerman 
271618a5822eSThomas Veerman The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
271718a5822eSThomas Veerman It should refer to the symbol to be referenced, as with 16_GOTOFF,
271818a5822eSThomas Veerman but it generates output not based on the position within the .got
271918a5822eSThomas Veerman section, but relative to the GP value chosen for the file during the
272018a5822eSThomas Veerman final link stage.
272118a5822eSThomas Veerman 
272218a5822eSThomas Veerman The LITUSE reloc, on the instruction using the loaded address, gives
272318a5822eSThomas Veerman information to the linker that it might be able to use to optimize
272418a5822eSThomas Veerman away some literal section references.  The symbol is ignored (read
272518a5822eSThomas Veerman as the absolute section symbol), and the "addend" indicates the type
272618a5822eSThomas Veerman of instruction using the register:
272718a5822eSThomas Veerman 1 - "memory" fmt insn
272818a5822eSThomas Veerman 2 - byte-manipulation (byte offset reg)
272918a5822eSThomas Veerman 3 - jsr (target of branch)  */
273018a5822eSThomas Veerman   BFD_RELOC_ALPHA_LITERAL,
273118a5822eSThomas Veerman   BFD_RELOC_ALPHA_ELF_LITERAL,
273218a5822eSThomas Veerman   BFD_RELOC_ALPHA_LITUSE,
273318a5822eSThomas Veerman 
273418a5822eSThomas Veerman /* The HINT relocation indicates a value that should be filled into the
273518a5822eSThomas Veerman "hint" field of a jmp/jsr/ret instruction, for possible branch-
273618a5822eSThomas Veerman prediction logic which may be provided on some processors.  */
273718a5822eSThomas Veerman   BFD_RELOC_ALPHA_HINT,
273818a5822eSThomas Veerman 
273918a5822eSThomas Veerman /* The LINKAGE relocation outputs a linkage pair in the object file,
274018a5822eSThomas Veerman which is filled by the linker.  */
274118a5822eSThomas Veerman   BFD_RELOC_ALPHA_LINKAGE,
274218a5822eSThomas Veerman 
274318a5822eSThomas Veerman /* The CODEADDR relocation outputs a STO_CA in the object file,
274418a5822eSThomas Veerman which is filled by the linker.  */
274518a5822eSThomas Veerman   BFD_RELOC_ALPHA_CODEADDR,
274618a5822eSThomas Veerman 
274718a5822eSThomas Veerman /* The GPREL_HI/LO relocations together form a 32-bit offset from the
274818a5822eSThomas Veerman GP register.  */
274918a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPREL_HI16,
275018a5822eSThomas Veerman   BFD_RELOC_ALPHA_GPREL_LO16,
275118a5822eSThomas Veerman 
275218a5822eSThomas Veerman /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
275318a5822eSThomas Veerman share a common GP, and the target address is adjusted for
275418a5822eSThomas Veerman STO_ALPHA_STD_GPLOAD.  */
275518a5822eSThomas Veerman   BFD_RELOC_ALPHA_BRSGP,
275618a5822eSThomas Veerman 
275718a5822eSThomas Veerman /* The NOP relocation outputs a NOP if the longword displacement
275818a5822eSThomas Veerman between two procedure entry points is < 2^21.  */
275918a5822eSThomas Veerman   BFD_RELOC_ALPHA_NOP,
276018a5822eSThomas Veerman 
276118a5822eSThomas Veerman /* The BSR relocation outputs a BSR if the longword displacement
276218a5822eSThomas Veerman between two procedure entry points is < 2^21.  */
276318a5822eSThomas Veerman   BFD_RELOC_ALPHA_BSR,
276418a5822eSThomas Veerman 
276518a5822eSThomas Veerman /* The LDA relocation outputs a LDA if the longword displacement
276618a5822eSThomas Veerman between two procedure entry points is < 2^16.  */
276718a5822eSThomas Veerman   BFD_RELOC_ALPHA_LDA,
276818a5822eSThomas Veerman 
276918a5822eSThomas Veerman /* The BOH relocation outputs a BSR if the longword displacement
277018a5822eSThomas Veerman between two procedure entry points is < 2^21, or else a hint.  */
277118a5822eSThomas Veerman   BFD_RELOC_ALPHA_BOH,
277218a5822eSThomas Veerman 
277318a5822eSThomas Veerman /* Alpha thread-local storage relocations.  */
277418a5822eSThomas Veerman   BFD_RELOC_ALPHA_TLSGD,
277518a5822eSThomas Veerman   BFD_RELOC_ALPHA_TLSLDM,
277618a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPMOD64,
277718a5822eSThomas Veerman   BFD_RELOC_ALPHA_GOTDTPREL16,
277818a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL64,
277918a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL_HI16,
278018a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL_LO16,
278118a5822eSThomas Veerman   BFD_RELOC_ALPHA_DTPREL16,
278218a5822eSThomas Veerman   BFD_RELOC_ALPHA_GOTTPREL16,
278318a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL64,
278418a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL_HI16,
278518a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL_LO16,
278618a5822eSThomas Veerman   BFD_RELOC_ALPHA_TPREL16,
278718a5822eSThomas Veerman 
2788*c9ea9e7aSLionel Sambuc /* The MIPS jump instruction.  */
278918a5822eSThomas Veerman   BFD_RELOC_MIPS_JMP,
2790*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_JMP,
279118a5822eSThomas Veerman 
279218a5822eSThomas Veerman /* The MIPS16 jump instruction.  */
279318a5822eSThomas Veerman   BFD_RELOC_MIPS16_JMP,
279418a5822eSThomas Veerman 
279518a5822eSThomas Veerman /* MIPS16 GP relative reloc.  */
279618a5822eSThomas Veerman   BFD_RELOC_MIPS16_GPREL,
279718a5822eSThomas Veerman 
279818a5822eSThomas Veerman /* High 16 bits of 32-bit value; simple reloc.  */
279918a5822eSThomas Veerman   BFD_RELOC_HI16,
280018a5822eSThomas Veerman 
280118a5822eSThomas Veerman /* High 16 bits of 32-bit value but the low 16 bits will be sign
280218a5822eSThomas Veerman extended and added to form the final result.  If the low 16
280318a5822eSThomas Veerman bits form a negative number, we need to add one to the high value
280418a5822eSThomas Veerman to compensate for the borrow when the low bits are added.  */
280518a5822eSThomas Veerman   BFD_RELOC_HI16_S,
280618a5822eSThomas Veerman 
280718a5822eSThomas Veerman /* Low 16 bits.  */
280818a5822eSThomas Veerman   BFD_RELOC_LO16,
280918a5822eSThomas Veerman 
281018a5822eSThomas Veerman /* High 16 bits of 32-bit pc-relative value  */
281118a5822eSThomas Veerman   BFD_RELOC_HI16_PCREL,
281218a5822eSThomas Veerman 
281318a5822eSThomas Veerman /* High 16 bits of 32-bit pc-relative value, adjusted  */
281418a5822eSThomas Veerman   BFD_RELOC_HI16_S_PCREL,
281518a5822eSThomas Veerman 
281618a5822eSThomas Veerman /* Low 16 bits of pc-relative value  */
281718a5822eSThomas Veerman   BFD_RELOC_LO16_PCREL,
281818a5822eSThomas Veerman 
281918a5822eSThomas Veerman /* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of
282018a5822eSThomas Veerman 16-bit immediate fields  */
282118a5822eSThomas Veerman   BFD_RELOC_MIPS16_GOT16,
282218a5822eSThomas Veerman   BFD_RELOC_MIPS16_CALL16,
282318a5822eSThomas Veerman 
282418a5822eSThomas Veerman /* MIPS16 high 16 bits of 32-bit value.  */
282518a5822eSThomas Veerman   BFD_RELOC_MIPS16_HI16,
282618a5822eSThomas Veerman 
282718a5822eSThomas Veerman /* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
282818a5822eSThomas Veerman extended and added to form the final result.  If the low 16
282918a5822eSThomas Veerman bits form a negative number, we need to add one to the high value
283018a5822eSThomas Veerman to compensate for the borrow when the low bits are added.  */
283118a5822eSThomas Veerman   BFD_RELOC_MIPS16_HI16_S,
283218a5822eSThomas Veerman 
283318a5822eSThomas Veerman /* MIPS16 low 16 bits.  */
283418a5822eSThomas Veerman   BFD_RELOC_MIPS16_LO16,
283518a5822eSThomas Veerman 
2836*c9ea9e7aSLionel Sambuc /* MIPS16 TLS relocations  */
2837*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_GD,
2838*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_LDM,
2839*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_DTPREL_HI16,
2840*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
2841*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_GOTTPREL,
2842*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_TPREL_HI16,
2843*c9ea9e7aSLionel Sambuc   BFD_RELOC_MIPS16_TLS_TPREL_LO16,
2844*c9ea9e7aSLionel Sambuc 
284518a5822eSThomas Veerman /* Relocation against a MIPS literal section.  */
284618a5822eSThomas Veerman   BFD_RELOC_MIPS_LITERAL,
2847*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_LITERAL,
2848*c9ea9e7aSLionel Sambuc 
2849*c9ea9e7aSLionel Sambuc /* microMIPS PC-relative relocations.  */
2850*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_7_PCREL_S1,
2851*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_10_PCREL_S1,
2852*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_16_PCREL_S1,
2853*c9ea9e7aSLionel Sambuc 
2854*c9ea9e7aSLionel Sambuc /* microMIPS versions of generic BFD relocs.  */
2855*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GPREL16,
2856*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HI16,
2857*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HI16_S,
2858*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_LO16,
285918a5822eSThomas Veerman 
286018a5822eSThomas Veerman /* MIPS ELF relocations.  */
286118a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT16,
2862*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT16,
286318a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL16,
2864*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL16,
286518a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_HI16,
2866*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_HI16,
286718a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_LO16,
2868*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_LO16,
286918a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL_HI16,
2870*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL_HI16,
287118a5822eSThomas Veerman   BFD_RELOC_MIPS_CALL_LO16,
2872*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_CALL_LO16,
287318a5822eSThomas Veerman   BFD_RELOC_MIPS_SUB,
2874*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_SUB,
287518a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_PAGE,
2876*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_PAGE,
287718a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_OFST,
2878*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_OFST,
287918a5822eSThomas Veerman   BFD_RELOC_MIPS_GOT_DISP,
2880*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_GOT_DISP,
288118a5822eSThomas Veerman   BFD_RELOC_MIPS_SHIFT5,
288218a5822eSThomas Veerman   BFD_RELOC_MIPS_SHIFT6,
288318a5822eSThomas Veerman   BFD_RELOC_MIPS_INSERT_A,
288418a5822eSThomas Veerman   BFD_RELOC_MIPS_INSERT_B,
288518a5822eSThomas Veerman   BFD_RELOC_MIPS_DELETE,
288618a5822eSThomas Veerman   BFD_RELOC_MIPS_HIGHEST,
2887*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HIGHEST,
288818a5822eSThomas Veerman   BFD_RELOC_MIPS_HIGHER,
2889*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_HIGHER,
289018a5822eSThomas Veerman   BFD_RELOC_MIPS_SCN_DISP,
2891*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_SCN_DISP,
289218a5822eSThomas Veerman   BFD_RELOC_MIPS_REL16,
289318a5822eSThomas Veerman   BFD_RELOC_MIPS_RELGOT,
289418a5822eSThomas Veerman   BFD_RELOC_MIPS_JALR,
2895*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_JALR,
289618a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPMOD32,
289718a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL32,
289818a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPMOD64,
289918a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL64,
290018a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_GD,
2901*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_GD,
290218a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_LDM,
2903*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_LDM,
290418a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL_HI16,
2905*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
290618a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_DTPREL_LO16,
2907*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
290818a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_GOTTPREL,
2909*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
291018a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL32,
291118a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL64,
291218a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL_HI16,
2913*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
291418a5822eSThomas Veerman   BFD_RELOC_MIPS_TLS_TPREL_LO16,
2915*c9ea9e7aSLionel Sambuc   BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
291618a5822eSThomas Veerman 
291718a5822eSThomas Veerman 
291818a5822eSThomas Veerman /* MIPS ELF relocations (VxWorks and PLT extensions).  */
291918a5822eSThomas Veerman   BFD_RELOC_MIPS_COPY,
292018a5822eSThomas Veerman   BFD_RELOC_MIPS_JUMP_SLOT,
292118a5822eSThomas Veerman 
292218a5822eSThomas Veerman 
292318a5822eSThomas Veerman /* Moxie ELF relocations.  */
292418a5822eSThomas Veerman   BFD_RELOC_MOXIE_10_PCREL,
292518a5822eSThomas Veerman 
292618a5822eSThomas Veerman 
292718a5822eSThomas Veerman /* Fujitsu Frv Relocations.  */
292818a5822eSThomas Veerman   BFD_RELOC_FRV_LABEL16,
292918a5822eSThomas Veerman   BFD_RELOC_FRV_LABEL24,
293018a5822eSThomas Veerman   BFD_RELOC_FRV_LO16,
293118a5822eSThomas Veerman   BFD_RELOC_FRV_HI16,
293218a5822eSThomas Veerman   BFD_RELOC_FRV_GPREL12,
293318a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELU12,
293418a5822eSThomas Veerman   BFD_RELOC_FRV_GPREL32,
293518a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELHI,
293618a5822eSThomas Veerman   BFD_RELOC_FRV_GPRELLO,
293718a5822eSThomas Veerman   BFD_RELOC_FRV_GOT12,
293818a5822eSThomas Veerman   BFD_RELOC_FRV_GOTHI,
293918a5822eSThomas Veerman   BFD_RELOC_FRV_GOTLO,
294018a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC,
294118a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOT12,
294218a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTHI,
294318a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTLO,
294418a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_VALUE,
294518a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
294618a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
294718a5822eSThomas Veerman   BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
294818a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFF12,
294918a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFFHI,
295018a5822eSThomas Veerman   BFD_RELOC_FRV_GOTOFFLO,
295118a5822eSThomas Veerman   BFD_RELOC_FRV_GETTLSOFF,
295218a5822eSThomas Veerman   BFD_RELOC_FRV_TLSDESC_VALUE,
295318a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESC12,
295418a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESCHI,
295518a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSDESCLO,
295618a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFF12,
295718a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFFHI,
295818a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFFLO,
295918a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFF12,
296018a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFFHI,
296118a5822eSThomas Veerman   BFD_RELOC_FRV_GOTTLSOFFLO,
296218a5822eSThomas Veerman   BFD_RELOC_FRV_TLSOFF,
296318a5822eSThomas Veerman   BFD_RELOC_FRV_TLSDESC_RELAX,
296418a5822eSThomas Veerman   BFD_RELOC_FRV_GETTLSOFF_RELAX,
296518a5822eSThomas Veerman   BFD_RELOC_FRV_TLSOFF_RELAX,
296618a5822eSThomas Veerman   BFD_RELOC_FRV_TLSMOFF,
296718a5822eSThomas Veerman 
296818a5822eSThomas Veerman 
296918a5822eSThomas Veerman /* This is a 24bit GOT-relative reloc for the mn10300.  */
297018a5822eSThomas Veerman   BFD_RELOC_MN10300_GOTOFF24,
297118a5822eSThomas Veerman 
297218a5822eSThomas Veerman /* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
297318a5822eSThomas Veerman in the instruction.  */
297418a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT32,
297518a5822eSThomas Veerman 
297618a5822eSThomas Veerman /* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
297718a5822eSThomas Veerman in the instruction.  */
297818a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT24,
297918a5822eSThomas Veerman 
298018a5822eSThomas Veerman /* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
298118a5822eSThomas Veerman in the instruction.  */
298218a5822eSThomas Veerman   BFD_RELOC_MN10300_GOT16,
298318a5822eSThomas Veerman 
298418a5822eSThomas Veerman /* Copy symbol at runtime.  */
298518a5822eSThomas Veerman   BFD_RELOC_MN10300_COPY,
298618a5822eSThomas Veerman 
298718a5822eSThomas Veerman /* Create GOT entry.  */
298818a5822eSThomas Veerman   BFD_RELOC_MN10300_GLOB_DAT,
298918a5822eSThomas Veerman 
299018a5822eSThomas Veerman /* Create PLT entry.  */
299118a5822eSThomas Veerman   BFD_RELOC_MN10300_JMP_SLOT,
299218a5822eSThomas Veerman 
299318a5822eSThomas Veerman /* Adjust by program base.  */
299418a5822eSThomas Veerman   BFD_RELOC_MN10300_RELATIVE,
299518a5822eSThomas Veerman 
299618a5822eSThomas Veerman /* Together with another reloc targeted at the same location,
299718a5822eSThomas Veerman allows for a value that is the difference of two symbols
299818a5822eSThomas Veerman in the same section.  */
299918a5822eSThomas Veerman   BFD_RELOC_MN10300_SYM_DIFF,
300018a5822eSThomas Veerman 
300118a5822eSThomas Veerman /* The addend of this reloc is an alignment power that must
300218a5822eSThomas Veerman be honoured at the offset's location, regardless of linker
300318a5822eSThomas Veerman relaxation.  */
300418a5822eSThomas Veerman   BFD_RELOC_MN10300_ALIGN,
300518a5822eSThomas Veerman 
3006*c9ea9e7aSLionel Sambuc /* Various TLS-related relocations.  */
3007*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_GD,
3008*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LD,
3009*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LDO,
3010*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_GOTIE,
3011*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_IE,
3012*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_LE,
3013*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_DTPMOD,
3014*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_DTPOFF,
3015*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_TLS_TPOFF,
3016*c9ea9e7aSLionel Sambuc 
3017*c9ea9e7aSLionel Sambuc /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
3018*c9ea9e7aSLionel Sambuc instruction.  */
3019*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_32_PCREL,
3020*c9ea9e7aSLionel Sambuc 
3021*c9ea9e7aSLionel Sambuc /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
3022*c9ea9e7aSLionel Sambuc instruction.  */
3023*c9ea9e7aSLionel Sambuc   BFD_RELOC_MN10300_16_PCREL,
3024*c9ea9e7aSLionel Sambuc 
302518a5822eSThomas Veerman 
302618a5822eSThomas Veerman /* i386/elf relocations  */
302718a5822eSThomas Veerman   BFD_RELOC_386_GOT32,
302818a5822eSThomas Veerman   BFD_RELOC_386_PLT32,
302918a5822eSThomas Veerman   BFD_RELOC_386_COPY,
303018a5822eSThomas Veerman   BFD_RELOC_386_GLOB_DAT,
303118a5822eSThomas Veerman   BFD_RELOC_386_JUMP_SLOT,
303218a5822eSThomas Veerman   BFD_RELOC_386_RELATIVE,
303318a5822eSThomas Veerman   BFD_RELOC_386_GOTOFF,
303418a5822eSThomas Veerman   BFD_RELOC_386_GOTPC,
303518a5822eSThomas Veerman   BFD_RELOC_386_TLS_TPOFF,
303618a5822eSThomas Veerman   BFD_RELOC_386_TLS_IE,
303718a5822eSThomas Veerman   BFD_RELOC_386_TLS_GOTIE,
303818a5822eSThomas Veerman   BFD_RELOC_386_TLS_LE,
303918a5822eSThomas Veerman   BFD_RELOC_386_TLS_GD,
304018a5822eSThomas Veerman   BFD_RELOC_386_TLS_LDM,
304118a5822eSThomas Veerman   BFD_RELOC_386_TLS_LDO_32,
304218a5822eSThomas Veerman   BFD_RELOC_386_TLS_IE_32,
304318a5822eSThomas Veerman   BFD_RELOC_386_TLS_LE_32,
304418a5822eSThomas Veerman   BFD_RELOC_386_TLS_DTPMOD32,
304518a5822eSThomas Veerman   BFD_RELOC_386_TLS_DTPOFF32,
304618a5822eSThomas Veerman   BFD_RELOC_386_TLS_TPOFF32,
304718a5822eSThomas Veerman   BFD_RELOC_386_TLS_GOTDESC,
304818a5822eSThomas Veerman   BFD_RELOC_386_TLS_DESC_CALL,
304918a5822eSThomas Veerman   BFD_RELOC_386_TLS_DESC,
305018a5822eSThomas Veerman   BFD_RELOC_386_IRELATIVE,
305118a5822eSThomas Veerman 
305218a5822eSThomas Veerman /* x86-64/elf relocations  */
305318a5822eSThomas Veerman   BFD_RELOC_X86_64_GOT32,
305418a5822eSThomas Veerman   BFD_RELOC_X86_64_PLT32,
305518a5822eSThomas Veerman   BFD_RELOC_X86_64_COPY,
305618a5822eSThomas Veerman   BFD_RELOC_X86_64_GLOB_DAT,
305718a5822eSThomas Veerman   BFD_RELOC_X86_64_JUMP_SLOT,
305818a5822eSThomas Veerman   BFD_RELOC_X86_64_RELATIVE,
305918a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPCREL,
306018a5822eSThomas Veerman   BFD_RELOC_X86_64_32S,
306118a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPMOD64,
306218a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPOFF64,
306318a5822eSThomas Veerman   BFD_RELOC_X86_64_TPOFF64,
306418a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSGD,
306518a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSLD,
306618a5822eSThomas Veerman   BFD_RELOC_X86_64_DTPOFF32,
306718a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTTPOFF,
306818a5822eSThomas Veerman   BFD_RELOC_X86_64_TPOFF32,
306918a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTOFF64,
307018a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC32,
307118a5822eSThomas Veerman   BFD_RELOC_X86_64_GOT64,
307218a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPCREL64,
307318a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC64,
307418a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPLT64,
307518a5822eSThomas Veerman   BFD_RELOC_X86_64_PLTOFF64,
307618a5822eSThomas Veerman   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
307718a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSDESC_CALL,
307818a5822eSThomas Veerman   BFD_RELOC_X86_64_TLSDESC,
307918a5822eSThomas Veerman   BFD_RELOC_X86_64_IRELATIVE,
308018a5822eSThomas Veerman 
308118a5822eSThomas Veerman /* ns32k relocations  */
308218a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_8,
308318a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_16,
308418a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_32,
308518a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_8_PCREL,
308618a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_16_PCREL,
308718a5822eSThomas Veerman   BFD_RELOC_NS32K_IMM_32_PCREL,
308818a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_8,
308918a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_16,
309018a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_32,
309118a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_8_PCREL,
309218a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_16_PCREL,
309318a5822eSThomas Veerman   BFD_RELOC_NS32K_DISP_32_PCREL,
309418a5822eSThomas Veerman 
309518a5822eSThomas Veerman /* PDP11 relocations  */
309618a5822eSThomas Veerman   BFD_RELOC_PDP11_DISP_8_PCREL,
309718a5822eSThomas Veerman   BFD_RELOC_PDP11_DISP_6_PCREL,
309818a5822eSThomas Veerman 
309918a5822eSThomas Veerman /* Picojava relocs.  Not all of these appear in object files.  */
310018a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_HI16,
310118a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_LO16,
310218a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_DIR16,
310318a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_DIR32,
310418a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_REL16,
310518a5822eSThomas Veerman   BFD_RELOC_PJ_CODE_REL32,
310618a5822eSThomas Veerman 
310718a5822eSThomas Veerman /* Power(rs6000) and PowerPC relocations.  */
310818a5822eSThomas Veerman   BFD_RELOC_PPC_B26,
310918a5822eSThomas Veerman   BFD_RELOC_PPC_BA26,
311018a5822eSThomas Veerman   BFD_RELOC_PPC_TOC16,
311118a5822eSThomas Veerman   BFD_RELOC_PPC_B16,
311218a5822eSThomas Veerman   BFD_RELOC_PPC_B16_BRTAKEN,
311318a5822eSThomas Veerman   BFD_RELOC_PPC_B16_BRNTAKEN,
311418a5822eSThomas Veerman   BFD_RELOC_PPC_BA16,
311518a5822eSThomas Veerman   BFD_RELOC_PPC_BA16_BRTAKEN,
311618a5822eSThomas Veerman   BFD_RELOC_PPC_BA16_BRNTAKEN,
311718a5822eSThomas Veerman   BFD_RELOC_PPC_COPY,
311818a5822eSThomas Veerman   BFD_RELOC_PPC_GLOB_DAT,
311918a5822eSThomas Veerman   BFD_RELOC_PPC_JMP_SLOT,
312018a5822eSThomas Veerman   BFD_RELOC_PPC_RELATIVE,
312118a5822eSThomas Veerman   BFD_RELOC_PPC_LOCAL24PC,
312218a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR32,
312318a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16,
312418a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_LO,
312518a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_HI,
312618a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_NADDR16_HA,
312718a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDAI16,
312818a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA2I16,
312918a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA2REL,
313018a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_SDA21,
313118a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_MRKREF,
313218a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELSEC16,
313318a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_LO,
313418a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_HI,
313518a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELST_HA,
313618a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_BIT_FLD,
313718a5822eSThomas Veerman   BFD_RELOC_PPC_EMB_RELSDA,
3138*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL8,
3139*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL15,
3140*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_REL24,
3141*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_LO16A,
3142*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_LO16D,
3143*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HI16A,
3144*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HI16D,
3145*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HA16A,
3146*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_HA16D,
3147*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDA21,
3148*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDA21_LO,
3149*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_LO16A,
3150*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_LO16D,
3151*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HI16A,
3152*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HI16D,
3153*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HA16A,
3154*c9ea9e7aSLionel Sambuc   BFD_RELOC_PPC_VLE_SDAREL_HA16D,
315518a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHER,
315618a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHER_S,
315718a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHEST,
315818a5822eSThomas Veerman   BFD_RELOC_PPC64_HIGHEST_S,
315918a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_LO,
316018a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_HI,
316118a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_HA,
316218a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC,
316318a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16,
316418a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_LO,
316518a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_HI,
316618a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_HA,
316718a5822eSThomas Veerman   BFD_RELOC_PPC64_ADDR16_DS,
316818a5822eSThomas Veerman   BFD_RELOC_PPC64_ADDR16_LO_DS,
316918a5822eSThomas Veerman   BFD_RELOC_PPC64_GOT16_DS,
317018a5822eSThomas Veerman   BFD_RELOC_PPC64_GOT16_LO_DS,
317118a5822eSThomas Veerman   BFD_RELOC_PPC64_PLT16_LO_DS,
317218a5822eSThomas Veerman   BFD_RELOC_PPC64_SECTOFF_DS,
317318a5822eSThomas Veerman   BFD_RELOC_PPC64_SECTOFF_LO_DS,
317418a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_DS,
317518a5822eSThomas Veerman   BFD_RELOC_PPC64_TOC16_LO_DS,
317618a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_DS,
317718a5822eSThomas Veerman   BFD_RELOC_PPC64_PLTGOT16_LO_DS,
317818a5822eSThomas Veerman 
317918a5822eSThomas Veerman /* PowerPC and PowerPC64 thread-local storage relocations.  */
318018a5822eSThomas Veerman   BFD_RELOC_PPC_TLS,
318118a5822eSThomas Veerman   BFD_RELOC_PPC_TLSGD,
318218a5822eSThomas Veerman   BFD_RELOC_PPC_TLSLD,
318318a5822eSThomas Veerman   BFD_RELOC_PPC_DTPMOD,
318418a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16,
318518a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_LO,
318618a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_HI,
318718a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL16_HA,
318818a5822eSThomas Veerman   BFD_RELOC_PPC_TPREL,
318918a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16,
319018a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_LO,
319118a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_HI,
319218a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL16_HA,
319318a5822eSThomas Veerman   BFD_RELOC_PPC_DTPREL,
319418a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16,
319518a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_LO,
319618a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_HI,
319718a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSGD16_HA,
319818a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16,
319918a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_LO,
320018a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_HI,
320118a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TLSLD16_HA,
320218a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16,
320318a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_LO,
320418a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_HI,
320518a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_TPREL16_HA,
320618a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16,
320718a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_LO,
320818a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_HI,
320918a5822eSThomas Veerman   BFD_RELOC_PPC_GOT_DTPREL16_HA,
321018a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_DS,
321118a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_LO_DS,
321218a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHER,
321318a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHERA,
321418a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHEST,
321518a5822eSThomas Veerman   BFD_RELOC_PPC64_TPREL16_HIGHESTA,
321618a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_DS,
321718a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_LO_DS,
321818a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHER,
321918a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHERA,
322018a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHEST,
322118a5822eSThomas Veerman   BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
322218a5822eSThomas Veerman 
322318a5822eSThomas Veerman /* IBM 370/390 relocations  */
322418a5822eSThomas Veerman   BFD_RELOC_I370_D12,
322518a5822eSThomas Veerman 
322618a5822eSThomas Veerman /* The type of reloc used to build a constructor table - at the moment
322718a5822eSThomas Veerman probably a 32 bit wide absolute relocation, but the target can choose.
322818a5822eSThomas Veerman It generally does map to one of the other relocation types.  */
322918a5822eSThomas Veerman   BFD_RELOC_CTOR,
323018a5822eSThomas Veerman 
323118a5822eSThomas Veerman /* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
323218a5822eSThomas Veerman not stored in the instruction.  */
323318a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_BRANCH,
323418a5822eSThomas Veerman 
323518a5822eSThomas Veerman /* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
323618a5822eSThomas Veerman not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
323718a5822eSThomas Veerman field in the instruction.  */
323818a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_BLX,
323918a5822eSThomas Veerman 
324018a5822eSThomas Veerman /* Thumb 22 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_THUMB_PCREL_BLX,
324418a5822eSThomas Veerman 
324518a5822eSThomas Veerman /* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
324618a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_CALL,
324718a5822eSThomas Veerman 
324818a5822eSThomas Veerman /* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
324918a5822eSThomas Veerman   BFD_RELOC_ARM_PCREL_JUMP,
325018a5822eSThomas Veerman 
325118a5822eSThomas Veerman /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
325218a5822eSThomas Veerman The lowest bit must be zero and is not stored in the instruction.
325318a5822eSThomas Veerman Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
325418a5822eSThomas Veerman "nn" one smaller in all cases.  Note further that BRANCH23
325518a5822eSThomas Veerman corresponds to R_ARM_THM_CALL.  */
325618a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH7,
325718a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH9,
325818a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH12,
325918a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH20,
326018a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH23,
326118a5822eSThomas Veerman   BFD_RELOC_THUMB_PCREL_BRANCH25,
326218a5822eSThomas Veerman 
326318a5822eSThomas Veerman /* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
326418a5822eSThomas Veerman   BFD_RELOC_ARM_OFFSET_IMM,
326518a5822eSThomas Veerman 
326618a5822eSThomas Veerman /* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
326718a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_OFFSET,
326818a5822eSThomas Veerman 
326918a5822eSThomas Veerman /* Pc-relative or absolute relocation depending on target.  Used for
327018a5822eSThomas Veerman entries in .init_array sections.  */
327118a5822eSThomas Veerman   BFD_RELOC_ARM_TARGET1,
327218a5822eSThomas Veerman 
327318a5822eSThomas Veerman /* Read-only segment base relative address.  */
327418a5822eSThomas Veerman   BFD_RELOC_ARM_ROSEGREL32,
327518a5822eSThomas Veerman 
327618a5822eSThomas Veerman /* Data segment base relative address.  */
327718a5822eSThomas Veerman   BFD_RELOC_ARM_SBREL32,
327818a5822eSThomas Veerman 
327918a5822eSThomas Veerman /* This reloc is used for references to RTTI data from exception handling
328018a5822eSThomas Veerman tables.  The actual definition depends on the target.  It may be a
328118a5822eSThomas Veerman pc-relative or some form of GOT-indirect relocation.  */
328218a5822eSThomas Veerman   BFD_RELOC_ARM_TARGET2,
328318a5822eSThomas Veerman 
328418a5822eSThomas Veerman /* 31-bit PC relative address.  */
328518a5822eSThomas Veerman   BFD_RELOC_ARM_PREL31,
328618a5822eSThomas Veerman 
328718a5822eSThomas Veerman /* Low and High halfword relocations for MOVW and MOVT instructions.  */
328818a5822eSThomas Veerman   BFD_RELOC_ARM_MOVW,
328918a5822eSThomas Veerman   BFD_RELOC_ARM_MOVT,
329018a5822eSThomas Veerman   BFD_RELOC_ARM_MOVW_PCREL,
329118a5822eSThomas Veerman   BFD_RELOC_ARM_MOVT_PCREL,
329218a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVW,
329318a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVT,
329418a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVW_PCREL,
329518a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_MOVT_PCREL,
329618a5822eSThomas Veerman 
329718a5822eSThomas Veerman /* Relocations for setting up GOTs and PLTs for shared libraries.  */
329818a5822eSThomas Veerman   BFD_RELOC_ARM_JUMP_SLOT,
329918a5822eSThomas Veerman   BFD_RELOC_ARM_GLOB_DAT,
330018a5822eSThomas Veerman   BFD_RELOC_ARM_GOT32,
330118a5822eSThomas Veerman   BFD_RELOC_ARM_PLT32,
330218a5822eSThomas Veerman   BFD_RELOC_ARM_RELATIVE,
330318a5822eSThomas Veerman   BFD_RELOC_ARM_GOTOFF,
330418a5822eSThomas Veerman   BFD_RELOC_ARM_GOTPC,
330518a5822eSThomas Veerman   BFD_RELOC_ARM_GOT_PREL,
330618a5822eSThomas Veerman 
330718a5822eSThomas Veerman /* ARM thread-local storage relocations.  */
330818a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_GD32,
330918a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LDO32,
331018a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LDM32,
331118a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_DTPOFF32,
331218a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_DTPMOD32,
331318a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_TPOFF32,
331418a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_IE32,
331518a5822eSThomas Veerman   BFD_RELOC_ARM_TLS_LE32,
3316*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_GOTDESC,
3317*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_CALL,
3318*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_THM_TLS_CALL,
3319*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_DESCSEQ,
3320*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_THM_TLS_DESCSEQ,
3321*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_TLS_DESC,
332218a5822eSThomas Veerman 
332318a5822eSThomas Veerman /* ARM group relocations.  */
332418a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G0_NC,
332518a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G0,
332618a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G1_NC,
332718a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G1,
332818a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_PC_G2,
332918a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G0,
333018a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G1,
333118a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_PC_G2,
333218a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G0,
333318a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G1,
333418a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_PC_G2,
333518a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G0,
333618a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G1,
333718a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_PC_G2,
333818a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G0_NC,
333918a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G0,
334018a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G1_NC,
334118a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G1,
334218a5822eSThomas Veerman   BFD_RELOC_ARM_ALU_SB_G2,
334318a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G0,
334418a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G1,
334518a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_SB_G2,
334618a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G0,
334718a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G1,
334818a5822eSThomas Veerman   BFD_RELOC_ARM_LDRS_SB_G2,
334918a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G0,
335018a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G1,
335118a5822eSThomas Veerman   BFD_RELOC_ARM_LDC_SB_G2,
335218a5822eSThomas Veerman 
335318a5822eSThomas Veerman /* Annotation of BX instructions.  */
335418a5822eSThomas Veerman   BFD_RELOC_ARM_V4BX,
335518a5822eSThomas Veerman 
3356*c9ea9e7aSLionel Sambuc /* ARM support for STT_GNU_IFUNC.  */
3357*c9ea9e7aSLionel Sambuc   BFD_RELOC_ARM_IRELATIVE,
3358*c9ea9e7aSLionel Sambuc 
335918a5822eSThomas Veerman /* These relocs are only used within the ARM assembler.  They are not
336018a5822eSThomas Veerman (at present) written to any object files.  */
336118a5822eSThomas Veerman   BFD_RELOC_ARM_IMMEDIATE,
336218a5822eSThomas Veerman   BFD_RELOC_ARM_ADRL_IMMEDIATE,
336318a5822eSThomas Veerman   BFD_RELOC_ARM_T32_IMMEDIATE,
336418a5822eSThomas Veerman   BFD_RELOC_ARM_T32_ADD_IMM,
336518a5822eSThomas Veerman   BFD_RELOC_ARM_T32_IMM12,
336618a5822eSThomas Veerman   BFD_RELOC_ARM_T32_ADD_PC12,
336718a5822eSThomas Veerman   BFD_RELOC_ARM_SHIFT_IMM,
336818a5822eSThomas Veerman   BFD_RELOC_ARM_SMC,
336918a5822eSThomas Veerman   BFD_RELOC_ARM_HVC,
337018a5822eSThomas Veerman   BFD_RELOC_ARM_SWI,
337118a5822eSThomas Veerman   BFD_RELOC_ARM_MULTI,
337218a5822eSThomas Veerman   BFD_RELOC_ARM_CP_OFF_IMM,
337318a5822eSThomas Veerman   BFD_RELOC_ARM_CP_OFF_IMM_S2,
337418a5822eSThomas Veerman   BFD_RELOC_ARM_T32_CP_OFF_IMM,
337518a5822eSThomas Veerman   BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
337618a5822eSThomas Veerman   BFD_RELOC_ARM_ADR_IMM,
337718a5822eSThomas Veerman   BFD_RELOC_ARM_LDR_IMM,
337818a5822eSThomas Veerman   BFD_RELOC_ARM_LITERAL,
337918a5822eSThomas Veerman   BFD_RELOC_ARM_IN_POOL,
338018a5822eSThomas Veerman   BFD_RELOC_ARM_OFFSET_IMM8,
338118a5822eSThomas Veerman   BFD_RELOC_ARM_T32_OFFSET_U8,
338218a5822eSThomas Veerman   BFD_RELOC_ARM_T32_OFFSET_IMM,
338318a5822eSThomas Veerman   BFD_RELOC_ARM_HWLITERAL,
338418a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_ADD,
338518a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_IMM,
338618a5822eSThomas Veerman   BFD_RELOC_ARM_THUMB_SHIFT,
338718a5822eSThomas Veerman 
338818a5822eSThomas Veerman /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
338918a5822eSThomas Veerman   BFD_RELOC_SH_PCDISP8BY2,
339018a5822eSThomas Veerman   BFD_RELOC_SH_PCDISP12BY2,
339118a5822eSThomas Veerman   BFD_RELOC_SH_IMM3,
339218a5822eSThomas Veerman   BFD_RELOC_SH_IMM3U,
339318a5822eSThomas Veerman   BFD_RELOC_SH_DISP12,
339418a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY2,
339518a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY4,
339618a5822eSThomas Veerman   BFD_RELOC_SH_DISP12BY8,
339718a5822eSThomas Veerman   BFD_RELOC_SH_DISP20,
339818a5822eSThomas Veerman   BFD_RELOC_SH_DISP20BY8,
339918a5822eSThomas Veerman   BFD_RELOC_SH_IMM4,
340018a5822eSThomas Veerman   BFD_RELOC_SH_IMM4BY2,
340118a5822eSThomas Veerman   BFD_RELOC_SH_IMM4BY4,
340218a5822eSThomas Veerman   BFD_RELOC_SH_IMM8,
340318a5822eSThomas Veerman   BFD_RELOC_SH_IMM8BY2,
340418a5822eSThomas Veerman   BFD_RELOC_SH_IMM8BY4,
340518a5822eSThomas Veerman   BFD_RELOC_SH_PCRELIMM8BY2,
340618a5822eSThomas Veerman   BFD_RELOC_SH_PCRELIMM8BY4,
340718a5822eSThomas Veerman   BFD_RELOC_SH_SWITCH16,
340818a5822eSThomas Veerman   BFD_RELOC_SH_SWITCH32,
340918a5822eSThomas Veerman   BFD_RELOC_SH_USES,
341018a5822eSThomas Veerman   BFD_RELOC_SH_COUNT,
341118a5822eSThomas Veerman   BFD_RELOC_SH_ALIGN,
341218a5822eSThomas Veerman   BFD_RELOC_SH_CODE,
341318a5822eSThomas Veerman   BFD_RELOC_SH_DATA,
341418a5822eSThomas Veerman   BFD_RELOC_SH_LABEL,
341518a5822eSThomas Veerman   BFD_RELOC_SH_LOOP_START,
341618a5822eSThomas Veerman   BFD_RELOC_SH_LOOP_END,
341718a5822eSThomas Veerman   BFD_RELOC_SH_COPY,
341818a5822eSThomas Veerman   BFD_RELOC_SH_GLOB_DAT,
341918a5822eSThomas Veerman   BFD_RELOC_SH_JMP_SLOT,
342018a5822eSThomas Veerman   BFD_RELOC_SH_RELATIVE,
342118a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC,
342218a5822eSThomas Veerman   BFD_RELOC_SH_GOT_LOW16,
342318a5822eSThomas Veerman   BFD_RELOC_SH_GOT_MEDLOW16,
342418a5822eSThomas Veerman   BFD_RELOC_SH_GOT_MEDHI16,
342518a5822eSThomas Veerman   BFD_RELOC_SH_GOT_HI16,
342618a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_LOW16,
342718a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_MEDLOW16,
342818a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_MEDHI16,
342918a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT_HI16,
343018a5822eSThomas Veerman   BFD_RELOC_SH_PLT_LOW16,
343118a5822eSThomas Veerman   BFD_RELOC_SH_PLT_MEDLOW16,
343218a5822eSThomas Veerman   BFD_RELOC_SH_PLT_MEDHI16,
343318a5822eSThomas Veerman   BFD_RELOC_SH_PLT_HI16,
343418a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_LOW16,
343518a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_MEDLOW16,
343618a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_MEDHI16,
343718a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF_HI16,
343818a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_LOW16,
343918a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_MEDLOW16,
344018a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_MEDHI16,
344118a5822eSThomas Veerman   BFD_RELOC_SH_GOTPC_HI16,
344218a5822eSThomas Veerman   BFD_RELOC_SH_COPY64,
344318a5822eSThomas Veerman   BFD_RELOC_SH_GLOB_DAT64,
344418a5822eSThomas Veerman   BFD_RELOC_SH_JMP_SLOT64,
344518a5822eSThomas Veerman   BFD_RELOC_SH_RELATIVE64,
344618a5822eSThomas Veerman   BFD_RELOC_SH_GOT10BY4,
344718a5822eSThomas Veerman   BFD_RELOC_SH_GOT10BY8,
344818a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT10BY4,
344918a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT10BY8,
345018a5822eSThomas Veerman   BFD_RELOC_SH_GOTPLT32,
345118a5822eSThomas Veerman   BFD_RELOC_SH_SHMEDIA_CODE,
345218a5822eSThomas Veerman   BFD_RELOC_SH_IMMU5,
345318a5822eSThomas Veerman   BFD_RELOC_SH_IMMS6,
345418a5822eSThomas Veerman   BFD_RELOC_SH_IMMS6BY32,
345518a5822eSThomas Veerman   BFD_RELOC_SH_IMMU6,
345618a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10,
345718a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY2,
345818a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY4,
345918a5822eSThomas Veerman   BFD_RELOC_SH_IMMS10BY8,
346018a5822eSThomas Veerman   BFD_RELOC_SH_IMMS16,
346118a5822eSThomas Veerman   BFD_RELOC_SH_IMMU16,
346218a5822eSThomas Veerman   BFD_RELOC_SH_IMM_LOW16,
346318a5822eSThomas Veerman   BFD_RELOC_SH_IMM_LOW16_PCREL,
346418a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDLOW16,
346518a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
346618a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDHI16,
346718a5822eSThomas Veerman   BFD_RELOC_SH_IMM_MEDHI16_PCREL,
346818a5822eSThomas Veerman   BFD_RELOC_SH_IMM_HI16,
346918a5822eSThomas Veerman   BFD_RELOC_SH_IMM_HI16_PCREL,
347018a5822eSThomas Veerman   BFD_RELOC_SH_PT_16,
347118a5822eSThomas Veerman   BFD_RELOC_SH_TLS_GD_32,
347218a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LD_32,
347318a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LDO_32,
347418a5822eSThomas Veerman   BFD_RELOC_SH_TLS_IE_32,
347518a5822eSThomas Veerman   BFD_RELOC_SH_TLS_LE_32,
347618a5822eSThomas Veerman   BFD_RELOC_SH_TLS_DTPMOD32,
347718a5822eSThomas Veerman   BFD_RELOC_SH_TLS_DTPOFF32,
347818a5822eSThomas Veerman   BFD_RELOC_SH_TLS_TPOFF32,
347918a5822eSThomas Veerman   BFD_RELOC_SH_GOT20,
348018a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFF20,
348118a5822eSThomas Veerman   BFD_RELOC_SH_GOTFUNCDESC,
348218a5822eSThomas Veerman   BFD_RELOC_SH_GOTFUNCDESC20,
348318a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFFFUNCDESC,
348418a5822eSThomas Veerman   BFD_RELOC_SH_GOTOFFFUNCDESC20,
348518a5822eSThomas Veerman   BFD_RELOC_SH_FUNCDESC,
348618a5822eSThomas Veerman 
348718a5822eSThomas Veerman /* ARC Cores relocs.
348818a5822eSThomas Veerman ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
348918a5822eSThomas Veerman not stored in the instruction.  The high 20 bits are installed in bits 26
349018a5822eSThomas Veerman through 7 of the instruction.  */
349118a5822eSThomas Veerman   BFD_RELOC_ARC_B22_PCREL,
349218a5822eSThomas Veerman 
349318a5822eSThomas Veerman /* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
349418a5822eSThomas Veerman stored in the instruction.  The high 24 bits are installed in bits 23
349518a5822eSThomas Veerman through 0.  */
349618a5822eSThomas Veerman   BFD_RELOC_ARC_B26,
349718a5822eSThomas Veerman 
349818a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc.  */
349918a5822eSThomas Veerman   BFD_RELOC_BFIN_16_IMM,
350018a5822eSThomas Veerman 
350118a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
350218a5822eSThomas Veerman   BFD_RELOC_BFIN_16_HIGH,
350318a5822eSThomas Veerman 
350418a5822eSThomas Veerman /* ADI Blackfin 'a' part of LSETUP.  */
350518a5822eSThomas Veerman   BFD_RELOC_BFIN_4_PCREL,
350618a5822eSThomas Veerman 
350718a5822eSThomas Veerman /* ADI Blackfin.  */
350818a5822eSThomas Veerman   BFD_RELOC_BFIN_5_PCREL,
350918a5822eSThomas Veerman 
351018a5822eSThomas Veerman /* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
351118a5822eSThomas Veerman   BFD_RELOC_BFIN_16_LOW,
351218a5822eSThomas Veerman 
351318a5822eSThomas Veerman /* ADI Blackfin.  */
351418a5822eSThomas Veerman   BFD_RELOC_BFIN_10_PCREL,
351518a5822eSThomas Veerman 
351618a5822eSThomas Veerman /* ADI Blackfin 'b' part of LSETUP.  */
351718a5822eSThomas Veerman   BFD_RELOC_BFIN_11_PCREL,
351818a5822eSThomas Veerman 
351918a5822eSThomas Veerman /* ADI Blackfin.  */
352018a5822eSThomas Veerman   BFD_RELOC_BFIN_12_PCREL_JUMP,
352118a5822eSThomas Veerman 
352218a5822eSThomas Veerman /* ADI Blackfin Short jump, pcrel.  */
352318a5822eSThomas Veerman   BFD_RELOC_BFIN_12_PCREL_JUMP_S,
352418a5822eSThomas Veerman 
352518a5822eSThomas Veerman /* ADI Blackfin Call.x not implemented.  */
352618a5822eSThomas Veerman   BFD_RELOC_BFIN_24_PCREL_CALL_X,
352718a5822eSThomas Veerman 
352818a5822eSThomas Veerman /* ADI Blackfin Long Jump pcrel.  */
352918a5822eSThomas Veerman   BFD_RELOC_BFIN_24_PCREL_JUMP_L,
353018a5822eSThomas Veerman 
353118a5822eSThomas Veerman /* ADI Blackfin FD-PIC relocations.  */
353218a5822eSThomas Veerman   BFD_RELOC_BFIN_GOT17M4,
353318a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTHI,
353418a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTLO,
353518a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC,
353618a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
353718a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTHI,
353818a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTLO,
353918a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_VALUE,
354018a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
354118a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
354218a5822eSThomas Veerman   BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
354318a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFF17M4,
354418a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFFHI,
354518a5822eSThomas Veerman   BFD_RELOC_BFIN_GOTOFFLO,
354618a5822eSThomas Veerman 
354718a5822eSThomas Veerman /* ADI Blackfin GOT relocation.  */
354818a5822eSThomas Veerman   BFD_RELOC_BFIN_GOT,
354918a5822eSThomas Veerman 
355018a5822eSThomas Veerman /* ADI Blackfin PLTPC relocation.  */
355118a5822eSThomas Veerman   BFD_RELOC_BFIN_PLTPC,
355218a5822eSThomas Veerman 
355318a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
355418a5822eSThomas Veerman   BFD_ARELOC_BFIN_PUSH,
355518a5822eSThomas Veerman 
355618a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
355718a5822eSThomas Veerman   BFD_ARELOC_BFIN_CONST,
355818a5822eSThomas Veerman 
355918a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356018a5822eSThomas Veerman   BFD_ARELOC_BFIN_ADD,
356118a5822eSThomas Veerman 
356218a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356318a5822eSThomas Veerman   BFD_ARELOC_BFIN_SUB,
356418a5822eSThomas Veerman 
356518a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356618a5822eSThomas Veerman   BFD_ARELOC_BFIN_MULT,
356718a5822eSThomas Veerman 
356818a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
356918a5822eSThomas Veerman   BFD_ARELOC_BFIN_DIV,
357018a5822eSThomas Veerman 
357118a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357218a5822eSThomas Veerman   BFD_ARELOC_BFIN_MOD,
357318a5822eSThomas Veerman 
357418a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357518a5822eSThomas Veerman   BFD_ARELOC_BFIN_LSHIFT,
357618a5822eSThomas Veerman 
357718a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
357818a5822eSThomas Veerman   BFD_ARELOC_BFIN_RSHIFT,
357918a5822eSThomas Veerman 
358018a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358118a5822eSThomas Veerman   BFD_ARELOC_BFIN_AND,
358218a5822eSThomas Veerman 
358318a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358418a5822eSThomas Veerman   BFD_ARELOC_BFIN_OR,
358518a5822eSThomas Veerman 
358618a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
358718a5822eSThomas Veerman   BFD_ARELOC_BFIN_XOR,
358818a5822eSThomas Veerman 
358918a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359018a5822eSThomas Veerman   BFD_ARELOC_BFIN_LAND,
359118a5822eSThomas Veerman 
359218a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359318a5822eSThomas Veerman   BFD_ARELOC_BFIN_LOR,
359418a5822eSThomas Veerman 
359518a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359618a5822eSThomas Veerman   BFD_ARELOC_BFIN_LEN,
359718a5822eSThomas Veerman 
359818a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
359918a5822eSThomas Veerman   BFD_ARELOC_BFIN_NEG,
360018a5822eSThomas Veerman 
360118a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360218a5822eSThomas Veerman   BFD_ARELOC_BFIN_COMP,
360318a5822eSThomas Veerman 
360418a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360518a5822eSThomas Veerman   BFD_ARELOC_BFIN_PAGE,
360618a5822eSThomas Veerman 
360718a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
360818a5822eSThomas Veerman   BFD_ARELOC_BFIN_HWPAGE,
360918a5822eSThomas Veerman 
361018a5822eSThomas Veerman /* ADI Blackfin arithmetic relocation.  */
361118a5822eSThomas Veerman   BFD_ARELOC_BFIN_ADDR,
361218a5822eSThomas Veerman 
361318a5822eSThomas Veerman /* Mitsubishi D10V relocs.
361418a5822eSThomas Veerman This is a 10-bit reloc with the right 2 bits
361518a5822eSThomas Veerman assumed to be 0.  */
361618a5822eSThomas Veerman   BFD_RELOC_D10V_10_PCREL_R,
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.  This is the same as the previous reloc
362118a5822eSThomas Veerman except it is in the left container, i.e.,
362218a5822eSThomas Veerman shifted left 15 bits.  */
362318a5822eSThomas Veerman   BFD_RELOC_D10V_10_PCREL_L,
362418a5822eSThomas Veerman 
362518a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits
362618a5822eSThomas Veerman assumed to be 0.  */
362718a5822eSThomas Veerman   BFD_RELOC_D10V_18,
362818a5822eSThomas Veerman 
362918a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits
363018a5822eSThomas Veerman assumed to be 0.  */
363118a5822eSThomas Veerman   BFD_RELOC_D10V_18_PCREL,
363218a5822eSThomas Veerman 
363318a5822eSThomas Veerman /* Mitsubishi D30V relocs.
363418a5822eSThomas Veerman This is a 6-bit absolute reloc.  */
363518a5822eSThomas Veerman   BFD_RELOC_D30V_6,
363618a5822eSThomas Veerman 
363718a5822eSThomas Veerman /* This is a 6-bit pc-relative reloc with
363818a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
363918a5822eSThomas Veerman   BFD_RELOC_D30V_9_PCREL,
364018a5822eSThomas Veerman 
364118a5822eSThomas Veerman /* This is a 6-bit pc-relative reloc with
364218a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
364318a5822eSThomas Veerman as the previous reloc but on the right side
364418a5822eSThomas Veerman of the container.  */
364518a5822eSThomas Veerman   BFD_RELOC_D30V_9_PCREL_R,
364618a5822eSThomas Veerman 
364718a5822eSThomas Veerman /* This is a 12-bit absolute reloc with the
364818a5822eSThomas Veerman right 3 bitsassumed to be 0.  */
364918a5822eSThomas Veerman   BFD_RELOC_D30V_15,
365018a5822eSThomas Veerman 
365118a5822eSThomas Veerman /* This is a 12-bit pc-relative reloc with
365218a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
365318a5822eSThomas Veerman   BFD_RELOC_D30V_15_PCREL,
365418a5822eSThomas Veerman 
365518a5822eSThomas Veerman /* This is a 12-bit pc-relative reloc with
365618a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
365718a5822eSThomas Veerman as the previous reloc but on the right side
365818a5822eSThomas Veerman of the container.  */
365918a5822eSThomas Veerman   BFD_RELOC_D30V_15_PCREL_R,
366018a5822eSThomas Veerman 
366118a5822eSThomas Veerman /* This is an 18-bit absolute reloc with
366218a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
366318a5822eSThomas Veerman   BFD_RELOC_D30V_21,
366418a5822eSThomas Veerman 
366518a5822eSThomas Veerman /* This is an 18-bit pc-relative reloc with
366618a5822eSThomas Veerman the right 3 bits assumed to be 0.  */
366718a5822eSThomas Veerman   BFD_RELOC_D30V_21_PCREL,
366818a5822eSThomas Veerman 
366918a5822eSThomas Veerman /* This is an 18-bit pc-relative reloc with
367018a5822eSThomas Veerman the right 3 bits assumed to be 0. Same
367118a5822eSThomas Veerman as the previous reloc but on the right side
367218a5822eSThomas Veerman of the container.  */
367318a5822eSThomas Veerman   BFD_RELOC_D30V_21_PCREL_R,
367418a5822eSThomas Veerman 
367518a5822eSThomas Veerman /* This is a 32-bit absolute reloc.  */
367618a5822eSThomas Veerman   BFD_RELOC_D30V_32,
367718a5822eSThomas Veerman 
367818a5822eSThomas Veerman /* This is a 32-bit pc-relative reloc.  */
367918a5822eSThomas Veerman   BFD_RELOC_D30V_32_PCREL,
368018a5822eSThomas Veerman 
368118a5822eSThomas Veerman /* DLX relocs  */
368218a5822eSThomas Veerman   BFD_RELOC_DLX_HI16_S,
368318a5822eSThomas Veerman 
368418a5822eSThomas Veerman /* DLX relocs  */
368518a5822eSThomas Veerman   BFD_RELOC_DLX_LO16,
368618a5822eSThomas Veerman 
368718a5822eSThomas Veerman /* DLX relocs  */
368818a5822eSThomas Veerman   BFD_RELOC_DLX_JMP26,
368918a5822eSThomas Veerman 
369018a5822eSThomas Veerman /* Renesas M16C/M32C Relocations.  */
369118a5822eSThomas Veerman   BFD_RELOC_M32C_HI8,
369218a5822eSThomas Veerman   BFD_RELOC_M32C_RL_JUMP,
369318a5822eSThomas Veerman   BFD_RELOC_M32C_RL_1ADDR,
369418a5822eSThomas Veerman   BFD_RELOC_M32C_RL_2ADDR,
369518a5822eSThomas Veerman 
369618a5822eSThomas Veerman /* Renesas M32R (formerly Mitsubishi M32R) relocs.
369718a5822eSThomas Veerman This is a 24 bit absolute address.  */
369818a5822eSThomas Veerman   BFD_RELOC_M32R_24,
369918a5822eSThomas Veerman 
370018a5822eSThomas Veerman /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
370118a5822eSThomas Veerman   BFD_RELOC_M32R_10_PCREL,
370218a5822eSThomas Veerman 
370318a5822eSThomas Veerman /* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
370418a5822eSThomas Veerman   BFD_RELOC_M32R_18_PCREL,
370518a5822eSThomas Veerman 
370618a5822eSThomas Veerman /* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
370718a5822eSThomas Veerman   BFD_RELOC_M32R_26_PCREL,
370818a5822eSThomas Veerman 
370918a5822eSThomas Veerman /* This is a 16-bit reloc containing the high 16 bits of an address
371018a5822eSThomas Veerman used when the lower 16 bits are treated as unsigned.  */
371118a5822eSThomas Veerman   BFD_RELOC_M32R_HI16_ULO,
371218a5822eSThomas Veerman 
371318a5822eSThomas Veerman /* This is a 16-bit reloc containing the high 16 bits of an address
371418a5822eSThomas Veerman used when the lower 16 bits are treated as signed.  */
371518a5822eSThomas Veerman   BFD_RELOC_M32R_HI16_SLO,
371618a5822eSThomas Veerman 
371718a5822eSThomas Veerman /* This is a 16-bit reloc containing the lower 16 bits of an address.  */
371818a5822eSThomas Veerman   BFD_RELOC_M32R_LO16,
371918a5822eSThomas Veerman 
372018a5822eSThomas Veerman /* This is a 16-bit reloc containing the small data area offset for use in
372118a5822eSThomas Veerman add3, load, and store instructions.  */
372218a5822eSThomas Veerman   BFD_RELOC_M32R_SDA16,
372318a5822eSThomas Veerman 
372418a5822eSThomas Veerman /* For PIC.  */
372518a5822eSThomas Veerman   BFD_RELOC_M32R_GOT24,
372618a5822eSThomas Veerman   BFD_RELOC_M32R_26_PLTREL,
372718a5822eSThomas Veerman   BFD_RELOC_M32R_COPY,
372818a5822eSThomas Veerman   BFD_RELOC_M32R_GLOB_DAT,
372918a5822eSThomas Veerman   BFD_RELOC_M32R_JMP_SLOT,
373018a5822eSThomas Veerman   BFD_RELOC_M32R_RELATIVE,
373118a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF,
373218a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_HI_ULO,
373318a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_HI_SLO,
373418a5822eSThomas Veerman   BFD_RELOC_M32R_GOTOFF_LO,
373518a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC24,
373618a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_HI_ULO,
373718a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_HI_SLO,
373818a5822eSThomas Veerman   BFD_RELOC_M32R_GOT16_LO,
373918a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_HI_ULO,
374018a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_HI_SLO,
374118a5822eSThomas Veerman   BFD_RELOC_M32R_GOTPC_LO,
374218a5822eSThomas Veerman 
374318a5822eSThomas Veerman /* This is a 9-bit reloc  */
374418a5822eSThomas Veerman   BFD_RELOC_V850_9_PCREL,
374518a5822eSThomas Veerman 
374618a5822eSThomas Veerman /* This is a 22-bit reloc  */
374718a5822eSThomas Veerman   BFD_RELOC_V850_22_PCREL,
374818a5822eSThomas Veerman 
374918a5822eSThomas Veerman /* This is a 16 bit offset from the short data area pointer.  */
375018a5822eSThomas Veerman   BFD_RELOC_V850_SDA_16_16_OFFSET,
375118a5822eSThomas Veerman 
375218a5822eSThomas Veerman /* This is a 16 bit offset (of which only 15 bits are used) from the
375318a5822eSThomas Veerman short data area pointer.  */
375418a5822eSThomas Veerman   BFD_RELOC_V850_SDA_15_16_OFFSET,
375518a5822eSThomas Veerman 
375618a5822eSThomas Veerman /* This is a 16 bit offset from the zero data area pointer.  */
375718a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_16_16_OFFSET,
375818a5822eSThomas Veerman 
375918a5822eSThomas Veerman /* This is a 16 bit offset (of which only 15 bits are used) from the
376018a5822eSThomas Veerman zero data area pointer.  */
376118a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_15_16_OFFSET,
376218a5822eSThomas Veerman 
376318a5822eSThomas Veerman /* This is an 8 bit offset (of which only 6 bits are used) from the
376418a5822eSThomas Veerman tiny data area pointer.  */
376518a5822eSThomas Veerman   BFD_RELOC_V850_TDA_6_8_OFFSET,
376618a5822eSThomas Veerman 
376718a5822eSThomas Veerman /* This is an 8bit offset (of which only 7 bits are used) from the tiny
376818a5822eSThomas Veerman data area pointer.  */
376918a5822eSThomas Veerman   BFD_RELOC_V850_TDA_7_8_OFFSET,
377018a5822eSThomas Veerman 
377118a5822eSThomas Veerman /* This is a 7 bit offset from the tiny data area pointer.  */
377218a5822eSThomas Veerman   BFD_RELOC_V850_TDA_7_7_OFFSET,
377318a5822eSThomas Veerman 
377418a5822eSThomas Veerman /* This is a 16 bit offset from the tiny data area pointer.  */
377518a5822eSThomas Veerman   BFD_RELOC_V850_TDA_16_16_OFFSET,
377618a5822eSThomas Veerman 
377718a5822eSThomas Veerman /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
377818a5822eSThomas Veerman data area pointer.  */
377918a5822eSThomas Veerman   BFD_RELOC_V850_TDA_4_5_OFFSET,
378018a5822eSThomas Veerman 
378118a5822eSThomas Veerman /* This is a 4 bit offset from the tiny data area pointer.  */
378218a5822eSThomas Veerman   BFD_RELOC_V850_TDA_4_4_OFFSET,
378318a5822eSThomas Veerman 
378418a5822eSThomas Veerman /* This is a 16 bit offset from the short data area pointer, with the
378518a5822eSThomas Veerman bits placed non-contiguously in the instruction.  */
378618a5822eSThomas Veerman   BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
378718a5822eSThomas Veerman 
378818a5822eSThomas Veerman /* This is a 16 bit offset from the zero data area pointer, with the
378918a5822eSThomas Veerman bits placed non-contiguously in the instruction.  */
379018a5822eSThomas Veerman   BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
379118a5822eSThomas Veerman 
379218a5822eSThomas Veerman /* This is a 6 bit offset from the call table base pointer.  */
379318a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_6_7_OFFSET,
379418a5822eSThomas Veerman 
379518a5822eSThomas Veerman /* This is a 16 bit offset from the call table base pointer.  */
379618a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_16_16_OFFSET,
379718a5822eSThomas Veerman 
379818a5822eSThomas Veerman /* Used for relaxing indirect function calls.  */
379918a5822eSThomas Veerman   BFD_RELOC_V850_LONGCALL,
380018a5822eSThomas Veerman 
380118a5822eSThomas Veerman /* Used for relaxing indirect jumps.  */
380218a5822eSThomas Veerman   BFD_RELOC_V850_LONGJUMP,
380318a5822eSThomas Veerman 
380418a5822eSThomas Veerman /* Used to maintain alignment whilst relaxing.  */
380518a5822eSThomas Veerman   BFD_RELOC_V850_ALIGN,
380618a5822eSThomas Veerman 
380718a5822eSThomas Veerman /* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
380818a5822eSThomas Veerman instructions.  */
380918a5822eSThomas Veerman   BFD_RELOC_V850_LO16_SPLIT_OFFSET,
381018a5822eSThomas Veerman 
381118a5822eSThomas Veerman /* This is a 16-bit reloc.  */
381218a5822eSThomas Veerman   BFD_RELOC_V850_16_PCREL,
381318a5822eSThomas Veerman 
381418a5822eSThomas Veerman /* This is a 17-bit reloc.  */
381518a5822eSThomas Veerman   BFD_RELOC_V850_17_PCREL,
381618a5822eSThomas Veerman 
381718a5822eSThomas Veerman /* This is a 23-bit reloc.  */
381818a5822eSThomas Veerman   BFD_RELOC_V850_23,
381918a5822eSThomas Veerman 
382018a5822eSThomas Veerman /* This is a 32-bit reloc.  */
382118a5822eSThomas Veerman   BFD_RELOC_V850_32_PCREL,
382218a5822eSThomas Veerman 
382318a5822eSThomas Veerman /* This is a 32-bit reloc.  */
382418a5822eSThomas Veerman   BFD_RELOC_V850_32_ABS,
382518a5822eSThomas Veerman 
382618a5822eSThomas Veerman /* This is a 16-bit reloc.  */
382718a5822eSThomas Veerman   BFD_RELOC_V850_16_SPLIT_OFFSET,
382818a5822eSThomas Veerman 
382918a5822eSThomas Veerman /* This is a 16-bit reloc.  */
383018a5822eSThomas Veerman   BFD_RELOC_V850_16_S1,
383118a5822eSThomas Veerman 
383218a5822eSThomas Veerman /* Low 16 bits. 16 bit shifted by 1.  */
383318a5822eSThomas Veerman   BFD_RELOC_V850_LO16_S1,
383418a5822eSThomas Veerman 
383518a5822eSThomas Veerman /* This is a 16 bit offset from the call table base pointer.  */
383618a5822eSThomas Veerman   BFD_RELOC_V850_CALLT_15_16_OFFSET,
383718a5822eSThomas Veerman 
383818a5822eSThomas Veerman /* DSO relocations.  */
383918a5822eSThomas Veerman   BFD_RELOC_V850_32_GOTPCREL,
384018a5822eSThomas Veerman 
384118a5822eSThomas Veerman /* DSO relocations.  */
384218a5822eSThomas Veerman   BFD_RELOC_V850_16_GOT,
384318a5822eSThomas Veerman 
384418a5822eSThomas Veerman /* DSO relocations.  */
384518a5822eSThomas Veerman   BFD_RELOC_V850_32_GOT,
384618a5822eSThomas Veerman 
384718a5822eSThomas Veerman /* DSO relocations.  */
384818a5822eSThomas Veerman   BFD_RELOC_V850_22_PLT_PCREL,
384918a5822eSThomas Veerman 
385018a5822eSThomas Veerman /* DSO relocations.  */
385118a5822eSThomas Veerman   BFD_RELOC_V850_32_PLT_PCREL,
385218a5822eSThomas Veerman 
385318a5822eSThomas Veerman /* DSO relocations.  */
385418a5822eSThomas Veerman   BFD_RELOC_V850_COPY,
385518a5822eSThomas Veerman 
385618a5822eSThomas Veerman /* DSO relocations.  */
385718a5822eSThomas Veerman   BFD_RELOC_V850_GLOB_DAT,
385818a5822eSThomas Veerman 
385918a5822eSThomas Veerman /* DSO relocations.  */
386018a5822eSThomas Veerman   BFD_RELOC_V850_JMP_SLOT,
386118a5822eSThomas Veerman 
386218a5822eSThomas Veerman /* DSO relocations.  */
386318a5822eSThomas Veerman   BFD_RELOC_V850_RELATIVE,
386418a5822eSThomas Veerman 
386518a5822eSThomas Veerman /* DSO relocations.  */
386618a5822eSThomas Veerman   BFD_RELOC_V850_16_GOTOFF,
386718a5822eSThomas Veerman 
386818a5822eSThomas Veerman /* DSO relocations.  */
386918a5822eSThomas Veerman   BFD_RELOC_V850_32_GOTOFF,
387018a5822eSThomas Veerman 
387118a5822eSThomas Veerman /* start code.  */
387218a5822eSThomas Veerman   BFD_RELOC_V850_CODE,
387318a5822eSThomas Veerman 
387418a5822eSThomas Veerman /* start data in text.  */
387518a5822eSThomas Veerman   BFD_RELOC_V850_DATA,
387618a5822eSThomas Veerman 
387718a5822eSThomas Veerman /* This is a 8bit DP reloc for the tms320c30, where the most
387818a5822eSThomas Veerman significant 8 bits of a 24 bit word are placed into the least
387918a5822eSThomas Veerman significant 8 bits of the opcode.  */
388018a5822eSThomas Veerman   BFD_RELOC_TIC30_LDP,
388118a5822eSThomas Veerman 
388218a5822eSThomas Veerman /* This is a 7bit reloc for the tms320c54x, where the least
388318a5822eSThomas Veerman significant 7 bits of a 16 bit word are placed into the least
388418a5822eSThomas Veerman significant 7 bits of the opcode.  */
388518a5822eSThomas Veerman   BFD_RELOC_TIC54X_PARTLS7,
388618a5822eSThomas Veerman 
388718a5822eSThomas Veerman /* This is a 9bit DP reloc for the tms320c54x, where the most
388818a5822eSThomas Veerman significant 9 bits of a 16 bit word are placed into the least
388918a5822eSThomas Veerman significant 9 bits of the opcode.  */
389018a5822eSThomas Veerman   BFD_RELOC_TIC54X_PARTMS9,
389118a5822eSThomas Veerman 
389218a5822eSThomas Veerman /* This is an extended address 23-bit reloc for the tms320c54x.  */
389318a5822eSThomas Veerman   BFD_RELOC_TIC54X_23,
389418a5822eSThomas Veerman 
389518a5822eSThomas Veerman /* This is a 16-bit reloc for the tms320c54x, where the least
389618a5822eSThomas Veerman significant 16 bits of a 23-bit extended address are placed into
389718a5822eSThomas Veerman the opcode.  */
389818a5822eSThomas Veerman   BFD_RELOC_TIC54X_16_OF_23,
389918a5822eSThomas Veerman 
390018a5822eSThomas Veerman /* This is a reloc for the tms320c54x, where the most
390118a5822eSThomas Veerman significant 7 bits of a 23-bit extended address are placed into
390218a5822eSThomas Veerman the opcode.  */
390318a5822eSThomas Veerman   BFD_RELOC_TIC54X_MS7_OF_23,
390418a5822eSThomas Veerman 
390518a5822eSThomas Veerman /* TMS320C6000 relocations.  */
390618a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S21,
390718a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S12,
390818a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S10,
390918a5822eSThomas Veerman   BFD_RELOC_C6000_PCR_S7,
391018a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_S16,
391118a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_L16,
391218a5822eSThomas Veerman   BFD_RELOC_C6000_ABS_H16,
391318a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_B,
391418a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_H,
391518a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_U15_W,
391618a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_S16,
391718a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_B,
391818a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_H,
391918a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_L16_W,
392018a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_B,
392118a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_H,
392218a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_H16_W,
392318a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_U15_W,
392418a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_L16_W,
392518a5822eSThomas Veerman   BFD_RELOC_C6000_SBR_GOT_H16_W,
392618a5822eSThomas Veerman   BFD_RELOC_C6000_DSBT_INDEX,
392718a5822eSThomas Veerman   BFD_RELOC_C6000_PREL31,
392818a5822eSThomas Veerman   BFD_RELOC_C6000_COPY,
3929*c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_JUMP_SLOT,
3930*c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_EHTYPE,
3931*c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_PCR_H16,
3932*c9ea9e7aSLionel Sambuc   BFD_RELOC_C6000_PCR_L16,
393318a5822eSThomas Veerman   BFD_RELOC_C6000_ALIGN,
393418a5822eSThomas Veerman   BFD_RELOC_C6000_FPHEAD,
393518a5822eSThomas Veerman   BFD_RELOC_C6000_NOCMP,
393618a5822eSThomas Veerman 
393718a5822eSThomas Veerman /* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
393818a5822eSThomas Veerman   BFD_RELOC_FR30_48,
393918a5822eSThomas Veerman 
394018a5822eSThomas Veerman /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
394118a5822eSThomas Veerman two sections.  */
394218a5822eSThomas Veerman   BFD_RELOC_FR30_20,
394318a5822eSThomas Veerman 
394418a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
394518a5822eSThomas Veerman 4 bits.  */
394618a5822eSThomas Veerman   BFD_RELOC_FR30_6_IN_4,
394718a5822eSThomas Veerman 
394818a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
394918a5822eSThomas Veerman into 8 bits.  */
395018a5822eSThomas Veerman   BFD_RELOC_FR30_8_IN_8,
395118a5822eSThomas Veerman 
395218a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
395318a5822eSThomas Veerman into 8 bits.  */
395418a5822eSThomas Veerman   BFD_RELOC_FR30_9_IN_8,
395518a5822eSThomas Veerman 
395618a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
395718a5822eSThomas Veerman into 8 bits.  */
395818a5822eSThomas Veerman   BFD_RELOC_FR30_10_IN_8,
395918a5822eSThomas Veerman 
396018a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
396118a5822eSThomas Veerman short offset into 8 bits.  */
396218a5822eSThomas Veerman   BFD_RELOC_FR30_9_PCREL,
396318a5822eSThomas Veerman 
396418a5822eSThomas Veerman /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
396518a5822eSThomas Veerman short offset into 11 bits.  */
396618a5822eSThomas Veerman   BFD_RELOC_FR30_12_PCREL,
396718a5822eSThomas Veerman 
396818a5822eSThomas Veerman /* Motorola Mcore relocations.  */
396918a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM8BY4,
397018a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM11BY2,
397118a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_IMM4BY2,
397218a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_32,
397318a5822eSThomas Veerman   BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
397418a5822eSThomas Veerman   BFD_RELOC_MCORE_RVA,
397518a5822eSThomas Veerman 
397618a5822eSThomas Veerman /* Toshiba Media Processor Relocations.  */
397718a5822eSThomas Veerman   BFD_RELOC_MEP_8,
397818a5822eSThomas Veerman   BFD_RELOC_MEP_16,
397918a5822eSThomas Veerman   BFD_RELOC_MEP_32,
398018a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL8A2,
398118a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL12A2,
398218a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL17A2,
398318a5822eSThomas Veerman   BFD_RELOC_MEP_PCREL24A2,
398418a5822eSThomas Veerman   BFD_RELOC_MEP_PCABS24A2,
398518a5822eSThomas Veerman   BFD_RELOC_MEP_LOW16,
398618a5822eSThomas Veerman   BFD_RELOC_MEP_HI16U,
398718a5822eSThomas Veerman   BFD_RELOC_MEP_HI16S,
398818a5822eSThomas Veerman   BFD_RELOC_MEP_GPREL,
398918a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL,
399018a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7,
399118a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7A2,
399218a5822eSThomas Veerman   BFD_RELOC_MEP_TPREL7A4,
399318a5822eSThomas Veerman   BFD_RELOC_MEP_UIMM24,
399418a5822eSThomas Veerman   BFD_RELOC_MEP_ADDR24A4,
399518a5822eSThomas Veerman   BFD_RELOC_MEP_GNU_VTINHERIT,
399618a5822eSThomas Veerman   BFD_RELOC_MEP_GNU_VTENTRY,
399718a5822eSThomas Veerman 
399818a5822eSThomas Veerman 
399918a5822eSThomas Veerman /* These are relocations for the GETA instruction.  */
400018a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA,
400118a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_1,
400218a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_2,
400318a5822eSThomas Veerman   BFD_RELOC_MMIX_GETA_3,
400418a5822eSThomas Veerman 
400518a5822eSThomas Veerman /* These are relocations for a conditional branch instruction.  */
400618a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH,
400718a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_J,
400818a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_1,
400918a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_2,
401018a5822eSThomas Veerman   BFD_RELOC_MMIX_CBRANCH_3,
401118a5822eSThomas Veerman 
401218a5822eSThomas Veerman /* These are relocations for the PUSHJ instruction.  */
401318a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ,
401418a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_1,
401518a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_2,
401618a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_3,
401718a5822eSThomas Veerman   BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
401818a5822eSThomas Veerman 
401918a5822eSThomas Veerman /* These are relocations for the JMP instruction.  */
402018a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP,
402118a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_1,
402218a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_2,
402318a5822eSThomas Veerman   BFD_RELOC_MMIX_JMP_3,
402418a5822eSThomas Veerman 
402518a5822eSThomas Veerman /* This is a relocation for a relative address as in a GETA instruction or
402618a5822eSThomas Veerman a branch.  */
402718a5822eSThomas Veerman   BFD_RELOC_MMIX_ADDR19,
402818a5822eSThomas Veerman 
402918a5822eSThomas Veerman /* This is a relocation for a relative address as in a JMP instruction.  */
403018a5822eSThomas Veerman   BFD_RELOC_MMIX_ADDR27,
403118a5822eSThomas Veerman 
403218a5822eSThomas Veerman /* This is a relocation for an instruction field that may be a general
403318a5822eSThomas Veerman register or a value 0..255.  */
403418a5822eSThomas Veerman   BFD_RELOC_MMIX_REG_OR_BYTE,
403518a5822eSThomas Veerman 
403618a5822eSThomas Veerman /* This is a relocation for an instruction field that may be a general
403718a5822eSThomas Veerman register.  */
403818a5822eSThomas Veerman   BFD_RELOC_MMIX_REG,
403918a5822eSThomas Veerman 
404018a5822eSThomas Veerman /* This is a relocation for two instruction fields holding a register and
404118a5822eSThomas Veerman an offset, the equivalent of the relocation.  */
404218a5822eSThomas Veerman   BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
404318a5822eSThomas Veerman 
404418a5822eSThomas Veerman /* This relocation is an assertion that the expression is not allocated as
404518a5822eSThomas Veerman a global register.  It does not modify contents.  */
404618a5822eSThomas Veerman   BFD_RELOC_MMIX_LOCAL,
404718a5822eSThomas Veerman 
404818a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
404918a5822eSThomas Veerman short offset into 7 bits.  */
405018a5822eSThomas Veerman   BFD_RELOC_AVR_7_PCREL,
405118a5822eSThomas Veerman 
405218a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
405318a5822eSThomas Veerman short offset into 12 bits.  */
405418a5822eSThomas Veerman   BFD_RELOC_AVR_13_PCREL,
405518a5822eSThomas Veerman 
405618a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
405718a5822eSThomas Veerman program memory address) into 16 bits.  */
405818a5822eSThomas Veerman   BFD_RELOC_AVR_16_PM,
405918a5822eSThomas Veerman 
406018a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
406118a5822eSThomas Veerman data memory address) into 8 bit immediate value of LDI insn.  */
406218a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI,
406318a5822eSThomas Veerman 
406418a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
406518a5822eSThomas Veerman of data memory address) into 8 bit immediate value of LDI insn.  */
406618a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI,
406718a5822eSThomas Veerman 
406818a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
406918a5822eSThomas Veerman of program memory address) into 8 bit immediate value of LDI insn.  */
407018a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI,
407118a5822eSThomas Veerman 
407218a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
407318a5822eSThomas Veerman of 32 bit value) into 8 bit immediate value of LDI insn.  */
407418a5822eSThomas Veerman   BFD_RELOC_AVR_MS8_LDI,
407518a5822eSThomas Veerman 
407618a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
407718a5822eSThomas Veerman (usually data memory address) into 8 bit immediate value of SUBI insn.  */
407818a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_NEG,
407918a5822eSThomas Veerman 
408018a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
408118a5822eSThomas Veerman (high 8 bit of data memory address) into 8 bit immediate value of
408218a5822eSThomas Veerman SUBI insn.  */
408318a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_NEG,
408418a5822eSThomas Veerman 
408518a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
408618a5822eSThomas Veerman (most high 8 bit of program memory address) into 8 bit immediate value
408718a5822eSThomas Veerman of LDI or SUBI insn.  */
408818a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_NEG,
408918a5822eSThomas Veerman 
409018a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
409118a5822eSThomas Veerman of 32 bit value) into 8 bit immediate value of LDI insn.  */
409218a5822eSThomas Veerman   BFD_RELOC_AVR_MS8_LDI_NEG,
409318a5822eSThomas Veerman 
409418a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
409518a5822eSThomas Veerman command address) into 8 bit immediate value of LDI insn.  */
409618a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_PM,
409718a5822eSThomas Veerman 
409818a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value
409918a5822eSThomas Veerman (command address) into 8 bit immediate value of LDI insn. If the address
410018a5822eSThomas Veerman is beyond the 128k boundary, the linker inserts a jump stub for this reloc
410118a5822eSThomas Veerman in the lower 128k.  */
410218a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_GS,
410318a5822eSThomas Veerman 
410418a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
410518a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  */
410618a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_PM,
410718a5822eSThomas Veerman 
410818a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
410918a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  If the address
411018a5822eSThomas Veerman is beyond the 128k boundary, the linker inserts a jump stub for this reloc
411118a5822eSThomas Veerman below 128k.  */
411218a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_LDI_GS,
411318a5822eSThomas Veerman 
411418a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
411518a5822eSThomas Veerman of command address) into 8 bit immediate value of LDI insn.  */
411618a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_PM,
411718a5822eSThomas Veerman 
411818a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
411918a5822eSThomas Veerman (usually command address) into 8 bit immediate value of SUBI insn.  */
412018a5822eSThomas Veerman   BFD_RELOC_AVR_LO8_LDI_PM_NEG,
412118a5822eSThomas Veerman 
412218a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores negated 8 bit value
412318a5822eSThomas Veerman (high 8 bit of 16 bit command address) into 8 bit immediate value
412418a5822eSThomas Veerman of SUBI insn.  */
412518a5822eSThomas Veerman   BFD_RELOC_AVR_HI8_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 6 bit of 22 bit command address) into 8 bit immediate
412918a5822eSThomas Veerman value of SUBI insn.  */
413018a5822eSThomas Veerman   BFD_RELOC_AVR_HH8_LDI_PM_NEG,
413118a5822eSThomas Veerman 
413218a5822eSThomas Veerman /* This is a 32 bit reloc for the AVR that stores 23 bit value
413318a5822eSThomas Veerman into 22 bits.  */
413418a5822eSThomas Veerman   BFD_RELOC_AVR_CALL,
413518a5822eSThomas Veerman 
413618a5822eSThomas Veerman /* This is a 16 bit reloc for the AVR that stores all needed bits
413718a5822eSThomas Veerman for absolute addressing with ldi with overflow check to linktime  */
413818a5822eSThomas Veerman   BFD_RELOC_AVR_LDI,
413918a5822eSThomas Veerman 
414018a5822eSThomas Veerman /* This is a 6 bit reloc for the AVR that stores offset for ldd/std
414118a5822eSThomas Veerman instructions  */
414218a5822eSThomas Veerman   BFD_RELOC_AVR_6,
414318a5822eSThomas Veerman 
414418a5822eSThomas Veerman /* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
414518a5822eSThomas Veerman instructions  */
414618a5822eSThomas Veerman   BFD_RELOC_AVR_6_ADIW,
414718a5822eSThomas Veerman 
4148*c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol
4149*c9ea9e7aSLionel Sambuc in .byte lo8(symbol)  */
4150*c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_LO,
4151*c9ea9e7aSLionel Sambuc 
4152*c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol
4153*c9ea9e7aSLionel Sambuc in .byte hi8(symbol)  */
4154*c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_HI,
4155*c9ea9e7aSLionel Sambuc 
4156*c9ea9e7aSLionel Sambuc /* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol
4157*c9ea9e7aSLionel Sambuc in .byte hlo8(symbol)  */
4158*c9ea9e7aSLionel Sambuc   BFD_RELOC_AVR_8_HLO,
4159*c9ea9e7aSLionel Sambuc 
4160*c9ea9e7aSLionel Sambuc /* Renesas RL78 Relocations.  */
4161*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG8,
4162*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG16,
4163*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG24,
4164*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_NEG32,
4165*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_16_OP,
4166*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_24_OP,
4167*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_32_OP,
4168*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_8U,
4169*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_16U,
4170*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_24U,
4171*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_DIR3U_PCREL,
4172*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_DIFF,
4173*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELB,
4174*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELW,
4175*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_GPRELL,
4176*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_SYM,
4177*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_SUBTRACT,
4178*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_NEG,
4179*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_AND,
4180*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_OP_SHRA,
4181*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS8,
4182*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16,
4183*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16_REV,
4184*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS32,
4185*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS32_REV,
4186*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16U,
4187*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16UW,
4188*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_ABS16UL,
4189*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_RELAX,
4190*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_HI16,
4191*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_HI8,
4192*c9ea9e7aSLionel Sambuc   BFD_RELOC_RL78_LO16,
4193*c9ea9e7aSLionel Sambuc 
419418a5822eSThomas Veerman /* Renesas RX Relocations.  */
419518a5822eSThomas Veerman   BFD_RELOC_RX_NEG8,
419618a5822eSThomas Veerman   BFD_RELOC_RX_NEG16,
419718a5822eSThomas Veerman   BFD_RELOC_RX_NEG24,
419818a5822eSThomas Veerman   BFD_RELOC_RX_NEG32,
419918a5822eSThomas Veerman   BFD_RELOC_RX_16_OP,
420018a5822eSThomas Veerman   BFD_RELOC_RX_24_OP,
420118a5822eSThomas Veerman   BFD_RELOC_RX_32_OP,
420218a5822eSThomas Veerman   BFD_RELOC_RX_8U,
420318a5822eSThomas Veerman   BFD_RELOC_RX_16U,
420418a5822eSThomas Veerman   BFD_RELOC_RX_24U,
420518a5822eSThomas Veerman   BFD_RELOC_RX_DIR3U_PCREL,
420618a5822eSThomas Veerman   BFD_RELOC_RX_DIFF,
420718a5822eSThomas Veerman   BFD_RELOC_RX_GPRELB,
420818a5822eSThomas Veerman   BFD_RELOC_RX_GPRELW,
420918a5822eSThomas Veerman   BFD_RELOC_RX_GPRELL,
421018a5822eSThomas Veerman   BFD_RELOC_RX_SYM,
421118a5822eSThomas Veerman   BFD_RELOC_RX_OP_SUBTRACT,
4212*c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_OP_NEG,
421318a5822eSThomas Veerman   BFD_RELOC_RX_ABS8,
421418a5822eSThomas Veerman   BFD_RELOC_RX_ABS16,
4215*c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_ABS16_REV,
421618a5822eSThomas Veerman   BFD_RELOC_RX_ABS32,
4217*c9ea9e7aSLionel Sambuc   BFD_RELOC_RX_ABS32_REV,
421818a5822eSThomas Veerman   BFD_RELOC_RX_ABS16U,
421918a5822eSThomas Veerman   BFD_RELOC_RX_ABS16UW,
422018a5822eSThomas Veerman   BFD_RELOC_RX_ABS16UL,
422118a5822eSThomas Veerman   BFD_RELOC_RX_RELAX,
422218a5822eSThomas Veerman 
422318a5822eSThomas Veerman /* Direct 12 bit.  */
422418a5822eSThomas Veerman   BFD_RELOC_390_12,
422518a5822eSThomas Veerman 
422618a5822eSThomas Veerman /* 12 bit GOT offset.  */
422718a5822eSThomas Veerman   BFD_RELOC_390_GOT12,
422818a5822eSThomas Veerman 
422918a5822eSThomas Veerman /* 32 bit PC relative PLT address.  */
423018a5822eSThomas Veerman   BFD_RELOC_390_PLT32,
423118a5822eSThomas Veerman 
423218a5822eSThomas Veerman /* Copy symbol at runtime.  */
423318a5822eSThomas Veerman   BFD_RELOC_390_COPY,
423418a5822eSThomas Veerman 
423518a5822eSThomas Veerman /* Create GOT entry.  */
423618a5822eSThomas Veerman   BFD_RELOC_390_GLOB_DAT,
423718a5822eSThomas Veerman 
423818a5822eSThomas Veerman /* Create PLT entry.  */
423918a5822eSThomas Veerman   BFD_RELOC_390_JMP_SLOT,
424018a5822eSThomas Veerman 
424118a5822eSThomas Veerman /* Adjust by program base.  */
424218a5822eSThomas Veerman   BFD_RELOC_390_RELATIVE,
424318a5822eSThomas Veerman 
424418a5822eSThomas Veerman /* 32 bit PC relative offset to GOT.  */
424518a5822eSThomas Veerman   BFD_RELOC_390_GOTPC,
424618a5822eSThomas Veerman 
424718a5822eSThomas Veerman /* 16 bit GOT offset.  */
424818a5822eSThomas Veerman   BFD_RELOC_390_GOT16,
424918a5822eSThomas Veerman 
425018a5822eSThomas Veerman /* PC relative 16 bit shifted by 1.  */
425118a5822eSThomas Veerman   BFD_RELOC_390_PC16DBL,
425218a5822eSThomas Veerman 
425318a5822eSThomas Veerman /* 16 bit PC rel. PLT shifted by 1.  */
425418a5822eSThomas Veerman   BFD_RELOC_390_PLT16DBL,
425518a5822eSThomas Veerman 
425618a5822eSThomas Veerman /* PC relative 32 bit shifted by 1.  */
425718a5822eSThomas Veerman   BFD_RELOC_390_PC32DBL,
425818a5822eSThomas Veerman 
425918a5822eSThomas Veerman /* 32 bit PC rel. PLT shifted by 1.  */
426018a5822eSThomas Veerman   BFD_RELOC_390_PLT32DBL,
426118a5822eSThomas Veerman 
426218a5822eSThomas Veerman /* 32 bit PC rel. GOT shifted by 1.  */
426318a5822eSThomas Veerman   BFD_RELOC_390_GOTPCDBL,
426418a5822eSThomas Veerman 
426518a5822eSThomas Veerman /* 64 bit GOT offset.  */
426618a5822eSThomas Veerman   BFD_RELOC_390_GOT64,
426718a5822eSThomas Veerman 
426818a5822eSThomas Veerman /* 64 bit PC relative PLT address.  */
426918a5822eSThomas Veerman   BFD_RELOC_390_PLT64,
427018a5822eSThomas Veerman 
427118a5822eSThomas Veerman /* 32 bit rel. offset to GOT entry.  */
427218a5822eSThomas Veerman   BFD_RELOC_390_GOTENT,
427318a5822eSThomas Veerman 
427418a5822eSThomas Veerman /* 64 bit offset to GOT.  */
427518a5822eSThomas Veerman   BFD_RELOC_390_GOTOFF64,
427618a5822eSThomas Veerman 
427718a5822eSThomas Veerman /* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
427818a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT12,
427918a5822eSThomas Veerman 
428018a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
428118a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT16,
428218a5822eSThomas Veerman 
428318a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
428418a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT32,
428518a5822eSThomas Veerman 
428618a5822eSThomas Veerman /* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
428718a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT64,
428818a5822eSThomas Veerman 
428918a5822eSThomas Veerman /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
429018a5822eSThomas Veerman   BFD_RELOC_390_GOTPLTENT,
429118a5822eSThomas Veerman 
429218a5822eSThomas Veerman /* 16-bit rel. offset from the GOT to a PLT entry.  */
429318a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF16,
429418a5822eSThomas Veerman 
429518a5822eSThomas Veerman /* 32-bit rel. offset from the GOT to a PLT entry.  */
429618a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF32,
429718a5822eSThomas Veerman 
429818a5822eSThomas Veerman /* 64-bit rel. offset from the GOT to a PLT entry.  */
429918a5822eSThomas Veerman   BFD_RELOC_390_PLTOFF64,
430018a5822eSThomas Veerman 
430118a5822eSThomas Veerman /* s390 tls relocations.  */
430218a5822eSThomas Veerman   BFD_RELOC_390_TLS_LOAD,
430318a5822eSThomas Veerman   BFD_RELOC_390_TLS_GDCALL,
430418a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDCALL,
430518a5822eSThomas Veerman   BFD_RELOC_390_TLS_GD32,
430618a5822eSThomas Veerman   BFD_RELOC_390_TLS_GD64,
430718a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE12,
430818a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE32,
430918a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE64,
431018a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDM32,
431118a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDM64,
431218a5822eSThomas Veerman   BFD_RELOC_390_TLS_IE32,
431318a5822eSThomas Veerman   BFD_RELOC_390_TLS_IE64,
431418a5822eSThomas Veerman   BFD_RELOC_390_TLS_IEENT,
431518a5822eSThomas Veerman   BFD_RELOC_390_TLS_LE32,
431618a5822eSThomas Veerman   BFD_RELOC_390_TLS_LE64,
431718a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDO32,
431818a5822eSThomas Veerman   BFD_RELOC_390_TLS_LDO64,
431918a5822eSThomas Veerman   BFD_RELOC_390_TLS_DTPMOD,
432018a5822eSThomas Veerman   BFD_RELOC_390_TLS_DTPOFF,
432118a5822eSThomas Veerman   BFD_RELOC_390_TLS_TPOFF,
432218a5822eSThomas Veerman 
432318a5822eSThomas Veerman /* Long displacement extension.  */
432418a5822eSThomas Veerman   BFD_RELOC_390_20,
432518a5822eSThomas Veerman   BFD_RELOC_390_GOT20,
432618a5822eSThomas Veerman   BFD_RELOC_390_GOTPLT20,
432718a5822eSThomas Veerman   BFD_RELOC_390_TLS_GOTIE20,
432818a5822eSThomas Veerman 
4329*c9ea9e7aSLionel Sambuc /* STT_GNU_IFUNC relocation.  */
4330*c9ea9e7aSLionel Sambuc   BFD_RELOC_390_IRELATIVE,
4331*c9ea9e7aSLionel Sambuc 
433218a5822eSThomas Veerman /* Score relocations
433318a5822eSThomas Veerman Low 16 bit for load/store  */
433418a5822eSThomas Veerman   BFD_RELOC_SCORE_GPREL15,
433518a5822eSThomas Veerman 
433618a5822eSThomas Veerman /* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
433718a5822eSThomas Veerman   BFD_RELOC_SCORE_DUMMY2,
433818a5822eSThomas Veerman   BFD_RELOC_SCORE_JMP,
433918a5822eSThomas Veerman 
434018a5822eSThomas Veerman /* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
434118a5822eSThomas Veerman   BFD_RELOC_SCORE_BRANCH,
434218a5822eSThomas Veerman 
434318a5822eSThomas Veerman /* This is a 32-bit reloc for 48-bit instructions.  */
434418a5822eSThomas Veerman   BFD_RELOC_SCORE_IMM30,
434518a5822eSThomas Veerman 
434618a5822eSThomas Veerman /* This is a 32-bit reloc for 48-bit instructions.  */
434718a5822eSThomas Veerman   BFD_RELOC_SCORE_IMM32,
434818a5822eSThomas Veerman 
434918a5822eSThomas Veerman /* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
435018a5822eSThomas Veerman   BFD_RELOC_SCORE16_JMP,
435118a5822eSThomas Veerman 
435218a5822eSThomas Veerman /* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
435318a5822eSThomas Veerman   BFD_RELOC_SCORE16_BRANCH,
435418a5822eSThomas Veerman 
435518a5822eSThomas Veerman /* This is a 9-bit reloc with the right 1 bit assumed to be 0  */
435618a5822eSThomas Veerman   BFD_RELOC_SCORE_BCMP,
435718a5822eSThomas Veerman 
435818a5822eSThomas Veerman /* Undocumented Score relocs  */
435918a5822eSThomas Veerman   BFD_RELOC_SCORE_GOT15,
436018a5822eSThomas Veerman   BFD_RELOC_SCORE_GOT_LO16,
436118a5822eSThomas Veerman   BFD_RELOC_SCORE_CALL15,
436218a5822eSThomas Veerman   BFD_RELOC_SCORE_DUMMY_HI16,
436318a5822eSThomas Veerman 
436418a5822eSThomas Veerman /* Scenix IP2K - 9-bit register number / data address  */
436518a5822eSThomas Veerman   BFD_RELOC_IP2K_FR9,
436618a5822eSThomas Veerman 
436718a5822eSThomas Veerman /* Scenix IP2K - 4-bit register/data bank number  */
436818a5822eSThomas Veerman   BFD_RELOC_IP2K_BANK,
436918a5822eSThomas Veerman 
437018a5822eSThomas Veerman /* Scenix IP2K - low 13 bits of instruction word address  */
437118a5822eSThomas Veerman   BFD_RELOC_IP2K_ADDR16CJP,
437218a5822eSThomas Veerman 
437318a5822eSThomas Veerman /* Scenix IP2K - high 3 bits of instruction word address  */
437418a5822eSThomas Veerman   BFD_RELOC_IP2K_PAGE3,
437518a5822eSThomas Veerman 
437618a5822eSThomas Veerman /* Scenix IP2K - ext/low/high 8 bits of data address  */
437718a5822eSThomas Veerman   BFD_RELOC_IP2K_LO8DATA,
437818a5822eSThomas Veerman   BFD_RELOC_IP2K_HI8DATA,
437918a5822eSThomas Veerman   BFD_RELOC_IP2K_EX8DATA,
438018a5822eSThomas Veerman 
438118a5822eSThomas Veerman /* Scenix IP2K - low/high 8 bits of instruction word address  */
438218a5822eSThomas Veerman   BFD_RELOC_IP2K_LO8INSN,
438318a5822eSThomas Veerman   BFD_RELOC_IP2K_HI8INSN,
438418a5822eSThomas Veerman 
438518a5822eSThomas Veerman /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
438618a5822eSThomas Veerman   BFD_RELOC_IP2K_PC_SKIP,
438718a5822eSThomas Veerman 
438818a5822eSThomas Veerman /* Scenix IP2K - 16 bit word address in text section.  */
438918a5822eSThomas Veerman   BFD_RELOC_IP2K_TEXT,
439018a5822eSThomas Veerman 
439118a5822eSThomas Veerman /* Scenix IP2K - 7-bit sp or dp offset  */
439218a5822eSThomas Veerman   BFD_RELOC_IP2K_FR_OFFSET,
439318a5822eSThomas Veerman 
439418a5822eSThomas Veerman /* Scenix VPE4K coprocessor - data/insn-space addressing  */
439518a5822eSThomas Veerman   BFD_RELOC_VPE4KMATH_DATA,
439618a5822eSThomas Veerman   BFD_RELOC_VPE4KMATH_INSN,
439718a5822eSThomas Veerman 
439818a5822eSThomas Veerman /* These two relocations are used by the linker to determine which of
439918a5822eSThomas Veerman the entries in a C++ virtual function table are actually used.  When
440018a5822eSThomas Veerman the --gc-sections option is given, the linker will zero out the entries
440118a5822eSThomas Veerman that are not used, so that the code for those functions need not be
440218a5822eSThomas Veerman included in the output.
440318a5822eSThomas Veerman 
440418a5822eSThomas Veerman VTABLE_INHERIT is a zero-space relocation used to describe to the
440518a5822eSThomas Veerman linker the inheritance tree of a C++ virtual function table.  The
440618a5822eSThomas Veerman relocation's symbol should be the parent class' vtable, and the
440718a5822eSThomas Veerman relocation should be located at the child vtable.
440818a5822eSThomas Veerman 
440918a5822eSThomas Veerman VTABLE_ENTRY is a zero-space relocation that describes the use of a
441018a5822eSThomas Veerman virtual function table entry.  The reloc's symbol should refer to the
441118a5822eSThomas Veerman table of the class mentioned in the code.  Off of that base, an offset
441218a5822eSThomas Veerman describes the entry that is being used.  For Rela hosts, this offset
441318a5822eSThomas Veerman is stored in the reloc's addend.  For Rel hosts, we are forced to put
441418a5822eSThomas Veerman this offset in the reloc's section offset.  */
441518a5822eSThomas Veerman   BFD_RELOC_VTABLE_INHERIT,
441618a5822eSThomas Veerman   BFD_RELOC_VTABLE_ENTRY,
441718a5822eSThomas Veerman 
441818a5822eSThomas Veerman /* Intel IA64 Relocations.  */
441918a5822eSThomas Veerman   BFD_RELOC_IA64_IMM14,
442018a5822eSThomas Veerman   BFD_RELOC_IA64_IMM22,
442118a5822eSThomas Veerman   BFD_RELOC_IA64_IMM64,
442218a5822eSThomas Veerman   BFD_RELOC_IA64_DIR32MSB,
442318a5822eSThomas Veerman   BFD_RELOC_IA64_DIR32LSB,
442418a5822eSThomas Veerman   BFD_RELOC_IA64_DIR64MSB,
442518a5822eSThomas Veerman   BFD_RELOC_IA64_DIR64LSB,
442618a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL22,
442718a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64I,
442818a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL32MSB,
442918a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL32LSB,
443018a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64MSB,
443118a5822eSThomas Veerman   BFD_RELOC_IA64_GPREL64LSB,
443218a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF22,
443318a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF64I,
443418a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF22,
443518a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64I,
443618a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64MSB,
443718a5822eSThomas Veerman   BFD_RELOC_IA64_PLTOFF64LSB,
443818a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64I,
443918a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR32MSB,
444018a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR32LSB,
444118a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64MSB,
444218a5822eSThomas Veerman   BFD_RELOC_IA64_FPTR64LSB,
444318a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21B,
444418a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21BI,
444518a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21M,
444618a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL21F,
444718a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL22,
444818a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL60B,
444918a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64I,
445018a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL32MSB,
445118a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL32LSB,
445218a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64MSB,
445318a5822eSThomas Veerman   BFD_RELOC_IA64_PCREL64LSB,
445418a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR22,
445518a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64I,
445618a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR32MSB,
445718a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR32LSB,
445818a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64MSB,
445918a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_FPTR64LSB,
446018a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL32MSB,
446118a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL32LSB,
446218a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL64MSB,
446318a5822eSThomas Veerman   BFD_RELOC_IA64_SEGREL64LSB,
446418a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL32MSB,
446518a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL32LSB,
446618a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL64MSB,
446718a5822eSThomas Veerman   BFD_RELOC_IA64_SECREL64LSB,
446818a5822eSThomas Veerman   BFD_RELOC_IA64_REL32MSB,
446918a5822eSThomas Veerman   BFD_RELOC_IA64_REL32LSB,
447018a5822eSThomas Veerman   BFD_RELOC_IA64_REL64MSB,
447118a5822eSThomas Veerman   BFD_RELOC_IA64_REL64LSB,
447218a5822eSThomas Veerman   BFD_RELOC_IA64_LTV32MSB,
447318a5822eSThomas Veerman   BFD_RELOC_IA64_LTV32LSB,
447418a5822eSThomas Veerman   BFD_RELOC_IA64_LTV64MSB,
447518a5822eSThomas Veerman   BFD_RELOC_IA64_LTV64LSB,
447618a5822eSThomas Veerman   BFD_RELOC_IA64_IPLTMSB,
447718a5822eSThomas Veerman   BFD_RELOC_IA64_IPLTLSB,
447818a5822eSThomas Veerman   BFD_RELOC_IA64_COPY,
447918a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF22X,
448018a5822eSThomas Veerman   BFD_RELOC_IA64_LDXMOV,
448118a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL14,
448218a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL22,
448318a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64I,
448418a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64MSB,
448518a5822eSThomas Veerman   BFD_RELOC_IA64_TPREL64LSB,
448618a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_TPREL22,
448718a5822eSThomas Veerman   BFD_RELOC_IA64_DTPMOD64MSB,
448818a5822eSThomas Veerman   BFD_RELOC_IA64_DTPMOD64LSB,
448918a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_DTPMOD22,
449018a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL14,
449118a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL22,
449218a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64I,
449318a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL32MSB,
449418a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL32LSB,
449518a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64MSB,
449618a5822eSThomas Veerman   BFD_RELOC_IA64_DTPREL64LSB,
449718a5822eSThomas Veerman   BFD_RELOC_IA64_LTOFF_DTPREL22,
449818a5822eSThomas Veerman 
449918a5822eSThomas Veerman /* Motorola 68HC11 reloc.
450018a5822eSThomas Veerman This is the 8 bit high part of an absolute address.  */
450118a5822eSThomas Veerman   BFD_RELOC_M68HC11_HI8,
450218a5822eSThomas Veerman 
450318a5822eSThomas Veerman /* Motorola 68HC11 reloc.
450418a5822eSThomas Veerman This is the 8 bit low part of an absolute address.  */
450518a5822eSThomas Veerman   BFD_RELOC_M68HC11_LO8,
450618a5822eSThomas Veerman 
450718a5822eSThomas Veerman /* Motorola 68HC11 reloc.
450818a5822eSThomas Veerman This is the 3 bit of a value.  */
450918a5822eSThomas Veerman   BFD_RELOC_M68HC11_3B,
451018a5822eSThomas Veerman 
451118a5822eSThomas Veerman /* Motorola 68HC11 reloc.
451218a5822eSThomas Veerman This reloc marks the beginning of a jump/call instruction.
451318a5822eSThomas Veerman It is used for linker relaxation to correctly identify beginning
451418a5822eSThomas Veerman of instruction and change some branches to use PC-relative
451518a5822eSThomas Veerman addressing mode.  */
451618a5822eSThomas Veerman   BFD_RELOC_M68HC11_RL_JUMP,
451718a5822eSThomas Veerman 
451818a5822eSThomas Veerman /* Motorola 68HC11 reloc.
451918a5822eSThomas Veerman This reloc marks a group of several instructions that gcc generates
452018a5822eSThomas Veerman and for which the linker relaxation pass can modify and/or remove
452118a5822eSThomas Veerman some of them.  */
452218a5822eSThomas Veerman   BFD_RELOC_M68HC11_RL_GROUP,
452318a5822eSThomas Veerman 
452418a5822eSThomas Veerman /* Motorola 68HC11 reloc.
452518a5822eSThomas Veerman This is the 16-bit lower part of an address.  It is used for 'call'
452618a5822eSThomas Veerman instruction to specify the symbol address without any special
452718a5822eSThomas Veerman transformation (due to memory bank window).  */
452818a5822eSThomas Veerman   BFD_RELOC_M68HC11_LO16,
452918a5822eSThomas Veerman 
453018a5822eSThomas Veerman /* Motorola 68HC11 reloc.
453118a5822eSThomas Veerman This is a 8-bit reloc that specifies the page number of an address.
453218a5822eSThomas Veerman It is used by 'call' instruction to specify the page number of
453318a5822eSThomas Veerman the symbol.  */
453418a5822eSThomas Veerman   BFD_RELOC_M68HC11_PAGE,
453518a5822eSThomas Veerman 
453618a5822eSThomas Veerman /* Motorola 68HC11 reloc.
453718a5822eSThomas Veerman This is a 24-bit reloc that represents the address with a 16-bit
453818a5822eSThomas Veerman value and a 8-bit page number.  The symbol address is transformed
453918a5822eSThomas Veerman to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
454018a5822eSThomas Veerman   BFD_RELOC_M68HC11_24,
454118a5822eSThomas Veerman 
454218a5822eSThomas Veerman /* Motorola 68HC12 reloc.
454318a5822eSThomas Veerman This is the 5 bits of a value.  */
454418a5822eSThomas Veerman   BFD_RELOC_M68HC12_5B,
454518a5822eSThomas Veerman 
4546*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4547*c9ea9e7aSLionel Sambuc This reloc marks the beginning of a bra/jal instruction.  */
4548*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_RL_JUMP,
4549*c9ea9e7aSLionel Sambuc 
4550*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4551*c9ea9e7aSLionel Sambuc This reloc marks a group of several instructions that gcc generates
4552*c9ea9e7aSLionel Sambuc and for which the linker relaxation pass can modify and/or remove
4553*c9ea9e7aSLionel Sambuc some of them.  */
4554*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_RL_GROUP,
4555*c9ea9e7aSLionel Sambuc 
4556*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4557*c9ea9e7aSLionel Sambuc This is the 16-bit lower part of an address.  It is used for the '16-bit'
4558*c9ea9e7aSLionel Sambuc instructions.  */
4559*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_LO16,
4560*c9ea9e7aSLionel Sambuc 
4561*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.  */
4562*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_GPAGE,
4563*c9ea9e7aSLionel Sambuc 
4564*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.  */
4565*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_24,
4566*c9ea9e7aSLionel Sambuc 
4567*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4568*c9ea9e7aSLionel Sambuc This is a 9-bit pc-relative reloc.  */
4569*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_PCREL_9,
4570*c9ea9e7aSLionel Sambuc 
4571*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4572*c9ea9e7aSLionel Sambuc This is a 10-bit pc-relative reloc.  */
4573*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_PCREL_10,
4574*c9ea9e7aSLionel Sambuc 
4575*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4576*c9ea9e7aSLionel Sambuc This is the 16-bit lower part of an address.  It is used for the '16-bit'
4577*c9ea9e7aSLionel Sambuc instructions.  */
4578*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM8_LO,
4579*c9ea9e7aSLionel Sambuc 
4580*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4581*c9ea9e7aSLionel Sambuc This is the 16-bit higher part of an address.  It is used for the '16-bit'
4582*c9ea9e7aSLionel Sambuc instructions.  */
4583*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM8_HI,
4584*c9ea9e7aSLionel Sambuc 
4585*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4586*c9ea9e7aSLionel Sambuc This is a 3-bit pc-relative reloc.  */
4587*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM3,
4588*c9ea9e7aSLionel Sambuc 
4589*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4590*c9ea9e7aSLionel Sambuc This is a 4-bit pc-relative reloc.  */
4591*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM4,
4592*c9ea9e7aSLionel Sambuc 
4593*c9ea9e7aSLionel Sambuc /* Freescale XGATE reloc.
4594*c9ea9e7aSLionel Sambuc This is a 5-bit pc-relative reloc.  */
4595*c9ea9e7aSLionel Sambuc   BFD_RELOC_XGATE_IMM5,
4596*c9ea9e7aSLionel Sambuc 
4597*c9ea9e7aSLionel Sambuc /* Motorola 68HC12 reloc.
4598*c9ea9e7aSLionel Sambuc This is the 9 bits of a value.  */
4599*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_9B,
4600*c9ea9e7aSLionel Sambuc 
4601*c9ea9e7aSLionel Sambuc /* Motorola 68HC12 reloc.
4602*c9ea9e7aSLionel Sambuc This is the 16 bits of a value.  */
4603*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_16B,
4604*c9ea9e7aSLionel Sambuc 
4605*c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4606*c9ea9e7aSLionel Sambuc This is a PCREL9 branch.  */
4607*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_9_PCREL,
4608*c9ea9e7aSLionel Sambuc 
4609*c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4610*c9ea9e7aSLionel Sambuc This is a PCREL10 branch.  */
4611*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_10_PCREL,
4612*c9ea9e7aSLionel Sambuc 
4613*c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4614*c9ea9e7aSLionel Sambuc This is the 8 bit low part of an absolute address and immediately precedes
4615*c9ea9e7aSLionel Sambuc a matching HI8XG part.  */
4616*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_LO8XG,
4617*c9ea9e7aSLionel Sambuc 
4618*c9ea9e7aSLionel Sambuc /* Motorola 68HC12/XGATE reloc.
4619*c9ea9e7aSLionel Sambuc This is the 8 bit high part of an absolute address and immediately follows
4620*c9ea9e7aSLionel Sambuc a matching LO8XG part.  */
4621*c9ea9e7aSLionel Sambuc   BFD_RELOC_M68HC12_HI8XG,
4622*c9ea9e7aSLionel Sambuc 
462318a5822eSThomas Veerman /* NS CR16C Relocations.  */
462418a5822eSThomas Veerman   BFD_RELOC_16C_NUM08,
462518a5822eSThomas Veerman   BFD_RELOC_16C_NUM08_C,
462618a5822eSThomas Veerman   BFD_RELOC_16C_NUM16,
462718a5822eSThomas Veerman   BFD_RELOC_16C_NUM16_C,
462818a5822eSThomas Veerman   BFD_RELOC_16C_NUM32,
462918a5822eSThomas Veerman   BFD_RELOC_16C_NUM32_C,
463018a5822eSThomas Veerman   BFD_RELOC_16C_DISP04,
463118a5822eSThomas Veerman   BFD_RELOC_16C_DISP04_C,
463218a5822eSThomas Veerman   BFD_RELOC_16C_DISP08,
463318a5822eSThomas Veerman   BFD_RELOC_16C_DISP08_C,
463418a5822eSThomas Veerman   BFD_RELOC_16C_DISP16,
463518a5822eSThomas Veerman   BFD_RELOC_16C_DISP16_C,
463618a5822eSThomas Veerman   BFD_RELOC_16C_DISP24,
463718a5822eSThomas Veerman   BFD_RELOC_16C_DISP24_C,
463818a5822eSThomas Veerman   BFD_RELOC_16C_DISP24a,
463918a5822eSThomas Veerman   BFD_RELOC_16C_DISP24a_C,
464018a5822eSThomas Veerman   BFD_RELOC_16C_REG04,
464118a5822eSThomas Veerman   BFD_RELOC_16C_REG04_C,
464218a5822eSThomas Veerman   BFD_RELOC_16C_REG04a,
464318a5822eSThomas Veerman   BFD_RELOC_16C_REG04a_C,
464418a5822eSThomas Veerman   BFD_RELOC_16C_REG14,
464518a5822eSThomas Veerman   BFD_RELOC_16C_REG14_C,
464618a5822eSThomas Veerman   BFD_RELOC_16C_REG16,
464718a5822eSThomas Veerman   BFD_RELOC_16C_REG16_C,
464818a5822eSThomas Veerman   BFD_RELOC_16C_REG20,
464918a5822eSThomas Veerman   BFD_RELOC_16C_REG20_C,
465018a5822eSThomas Veerman   BFD_RELOC_16C_ABS20,
465118a5822eSThomas Veerman   BFD_RELOC_16C_ABS20_C,
465218a5822eSThomas Veerman   BFD_RELOC_16C_ABS24,
465318a5822eSThomas Veerman   BFD_RELOC_16C_ABS24_C,
465418a5822eSThomas Veerman   BFD_RELOC_16C_IMM04,
465518a5822eSThomas Veerman   BFD_RELOC_16C_IMM04_C,
465618a5822eSThomas Veerman   BFD_RELOC_16C_IMM16,
465718a5822eSThomas Veerman   BFD_RELOC_16C_IMM16_C,
465818a5822eSThomas Veerman   BFD_RELOC_16C_IMM20,
465918a5822eSThomas Veerman   BFD_RELOC_16C_IMM20_C,
466018a5822eSThomas Veerman   BFD_RELOC_16C_IMM24,
466118a5822eSThomas Veerman   BFD_RELOC_16C_IMM24_C,
466218a5822eSThomas Veerman   BFD_RELOC_16C_IMM32,
466318a5822eSThomas Veerman   BFD_RELOC_16C_IMM32_C,
466418a5822eSThomas Veerman 
466518a5822eSThomas Veerman /* NS CR16 Relocations.  */
466618a5822eSThomas Veerman   BFD_RELOC_CR16_NUM8,
466718a5822eSThomas Veerman   BFD_RELOC_CR16_NUM16,
466818a5822eSThomas Veerman   BFD_RELOC_CR16_NUM32,
466918a5822eSThomas Veerman   BFD_RELOC_CR16_NUM32a,
467018a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL0,
467118a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL4,
467218a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL4a,
467318a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL14,
467418a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL14a,
467518a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL16,
467618a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL20,
467718a5822eSThomas Veerman   BFD_RELOC_CR16_REGREL20a,
467818a5822eSThomas Veerman   BFD_RELOC_CR16_ABS20,
467918a5822eSThomas Veerman   BFD_RELOC_CR16_ABS24,
468018a5822eSThomas Veerman   BFD_RELOC_CR16_IMM4,
468118a5822eSThomas Veerman   BFD_RELOC_CR16_IMM8,
468218a5822eSThomas Veerman   BFD_RELOC_CR16_IMM16,
468318a5822eSThomas Veerman   BFD_RELOC_CR16_IMM20,
468418a5822eSThomas Veerman   BFD_RELOC_CR16_IMM24,
468518a5822eSThomas Veerman   BFD_RELOC_CR16_IMM32,
468618a5822eSThomas Veerman   BFD_RELOC_CR16_IMM32a,
468718a5822eSThomas Veerman   BFD_RELOC_CR16_DISP4,
468818a5822eSThomas Veerman   BFD_RELOC_CR16_DISP8,
468918a5822eSThomas Veerman   BFD_RELOC_CR16_DISP16,
469018a5822eSThomas Veerman   BFD_RELOC_CR16_DISP20,
469118a5822eSThomas Veerman   BFD_RELOC_CR16_DISP24,
469218a5822eSThomas Veerman   BFD_RELOC_CR16_DISP24a,
469318a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH8,
469418a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH16,
469518a5822eSThomas Veerman   BFD_RELOC_CR16_SWITCH32,
469618a5822eSThomas Veerman   BFD_RELOC_CR16_GOT_REGREL20,
469718a5822eSThomas Veerman   BFD_RELOC_CR16_GOTC_REGREL20,
469818a5822eSThomas Veerman   BFD_RELOC_CR16_GLOB_DAT,
469918a5822eSThomas Veerman 
470018a5822eSThomas Veerman /* NS CRX Relocations.  */
470118a5822eSThomas Veerman   BFD_RELOC_CRX_REL4,
470218a5822eSThomas Veerman   BFD_RELOC_CRX_REL8,
470318a5822eSThomas Veerman   BFD_RELOC_CRX_REL8_CMP,
470418a5822eSThomas Veerman   BFD_RELOC_CRX_REL16,
470518a5822eSThomas Veerman   BFD_RELOC_CRX_REL24,
470618a5822eSThomas Veerman   BFD_RELOC_CRX_REL32,
470718a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL12,
470818a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL22,
470918a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL28,
471018a5822eSThomas Veerman   BFD_RELOC_CRX_REGREL32,
471118a5822eSThomas Veerman   BFD_RELOC_CRX_ABS16,
471218a5822eSThomas Veerman   BFD_RELOC_CRX_ABS32,
471318a5822eSThomas Veerman   BFD_RELOC_CRX_NUM8,
471418a5822eSThomas Veerman   BFD_RELOC_CRX_NUM16,
471518a5822eSThomas Veerman   BFD_RELOC_CRX_NUM32,
471618a5822eSThomas Veerman   BFD_RELOC_CRX_IMM16,
471718a5822eSThomas Veerman   BFD_RELOC_CRX_IMM32,
471818a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH8,
471918a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH16,
472018a5822eSThomas Veerman   BFD_RELOC_CRX_SWITCH32,
472118a5822eSThomas Veerman 
472218a5822eSThomas Veerman /* These relocs are only used within the CRIS assembler.  They are not
472318a5822eSThomas Veerman (at present) written to any object files.  */
472418a5822eSThomas Veerman   BFD_RELOC_CRIS_BDISP8,
472518a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_5,
472618a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_6,
472718a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_6,
472818a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_8,
472918a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_8,
473018a5822eSThomas Veerman   BFD_RELOC_CRIS_SIGNED_16,
473118a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_16,
473218a5822eSThomas Veerman   BFD_RELOC_CRIS_LAPCQ_OFFSET,
473318a5822eSThomas Veerman   BFD_RELOC_CRIS_UNSIGNED_4,
473418a5822eSThomas Veerman 
473518a5822eSThomas Veerman /* Relocs used in ELF shared libraries for CRIS.  */
473618a5822eSThomas Veerman   BFD_RELOC_CRIS_COPY,
473718a5822eSThomas Veerman   BFD_RELOC_CRIS_GLOB_DAT,
473818a5822eSThomas Veerman   BFD_RELOC_CRIS_JUMP_SLOT,
473918a5822eSThomas Veerman   BFD_RELOC_CRIS_RELATIVE,
474018a5822eSThomas Veerman 
474118a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT.  */
474218a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT,
474318a5822eSThomas Veerman 
474418a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT.  */
474518a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT,
474618a5822eSThomas Veerman 
474718a5822eSThomas Veerman /* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
474818a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOTPLT,
474918a5822eSThomas Veerman 
475018a5822eSThomas Veerman /* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
475118a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOTPLT,
475218a5822eSThomas Veerman 
475318a5822eSThomas Veerman /* 32-bit offset to symbol, relative to GOT.  */
475418a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOTREL,
475518a5822eSThomas Veerman 
475618a5822eSThomas Veerman /* 32-bit offset to symbol with PLT entry, relative to GOT.  */
475718a5822eSThomas Veerman   BFD_RELOC_CRIS_32_PLT_GOTREL,
475818a5822eSThomas Veerman 
475918a5822eSThomas Veerman /* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
476018a5822eSThomas Veerman   BFD_RELOC_CRIS_32_PLT_PCREL,
476118a5822eSThomas Veerman 
476218a5822eSThomas Veerman /* Relocs used in TLS code for CRIS.  */
476318a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT_GD,
476418a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT_GD,
476518a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GD,
476618a5822eSThomas Veerman   BFD_RELOC_CRIS_DTP,
476718a5822eSThomas Veerman   BFD_RELOC_CRIS_32_DTPREL,
476818a5822eSThomas Veerman   BFD_RELOC_CRIS_16_DTPREL,
476918a5822eSThomas Veerman   BFD_RELOC_CRIS_32_GOT_TPREL,
477018a5822eSThomas Veerman   BFD_RELOC_CRIS_16_GOT_TPREL,
477118a5822eSThomas Veerman   BFD_RELOC_CRIS_32_TPREL,
477218a5822eSThomas Veerman   BFD_RELOC_CRIS_16_TPREL,
477318a5822eSThomas Veerman   BFD_RELOC_CRIS_DTPMOD,
477418a5822eSThomas Veerman   BFD_RELOC_CRIS_32_IE,
477518a5822eSThomas Veerman 
477618a5822eSThomas Veerman /* Intel i860 Relocations.  */
477718a5822eSThomas Veerman   BFD_RELOC_860_COPY,
477818a5822eSThomas Veerman   BFD_RELOC_860_GLOB_DAT,
477918a5822eSThomas Veerman   BFD_RELOC_860_JUMP_SLOT,
478018a5822eSThomas Veerman   BFD_RELOC_860_RELATIVE,
478118a5822eSThomas Veerman   BFD_RELOC_860_PC26,
478218a5822eSThomas Veerman   BFD_RELOC_860_PLT26,
478318a5822eSThomas Veerman   BFD_RELOC_860_PC16,
478418a5822eSThomas Veerman   BFD_RELOC_860_LOW0,
478518a5822eSThomas Veerman   BFD_RELOC_860_SPLIT0,
478618a5822eSThomas Veerman   BFD_RELOC_860_LOW1,
478718a5822eSThomas Veerman   BFD_RELOC_860_SPLIT1,
478818a5822eSThomas Veerman   BFD_RELOC_860_LOW2,
478918a5822eSThomas Veerman   BFD_RELOC_860_SPLIT2,
479018a5822eSThomas Veerman   BFD_RELOC_860_LOW3,
479118a5822eSThomas Veerman   BFD_RELOC_860_LOGOT0,
479218a5822eSThomas Veerman   BFD_RELOC_860_SPGOT0,
479318a5822eSThomas Veerman   BFD_RELOC_860_LOGOT1,
479418a5822eSThomas Veerman   BFD_RELOC_860_SPGOT1,
479518a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF0,
479618a5822eSThomas Veerman   BFD_RELOC_860_SPGOTOFF0,
479718a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF1,
479818a5822eSThomas Veerman   BFD_RELOC_860_SPGOTOFF1,
479918a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF2,
480018a5822eSThomas Veerman   BFD_RELOC_860_LOGOTOFF3,
480118a5822eSThomas Veerman   BFD_RELOC_860_LOPC,
480218a5822eSThomas Veerman   BFD_RELOC_860_HIGHADJ,
480318a5822eSThomas Veerman   BFD_RELOC_860_HAGOT,
480418a5822eSThomas Veerman   BFD_RELOC_860_HAGOTOFF,
480518a5822eSThomas Veerman   BFD_RELOC_860_HAPC,
480618a5822eSThomas Veerman   BFD_RELOC_860_HIGH,
480718a5822eSThomas Veerman   BFD_RELOC_860_HIGOT,
480818a5822eSThomas Veerman   BFD_RELOC_860_HIGOTOFF,
480918a5822eSThomas Veerman 
481018a5822eSThomas Veerman /* OpenRISC Relocations.  */
481118a5822eSThomas Veerman   BFD_RELOC_OPENRISC_ABS_26,
481218a5822eSThomas Veerman   BFD_RELOC_OPENRISC_REL_26,
481318a5822eSThomas Veerman 
481418a5822eSThomas Veerman /* H8 elf Relocations.  */
481518a5822eSThomas Veerman   BFD_RELOC_H8_DIR16A8,
481618a5822eSThomas Veerman   BFD_RELOC_H8_DIR16R8,
481718a5822eSThomas Veerman   BFD_RELOC_H8_DIR24A8,
481818a5822eSThomas Veerman   BFD_RELOC_H8_DIR24R8,
481918a5822eSThomas Veerman   BFD_RELOC_H8_DIR32A16,
482018a5822eSThomas Veerman 
482118a5822eSThomas Veerman /* Sony Xstormy16 Relocations.  */
482218a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_REL_12,
482318a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_12,
482418a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_24,
482518a5822eSThomas Veerman   BFD_RELOC_XSTORMY16_FPTR16,
482618a5822eSThomas Veerman 
482718a5822eSThomas Veerman /* Self-describing complex relocations.  */
482818a5822eSThomas Veerman   BFD_RELOC_RELC,
482918a5822eSThomas Veerman 
483018a5822eSThomas Veerman 
483118a5822eSThomas Veerman /* Infineon Relocations.  */
483218a5822eSThomas Veerman   BFD_RELOC_XC16X_PAG,
483318a5822eSThomas Veerman   BFD_RELOC_XC16X_POF,
483418a5822eSThomas Veerman   BFD_RELOC_XC16X_SEG,
483518a5822eSThomas Veerman   BFD_RELOC_XC16X_SOF,
483618a5822eSThomas Veerman 
483718a5822eSThomas Veerman /* Relocations used by VAX ELF.  */
483818a5822eSThomas Veerman   BFD_RELOC_VAX_GLOB_DAT,
483918a5822eSThomas Veerman   BFD_RELOC_VAX_JMP_SLOT,
484018a5822eSThomas Veerman   BFD_RELOC_VAX_RELATIVE,
484118a5822eSThomas Veerman 
484218a5822eSThomas Veerman /* Morpho MT - 16 bit immediate relocation.  */
484318a5822eSThomas Veerman   BFD_RELOC_MT_PC16,
484418a5822eSThomas Veerman 
484518a5822eSThomas Veerman /* Morpho MT - Hi 16 bits of an address.  */
484618a5822eSThomas Veerman   BFD_RELOC_MT_HI16,
484718a5822eSThomas Veerman 
484818a5822eSThomas Veerman /* Morpho MT - Low 16 bits of an address.  */
484918a5822eSThomas Veerman   BFD_RELOC_MT_LO16,
485018a5822eSThomas Veerman 
485118a5822eSThomas Veerman /* Morpho MT - Used to tell the linker which vtable entries are used.  */
485218a5822eSThomas Veerman   BFD_RELOC_MT_GNU_VTINHERIT,
485318a5822eSThomas Veerman 
485418a5822eSThomas Veerman /* Morpho MT - Used to tell the linker which vtable entries are used.  */
485518a5822eSThomas Veerman   BFD_RELOC_MT_GNU_VTENTRY,
485618a5822eSThomas Veerman 
485718a5822eSThomas Veerman /* Morpho MT - 8 bit immediate relocation.  */
485818a5822eSThomas Veerman   BFD_RELOC_MT_PCINSN8,
485918a5822eSThomas Veerman 
486018a5822eSThomas Veerman /* msp430 specific relocation codes  */
486118a5822eSThomas Veerman   BFD_RELOC_MSP430_10_PCREL,
486218a5822eSThomas Veerman   BFD_RELOC_MSP430_16_PCREL,
486318a5822eSThomas Veerman   BFD_RELOC_MSP430_16,
486418a5822eSThomas Veerman   BFD_RELOC_MSP430_16_PCREL_BYTE,
486518a5822eSThomas Veerman   BFD_RELOC_MSP430_16_BYTE,
486618a5822eSThomas Veerman   BFD_RELOC_MSP430_2X_PCREL,
486718a5822eSThomas Veerman   BFD_RELOC_MSP430_RL_PCREL,
486818a5822eSThomas Veerman 
486918a5822eSThomas Veerman /* IQ2000 Relocations.  */
487018a5822eSThomas Veerman   BFD_RELOC_IQ2000_OFFSET_16,
487118a5822eSThomas Veerman   BFD_RELOC_IQ2000_OFFSET_21,
487218a5822eSThomas Veerman   BFD_RELOC_IQ2000_UHI16,
487318a5822eSThomas Veerman 
487418a5822eSThomas Veerman /* Special Xtensa relocation used only by PLT entries in ELF shared
487518a5822eSThomas Veerman objects to indicate that the runtime linker should set the value
487618a5822eSThomas Veerman to one of its own internal functions or data structures.  */
487718a5822eSThomas Veerman   BFD_RELOC_XTENSA_RTLD,
487818a5822eSThomas Veerman 
487918a5822eSThomas Veerman /* Xtensa relocations for ELF shared objects.  */
488018a5822eSThomas Veerman   BFD_RELOC_XTENSA_GLOB_DAT,
488118a5822eSThomas Veerman   BFD_RELOC_XTENSA_JMP_SLOT,
488218a5822eSThomas Veerman   BFD_RELOC_XTENSA_RELATIVE,
488318a5822eSThomas Veerman 
488418a5822eSThomas Veerman /* Xtensa relocation used in ELF object files for symbols that may require
488518a5822eSThomas Veerman PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
488618a5822eSThomas Veerman   BFD_RELOC_XTENSA_PLT,
488718a5822eSThomas Veerman 
488818a5822eSThomas Veerman /* Xtensa relocations to mark the difference of two local symbols.
488918a5822eSThomas Veerman These are only needed to support linker relaxation and can be ignored
489018a5822eSThomas Veerman when not relaxing.  The field is set to the value of the difference
489118a5822eSThomas Veerman assuming no relaxation.  The relocation encodes the position of the
489218a5822eSThomas Veerman first symbol so the linker can determine whether to adjust the field
489318a5822eSThomas Veerman value.  */
489418a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF8,
489518a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF16,
489618a5822eSThomas Veerman   BFD_RELOC_XTENSA_DIFF32,
489718a5822eSThomas Veerman 
489818a5822eSThomas Veerman /* Generic Xtensa relocations for instruction operands.  Only the slot
489918a5822eSThomas Veerman number is encoded in the relocation.  The relocation applies to the
490018a5822eSThomas Veerman last PC-relative immediate operand, or if there are no PC-relative
490118a5822eSThomas Veerman immediates, to the last immediate operand.  */
490218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT0_OP,
490318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT1_OP,
490418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT2_OP,
490518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT3_OP,
490618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT4_OP,
490718a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT5_OP,
490818a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT6_OP,
490918a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT7_OP,
491018a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT8_OP,
491118a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT9_OP,
491218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT10_OP,
491318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT11_OP,
491418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT12_OP,
491518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT13_OP,
491618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT14_OP,
491718a5822eSThomas Veerman 
491818a5822eSThomas Veerman /* Alternate Xtensa relocations.  Only the slot is encoded in the
491918a5822eSThomas Veerman relocation.  The meaning of these relocations is opcode-specific.  */
492018a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT0_ALT,
492118a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT1_ALT,
492218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT2_ALT,
492318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT3_ALT,
492418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT4_ALT,
492518a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT5_ALT,
492618a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT6_ALT,
492718a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT7_ALT,
492818a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT8_ALT,
492918a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT9_ALT,
493018a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT10_ALT,
493118a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT11_ALT,
493218a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT12_ALT,
493318a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT13_ALT,
493418a5822eSThomas Veerman   BFD_RELOC_XTENSA_SLOT14_ALT,
493518a5822eSThomas Veerman 
493618a5822eSThomas Veerman /* Xtensa relocations for backward compatibility.  These have all been
493718a5822eSThomas Veerman replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
493818a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP0,
493918a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP1,
494018a5822eSThomas Veerman   BFD_RELOC_XTENSA_OP2,
494118a5822eSThomas Veerman 
494218a5822eSThomas Veerman /* Xtensa relocation to mark that the assembler expanded the
494318a5822eSThomas Veerman instructions from an original target.  The expansion size is
494418a5822eSThomas Veerman encoded in the reloc size.  */
494518a5822eSThomas Veerman   BFD_RELOC_XTENSA_ASM_EXPAND,
494618a5822eSThomas Veerman 
494718a5822eSThomas Veerman /* Xtensa relocation to mark that the linker should simplify
494818a5822eSThomas Veerman assembler-expanded instructions.  This is commonly used
494918a5822eSThomas Veerman internally by the linker after analysis of a
495018a5822eSThomas Veerman BFD_RELOC_XTENSA_ASM_EXPAND.  */
495118a5822eSThomas Veerman   BFD_RELOC_XTENSA_ASM_SIMPLIFY,
495218a5822eSThomas Veerman 
495318a5822eSThomas Veerman /* Xtensa TLS relocations.  */
495418a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLSDESC_FN,
495518a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLSDESC_ARG,
495618a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_DTPOFF,
495718a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_TPOFF,
495818a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_FUNC,
495918a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_ARG,
496018a5822eSThomas Veerman   BFD_RELOC_XTENSA_TLS_CALL,
496118a5822eSThomas Veerman 
496218a5822eSThomas Veerman /* 8 bit signed offset in (ix+d) or (iy+d).  */
496318a5822eSThomas Veerman   BFD_RELOC_Z80_DISP8,
496418a5822eSThomas Veerman 
496518a5822eSThomas Veerman /* DJNZ offset.  */
496618a5822eSThomas Veerman   BFD_RELOC_Z8K_DISP7,
496718a5822eSThomas Veerman 
496818a5822eSThomas Veerman /* CALR offset.  */
496918a5822eSThomas Veerman   BFD_RELOC_Z8K_CALLR,
497018a5822eSThomas Veerman 
497118a5822eSThomas Veerman /* 4 bit value.  */
497218a5822eSThomas Veerman   BFD_RELOC_Z8K_IMM4L,
497318a5822eSThomas Veerman 
497418a5822eSThomas Veerman /* Lattice Mico32 relocations.  */
497518a5822eSThomas Veerman   BFD_RELOC_LM32_CALL,
497618a5822eSThomas Veerman   BFD_RELOC_LM32_BRANCH,
497718a5822eSThomas Veerman   BFD_RELOC_LM32_16_GOT,
497818a5822eSThomas Veerman   BFD_RELOC_LM32_GOTOFF_HI16,
497918a5822eSThomas Veerman   BFD_RELOC_LM32_GOTOFF_LO16,
498018a5822eSThomas Veerman   BFD_RELOC_LM32_COPY,
498118a5822eSThomas Veerman   BFD_RELOC_LM32_GLOB_DAT,
498218a5822eSThomas Veerman   BFD_RELOC_LM32_JMP_SLOT,
498318a5822eSThomas Veerman   BFD_RELOC_LM32_RELATIVE,
498418a5822eSThomas Veerman 
498518a5822eSThomas Veerman /* Difference between two section addreses.  Must be followed by a
498618a5822eSThomas Veerman BFD_RELOC_MACH_O_PAIR.  */
498718a5822eSThomas Veerman   BFD_RELOC_MACH_O_SECTDIFF,
498818a5822eSThomas Veerman 
4989*c9ea9e7aSLionel Sambuc /* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol.  */
4990*c9ea9e7aSLionel Sambuc   BFD_RELOC_MACH_O_LOCAL_SECTDIFF,
4991*c9ea9e7aSLionel Sambuc 
499218a5822eSThomas Veerman /* Pair of relocation.  Contains the first symbol.  */
499318a5822eSThomas Veerman   BFD_RELOC_MACH_O_PAIR,
499418a5822eSThomas Veerman 
499518a5822eSThomas Veerman /* PCREL relocations.  They are marked as branch to create PLT entry if
499618a5822eSThomas Veerman required.  */
499718a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_BRANCH32,
499818a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_BRANCH8,
499918a5822eSThomas Veerman 
500018a5822eSThomas Veerman /* Used when referencing a GOT entry.  */
500118a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_GOT,
500218a5822eSThomas Veerman 
500318a5822eSThomas Veerman /* Used when loading a GOT entry with movq.  It is specially marked so that
500418a5822eSThomas Veerman the linker could optimize the movq to a leaq if possible.  */
500518a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_GOT_LOAD,
500618a5822eSThomas Veerman 
500718a5822eSThomas Veerman /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
500818a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
500918a5822eSThomas Veerman 
501018a5822eSThomas Veerman /* Symbol will be substracted.  Must be followed by a BFD_RELOC_64.  */
501118a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64,
501218a5822eSThomas Veerman 
501318a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend.  */
501418a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_1,
501518a5822eSThomas Veerman 
501618a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend.  */
501718a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_2,
501818a5822eSThomas Veerman 
501918a5822eSThomas Veerman /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend.  */
502018a5822eSThomas Veerman   BFD_RELOC_MACH_O_X86_64_PCREL32_4,
502118a5822eSThomas Veerman 
502218a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores the
502318a5822eSThomas Veerman low 16 bits of a value  */
502418a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_LO,
502518a5822eSThomas Veerman 
502618a5822eSThomas Veerman /* This is a 32 bit pc-relative reloc for the microblaze that
502718a5822eSThomas Veerman stores the low 16 bits of a value  */
502818a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_LO_PCREL,
502918a5822eSThomas Veerman 
503018a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores a
503118a5822eSThomas Veerman value relative to the read-only small data area anchor  */
503218a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_ROSDA,
503318a5822eSThomas Veerman 
503418a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze that stores a
503518a5822eSThomas Veerman value relative to the read-write small data area anchor  */
503618a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_RWSDA,
503718a5822eSThomas Veerman 
503818a5822eSThomas Veerman /* This is a 32 bit reloc for the microblaze to handle
503918a5822eSThomas Veerman expressions of the form "Symbol Op Symbol"  */
504018a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
504118a5822eSThomas Veerman 
504218a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
504318a5822eSThomas Veerman value in two words (with an imm instruction).  No relocation is
504418a5822eSThomas Veerman done here - only used for relaxing  */
504518a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_NONE,
504618a5822eSThomas Veerman 
504718a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
504818a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
504918a5822eSThomas Veerman PC-relative GOT offset  */
505018a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOTPC,
505118a5822eSThomas Veerman 
505218a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
505318a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
505418a5822eSThomas Veerman GOT offset  */
505518a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOT,
505618a5822eSThomas Veerman 
505718a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit pc relative
505818a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
505918a5822eSThomas Veerman PC-relative offset into PLT  */
506018a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_PLT,
506118a5822eSThomas Veerman 
506218a5822eSThomas Veerman /* This is a 64 bit reloc that stores the 32 bit GOT relative
506318a5822eSThomas Veerman value in two words (with an imm instruction).  The relocation is
506418a5822eSThomas Veerman relative offset from _GLOBAL_OFFSET_TABLE_  */
506518a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_64_GOTOFF,
506618a5822eSThomas Veerman 
506718a5822eSThomas Veerman /* This is a 32 bit reloc that stores the 32 bit GOT relative
506818a5822eSThomas Veerman value in a word.  The relocation is relative offset from  */
506918a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_32_GOTOFF,
507018a5822eSThomas Veerman 
507118a5822eSThomas Veerman /* This is used to tell the dynamic linker to copy the value out of
507218a5822eSThomas Veerman the dynamic object into the runtime process image.  */
507318a5822eSThomas Veerman   BFD_RELOC_MICROBLAZE_COPY,
5074*c9ea9e7aSLionel Sambuc 
5075*c9ea9e7aSLionel Sambuc /* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
5076*c9ea9e7aSLionel Sambuc Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5077*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADD_LO12,
5078*c9ea9e7aSLionel Sambuc 
5079*c9ea9e7aSLionel Sambuc /* Get to the page base of the global offset table entry for a symbol as
5080*c9ea9e7aSLionel Sambuc part of an ADRP instruction using a 21 bit PC relative value.Used in
5081*c9ea9e7aSLionel Sambuc conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC.  */
5082*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_GOT_PAGE,
5083*c9ea9e7aSLionel Sambuc 
5084*c9ea9e7aSLionel Sambuc /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5085*c9ea9e7aSLionel Sambuc offset, giving a 4KB aligned page base address.  */
5086*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_HI21_PCREL,
5087*c9ea9e7aSLionel Sambuc 
5088*c9ea9e7aSLionel Sambuc /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page
5089*c9ea9e7aSLionel Sambuc offset, giving a 4KB aligned page base address, but with no overflow
5090*c9ea9e7aSLionel Sambuc checking.  */
5091*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL,
5092*c9ea9e7aSLionel Sambuc 
5093*c9ea9e7aSLionel Sambuc /* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset.  */
5094*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_ADR_LO21_PCREL,
5095*c9ea9e7aSLionel Sambuc 
5096*c9ea9e7aSLionel Sambuc /* AArch64 19 bit pc-relative conditional branch and compare & branch.
5097*c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5098*c9ea9e7aSLionel Sambuc giving a 21 bit signed byte offset.  */
5099*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_BRANCH19,
5100*c9ea9e7aSLionel Sambuc 
5101*c9ea9e7aSLionel Sambuc /* AArch64 26 bit pc-relative unconditional branch and link.
5102*c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5103*c9ea9e7aSLionel Sambuc giving a 28 bit signed byte offset.  */
5104*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_CALL26,
5105*c9ea9e7aSLionel Sambuc 
5106*c9ea9e7aSLionel Sambuc /* AArch64 pseudo relocation code to be used internally by the AArch64
5107*c9ea9e7aSLionel Sambuc assembler and not (currently) written to any object files.  */
5108*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP,
5109*c9ea9e7aSLionel Sambuc 
5110*c9ea9e7aSLionel Sambuc /* AArch64 26 bit pc-relative unconditional branch.
5111*c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5112*c9ea9e7aSLionel Sambuc giving a 28 bit signed byte offset.  */
5113*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_JUMP26,
5114*c9ea9e7aSLionel Sambuc 
5115*c9ea9e7aSLionel Sambuc /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word
5116*c9ea9e7aSLionel Sambuc offset.  The lowest two bits must be zero and are not stored in the
5117*c9ea9e7aSLionel Sambuc instruction, giving a 21 bit signed byte offset.  */
5118*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LD_LO19_PCREL,
5119*c9ea9e7aSLionel Sambuc 
5120*c9ea9e7aSLionel Sambuc /* Unsigned 12 bit byte offset for 64 bit load/store from the page of
5121*c9ea9e7aSLionel Sambuc the GOT entry for this symbol.  Used in conjunction with
5122*c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_ADR_GOTPAGE.  */
5123*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LD64_GOT_LO12_NC,
5124*c9ea9e7aSLionel Sambuc 
5125*c9ea9e7aSLionel Sambuc /* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the
5126*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5127*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST_LO12,
5128*c9ea9e7aSLionel Sambuc 
5129*c9ea9e7aSLionel Sambuc /* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the
5130*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5131*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST8_LO12,
5132*c9ea9e7aSLionel Sambuc 
5133*c9ea9e7aSLionel Sambuc /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the
5134*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5135*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST16_LO12,
5136*c9ea9e7aSLionel Sambuc 
5137*c9ea9e7aSLionel Sambuc /* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the
5138*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5139*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST32_LO12,
5140*c9ea9e7aSLionel Sambuc 
5141*c9ea9e7aSLionel Sambuc /* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the
5142*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5143*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST64_LO12,
5144*c9ea9e7aSLionel Sambuc 
5145*c9ea9e7aSLionel Sambuc /* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the
5146*c9ea9e7aSLionel Sambuc address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
5147*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_LDST128_LO12,
5148*c9ea9e7aSLionel Sambuc 
5149*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 0 to 15
5150*c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5151*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0,
5152*c9ea9e7aSLionel Sambuc 
5153*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 0 to 15
5154*c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5155*c9ea9e7aSLionel Sambuc value's sign.  */
5156*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0_S,
5157*c9ea9e7aSLionel Sambuc 
5158*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of
5159*c9ea9e7aSLionel Sambuc an address/value.  No overflow checking.  */
5160*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G0_NC,
5161*c9ea9e7aSLionel Sambuc 
5162*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 16 to 31
5163*c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5164*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1,
5165*c9ea9e7aSLionel Sambuc 
5166*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 16 to 31
5167*c9ea9e7aSLionel Sambuc of an address/value.  No overflow checking.  */
5168*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1_NC,
5169*c9ea9e7aSLionel Sambuc 
5170*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 16 to 31
5171*c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5172*c9ea9e7aSLionel Sambuc value's sign.  */
5173*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G1_S,
5174*c9ea9e7aSLionel Sambuc 
5175*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most significant bits 32 to 47
5176*c9ea9e7aSLionel Sambuc of an unsigned address/value.  */
5177*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2,
5178*c9ea9e7aSLionel Sambuc 
5179*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with less significant bits 32 to 47
5180*c9ea9e7aSLionel Sambuc of an address/value.  No overflow checking.  */
5181*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2_NC,
5182*c9ea9e7aSLionel Sambuc 
5183*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZ] instruction with most significant bits 32 to 47
5184*c9ea9e7aSLionel Sambuc of a signed value.  Changes instruction to MOVZ or MOVN depending on the
5185*c9ea9e7aSLionel Sambuc value's sign.  */
5186*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G2_S,
5187*c9ea9e7aSLionel Sambuc 
5188*c9ea9e7aSLionel Sambuc /* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64
5189*c9ea9e7aSLionel Sambuc of a signed or unsigned address/value.  */
5190*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_MOVW_G3,
5191*c9ea9e7aSLionel Sambuc 
5192*c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5193*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC,
5194*c9ea9e7aSLionel Sambuc 
5195*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5196*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADD,
5197*c9ea9e7aSLionel Sambuc 
5198*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5199*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC,
5200*c9ea9e7aSLionel Sambuc 
5201*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5202*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE,
5203*c9ea9e7aSLionel Sambuc 
5204*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5205*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
5206*c9ea9e7aSLionel Sambuc 
5207*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5208*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_CALL,
5209*c9ea9e7aSLionel Sambuc 
5210*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5211*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC,
5212*c9ea9e7aSLionel Sambuc 
5213*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5214*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19,
5215*c9ea9e7aSLionel Sambuc 
5216*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5217*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_LDR,
5218*c9ea9e7aSLionel Sambuc 
5219*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5220*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC,
5221*c9ea9e7aSLionel Sambuc 
5222*c9ea9e7aSLionel Sambuc /* AArch64 TLS DESC relocation.  */
5223*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSDESC_OFF_G1,
5224*c9ea9e7aSLionel Sambuc 
5225*c9ea9e7aSLionel Sambuc /* Unsigned 12 bit byte offset to global offset table entry for a symbols
5226*c9ea9e7aSLionel Sambuc tls_index structure.  Used in conjunction with
5227*c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
5228*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC,
5229*c9ea9e7aSLionel Sambuc 
5230*c9ea9e7aSLionel Sambuc /* Get to the page base of the global offset table entry for a symbols
5231*c9ea9e7aSLionel Sambuc tls_index structure as part of an adrp instruction using a 21 bit PC
5232*c9ea9e7aSLionel Sambuc relative value.  Used in conjunction with
5233*c9ea9e7aSLionel Sambuc BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC.  */
5234*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21,
5235*c9ea9e7aSLionel Sambuc 
5236*c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5237*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
5238*c9ea9e7aSLionel Sambuc 
5239*c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5240*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
5241*c9ea9e7aSLionel Sambuc 
5242*c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5243*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,
5244*c9ea9e7aSLionel Sambuc 
5245*c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5246*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
5247*c9ea9e7aSLionel Sambuc 
5248*c9ea9e7aSLionel Sambuc /* AArch64 TLS INITIAL EXEC relocation.  */
5249*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
5250*c9ea9e7aSLionel Sambuc 
5251*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5252*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12,
5253*c9ea9e7aSLionel Sambuc 
5254*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5255*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12,
5256*c9ea9e7aSLionel Sambuc 
5257*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5258*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
5259*c9ea9e7aSLionel Sambuc 
5260*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5261*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0,
5262*c9ea9e7aSLionel Sambuc 
5263*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5264*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC,
5265*c9ea9e7aSLionel Sambuc 
5266*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5267*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1,
5268*c9ea9e7aSLionel Sambuc 
5269*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5270*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC,
5271*c9ea9e7aSLionel Sambuc 
5272*c9ea9e7aSLionel Sambuc /* AArch64 TLS LOCAL EXEC relocation.  */
5273*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
5274*c9ea9e7aSLionel Sambuc 
5275*c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5276*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_DTPMOD64,
5277*c9ea9e7aSLionel Sambuc 
5278*c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5279*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_DTPREL64,
5280*c9ea9e7aSLionel Sambuc 
5281*c9ea9e7aSLionel Sambuc /* AArch64 TLS relocation.  */
5282*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TLS_TPREL64,
5283*c9ea9e7aSLionel Sambuc 
5284*c9ea9e7aSLionel Sambuc /* AArch64 14 bit pc-relative test bit and branch.
5285*c9ea9e7aSLionel Sambuc The lowest two bits must be zero and are not stored in the instruction,
5286*c9ea9e7aSLionel Sambuc giving a 16 bit signed byte offset.  */
5287*c9ea9e7aSLionel Sambuc   BFD_RELOC_AARCH64_TSTBR14,
5288*c9ea9e7aSLionel Sambuc 
5289*c9ea9e7aSLionel Sambuc /* Tilera TILEPro Relocations.  */
5290*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_COPY,
5291*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_GLOB_DAT,
5292*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JMP_SLOT,
5293*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_RELATIVE,
5294*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_BROFF_X1,
5295*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JOFFLONG_X1,
5296*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT,
5297*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X0,
5298*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y0,
5299*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X1,
5300*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y1,
5301*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_DEST_IMM8_X1,
5302*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MT_IMM15_X1,
5303*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MF_IMM15_X1,
5304*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0,
5305*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1,
5306*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_LO,
5307*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_LO,
5308*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HI,
5309*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HI,
5310*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HA,
5311*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HA,
5312*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_PCREL,
5313*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_PCREL,
5314*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL,
5315*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL,
5316*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL,
5317*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL,
5318*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL,
5319*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL,
5320*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT,
5321*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT,
5322*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO,
5323*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO,
5324*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI,
5325*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI,
5326*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA,
5327*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA,
5328*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMSTART_X0,
5329*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMEND_X0,
5330*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMSTART_X1,
5331*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_MMEND_X1,
5332*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_X0,
5333*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_X1,
5334*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_Y0,
5335*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_SHAMT_Y1,
5336*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_GD_CALL,
5337*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
5338*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
5339*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
5340*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
5341*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_IE_LOAD,
5342*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD,
5343*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD,
5344*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO,
5345*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO,
5346*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI,
5347*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI,
5348*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA,
5349*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA,
5350*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE,
5351*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE,
5352*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO,
5353*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO,
5354*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI,
5355*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI,
5356*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA,
5357*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA,
5358*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_DTPMOD32,
5359*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_DTPOFF32,
5360*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_TLS_TPOFF32,
5361*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
5362*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
5363*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
5364*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
5365*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
5366*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
5367*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
5368*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
5369*c9ea9e7aSLionel Sambuc 
5370*c9ea9e7aSLionel Sambuc /* Tilera TILE-Gx Relocations.  */
5371*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW0,
5372*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW1,
5373*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW2,
5374*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW3,
5375*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW0_LAST,
5376*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW1_LAST,
5377*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_HW2_LAST,
5378*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_COPY,
5379*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_GLOB_DAT,
5380*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JMP_SLOT,
5381*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_RELATIVE,
5382*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_BROFF_X1,
5383*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JUMPOFF_X1,
5384*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_JUMPOFF_X1_PLT,
5385*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0,
5386*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0,
5387*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1,
5388*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1,
5389*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_DEST_IMM8_X1,
5390*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MT_IMM14_X1,
5391*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MF_IMM14_X1,
5392*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MMSTART_X0,
5393*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_MMEND_X0,
5394*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_X0,
5395*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_X1,
5396*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_Y0,
5397*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_SHAMT_Y1,
5398*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0,
5399*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0,
5400*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1,
5401*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1,
5402*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2,
5403*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2,
5404*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW3,
5405*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW3,
5406*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST,
5407*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST,
5408*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST,
5409*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST,
5410*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST,
5411*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST,
5412*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL,
5413*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL,
5414*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL,
5415*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL,
5416*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL,
5417*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL,
5418*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL,
5419*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL,
5420*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL,
5421*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL,
5422*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL,
5423*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL,
5424*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL,
5425*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL,
5426*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT,
5427*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT,
5428*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT,
5429*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT,
5430*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT,
5431*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT,
5432*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD,
5433*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD,
5434*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
5435*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
5436*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
5437*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
5438*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
5439*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
5440*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD,
5441*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD,
5442*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD,
5443*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD,
5444*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE,
5445*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE,
5446*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE,
5447*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE,
5448*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE,
5449*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE,
5450*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPMOD64,
5451*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPOFF64,
5452*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_TPOFF64,
5453*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPMOD32,
5454*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_DTPOFF32,
5455*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_TPOFF32,
5456*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_GD_CALL,
5457*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
5458*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
5459*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
5460*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD,
5461*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_TLS_IE_LOAD,
5462*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
5463*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
5464*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD,
5465*c9ea9e7aSLionel Sambuc   BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD,
5466*c9ea9e7aSLionel Sambuc 
5467*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement  */
5468*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM8,
5469*c9ea9e7aSLionel Sambuc 
5470*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 24 bit signed pc-relative displacement  */
5471*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM24,
5472*c9ea9e7aSLionel Sambuc 
5473*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 16 most-significant bits of absolute address  */
5474*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_HIGH,
5475*c9ea9e7aSLionel Sambuc 
5476*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 16 least-significant bits of absolute address  */
5477*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_LOW,
5478*c9ea9e7aSLionel Sambuc 
5479*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate  */
5480*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_SIMM11,
5481*c9ea9e7aSLionel Sambuc 
5482*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement)  */
5483*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_IMM11,
5484*c9ea9e7aSLionel Sambuc 
5485*c9ea9e7aSLionel Sambuc /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction.  */
5486*c9ea9e7aSLionel Sambuc   BFD_RELOC_EPIPHANY_IMM8,
548718a5822eSThomas Veerman   BFD_RELOC_UNUSED };
548818a5822eSThomas Veerman typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
548918a5822eSThomas Veerman reloc_howto_type *bfd_reloc_type_lookup
549018a5822eSThomas Veerman    (bfd *abfd, bfd_reloc_code_real_type code);
549118a5822eSThomas Veerman reloc_howto_type *bfd_reloc_name_lookup
549218a5822eSThomas Veerman    (bfd *abfd, const char *reloc_name);
549318a5822eSThomas Veerman 
549418a5822eSThomas Veerman const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
549518a5822eSThomas Veerman 
549618a5822eSThomas Veerman /* Extracted from syms.c.  */
549718a5822eSThomas Veerman 
549818a5822eSThomas Veerman typedef struct bfd_symbol
549918a5822eSThomas Veerman {
550018a5822eSThomas Veerman   /* A pointer to the BFD which owns the symbol. This information
550118a5822eSThomas Veerman      is necessary so that a back end can work out what additional
550218a5822eSThomas Veerman      information (invisible to the application writer) is carried
550318a5822eSThomas Veerman      with the symbol.
550418a5822eSThomas Veerman 
550518a5822eSThomas Veerman      This field is *almost* redundant, since you can use section->owner
550618a5822eSThomas Veerman      instead, except that some symbols point to the global sections
550718a5822eSThomas Veerman      bfd_{abs,com,und}_section.  This could be fixed by making
550818a5822eSThomas Veerman      these globals be per-bfd (or per-target-flavor).  FIXME.  */
550918a5822eSThomas Veerman   struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
551018a5822eSThomas Veerman 
551118a5822eSThomas Veerman   /* The text of the symbol. The name is left alone, and not copied; the
551218a5822eSThomas Veerman      application may not alter it.  */
551318a5822eSThomas Veerman   const char *name;
551418a5822eSThomas Veerman 
551518a5822eSThomas Veerman   /* The value of the symbol.  This really should be a union of a
551618a5822eSThomas Veerman      numeric value with a pointer, since some flags indicate that
551718a5822eSThomas Veerman      a pointer to another symbol is stored here.  */
551818a5822eSThomas Veerman   symvalue value;
551918a5822eSThomas Veerman 
552018a5822eSThomas Veerman   /* Attributes of a symbol.  */
552118a5822eSThomas Veerman #define BSF_NO_FLAGS           0x00
552218a5822eSThomas Veerman 
552318a5822eSThomas Veerman   /* The symbol has local scope; <<static>> in <<C>>. The value
552418a5822eSThomas Veerman      is the offset into the section of the data.  */
552518a5822eSThomas Veerman #define BSF_LOCAL              (1 << 0)
552618a5822eSThomas Veerman 
552718a5822eSThomas Veerman   /* The symbol has global scope; initialized data in <<C>>. The
552818a5822eSThomas Veerman      value is the offset into the section of the data.  */
552918a5822eSThomas Veerman #define BSF_GLOBAL             (1 << 1)
553018a5822eSThomas Veerman 
553118a5822eSThomas Veerman   /* The symbol has global scope and is exported. The value is
553218a5822eSThomas Veerman      the offset into the section of the data.  */
553318a5822eSThomas Veerman #define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
553418a5822eSThomas Veerman 
553518a5822eSThomas Veerman   /* A normal C symbol would be one of:
553618a5822eSThomas Veerman      <<BSF_LOCAL>>, <<BSF_COMMON>>,  <<BSF_UNDEFINED>> or
553718a5822eSThomas Veerman      <<BSF_GLOBAL>>.  */
553818a5822eSThomas Veerman 
553918a5822eSThomas Veerman   /* The symbol is a debugging record. The value has an arbitrary
554018a5822eSThomas Veerman      meaning, unless BSF_DEBUGGING_RELOC is also set.  */
554118a5822eSThomas Veerman #define BSF_DEBUGGING          (1 << 2)
554218a5822eSThomas Veerman 
554318a5822eSThomas Veerman   /* The symbol denotes a function entry point.  Used in ELF,
554418a5822eSThomas Veerman      perhaps others someday.  */
554518a5822eSThomas Veerman #define BSF_FUNCTION           (1 << 3)
554618a5822eSThomas Veerman 
554718a5822eSThomas Veerman   /* Used by the linker.  */
554818a5822eSThomas Veerman #define BSF_KEEP               (1 << 5)
554918a5822eSThomas Veerman #define BSF_KEEP_G             (1 << 6)
555018a5822eSThomas Veerman 
555118a5822eSThomas Veerman   /* A weak global symbol, overridable without warnings by
555218a5822eSThomas Veerman      a regular global symbol of the same name.  */
555318a5822eSThomas Veerman #define BSF_WEAK               (1 << 7)
555418a5822eSThomas Veerman 
555518a5822eSThomas Veerman   /* This symbol was created to point to a section, e.g. ELF's
555618a5822eSThomas Veerman      STT_SECTION symbols.  */
555718a5822eSThomas Veerman #define BSF_SECTION_SYM        (1 << 8)
555818a5822eSThomas Veerman 
555918a5822eSThomas Veerman   /* The symbol used to be a common symbol, but now it is
556018a5822eSThomas Veerman      allocated.  */
556118a5822eSThomas Veerman #define BSF_OLD_COMMON         (1 << 9)
556218a5822eSThomas Veerman 
556318a5822eSThomas Veerman   /* In some files the type of a symbol sometimes alters its
556418a5822eSThomas Veerman      location in an output file - ie in coff a <<ISFCN>> symbol
556518a5822eSThomas Veerman      which is also <<C_EXT>> symbol appears where it was
556618a5822eSThomas Veerman      declared and not at the end of a section.  This bit is set
556718a5822eSThomas Veerman      by the target BFD part to convey this information.  */
556818a5822eSThomas Veerman #define BSF_NOT_AT_END         (1 << 10)
556918a5822eSThomas Veerman 
557018a5822eSThomas Veerman   /* Signal that the symbol is the label of constructor section.  */
557118a5822eSThomas Veerman #define BSF_CONSTRUCTOR        (1 << 11)
557218a5822eSThomas Veerman 
557318a5822eSThomas Veerman   /* Signal that the symbol is a warning symbol.  The name is a
557418a5822eSThomas Veerman      warning.  The name of the next symbol is the one to warn about;
557518a5822eSThomas Veerman      if a reference is made to a symbol with the same name as the next
557618a5822eSThomas Veerman      symbol, a warning is issued by the linker.  */
557718a5822eSThomas Veerman #define BSF_WARNING            (1 << 12)
557818a5822eSThomas Veerman 
557918a5822eSThomas Veerman   /* Signal that the symbol is indirect.  This symbol is an indirect
558018a5822eSThomas Veerman      pointer to the symbol with the same name as the next symbol.  */
558118a5822eSThomas Veerman #define BSF_INDIRECT           (1 << 13)
558218a5822eSThomas Veerman 
558318a5822eSThomas Veerman   /* BSF_FILE marks symbols that contain a file name.  This is used
558418a5822eSThomas Veerman      for ELF STT_FILE symbols.  */
558518a5822eSThomas Veerman #define BSF_FILE               (1 << 14)
558618a5822eSThomas Veerman 
558718a5822eSThomas Veerman   /* Symbol is from dynamic linking information.  */
558818a5822eSThomas Veerman #define BSF_DYNAMIC            (1 << 15)
558918a5822eSThomas Veerman 
559018a5822eSThomas Veerman   /* The symbol denotes a data object.  Used in ELF, and perhaps
559118a5822eSThomas Veerman      others someday.  */
559218a5822eSThomas Veerman #define BSF_OBJECT             (1 << 16)
559318a5822eSThomas Veerman 
559418a5822eSThomas Veerman   /* This symbol is a debugging symbol.  The value is the offset
559518a5822eSThomas Veerman      into the section of the data.  BSF_DEBUGGING should be set
559618a5822eSThomas Veerman      as well.  */
559718a5822eSThomas Veerman #define BSF_DEBUGGING_RELOC    (1 << 17)
559818a5822eSThomas Veerman 
559918a5822eSThomas Veerman   /* This symbol is thread local.  Used in ELF.  */
560018a5822eSThomas Veerman #define BSF_THREAD_LOCAL       (1 << 18)
560118a5822eSThomas Veerman 
560218a5822eSThomas Veerman   /* This symbol represents a complex relocation expression,
560318a5822eSThomas Veerman      with the expression tree serialized in the symbol name.  */
560418a5822eSThomas Veerman #define BSF_RELC               (1 << 19)
560518a5822eSThomas Veerman 
560618a5822eSThomas Veerman   /* This symbol represents a signed complex relocation expression,
560718a5822eSThomas Veerman      with the expression tree serialized in the symbol name.  */
560818a5822eSThomas Veerman #define BSF_SRELC              (1 << 20)
560918a5822eSThomas Veerman 
561018a5822eSThomas Veerman   /* This symbol was created by bfd_get_synthetic_symtab.  */
561118a5822eSThomas Veerman #define BSF_SYNTHETIC          (1 << 21)
561218a5822eSThomas Veerman 
561318a5822eSThomas Veerman   /* This symbol is an indirect code object.  Unrelated to BSF_INDIRECT.
561418a5822eSThomas Veerman      The dynamic linker will compute the value of this symbol by
561518a5822eSThomas Veerman      calling the function that it points to.  BSF_FUNCTION must
561618a5822eSThomas Veerman      also be also set.  */
561718a5822eSThomas Veerman #define BSF_GNU_INDIRECT_FUNCTION (1 << 22)
561818a5822eSThomas Veerman   /* This symbol is a globally unique data object.  The dynamic linker
561918a5822eSThomas Veerman      will make sure that in the entire process there is just one symbol
562018a5822eSThomas Veerman      with this name and type in use.  BSF_OBJECT must also be set.  */
562118a5822eSThomas Veerman #define BSF_GNU_UNIQUE         (1 << 23)
562218a5822eSThomas Veerman 
562318a5822eSThomas Veerman   flagword flags;
562418a5822eSThomas Veerman 
562518a5822eSThomas Veerman   /* A pointer to the section to which this symbol is
562618a5822eSThomas Veerman      relative.  This will always be non NULL, there are special
562718a5822eSThomas Veerman      sections for undefined and absolute symbols.  */
562818a5822eSThomas Veerman   struct bfd_section *section;
562918a5822eSThomas Veerman 
563018a5822eSThomas Veerman   /* Back end special data.  */
563118a5822eSThomas Veerman   union
563218a5822eSThomas Veerman     {
563318a5822eSThomas Veerman       void *p;
563418a5822eSThomas Veerman       bfd_vma i;
563518a5822eSThomas Veerman     }
563618a5822eSThomas Veerman   udata;
563718a5822eSThomas Veerman }
563818a5822eSThomas Veerman asymbol;
563918a5822eSThomas Veerman 
564018a5822eSThomas Veerman #define bfd_get_symtab_upper_bound(abfd) \
564118a5822eSThomas Veerman      BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
564218a5822eSThomas Veerman 
564318a5822eSThomas Veerman bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
564418a5822eSThomas Veerman 
564518a5822eSThomas Veerman bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
564618a5822eSThomas Veerman 
564718a5822eSThomas Veerman #define bfd_is_local_label_name(abfd, name) \
564818a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
564918a5822eSThomas Veerman 
565018a5822eSThomas Veerman bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
565118a5822eSThomas Veerman 
565218a5822eSThomas Veerman #define bfd_is_target_special_symbol(abfd, sym) \
565318a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
565418a5822eSThomas Veerman 
565518a5822eSThomas Veerman #define bfd_canonicalize_symtab(abfd, location) \
565618a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
565718a5822eSThomas Veerman 
565818a5822eSThomas Veerman bfd_boolean bfd_set_symtab
565918a5822eSThomas Veerman    (bfd *abfd, asymbol **location, unsigned int count);
566018a5822eSThomas Veerman 
566118a5822eSThomas Veerman void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
566218a5822eSThomas Veerman 
566318a5822eSThomas Veerman #define bfd_make_empty_symbol(abfd) \
566418a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
566518a5822eSThomas Veerman 
566618a5822eSThomas Veerman asymbol *_bfd_generic_make_empty_symbol (bfd *);
566718a5822eSThomas Veerman 
566818a5822eSThomas Veerman #define bfd_make_debug_symbol(abfd,ptr,size) \
566918a5822eSThomas Veerman   BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
567018a5822eSThomas Veerman 
567118a5822eSThomas Veerman int bfd_decode_symclass (asymbol *symbol);
567218a5822eSThomas Veerman 
567318a5822eSThomas Veerman bfd_boolean bfd_is_undefined_symclass (int symclass);
567418a5822eSThomas Veerman 
567518a5822eSThomas Veerman void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
567618a5822eSThomas Veerman 
567718a5822eSThomas Veerman bfd_boolean bfd_copy_private_symbol_data
567818a5822eSThomas Veerman    (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
567918a5822eSThomas Veerman 
568018a5822eSThomas Veerman #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
568118a5822eSThomas Veerman   BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
568218a5822eSThomas Veerman             (ibfd, isymbol, obfd, osymbol))
568318a5822eSThomas Veerman 
568418a5822eSThomas Veerman /* Extracted from bfd.c.  */
568518a5822eSThomas Veerman enum bfd_direction
568618a5822eSThomas Veerman   {
568718a5822eSThomas Veerman     no_direction = 0,
568818a5822eSThomas Veerman     read_direction = 1,
568918a5822eSThomas Veerman     write_direction = 2,
569018a5822eSThomas Veerman     both_direction = 3
569118a5822eSThomas Veerman   };
569218a5822eSThomas Veerman 
569318a5822eSThomas Veerman struct bfd
569418a5822eSThomas Veerman {
569518a5822eSThomas Veerman   /* A unique identifier of the BFD  */
569618a5822eSThomas Veerman   unsigned int id;
569718a5822eSThomas Veerman 
569818a5822eSThomas Veerman   /* The filename the application opened the BFD with.  */
569918a5822eSThomas Veerman   const char *filename;
570018a5822eSThomas Veerman 
570118a5822eSThomas Veerman   /* A pointer to the target jump table.  */
570218a5822eSThomas Veerman   const struct bfd_target *xvec;
570318a5822eSThomas Veerman 
570418a5822eSThomas Veerman   /* The IOSTREAM, and corresponding IO vector that provide access
570518a5822eSThomas Veerman      to the file backing the BFD.  */
570618a5822eSThomas Veerman   void *iostream;
570718a5822eSThomas Veerman   const struct bfd_iovec *iovec;
570818a5822eSThomas Veerman 
570918a5822eSThomas Veerman   /* The caching routines use these to maintain a
571018a5822eSThomas Veerman      least-recently-used list of BFDs.  */
571118a5822eSThomas Veerman   struct bfd *lru_prev, *lru_next;
571218a5822eSThomas Veerman 
571318a5822eSThomas Veerman   /* When a file is closed by the caching routines, BFD retains
571418a5822eSThomas Veerman      state information on the file here...  */
571518a5822eSThomas Veerman   ufile_ptr where;
571618a5822eSThomas Veerman 
571718a5822eSThomas Veerman   /* File modified time, if mtime_set is TRUE.  */
571818a5822eSThomas Veerman   long mtime;
571918a5822eSThomas Veerman 
572018a5822eSThomas Veerman   /* Reserved for an unimplemented file locking extension.  */
572118a5822eSThomas Veerman   int ifd;
572218a5822eSThomas Veerman 
572318a5822eSThomas Veerman   /* The format which belongs to the BFD. (object, core, etc.)  */
572418a5822eSThomas Veerman   bfd_format format;
572518a5822eSThomas Veerman 
572618a5822eSThomas Veerman   /* The direction with which the BFD was opened.  */
572718a5822eSThomas Veerman   enum bfd_direction direction;
572818a5822eSThomas Veerman 
572918a5822eSThomas Veerman   /* Format_specific flags.  */
573018a5822eSThomas Veerman   flagword flags;
573118a5822eSThomas Veerman 
573218a5822eSThomas Veerman   /* Values that may appear in the flags field of a BFD.  These also
573318a5822eSThomas Veerman      appear in the object_flags field of the bfd_target structure, where
573418a5822eSThomas Veerman      they indicate the set of flags used by that backend (not all flags
573518a5822eSThomas Veerman      are meaningful for all object file formats) (FIXME: at the moment,
573618a5822eSThomas Veerman      the object_flags values have mostly just been copied from backend
573718a5822eSThomas Veerman      to another, and are not necessarily correct).  */
573818a5822eSThomas Veerman 
573918a5822eSThomas Veerman #define BFD_NO_FLAGS   0x00
574018a5822eSThomas Veerman 
574118a5822eSThomas Veerman   /* BFD contains relocation entries.  */
574218a5822eSThomas Veerman #define HAS_RELOC      0x01
574318a5822eSThomas Veerman 
574418a5822eSThomas Veerman   /* BFD is directly executable.  */
574518a5822eSThomas Veerman #define EXEC_P         0x02
574618a5822eSThomas Veerman 
574718a5822eSThomas Veerman   /* BFD has line number information (basically used for F_LNNO in a
574818a5822eSThomas Veerman      COFF header).  */
574918a5822eSThomas Veerman #define HAS_LINENO     0x04
575018a5822eSThomas Veerman 
575118a5822eSThomas Veerman   /* BFD has debugging information.  */
575218a5822eSThomas Veerman #define HAS_DEBUG      0x08
575318a5822eSThomas Veerman 
575418a5822eSThomas Veerman   /* BFD has symbols.  */
575518a5822eSThomas Veerman #define HAS_SYMS       0x10
575618a5822eSThomas Veerman 
575718a5822eSThomas Veerman   /* BFD has local symbols (basically used for F_LSYMS in a COFF
575818a5822eSThomas Veerman      header).  */
575918a5822eSThomas Veerman #define HAS_LOCALS     0x20
576018a5822eSThomas Veerman 
576118a5822eSThomas Veerman   /* BFD is a dynamic object.  */
576218a5822eSThomas Veerman #define DYNAMIC        0x40
576318a5822eSThomas Veerman 
576418a5822eSThomas Veerman   /* Text section is write protected (if D_PAGED is not set, this is
576518a5822eSThomas Veerman      like an a.out NMAGIC file) (the linker sets this by default, but
576618a5822eSThomas Veerman      clears it for -r or -N).  */
576718a5822eSThomas Veerman #define WP_TEXT        0x80
576818a5822eSThomas Veerman 
576918a5822eSThomas Veerman   /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
577018a5822eSThomas Veerman      linker sets this by default, but clears it for -r or -n or -N).  */
577118a5822eSThomas Veerman #define D_PAGED        0x100
577218a5822eSThomas Veerman 
577318a5822eSThomas Veerman   /* BFD is relaxable (this means that bfd_relax_section may be able to
577418a5822eSThomas Veerman      do something) (sometimes bfd_relax_section can do something even if
577518a5822eSThomas Veerman      this is not set).  */
577618a5822eSThomas Veerman #define BFD_IS_RELAXABLE 0x200
577718a5822eSThomas Veerman 
577818a5822eSThomas Veerman   /* This may be set before writing out a BFD to request using a
577918a5822eSThomas Veerman      traditional format.  For example, this is used to request that when
578018a5822eSThomas Veerman      writing out an a.out object the symbols not be hashed to eliminate
578118a5822eSThomas Veerman      duplicates.  */
578218a5822eSThomas Veerman #define BFD_TRADITIONAL_FORMAT 0x400
578318a5822eSThomas Veerman 
578418a5822eSThomas Veerman   /* This flag indicates that the BFD contents are actually cached
578518a5822eSThomas Veerman      in memory.  If this is set, iostream points to a bfd_in_memory
578618a5822eSThomas Veerman      struct.  */
578718a5822eSThomas Veerman #define BFD_IN_MEMORY 0x800
578818a5822eSThomas Veerman 
578918a5822eSThomas Veerman   /* The sections in this BFD specify a memory page.  */
579018a5822eSThomas Veerman #define HAS_LOAD_PAGE 0x1000
579118a5822eSThomas Veerman 
579218a5822eSThomas Veerman   /* This BFD has been created by the linker and doesn't correspond
579318a5822eSThomas Veerman      to any input file.  */
579418a5822eSThomas Veerman #define BFD_LINKER_CREATED 0x2000
579518a5822eSThomas Veerman   /* This may be set before writing out a BFD to request that it
579618a5822eSThomas Veerman   be written using values for UIDs, GIDs, timestamps, etc. that
579718a5822eSThomas Veerman   will be consistent from run to run.  */
579818a5822eSThomas Veerman #define BFD_DETERMINISTIC_OUTPUT 0x4000
579918a5822eSThomas Veerman 
580018a5822eSThomas Veerman 
580118a5822eSThomas Veerman   /* This may be set before writing out a BFD to request that it
580218a5822eSThomas Veerman      be written using values for UIDs, GIDs, timestamps, etc. that
580318a5822eSThomas Veerman      will be consistent from run to run.  */
580418a5822eSThomas Veerman #define BFD_DETERMINISTIC_OUTPUT 0x4000
580518a5822eSThomas Veerman 
580618a5822eSThomas Veerman   /* Compress sections in this BFD.  */
580718a5822eSThomas Veerman #define BFD_COMPRESS 0x8000
580818a5822eSThomas Veerman 
580918a5822eSThomas Veerman   /* Decompress sections in this BFD.  */
581018a5822eSThomas Veerman #define BFD_DECOMPRESS 0x10000
581118a5822eSThomas Veerman 
581218a5822eSThomas Veerman   /* BFD is a dummy, for plugins.  */
581318a5822eSThomas Veerman #define BFD_PLUGIN 0x20000
581418a5822eSThomas Veerman 
581518a5822eSThomas Veerman   /* Flags bits to be saved in bfd_preserve_save.  */
581618a5822eSThomas Veerman #define BFD_FLAGS_SAVED \
581718a5822eSThomas Veerman   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN)
581818a5822eSThomas Veerman 
581918a5822eSThomas Veerman   /* Flags bits which are for BFD use only.  */
582018a5822eSThomas Veerman #define BFD_FLAGS_FOR_BFD_USE_MASK \
582118a5822eSThomas Veerman   (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
582218a5822eSThomas Veerman    | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT)
582318a5822eSThomas Veerman 
582418a5822eSThomas Veerman   /* Currently my_archive is tested before adding origin to
582518a5822eSThomas Veerman      anything. I believe that this can become always an add of
582618a5822eSThomas Veerman      origin, with origin set to 0 for non archive files.  */
582718a5822eSThomas Veerman   ufile_ptr origin;
582818a5822eSThomas Veerman 
582918a5822eSThomas Veerman   /* The origin in the archive of the proxy entry.  This will
583018a5822eSThomas Veerman      normally be the same as origin, except for thin archives,
583118a5822eSThomas Veerman      when it will contain the current offset of the proxy in the
583218a5822eSThomas Veerman      thin archive rather than the offset of the bfd in its actual
583318a5822eSThomas Veerman      container.  */
583418a5822eSThomas Veerman   ufile_ptr proxy_origin;
583518a5822eSThomas Veerman 
583618a5822eSThomas Veerman   /* A hash table for section names.  */
583718a5822eSThomas Veerman   struct bfd_hash_table section_htab;
583818a5822eSThomas Veerman 
583918a5822eSThomas Veerman   /* Pointer to linked list of sections.  */
584018a5822eSThomas Veerman   struct bfd_section *sections;
584118a5822eSThomas Veerman 
584218a5822eSThomas Veerman   /* The last section on the section list.  */
584318a5822eSThomas Veerman   struct bfd_section *section_last;
584418a5822eSThomas Veerman 
584518a5822eSThomas Veerman   /* The number of sections.  */
584618a5822eSThomas Veerman   unsigned int section_count;
584718a5822eSThomas Veerman 
584818a5822eSThomas Veerman   /* Stuff only useful for object files:
584918a5822eSThomas Veerman      The start address.  */
585018a5822eSThomas Veerman   bfd_vma start_address;
585118a5822eSThomas Veerman 
585218a5822eSThomas Veerman   /* Used for input and output.  */
585318a5822eSThomas Veerman   unsigned int symcount;
585418a5822eSThomas Veerman 
585518a5822eSThomas Veerman   /* Symbol table for output BFD (with symcount entries).
585618a5822eSThomas Veerman      Also used by the linker to cache input BFD symbols.  */
585718a5822eSThomas Veerman   struct bfd_symbol  **outsymbols;
585818a5822eSThomas Veerman 
585918a5822eSThomas Veerman   /* Used for slurped dynamic symbol tables.  */
586018a5822eSThomas Veerman   unsigned int dynsymcount;
586118a5822eSThomas Veerman 
586218a5822eSThomas Veerman   /* Pointer to structure which contains architecture information.  */
586318a5822eSThomas Veerman   const struct bfd_arch_info *arch_info;
586418a5822eSThomas Veerman 
586518a5822eSThomas Veerman   /* Stuff only useful for archives.  */
586618a5822eSThomas Veerman   void *arelt_data;
586718a5822eSThomas Veerman   struct bfd *my_archive;      /* The containing archive BFD.  */
586818a5822eSThomas Veerman   struct bfd *archive_next;    /* The next BFD in the archive.  */
586918a5822eSThomas Veerman   struct bfd *archive_head;    /* The first BFD in the archive.  */
587018a5822eSThomas Veerman   struct bfd *nested_archives; /* List of nested archive in a flattened
587118a5822eSThomas Veerman                                   thin archive.  */
587218a5822eSThomas Veerman 
587318a5822eSThomas Veerman   /* A chain of BFD structures involved in a link.  */
587418a5822eSThomas Veerman   struct bfd *link_next;
587518a5822eSThomas Veerman 
587618a5822eSThomas Veerman   /* A field used by _bfd_generic_link_add_archive_symbols.  This will
587718a5822eSThomas Veerman      be used only for archive elements.  */
587818a5822eSThomas Veerman   int archive_pass;
587918a5822eSThomas Veerman 
588018a5822eSThomas Veerman   /* Used by the back end to hold private data.  */
588118a5822eSThomas Veerman   union
588218a5822eSThomas Veerman     {
588318a5822eSThomas Veerman       struct aout_data_struct *aout_data;
588418a5822eSThomas Veerman       struct artdata *aout_ar_data;
588518a5822eSThomas Veerman       struct _oasys_data *oasys_obj_data;
588618a5822eSThomas Veerman       struct _oasys_ar_data *oasys_ar_data;
588718a5822eSThomas Veerman       struct coff_tdata *coff_obj_data;
588818a5822eSThomas Veerman       struct pe_tdata *pe_obj_data;
588918a5822eSThomas Veerman       struct xcoff_tdata *xcoff_obj_data;
589018a5822eSThomas Veerman       struct ecoff_tdata *ecoff_obj_data;
589118a5822eSThomas Veerman       struct ieee_data_struct *ieee_data;
589218a5822eSThomas Veerman       struct ieee_ar_data_struct *ieee_ar_data;
589318a5822eSThomas Veerman       struct srec_data_struct *srec_data;
589418a5822eSThomas Veerman       struct verilog_data_struct *verilog_data;
589518a5822eSThomas Veerman       struct ihex_data_struct *ihex_data;
589618a5822eSThomas Veerman       struct tekhex_data_struct *tekhex_data;
589718a5822eSThomas Veerman       struct elf_obj_tdata *elf_obj_data;
589818a5822eSThomas Veerman       struct nlm_obj_tdata *nlm_obj_data;
589918a5822eSThomas Veerman       struct bout_data_struct *bout_data;
590018a5822eSThomas Veerman       struct mmo_data_struct *mmo_data;
590118a5822eSThomas Veerman       struct sun_core_struct *sun_core_data;
590218a5822eSThomas Veerman       struct sco5_core_struct *sco5_core_data;
590318a5822eSThomas Veerman       struct trad_core_struct *trad_core_data;
590418a5822eSThomas Veerman       struct som_data_struct *som_data;
590518a5822eSThomas Veerman       struct hpux_core_struct *hpux_core_data;
590618a5822eSThomas Veerman       struct hppabsd_core_struct *hppabsd_core_data;
590718a5822eSThomas Veerman       struct sgi_core_struct *sgi_core_data;
590818a5822eSThomas Veerman       struct lynx_core_struct *lynx_core_data;
590918a5822eSThomas Veerman       struct osf_core_struct *osf_core_data;
591018a5822eSThomas Veerman       struct cisco_core_struct *cisco_core_data;
591118a5822eSThomas Veerman       struct versados_data_struct *versados_data;
591218a5822eSThomas Veerman       struct netbsd_core_struct *netbsd_core_data;
591318a5822eSThomas Veerman       struct mach_o_data_struct *mach_o_data;
591418a5822eSThomas Veerman       struct mach_o_fat_data_struct *mach_o_fat_data;
591518a5822eSThomas Veerman       struct plugin_data_struct *plugin_data;
591618a5822eSThomas Veerman       struct bfd_pef_data_struct *pef_data;
591718a5822eSThomas Veerman       struct bfd_pef_xlib_data_struct *pef_xlib_data;
591818a5822eSThomas Veerman       struct bfd_sym_data_struct *sym_data;
591918a5822eSThomas Veerman       void *any;
592018a5822eSThomas Veerman     }
592118a5822eSThomas Veerman   tdata;
592218a5822eSThomas Veerman 
592318a5822eSThomas Veerman   /* Used by the application to hold private data.  */
592418a5822eSThomas Veerman   void *usrdata;
592518a5822eSThomas Veerman 
592618a5822eSThomas Veerman   /* Where all the allocated stuff under this BFD goes.  This is a
592718a5822eSThomas Veerman      struct objalloc *, but we use void * to avoid requiring the inclusion
592818a5822eSThomas Veerman      of objalloc.h.  */
592918a5822eSThomas Veerman   void *memory;
593018a5822eSThomas Veerman 
593118a5822eSThomas Veerman   /* Is the file descriptor being cached?  That is, can it be closed as
593218a5822eSThomas Veerman      needed, and re-opened when accessed later?  */
593318a5822eSThomas Veerman   unsigned int cacheable : 1;
593418a5822eSThomas Veerman 
593518a5822eSThomas Veerman   /* Marks whether there was a default target specified when the
593618a5822eSThomas Veerman      BFD was opened. This is used to select which matching algorithm
593718a5822eSThomas Veerman      to use to choose the back end.  */
593818a5822eSThomas Veerman   unsigned int target_defaulted : 1;
593918a5822eSThomas Veerman 
594018a5822eSThomas Veerman   /* ... and here: (``once'' means at least once).  */
594118a5822eSThomas Veerman   unsigned int opened_once : 1;
594218a5822eSThomas Veerman 
594318a5822eSThomas Veerman   /* Set if we have a locally maintained mtime value, rather than
594418a5822eSThomas Veerman      getting it from the file each time.  */
594518a5822eSThomas Veerman   unsigned int mtime_set : 1;
594618a5822eSThomas Veerman 
594718a5822eSThomas Veerman   /* Flag set if symbols from this BFD should not be exported.  */
594818a5822eSThomas Veerman   unsigned int no_export : 1;
594918a5822eSThomas Veerman 
595018a5822eSThomas Veerman   /* Remember when output has begun, to stop strange things
595118a5822eSThomas Veerman      from happening.  */
595218a5822eSThomas Veerman   unsigned int output_has_begun : 1;
595318a5822eSThomas Veerman 
595418a5822eSThomas Veerman   /* Have archive map.  */
595518a5822eSThomas Veerman   unsigned int has_armap : 1;
595618a5822eSThomas Veerman 
595718a5822eSThomas Veerman   /* Set if this is a thin archive.  */
595818a5822eSThomas Veerman   unsigned int is_thin_archive : 1;
595918a5822eSThomas Veerman 
596018a5822eSThomas Veerman   /* Set if only required symbols should be added in the link hash table for
596118a5822eSThomas Veerman      this object.  Used by VMS linkers.  */
596218a5822eSThomas Veerman   unsigned int selective_search : 1;
596318a5822eSThomas Veerman };
596418a5822eSThomas Veerman 
596518a5822eSThomas Veerman typedef enum bfd_error
596618a5822eSThomas Veerman {
596718a5822eSThomas Veerman   bfd_error_no_error = 0,
596818a5822eSThomas Veerman   bfd_error_system_call,
596918a5822eSThomas Veerman   bfd_error_invalid_target,
597018a5822eSThomas Veerman   bfd_error_wrong_format,
597118a5822eSThomas Veerman   bfd_error_wrong_object_format,
597218a5822eSThomas Veerman   bfd_error_invalid_operation,
597318a5822eSThomas Veerman   bfd_error_no_memory,
597418a5822eSThomas Veerman   bfd_error_no_symbols,
597518a5822eSThomas Veerman   bfd_error_no_armap,
597618a5822eSThomas Veerman   bfd_error_no_more_archived_files,
597718a5822eSThomas Veerman   bfd_error_malformed_archive,
597818a5822eSThomas Veerman   bfd_error_file_not_recognized,
597918a5822eSThomas Veerman   bfd_error_file_ambiguously_recognized,
598018a5822eSThomas Veerman   bfd_error_no_contents,
598118a5822eSThomas Veerman   bfd_error_nonrepresentable_section,
598218a5822eSThomas Veerman   bfd_error_no_debug_section,
598318a5822eSThomas Veerman   bfd_error_bad_value,
598418a5822eSThomas Veerman   bfd_error_file_truncated,
598518a5822eSThomas Veerman   bfd_error_file_too_big,
598618a5822eSThomas Veerman   bfd_error_on_input,
598718a5822eSThomas Veerman   bfd_error_invalid_error_code
598818a5822eSThomas Veerman }
598918a5822eSThomas Veerman bfd_error_type;
599018a5822eSThomas Veerman 
599118a5822eSThomas Veerman bfd_error_type bfd_get_error (void);
599218a5822eSThomas Veerman 
599318a5822eSThomas Veerman void bfd_set_error (bfd_error_type error_tag, ...);
599418a5822eSThomas Veerman 
599518a5822eSThomas Veerman const char *bfd_errmsg (bfd_error_type error_tag);
599618a5822eSThomas Veerman 
599718a5822eSThomas Veerman void bfd_perror (const char *message);
599818a5822eSThomas Veerman 
599918a5822eSThomas Veerman typedef void (*bfd_error_handler_type) (const char *, ...);
600018a5822eSThomas Veerman 
600118a5822eSThomas Veerman bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
600218a5822eSThomas Veerman 
600318a5822eSThomas Veerman void bfd_set_error_program_name (const char *);
600418a5822eSThomas Veerman 
600518a5822eSThomas Veerman bfd_error_handler_type bfd_get_error_handler (void);
600618a5822eSThomas Veerman 
6007*c9ea9e7aSLionel Sambuc typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
6008*c9ea9e7aSLionel Sambuc                                          const char *bfd_version,
6009*c9ea9e7aSLionel Sambuc                                          const char *bfd_file,
6010*c9ea9e7aSLionel Sambuc                                          int bfd_line);
6011*c9ea9e7aSLionel Sambuc 
6012*c9ea9e7aSLionel Sambuc bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type);
6013*c9ea9e7aSLionel Sambuc 
6014*c9ea9e7aSLionel Sambuc bfd_assert_handler_type bfd_get_assert_handler (void);
6015*c9ea9e7aSLionel Sambuc 
601618a5822eSThomas Veerman long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
601718a5822eSThomas Veerman 
601818a5822eSThomas Veerman long bfd_canonicalize_reloc
601918a5822eSThomas Veerman    (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
602018a5822eSThomas Veerman 
602118a5822eSThomas Veerman void bfd_set_reloc
602218a5822eSThomas Veerman    (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
602318a5822eSThomas Veerman 
602418a5822eSThomas Veerman bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
602518a5822eSThomas Veerman 
602618a5822eSThomas Veerman int bfd_get_arch_size (bfd *abfd);
602718a5822eSThomas Veerman 
602818a5822eSThomas Veerman int bfd_get_sign_extend_vma (bfd *abfd);
602918a5822eSThomas Veerman 
603018a5822eSThomas Veerman bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
603118a5822eSThomas Veerman 
603218a5822eSThomas Veerman unsigned int bfd_get_gp_size (bfd *abfd);
603318a5822eSThomas Veerman 
603418a5822eSThomas Veerman void bfd_set_gp_size (bfd *abfd, unsigned int i);
603518a5822eSThomas Veerman 
603618a5822eSThomas Veerman bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
603718a5822eSThomas Veerman 
603818a5822eSThomas Veerman bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
603918a5822eSThomas Veerman 
604018a5822eSThomas Veerman #define bfd_copy_private_header_data(ibfd, obfd) \
604118a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_copy_private_header_data, \
604218a5822eSThomas Veerman                (ibfd, obfd))
604318a5822eSThomas Veerman bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
604418a5822eSThomas Veerman 
604518a5822eSThomas Veerman #define bfd_copy_private_bfd_data(ibfd, obfd) \
604618a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
604718a5822eSThomas Veerman                (ibfd, obfd))
604818a5822eSThomas Veerman bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
604918a5822eSThomas Veerman 
605018a5822eSThomas Veerman #define bfd_merge_private_bfd_data(ibfd, obfd) \
605118a5822eSThomas Veerman      BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
605218a5822eSThomas Veerman                (ibfd, obfd))
605318a5822eSThomas Veerman bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
605418a5822eSThomas Veerman 
605518a5822eSThomas Veerman #define bfd_set_private_flags(abfd, flags) \
605618a5822eSThomas Veerman      BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
605718a5822eSThomas Veerman #define bfd_sizeof_headers(abfd, info) \
605818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
605918a5822eSThomas Veerman 
606018a5822eSThomas Veerman #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
606118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_nearest_line, \
606218a5822eSThomas Veerman                  (abfd, sec, syms, off, file, func, line))
606318a5822eSThomas Veerman 
6064*c9ea9e7aSLionel Sambuc #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
6065*c9ea9e7aSLionel Sambuc                                             line, disc) \
6066*c9ea9e7aSLionel Sambuc        BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \
6067*c9ea9e7aSLionel Sambuc                  (abfd, sec, syms, off, file, func, line, disc))
6068*c9ea9e7aSLionel Sambuc 
606918a5822eSThomas Veerman #define bfd_find_line(abfd, syms, sym, file, line) \
607018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_line, \
607118a5822eSThomas Veerman                  (abfd, syms, sym, file, line))
607218a5822eSThomas Veerman 
607318a5822eSThomas Veerman #define bfd_find_inliner_info(abfd, file, func, line) \
607418a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_find_inliner_info, \
607518a5822eSThomas Veerman                  (abfd, file, func, line))
607618a5822eSThomas Veerman 
607718a5822eSThomas Veerman #define bfd_debug_info_start(abfd) \
607818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
607918a5822eSThomas Veerman 
608018a5822eSThomas Veerman #define bfd_debug_info_end(abfd) \
608118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
608218a5822eSThomas Veerman 
608318a5822eSThomas Veerman #define bfd_debug_info_accumulate(abfd, section) \
608418a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
608518a5822eSThomas Veerman 
608618a5822eSThomas Veerman #define bfd_stat_arch_elt(abfd, stat) \
608718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
608818a5822eSThomas Veerman 
608918a5822eSThomas Veerman #define bfd_update_armap_timestamp(abfd) \
609018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
609118a5822eSThomas Veerman 
609218a5822eSThomas Veerman #define bfd_set_arch_mach(abfd, arch, mach)\
609318a5822eSThomas Veerman        BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
609418a5822eSThomas Veerman 
609518a5822eSThomas Veerman #define bfd_relax_section(abfd, section, link_info, again) \
609618a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
609718a5822eSThomas Veerman 
609818a5822eSThomas Veerman #define bfd_gc_sections(abfd, link_info) \
609918a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
610018a5822eSThomas Veerman 
6101*c9ea9e7aSLionel Sambuc #define bfd_lookup_section_flags(link_info, flag_info, section) \
6102*c9ea9e7aSLionel Sambuc        BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section))
6103*c9ea9e7aSLionel Sambuc 
610418a5822eSThomas Veerman #define bfd_merge_sections(abfd, link_info) \
610518a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
610618a5822eSThomas Veerman 
610718a5822eSThomas Veerman #define bfd_is_group_section(abfd, sec) \
610818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
610918a5822eSThomas Veerman 
611018a5822eSThomas Veerman #define bfd_discard_group(abfd, sec) \
611118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
611218a5822eSThomas Veerman 
611318a5822eSThomas Veerman #define bfd_link_hash_table_create(abfd) \
611418a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
611518a5822eSThomas Veerman 
611618a5822eSThomas Veerman #define bfd_link_hash_table_free(abfd, hash) \
611718a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
611818a5822eSThomas Veerman 
611918a5822eSThomas Veerman #define bfd_link_add_symbols(abfd, info) \
612018a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
612118a5822eSThomas Veerman 
612218a5822eSThomas Veerman #define bfd_link_just_syms(abfd, sec, info) \
612318a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
612418a5822eSThomas Veerman 
612518a5822eSThomas Veerman #define bfd_final_link(abfd, info) \
612618a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_final_link, (abfd, info))
612718a5822eSThomas Veerman 
612818a5822eSThomas Veerman #define bfd_free_cached_info(abfd) \
612918a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
613018a5822eSThomas Veerman 
613118a5822eSThomas Veerman #define bfd_get_dynamic_symtab_upper_bound(abfd) \
613218a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
613318a5822eSThomas Veerman 
613418a5822eSThomas Veerman #define bfd_print_private_bfd_data(abfd, file)\
613518a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
613618a5822eSThomas Veerman 
613718a5822eSThomas Veerman #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
613818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
613918a5822eSThomas Veerman 
614018a5822eSThomas Veerman #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
614118a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
614218a5822eSThomas Veerman                                                    dyncount, dynsyms, ret))
614318a5822eSThomas Veerman 
614418a5822eSThomas Veerman #define bfd_get_dynamic_reloc_upper_bound(abfd) \
614518a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
614618a5822eSThomas Veerman 
614718a5822eSThomas Veerman #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
614818a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
614918a5822eSThomas Veerman 
615018a5822eSThomas Veerman extern bfd_byte *bfd_get_relocated_section_contents
615118a5822eSThomas Veerman   (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
615218a5822eSThomas Veerman    bfd_boolean, asymbol **);
615318a5822eSThomas Veerman 
615418a5822eSThomas Veerman bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
615518a5822eSThomas Veerman 
615618a5822eSThomas Veerman struct bfd_preserve
615718a5822eSThomas Veerman {
615818a5822eSThomas Veerman   void *marker;
615918a5822eSThomas Veerman   void *tdata;
616018a5822eSThomas Veerman   flagword flags;
616118a5822eSThomas Veerman   const struct bfd_arch_info *arch_info;
616218a5822eSThomas Veerman   struct bfd_section *sections;
616318a5822eSThomas Veerman   struct bfd_section *section_last;
616418a5822eSThomas Veerman   unsigned int section_count;
616518a5822eSThomas Veerman   struct bfd_hash_table section_htab;
616618a5822eSThomas Veerman };
616718a5822eSThomas Veerman 
616818a5822eSThomas Veerman bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
616918a5822eSThomas Veerman 
617018a5822eSThomas Veerman void bfd_preserve_restore (bfd *, struct bfd_preserve *);
617118a5822eSThomas Veerman 
617218a5822eSThomas Veerman void bfd_preserve_finish (bfd *, struct bfd_preserve *);
617318a5822eSThomas Veerman 
617418a5822eSThomas Veerman bfd_vma bfd_emul_get_maxpagesize (const char *);
617518a5822eSThomas Veerman 
617618a5822eSThomas Veerman void bfd_emul_set_maxpagesize (const char *, bfd_vma);
617718a5822eSThomas Veerman 
617818a5822eSThomas Veerman bfd_vma bfd_emul_get_commonpagesize (const char *);
617918a5822eSThomas Veerman 
618018a5822eSThomas Veerman void bfd_emul_set_commonpagesize (const char *, bfd_vma);
618118a5822eSThomas Veerman 
618218a5822eSThomas Veerman char *bfd_demangle (bfd *, const char *, int);
618318a5822eSThomas Veerman 
618418a5822eSThomas Veerman /* Extracted from archive.c.  */
618518a5822eSThomas Veerman symindex bfd_get_next_mapent
618618a5822eSThomas Veerman    (bfd *abfd, symindex previous, carsym **sym);
618718a5822eSThomas Veerman 
618818a5822eSThomas Veerman bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
618918a5822eSThomas Veerman 
619018a5822eSThomas Veerman bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
619118a5822eSThomas Veerman 
619218a5822eSThomas Veerman /* Extracted from corefile.c.  */
619318a5822eSThomas Veerman const char *bfd_core_file_failing_command (bfd *abfd);
619418a5822eSThomas Veerman 
619518a5822eSThomas Veerman int bfd_core_file_failing_signal (bfd *abfd);
619618a5822eSThomas Veerman 
619718a5822eSThomas Veerman int bfd_core_file_pid (bfd *abfd);
619818a5822eSThomas Veerman 
619918a5822eSThomas Veerman bfd_boolean core_file_matches_executable_p
620018a5822eSThomas Veerman    (bfd *core_bfd, bfd *exec_bfd);
620118a5822eSThomas Veerman 
620218a5822eSThomas Veerman bfd_boolean generic_core_file_matches_executable_p
620318a5822eSThomas Veerman    (bfd *core_bfd, bfd *exec_bfd);
620418a5822eSThomas Veerman 
620518a5822eSThomas Veerman /* Extracted from targets.c.  */
620618a5822eSThomas Veerman #define BFD_SEND(bfd, message, arglist) \
620718a5822eSThomas Veerman   ((*((bfd)->xvec->message)) arglist)
620818a5822eSThomas Veerman 
620918a5822eSThomas Veerman #ifdef DEBUG_BFD_SEND
621018a5822eSThomas Veerman #undef BFD_SEND
621118a5822eSThomas Veerman #define BFD_SEND(bfd, message, arglist) \
621218a5822eSThomas Veerman   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
621318a5822eSThomas Veerman     ((*((bfd)->xvec->message)) arglist) : \
621418a5822eSThomas Veerman     (bfd_assert (__FILE__,__LINE__), NULL))
621518a5822eSThomas Veerman #endif
621618a5822eSThomas Veerman #define BFD_SEND_FMT(bfd, message, arglist) \
621718a5822eSThomas Veerman   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
621818a5822eSThomas Veerman 
621918a5822eSThomas Veerman #ifdef DEBUG_BFD_SEND
622018a5822eSThomas Veerman #undef BFD_SEND_FMT
622118a5822eSThomas Veerman #define BFD_SEND_FMT(bfd, message, arglist) \
622218a5822eSThomas Veerman   (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
622318a5822eSThomas Veerman    (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
622418a5822eSThomas Veerman    (bfd_assert (__FILE__,__LINE__), NULL))
622518a5822eSThomas Veerman #endif
622618a5822eSThomas Veerman 
622718a5822eSThomas Veerman enum bfd_flavour
622818a5822eSThomas Veerman {
622918a5822eSThomas Veerman   bfd_target_unknown_flavour,
623018a5822eSThomas Veerman   bfd_target_aout_flavour,
623118a5822eSThomas Veerman   bfd_target_coff_flavour,
623218a5822eSThomas Veerman   bfd_target_ecoff_flavour,
623318a5822eSThomas Veerman   bfd_target_xcoff_flavour,
623418a5822eSThomas Veerman   bfd_target_elf_flavour,
623518a5822eSThomas Veerman   bfd_target_ieee_flavour,
623618a5822eSThomas Veerman   bfd_target_nlm_flavour,
623718a5822eSThomas Veerman   bfd_target_oasys_flavour,
623818a5822eSThomas Veerman   bfd_target_tekhex_flavour,
623918a5822eSThomas Veerman   bfd_target_srec_flavour,
624018a5822eSThomas Veerman   bfd_target_verilog_flavour,
624118a5822eSThomas Veerman   bfd_target_ihex_flavour,
624218a5822eSThomas Veerman   bfd_target_som_flavour,
624318a5822eSThomas Veerman   bfd_target_os9k_flavour,
624418a5822eSThomas Veerman   bfd_target_versados_flavour,
624518a5822eSThomas Veerman   bfd_target_msdos_flavour,
624618a5822eSThomas Veerman   bfd_target_ovax_flavour,
624718a5822eSThomas Veerman   bfd_target_evax_flavour,
624818a5822eSThomas Veerman   bfd_target_mmo_flavour,
624918a5822eSThomas Veerman   bfd_target_mach_o_flavour,
625018a5822eSThomas Veerman   bfd_target_pef_flavour,
625118a5822eSThomas Veerman   bfd_target_pef_xlib_flavour,
625218a5822eSThomas Veerman   bfd_target_sym_flavour
625318a5822eSThomas Veerman };
625418a5822eSThomas Veerman 
625518a5822eSThomas Veerman enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
625618a5822eSThomas Veerman 
625718a5822eSThomas Veerman /* Forward declaration.  */
625818a5822eSThomas Veerman typedef struct bfd_link_info _bfd_link_info;
625918a5822eSThomas Veerman 
6260*c9ea9e7aSLionel Sambuc /* Forward declaration.  */
6261*c9ea9e7aSLionel Sambuc typedef struct flag_info flag_info;
6262*c9ea9e7aSLionel Sambuc 
626318a5822eSThomas Veerman typedef struct bfd_target
626418a5822eSThomas Veerman {
626518a5822eSThomas Veerman   /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
626618a5822eSThomas Veerman   char *name;
626718a5822eSThomas Veerman 
626818a5822eSThomas Veerman  /* The "flavour" of a back end is a general indication about
626918a5822eSThomas Veerman     the contents of a file.  */
627018a5822eSThomas Veerman   enum bfd_flavour flavour;
627118a5822eSThomas Veerman 
627218a5822eSThomas Veerman   /* The order of bytes within the data area of a file.  */
627318a5822eSThomas Veerman   enum bfd_endian byteorder;
627418a5822eSThomas Veerman 
627518a5822eSThomas Veerman  /* The order of bytes within the header parts of a file.  */
627618a5822eSThomas Veerman   enum bfd_endian header_byteorder;
627718a5822eSThomas Veerman 
627818a5822eSThomas Veerman   /* A mask of all the flags which an executable may have set -
627918a5822eSThomas Veerman      from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
628018a5822eSThomas Veerman   flagword object_flags;
628118a5822eSThomas Veerman 
628218a5822eSThomas Veerman  /* A mask of all the flags which a section may have set - from
628318a5822eSThomas Veerman     the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
628418a5822eSThomas Veerman   flagword section_flags;
628518a5822eSThomas Veerman 
628618a5822eSThomas Veerman  /* The character normally found at the front of a symbol.
628718a5822eSThomas Veerman     (if any), perhaps `_'.  */
628818a5822eSThomas Veerman   char symbol_leading_char;
628918a5822eSThomas Veerman 
629018a5822eSThomas Veerman  /* The pad character for file names within an archive header.  */
629118a5822eSThomas Veerman   char ar_pad_char;
629218a5822eSThomas Veerman 
629318a5822eSThomas Veerman   /* The maximum number of characters in an archive header.  */
6294*c9ea9e7aSLionel Sambuc   unsigned char ar_max_namelen;
6295*c9ea9e7aSLionel Sambuc 
6296*c9ea9e7aSLionel Sambuc   /* How well this target matches, used to select between various
6297*c9ea9e7aSLionel Sambuc      possible targets when more than one target matches.  */
6298*c9ea9e7aSLionel Sambuc   unsigned char match_priority;
629918a5822eSThomas Veerman 
630018a5822eSThomas Veerman   /* Entries for byte swapping for data. These are different from the
630118a5822eSThomas Veerman      other entry points, since they don't take a BFD as the first argument.
630218a5822eSThomas Veerman      Certain other handlers could do the same.  */
630318a5822eSThomas Veerman   bfd_uint64_t   (*bfd_getx64) (const void *);
630418a5822eSThomas Veerman   bfd_int64_t    (*bfd_getx_signed_64) (const void *);
630518a5822eSThomas Veerman   void           (*bfd_putx64) (bfd_uint64_t, void *);
630618a5822eSThomas Veerman   bfd_vma        (*bfd_getx32) (const void *);
630718a5822eSThomas Veerman   bfd_signed_vma (*bfd_getx_signed_32) (const void *);
630818a5822eSThomas Veerman   void           (*bfd_putx32) (bfd_vma, void *);
630918a5822eSThomas Veerman   bfd_vma        (*bfd_getx16) (const void *);
631018a5822eSThomas Veerman   bfd_signed_vma (*bfd_getx_signed_16) (const void *);
631118a5822eSThomas Veerman   void           (*bfd_putx16) (bfd_vma, void *);
631218a5822eSThomas Veerman 
631318a5822eSThomas Veerman   /* Byte swapping for the headers.  */
631418a5822eSThomas Veerman   bfd_uint64_t   (*bfd_h_getx64) (const void *);
631518a5822eSThomas Veerman   bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
631618a5822eSThomas Veerman   void           (*bfd_h_putx64) (bfd_uint64_t, void *);
631718a5822eSThomas Veerman   bfd_vma        (*bfd_h_getx32) (const void *);
631818a5822eSThomas Veerman   bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
631918a5822eSThomas Veerman   void           (*bfd_h_putx32) (bfd_vma, void *);
632018a5822eSThomas Veerman   bfd_vma        (*bfd_h_getx16) (const void *);
632118a5822eSThomas Veerman   bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
632218a5822eSThomas Veerman   void           (*bfd_h_putx16) (bfd_vma, void *);
632318a5822eSThomas Veerman 
632418a5822eSThomas Veerman   /* Format dependent routines: these are vectors of entry points
632518a5822eSThomas Veerman      within the target vector structure, one for each format to check.  */
632618a5822eSThomas Veerman 
632718a5822eSThomas Veerman   /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
632818a5822eSThomas Veerman   const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
632918a5822eSThomas Veerman 
633018a5822eSThomas Veerman   /* Set the format of a file being written.  */
633118a5822eSThomas Veerman   bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
633218a5822eSThomas Veerman 
633318a5822eSThomas Veerman   /* Write cached information into a file being written, at <<bfd_close>>.  */
633418a5822eSThomas Veerman   bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
633518a5822eSThomas Veerman 
633618a5822eSThomas Veerman 
633718a5822eSThomas Veerman   /* Generic entry points.  */
633818a5822eSThomas Veerman #define BFD_JUMP_TABLE_GENERIC(NAME) \
633918a5822eSThomas Veerman   NAME##_close_and_cleanup, \
634018a5822eSThomas Veerman   NAME##_bfd_free_cached_info, \
634118a5822eSThomas Veerman   NAME##_new_section_hook, \
634218a5822eSThomas Veerman   NAME##_get_section_contents, \
634318a5822eSThomas Veerman   NAME##_get_section_contents_in_window
634418a5822eSThomas Veerman 
634518a5822eSThomas Veerman   /* Called when the BFD is being closed to do any necessary cleanup.  */
634618a5822eSThomas Veerman   bfd_boolean (*_close_and_cleanup) (bfd *);
634718a5822eSThomas Veerman   /* Ask the BFD to free all cached information.  */
634818a5822eSThomas Veerman   bfd_boolean (*_bfd_free_cached_info) (bfd *);
634918a5822eSThomas Veerman   /* Called when a new section is created.  */
635018a5822eSThomas Veerman   bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
635118a5822eSThomas Veerman   /* Read the contents of a section.  */
635218a5822eSThomas Veerman   bfd_boolean (*_bfd_get_section_contents)
635318a5822eSThomas Veerman     (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
635418a5822eSThomas Veerman   bfd_boolean (*_bfd_get_section_contents_in_window)
635518a5822eSThomas Veerman     (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
635618a5822eSThomas Veerman 
635718a5822eSThomas Veerman   /* Entry points to copy private data.  */
635818a5822eSThomas Veerman #define BFD_JUMP_TABLE_COPY(NAME) \
635918a5822eSThomas Veerman   NAME##_bfd_copy_private_bfd_data, \
636018a5822eSThomas Veerman   NAME##_bfd_merge_private_bfd_data, \
636118a5822eSThomas Veerman   _bfd_generic_init_private_section_data, \
636218a5822eSThomas Veerman   NAME##_bfd_copy_private_section_data, \
636318a5822eSThomas Veerman   NAME##_bfd_copy_private_symbol_data, \
636418a5822eSThomas Veerman   NAME##_bfd_copy_private_header_data, \
636518a5822eSThomas Veerman   NAME##_bfd_set_private_flags, \
636618a5822eSThomas Veerman   NAME##_bfd_print_private_bfd_data
636718a5822eSThomas Veerman 
636818a5822eSThomas Veerman   /* Called to copy BFD general private data from one object file
636918a5822eSThomas Veerman      to another.  */
637018a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
637118a5822eSThomas Veerman   /* Called to merge BFD general private data from one object file
637218a5822eSThomas Veerman      to a common output file when linking.  */
637318a5822eSThomas Veerman   bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
637418a5822eSThomas Veerman   /* Called to initialize BFD private section data from one object file
637518a5822eSThomas Veerman      to another.  */
637618a5822eSThomas Veerman #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
637718a5822eSThomas Veerman   BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
637818a5822eSThomas Veerman   bfd_boolean (*_bfd_init_private_section_data)
637918a5822eSThomas Veerman     (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
638018a5822eSThomas Veerman   /* Called to copy BFD private section data from one object file
638118a5822eSThomas Veerman      to another.  */
638218a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_section_data)
638318a5822eSThomas Veerman     (bfd *, sec_ptr, bfd *, sec_ptr);
638418a5822eSThomas Veerman   /* Called to copy BFD private symbol data from one symbol
638518a5822eSThomas Veerman      to another.  */
638618a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_symbol_data)
638718a5822eSThomas Veerman     (bfd *, asymbol *, bfd *, asymbol *);
638818a5822eSThomas Veerman   /* Called to copy BFD private header data from one object file
638918a5822eSThomas Veerman      to another.  */
639018a5822eSThomas Veerman   bfd_boolean (*_bfd_copy_private_header_data)
639118a5822eSThomas Veerman     (bfd *, bfd *);
639218a5822eSThomas Veerman   /* Called to set private backend flags.  */
639318a5822eSThomas Veerman   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
639418a5822eSThomas Veerman 
639518a5822eSThomas Veerman   /* Called to print private BFD data.  */
639618a5822eSThomas Veerman   bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
639718a5822eSThomas Veerman 
639818a5822eSThomas Veerman   /* Core file entry points.  */
639918a5822eSThomas Veerman #define BFD_JUMP_TABLE_CORE(NAME) \
640018a5822eSThomas Veerman   NAME##_core_file_failing_command, \
640118a5822eSThomas Veerman   NAME##_core_file_failing_signal, \
640218a5822eSThomas Veerman   NAME##_core_file_matches_executable_p, \
640318a5822eSThomas Veerman   NAME##_core_file_pid
640418a5822eSThomas Veerman 
640518a5822eSThomas Veerman   char *      (*_core_file_failing_command) (bfd *);
640618a5822eSThomas Veerman   int         (*_core_file_failing_signal) (bfd *);
640718a5822eSThomas Veerman   bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
640818a5822eSThomas Veerman   int         (*_core_file_pid) (bfd *);
640918a5822eSThomas Veerman 
641018a5822eSThomas Veerman   /* Archive entry points.  */
641118a5822eSThomas Veerman #define BFD_JUMP_TABLE_ARCHIVE(NAME) \
641218a5822eSThomas Veerman   NAME##_slurp_armap, \
641318a5822eSThomas Veerman   NAME##_slurp_extended_name_table, \
641418a5822eSThomas Veerman   NAME##_construct_extended_name_table, \
641518a5822eSThomas Veerman   NAME##_truncate_arname, \
641618a5822eSThomas Veerman   NAME##_write_armap, \
641718a5822eSThomas Veerman   NAME##_read_ar_hdr, \
641818a5822eSThomas Veerman   NAME##_write_ar_hdr, \
641918a5822eSThomas Veerman   NAME##_openr_next_archived_file, \
642018a5822eSThomas Veerman   NAME##_get_elt_at_index, \
642118a5822eSThomas Veerman   NAME##_generic_stat_arch_elt, \
642218a5822eSThomas Veerman   NAME##_update_armap_timestamp
642318a5822eSThomas Veerman 
642418a5822eSThomas Veerman   bfd_boolean (*_bfd_slurp_armap) (bfd *);
642518a5822eSThomas Veerman   bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
642618a5822eSThomas Veerman   bfd_boolean (*_bfd_construct_extended_name_table)
642718a5822eSThomas Veerman     (bfd *, char **, bfd_size_type *, const char **);
642818a5822eSThomas Veerman   void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
642918a5822eSThomas Veerman   bfd_boolean (*write_armap)
643018a5822eSThomas Veerman     (bfd *, unsigned int, struct orl *, unsigned int, int);
643118a5822eSThomas Veerman   void *      (*_bfd_read_ar_hdr_fn) (bfd *);
643218a5822eSThomas Veerman   bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
643318a5822eSThomas Veerman   bfd *       (*openr_next_archived_file) (bfd *, bfd *);
643418a5822eSThomas Veerman #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
643518a5822eSThomas Veerman   bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
643618a5822eSThomas Veerman   int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
643718a5822eSThomas Veerman   bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
643818a5822eSThomas Veerman 
643918a5822eSThomas Veerman   /* Entry points used for symbols.  */
644018a5822eSThomas Veerman #define BFD_JUMP_TABLE_SYMBOLS(NAME) \
644118a5822eSThomas Veerman   NAME##_get_symtab_upper_bound, \
644218a5822eSThomas Veerman   NAME##_canonicalize_symtab, \
644318a5822eSThomas Veerman   NAME##_make_empty_symbol, \
644418a5822eSThomas Veerman   NAME##_print_symbol, \
644518a5822eSThomas Veerman   NAME##_get_symbol_info, \
644618a5822eSThomas Veerman   NAME##_bfd_is_local_label_name, \
644718a5822eSThomas Veerman   NAME##_bfd_is_target_special_symbol, \
644818a5822eSThomas Veerman   NAME##_get_lineno, \
644918a5822eSThomas Veerman   NAME##_find_nearest_line, \
6450*c9ea9e7aSLionel Sambuc   _bfd_generic_find_nearest_line_discriminator, \
645118a5822eSThomas Veerman   _bfd_generic_find_line, \
645218a5822eSThomas Veerman   NAME##_find_inliner_info, \
645318a5822eSThomas Veerman   NAME##_bfd_make_debug_symbol, \
645418a5822eSThomas Veerman   NAME##_read_minisymbols, \
645518a5822eSThomas Veerman   NAME##_minisymbol_to_symbol
645618a5822eSThomas Veerman 
645718a5822eSThomas Veerman   long        (*_bfd_get_symtab_upper_bound) (bfd *);
645818a5822eSThomas Veerman   long        (*_bfd_canonicalize_symtab)
645918a5822eSThomas Veerman     (bfd *, struct bfd_symbol **);
646018a5822eSThomas Veerman   struct bfd_symbol *
646118a5822eSThomas Veerman               (*_bfd_make_empty_symbol) (bfd *);
646218a5822eSThomas Veerman   void        (*_bfd_print_symbol)
646318a5822eSThomas Veerman     (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
646418a5822eSThomas Veerman #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
646518a5822eSThomas Veerman   void        (*_bfd_get_symbol_info)
646618a5822eSThomas Veerman     (bfd *, struct bfd_symbol *, symbol_info *);
646718a5822eSThomas Veerman #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
646818a5822eSThomas Veerman   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
646918a5822eSThomas Veerman   bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
647018a5822eSThomas Veerman   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
647118a5822eSThomas Veerman   bfd_boolean (*_bfd_find_nearest_line)
647218a5822eSThomas Veerman     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
647318a5822eSThomas Veerman      const char **, const char **, unsigned int *);
6474*c9ea9e7aSLionel Sambuc   bfd_boolean (*_bfd_find_nearest_line_discriminator)
6475*c9ea9e7aSLionel Sambuc     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
6476*c9ea9e7aSLionel Sambuc      const char **, const char **, unsigned int *, unsigned int *);
647718a5822eSThomas Veerman   bfd_boolean (*_bfd_find_line)
647818a5822eSThomas Veerman     (bfd *, struct bfd_symbol **, struct bfd_symbol *,
647918a5822eSThomas Veerman      const char **, unsigned int *);
648018a5822eSThomas Veerman   bfd_boolean (*_bfd_find_inliner_info)
648118a5822eSThomas Veerman     (bfd *, const char **, const char **, unsigned int *);
648218a5822eSThomas Veerman  /* Back-door to allow format-aware applications to create debug symbols
648318a5822eSThomas Veerman     while using BFD for everything else.  Currently used by the assembler
648418a5822eSThomas Veerman     when creating COFF files.  */
648518a5822eSThomas Veerman   asymbol *   (*_bfd_make_debug_symbol)
648618a5822eSThomas Veerman     (bfd *, void *, unsigned long size);
648718a5822eSThomas Veerman #define bfd_read_minisymbols(b, d, m, s) \
648818a5822eSThomas Veerman   BFD_SEND (b, _read_minisymbols, (b, d, m, s))
648918a5822eSThomas Veerman   long        (*_read_minisymbols)
649018a5822eSThomas Veerman     (bfd *, bfd_boolean, void **, unsigned int *);
649118a5822eSThomas Veerman #define bfd_minisymbol_to_symbol(b, d, m, f) \
649218a5822eSThomas Veerman   BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
649318a5822eSThomas Veerman   asymbol *   (*_minisymbol_to_symbol)
649418a5822eSThomas Veerman     (bfd *, bfd_boolean, const void *, asymbol *);
649518a5822eSThomas Veerman 
649618a5822eSThomas Veerman   /* Routines for relocs.  */
649718a5822eSThomas Veerman #define BFD_JUMP_TABLE_RELOCS(NAME) \
649818a5822eSThomas Veerman   NAME##_get_reloc_upper_bound, \
649918a5822eSThomas Veerman   NAME##_canonicalize_reloc, \
650018a5822eSThomas Veerman   NAME##_bfd_reloc_type_lookup, \
650118a5822eSThomas Veerman   NAME##_bfd_reloc_name_lookup
650218a5822eSThomas Veerman 
650318a5822eSThomas Veerman   long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
650418a5822eSThomas Veerman   long        (*_bfd_canonicalize_reloc)
650518a5822eSThomas Veerman     (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
650618a5822eSThomas Veerman   /* See documentation on reloc types.  */
650718a5822eSThomas Veerman   reloc_howto_type *
650818a5822eSThomas Veerman               (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
650918a5822eSThomas Veerman   reloc_howto_type *
651018a5822eSThomas Veerman               (*reloc_name_lookup) (bfd *, const char *);
651118a5822eSThomas Veerman 
651218a5822eSThomas Veerman 
651318a5822eSThomas Veerman   /* Routines used when writing an object file.  */
651418a5822eSThomas Veerman #define BFD_JUMP_TABLE_WRITE(NAME) \
651518a5822eSThomas Veerman   NAME##_set_arch_mach, \
651618a5822eSThomas Veerman   NAME##_set_section_contents
651718a5822eSThomas Veerman 
651818a5822eSThomas Veerman   bfd_boolean (*_bfd_set_arch_mach)
651918a5822eSThomas Veerman     (bfd *, enum bfd_architecture, unsigned long);
652018a5822eSThomas Veerman   bfd_boolean (*_bfd_set_section_contents)
652118a5822eSThomas Veerman     (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
652218a5822eSThomas Veerman 
652318a5822eSThomas Veerman   /* Routines used by the linker.  */
652418a5822eSThomas Veerman #define BFD_JUMP_TABLE_LINK(NAME) \
652518a5822eSThomas Veerman   NAME##_sizeof_headers, \
652618a5822eSThomas Veerman   NAME##_bfd_get_relocated_section_contents, \
652718a5822eSThomas Veerman   NAME##_bfd_relax_section, \
652818a5822eSThomas Veerman   NAME##_bfd_link_hash_table_create, \
652918a5822eSThomas Veerman   NAME##_bfd_link_hash_table_free, \
653018a5822eSThomas Veerman   NAME##_bfd_link_add_symbols, \
653118a5822eSThomas Veerman   NAME##_bfd_link_just_syms, \
653218a5822eSThomas Veerman   NAME##_bfd_copy_link_hash_symbol_type, \
653318a5822eSThomas Veerman   NAME##_bfd_final_link, \
653418a5822eSThomas Veerman   NAME##_bfd_link_split_section, \
653518a5822eSThomas Veerman   NAME##_bfd_gc_sections, \
6536*c9ea9e7aSLionel Sambuc   NAME##_bfd_lookup_section_flags, \
653718a5822eSThomas Veerman   NAME##_bfd_merge_sections, \
653818a5822eSThomas Veerman   NAME##_bfd_is_group_section, \
653918a5822eSThomas Veerman   NAME##_bfd_discard_group, \
654018a5822eSThomas Veerman   NAME##_section_already_linked, \
654118a5822eSThomas Veerman   NAME##_bfd_define_common_symbol
654218a5822eSThomas Veerman 
654318a5822eSThomas Veerman   int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
654418a5822eSThomas Veerman   bfd_byte *  (*_bfd_get_relocated_section_contents)
654518a5822eSThomas Veerman     (bfd *, struct bfd_link_info *, struct bfd_link_order *,
654618a5822eSThomas Veerman      bfd_byte *, bfd_boolean, struct bfd_symbol **);
654718a5822eSThomas Veerman 
654818a5822eSThomas Veerman   bfd_boolean (*_bfd_relax_section)
654918a5822eSThomas Veerman     (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
655018a5822eSThomas Veerman 
655118a5822eSThomas Veerman   /* Create a hash table for the linker.  Different backends store
655218a5822eSThomas Veerman      different information in this table.  */
655318a5822eSThomas Veerman   struct bfd_link_hash_table *
655418a5822eSThomas Veerman               (*_bfd_link_hash_table_create) (bfd *);
655518a5822eSThomas Veerman 
655618a5822eSThomas Veerman   /* Release the memory associated with the linker hash table.  */
655718a5822eSThomas Veerman   void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
655818a5822eSThomas Veerman 
655918a5822eSThomas Veerman   /* Add symbols from this object file into the hash table.  */
656018a5822eSThomas Veerman   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
656118a5822eSThomas Veerman 
656218a5822eSThomas Veerman   /* Indicate that we are only retrieving symbol values from this section.  */
656318a5822eSThomas Veerman   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
656418a5822eSThomas Veerman 
656518a5822eSThomas Veerman   /* Copy the symbol type of a linker hash table entry.  */
656618a5822eSThomas Veerman #define bfd_copy_link_hash_symbol_type(b, t, f) \
656718a5822eSThomas Veerman   BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
656818a5822eSThomas Veerman   void (*_bfd_copy_link_hash_symbol_type)
656918a5822eSThomas Veerman     (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
657018a5822eSThomas Veerman 
657118a5822eSThomas Veerman   /* Do a link based on the link_order structures attached to each
657218a5822eSThomas Veerman      section of the BFD.  */
657318a5822eSThomas Veerman   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
657418a5822eSThomas Veerman 
657518a5822eSThomas Veerman   /* Should this section be split up into smaller pieces during linking.  */
657618a5822eSThomas Veerman   bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
657718a5822eSThomas Veerman 
657818a5822eSThomas Veerman   /* Remove sections that are not referenced from the output.  */
657918a5822eSThomas Veerman   bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
658018a5822eSThomas Veerman 
6581*c9ea9e7aSLionel Sambuc   /* Sets the bitmask of allowed and disallowed section flags.  */
6582*c9ea9e7aSLionel Sambuc   bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
6583*c9ea9e7aSLionel Sambuc                                             struct flag_info *,
6584*c9ea9e7aSLionel Sambuc                                             asection *);
6585*c9ea9e7aSLionel Sambuc 
658618a5822eSThomas Veerman   /* Attempt to merge SEC_MERGE sections.  */
658718a5822eSThomas Veerman   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
658818a5822eSThomas Veerman 
658918a5822eSThomas Veerman   /* Is this section a member of a group?  */
659018a5822eSThomas Veerman   bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
659118a5822eSThomas Veerman 
659218a5822eSThomas Veerman   /* Discard members of a group.  */
659318a5822eSThomas Veerman   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
659418a5822eSThomas Veerman 
659518a5822eSThomas Veerman   /* Check if SEC has been already linked during a reloceatable or
659618a5822eSThomas Veerman      final link.  */
6597*c9ea9e7aSLionel Sambuc   bfd_boolean (*_section_already_linked) (bfd *, asection *,
659818a5822eSThomas Veerman                                           struct bfd_link_info *);
659918a5822eSThomas Veerman 
660018a5822eSThomas Veerman   /* Define a common symbol.  */
660118a5822eSThomas Veerman   bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *,
660218a5822eSThomas Veerman                                             struct bfd_link_hash_entry *);
660318a5822eSThomas Veerman 
660418a5822eSThomas Veerman   /* Routines to handle dynamic symbols and relocs.  */
660518a5822eSThomas Veerman #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
660618a5822eSThomas Veerman   NAME##_get_dynamic_symtab_upper_bound, \
660718a5822eSThomas Veerman   NAME##_canonicalize_dynamic_symtab, \
660818a5822eSThomas Veerman   NAME##_get_synthetic_symtab, \
660918a5822eSThomas Veerman   NAME##_get_dynamic_reloc_upper_bound, \
661018a5822eSThomas Veerman   NAME##_canonicalize_dynamic_reloc
661118a5822eSThomas Veerman 
661218a5822eSThomas Veerman   /* Get the amount of memory required to hold the dynamic symbols.  */
661318a5822eSThomas Veerman   long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
661418a5822eSThomas Veerman   /* Read in the dynamic symbols.  */
661518a5822eSThomas Veerman   long        (*_bfd_canonicalize_dynamic_symtab)
661618a5822eSThomas Veerman     (bfd *, struct bfd_symbol **);
661718a5822eSThomas Veerman   /* Create synthetized symbols.  */
661818a5822eSThomas Veerman   long        (*_bfd_get_synthetic_symtab)
661918a5822eSThomas Veerman     (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
662018a5822eSThomas Veerman      struct bfd_symbol **);
662118a5822eSThomas Veerman   /* Get the amount of memory required to hold the dynamic relocs.  */
662218a5822eSThomas Veerman   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
662318a5822eSThomas Veerman   /* Read in the dynamic relocs.  */
662418a5822eSThomas Veerman   long        (*_bfd_canonicalize_dynamic_reloc)
662518a5822eSThomas Veerman     (bfd *, arelent **, struct bfd_symbol **);
662618a5822eSThomas Veerman 
662718a5822eSThomas Veerman   /* Opposite endian version of this target.  */
662818a5822eSThomas Veerman   const struct bfd_target * alternative_target;
662918a5822eSThomas Veerman 
663018a5822eSThomas Veerman   /* Data for use by back-end routines, which isn't
663118a5822eSThomas Veerman      generic enough to belong in this structure.  */
663218a5822eSThomas Veerman   const void *backend_data;
663318a5822eSThomas Veerman 
663418a5822eSThomas Veerman } bfd_target;
663518a5822eSThomas Veerman 
663618a5822eSThomas Veerman bfd_boolean bfd_set_default_target (const char *name);
663718a5822eSThomas Veerman 
663818a5822eSThomas Veerman const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
663918a5822eSThomas Veerman 
664018a5822eSThomas Veerman const bfd_target *bfd_get_target_info (const char *target_name,
664118a5822eSThomas Veerman     bfd *abfd,
664218a5822eSThomas Veerman     bfd_boolean *is_bigendian,
664318a5822eSThomas Veerman     int *underscoring,
664418a5822eSThomas Veerman     const char **def_target_arch);
664518a5822eSThomas Veerman const char ** bfd_target_list (void);
664618a5822eSThomas Veerman 
664718a5822eSThomas Veerman const bfd_target *bfd_search_for_target
664818a5822eSThomas Veerman    (int (*search_func) (const bfd_target *, void *),
664918a5822eSThomas Veerman     void *);
665018a5822eSThomas Veerman 
665118a5822eSThomas Veerman /* Extracted from format.c.  */
665218a5822eSThomas Veerman bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
665318a5822eSThomas Veerman 
665418a5822eSThomas Veerman bfd_boolean bfd_check_format_matches
665518a5822eSThomas Veerman    (bfd *abfd, bfd_format format, char ***matching);
665618a5822eSThomas Veerman 
665718a5822eSThomas Veerman bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
665818a5822eSThomas Veerman 
665918a5822eSThomas Veerman const char *bfd_format_string (bfd_format format);
666018a5822eSThomas Veerman 
666118a5822eSThomas Veerman /* Extracted from linker.c.  */
666218a5822eSThomas Veerman bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
666318a5822eSThomas Veerman 
666418a5822eSThomas Veerman #define bfd_link_split_section(abfd, sec) \
666518a5822eSThomas Veerman        BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
666618a5822eSThomas Veerman 
6667*c9ea9e7aSLionel Sambuc bfd_boolean bfd_section_already_linked (bfd *abfd,
6668*c9ea9e7aSLionel Sambuc     asection *sec,
666918a5822eSThomas Veerman     struct bfd_link_info *info);
667018a5822eSThomas Veerman 
667118a5822eSThomas Veerman #define bfd_section_already_linked(abfd, sec, info) \
667218a5822eSThomas Veerman        BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
667318a5822eSThomas Veerman 
667418a5822eSThomas Veerman bfd_boolean bfd_generic_define_common_symbol
667518a5822eSThomas Veerman    (bfd *output_bfd, struct bfd_link_info *info,
667618a5822eSThomas Veerman     struct bfd_link_hash_entry *h);
667718a5822eSThomas Veerman 
667818a5822eSThomas Veerman #define bfd_define_common_symbol(output_bfd, info, h) \
667918a5822eSThomas Veerman        BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
668018a5822eSThomas Veerman 
668118a5822eSThomas Veerman struct bfd_elf_version_tree * bfd_find_version_for_sym
668218a5822eSThomas Veerman    (struct bfd_elf_version_tree *verdefs,
668318a5822eSThomas Veerman     const char *sym_name, bfd_boolean *hide);
668418a5822eSThomas Veerman 
6685*c9ea9e7aSLionel Sambuc bfd_boolean bfd_hide_sym_by_version
6686*c9ea9e7aSLionel Sambuc    (struct bfd_elf_version_tree *verdefs, const char *sym_name);
6687*c9ea9e7aSLionel Sambuc 
668818a5822eSThomas Veerman /* Extracted from simple.c.  */
668918a5822eSThomas Veerman bfd_byte *bfd_simple_get_relocated_section_contents
669018a5822eSThomas Veerman    (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
669118a5822eSThomas Veerman 
669218a5822eSThomas Veerman /* Extracted from compress.c.  */
669318a5822eSThomas Veerman bfd_boolean bfd_compress_section_contents
669418a5822eSThomas Veerman    (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer,
669518a5822eSThomas Veerman     bfd_size_type uncompressed_size);
669618a5822eSThomas Veerman 
669718a5822eSThomas Veerman bfd_boolean bfd_get_full_section_contents
669818a5822eSThomas Veerman    (bfd *abfd, asection *section, bfd_byte **ptr);
669918a5822eSThomas Veerman 
670018a5822eSThomas Veerman bfd_boolean bfd_is_section_compressed
670118a5822eSThomas Veerman    (bfd *abfd, asection *section);
670218a5822eSThomas Veerman 
670318a5822eSThomas Veerman bfd_boolean bfd_init_section_decompress_status
670418a5822eSThomas Veerman    (bfd *abfd, asection *section);
670518a5822eSThomas Veerman 
670618a5822eSThomas Veerman bfd_boolean bfd_init_section_compress_status
670718a5822eSThomas Veerman    (bfd *abfd, asection *section);
670818a5822eSThomas Veerman 
670918a5822eSThomas Veerman #ifdef __cplusplus
671018a5822eSThomas Veerman }
671118a5822eSThomas Veerman #endif
671218a5822eSThomas Veerman #endif
6713