189857Sobrien/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically 289857Sobrien generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 3130561Sobrien "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 4130561Sobrien "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 5130561Sobrien "linker.c" and "simple.c". 689857Sobrien Run "make headers" in your build bfd/ to regenerate. */ 789857Sobrien 833965Sjdp/* Main header file for the bfd library -- portable access to object files. 9130561Sobrien 10130561Sobrien Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 11218822Sdim 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 12208737Sjmallett Free Software Foundation, Inc. 13130561Sobrien 1433965Sjdp Contributed by Cygnus Support. 1533965Sjdp 16104834Sobrien This file is part of BFD, the Binary File Descriptor library. 1733965Sjdp 18104834Sobrien This program is free software; you can redistribute it and/or modify 19104834Sobrien it under the terms of the GNU General Public License as published by 20104834Sobrien the Free Software Foundation; either version 2 of the License, or 21104834Sobrien (at your option) any later version. 2233965Sjdp 23104834Sobrien This program is distributed in the hope that it will be useful, 24104834Sobrien but WITHOUT ANY WARRANTY; without even the implied warranty of 25104834Sobrien MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26104834Sobrien GNU General Public License for more details. 2733965Sjdp 28104834Sobrien You should have received a copy of the GNU General Public License 29104834Sobrien along with this program; if not, write to the Free Software 30208737Sjmallett Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 3133965Sjdp 3233965Sjdp#ifndef __BFD_H_SEEN__ 3333965Sjdp#define __BFD_H_SEEN__ 3433965Sjdp 3533965Sjdp#ifdef __cplusplus 3633965Sjdpextern "C" { 3733965Sjdp#endif 3833965Sjdp 3933965Sjdp#include "ansidecl.h" 4089857Sobrien#include "symcat.h" 4189857Sobrien#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) 4289857Sobrien#ifndef SABER 4389857Sobrien/* This hack is to avoid a problem with some strict ANSI C preprocessors. 4489857Sobrien The problem is, "32_" is not a valid preprocessing token, and we don't 4589857Sobrien want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will 4689857Sobrien cause the inner CONCAT2 macros to be evaluated first, producing 4789857Sobrien still-valid pp-tokens. Then the final concatenation can be done. */ 4889857Sobrien#undef CONCAT4 4989857Sobrien#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) 5089857Sobrien#endif 5189857Sobrien#endif 5233965Sjdp 53218822Sdim/* This is a utility macro to handle the situation where the code 54218822Sdim wants to place a constant string into the code, followed by a 55218822Sdim comma and then the length of the string. Doing this by hand 56218822Sdim is error prone, so using this macro is safer. The macro will 57218822Sdim also safely handle the case where a NULL is passed as the arg. */ 58218822Sdim#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0) 59218822Sdim/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro 60218822Sdim to create the arguments to another macro, since the preprocessor 61218822Sdim will mis-count the number of arguments to the outer macro (by not 62218822Sdim evaluating STRING_COMMA_LEN and so missing the comma). This is a 63218822Sdim problem for example when trying to use STRING_COMMA_LEN to build 64218822Sdim the arguments to the strncmp() macro. Hence this alternative 65218822Sdim definition of strncmp is provided here. 66218822Sdim 67218822Sdim Note - these macros do NOT work if STR2 is not a constant string. */ 68218822Sdim#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) 69218822Sdim /* strcpy() can have a similar problem, but since we know we are 70218822Sdim copying a constant string, we can use memcpy which will be faster 71218822Sdim since there is no need to check for a NUL byte inside STR. We 72218822Sdim can also save time if we do not need to copy the terminating NUL. */ 73218822Sdim#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) 74218822Sdim#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) 75218822Sdim 76218822Sdim 7789857Sobrien/* The word size used by BFD on the host. This may be 64 with a 32 7889857Sobrien bit target if the host is 64 bit, or if other 64 bit targets have 7989857Sobrien been selected with --enable-targets, or if --enable-64-bit-bfd. */ 8033965Sjdp#define BFD_ARCH_SIZE @wordsize@ 8189857Sobrien 8289857Sobrien/* The word size of the default bfd target. */ 8389857Sobrien#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ 8489857Sobrien 8533965Sjdp#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ 86130561Sobrien#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@ 8733965Sjdp#if @BFD_HOST_64_BIT_DEFINED@ 8833965Sjdp#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ 8933965Sjdp#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@ 90130561Sobrientypedef BFD_HOST_64_BIT bfd_int64_t; 91130561Sobrientypedef BFD_HOST_U_64_BIT bfd_uint64_t; 9233965Sjdp#endif 9333965Sjdp 9433965Sjdp#if BFD_ARCH_SIZE >= 64 9533965Sjdp#define BFD64 9633965Sjdp#endif 9733965Sjdp 9833965Sjdp#ifndef INLINE 9933965Sjdp#if __GNUC__ >= 2 10033965Sjdp#define INLINE __inline__ 10133965Sjdp#else 10233965Sjdp#define INLINE 10333965Sjdp#endif 10433965Sjdp#endif 10533965Sjdp 10691041Sobrien/* Forward declaration. */ 107130561Sobrientypedef struct bfd bfd; 10833965Sjdp 109130561Sobrien/* Boolean type used in bfd. Too many systems define their own 110130561Sobrien versions of "boolean" for us to safely typedef a "boolean" of 111130561Sobrien our own. Using an enum for "bfd_boolean" has its own set of 112130561Sobrien problems, with strange looking casts required to avoid warnings 113130561Sobrien on some older compilers. Thus we just use an int. 11433965Sjdp 115130561Sobrien General rule: Functions which are bfd_boolean return TRUE on 116130561Sobrien success and FALSE on failure (unless they're a predicate). */ 11733965Sjdp 118130561Sobrientypedef int bfd_boolean; 119130561Sobrien#undef FALSE 120130561Sobrien#undef TRUE 121130561Sobrien#define FALSE 0 122130561Sobrien#define TRUE 1 12360484Sobrien 12433965Sjdp#ifdef BFD64 12533965Sjdp 12633965Sjdp#ifndef BFD_HOST_64_BIT 12733965Sjdp #error No 64 bit integer type available 12833965Sjdp#endif /* ! defined (BFD_HOST_64_BIT) */ 12933965Sjdp 13033965Sjdptypedef BFD_HOST_U_64_BIT bfd_vma; 13133965Sjdptypedef BFD_HOST_64_BIT bfd_signed_vma; 13233965Sjdptypedef BFD_HOST_U_64_BIT bfd_size_type; 13333965Sjdptypedef BFD_HOST_U_64_BIT symvalue; 13433965Sjdp 13533965Sjdp#ifndef fprintf_vma 13633965Sjdp#if BFD_HOST_64BIT_LONG 13733965Sjdp#define sprintf_vma(s,x) sprintf (s, "%016lx", x) 13833965Sjdp#define fprintf_vma(f,x) fprintf (f, "%016lx", x) 13933965Sjdp#else 14033965Sjdp#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff))) 14133965Sjdp#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) 14233965Sjdp#define fprintf_vma(s,x) \ 14333965Sjdp fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) 14433965Sjdp#define sprintf_vma(s,x) \ 14533965Sjdp sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) 14633965Sjdp#endif 14733965Sjdp#endif 14833965Sjdp 14933965Sjdp#else /* not BFD64 */ 15033965Sjdp 15133965Sjdp/* Represent a target address. Also used as a generic unsigned type 15233965Sjdp which is guaranteed to be big enough to hold any arithmetic types 15333965Sjdp we need to deal with. */ 15433965Sjdptypedef unsigned long bfd_vma; 15533965Sjdp 15633965Sjdp/* A generic signed type which is guaranteed to be big enough to hold any 15733965Sjdp arithmetic types we need to deal with. Can be assumed to be compatible 15833965Sjdp with bfd_vma in the same way that signed and unsigned ints are compatible 15933965Sjdp (as parameters, in assignment, etc). */ 16033965Sjdptypedef long bfd_signed_vma; 16133965Sjdp 16233965Sjdptypedef unsigned long symvalue; 16333965Sjdptypedef unsigned long bfd_size_type; 16433965Sjdp 16533965Sjdp/* Print a bfd_vma x on stream s. */ 16677298Sobrien#define fprintf_vma(s,x) fprintf (s, "%08lx", x) 16777298Sobrien#define sprintf_vma(s,x) sprintf (s, "%08lx", x) 16860484Sobrien 16933965Sjdp#endif /* not BFD64 */ 17060484Sobrien 171218822Sdim#define HALF_BFD_SIZE_TYPE \ 172218822Sdim (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2)) 173218822Sdim 174130561Sobrien#ifndef BFD_HOST_64_BIT 175130561Sobrien/* Fall back on a 32 bit type. The idea is to make these types always 176130561Sobrien available for function return types, but in the case that 177130561Sobrien BFD_HOST_64_BIT is undefined such a function should abort or 178130561Sobrien otherwise signal an error. */ 179130561Sobrientypedef bfd_signed_vma bfd_int64_t; 180130561Sobrientypedef bfd_vma bfd_uint64_t; 181130561Sobrien#endif 18289857Sobrien 183130561Sobrien/* An offset into a file. BFD always uses the largest possible offset 184130561Sobrien based on the build time availability of fseek, fseeko, or fseeko64. */ 185130561Sobrientypedef @bfd_file_ptr@ file_ptr; 186130561Sobrientypedef unsigned @bfd_file_ptr@ ufile_ptr; 18789857Sobrien 188130561Sobrienextern void bfd_sprintf_vma (bfd *, char *, bfd_vma); 189130561Sobrienextern void bfd_fprintf_vma (bfd *, void *, bfd_vma); 190130561Sobrien 19133965Sjdp#define printf_vma(x) fprintf_vma(stdout,x) 19289857Sobrien#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) 19333965Sjdp 19433965Sjdptypedef unsigned int flagword; /* 32 bits of flags */ 19533965Sjdptypedef unsigned char bfd_byte; 19633965Sjdp 19791041Sobrien/* File formats. */ 19833965Sjdp 19991041Sobrientypedef enum bfd_format 20091041Sobrien{ 20191041Sobrien bfd_unknown = 0, /* File format is unknown. */ 202130561Sobrien bfd_object, /* Linker/assembler/compiler output. */ 20391041Sobrien bfd_archive, /* Object archive file. */ 20491041Sobrien bfd_core, /* Core dump. */ 20591041Sobrien bfd_type_end /* Marks the end; don't use it! */ 20691041Sobrien} 20791041Sobrienbfd_format; 20833965Sjdp 20933965Sjdp/* Values that may appear in the flags field of a BFD. These also 21033965Sjdp appear in the object_flags field of the bfd_target structure, where 21133965Sjdp they indicate the set of flags used by that backend (not all flags 21233965Sjdp are meaningful for all object file formats) (FIXME: at the moment, 21333965Sjdp the object_flags values have mostly just been copied from backend 21433965Sjdp to another, and are not necessarily correct). */ 21533965Sjdp 21633965Sjdp/* No flags. */ 21733965Sjdp#define BFD_NO_FLAGS 0x00 21833965Sjdp 21933965Sjdp/* BFD contains relocation entries. */ 22033965Sjdp#define HAS_RELOC 0x01 22133965Sjdp 22233965Sjdp/* BFD is directly executable. */ 22333965Sjdp#define EXEC_P 0x02 22433965Sjdp 22533965Sjdp/* BFD has line number information (basically used for F_LNNO in a 22633965Sjdp COFF header). */ 22733965Sjdp#define HAS_LINENO 0x04 22833965Sjdp 22933965Sjdp/* BFD has debugging information. */ 23033965Sjdp#define HAS_DEBUG 0x08 23133965Sjdp 23233965Sjdp/* BFD has symbols. */ 23333965Sjdp#define HAS_SYMS 0x10 23433965Sjdp 23533965Sjdp/* BFD has local symbols (basically used for F_LSYMS in a COFF 23633965Sjdp header). */ 23733965Sjdp#define HAS_LOCALS 0x20 23833965Sjdp 23933965Sjdp/* BFD is a dynamic object. */ 24033965Sjdp#define DYNAMIC 0x40 24133965Sjdp 24233965Sjdp/* Text section is write protected (if D_PAGED is not set, this is 24333965Sjdp like an a.out NMAGIC file) (the linker sets this by default, but 24433965Sjdp clears it for -r or -N). */ 24533965Sjdp#define WP_TEXT 0x80 24633965Sjdp 24733965Sjdp/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the 24833965Sjdp linker sets this by default, but clears it for -r or -n or -N). */ 24933965Sjdp#define D_PAGED 0x100 25033965Sjdp 25133965Sjdp/* BFD is relaxable (this means that bfd_relax_section may be able to 25233965Sjdp do something) (sometimes bfd_relax_section can do something even if 25333965Sjdp this is not set). */ 25433965Sjdp#define BFD_IS_RELAXABLE 0x200 25533965Sjdp 25633965Sjdp/* This may be set before writing out a BFD to request using a 25733965Sjdp traditional format. For example, this is used to request that when 25833965Sjdp writing out an a.out object the symbols not be hashed to eliminate 25933965Sjdp duplicates. */ 26033965Sjdp#define BFD_TRADITIONAL_FORMAT 0x400 26133965Sjdp 26233965Sjdp/* This flag indicates that the BFD contents are actually cached in 26333965Sjdp memory. If this is set, iostream points to a bfd_in_memory struct. */ 26433965Sjdp#define BFD_IN_MEMORY 0x800 265130561Sobrien 266130561Sobrien/* The sections in this BFD specify a memory page. */ 267130561Sobrien#define HAS_LOAD_PAGE 0x1000 268218822Sdim 269218822Sdim/* This BFD has been created by the linker and doesn't correspond 270218822Sdim to any input file. */ 271218822Sdim#define BFD_LINKER_CREATED 0x2000 27233965Sjdp 27391041Sobrien/* Symbols and relocation. */ 27433965Sjdp 27533965Sjdp/* A count of carsyms (canonical archive symbols). */ 27633965Sjdptypedef unsigned long symindex; 27733965Sjdp 27833965Sjdp/* How to perform a relocation. */ 27933965Sjdptypedef const struct reloc_howto_struct reloc_howto_type; 28033965Sjdp 28133965Sjdp#define BFD_NO_MORE_SYMBOLS ((symindex) ~0) 28233965Sjdp 28333965Sjdp/* General purpose part of a symbol X; 28433965Sjdp target specific parts are in libcoff.h, libaout.h, etc. */ 28533965Sjdp 28633965Sjdp#define bfd_get_section(x) ((x)->section) 28733965Sjdp#define bfd_get_output_section(x) ((x)->section->output_section) 28833965Sjdp#define bfd_set_section(x,y) ((x)->section) = (y) 28933965Sjdp#define bfd_asymbol_base(x) ((x)->section->vma) 29033965Sjdp#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) 29133965Sjdp#define bfd_asymbol_name(x) ((x)->name) 29233965Sjdp/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ 29333965Sjdp#define bfd_asymbol_bfd(x) ((x)->the_bfd) 29433965Sjdp#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour) 29533965Sjdp 29633965Sjdp/* A canonical archive symbol. */ 29791041Sobrien/* This is a type pun with struct ranlib on purpose! */ 29891041Sobrientypedef struct carsym 29991041Sobrien{ 30033965Sjdp char *name; 30191041Sobrien file_ptr file_offset; /* Look here to find the file. */ 30291041Sobrien} 30391041Sobriencarsym; /* To make these you call a carsymogen. */ 30433965Sjdp 30533965Sjdp/* Used in generating armaps (archive tables of contents). 30691041Sobrien Perhaps just a forward definition would do? */ 30791041Sobrienstruct orl /* Output ranlib. */ 30891041Sobrien{ 30991041Sobrien char **name; /* Symbol name. */ 31091041Sobrien union 31191041Sobrien { 31289857Sobrien file_ptr pos; 31389857Sobrien bfd *abfd; 31491041Sobrien } u; /* bfd* or file position. */ 31591041Sobrien int namidx; /* Index into string table. */ 31633965Sjdp}; 31733965Sjdp 31891041Sobrien/* Linenumber stuff. */ 31991041Sobrientypedef struct lineno_cache_entry 32091041Sobrien{ 32191041Sobrien unsigned int line_number; /* Linenumber from start of function. */ 32291041Sobrien union 32391041Sobrien { 324130561Sobrien struct bfd_symbol *sym; /* Function name. */ 32591041Sobrien bfd_vma offset; /* Offset into section. */ 32633965Sjdp } u; 32791041Sobrien} 32891041Sobrienalent; 32933965Sjdp 33091041Sobrien/* Object and core file sections. */ 33133965Sjdp 33233965Sjdp#define align_power(addr, align) \ 333104834Sobrien (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) 33433965Sjdp 335130561Sobrientypedef struct bfd_section *sec_ptr; 33633965Sjdp 33733965Sjdp#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) 33833965Sjdp#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) 339104834Sobrien#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0) 34033965Sjdp#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0) 34133965Sjdp#define bfd_section_name(bfd, ptr) ((ptr)->name) 342218822Sdim#define bfd_section_size(bfd, ptr) ((ptr)->size) 343218822Sdim#define bfd_get_section_size(ptr) ((ptr)->size) 34433965Sjdp#define bfd_section_vma(bfd, ptr) ((ptr)->vma) 34538889Sjdp#define bfd_section_lma(bfd, ptr) ((ptr)->lma) 34633965Sjdp#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) 34733965Sjdp#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0) 34833965Sjdp#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata) 34933965Sjdp 35033965Sjdp#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) 35133965Sjdp 352130561Sobrien#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) 353130561Sobrien#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) 354130561Sobrien#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) 355218822Sdim/* Find the address one past the end of SEC. */ 356218822Sdim#define bfd_get_section_limit(bfd, sec) \ 357218822Sdim (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \ 358218822Sdim / bfd_octets_per_byte (bfd)) 35933965Sjdp 360218822Sdim/* Return TRUE if section has been discarded. */ 361218822Sdim#define elf_discarded_section(sec) \ 362218822Sdim (!bfd_is_abs_section (sec) \ 363218822Sdim && bfd_is_abs_section ((sec)->output_section) \ 364218822Sdim && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ 365218822Sdim && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) 366218822Sdim 367218822Sdim/* Forward define. */ 368218822Sdimstruct stat; 36933965Sjdp 37033965Sjdptypedef enum bfd_print_symbol 37177298Sobrien{ 37233965Sjdp bfd_print_symbol_name, 37333965Sjdp bfd_print_symbol_more, 37433965Sjdp bfd_print_symbol_all 37533965Sjdp} bfd_print_symbol_type; 37677298Sobrien 37733965Sjdp/* Information about a symbol that nm needs. */ 37833965Sjdp 37933965Sjdptypedef struct _symbol_info 38033965Sjdp{ 38133965Sjdp symvalue value; 38233965Sjdp char type; 38389857Sobrien const char *name; /* Symbol name. */ 38433965Sjdp unsigned char stab_type; /* Stab type. */ 38577298Sobrien char stab_other; /* Stab other. */ 38633965Sjdp short stab_desc; /* Stab desc. */ 38789857Sobrien const char *stab_name; /* String for stab type. */ 38833965Sjdp} symbol_info; 38933965Sjdp 39033965Sjdp/* Get the name of a stabs type code. */ 39133965Sjdp 392130561Sobrienextern const char *bfd_get_stab_name (int); 39333965Sjdp 39433965Sjdp/* Hash table routines. There is no way to free up a hash table. */ 39533965Sjdp 39633965Sjdp/* An element in the hash table. Most uses will actually use a larger 39733965Sjdp structure, and an instance of this will be the first field. */ 39833965Sjdp 39933965Sjdpstruct bfd_hash_entry 40033965Sjdp{ 40133965Sjdp /* Next entry for this hash code. */ 40233965Sjdp struct bfd_hash_entry *next; 40333965Sjdp /* String being hashed. */ 40433965Sjdp const char *string; 40533965Sjdp /* Hash code. This is the full hash code, not the index into the 40633965Sjdp table. */ 40733965Sjdp unsigned long hash; 40833965Sjdp}; 40933965Sjdp 41033965Sjdp/* A hash table. */ 41133965Sjdp 41233965Sjdpstruct bfd_hash_table 41333965Sjdp{ 41433965Sjdp /* The hash array. */ 41533965Sjdp struct bfd_hash_entry **table; 41633965Sjdp /* A function used to create new elements in the hash table. The 41733965Sjdp first entry is itself a pointer to an element. When this 41833965Sjdp function is first invoked, this pointer will be NULL. However, 41933965Sjdp having the pointer permits a hierarchy of method functions to be 42033965Sjdp built each of which calls the function in the superclass. Thus 42133965Sjdp each function should be written to allocate a new block of memory 42233965Sjdp only if the argument is NULL. */ 423130561Sobrien struct bfd_hash_entry *(*newfunc) 424130561Sobrien (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); 42533965Sjdp /* An objalloc for this hash table. This is a struct objalloc *, 426130561Sobrien but we use void * to avoid requiring the inclusion of objalloc.h. */ 427130561Sobrien void *memory; 428218822Sdim /* The number of slots in the hash table. */ 429218822Sdim unsigned int size; 430218822Sdim /* The number of entries in the hash table. */ 431218822Sdim unsigned int count; 432218822Sdim /* The size of elements. */ 433218822Sdim unsigned int entsize; 434218822Sdim /* If non-zero, don't grow the hash table. */ 435218822Sdim unsigned int frozen:1; 43633965Sjdp}; 43733965Sjdp 43833965Sjdp/* Initialize a hash table. */ 439130561Sobrienextern bfd_boolean bfd_hash_table_init 440130561Sobrien (struct bfd_hash_table *, 441130561Sobrien struct bfd_hash_entry *(*) (struct bfd_hash_entry *, 442130561Sobrien struct bfd_hash_table *, 443218822Sdim const char *), 444218822Sdim unsigned int); 44533965Sjdp 44633965Sjdp/* Initialize a hash table specifying a size. */ 447130561Sobrienextern bfd_boolean bfd_hash_table_init_n 448130561Sobrien (struct bfd_hash_table *, 449130561Sobrien struct bfd_hash_entry *(*) (struct bfd_hash_entry *, 450130561Sobrien struct bfd_hash_table *, 451130561Sobrien const char *), 452218822Sdim unsigned int, unsigned int); 45333965Sjdp 45433965Sjdp/* Free up a hash table. */ 455130561Sobrienextern void bfd_hash_table_free 456130561Sobrien (struct bfd_hash_table *); 45733965Sjdp 458130561Sobrien/* Look up a string in a hash table. If CREATE is TRUE, a new entry 45933965Sjdp will be created for this string if one does not already exist. The 460130561Sobrien COPY argument must be TRUE if this routine should copy the string 46133965Sjdp into newly allocated memory when adding an entry. */ 46233965Sjdpextern struct bfd_hash_entry *bfd_hash_lookup 463130561Sobrien (struct bfd_hash_table *, const char *, bfd_boolean create, 464130561Sobrien bfd_boolean copy); 46533965Sjdp 46633965Sjdp/* Replace an entry in a hash table. */ 46733965Sjdpextern void bfd_hash_replace 468130561Sobrien (struct bfd_hash_table *, struct bfd_hash_entry *old, 469130561Sobrien struct bfd_hash_entry *nw); 47033965Sjdp 47133965Sjdp/* Base method for creating a hash table entry. */ 47233965Sjdpextern struct bfd_hash_entry *bfd_hash_newfunc 473130561Sobrien (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); 47433965Sjdp 47533965Sjdp/* Grab some space for a hash table entry. */ 476130561Sobrienextern void *bfd_hash_allocate 477130561Sobrien (struct bfd_hash_table *, unsigned int); 47833965Sjdp 47933965Sjdp/* Traverse a hash table in a random order, calling a function on each 480130561Sobrien element. If the function returns FALSE, the traversal stops. The 48133965Sjdp INFO argument is passed to the function. */ 482130561Sobrienextern void bfd_hash_traverse 483130561Sobrien (struct bfd_hash_table *, 484130561Sobrien bfd_boolean (*) (struct bfd_hash_entry *, void *), 485130561Sobrien void *info); 48633965Sjdp 487218822Sdim/* Allows the default size of a hash table to be configured. New hash 488218822Sdim tables allocated using bfd_hash_table_init will be created with 489218822Sdim this size. */ 490218822Sdimextern void bfd_hash_set_default_size (bfd_size_type); 491218822Sdim 492218822Sdim/* This structure is used to keep track of stabs in sections 493218822Sdim information while linking. */ 494218822Sdim 495218822Sdimstruct stab_info 496218822Sdim{ 497218822Sdim /* A hash table used to hold stabs strings. */ 498218822Sdim struct bfd_strtab_hash *strings; 499218822Sdim /* The header file hash table. */ 500218822Sdim struct bfd_hash_table includes; 501218822Sdim /* The first .stabstr section. */ 502218822Sdim struct bfd_section *stabstr; 503218822Sdim}; 504218822Sdim 505130561Sobrien#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table 50689857Sobrien 50791041Sobrien/* User program access to BFD facilities. */ 50833965Sjdp 50933965Sjdp/* Direct I/O routines, for programs which know more about the object 51033965Sjdp file than BFD does. Use higher level routines if possible. */ 51133965Sjdp 512130561Sobrienextern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *); 513130561Sobrienextern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *); 514130561Sobrienextern int bfd_seek (bfd *, file_ptr, int); 515130561Sobrienextern file_ptr bfd_tell (bfd *); 516130561Sobrienextern int bfd_flush (bfd *); 517130561Sobrienextern int bfd_stat (bfd *, struct stat *); 51833965Sjdp 51989857Sobrien/* Deprecated old routines. */ 52089857Sobrien#if __GNUC__ 52189857Sobrien#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 52289857Sobrien (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ 52389857Sobrien bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 52489857Sobrien#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 52589857Sobrien (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ 52689857Sobrien bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 52789857Sobrien#else 52889857Sobrien#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 52989857Sobrien (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ 53089857Sobrien bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 53189857Sobrien#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 53289857Sobrien (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ 53389857Sobrien bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 53489857Sobrien#endif 535130561Sobrienextern void warn_deprecated (const char *, const char *, int, const char *); 53689857Sobrien 53733965Sjdp/* Cast from const char * to char * so that caller can assign to 53833965Sjdp a char * without a warning. */ 53933965Sjdp#define bfd_get_filename(abfd) ((char *) (abfd)->filename) 54033965Sjdp#define bfd_get_cacheable(abfd) ((abfd)->cacheable) 54133965Sjdp#define bfd_get_format(abfd) ((abfd)->format) 54233965Sjdp#define bfd_get_target(abfd) ((abfd)->xvec->name) 54333965Sjdp#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) 54477298Sobrien#define bfd_family_coff(abfd) \ 54577298Sobrien (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ 54677298Sobrien bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) 54733965Sjdp#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) 54833965Sjdp#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) 54933965Sjdp#define bfd_header_big_endian(abfd) \ 55033965Sjdp ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) 55133965Sjdp#define bfd_header_little_endian(abfd) \ 55233965Sjdp ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) 55333965Sjdp#define bfd_get_file_flags(abfd) ((abfd)->flags) 55433965Sjdp#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) 55533965Sjdp#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) 55633965Sjdp#define bfd_my_archive(abfd) ((abfd)->my_archive) 55733965Sjdp#define bfd_has_map(abfd) ((abfd)->has_armap) 55833965Sjdp 55933965Sjdp#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) 56033965Sjdp#define bfd_usrdata(abfd) ((abfd)->usrdata) 56133965Sjdp 56233965Sjdp#define bfd_get_start_address(abfd) ((abfd)->start_address) 56333965Sjdp#define bfd_get_symcount(abfd) ((abfd)->symcount) 56433965Sjdp#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) 56533965Sjdp#define bfd_count_sections(abfd) ((abfd)->section_count) 56633965Sjdp 567104834Sobrien#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) 568104834Sobrien 56933965Sjdp#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) 57033965Sjdp 571130561Sobrien#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) 57233965Sjdp 573130561Sobrienextern bfd_boolean bfd_cache_close 574130561Sobrien (bfd *abfd); 57589857Sobrien/* NB: This declaration should match the autogenerated one in libbfd.h. */ 57689857Sobrien 577218822Sdimextern bfd_boolean bfd_cache_close_all (void); 578218822Sdim 579130561Sobrienextern bfd_boolean bfd_record_phdr 580130561Sobrien (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, 581130561Sobrien bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **); 58233965Sjdp 58333965Sjdp/* Byte swapping routines. */ 58433965Sjdp 585130561Sobrienbfd_uint64_t bfd_getb64 (const void *); 586130561Sobrienbfd_uint64_t bfd_getl64 (const void *); 587130561Sobrienbfd_int64_t bfd_getb_signed_64 (const void *); 588130561Sobrienbfd_int64_t bfd_getl_signed_64 (const void *); 589130561Sobrienbfd_vma bfd_getb32 (const void *); 590130561Sobrienbfd_vma bfd_getl32 (const void *); 591130561Sobrienbfd_signed_vma bfd_getb_signed_32 (const void *); 592130561Sobrienbfd_signed_vma bfd_getl_signed_32 (const void *); 593130561Sobrienbfd_vma bfd_getb16 (const void *); 594130561Sobrienbfd_vma bfd_getl16 (const void *); 595130561Sobrienbfd_signed_vma bfd_getb_signed_16 (const void *); 596130561Sobrienbfd_signed_vma bfd_getl_signed_16 (const void *); 597130561Sobrienvoid bfd_putb64 (bfd_uint64_t, void *); 598130561Sobrienvoid bfd_putl64 (bfd_uint64_t, void *); 599130561Sobrienvoid bfd_putb32 (bfd_vma, void *); 600130561Sobrienvoid bfd_putl32 (bfd_vma, void *); 601130561Sobrienvoid bfd_putb16 (bfd_vma, void *); 602130561Sobrienvoid bfd_putl16 (bfd_vma, void *); 60377298Sobrien 60477298Sobrien/* Byte swapping routines which take size and endiannes as arguments. */ 60577298Sobrien 606130561Sobrienbfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); 607130561Sobrienvoid bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); 608218822Sdim 609218822Sdimextern bfd_boolean bfd_section_already_linked_table_init (void); 610218822Sdimextern void bfd_section_already_linked_table_free (void); 61133965Sjdp 61233965Sjdp/* Externally visible ECOFF routines. */ 61333965Sjdp 61433965Sjdp#if defined(__STDC__) || defined(ALMOST_STDC) 61533965Sjdpstruct ecoff_debug_info; 61633965Sjdpstruct ecoff_debug_swap; 61733965Sjdpstruct ecoff_extr; 618130561Sobrienstruct bfd_symbol; 61933965Sjdpstruct bfd_link_info; 62033965Sjdpstruct bfd_link_hash_entry; 62133965Sjdpstruct bfd_elf_version_tree; 62233965Sjdp#endif 623130561Sobrienextern bfd_vma bfd_ecoff_get_gp_value 624130561Sobrien (bfd * abfd); 625130561Sobrienextern bfd_boolean bfd_ecoff_set_gp_value 626130561Sobrien (bfd *abfd, bfd_vma gp_value); 627130561Sobrienextern bfd_boolean bfd_ecoff_set_regmasks 628130561Sobrien (bfd *abfd, unsigned long gprmask, unsigned long fprmask, 629130561Sobrien unsigned long *cprmask); 630130561Sobrienextern void *bfd_ecoff_debug_init 631130561Sobrien (bfd *output_bfd, struct ecoff_debug_info *output_debug, 632130561Sobrien const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); 63333965Sjdpextern void bfd_ecoff_debug_free 634130561Sobrien (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 635130561Sobrien const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); 636130561Sobrienextern bfd_boolean bfd_ecoff_debug_accumulate 637130561Sobrien (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 638130561Sobrien const struct ecoff_debug_swap *output_swap, bfd *input_bfd, 639130561Sobrien struct ecoff_debug_info *input_debug, 640130561Sobrien const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); 641130561Sobrienextern bfd_boolean bfd_ecoff_debug_accumulate_other 642130561Sobrien (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 643130561Sobrien const struct ecoff_debug_swap *output_swap, bfd *input_bfd, 644130561Sobrien struct bfd_link_info *); 645130561Sobrienextern bfd_boolean bfd_ecoff_debug_externals 646130561Sobrien (bfd *abfd, struct ecoff_debug_info *debug, 647130561Sobrien const struct ecoff_debug_swap *swap, bfd_boolean relocatable, 648130561Sobrien bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), 649130561Sobrien void (*set_index) (struct bfd_symbol *, bfd_size_type)); 650130561Sobrienextern bfd_boolean bfd_ecoff_debug_one_external 651130561Sobrien (bfd *abfd, struct ecoff_debug_info *debug, 652130561Sobrien const struct ecoff_debug_swap *swap, const char *name, 653130561Sobrien struct ecoff_extr *esym); 65433965Sjdpextern bfd_size_type bfd_ecoff_debug_size 655130561Sobrien (bfd *abfd, struct ecoff_debug_info *debug, 656130561Sobrien const struct ecoff_debug_swap *swap); 657130561Sobrienextern bfd_boolean bfd_ecoff_write_debug 658130561Sobrien (bfd *abfd, struct ecoff_debug_info *debug, 659130561Sobrien const struct ecoff_debug_swap *swap, file_ptr where); 660130561Sobrienextern bfd_boolean bfd_ecoff_write_accumulated_debug 661130561Sobrien (void *handle, bfd *abfd, struct ecoff_debug_info *debug, 662130561Sobrien const struct ecoff_debug_swap *swap, 663130561Sobrien struct bfd_link_info *info, file_ptr where); 66433965Sjdp 66533965Sjdp/* Externally visible ELF routines. */ 66633965Sjdp 66733965Sjdpstruct bfd_link_needed_list 66833965Sjdp{ 66933965Sjdp struct bfd_link_needed_list *next; 67033965Sjdp bfd *by; 67133965Sjdp const char *name; 67233965Sjdp}; 67333965Sjdp 674130561Sobrienenum dynamic_lib_link_class { 675130561Sobrien DYN_NORMAL = 0, 676130561Sobrien DYN_AS_NEEDED = 1, 677218822Sdim DYN_DT_NEEDED = 2, 678218822Sdim DYN_NO_ADD_NEEDED = 4, 679218822Sdim DYN_NO_NEEDED = 8 680130561Sobrien}; 681130561Sobrien 682218822Sdimenum notice_asneeded_action { 683218822Sdim notice_as_needed, 684218822Sdim notice_not_needed, 685218822Sdim notice_needed 686218822Sdim}; 687218822Sdim 688130561Sobrienextern bfd_boolean bfd_elf_record_link_assignment 689218822Sdim (bfd *, struct bfd_link_info *, const char *, bfd_boolean, 690218822Sdim bfd_boolean); 69133965Sjdpextern struct bfd_link_needed_list *bfd_elf_get_needed_list 692130561Sobrien (bfd *, struct bfd_link_info *); 693130561Sobrienextern bfd_boolean bfd_elf_get_bfd_needed_list 694130561Sobrien (bfd *, struct bfd_link_needed_list **); 695130561Sobrienextern bfd_boolean bfd_elf_size_dynamic_sections 696130561Sobrien (bfd *, const char *, const char *, const char *, const char * const *, 697218822Sdim struct bfd_link_info *, struct bfd_section **, 698218822Sdim struct bfd_elf_version_tree *); 699218822Sdimextern bfd_boolean bfd_elf_size_dynsym_hash_dynstr 700218822Sdim (bfd *, struct bfd_link_info *); 701130561Sobrienextern void bfd_elf_set_dt_needed_name 702130561Sobrien (bfd *, const char *); 703130561Sobrienextern const char *bfd_elf_get_dt_soname 704130561Sobrien (bfd *); 705130561Sobrienextern void bfd_elf_set_dyn_lib_class 706218822Sdim (bfd *, enum dynamic_lib_link_class); 707218822Sdimextern int bfd_elf_get_dyn_lib_class 708218822Sdim (bfd *); 70977298Sobrienextern struct bfd_link_needed_list *bfd_elf_get_runpath_list 710130561Sobrien (bfd *, struct bfd_link_info *); 711130561Sobrienextern bfd_boolean bfd_elf_discard_info 712130561Sobrien (bfd *, struct bfd_link_info *); 713218822Sdimextern unsigned int _bfd_elf_default_action_discarded 714218822Sdim (struct bfd_section *); 71533965Sjdp 71660484Sobrien/* Return an upper bound on the number of bytes required to store a 71760484Sobrien copy of ABFD's program header table entries. Return -1 if an error 71860484Sobrien occurs; bfd_get_error will return an appropriate code. */ 719130561Sobrienextern long bfd_get_elf_phdr_upper_bound 720130561Sobrien (bfd *abfd); 72160484Sobrien 72260484Sobrien/* Copy ABFD's program header table entries to *PHDRS. The entries 72360484Sobrien will be stored as an array of Elf_Internal_Phdr structures, as 72460484Sobrien defined in include/elf/internal.h. To find out how large the 72560484Sobrien buffer needs to be, call bfd_get_elf_phdr_upper_bound. 72660484Sobrien 72760484Sobrien Return the number of program header table entries read, or -1 if an 72860484Sobrien error occurs; bfd_get_error will return an appropriate code. */ 729130561Sobrienextern int bfd_get_elf_phdrs 730130561Sobrien (bfd *abfd, void *phdrs); 73160484Sobrien 732130561Sobrien/* Create a new BFD as if by bfd_openr. Rather than opening a file, 733130561Sobrien reconstruct an ELF file by reading the segments out of remote memory 734130561Sobrien based on the ELF file header at EHDR_VMA and the ELF program headers it 735130561Sobrien points to. If not null, *LOADBASEP is filled in with the difference 736130561Sobrien between the VMAs from which the segments were read, and the VMAs the 737130561Sobrien file headers (and hence BFD's idea of each section's VMA) put them at. 738130561Sobrien 739130561Sobrien The function TARGET_READ_MEMORY is called to copy LEN bytes from the 740130561Sobrien remote memory at target address VMA into the local buffer at MYADDR; it 741130561Sobrien should return zero on success or an `errno' code on failure. TEMPL must 742130561Sobrien be a BFD for an ELF target with the word size and byte order found in 743130561Sobrien the remote memory. */ 744130561Sobrienextern bfd *bfd_elf_bfd_from_remote_memory 745130561Sobrien (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, 746218822Sdim int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); 747130561Sobrien 74877298Sobrien/* Return the arch_size field of an elf bfd, or -1 if not elf. */ 749130561Sobrienextern int bfd_get_arch_size 750130561Sobrien (bfd *); 75177298Sobrien 752130561Sobrien/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ 753130561Sobrienextern int bfd_get_sign_extend_vma 754130561Sobrien (bfd *); 75577298Sobrien 756130561Sobrienextern struct bfd_section *_bfd_elf_tls_setup 757130561Sobrien (bfd *, struct bfd_link_info *); 75877298Sobrien 759218822Sdimextern void _bfd_fix_excluded_sec_syms 760218822Sdim (bfd *, struct bfd_link_info *); 761218822Sdim 762218822Sdimextern unsigned bfd_m68k_mach_to_features (int); 763218822Sdim 764218822Sdimextern int bfd_m68k_features_to_mach (unsigned); 765218822Sdim 766130561Sobrienextern bfd_boolean bfd_m68k_elf32_create_embedded_relocs 767218822Sdim (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, 768218822Sdim char **); 769130561Sobrien 770218822Sdimextern bfd_boolean bfd_bfin_elf32_create_embedded_relocs 771218822Sdim (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, 772218822Sdim char **); 773218822Sdim 77433965Sjdp/* SunOS shared library support routines for the linker. */ 77533965Sjdp 77633965Sjdpextern struct bfd_link_needed_list *bfd_sunos_get_needed_list 777130561Sobrien (bfd *, struct bfd_link_info *); 778130561Sobrienextern bfd_boolean bfd_sunos_record_link_assignment 779130561Sobrien (bfd *, struct bfd_link_info *, const char *); 780130561Sobrienextern bfd_boolean bfd_sunos_size_dynamic_sections 781218822Sdim (bfd *, struct bfd_link_info *, struct bfd_section **, 782218822Sdim struct bfd_section **, struct bfd_section **); 78333965Sjdp 78433965Sjdp/* Linux shared library support routines for the linker. */ 78533965Sjdp 786130561Sobrienextern bfd_boolean bfd_i386linux_size_dynamic_sections 787130561Sobrien (bfd *, struct bfd_link_info *); 788130561Sobrienextern bfd_boolean bfd_m68klinux_size_dynamic_sections 789130561Sobrien (bfd *, struct bfd_link_info *); 790130561Sobrienextern bfd_boolean bfd_sparclinux_size_dynamic_sections 791130561Sobrien (bfd *, struct bfd_link_info *); 79233965Sjdp 79333965Sjdp/* mmap hacks */ 79433965Sjdp 79533965Sjdpstruct _bfd_window_internal; 79633965Sjdptypedef struct _bfd_window_internal bfd_window_internal; 79733965Sjdp 79891041Sobrientypedef struct _bfd_window 79991041Sobrien{ 80033965Sjdp /* What the user asked for. */ 801130561Sobrien void *data; 80233965Sjdp bfd_size_type size; 80333965Sjdp /* The actual window used by BFD. Small user-requested read-only 80433965Sjdp regions sharing a page may share a single window into the object 80533965Sjdp file. Read-write versions shouldn't until I've fixed things to 80633965Sjdp keep track of which portions have been claimed by the 80733965Sjdp application; don't want to give the same region back when the 80833965Sjdp application wants two writable copies! */ 80933965Sjdp struct _bfd_window_internal *i; 81091041Sobrien} 81191041Sobrienbfd_window; 81233965Sjdp 813130561Sobrienextern void bfd_init_window 814130561Sobrien (bfd_window *); 815130561Sobrienextern void bfd_free_window 816130561Sobrien (bfd_window *); 817130561Sobrienextern bfd_boolean bfd_get_file_window 818130561Sobrien (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); 81933965Sjdp 82033965Sjdp/* XCOFF support routines for the linker. */ 82133965Sjdp 822130561Sobrienextern bfd_boolean bfd_xcoff_link_record_set 823130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); 824130561Sobrienextern bfd_boolean bfd_xcoff_import_symbol 825130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, 826130561Sobrien const char *, const char *, const char *, unsigned int); 827130561Sobrienextern bfd_boolean bfd_xcoff_export_symbol 828130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); 829130561Sobrienextern bfd_boolean bfd_xcoff_link_count_reloc 830130561Sobrien (bfd *, struct bfd_link_info *, const char *); 831130561Sobrienextern bfd_boolean bfd_xcoff_record_link_assignment 832130561Sobrien (bfd *, struct bfd_link_info *, const char *); 833130561Sobrienextern bfd_boolean bfd_xcoff_size_dynamic_sections 834130561Sobrien (bfd *, struct bfd_link_info *, const char *, const char *, 835130561Sobrien unsigned long, unsigned long, unsigned long, bfd_boolean, 836130561Sobrien int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean); 837130561Sobrienextern bfd_boolean bfd_xcoff_link_generate_rtinit 838130561Sobrien (bfd *, const char *, const char *, bfd_boolean); 83933965Sjdp 840104834Sobrien/* XCOFF support routines for ar. */ 841130561Sobrienextern bfd_boolean bfd_xcoff_ar_archive_set_magic 842130561Sobrien (bfd *, char *); 843104834Sobrien 84433965Sjdp/* Externally visible COFF routines. */ 84533965Sjdp 84633965Sjdp#if defined(__STDC__) || defined(ALMOST_STDC) 84733965Sjdpstruct internal_syment; 84833965Sjdpunion internal_auxent; 84933965Sjdp#endif 85033965Sjdp 851130561Sobrienextern bfd_boolean bfd_coff_get_syment 852130561Sobrien (bfd *, struct bfd_symbol *, struct internal_syment *); 85360484Sobrien 854130561Sobrienextern bfd_boolean bfd_coff_get_auxent 855130561Sobrien (bfd *, struct bfd_symbol *, int, union internal_auxent *); 85633965Sjdp 857130561Sobrienextern bfd_boolean bfd_coff_set_symbol_class 858130561Sobrien (bfd *, struct bfd_symbol *, unsigned int); 85960484Sobrien 860130561Sobrienextern bfd_boolean bfd_m68k_coff_create_embedded_relocs 861130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); 86277298Sobrien 863218822Sdim/* ARM VFP11 erratum workaround support. */ 864218822Sdimtypedef enum 865218822Sdim{ 866218822Sdim BFD_ARM_VFP11_FIX_DEFAULT, 867218822Sdim BFD_ARM_VFP11_FIX_NONE, 868218822Sdim BFD_ARM_VFP11_FIX_SCALAR, 869218822Sdim BFD_ARM_VFP11_FIX_VECTOR 870218822Sdim} bfd_arm_vfp11_fix; 871218822Sdim 872218822Sdimextern void bfd_elf32_arm_init_maps 873218822Sdim (bfd *); 874218822Sdim 875218822Sdimextern void bfd_elf32_arm_set_vfp11_fix 876218822Sdim (bfd *, struct bfd_link_info *); 877218822Sdim 878218822Sdimextern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan 879218822Sdim (bfd *, struct bfd_link_info *); 880218822Sdim 881218822Sdimextern void bfd_elf32_arm_vfp11_fix_veneer_locations 882218822Sdim (bfd *, struct bfd_link_info *); 883218822Sdim 88460484Sobrien/* ARM Interworking support. Called from linker. */ 885130561Sobrienextern bfd_boolean bfd_arm_allocate_interworking_sections 886130561Sobrien (struct bfd_link_info *); 88760484Sobrien 888130561Sobrienextern bfd_boolean bfd_arm_process_before_allocation 889130561Sobrien (bfd *, struct bfd_link_info *, int); 89060484Sobrien 891130561Sobrienextern bfd_boolean bfd_arm_get_bfd_for_interworking 892130561Sobrien (bfd *, struct bfd_link_info *); 89360484Sobrien 89460484Sobrien/* PE ARM Interworking support. Called from linker. */ 895130561Sobrienextern bfd_boolean bfd_arm_pe_allocate_interworking_sections 896130561Sobrien (struct bfd_link_info *); 89760484Sobrien 898130561Sobrienextern bfd_boolean bfd_arm_pe_process_before_allocation 899130561Sobrien (bfd *, struct bfd_link_info *, int); 90060484Sobrien 901130561Sobrienextern bfd_boolean bfd_arm_pe_get_bfd_for_interworking 902130561Sobrien (bfd *, struct bfd_link_info *); 90360484Sobrien 90460484Sobrien/* ELF ARM Interworking support. Called from linker. */ 905130561Sobrienextern bfd_boolean bfd_elf32_arm_allocate_interworking_sections 906130561Sobrien (struct bfd_link_info *); 90760484Sobrien 908130561Sobrienextern bfd_boolean bfd_elf32_arm_process_before_allocation 909218822Sdim (bfd *, struct bfd_link_info *); 91060484Sobrien 911218822Sdimvoid bfd_elf32_arm_set_target_relocs 912218822Sdim (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, 913218822Sdim int, int); 914218822Sdim 915130561Sobrienextern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking 916130561Sobrien (bfd *, struct bfd_link_info *); 91760484Sobrien 918130561Sobrienextern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd 919130561Sobrien (bfd *, struct bfd_link_info *); 920104834Sobrien 921218822Sdim/* ELF ARM mapping symbol support */ 922218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) 923218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) 924218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) 925218822Sdim#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) 926218822Sdimextern bfd_boolean bfd_is_arm_special_symbol_name 927218822Sdim (const char * name, int type); 928218822Sdim 929218822Sdimextern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); 930218822Sdim 931130561Sobrien/* ARM Note section processing. */ 932130561Sobrienextern bfd_boolean bfd_arm_merge_machines 933130561Sobrien (bfd *, bfd *); 934130561Sobrien 935130561Sobrienextern bfd_boolean bfd_arm_update_notes 936130561Sobrien (bfd *, const char *); 937130561Sobrien 938130561Sobrienextern unsigned int bfd_arm_get_mach_from_notes 939130561Sobrien (bfd *, const char *); 940130561Sobrien 94177298Sobrien/* TI COFF load page support. */ 94277298Sobrienextern void bfd_ticoff_set_section_load_page 943130561Sobrien (struct bfd_section *, int); 94477298Sobrien 94577298Sobrienextern int bfd_ticoff_get_section_load_page 946130561Sobrien (struct bfd_section *); 94777298Sobrien 948130561Sobrien/* H8/300 functions. */ 949130561Sobrienextern bfd_vma bfd_h8300_pad_address 950130561Sobrien (bfd *, bfd_vma); 951130561Sobrien 952130561Sobrien/* IA64 Itanium code generation. Called from linker. */ 953130561Sobrienextern void bfd_elf32_ia64_after_parse 954130561Sobrien (int); 955130561Sobrien 956130561Sobrienextern void bfd_elf64_ia64_after_parse 957130561Sobrien (int); 958130561Sobrien 959218822Sdim/* This structure is used for a comdat section, as in PE. A comdat 960218822Sdim section is associated with a particular symbol. When the linker 961218822Sdim sees a comdat section, it keeps only one of the sections with a 962218822Sdim given name and associated with a given symbol. */ 963218822Sdim 964218822Sdimstruct coff_comdat_info 965218822Sdim{ 966218822Sdim /* The name of the symbol associated with a comdat section. */ 967218822Sdim const char *name; 968218822Sdim 969218822Sdim /* The local symbol table index of the symbol associated with a 970218822Sdim comdat section. This is only meaningful to the object file format 971218822Sdim specific code; it is not an index into the list returned by 972218822Sdim bfd_canonicalize_symtab. */ 973218822Sdim long symbol; 974218822Sdim}; 975218822Sdim 976218822Sdimextern struct coff_comdat_info *bfd_coff_get_comdat_section 977218822Sdim (bfd *, struct bfd_section *); 978218822Sdim 979104834Sobrien/* Extracted from init.c. */ 980130561Sobrienvoid bfd_init (void); 98133965Sjdp 982104834Sobrien/* Extracted from opncls.c. */ 983218822Sdimbfd *bfd_fopen (const char *filename, const char *target, 984218822Sdim const char *mode, int fd); 985218822Sdim 986130561Sobrienbfd *bfd_openr (const char *filename, const char *target); 98733965Sjdp 988130561Sobrienbfd *bfd_fdopenr (const char *filename, const char *target, int fd); 98933965Sjdp 990130561Sobrienbfd *bfd_openstreamr (const char *, const char *, void *); 99133965Sjdp 992218822Sdimbfd *bfd_openr_iovec (const char *filename, const char *target, 993218822Sdim void *(*open) (struct bfd *nbfd, 994218822Sdim void *open_closure), 995218822Sdim void *open_closure, 996218822Sdim file_ptr (*pread) (struct bfd *nbfd, 997218822Sdim void *stream, 998218822Sdim void *buf, 999218822Sdim file_ptr nbytes, 1000218822Sdim file_ptr offset), 1001218822Sdim int (*close) (struct bfd *nbfd, 1002218822Sdim void *stream), 1003218822Sdim int (*stat) (struct bfd *abfd, 1004218822Sdim void *stream, 1005218822Sdim struct stat *sb)); 1006218822Sdim 1007130561Sobrienbfd *bfd_openw (const char *filename, const char *target); 100833965Sjdp 1009130561Sobrienbfd_boolean bfd_close (bfd *abfd); 101033965Sjdp 1011130561Sobrienbfd_boolean bfd_close_all_done (bfd *); 101233965Sjdp 1013130561Sobrienbfd *bfd_create (const char *filename, bfd *templ); 101433965Sjdp 1015130561Sobrienbfd_boolean bfd_make_writable (bfd *abfd); 101633965Sjdp 1017130561Sobrienbfd_boolean bfd_make_readable (bfd *abfd); 101860484Sobrien 1019130561Sobrienunsigned long bfd_calc_gnu_debuglink_crc32 1020130561Sobrien (unsigned long crc, const unsigned char *buf, bfd_size_type len); 1021130561Sobrien 1022130561Sobrienchar *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); 1023130561Sobrien 1024130561Sobrienstruct bfd_section *bfd_create_gnu_debuglink_section 1025130561Sobrien (bfd *abfd, const char *filename); 1026130561Sobrien 1027130561Sobrienbfd_boolean bfd_fill_in_gnu_debuglink_section 1028130561Sobrien (bfd *abfd, struct bfd_section *sect, const char *filename); 1029130561Sobrien 1030104834Sobrien/* Extracted from libbfd.c. */ 103160484Sobrien 103277298Sobrien/* Byte swapping macros for user section data. */ 103333965Sjdp 103433965Sjdp#define bfd_put_8(abfd, val, ptr) \ 1035130561Sobrien ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) 103633965Sjdp#define bfd_put_signed_8 \ 1037130561Sobrien bfd_put_8 103833965Sjdp#define bfd_get_8(abfd, ptr) \ 1039130561Sobrien (*(unsigned char *) (ptr) & 0xff) 104033965Sjdp#define bfd_get_signed_8(abfd, ptr) \ 1041130561Sobrien (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) 104233965Sjdp 104333965Sjdp#define bfd_put_16(abfd, val, ptr) \ 1044130561Sobrien BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) 104533965Sjdp#define bfd_put_signed_16 \ 1046130561Sobrien bfd_put_16 104733965Sjdp#define bfd_get_16(abfd, ptr) \ 1048130561Sobrien BFD_SEND (abfd, bfd_getx16, (ptr)) 104933965Sjdp#define bfd_get_signed_16(abfd, ptr) \ 1050130561Sobrien BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) 105133965Sjdp 105233965Sjdp#define bfd_put_32(abfd, val, ptr) \ 1053130561Sobrien BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) 105433965Sjdp#define bfd_put_signed_32 \ 1055130561Sobrien bfd_put_32 105633965Sjdp#define bfd_get_32(abfd, ptr) \ 1057130561Sobrien BFD_SEND (abfd, bfd_getx32, (ptr)) 105833965Sjdp#define bfd_get_signed_32(abfd, ptr) \ 1059130561Sobrien BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) 106033965Sjdp 106133965Sjdp#define bfd_put_64(abfd, val, ptr) \ 1062130561Sobrien BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) 106333965Sjdp#define bfd_put_signed_64 \ 1064130561Sobrien bfd_put_64 106533965Sjdp#define bfd_get_64(abfd, ptr) \ 1066130561Sobrien BFD_SEND (abfd, bfd_getx64, (ptr)) 106733965Sjdp#define bfd_get_signed_64(abfd, ptr) \ 1068130561Sobrien BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) 106933965Sjdp 1070130561Sobrien#define bfd_get(bits, abfd, ptr) \ 1071130561Sobrien ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ 1072130561Sobrien : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ 1073130561Sobrien : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ 1074130561Sobrien : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ 1075130561Sobrien : (abort (), (bfd_vma) - 1)) 107633965Sjdp 1077130561Sobrien#define bfd_put(bits, abfd, val, ptr) \ 1078130561Sobrien ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ 1079130561Sobrien : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ 1080130561Sobrien : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ 1081130561Sobrien : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ 1082130561Sobrien : (abort (), (void) 0)) 108360484Sobrien 108460484Sobrien 108577298Sobrien/* Byte swapping macros for file header data. */ 108633965Sjdp 108733965Sjdp#define bfd_h_put_8(abfd, val, ptr) \ 108889857Sobrien bfd_put_8 (abfd, val, ptr) 108933965Sjdp#define bfd_h_put_signed_8(abfd, val, ptr) \ 109089857Sobrien bfd_put_8 (abfd, val, ptr) 109133965Sjdp#define bfd_h_get_8(abfd, ptr) \ 109289857Sobrien bfd_get_8 (abfd, ptr) 109333965Sjdp#define bfd_h_get_signed_8(abfd, ptr) \ 109489857Sobrien bfd_get_signed_8 (abfd, ptr) 109533965Sjdp 109633965Sjdp#define bfd_h_put_16(abfd, val, ptr) \ 109789857Sobrien BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) 109833965Sjdp#define bfd_h_put_signed_16 \ 109989857Sobrien bfd_h_put_16 110033965Sjdp#define bfd_h_get_16(abfd, ptr) \ 110189857Sobrien BFD_SEND (abfd, bfd_h_getx16, (ptr)) 110233965Sjdp#define bfd_h_get_signed_16(abfd, ptr) \ 110389857Sobrien BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) 110433965Sjdp 110533965Sjdp#define bfd_h_put_32(abfd, val, ptr) \ 110689857Sobrien BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) 110733965Sjdp#define bfd_h_put_signed_32 \ 110889857Sobrien bfd_h_put_32 110933965Sjdp#define bfd_h_get_32(abfd, ptr) \ 111089857Sobrien BFD_SEND (abfd, bfd_h_getx32, (ptr)) 111133965Sjdp#define bfd_h_get_signed_32(abfd, ptr) \ 111289857Sobrien BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) 111333965Sjdp 111433965Sjdp#define bfd_h_put_64(abfd, val, ptr) \ 111589857Sobrien BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) 111633965Sjdp#define bfd_h_put_signed_64 \ 111789857Sobrien bfd_h_put_64 111833965Sjdp#define bfd_h_get_64(abfd, ptr) \ 111989857Sobrien BFD_SEND (abfd, bfd_h_getx64, (ptr)) 112033965Sjdp#define bfd_h_get_signed_64(abfd, ptr) \ 112189857Sobrien BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) 112233965Sjdp 1123130561Sobrien/* Aliases for the above, which should eventually go away. */ 112489857Sobrien 1125130561Sobrien#define H_PUT_64 bfd_h_put_64 1126130561Sobrien#define H_PUT_32 bfd_h_put_32 1127130561Sobrien#define H_PUT_16 bfd_h_put_16 1128130561Sobrien#define H_PUT_8 bfd_h_put_8 1129130561Sobrien#define H_PUT_S64 bfd_h_put_signed_64 1130130561Sobrien#define H_PUT_S32 bfd_h_put_signed_32 1131130561Sobrien#define H_PUT_S16 bfd_h_put_signed_16 1132130561Sobrien#define H_PUT_S8 bfd_h_put_signed_8 1133130561Sobrien#define H_GET_64 bfd_h_get_64 1134130561Sobrien#define H_GET_32 bfd_h_get_32 1135130561Sobrien#define H_GET_16 bfd_h_get_16 1136130561Sobrien#define H_GET_8 bfd_h_get_8 1137130561Sobrien#define H_GET_S64 bfd_h_get_signed_64 1138130561Sobrien#define H_GET_S32 bfd_h_get_signed_32 1139130561Sobrien#define H_GET_S16 bfd_h_get_signed_16 1140130561Sobrien#define H_GET_S8 bfd_h_get_signed_8 114189857Sobrien 114289857Sobrien 1143130561Sobrien/* Extracted from bfdio.c. */ 1144251227Spfglong bfd_get_mtime (bfd *abfd); 114589857Sobrien 1146218822Sdimfile_ptr bfd_get_size (bfd *abfd); 114789857Sobrien 1148130561Sobrien/* Extracted from bfdwin.c. */ 1149104834Sobrien/* Extracted from section.c. */ 1150130561Sobrientypedef struct bfd_section 115133965Sjdp{ 115277298Sobrien /* The name of the section; the name isn't a copy, the pointer is 115377298Sobrien the same as that passed to bfd_make_section. */ 115477298Sobrien const char *name; 115533965Sjdp 115677298Sobrien /* A unique sequence number. */ 115777298Sobrien int id; 115833965Sjdp 115989857Sobrien /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ 116077298Sobrien int index; 116133965Sjdp 116277298Sobrien /* The next section in the list belonging to the BFD, or NULL. */ 1163130561Sobrien struct bfd_section *next; 116433965Sjdp 1165218822Sdim /* The previous section in the list belonging to the BFD, or NULL. */ 1166218822Sdim struct bfd_section *prev; 1167218822Sdim 116877298Sobrien /* The field flags contains attributes of the section. Some 116977298Sobrien flags are read in from the object file, and some are 117077298Sobrien synthesized from other information. */ 117177298Sobrien flagword flags; 117277298Sobrien 117333965Sjdp#define SEC_NO_FLAGS 0x000 117433965Sjdp 117577298Sobrien /* Tells the OS to allocate space for this section when loading. 117677298Sobrien This is clear for a section containing debug information only. */ 117733965Sjdp#define SEC_ALLOC 0x001 117833965Sjdp 117977298Sobrien /* Tells the OS to load the section from the file when loading. 118077298Sobrien This is clear for a .bss section. */ 118133965Sjdp#define SEC_LOAD 0x002 118233965Sjdp 118377298Sobrien /* The section contains data still to be relocated, so there is 118477298Sobrien some relocation information too. */ 118533965Sjdp#define SEC_RELOC 0x004 118633965Sjdp 118777298Sobrien /* A signal to the OS that the section contains read only data. */ 1188218822Sdim#define SEC_READONLY 0x008 118933965Sjdp 119077298Sobrien /* The section contains code only. */ 1191218822Sdim#define SEC_CODE 0x010 119233965Sjdp 119377298Sobrien /* The section contains data only. */ 1194218822Sdim#define SEC_DATA 0x020 119533965Sjdp 119677298Sobrien /* The section will reside in ROM. */ 1197218822Sdim#define SEC_ROM 0x040 119833965Sjdp 119977298Sobrien /* The section contains constructor information. This section 120077298Sobrien type is used by the linker to create lists of constructors and 120177298Sobrien destructors used by <<g++>>. When a back end sees a symbol 120277298Sobrien which should be used in a constructor list, it creates a new 120377298Sobrien section for the type of name (e.g., <<__CTOR_LIST__>>), attaches 120477298Sobrien the symbol to it, and builds a relocation. To build the lists 120577298Sobrien of constructors, all the linker has to do is catenate all the 120677298Sobrien sections called <<__CTOR_LIST__>> and relocate the data 120777298Sobrien contained within - exactly the operations it would peform on 120877298Sobrien standard data. */ 1209218822Sdim#define SEC_CONSTRUCTOR 0x080 121033965Sjdp 121177298Sobrien /* The section has contents - a data section could be 121277298Sobrien <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be 121377298Sobrien <<SEC_HAS_CONTENTS>> */ 1214218822Sdim#define SEC_HAS_CONTENTS 0x100 121533965Sjdp 121677298Sobrien /* An instruction to the linker to not output the section 121777298Sobrien even if it has information which would normally be written. */ 1218218822Sdim#define SEC_NEVER_LOAD 0x200 121933965Sjdp 1220104834Sobrien /* The section contains thread local data. */ 1221218822Sdim#define SEC_THREAD_LOCAL 0x400 1222104834Sobrien 122377298Sobrien /* The section has GOT references. This flag is only for the 122477298Sobrien linker, and is currently only used by the elf32-hppa back end. 122577298Sobrien It will be set if global offset table references were detected 122677298Sobrien in this section, which indicate to the linker that the section 122777298Sobrien contains PIC code, and must be handled specially when doing a 122877298Sobrien static link. */ 1229218822Sdim#define SEC_HAS_GOT_REF 0x800 123077298Sobrien 123177298Sobrien /* The section contains common symbols (symbols may be defined 123277298Sobrien multiple times, the value of a symbol is the amount of 123377298Sobrien space it requires, and the largest symbol value is the one 123477298Sobrien used). Most targets have exactly one of these (which we 123577298Sobrien translate to bfd_com_section_ptr), but ECOFF has two. */ 1236218822Sdim#define SEC_IS_COMMON 0x1000 123733965Sjdp 123877298Sobrien /* The section contains only debugging information. For 123977298Sobrien example, this is set for ELF .debug and .stab sections. 124077298Sobrien strip tests this flag to see if a section can be 124177298Sobrien discarded. */ 1242218822Sdim#define SEC_DEBUGGING 0x2000 124333965Sjdp 124477298Sobrien /* The contents of this section are held in memory pointed to 124577298Sobrien by the contents field. This is checked by bfd_get_section_contents, 124677298Sobrien and the data is retrieved from memory if appropriate. */ 1247218822Sdim#define SEC_IN_MEMORY 0x4000 124833965Sjdp 124977298Sobrien /* The contents of this section are to be excluded by the 125077298Sobrien linker for executable and shared objects unless those 125177298Sobrien objects are to be further relocated. */ 1252218822Sdim#define SEC_EXCLUDE 0x8000 125333965Sjdp 125489857Sobrien /* The contents of this section are to be sorted based on the sum of 125589857Sobrien the symbol and addend values specified by the associated relocation 125689857Sobrien entries. Entries without associated relocation entries will be 125789857Sobrien appended to the end of the section in an unspecified order. */ 1258218822Sdim#define SEC_SORT_ENTRIES 0x10000 125933965Sjdp 126077298Sobrien /* When linking, duplicate sections of the same name should be 126177298Sobrien discarded, rather than being combined into a single section as 126277298Sobrien is usually done. This is similar to how common symbols are 126377298Sobrien handled. See SEC_LINK_DUPLICATES below. */ 1264218822Sdim#define SEC_LINK_ONCE 0x20000 126533965Sjdp 126677298Sobrien /* If SEC_LINK_ONCE is set, this bitfield describes how the linker 126777298Sobrien should handle duplicate sections. */ 1268218822Sdim#define SEC_LINK_DUPLICATES 0x40000 126933965Sjdp 127077298Sobrien /* This value for SEC_LINK_DUPLICATES means that duplicate 127177298Sobrien sections with the same name should simply be discarded. */ 127233965Sjdp#define SEC_LINK_DUPLICATES_DISCARD 0x0 127333965Sjdp 127477298Sobrien /* This value for SEC_LINK_DUPLICATES means that the linker 127577298Sobrien should warn if there are any duplicate sections, although 127677298Sobrien it should still only link one copy. */ 1277218822Sdim#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000 127833965Sjdp 127977298Sobrien /* This value for SEC_LINK_DUPLICATES means that the linker 128077298Sobrien should warn if any duplicate sections are a different size. */ 1281218822Sdim#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000 128233965Sjdp 128377298Sobrien /* This value for SEC_LINK_DUPLICATES means that the linker 128477298Sobrien should warn if any duplicate sections contain different 128577298Sobrien contents. */ 1286218822Sdim#define SEC_LINK_DUPLICATES_SAME_CONTENTS \ 1287218822Sdim (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) 128833965Sjdp 128977298Sobrien /* This section was created by the linker as part of dynamic 129077298Sobrien relocation or other arcane processing. It is skipped when 129177298Sobrien going through the first-pass output, trusting that someone 129277298Sobrien else up the line will take care of it later. */ 1293218822Sdim#define SEC_LINKER_CREATED 0x200000 129433965Sjdp 1295218822Sdim /* This section should not be subject to garbage collection. 1296218822Sdim Also set to inform the linker that this section should not be 1297218822Sdim listed in the link map as discarded. */ 1298218822Sdim#define SEC_KEEP 0x400000 129960484Sobrien 130077298Sobrien /* This section contains "short" data, and should be placed 130177298Sobrien "near" the GP. */ 1302218822Sdim#define SEC_SMALL_DATA 0x800000 130360484Sobrien 130489857Sobrien /* Attempt to merge identical entities in the section. 130589857Sobrien Entity size is given in the entsize field. */ 1306218822Sdim#define SEC_MERGE 0x1000000 130789857Sobrien 130889857Sobrien /* If given with SEC_MERGE, entities to merge are zero terminated 130989857Sobrien strings where entsize specifies character size instead of fixed 131089857Sobrien size entries. */ 1311218822Sdim#define SEC_STRINGS 0x2000000 131289857Sobrien 131389857Sobrien /* This section contains data about section groups. */ 1314218822Sdim#define SEC_GROUP 0x4000000 131589857Sobrien 1316218822Sdim /* The section is a COFF shared library section. This flag is 1317218822Sdim only for the linker. If this type of section appears in 1318218822Sdim the input file, the linker must copy it to the output file 1319218822Sdim without changing the vma or size. FIXME: Although this 1320218822Sdim was originally intended to be general, it really is COFF 1321218822Sdim specific (and the flag was renamed to indicate this). It 1322218822Sdim might be cleaner to have some more general mechanism to 1323218822Sdim allow the back end to control what the linker does with 1324218822Sdim sections. */ 1325218822Sdim#define SEC_COFF_SHARED_LIBRARY 0x10000000 1326218822Sdim 1327218822Sdim /* This section contains data which may be shared with other 1328218822Sdim executables or shared objects. This is for COFF only. */ 1329218822Sdim#define SEC_COFF_SHARED 0x20000000 1330218822Sdim 1331218822Sdim /* When a section with this flag is being linked, then if the size of 1332218822Sdim the input section is less than a page, it should not cross a page 1333218822Sdim boundary. If the size of the input section is one page or more, 1334218822Sdim it should be aligned on a page boundary. This is for TI 1335218822Sdim TMS320C54X only. */ 1336218822Sdim#define SEC_TIC54X_BLOCK 0x40000000 1337218822Sdim 1338218822Sdim /* Conditionally link this section; do not link if there are no 1339218822Sdim references found to any symbol in the section. This is for TI 1340218822Sdim TMS320C54X only. */ 1341218822Sdim#define SEC_TIC54X_CLINK 0x80000000 1342218822Sdim 134377298Sobrien /* End of section flags. */ 134433965Sjdp 134577298Sobrien /* Some internal packed boolean fields. */ 134633965Sjdp 134777298Sobrien /* See the vma field. */ 134877298Sobrien unsigned int user_set_vma : 1; 134933965Sjdp 135077298Sobrien /* A mark flag used by some of the linker backends. */ 135177298Sobrien unsigned int linker_mark : 1; 135233965Sjdp 135378828Sobrien /* Another mark flag used by some of the linker backends. Set for 135489857Sobrien output sections that have an input section. */ 135578828Sobrien unsigned int linker_has_input : 1; 135678828Sobrien 1357218822Sdim /* Mark flags used by some linker backends for garbage collection. */ 135877298Sobrien unsigned int gc_mark : 1; 1359218822Sdim unsigned int gc_mark_from_eh : 1; 136033965Sjdp 1361130561Sobrien /* The following flags are used by the ELF linker. */ 1362130561Sobrien 1363130561Sobrien /* Mark sections which have been allocated to segments. */ 136477298Sobrien unsigned int segment_mark : 1; 136533965Sjdp 1366130561Sobrien /* Type of sec_info information. */ 1367130561Sobrien unsigned int sec_info_type:3; 1368130561Sobrien#define ELF_INFO_TYPE_NONE 0 1369130561Sobrien#define ELF_INFO_TYPE_STABS 1 1370130561Sobrien#define ELF_INFO_TYPE_MERGE 2 1371130561Sobrien#define ELF_INFO_TYPE_EH_FRAME 3 1372130561Sobrien#define ELF_INFO_TYPE_JUST_SYMS 4 1373130561Sobrien 1374130561Sobrien /* Nonzero if this section uses RELA relocations, rather than REL. */ 1375130561Sobrien unsigned int use_rela_p:1; 1376130561Sobrien 1377218822Sdim /* Bits used by various backends. The generic code doesn't touch 1378218822Sdim these fields. */ 1379218822Sdim 1380218822Sdim /* Nonzero if this section has TLS related relocations. */ 1381130561Sobrien unsigned int has_tls_reloc:1; 1382130561Sobrien 1383275718Sjhibbits /* Nonzero if this section has a call to __tls_get_addr. */ 1384275718Sjhibbits unsigned int has_tls_get_addr_call:1; 1385275718Sjhibbits 1386218822Sdim /* Nonzero if this section has a gp reloc. */ 1387218822Sdim unsigned int has_gp_reloc:1; 1388218822Sdim 1389130561Sobrien /* Nonzero if this section needs the relax finalize pass. */ 1390130561Sobrien unsigned int need_finalize_relax:1; 1391130561Sobrien 1392218822Sdim /* Whether relocations have been processed. */ 1393218822Sdim unsigned int reloc_done : 1; 1394130561Sobrien 139577298Sobrien /* End of internal packed boolean fields. */ 139633965Sjdp 139777298Sobrien /* The virtual memory address of the section - where it will be 139877298Sobrien at run time. The symbols are relocated against this. The 139977298Sobrien user_set_vma flag is maintained by bfd; if it's not set, the 140077298Sobrien backend can assign addresses (for example, in <<a.out>>, where 140177298Sobrien the default address for <<.data>> is dependent on the specific 140277298Sobrien target and various flags). */ 140377298Sobrien bfd_vma vma; 140433965Sjdp 140577298Sobrien /* The load address of the section - where it would be in a 140677298Sobrien rom image; really only used for writing section header 140791041Sobrien information. */ 140877298Sobrien bfd_vma lma; 140933965Sjdp 141077298Sobrien /* The size of the section in octets, as it will be output. 141177298Sobrien Contains a value even if the section has no contents (e.g., the 1412218822Sdim size of <<.bss>>). */ 1413218822Sdim bfd_size_type size; 141433965Sjdp 1415218822Sdim /* For input sections, the original size on disk of the section, in 1416218822Sdim octets. This field is used by the linker relaxation code. It is 1417218822Sdim currently only set for sections where the linker relaxation scheme 1418218822Sdim doesn't cache altered section and reloc contents (stabs, eh_frame, 1419218822Sdim SEC_MERGE, some coff relaxing targets), and thus the original size 1420218822Sdim needs to be kept to read the section multiple times. 1421218822Sdim For output sections, rawsize holds the section size calculated on 1422218822Sdim a previous linker relaxation pass. */ 1423218822Sdim bfd_size_type rawsize; 142433965Sjdp 142577298Sobrien /* If this section is going to be output, then this value is the 142677298Sobrien offset in *bytes* into the output section of the first byte in the 142777298Sobrien input section (byte ==> smallest addressable unit on the 142877298Sobrien target). In most cases, if this was going to start at the 142977298Sobrien 100th octet (8-bit quantity) in the output section, this value 143077298Sobrien would be 100. However, if the target byte size is 16 bits 143177298Sobrien (bfd_octets_per_byte is "2"), this value would be 50. */ 143277298Sobrien bfd_vma output_offset; 143333965Sjdp 143477298Sobrien /* The output section through which to map on output. */ 1435130561Sobrien struct bfd_section *output_section; 143633965Sjdp 143777298Sobrien /* The alignment requirement of the section, as an exponent of 2 - 143877298Sobrien e.g., 3 aligns to 2^3 (or 8). */ 143977298Sobrien unsigned int alignment_power; 144033965Sjdp 144177298Sobrien /* If an input section, a pointer to a vector of relocation 144277298Sobrien records for the data in this section. */ 144377298Sobrien struct reloc_cache_entry *relocation; 144433965Sjdp 144577298Sobrien /* If an output section, a pointer to a vector of pointers to 144677298Sobrien relocation records for the data in this section. */ 144777298Sobrien struct reloc_cache_entry **orelocation; 144833965Sjdp 144991041Sobrien /* The number of relocation records in one of the above. */ 145077298Sobrien unsigned reloc_count; 145133965Sjdp 145277298Sobrien /* Information below is back end specific - and not always used 145377298Sobrien or updated. */ 145433965Sjdp 145577298Sobrien /* File position of section data. */ 145677298Sobrien file_ptr filepos; 145733965Sjdp 145877298Sobrien /* File position of relocation info. */ 145977298Sobrien file_ptr rel_filepos; 146033965Sjdp 146177298Sobrien /* File position of line data. */ 146277298Sobrien file_ptr line_filepos; 146333965Sjdp 146477298Sobrien /* Pointer to data for applications. */ 1465130561Sobrien void *userdata; 146633965Sjdp 146777298Sobrien /* If the SEC_IN_MEMORY flag is set, this points to the actual 146877298Sobrien contents. */ 146977298Sobrien unsigned char *contents; 147033965Sjdp 147177298Sobrien /* Attached line number information. */ 147277298Sobrien alent *lineno; 147360484Sobrien 147477298Sobrien /* Number of line number records. */ 147577298Sobrien unsigned int lineno_count; 147633965Sjdp 147789857Sobrien /* Entity size for merging purposes. */ 147889857Sobrien unsigned int entsize; 147989857Sobrien 1480130561Sobrien /* Points to the kept section if this section is a link-once section, 1481130561Sobrien and is discarded. */ 1482130561Sobrien struct bfd_section *kept_section; 1483130561Sobrien 148477298Sobrien /* When a section is being output, this value changes as more 148577298Sobrien linenumbers are written out. */ 148677298Sobrien file_ptr moving_line_filepos; 148733965Sjdp 148877298Sobrien /* What the section number is in the target world. */ 148977298Sobrien int target_index; 149033965Sjdp 1491130561Sobrien void *used_by_bfd; 149233965Sjdp 149377298Sobrien /* If this is a constructor section then here is a list of the 149477298Sobrien relocations created to relocate items within it. */ 149577298Sobrien struct relent_chain *constructor_chain; 149677298Sobrien 149777298Sobrien /* The BFD which owns the section. */ 149877298Sobrien bfd *owner; 149977298Sobrien 150091041Sobrien /* A symbol which points at this section only. */ 1501130561Sobrien struct bfd_symbol *symbol; 1502130561Sobrien struct bfd_symbol **symbol_ptr_ptr; 150377298Sobrien 1504218822Sdim /* Early in the link process, map_head and map_tail are used to build 1505218822Sdim a list of input sections attached to an output section. Later, 1506218822Sdim output sections use these fields for a list of bfd_link_order 1507218822Sdim structs. */ 1508218822Sdim union { 1509218822Sdim struct bfd_link_order *link_order; 1510218822Sdim struct bfd_section *s; 1511218822Sdim } map_head, map_tail; 151291041Sobrien} asection; 151333965Sjdp 151477298Sobrien/* These sections are global, and are managed by BFD. The application 151577298Sobrien and target back end are not permitted to change the values in 151677298Sobrien these sections. New code should use the section_ptr macros rather 151777298Sobrien than referring directly to the const sections. The const sections 151877298Sobrien may eventually vanish. */ 151933965Sjdp#define BFD_ABS_SECTION_NAME "*ABS*" 152033965Sjdp#define BFD_UND_SECTION_NAME "*UND*" 152133965Sjdp#define BFD_COM_SECTION_NAME "*COM*" 152233965Sjdp#define BFD_IND_SECTION_NAME "*IND*" 152333965Sjdp 152491041Sobrien/* The absolute section. */ 1525130561Sobrienextern asection bfd_abs_section; 152633965Sjdp#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) 152733965Sjdp#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) 152891041Sobrien/* Pointer to the undefined section. */ 1529130561Sobrienextern asection bfd_und_section; 153033965Sjdp#define bfd_und_section_ptr ((asection *) &bfd_und_section) 153133965Sjdp#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) 153291041Sobrien/* Pointer to the common section. */ 1533130561Sobrienextern asection bfd_com_section; 153433965Sjdp#define bfd_com_section_ptr ((asection *) &bfd_com_section) 153591041Sobrien/* Pointer to the indirect section. */ 1536130561Sobrienextern asection bfd_ind_section; 153733965Sjdp#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) 153833965Sjdp#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) 153933965Sjdp 154089857Sobrien#define bfd_is_const_section(SEC) \ 154189857Sobrien ( ((SEC) == bfd_abs_section_ptr) \ 154289857Sobrien || ((SEC) == bfd_und_section_ptr) \ 154389857Sobrien || ((SEC) == bfd_com_section_ptr) \ 154489857Sobrien || ((SEC) == bfd_ind_section_ptr)) 154589857Sobrien 154689857Sobrien/* Macros to handle insertion and deletion of a bfd's sections. These 154789857Sobrien only handle the list pointers, ie. do not adjust section_count, 154889857Sobrien target_index etc. */ 1549218822Sdim#define bfd_section_list_remove(ABFD, S) \ 155089857Sobrien do \ 155189857Sobrien { \ 1552218822Sdim asection *_s = S; \ 1553218822Sdim asection *_next = _s->next; \ 1554218822Sdim asection *_prev = _s->prev; \ 1555218822Sdim if (_prev) \ 1556218822Sdim _prev->next = _next; \ 1557218822Sdim else \ 1558218822Sdim (ABFD)->sections = _next; \ 1559218822Sdim if (_next) \ 1560218822Sdim _next->prev = _prev; \ 1561218822Sdim else \ 1562218822Sdim (ABFD)->section_last = _prev; \ 156389857Sobrien } \ 156489857Sobrien while (0) 1565218822Sdim#define bfd_section_list_append(ABFD, S) \ 156689857Sobrien do \ 156789857Sobrien { \ 156889857Sobrien asection *_s = S; \ 1569218822Sdim bfd *_abfd = ABFD; \ 1570218822Sdim _s->next = NULL; \ 1571218822Sdim if (_abfd->section_last) \ 1572218822Sdim { \ 1573218822Sdim _s->prev = _abfd->section_last; \ 1574218822Sdim _abfd->section_last->next = _s; \ 1575218822Sdim } \ 1576218822Sdim else \ 1577218822Sdim { \ 1578218822Sdim _s->prev = NULL; \ 1579218822Sdim _abfd->sections = _s; \ 1580218822Sdim } \ 1581218822Sdim _abfd->section_last = _s; \ 158289857Sobrien } \ 158389857Sobrien while (0) 1584218822Sdim#define bfd_section_list_prepend(ABFD, S) \ 1585218822Sdim do \ 1586218822Sdim { \ 1587218822Sdim asection *_s = S; \ 1588218822Sdim bfd *_abfd = ABFD; \ 1589218822Sdim _s->prev = NULL; \ 1590218822Sdim if (_abfd->sections) \ 1591218822Sdim { \ 1592218822Sdim _s->next = _abfd->sections; \ 1593218822Sdim _abfd->sections->prev = _s; \ 1594218822Sdim } \ 1595218822Sdim else \ 1596218822Sdim { \ 1597218822Sdim _s->next = NULL; \ 1598218822Sdim _abfd->section_last = _s; \ 1599218822Sdim } \ 1600218822Sdim _abfd->sections = _s; \ 1601218822Sdim } \ 1602218822Sdim while (0) 1603218822Sdim#define bfd_section_list_insert_after(ABFD, A, S) \ 1604218822Sdim do \ 1605218822Sdim { \ 1606218822Sdim asection *_a = A; \ 1607218822Sdim asection *_s = S; \ 1608218822Sdim asection *_next = _a->next; \ 1609218822Sdim _s->next = _next; \ 1610218822Sdim _s->prev = _a; \ 1611218822Sdim _a->next = _s; \ 1612218822Sdim if (_next) \ 1613218822Sdim _next->prev = _s; \ 1614218822Sdim else \ 1615218822Sdim (ABFD)->section_last = _s; \ 1616218822Sdim } \ 1617218822Sdim while (0) 1618218822Sdim#define bfd_section_list_insert_before(ABFD, B, S) \ 1619218822Sdim do \ 1620218822Sdim { \ 1621218822Sdim asection *_b = B; \ 1622218822Sdim asection *_s = S; \ 1623218822Sdim asection *_prev = _b->prev; \ 1624218822Sdim _s->prev = _prev; \ 1625218822Sdim _s->next = _b; \ 1626218822Sdim _b->prev = _s; \ 1627218822Sdim if (_prev) \ 1628218822Sdim _prev->next = _s; \ 1629218822Sdim else \ 1630218822Sdim (ABFD)->sections = _s; \ 1631218822Sdim } \ 1632218822Sdim while (0) 1633218822Sdim#define bfd_section_removed_from_list(ABFD, S) \ 1634218822Sdim ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) 163589857Sobrien 1636218822Sdim#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ 1637218822Sdim /* name, id, index, next, prev, flags, user_set_vma, */ \ 1638218822Sdim { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ 1639218822Sdim \ 1640218822Sdim /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh, */ \ 1641218822Sdim 0, 0, 1, 0, \ 1642218822Sdim \ 1643218822Sdim /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc, */ \ 1644218822Sdim 0, 0, 0, 0, \ 1645218822Sdim \ 1646275718Sjhibbits /* has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, */ \ 1647275718Sjhibbits 0, 0, 0, \ 1648218822Sdim \ 1649275718Sjhibbits /* reloc_done, vma, lma, size, rawsize */ \ 1650275718Sjhibbits 0, 0, 0, 0, 0, \ 1651218822Sdim \ 1652218822Sdim /* output_offset, output_section, alignment_power, */ \ 1653218822Sdim 0, (struct bfd_section *) &SEC, 0, \ 1654218822Sdim \ 1655218822Sdim /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ 1656218822Sdim NULL, NULL, 0, 0, 0, \ 1657218822Sdim \ 1658218822Sdim /* line_filepos, userdata, contents, lineno, lineno_count, */ \ 1659218822Sdim 0, NULL, NULL, NULL, 0, \ 1660218822Sdim \ 1661218822Sdim /* entsize, kept_section, moving_line_filepos, */ \ 1662218822Sdim 0, NULL, 0, \ 1663218822Sdim \ 1664218822Sdim /* target_index, used_by_bfd, constructor_chain, owner, */ \ 1665218822Sdim 0, NULL, NULL, NULL, \ 1666218822Sdim \ 1667218822Sdim /* symbol, symbol_ptr_ptr, */ \ 1668218822Sdim (struct bfd_symbol *) SYM, &SEC.symbol, \ 1669218822Sdim \ 1670218822Sdim /* map_head, map_tail */ \ 1671218822Sdim { NULL }, { NULL } \ 1672218822Sdim } 1673218822Sdim 1674130561Sobrienvoid bfd_section_list_clear (bfd *); 167589857Sobrien 1676130561Sobrienasection *bfd_get_section_by_name (bfd *abfd, const char *name); 167733965Sjdp 1678218822Sdimasection *bfd_get_section_by_name_if 1679218822Sdim (bfd *abfd, 1680218822Sdim const char *name, 1681218822Sdim bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), 1682218822Sdim void *obj); 1683218822Sdim 1684130561Sobrienchar *bfd_get_unique_section_name 1685130561Sobrien (bfd *abfd, const char *templat, int *count); 168677298Sobrien 1687130561Sobrienasection *bfd_make_section_old_way (bfd *abfd, const char *name); 168833965Sjdp 1689218822Sdimasection *bfd_make_section_anyway_with_flags 1690218822Sdim (bfd *abfd, const char *name, flagword flags); 1691218822Sdim 1692130561Sobrienasection *bfd_make_section_anyway (bfd *abfd, const char *name); 169333965Sjdp 1694218822Sdimasection *bfd_make_section_with_flags 1695218822Sdim (bfd *, const char *name, flagword flags); 1696218822Sdim 1697130561Sobrienasection *bfd_make_section (bfd *, const char *name); 169833965Sjdp 1699130561Sobrienbfd_boolean bfd_set_section_flags 1700130561Sobrien (bfd *abfd, asection *sec, flagword flags); 170133965Sjdp 1702130561Sobrienvoid bfd_map_over_sections 1703130561Sobrien (bfd *abfd, 1704130561Sobrien void (*func) (bfd *abfd, asection *sect, void *obj), 1705130561Sobrien void *obj); 170633965Sjdp 1707218822Sdimasection *bfd_sections_find_if 1708218822Sdim (bfd *abfd, 1709218822Sdim bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), 1710218822Sdim void *obj); 1711218822Sdim 1712130561Sobrienbfd_boolean bfd_set_section_size 1713130561Sobrien (bfd *abfd, asection *sec, bfd_size_type val); 171433965Sjdp 1715130561Sobrienbfd_boolean bfd_set_section_contents 1716130561Sobrien (bfd *abfd, asection *section, const void *data, 1717130561Sobrien file_ptr offset, bfd_size_type count); 171833965Sjdp 1719130561Sobrienbfd_boolean bfd_get_section_contents 1720130561Sobrien (bfd *abfd, asection *section, void *location, file_ptr offset, 1721130561Sobrien bfd_size_type count); 172233965Sjdp 1723218822Sdimbfd_boolean bfd_malloc_and_get_section 1724218822Sdim (bfd *abfd, asection *section, bfd_byte **buf); 1725218822Sdim 1726130561Sobrienbfd_boolean bfd_copy_private_section_data 1727130561Sobrien (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); 172833965Sjdp 172933965Sjdp#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ 173033965Sjdp BFD_SEND (obfd, _bfd_copy_private_section_data, \ 173138889Sjdp (ibfd, isection, obfd, osection)) 1732218822Sdimbfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); 173360484Sobrien 1734130561Sobrienbfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); 1735104834Sobrien 1736104834Sobrien/* Extracted from archures.c. */ 173777298Sobrienenum bfd_architecture 173833965Sjdp{ 173991041Sobrien bfd_arch_unknown, /* File arch not known. */ 174091041Sobrien bfd_arch_obscure, /* Arch known, not one of these. */ 174177298Sobrien bfd_arch_m68k, /* Motorola 68xxx */ 174238889Sjdp#define bfd_mach_m68000 1 174338889Sjdp#define bfd_mach_m68008 2 174438889Sjdp#define bfd_mach_m68010 3 174538889Sjdp#define bfd_mach_m68020 4 174638889Sjdp#define bfd_mach_m68030 5 174738889Sjdp#define bfd_mach_m68040 6 174838889Sjdp#define bfd_mach_m68060 7 174960484Sobrien#define bfd_mach_cpu32 8 1750218822Sdim#define bfd_mach_fido 9 1751218822Sdim#define bfd_mach_mcf_isa_a_nodiv 10 1752218822Sdim#define bfd_mach_mcf_isa_a 11 1753218822Sdim#define bfd_mach_mcf_isa_a_mac 12 1754218822Sdim#define bfd_mach_mcf_isa_a_emac 13 1755218822Sdim#define bfd_mach_mcf_isa_aplus 14 1756218822Sdim#define bfd_mach_mcf_isa_aplus_mac 15 1757218822Sdim#define bfd_mach_mcf_isa_aplus_emac 16 1758218822Sdim#define bfd_mach_mcf_isa_b_nousp 17 1759218822Sdim#define bfd_mach_mcf_isa_b_nousp_mac 18 1760218822Sdim#define bfd_mach_mcf_isa_b_nousp_emac 19 1761218822Sdim#define bfd_mach_mcf_isa_b 20 1762218822Sdim#define bfd_mach_mcf_isa_b_mac 21 1763218822Sdim#define bfd_mach_mcf_isa_b_emac 22 1764218822Sdim#define bfd_mach_mcf_isa_b_float 23 1765218822Sdim#define bfd_mach_mcf_isa_b_float_mac 24 1766218822Sdim#define bfd_mach_mcf_isa_b_float_emac 25 1767218822Sdim#define bfd_mach_mcf_isa_c 26 1768218822Sdim#define bfd_mach_mcf_isa_c_mac 27 1769218822Sdim#define bfd_mach_mcf_isa_c_emac 28 177077298Sobrien bfd_arch_vax, /* DEC Vax */ 177177298Sobrien bfd_arch_i960, /* Intel 960 */ 177277298Sobrien /* The order of the following is important. 177377298Sobrien lower number indicates a machine type that 177433965Sjdp only accepts a subset of the instructions 177533965Sjdp available to machines with higher numbers. 177633965Sjdp The exception is the "ca", which is 177777298Sobrien incompatible with all other machines except 177891041Sobrien "core". */ 177933965Sjdp 178033965Sjdp#define bfd_mach_i960_core 1 178133965Sjdp#define bfd_mach_i960_ka_sa 2 178233965Sjdp#define bfd_mach_i960_kb_sb 3 178333965Sjdp#define bfd_mach_i960_mc 4 178433965Sjdp#define bfd_mach_i960_xa 5 178533965Sjdp#define bfd_mach_i960_ca 6 178638889Sjdp#define bfd_mach_i960_jx 7 178733965Sjdp#define bfd_mach_i960_hx 8 178833965Sjdp 178991041Sobrien bfd_arch_or32, /* OpenRISC 32 */ 179091041Sobrien 179177298Sobrien bfd_arch_sparc, /* SPARC */ 179238889Sjdp#define bfd_mach_sparc 1 179377298Sobrien/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ 179438889Sjdp#define bfd_mach_sparc_sparclet 2 179538889Sjdp#define bfd_mach_sparc_sparclite 3 179638889Sjdp#define bfd_mach_sparc_v8plus 4 179791041Sobrien#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 179860484Sobrien#define bfd_mach_sparc_sparclite_le 6 179960484Sobrien#define bfd_mach_sparc_v9 7 180091041Sobrien#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 180191041Sobrien#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 180291041Sobrien#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 180377298Sobrien/* Nonzero if MACH has the v9 instruction set. */ 180433965Sjdp#define bfd_mach_sparc_v9_p(mach) \ 180577298Sobrien ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ 180677298Sobrien && (mach) != bfd_mach_sparc_sparclite_le) 1807218822Sdim/* Nonzero if MACH is a 64 bit sparc architecture. */ 1808218822Sdim#define bfd_mach_sparc_64bit_p(mach) \ 1809218822Sdim ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) 1810218822Sdim bfd_arch_spu, /* PowerPC SPU */ 1811218822Sdim#define bfd_mach_spu 256 181277298Sobrien bfd_arch_mips, /* MIPS Rxxxx */ 181338889Sjdp#define bfd_mach_mips3000 3000 181438889Sjdp#define bfd_mach_mips3900 3900 181538889Sjdp#define bfd_mach_mips4000 4000 181638889Sjdp#define bfd_mach_mips4010 4010 181738889Sjdp#define bfd_mach_mips4100 4100 181860484Sobrien#define bfd_mach_mips4111 4111 1819130561Sobrien#define bfd_mach_mips4120 4120 182038889Sjdp#define bfd_mach_mips4300 4300 182138889Sjdp#define bfd_mach_mips4400 4400 182238889Sjdp#define bfd_mach_mips4600 4600 182338889Sjdp#define bfd_mach_mips4650 4650 182438889Sjdp#define bfd_mach_mips5000 5000 1825130561Sobrien#define bfd_mach_mips5400 5400 1826130561Sobrien#define bfd_mach_mips5500 5500 182738889Sjdp#define bfd_mach_mips6000 6000 1828130561Sobrien#define bfd_mach_mips7000 7000 182938889Sjdp#define bfd_mach_mips8000 8000 1830218822Sdim#define bfd_mach_mips9000 9000 183138889Sjdp#define bfd_mach_mips10000 10000 183278828Sobrien#define bfd_mach_mips12000 12000 183338889Sjdp#define bfd_mach_mips16 16 183477298Sobrien#define bfd_mach_mips5 5 183577298Sobrien#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ 183689857Sobrien#define bfd_mach_mipsisa32 32 1837130561Sobrien#define bfd_mach_mipsisa32r2 33 183889857Sobrien#define bfd_mach_mipsisa64 64 1839130561Sobrien#define bfd_mach_mipsisa64r2 65 184077298Sobrien bfd_arch_i386, /* Intel 386 */ 1841130561Sobrien#define bfd_mach_i386_i386 1 1842130561Sobrien#define bfd_mach_i386_i8086 2 1843130561Sobrien#define bfd_mach_i386_i386_intel_syntax 3 1844130561Sobrien#define bfd_mach_x86_64 64 1845130561Sobrien#define bfd_mach_x86_64_intel_syntax 65 184677298Sobrien bfd_arch_we32k, /* AT&T WE32xxx */ 184777298Sobrien bfd_arch_tahoe, /* CCI/Harris Tahoe */ 184877298Sobrien bfd_arch_i860, /* Intel 860 */ 184977298Sobrien bfd_arch_i370, /* IBM 360/370 Mainframes */ 185077298Sobrien bfd_arch_romp, /* IBM ROMP PC/RT */ 185177298Sobrien bfd_arch_convex, /* Convex */ 185277298Sobrien bfd_arch_m88k, /* Motorola 88xxx */ 1853130561Sobrien bfd_arch_m98k, /* Motorola 98xxx */ 185477298Sobrien bfd_arch_pyramid, /* Pyramid Technology */ 1855130561Sobrien bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ 1856130561Sobrien#define bfd_mach_h8300 1 1857130561Sobrien#define bfd_mach_h8300h 2 1858130561Sobrien#define bfd_mach_h8300s 3 1859130561Sobrien#define bfd_mach_h8300hn 4 1860130561Sobrien#define bfd_mach_h8300sn 5 1861130561Sobrien#define bfd_mach_h8300sx 6 1862130561Sobrien#define bfd_mach_h8300sxn 7 186389857Sobrien bfd_arch_pdp11, /* DEC PDP-11 */ 186477298Sobrien bfd_arch_powerpc, /* PowerPC */ 1865130561Sobrien#define bfd_mach_ppc 32 1866130561Sobrien#define bfd_mach_ppc64 64 186777298Sobrien#define bfd_mach_ppc_403 403 186877298Sobrien#define bfd_mach_ppc_403gc 4030 186977298Sobrien#define bfd_mach_ppc_505 505 187077298Sobrien#define bfd_mach_ppc_601 601 187177298Sobrien#define bfd_mach_ppc_602 602 187277298Sobrien#define bfd_mach_ppc_603 603 187377298Sobrien#define bfd_mach_ppc_ec603e 6031 187477298Sobrien#define bfd_mach_ppc_604 604 187577298Sobrien#define bfd_mach_ppc_620 620 187677298Sobrien#define bfd_mach_ppc_630 630 187777298Sobrien#define bfd_mach_ppc_750 750 187877298Sobrien#define bfd_mach_ppc_860 860 187977298Sobrien#define bfd_mach_ppc_a35 35 188077298Sobrien#define bfd_mach_ppc_rs64ii 642 188177298Sobrien#define bfd_mach_ppc_rs64iii 643 188277298Sobrien#define bfd_mach_ppc_7400 7400 1883130561Sobrien#define bfd_mach_ppc_e500 500 188477298Sobrien bfd_arch_rs6000, /* IBM RS/6000 */ 1885130561Sobrien#define bfd_mach_rs6k 6000 188677298Sobrien#define bfd_mach_rs6k_rs1 6001 188777298Sobrien#define bfd_mach_rs6k_rsc 6003 188877298Sobrien#define bfd_mach_rs6k_rs2 6002 188977298Sobrien bfd_arch_hppa, /* HP PA RISC */ 1890130561Sobrien#define bfd_mach_hppa10 10 1891130561Sobrien#define bfd_mach_hppa11 11 1892130561Sobrien#define bfd_mach_hppa20 20 1893130561Sobrien#define bfd_mach_hppa20w 25 189477298Sobrien bfd_arch_d10v, /* Mitsubishi D10V */ 1895130561Sobrien#define bfd_mach_d10v 1 189660484Sobrien#define bfd_mach_d10v_ts2 2 189760484Sobrien#define bfd_mach_d10v_ts3 3 189877298Sobrien bfd_arch_d30v, /* Mitsubishi D30V */ 1899104834Sobrien bfd_arch_dlx, /* DLX */ 190077298Sobrien bfd_arch_m68hc11, /* Motorola 68HC11 */ 190177298Sobrien bfd_arch_m68hc12, /* Motorola 68HC12 */ 1902130561Sobrien#define bfd_mach_m6812_default 0 1903130561Sobrien#define bfd_mach_m6812 1 1904130561Sobrien#define bfd_mach_m6812s 2 190577298Sobrien bfd_arch_z8k, /* Zilog Z8000 */ 190638889Sjdp#define bfd_mach_z8001 1 190738889Sjdp#define bfd_mach_z8002 2 1908130561Sobrien bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ 1909130561Sobrien bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ 1910130561Sobrien#define bfd_mach_sh 1 191160484Sobrien#define bfd_mach_sh2 0x20 191260484Sobrien#define bfd_mach_sh_dsp 0x2d 1913218822Sdim#define bfd_mach_sh2a 0x2a 1914218822Sdim#define bfd_mach_sh2a_nofpu 0x2b 1915218822Sdim#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 1916218822Sdim#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 1917218822Sdim#define bfd_mach_sh2a_or_sh4 0x2a3 1918218822Sdim#define bfd_mach_sh2a_or_sh3e 0x2a4 1919130561Sobrien#define bfd_mach_sh2e 0x2e 192038889Sjdp#define bfd_mach_sh3 0x30 1921218822Sdim#define bfd_mach_sh3_nommu 0x31 192260484Sobrien#define bfd_mach_sh3_dsp 0x3d 192338889Sjdp#define bfd_mach_sh3e 0x3e 192438889Sjdp#define bfd_mach_sh4 0x40 1925130561Sobrien#define bfd_mach_sh4_nofpu 0x41 1926218822Sdim#define bfd_mach_sh4_nommu_nofpu 0x42 1927130561Sobrien#define bfd_mach_sh4a 0x4a 1928130561Sobrien#define bfd_mach_sh4a_nofpu 0x4b 1929130561Sobrien#define bfd_mach_sh4al_dsp 0x4d 193091041Sobrien#define bfd_mach_sh5 0x50 193177298Sobrien bfd_arch_alpha, /* Dec Alpha */ 193260484Sobrien#define bfd_mach_alpha_ev4 0x10 193360484Sobrien#define bfd_mach_alpha_ev5 0x20 193460484Sobrien#define bfd_mach_alpha_ev6 0x30 193591041Sobrien bfd_arch_arm, /* Advanced Risc Machines ARM. */ 1936130561Sobrien#define bfd_mach_arm_unknown 0 193738889Sjdp#define bfd_mach_arm_2 1 193860484Sobrien#define bfd_mach_arm_2a 2 193938889Sjdp#define bfd_mach_arm_3 3 194038889Sjdp#define bfd_mach_arm_3M 4 194160484Sobrien#define bfd_mach_arm_4 5 194238889Sjdp#define bfd_mach_arm_4T 6 194360484Sobrien#define bfd_mach_arm_5 7 194460484Sobrien#define bfd_mach_arm_5T 8 194577298Sobrien#define bfd_mach_arm_5TE 9 194677298Sobrien#define bfd_mach_arm_XScale 10 1947130561Sobrien#define bfd_mach_arm_ep9312 11 1948130561Sobrien#define bfd_mach_arm_iWMMXt 12 1949218822Sdim#define bfd_mach_arm_iWMMXt2 13 195077298Sobrien bfd_arch_ns32k, /* National Semiconductors ns32000 */ 195177298Sobrien bfd_arch_w65, /* WDC 65816 */ 195277298Sobrien bfd_arch_tic30, /* Texas Instruments TMS320C30 */ 1953130561Sobrien bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ 1954130561Sobrien#define bfd_mach_tic3x 30 1955130561Sobrien#define bfd_mach_tic4x 40 195677298Sobrien bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ 195777298Sobrien bfd_arch_tic80, /* TI TMS320c80 (MVP) */ 195877298Sobrien bfd_arch_v850, /* NEC V850 */ 1959130561Sobrien#define bfd_mach_v850 1 196060484Sobrien#define bfd_mach_v850e 'E' 1961130561Sobrien#define bfd_mach_v850e1 '1' 196277298Sobrien bfd_arch_arc, /* ARC Cores */ 1963130561Sobrien#define bfd_mach_arc_5 5 1964130561Sobrien#define bfd_mach_arc_6 6 1965130561Sobrien#define bfd_mach_arc_7 7 1966130561Sobrien#define bfd_mach_arc_8 8 1967218822Sdim bfd_arch_m32c, /* Renesas M16C/M32C. */ 1968218822Sdim#define bfd_mach_m16c 0x75 1969218822Sdim#define bfd_mach_m32c 0x78 1970130561Sobrien bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ 1971130561Sobrien#define bfd_mach_m32r 1 /* For backwards compatibility. */ 197260484Sobrien#define bfd_mach_m32rx 'x' 1973130561Sobrien#define bfd_mach_m32r2 '2' 197477298Sobrien bfd_arch_mn10200, /* Matsushita MN10200 */ 197577298Sobrien bfd_arch_mn10300, /* Matsushita MN10300 */ 197660484Sobrien#define bfd_mach_mn10300 300 197760484Sobrien#define bfd_mach_am33 330 1978130561Sobrien#define bfd_mach_am33_2 332 197960484Sobrien bfd_arch_fr30, 198060484Sobrien#define bfd_mach_fr30 0x46523330 1981104834Sobrien bfd_arch_frv, 1982130561Sobrien#define bfd_mach_frv 1 1983130561Sobrien#define bfd_mach_frvsimple 2 1984104834Sobrien#define bfd_mach_fr300 300 1985104834Sobrien#define bfd_mach_fr400 400 1986218822Sdim#define bfd_mach_fr450 450 1987104834Sobrien#define bfd_mach_frvtomcat 499 /* fr500 prototype */ 1988104834Sobrien#define bfd_mach_fr500 500 1989130561Sobrien#define bfd_mach_fr550 550 199060484Sobrien bfd_arch_mcore, 1991218822Sdim bfd_arch_mep, 1992218822Sdim#define bfd_mach_mep 1 1993218822Sdim#define bfd_mach_mep_h1 0x6831 199477298Sobrien bfd_arch_ia64, /* HP/Intel ia64 */ 1995130561Sobrien#define bfd_mach_ia64_elf64 64 1996130561Sobrien#define bfd_mach_ia64_elf32 32 1997130561Sobrien bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 1998130561Sobrien#define bfd_mach_ip2022 1 1999130561Sobrien#define bfd_mach_ip2022ext 2 2000130561Sobrien bfd_arch_iq2000, /* Vitesse IQ2000. */ 2001130561Sobrien#define bfd_mach_iq2000 1 2002130561Sobrien#define bfd_mach_iq10 2 2003218822Sdim bfd_arch_mt, 2004218822Sdim#define bfd_mach_ms1 1 2005218822Sdim#define bfd_mach_mrisc2 2 2006218822Sdim#define bfd_mach_ms2 3 200760484Sobrien bfd_arch_pj, 200891041Sobrien bfd_arch_avr, /* Atmel AVR microcontrollers. */ 200960484Sobrien#define bfd_mach_avr1 1 201060484Sobrien#define bfd_mach_avr2 2 201160484Sobrien#define bfd_mach_avr3 3 201260484Sobrien#define bfd_mach_avr4 4 201377298Sobrien#define bfd_mach_avr5 5 2014218822Sdim#define bfd_mach_avr6 6 2015218822Sdim bfd_arch_bfin, /* ADI Blackfin */ 2016218822Sdim#define bfd_mach_bfin 1 2017218822Sdim bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ 2018218822Sdim#define bfd_mach_cr16 1 2019218822Sdim bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ 2020218822Sdim#define bfd_mach_cr16c 1 2021218822Sdim bfd_arch_crx, /* National Semiconductor CRX. */ 2022218822Sdim#define bfd_mach_crx 1 202377298Sobrien bfd_arch_cris, /* Axis CRIS */ 2024218822Sdim#define bfd_mach_cris_v0_v10 255 2025218822Sdim#define bfd_mach_cris_v32 32 2026218822Sdim#define bfd_mach_cris_v10_v32 1032 202789857Sobrien bfd_arch_s390, /* IBM s390 */ 2028130561Sobrien#define bfd_mach_s390_31 31 2029130561Sobrien#define bfd_mach_s390_64 64 2030218822Sdim bfd_arch_score, /* Sunplus score */ 203189857Sobrien bfd_arch_openrisc, /* OpenRISC */ 203291041Sobrien bfd_arch_mmix, /* Donald Knuth's educational processor. */ 203389857Sobrien bfd_arch_xstormy16, 2034130561Sobrien#define bfd_mach_xstormy16 1 2035130561Sobrien bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 2036130561Sobrien#define bfd_mach_msp11 11 2037130561Sobrien#define bfd_mach_msp110 110 2038130561Sobrien#define bfd_mach_msp12 12 2039130561Sobrien#define bfd_mach_msp13 13 2040130561Sobrien#define bfd_mach_msp14 14 2041130561Sobrien#define bfd_mach_msp15 15 2042218822Sdim#define bfd_mach_msp16 16 2043218822Sdim#define bfd_mach_msp21 21 2044130561Sobrien#define bfd_mach_msp31 31 2045130561Sobrien#define bfd_mach_msp32 32 2046130561Sobrien#define bfd_mach_msp33 33 2047130561Sobrien#define bfd_mach_msp41 41 2048130561Sobrien#define bfd_mach_msp42 42 2049130561Sobrien#define bfd_mach_msp43 43 2050130561Sobrien#define bfd_mach_msp44 44 2051218822Sdim bfd_arch_xc16x, /* Infineon's XC16X Series. */ 2052218822Sdim#define bfd_mach_xc16x 1 2053218822Sdim#define bfd_mach_xc16xl 2 2054218822Sdim#define bfd_mach_xc16xs 3 2055130561Sobrien bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 2056130561Sobrien#define bfd_mach_xtensa 1 2057218822Sdim bfd_arch_maxq, /* Dallas MAXQ 10/20 */ 2058218822Sdim#define bfd_mach_maxq10 10 2059218822Sdim#define bfd_mach_maxq20 20 2060218822Sdim bfd_arch_z80, 2061218822Sdim#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ 2062218822Sdim#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ 2063218822Sdim#define bfd_mach_z80full 7 /* All undocumented instructions. */ 2064218822Sdim#define bfd_mach_r800 11 /* R800: successor with multiplication. */ 206533965Sjdp bfd_arch_last 206633965Sjdp }; 206733965Sjdp 206877298Sobrientypedef struct bfd_arch_info 206933965Sjdp{ 207033965Sjdp int bits_per_word; 207133965Sjdp int bits_per_address; 207233965Sjdp int bits_per_byte; 207333965Sjdp enum bfd_architecture arch; 207433965Sjdp unsigned long mach; 207533965Sjdp const char *arch_name; 207633965Sjdp const char *printable_name; 207733965Sjdp unsigned int section_align_power; 2078130561Sobrien /* TRUE if this is the default machine for the architecture. 207999461Sobrien The default arch should be the first entry for an arch so that 208099461Sobrien all the entries for that arch can be accessed via <<next>>. */ 2081130561Sobrien bfd_boolean the_default; 208233965Sjdp const struct bfd_arch_info * (*compatible) 2083130561Sobrien (const struct bfd_arch_info *a, const struct bfd_arch_info *b); 208433965Sjdp 2085130561Sobrien bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); 208633965Sjdp 208733965Sjdp const struct bfd_arch_info *next; 208891041Sobrien} 208991041Sobrienbfd_arch_info_type; 209091041Sobrien 2091130561Sobrienconst char *bfd_printable_name (bfd *abfd); 209233965Sjdp 2093130561Sobrienconst bfd_arch_info_type *bfd_scan_arch (const char *string); 209433965Sjdp 2095130561Sobrienconst char **bfd_arch_list (void); 209638889Sjdp 2097130561Sobrienconst bfd_arch_info_type *bfd_arch_get_compatible 2098130561Sobrien (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); 209933965Sjdp 2100130561Sobrienvoid bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); 210133965Sjdp 2102130561Sobrienenum bfd_architecture bfd_get_arch (bfd *abfd); 210333965Sjdp 2104130561Sobrienunsigned long bfd_get_mach (bfd *abfd); 210533965Sjdp 2106130561Sobrienunsigned int bfd_arch_bits_per_byte (bfd *abfd); 210733965Sjdp 2108130561Sobrienunsigned int bfd_arch_bits_per_address (bfd *abfd); 210933965Sjdp 2110130561Sobrienconst bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); 211133965Sjdp 2112130561Sobrienconst bfd_arch_info_type *bfd_lookup_arch 2113130561Sobrien (enum bfd_architecture arch, unsigned long machine); 211433965Sjdp 2115130561Sobrienconst char *bfd_printable_arch_mach 2116130561Sobrien (enum bfd_architecture arch, unsigned long machine); 211733965Sjdp 2118130561Sobrienunsigned int bfd_octets_per_byte (bfd *abfd); 211960484Sobrien 2120130561Sobrienunsigned int bfd_arch_mach_octets_per_byte 2121130561Sobrien (enum bfd_architecture arch, unsigned long machine); 212260484Sobrien 2123104834Sobrien/* Extracted from reloc.c. */ 212433965Sjdptypedef enum bfd_reloc_status 212533965Sjdp{ 212691041Sobrien /* No errors detected. */ 212733965Sjdp bfd_reloc_ok, 212833965Sjdp 212991041Sobrien /* The relocation was performed, but there was an overflow. */ 213033965Sjdp bfd_reloc_overflow, 213133965Sjdp 213291041Sobrien /* The address to relocate was not within the section supplied. */ 213333965Sjdp bfd_reloc_outofrange, 213433965Sjdp 213591041Sobrien /* Used by special functions. */ 213633965Sjdp bfd_reloc_continue, 213733965Sjdp 213891041Sobrien /* Unsupported relocation size requested. */ 213933965Sjdp bfd_reloc_notsupported, 214033965Sjdp 214191041Sobrien /* Unused. */ 214233965Sjdp bfd_reloc_other, 214333965Sjdp 214491041Sobrien /* The symbol to relocate against was undefined. */ 214533965Sjdp bfd_reloc_undefined, 214633965Sjdp 214789857Sobrien /* The relocation was performed, but may not be ok - presently 214889857Sobrien generated only when linking i960 coff files with i960 b.out 214989857Sobrien symbols. If this type is returned, the error_message argument 215089857Sobrien to bfd_perform_relocation will be set. */ 215133965Sjdp bfd_reloc_dangerous 215233965Sjdp } 215333965Sjdp bfd_reloc_status_type; 215433965Sjdp 215533965Sjdp 215633965Sjdptypedef struct reloc_cache_entry 215733965Sjdp{ 215891041Sobrien /* A pointer into the canonical table of pointers. */ 2159130561Sobrien struct bfd_symbol **sym_ptr_ptr; 216033965Sjdp 216191041Sobrien /* offset in section. */ 216233965Sjdp bfd_size_type address; 216333965Sjdp 216491041Sobrien /* addend for relocation value. */ 216533965Sjdp bfd_vma addend; 216633965Sjdp 216791041Sobrien /* Pointer to how to perform the required relocation. */ 216833965Sjdp reloc_howto_type *howto; 216933965Sjdp 217091041Sobrien} 217191041Sobrienarelent; 217291041Sobrien 217333965Sjdpenum complain_overflow 217433965Sjdp{ 217591041Sobrien /* Do not complain on overflow. */ 217633965Sjdp complain_overflow_dont, 217733965Sjdp 2178218822Sdim /* Complain if the value overflows when considered as a signed 2179218822Sdim number one bit larger than the field. ie. A bitfield of N bits 2180218822Sdim is allowed to represent -2**n to 2**n-1. */ 218133965Sjdp complain_overflow_bitfield, 218233965Sjdp 2183218822Sdim /* Complain if the value overflows when considered as a signed 218491041Sobrien number. */ 218533965Sjdp complain_overflow_signed, 218633965Sjdp 218789857Sobrien /* Complain if the value overflows when considered as an 218891041Sobrien unsigned number. */ 218933965Sjdp complain_overflow_unsigned 219033965Sjdp}; 219133965Sjdp 219233965Sjdpstruct reloc_howto_struct 219333965Sjdp{ 219489857Sobrien /* The type field has mainly a documentary use - the back end can 219589857Sobrien do what it wants with it, though normally the back end's 219689857Sobrien external idea of what a reloc number is stored 219789857Sobrien in this field. For example, a PC relative word relocation 219889857Sobrien in a coff environment has the type 023 - because that's 219989857Sobrien what the outside world calls a R_PCRWORD reloc. */ 220033965Sjdp unsigned int type; 220133965Sjdp 220289857Sobrien /* The value the final relocation is shifted right by. This drops 220389857Sobrien unwanted data from the relocation. */ 220433965Sjdp unsigned int rightshift; 220533965Sjdp 220689857Sobrien /* The size of the item to be relocated. This is *not* a 220789857Sobrien power-of-two measure. To get the number of bytes operated 220889857Sobrien on by a type of relocation, use bfd_get_reloc_size. */ 220933965Sjdp int size; 221033965Sjdp 221189857Sobrien /* The number of bits in the item to be relocated. This is used 221289857Sobrien when doing overflow checking. */ 221333965Sjdp unsigned int bitsize; 221433965Sjdp 221589857Sobrien /* Notes that the relocation is relative to the location in the 221689857Sobrien data section of the addend. The relocation function will 221789857Sobrien subtract from the relocation value the address of the location 221889857Sobrien being relocated. */ 2219130561Sobrien bfd_boolean pc_relative; 222033965Sjdp 222189857Sobrien /* The bit position of the reloc value in the destination. 222289857Sobrien The relocated value is left shifted by this amount. */ 222333965Sjdp unsigned int bitpos; 222433965Sjdp 222589857Sobrien /* What type of overflow error should be checked for when 222689857Sobrien relocating. */ 222733965Sjdp enum complain_overflow complain_on_overflow; 222833965Sjdp 222989857Sobrien /* If this field is non null, then the supplied function is 223089857Sobrien called rather than the normal function. This allows really 2231130561Sobrien strange relocation methods to be accommodated (e.g., i960 callj 223289857Sobrien instructions). */ 223333965Sjdp bfd_reloc_status_type (*special_function) 2234130561Sobrien (bfd *, arelent *, struct bfd_symbol *, void *, asection *, 2235130561Sobrien bfd *, char **); 223633965Sjdp 223789857Sobrien /* The textual name of the relocation type. */ 223833965Sjdp char *name; 223933965Sjdp 224089857Sobrien /* Some formats record a relocation addend in the section contents 224189857Sobrien rather than with the relocation. For ELF formats this is the 224289857Sobrien distinction between USE_REL and USE_RELA (though the code checks 224389857Sobrien for USE_REL == 1/0). The value of this field is TRUE if the 224489857Sobrien addend is recorded with the section contents; when performing a 224589857Sobrien partial link (ld -r) the section contents (the data) will be 224689857Sobrien modified. The value of this field is FALSE if addends are 224789857Sobrien recorded with the relocation (in arelent.addend); when performing 224889857Sobrien a partial link the relocation will be modified. 224989857Sobrien All relocations for all ELF USE_RELA targets should set this field 225089857Sobrien to FALSE (values of TRUE should be looked on with suspicion). 225189857Sobrien However, the converse is not true: not all relocations of all ELF 225289857Sobrien USE_REL targets set this field to TRUE. Why this is so is peculiar 225389857Sobrien to each particular target. For relocs that aren't used in partial 225489857Sobrien links (e.g. GOT stuff) it doesn't matter what this is set to. */ 2255130561Sobrien bfd_boolean partial_inplace; 225633965Sjdp 2257130561Sobrien /* src_mask selects the part of the instruction (or data) to be used 2258130561Sobrien in the relocation sum. If the target relocations don't have an 2259130561Sobrien addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 2260130561Sobrien dst_mask to extract the addend from the section contents. If 2261130561Sobrien relocations do have an addend in the reloc, eg. ELF USE_RELA, this 2262130561Sobrien field should be zero. Non-zero values for ELF USE_RELA targets are 2263130561Sobrien bogus as in those cases the value in the dst_mask part of the 2264130561Sobrien section contents should be treated as garbage. */ 226533965Sjdp bfd_vma src_mask; 226633965Sjdp 2267130561Sobrien /* dst_mask selects which parts of the instruction (or data) are 2268130561Sobrien replaced with a relocated value. */ 226933965Sjdp bfd_vma dst_mask; 227033965Sjdp 227189857Sobrien /* When some formats create PC relative instructions, they leave 227289857Sobrien the value of the pc of the place being relocated in the offset 227389857Sobrien slot of the instruction, so that a PC relative relocation can 227489857Sobrien be made just by adding in an ordinary offset (e.g., sun3 a.out). 227589857Sobrien Some formats leave the displacement part of an instruction 227689857Sobrien empty (e.g., m88k bcs); this flag signals the fact. */ 2277130561Sobrien bfd_boolean pcrel_offset; 227833965Sjdp}; 227991041Sobrien 228089857Sobrien#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 228189857Sobrien { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 228289857Sobrien#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 228389857Sobrien HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 2284130561Sobrien NAME, FALSE, 0, 0, IN) 228533965Sjdp 228660484Sobrien#define EMPTY_HOWTO(C) \ 2287130561Sobrien HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 2288130561Sobrien NULL, FALSE, 0, 0, FALSE) 228960484Sobrien 229089857Sobrien#define HOWTO_PREPARE(relocation, symbol) \ 229189857Sobrien { \ 2292130561Sobrien if (symbol != NULL) \ 229389857Sobrien { \ 229489857Sobrien if (bfd_is_com_section (symbol->section)) \ 229589857Sobrien { \ 229689857Sobrien relocation = 0; \ 229789857Sobrien } \ 229889857Sobrien else \ 229989857Sobrien { \ 230089857Sobrien relocation = symbol->value; \ 230189857Sobrien } \ 230289857Sobrien } \ 230389857Sobrien } 230491041Sobrien 2305130561Sobrienunsigned int bfd_get_reloc_size (reloc_howto_type *); 230633965Sjdp 230789857Sobrientypedef struct relent_chain 230889857Sobrien{ 230933965Sjdp arelent relent; 231089857Sobrien struct relent_chain *next; 231191041Sobrien} 231291041Sobrienarelent_chain; 231391041Sobrien 2314130561Sobrienbfd_reloc_status_type bfd_check_overflow 2315130561Sobrien (enum complain_overflow how, 231638889Sjdp unsigned int bitsize, 231738889Sjdp unsigned int rightshift, 231860484Sobrien unsigned int addrsize, 2319130561Sobrien bfd_vma relocation); 232038889Sjdp 2321130561Sobrienbfd_reloc_status_type bfd_perform_relocation 2322130561Sobrien (bfd *abfd, 232333965Sjdp arelent *reloc_entry, 2324130561Sobrien void *data, 232533965Sjdp asection *input_section, 232633965Sjdp bfd *output_bfd, 2327130561Sobrien char **error_message); 232833965Sjdp 2329130561Sobrienbfd_reloc_status_type bfd_install_relocation 2330130561Sobrien (bfd *abfd, 233133965Sjdp arelent *reloc_entry, 2332130561Sobrien void *data, bfd_vma data_start, 233333965Sjdp asection *input_section, 2334130561Sobrien char **error_message); 233533965Sjdp 233633965Sjdpenum bfd_reloc_code_real { 233733965Sjdp _dummy_first_bfd_reloc_code_real, 233833965Sjdp 233933965Sjdp 234091041Sobrien/* Basic absolute relocations of N bits. */ 234133965Sjdp BFD_RELOC_64, 234233965Sjdp BFD_RELOC_32, 234333965Sjdp BFD_RELOC_26, 234433965Sjdp BFD_RELOC_24, 234533965Sjdp BFD_RELOC_16, 234633965Sjdp BFD_RELOC_14, 234733965Sjdp BFD_RELOC_8, 234833965Sjdp 234933965Sjdp/* PC-relative relocations. Sometimes these are relative to the address 235033965Sjdpof the relocation itself; sometimes they are relative to the start of 235133965Sjdpthe section containing the relocation. It depends on the specific target. 235233965Sjdp 235391041SobrienThe 24-bit relocation is used in some Intel 960 configurations. */ 235433965Sjdp BFD_RELOC_64_PCREL, 235533965Sjdp BFD_RELOC_32_PCREL, 235633965Sjdp BFD_RELOC_24_PCREL, 235733965Sjdp BFD_RELOC_16_PCREL, 235833965Sjdp BFD_RELOC_12_PCREL, 235933965Sjdp BFD_RELOC_8_PCREL, 236033965Sjdp 2361218822Sdim/* Section relative relocations. Some targets need this for DWARF2. */ 2362218822Sdim BFD_RELOC_32_SECREL, 2363218822Sdim 236491041Sobrien/* For ELF. */ 236533965Sjdp BFD_RELOC_32_GOT_PCREL, 236633965Sjdp BFD_RELOC_16_GOT_PCREL, 236733965Sjdp BFD_RELOC_8_GOT_PCREL, 236833965Sjdp BFD_RELOC_32_GOTOFF, 236933965Sjdp BFD_RELOC_16_GOTOFF, 237033965Sjdp BFD_RELOC_LO16_GOTOFF, 237133965Sjdp BFD_RELOC_HI16_GOTOFF, 237233965Sjdp BFD_RELOC_HI16_S_GOTOFF, 237333965Sjdp BFD_RELOC_8_GOTOFF, 237489857Sobrien BFD_RELOC_64_PLT_PCREL, 237533965Sjdp BFD_RELOC_32_PLT_PCREL, 237633965Sjdp BFD_RELOC_24_PLT_PCREL, 237733965Sjdp BFD_RELOC_16_PLT_PCREL, 237833965Sjdp BFD_RELOC_8_PLT_PCREL, 237989857Sobrien BFD_RELOC_64_PLTOFF, 238033965Sjdp BFD_RELOC_32_PLTOFF, 238133965Sjdp BFD_RELOC_16_PLTOFF, 238233965Sjdp BFD_RELOC_LO16_PLTOFF, 238333965Sjdp BFD_RELOC_HI16_PLTOFF, 238433965Sjdp BFD_RELOC_HI16_S_PLTOFF, 238533965Sjdp BFD_RELOC_8_PLTOFF, 238633965Sjdp 238791041Sobrien/* Relocations used by 68K ELF. */ 238833965Sjdp BFD_RELOC_68K_GLOB_DAT, 238933965Sjdp BFD_RELOC_68K_JMP_SLOT, 239033965Sjdp BFD_RELOC_68K_RELATIVE, 239133965Sjdp 239291041Sobrien/* Linkage-table relative. */ 239333965Sjdp BFD_RELOC_32_BASEREL, 239433965Sjdp BFD_RELOC_16_BASEREL, 239533965Sjdp BFD_RELOC_LO16_BASEREL, 239633965Sjdp BFD_RELOC_HI16_BASEREL, 239733965Sjdp BFD_RELOC_HI16_S_BASEREL, 239833965Sjdp BFD_RELOC_8_BASEREL, 239933965Sjdp BFD_RELOC_RVA, 240033965Sjdp 240191041Sobrien/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */ 240233965Sjdp BFD_RELOC_8_FFnn, 240333965Sjdp 240433965Sjdp/* These PC-relative relocations are stored as word displacements -- 240533965Sjdpi.e., byte displacements shifted right two bits. The 30-bit word 240633965Sjdpdisplacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the 240733965SjdpSPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 240833965Sjdpsigned 16-bit displacement is used on the MIPS, and the 23-bit 240991041Sobriendisplacement is used on the Alpha. */ 241033965Sjdp BFD_RELOC_32_PCREL_S2, 241133965Sjdp BFD_RELOC_16_PCREL_S2, 241233965Sjdp BFD_RELOC_23_PCREL_S2, 241333965Sjdp 241433965Sjdp/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of 241591041Sobrienthe target word. These are used on the SPARC. */ 241633965Sjdp BFD_RELOC_HI22, 241733965Sjdp BFD_RELOC_LO10, 241833965Sjdp 241933965Sjdp/* For systems that allocate a Global Pointer register, these are 242033965Sjdpdisplacements off that register. These relocation types are 242133965Sjdphandled specially, because the value the register will have is 242291041Sobriendecided relatively late. */ 242333965Sjdp BFD_RELOC_GPREL16, 242433965Sjdp BFD_RELOC_GPREL32, 242533965Sjdp 242691041Sobrien/* Reloc types used for i960/b.out. */ 242733965Sjdp BFD_RELOC_I960_CALLJ, 242833965Sjdp 242933965Sjdp/* SPARC ELF relocations. There is probably some overlap with other 243091041Sobrienrelocation types already defined. */ 243133965Sjdp BFD_RELOC_NONE, 243233965Sjdp BFD_RELOC_SPARC_WDISP22, 243333965Sjdp BFD_RELOC_SPARC22, 243433965Sjdp BFD_RELOC_SPARC13, 243533965Sjdp BFD_RELOC_SPARC_GOT10, 243633965Sjdp BFD_RELOC_SPARC_GOT13, 243733965Sjdp BFD_RELOC_SPARC_GOT22, 243833965Sjdp BFD_RELOC_SPARC_PC10, 243933965Sjdp BFD_RELOC_SPARC_PC22, 244033965Sjdp BFD_RELOC_SPARC_WPLT30, 244133965Sjdp BFD_RELOC_SPARC_COPY, 244233965Sjdp BFD_RELOC_SPARC_GLOB_DAT, 244333965Sjdp BFD_RELOC_SPARC_JMP_SLOT, 244433965Sjdp BFD_RELOC_SPARC_RELATIVE, 244578828Sobrien BFD_RELOC_SPARC_UA16, 244633965Sjdp BFD_RELOC_SPARC_UA32, 244778828Sobrien BFD_RELOC_SPARC_UA64, 244833965Sjdp 244991041Sobrien/* I think these are specific to SPARC a.out (e.g., Sun 4). */ 245033965Sjdp BFD_RELOC_SPARC_BASE13, 245133965Sjdp BFD_RELOC_SPARC_BASE22, 245233965Sjdp 245391041Sobrien/* SPARC64 relocations */ 245433965Sjdp#define BFD_RELOC_SPARC_64 BFD_RELOC_64 245533965Sjdp BFD_RELOC_SPARC_10, 245633965Sjdp BFD_RELOC_SPARC_11, 245733965Sjdp BFD_RELOC_SPARC_OLO10, 245833965Sjdp BFD_RELOC_SPARC_HH22, 245933965Sjdp BFD_RELOC_SPARC_HM10, 246033965Sjdp BFD_RELOC_SPARC_LM22, 246133965Sjdp BFD_RELOC_SPARC_PC_HH22, 246233965Sjdp BFD_RELOC_SPARC_PC_HM10, 246333965Sjdp BFD_RELOC_SPARC_PC_LM22, 246433965Sjdp BFD_RELOC_SPARC_WDISP16, 246533965Sjdp BFD_RELOC_SPARC_WDISP19, 246633965Sjdp BFD_RELOC_SPARC_7, 246733965Sjdp BFD_RELOC_SPARC_6, 246833965Sjdp BFD_RELOC_SPARC_5, 246938889Sjdp#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL 247089857Sobrien BFD_RELOC_SPARC_PLT32, 247138889Sjdp BFD_RELOC_SPARC_PLT64, 247238889Sjdp BFD_RELOC_SPARC_HIX22, 247338889Sjdp BFD_RELOC_SPARC_LOX10, 247438889Sjdp BFD_RELOC_SPARC_H44, 247538889Sjdp BFD_RELOC_SPARC_M44, 247638889Sjdp BFD_RELOC_SPARC_L44, 247738889Sjdp BFD_RELOC_SPARC_REGISTER, 247833965Sjdp 247991041Sobrien/* SPARC little endian relocation */ 248060484Sobrien BFD_RELOC_SPARC_REV32, 248160484Sobrien 2482130561Sobrien/* SPARC TLS relocations */ 2483130561Sobrien BFD_RELOC_SPARC_TLS_GD_HI22, 2484130561Sobrien BFD_RELOC_SPARC_TLS_GD_LO10, 2485130561Sobrien BFD_RELOC_SPARC_TLS_GD_ADD, 2486130561Sobrien BFD_RELOC_SPARC_TLS_GD_CALL, 2487130561Sobrien BFD_RELOC_SPARC_TLS_LDM_HI22, 2488130561Sobrien BFD_RELOC_SPARC_TLS_LDM_LO10, 2489130561Sobrien BFD_RELOC_SPARC_TLS_LDM_ADD, 2490130561Sobrien BFD_RELOC_SPARC_TLS_LDM_CALL, 2491130561Sobrien BFD_RELOC_SPARC_TLS_LDO_HIX22, 2492130561Sobrien BFD_RELOC_SPARC_TLS_LDO_LOX10, 2493130561Sobrien BFD_RELOC_SPARC_TLS_LDO_ADD, 2494130561Sobrien BFD_RELOC_SPARC_TLS_IE_HI22, 2495130561Sobrien BFD_RELOC_SPARC_TLS_IE_LO10, 2496130561Sobrien BFD_RELOC_SPARC_TLS_IE_LD, 2497130561Sobrien BFD_RELOC_SPARC_TLS_IE_LDX, 2498130561Sobrien BFD_RELOC_SPARC_TLS_IE_ADD, 2499130561Sobrien BFD_RELOC_SPARC_TLS_LE_HIX22, 2500130561Sobrien BFD_RELOC_SPARC_TLS_LE_LOX10, 2501130561Sobrien BFD_RELOC_SPARC_TLS_DTPMOD32, 2502130561Sobrien BFD_RELOC_SPARC_TLS_DTPMOD64, 2503130561Sobrien BFD_RELOC_SPARC_TLS_DTPOFF32, 2504130561Sobrien BFD_RELOC_SPARC_TLS_DTPOFF64, 2505130561Sobrien BFD_RELOC_SPARC_TLS_TPOFF32, 2506130561Sobrien BFD_RELOC_SPARC_TLS_TPOFF64, 2507130561Sobrien 2508218822Sdim/* SPU Relocations. */ 2509218822Sdim BFD_RELOC_SPU_IMM7, 2510218822Sdim BFD_RELOC_SPU_IMM8, 2511218822Sdim BFD_RELOC_SPU_IMM10, 2512218822Sdim BFD_RELOC_SPU_IMM10W, 2513218822Sdim BFD_RELOC_SPU_IMM16, 2514218822Sdim BFD_RELOC_SPU_IMM16W, 2515218822Sdim BFD_RELOC_SPU_IMM18, 2516218822Sdim BFD_RELOC_SPU_PCREL9a, 2517218822Sdim BFD_RELOC_SPU_PCREL9b, 2518218822Sdim BFD_RELOC_SPU_PCREL16, 2519218822Sdim BFD_RELOC_SPU_LO16, 2520218822Sdim BFD_RELOC_SPU_HI16, 2521218822Sdim BFD_RELOC_SPU_PPU32, 2522218822Sdim BFD_RELOC_SPU_PPU64, 2523218822Sdim 252433965Sjdp/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or 252533965Sjdp"addend" in some special way. 252633965SjdpFor GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when 252733965Sjdpwriting; when reading, it will be the absolute section symbol. The 252833965Sjdpaddend is the displacement in bytes of the "lda" instruction from 252991041Sobrienthe "ldah" instruction (which is at the address of this reloc). */ 253033965Sjdp BFD_RELOC_ALPHA_GPDISP_HI16, 253133965Sjdp 253233965Sjdp/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as 253333965Sjdpwith GPDISP_HI16 relocs. The addend is ignored when writing the 253433965Sjdprelocations out, and is filled in with the file's GP value on 253591041Sobrienreading, for convenience. */ 253633965Sjdp BFD_RELOC_ALPHA_GPDISP_LO16, 253733965Sjdp 253833965Sjdp/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 253933965Sjdprelocation except that there is no accompanying GPDISP_LO16 254091041Sobrienrelocation. */ 254133965Sjdp BFD_RELOC_ALPHA_GPDISP, 254233965Sjdp 254333965Sjdp/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; 254433965Sjdpthe assembler turns it into a LDQ instruction to load the address of 254533965Sjdpthe symbol, and then fills in a register in the real instruction. 254633965Sjdp 254733965SjdpThe LITERAL reloc, at the LDQ instruction, refers to the .lita 254833965Sjdpsection symbol. The addend is ignored when writing, but is filled 254933965Sjdpin with the file's GP value on reading, for convenience, as with the 255033965SjdpGPDISP_LO16 reloc. 255133965Sjdp 255233965SjdpThe ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. 255333965SjdpIt should refer to the symbol to be referenced, as with 16_GOTOFF, 255433965Sjdpbut it generates output not based on the position within the .got 255533965Sjdpsection, but relative to the GP value chosen for the file during the 255633965Sjdpfinal link stage. 255733965Sjdp 255833965SjdpThe LITUSE reloc, on the instruction using the loaded address, gives 255933965Sjdpinformation to the linker that it might be able to use to optimize 256033965Sjdpaway some literal section references. The symbol is ignored (read 256133965Sjdpas the absolute section symbol), and the "addend" indicates the type 256233965Sjdpof instruction using the register: 256333965Sjdp1 - "memory" fmt insn 256433965Sjdp2 - byte-manipulation (byte offset reg) 256591041Sobrien3 - jsr (target of branch) */ 256633965Sjdp BFD_RELOC_ALPHA_LITERAL, 256733965Sjdp BFD_RELOC_ALPHA_ELF_LITERAL, 256833965Sjdp BFD_RELOC_ALPHA_LITUSE, 256933965Sjdp 257033965Sjdp/* The HINT relocation indicates a value that should be filled into the 257133965Sjdp"hint" field of a jmp/jsr/ret instruction, for possible branch- 257291041Sobrienprediction logic which may be provided on some processors. */ 257333965Sjdp BFD_RELOC_ALPHA_HINT, 257433965Sjdp 257533965Sjdp/* The LINKAGE relocation outputs a linkage pair in the object file, 257691041Sobrienwhich is filled by the linker. */ 257733965Sjdp BFD_RELOC_ALPHA_LINKAGE, 257833965Sjdp 257933965Sjdp/* The CODEADDR relocation outputs a STO_CA in the object file, 258091041Sobrienwhich is filled by the linker. */ 258133965Sjdp BFD_RELOC_ALPHA_CODEADDR, 258233965Sjdp 258389857Sobrien/* The GPREL_HI/LO relocations together form a 32-bit offset from the 258491041SobrienGP register. */ 258589857Sobrien BFD_RELOC_ALPHA_GPREL_HI16, 258689857Sobrien BFD_RELOC_ALPHA_GPREL_LO16, 258789857Sobrien 258891041Sobrien/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must 2589130561Sobrienshare a common GP, and the target address is adjusted for 259091041SobrienSTO_ALPHA_STD_GPLOAD. */ 259191041Sobrien BFD_RELOC_ALPHA_BRSGP, 259291041Sobrien 2593104834Sobrien/* Alpha thread-local storage relocations. */ 2594104834Sobrien BFD_RELOC_ALPHA_TLSGD, 2595104834Sobrien BFD_RELOC_ALPHA_TLSLDM, 2596104834Sobrien BFD_RELOC_ALPHA_DTPMOD64, 2597104834Sobrien BFD_RELOC_ALPHA_GOTDTPREL16, 2598104834Sobrien BFD_RELOC_ALPHA_DTPREL64, 2599104834Sobrien BFD_RELOC_ALPHA_DTPREL_HI16, 2600104834Sobrien BFD_RELOC_ALPHA_DTPREL_LO16, 2601104834Sobrien BFD_RELOC_ALPHA_DTPREL16, 2602104834Sobrien BFD_RELOC_ALPHA_GOTTPREL16, 2603104834Sobrien BFD_RELOC_ALPHA_TPREL64, 2604104834Sobrien BFD_RELOC_ALPHA_TPREL_HI16, 2605104834Sobrien BFD_RELOC_ALPHA_TPREL_LO16, 2606104834Sobrien BFD_RELOC_ALPHA_TPREL16, 2607104834Sobrien 260833965Sjdp/* Bits 27..2 of the relocation address shifted right 2 bits; 260991041Sobriensimple reloc otherwise. */ 261033965Sjdp BFD_RELOC_MIPS_JMP, 261133965Sjdp 261291041Sobrien/* The MIPS16 jump instruction. */ 261333965Sjdp BFD_RELOC_MIPS16_JMP, 261433965Sjdp 261591041Sobrien/* MIPS16 GP relative reloc. */ 261633965Sjdp BFD_RELOC_MIPS16_GPREL, 261733965Sjdp 261891041Sobrien/* High 16 bits of 32-bit value; simple reloc. */ 261933965Sjdp BFD_RELOC_HI16, 262033965Sjdp 262133965Sjdp/* High 16 bits of 32-bit value but the low 16 bits will be sign 262233965Sjdpextended and added to form the final result. If the low 16 262333965Sjdpbits form a negative number, we need to add one to the high value 262491041Sobriento compensate for the borrow when the low bits are added. */ 262533965Sjdp BFD_RELOC_HI16_S, 262633965Sjdp 262791041Sobrien/* Low 16 bits. */ 262833965Sjdp BFD_RELOC_LO16, 262933965Sjdp 2630218822Sdim/* High 16 bits of 32-bit pc-relative value */ 2631218822Sdim BFD_RELOC_HI16_PCREL, 263233965Sjdp 2633218822Sdim/* High 16 bits of 32-bit pc-relative value, adjusted */ 2634218822Sdim BFD_RELOC_HI16_S_PCREL, 263533965Sjdp 2636218822Sdim/* Low 16 bits of pc-relative value */ 2637218822Sdim BFD_RELOC_LO16_PCREL, 2638218822Sdim 2639218822Sdim/* MIPS16 high 16 bits of 32-bit value. */ 2640218822Sdim BFD_RELOC_MIPS16_HI16, 2641218822Sdim 2642218822Sdim/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign 2643218822Sdimextended and added to form the final result. If the low 16 2644218822Sdimbits form a negative number, we need to add one to the high value 2645218822Sdimto compensate for the borrow when the low bits are added. */ 2646218822Sdim BFD_RELOC_MIPS16_HI16_S, 2647218822Sdim 2648218822Sdim/* MIPS16 low 16 bits. */ 2649218822Sdim BFD_RELOC_MIPS16_LO16, 2650218822Sdim 265191041Sobrien/* Relocation against a MIPS literal section. */ 265233965Sjdp BFD_RELOC_MIPS_LITERAL, 265333965Sjdp 265491041Sobrien/* MIPS ELF relocations. */ 265533965Sjdp BFD_RELOC_MIPS_GOT16, 265633965Sjdp BFD_RELOC_MIPS_CALL16, 265733965Sjdp BFD_RELOC_MIPS_GOT_HI16, 265833965Sjdp BFD_RELOC_MIPS_GOT_LO16, 265933965Sjdp BFD_RELOC_MIPS_CALL_HI16, 266033965Sjdp BFD_RELOC_MIPS_CALL_LO16, 266160484Sobrien BFD_RELOC_MIPS_SUB, 266260484Sobrien BFD_RELOC_MIPS_GOT_PAGE, 266360484Sobrien BFD_RELOC_MIPS_GOT_OFST, 266460484Sobrien BFD_RELOC_MIPS_GOT_DISP, 266578828Sobrien BFD_RELOC_MIPS_SHIFT5, 266678828Sobrien BFD_RELOC_MIPS_SHIFT6, 266778828Sobrien BFD_RELOC_MIPS_INSERT_A, 266878828Sobrien BFD_RELOC_MIPS_INSERT_B, 266978828Sobrien BFD_RELOC_MIPS_DELETE, 267078828Sobrien BFD_RELOC_MIPS_HIGHEST, 267178828Sobrien BFD_RELOC_MIPS_HIGHER, 267278828Sobrien BFD_RELOC_MIPS_SCN_DISP, 267378828Sobrien BFD_RELOC_MIPS_REL16, 267478828Sobrien BFD_RELOC_MIPS_RELGOT, 267578828Sobrien BFD_RELOC_MIPS_JALR, 2676218822Sdim BFD_RELOC_MIPS_TLS_DTPMOD32, 2677218822Sdim BFD_RELOC_MIPS_TLS_DTPREL32, 2678218822Sdim BFD_RELOC_MIPS_TLS_DTPMOD64, 2679218822Sdim BFD_RELOC_MIPS_TLS_DTPREL64, 2680218822Sdim BFD_RELOC_MIPS_TLS_GD, 2681218822Sdim BFD_RELOC_MIPS_TLS_LDM, 2682218822Sdim BFD_RELOC_MIPS_TLS_DTPREL_HI16, 2683218822Sdim BFD_RELOC_MIPS_TLS_DTPREL_LO16, 2684218822Sdim BFD_RELOC_MIPS_TLS_GOTTPREL, 2685218822Sdim BFD_RELOC_MIPS_TLS_TPREL32, 2686218822Sdim BFD_RELOC_MIPS_TLS_TPREL64, 2687218822Sdim BFD_RELOC_MIPS_TLS_TPREL_HI16, 2688218822Sdim BFD_RELOC_MIPS_TLS_TPREL_LO16, 268933965Sjdp 2690130561Sobrien 2691218822Sdim/* MIPS ELF relocations (VxWorks extensions). */ 2692218822Sdim BFD_RELOC_MIPS_COPY, 2693218822Sdim BFD_RELOC_MIPS_JUMP_SLOT, 2694218822Sdim 2695218822Sdim 2696104834Sobrien/* Fujitsu Frv Relocations. */ 2697104834Sobrien BFD_RELOC_FRV_LABEL16, 2698104834Sobrien BFD_RELOC_FRV_LABEL24, 2699104834Sobrien BFD_RELOC_FRV_LO16, 2700104834Sobrien BFD_RELOC_FRV_HI16, 2701104834Sobrien BFD_RELOC_FRV_GPREL12, 2702104834Sobrien BFD_RELOC_FRV_GPRELU12, 2703104834Sobrien BFD_RELOC_FRV_GPREL32, 2704104834Sobrien BFD_RELOC_FRV_GPRELHI, 2705104834Sobrien BFD_RELOC_FRV_GPRELLO, 2706130561Sobrien BFD_RELOC_FRV_GOT12, 2707130561Sobrien BFD_RELOC_FRV_GOTHI, 2708130561Sobrien BFD_RELOC_FRV_GOTLO, 2709130561Sobrien BFD_RELOC_FRV_FUNCDESC, 2710130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOT12, 2711130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTHI, 2712130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTLO, 2713130561Sobrien BFD_RELOC_FRV_FUNCDESC_VALUE, 2714130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFF12, 2715130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFFHI, 2716130561Sobrien BFD_RELOC_FRV_FUNCDESC_GOTOFFLO, 2717130561Sobrien BFD_RELOC_FRV_GOTOFF12, 2718130561Sobrien BFD_RELOC_FRV_GOTOFFHI, 2719130561Sobrien BFD_RELOC_FRV_GOTOFFLO, 2720218822Sdim BFD_RELOC_FRV_GETTLSOFF, 2721218822Sdim BFD_RELOC_FRV_TLSDESC_VALUE, 2722218822Sdim BFD_RELOC_FRV_GOTTLSDESC12, 2723218822Sdim BFD_RELOC_FRV_GOTTLSDESCHI, 2724218822Sdim BFD_RELOC_FRV_GOTTLSDESCLO, 2725218822Sdim BFD_RELOC_FRV_TLSMOFF12, 2726218822Sdim BFD_RELOC_FRV_TLSMOFFHI, 2727218822Sdim BFD_RELOC_FRV_TLSMOFFLO, 2728218822Sdim BFD_RELOC_FRV_GOTTLSOFF12, 2729218822Sdim BFD_RELOC_FRV_GOTTLSOFFHI, 2730218822Sdim BFD_RELOC_FRV_GOTTLSOFFLO, 2731218822Sdim BFD_RELOC_FRV_TLSOFF, 2732218822Sdim BFD_RELOC_FRV_TLSDESC_RELAX, 2733218822Sdim BFD_RELOC_FRV_GETTLSOFF_RELAX, 2734218822Sdim BFD_RELOC_FRV_TLSOFF_RELAX, 2735218822Sdim BFD_RELOC_FRV_TLSMOFF, 273638889Sjdp 2737104834Sobrien 2738130561Sobrien/* This is a 24bit GOT-relative reloc for the mn10300. */ 2739130561Sobrien BFD_RELOC_MN10300_GOTOFF24, 2740130561Sobrien 2741130561Sobrien/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes 2742130561Sobrienin the instruction. */ 2743130561Sobrien BFD_RELOC_MN10300_GOT32, 2744130561Sobrien 2745130561Sobrien/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes 2746130561Sobrienin the instruction. */ 2747130561Sobrien BFD_RELOC_MN10300_GOT24, 2748130561Sobrien 2749130561Sobrien/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes 2750130561Sobrienin the instruction. */ 2751130561Sobrien BFD_RELOC_MN10300_GOT16, 2752130561Sobrien 2753130561Sobrien/* Copy symbol at runtime. */ 2754130561Sobrien BFD_RELOC_MN10300_COPY, 2755130561Sobrien 2756130561Sobrien/* Create GOT entry. */ 2757130561Sobrien BFD_RELOC_MN10300_GLOB_DAT, 2758130561Sobrien 2759130561Sobrien/* Create PLT entry. */ 2760130561Sobrien BFD_RELOC_MN10300_JMP_SLOT, 2761130561Sobrien 2762130561Sobrien/* Adjust by program base. */ 2763130561Sobrien BFD_RELOC_MN10300_RELATIVE, 2764130561Sobrien 2765130561Sobrien 276691041Sobrien/* i386/elf relocations */ 276733965Sjdp BFD_RELOC_386_GOT32, 276833965Sjdp BFD_RELOC_386_PLT32, 276933965Sjdp BFD_RELOC_386_COPY, 277033965Sjdp BFD_RELOC_386_GLOB_DAT, 277133965Sjdp BFD_RELOC_386_JUMP_SLOT, 277233965Sjdp BFD_RELOC_386_RELATIVE, 277333965Sjdp BFD_RELOC_386_GOTOFF, 277433965Sjdp BFD_RELOC_386_GOTPC, 2775104834Sobrien BFD_RELOC_386_TLS_TPOFF, 2776104834Sobrien BFD_RELOC_386_TLS_IE, 2777104834Sobrien BFD_RELOC_386_TLS_GOTIE, 2778104834Sobrien BFD_RELOC_386_TLS_LE, 2779104834Sobrien BFD_RELOC_386_TLS_GD, 2780104834Sobrien BFD_RELOC_386_TLS_LDM, 2781104834Sobrien BFD_RELOC_386_TLS_LDO_32, 2782104834Sobrien BFD_RELOC_386_TLS_IE_32, 2783104834Sobrien BFD_RELOC_386_TLS_LE_32, 2784104834Sobrien BFD_RELOC_386_TLS_DTPMOD32, 2785104834Sobrien BFD_RELOC_386_TLS_DTPOFF32, 2786104834Sobrien BFD_RELOC_386_TLS_TPOFF32, 2787218822Sdim BFD_RELOC_386_TLS_GOTDESC, 2788218822Sdim BFD_RELOC_386_TLS_DESC_CALL, 2789218822Sdim BFD_RELOC_386_TLS_DESC, 279033965Sjdp 279191041Sobrien/* x86-64/elf relocations */ 279277298Sobrien BFD_RELOC_X86_64_GOT32, 279377298Sobrien BFD_RELOC_X86_64_PLT32, 279477298Sobrien BFD_RELOC_X86_64_COPY, 279577298Sobrien BFD_RELOC_X86_64_GLOB_DAT, 279677298Sobrien BFD_RELOC_X86_64_JUMP_SLOT, 279777298Sobrien BFD_RELOC_X86_64_RELATIVE, 279877298Sobrien BFD_RELOC_X86_64_GOTPCREL, 279977298Sobrien BFD_RELOC_X86_64_32S, 2800130561Sobrien BFD_RELOC_X86_64_DTPMOD64, 2801130561Sobrien BFD_RELOC_X86_64_DTPOFF64, 2802130561Sobrien BFD_RELOC_X86_64_TPOFF64, 2803130561Sobrien BFD_RELOC_X86_64_TLSGD, 2804130561Sobrien BFD_RELOC_X86_64_TLSLD, 2805130561Sobrien BFD_RELOC_X86_64_DTPOFF32, 2806130561Sobrien BFD_RELOC_X86_64_GOTTPOFF, 2807130561Sobrien BFD_RELOC_X86_64_TPOFF32, 2808218822Sdim BFD_RELOC_X86_64_GOTOFF64, 2809218822Sdim BFD_RELOC_X86_64_GOTPC32, 2810218822Sdim BFD_RELOC_X86_64_GOT64, 2811218822Sdim BFD_RELOC_X86_64_GOTPCREL64, 2812218822Sdim BFD_RELOC_X86_64_GOTPC64, 2813218822Sdim BFD_RELOC_X86_64_GOTPLT64, 2814218822Sdim BFD_RELOC_X86_64_PLTOFF64, 2815218822Sdim BFD_RELOC_X86_64_GOTPC32_TLSDESC, 2816218822Sdim BFD_RELOC_X86_64_TLSDESC_CALL, 2817218822Sdim BFD_RELOC_X86_64_TLSDESC, 281877298Sobrien 281991041Sobrien/* ns32k relocations */ 282033965Sjdp BFD_RELOC_NS32K_IMM_8, 282133965Sjdp BFD_RELOC_NS32K_IMM_16, 282233965Sjdp BFD_RELOC_NS32K_IMM_32, 282333965Sjdp BFD_RELOC_NS32K_IMM_8_PCREL, 282433965Sjdp BFD_RELOC_NS32K_IMM_16_PCREL, 282533965Sjdp BFD_RELOC_NS32K_IMM_32_PCREL, 282633965Sjdp BFD_RELOC_NS32K_DISP_8, 282733965Sjdp BFD_RELOC_NS32K_DISP_16, 282833965Sjdp BFD_RELOC_NS32K_DISP_32, 282933965Sjdp BFD_RELOC_NS32K_DISP_8_PCREL, 283033965Sjdp BFD_RELOC_NS32K_DISP_16_PCREL, 283133965Sjdp BFD_RELOC_NS32K_DISP_32_PCREL, 283233965Sjdp 283391041Sobrien/* PDP11 relocations */ 283489857Sobrien BFD_RELOC_PDP11_DISP_8_PCREL, 283589857Sobrien BFD_RELOC_PDP11_DISP_6_PCREL, 283689857Sobrien 283791041Sobrien/* Picojava relocs. Not all of these appear in object files. */ 283860484Sobrien BFD_RELOC_PJ_CODE_HI16, 283960484Sobrien BFD_RELOC_PJ_CODE_LO16, 284060484Sobrien BFD_RELOC_PJ_CODE_DIR16, 284160484Sobrien BFD_RELOC_PJ_CODE_DIR32, 284260484Sobrien BFD_RELOC_PJ_CODE_REL16, 284360484Sobrien BFD_RELOC_PJ_CODE_REL32, 284460484Sobrien 284591041Sobrien/* Power(rs6000) and PowerPC relocations. */ 284633965Sjdp BFD_RELOC_PPC_B26, 284733965Sjdp BFD_RELOC_PPC_BA26, 284833965Sjdp BFD_RELOC_PPC_TOC16, 284933965Sjdp BFD_RELOC_PPC_B16, 285033965Sjdp BFD_RELOC_PPC_B16_BRTAKEN, 285133965Sjdp BFD_RELOC_PPC_B16_BRNTAKEN, 285233965Sjdp BFD_RELOC_PPC_BA16, 285333965Sjdp BFD_RELOC_PPC_BA16_BRTAKEN, 285433965Sjdp BFD_RELOC_PPC_BA16_BRNTAKEN, 285533965Sjdp BFD_RELOC_PPC_COPY, 285633965Sjdp BFD_RELOC_PPC_GLOB_DAT, 285733965Sjdp BFD_RELOC_PPC_JMP_SLOT, 285833965Sjdp BFD_RELOC_PPC_RELATIVE, 285933965Sjdp BFD_RELOC_PPC_LOCAL24PC, 286033965Sjdp BFD_RELOC_PPC_EMB_NADDR32, 286133965Sjdp BFD_RELOC_PPC_EMB_NADDR16, 286233965Sjdp BFD_RELOC_PPC_EMB_NADDR16_LO, 286333965Sjdp BFD_RELOC_PPC_EMB_NADDR16_HI, 286433965Sjdp BFD_RELOC_PPC_EMB_NADDR16_HA, 286533965Sjdp BFD_RELOC_PPC_EMB_SDAI16, 286633965Sjdp BFD_RELOC_PPC_EMB_SDA2I16, 286733965Sjdp BFD_RELOC_PPC_EMB_SDA2REL, 286833965Sjdp BFD_RELOC_PPC_EMB_SDA21, 286933965Sjdp BFD_RELOC_PPC_EMB_MRKREF, 287033965Sjdp BFD_RELOC_PPC_EMB_RELSEC16, 287133965Sjdp BFD_RELOC_PPC_EMB_RELST_LO, 287233965Sjdp BFD_RELOC_PPC_EMB_RELST_HI, 287333965Sjdp BFD_RELOC_PPC_EMB_RELST_HA, 287433965Sjdp BFD_RELOC_PPC_EMB_BIT_FLD, 287533965Sjdp BFD_RELOC_PPC_EMB_RELSDA, 287689857Sobrien BFD_RELOC_PPC64_HIGHER, 287789857Sobrien BFD_RELOC_PPC64_HIGHER_S, 287889857Sobrien BFD_RELOC_PPC64_HIGHEST, 287989857Sobrien BFD_RELOC_PPC64_HIGHEST_S, 288089857Sobrien BFD_RELOC_PPC64_TOC16_LO, 288189857Sobrien BFD_RELOC_PPC64_TOC16_HI, 288289857Sobrien BFD_RELOC_PPC64_TOC16_HA, 288389857Sobrien BFD_RELOC_PPC64_TOC, 288489857Sobrien BFD_RELOC_PPC64_PLTGOT16, 288589857Sobrien BFD_RELOC_PPC64_PLTGOT16_LO, 288689857Sobrien BFD_RELOC_PPC64_PLTGOT16_HI, 288789857Sobrien BFD_RELOC_PPC64_PLTGOT16_HA, 288889857Sobrien BFD_RELOC_PPC64_ADDR16_DS, 288989857Sobrien BFD_RELOC_PPC64_ADDR16_LO_DS, 289089857Sobrien BFD_RELOC_PPC64_GOT16_DS, 289189857Sobrien BFD_RELOC_PPC64_GOT16_LO_DS, 289289857Sobrien BFD_RELOC_PPC64_PLT16_LO_DS, 289389857Sobrien BFD_RELOC_PPC64_SECTOFF_DS, 289489857Sobrien BFD_RELOC_PPC64_SECTOFF_LO_DS, 289589857Sobrien BFD_RELOC_PPC64_TOC16_DS, 289689857Sobrien BFD_RELOC_PPC64_TOC16_LO_DS, 289789857Sobrien BFD_RELOC_PPC64_PLTGOT16_DS, 289889857Sobrien BFD_RELOC_PPC64_PLTGOT16_LO_DS, 289933965Sjdp 2900130561Sobrien/* PowerPC and PowerPC64 thread-local storage relocations. */ 2901130561Sobrien BFD_RELOC_PPC_TLS, 2902275718Sjhibbits BFD_RELOC_PPC_TLSGD, 2903275718Sjhibbits BFD_RELOC_PPC_TLSLD, 2904130561Sobrien BFD_RELOC_PPC_DTPMOD, 2905130561Sobrien BFD_RELOC_PPC_TPREL16, 2906130561Sobrien BFD_RELOC_PPC_TPREL16_LO, 2907130561Sobrien BFD_RELOC_PPC_TPREL16_HI, 2908130561Sobrien BFD_RELOC_PPC_TPREL16_HA, 2909130561Sobrien BFD_RELOC_PPC_TPREL, 2910130561Sobrien BFD_RELOC_PPC_DTPREL16, 2911130561Sobrien BFD_RELOC_PPC_DTPREL16_LO, 2912130561Sobrien BFD_RELOC_PPC_DTPREL16_HI, 2913130561Sobrien BFD_RELOC_PPC_DTPREL16_HA, 2914130561Sobrien BFD_RELOC_PPC_DTPREL, 2915130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16, 2916130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_LO, 2917130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_HI, 2918130561Sobrien BFD_RELOC_PPC_GOT_TLSGD16_HA, 2919130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16, 2920130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_LO, 2921130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_HI, 2922130561Sobrien BFD_RELOC_PPC_GOT_TLSLD16_HA, 2923130561Sobrien BFD_RELOC_PPC_GOT_TPREL16, 2924130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_LO, 2925130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_HI, 2926130561Sobrien BFD_RELOC_PPC_GOT_TPREL16_HA, 2927130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16, 2928130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_LO, 2929130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_HI, 2930130561Sobrien BFD_RELOC_PPC_GOT_DTPREL16_HA, 2931130561Sobrien BFD_RELOC_PPC64_TPREL16_DS, 2932130561Sobrien BFD_RELOC_PPC64_TPREL16_LO_DS, 2933130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHER, 2934130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHERA, 2935130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHEST, 2936130561Sobrien BFD_RELOC_PPC64_TPREL16_HIGHESTA, 2937130561Sobrien BFD_RELOC_PPC64_DTPREL16_DS, 2938130561Sobrien BFD_RELOC_PPC64_DTPREL16_LO_DS, 2939130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHER, 2940130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHERA, 2941130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHEST, 2942130561Sobrien BFD_RELOC_PPC64_DTPREL16_HIGHESTA, 2943130561Sobrien 294491041Sobrien/* IBM 370/390 relocations */ 294560484Sobrien BFD_RELOC_I370_D12, 294660484Sobrien 2947130561Sobrien/* The type of reloc used to build a constructor table - at the moment 294833965Sjdpprobably a 32 bit wide absolute relocation, but the target can choose. 294991041SobrienIt generally does map to one of the other relocation types. */ 295033965Sjdp BFD_RELOC_CTOR, 295133965Sjdp 295233965Sjdp/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are 295391041Sobriennot stored in the instruction. */ 295433965Sjdp BFD_RELOC_ARM_PCREL_BRANCH, 295533965Sjdp 295677298Sobrien/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is 295777298Sobriennot stored in the instruction. The 2nd lowest bit comes from a 1 bit 295891041Sobrienfield in the instruction. */ 295977298Sobrien BFD_RELOC_ARM_PCREL_BLX, 296077298Sobrien 296177298Sobrien/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is 296277298Sobriennot stored in the instruction. The 2nd lowest bit comes from a 1 bit 296391041Sobrienfield in the instruction. */ 296477298Sobrien BFD_RELOC_THUMB_PCREL_BLX, 296577298Sobrien 2966218822Sdim/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */ 2967218822Sdim BFD_RELOC_ARM_PCREL_CALL, 2968218822Sdim 2969218822Sdim/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ 2970218822Sdim BFD_RELOC_ARM_PCREL_JUMP, 2971218822Sdim 2972218822Sdim/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. 2973218822SdimThe lowest bit must be zero and is not stored in the instruction. 2974218822SdimNote that the corresponding ELF R_ARM_THM_JUMPnn constant has an 2975218822Sdim"nn" one smaller in all cases. Note further that BRANCH23 2976218822Sdimcorresponds to R_ARM_THM_CALL. */ 2977218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH7, 2978218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH9, 2979218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH12, 2980218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH20, 2981218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH23, 2982218822Sdim BFD_RELOC_THUMB_PCREL_BRANCH25, 2983218822Sdim 2984218822Sdim/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */ 2985218822Sdim BFD_RELOC_ARM_OFFSET_IMM, 2986218822Sdim 2987218822Sdim/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */ 2988218822Sdim BFD_RELOC_ARM_THUMB_OFFSET, 2989218822Sdim 2990218822Sdim/* Pc-relative or absolute relocation depending on target. Used for 2991218822Sdimentries in .init_array sections. */ 2992218822Sdim BFD_RELOC_ARM_TARGET1, 2993218822Sdim 2994218822Sdim/* Read-only segment base relative address. */ 2995218822Sdim BFD_RELOC_ARM_ROSEGREL32, 2996218822Sdim 2997218822Sdim/* Data segment base relative address. */ 2998218822Sdim BFD_RELOC_ARM_SBREL32, 2999218822Sdim 3000218822Sdim/* This reloc is used for references to RTTI data from exception handling 3001218822Sdimtables. The actual definition depends on the target. It may be a 3002218822Sdimpc-relative or some form of GOT-indirect relocation. */ 3003218822Sdim BFD_RELOC_ARM_TARGET2, 3004218822Sdim 3005218822Sdim/* 31-bit PC relative address. */ 3006218822Sdim BFD_RELOC_ARM_PREL31, 3007218822Sdim 3008218822Sdim/* Low and High halfword relocations for MOVW and MOVT instructions. */ 3009218822Sdim BFD_RELOC_ARM_MOVW, 3010218822Sdim BFD_RELOC_ARM_MOVT, 3011218822Sdim BFD_RELOC_ARM_MOVW_PCREL, 3012218822Sdim BFD_RELOC_ARM_MOVT_PCREL, 3013218822Sdim BFD_RELOC_ARM_THUMB_MOVW, 3014218822Sdim BFD_RELOC_ARM_THUMB_MOVT, 3015218822Sdim BFD_RELOC_ARM_THUMB_MOVW_PCREL, 3016218822Sdim BFD_RELOC_ARM_THUMB_MOVT_PCREL, 3017218822Sdim 3018218822Sdim/* Relocations for setting up GOTs and PLTs for shared libraries. */ 3019218822Sdim BFD_RELOC_ARM_JUMP_SLOT, 3020218822Sdim BFD_RELOC_ARM_GLOB_DAT, 3021218822Sdim BFD_RELOC_ARM_GOT32, 3022218822Sdim BFD_RELOC_ARM_PLT32, 3023218822Sdim BFD_RELOC_ARM_RELATIVE, 3024218822Sdim BFD_RELOC_ARM_GOTOFF, 3025218822Sdim BFD_RELOC_ARM_GOTPC, 3026218822Sdim 3027218822Sdim/* ARM thread-local storage relocations. */ 3028218822Sdim BFD_RELOC_ARM_TLS_GD32, 3029218822Sdim BFD_RELOC_ARM_TLS_LDO32, 3030218822Sdim BFD_RELOC_ARM_TLS_LDM32, 3031218822Sdim BFD_RELOC_ARM_TLS_DTPOFF32, 3032218822Sdim BFD_RELOC_ARM_TLS_DTPMOD32, 3033218822Sdim BFD_RELOC_ARM_TLS_TPOFF32, 3034218822Sdim BFD_RELOC_ARM_TLS_IE32, 3035218822Sdim BFD_RELOC_ARM_TLS_LE32, 3036218822Sdim 3037218822Sdim/* ARM group relocations. */ 3038218822Sdim BFD_RELOC_ARM_ALU_PC_G0_NC, 3039218822Sdim BFD_RELOC_ARM_ALU_PC_G0, 3040218822Sdim BFD_RELOC_ARM_ALU_PC_G1_NC, 3041218822Sdim BFD_RELOC_ARM_ALU_PC_G1, 3042218822Sdim BFD_RELOC_ARM_ALU_PC_G2, 3043218822Sdim BFD_RELOC_ARM_LDR_PC_G0, 3044218822Sdim BFD_RELOC_ARM_LDR_PC_G1, 3045218822Sdim BFD_RELOC_ARM_LDR_PC_G2, 3046218822Sdim BFD_RELOC_ARM_LDRS_PC_G0, 3047218822Sdim BFD_RELOC_ARM_LDRS_PC_G1, 3048218822Sdim BFD_RELOC_ARM_LDRS_PC_G2, 3049218822Sdim BFD_RELOC_ARM_LDC_PC_G0, 3050218822Sdim BFD_RELOC_ARM_LDC_PC_G1, 3051218822Sdim BFD_RELOC_ARM_LDC_PC_G2, 3052218822Sdim BFD_RELOC_ARM_ALU_SB_G0_NC, 3053218822Sdim BFD_RELOC_ARM_ALU_SB_G0, 3054218822Sdim BFD_RELOC_ARM_ALU_SB_G1_NC, 3055218822Sdim BFD_RELOC_ARM_ALU_SB_G1, 3056218822Sdim BFD_RELOC_ARM_ALU_SB_G2, 3057218822Sdim BFD_RELOC_ARM_LDR_SB_G0, 3058218822Sdim BFD_RELOC_ARM_LDR_SB_G1, 3059218822Sdim BFD_RELOC_ARM_LDR_SB_G2, 3060218822Sdim BFD_RELOC_ARM_LDRS_SB_G0, 3061218822Sdim BFD_RELOC_ARM_LDRS_SB_G1, 3062218822Sdim BFD_RELOC_ARM_LDRS_SB_G2, 3063218822Sdim BFD_RELOC_ARM_LDC_SB_G0, 3064218822Sdim BFD_RELOC_ARM_LDC_SB_G1, 3065218822Sdim BFD_RELOC_ARM_LDC_SB_G2, 3066218822Sdim 306733965Sjdp/* These relocs are only used within the ARM assembler. They are not 306891041Sobrien(at present) written to any object files. */ 306933965Sjdp BFD_RELOC_ARM_IMMEDIATE, 307060484Sobrien BFD_RELOC_ARM_ADRL_IMMEDIATE, 3071218822Sdim BFD_RELOC_ARM_T32_IMMEDIATE, 3072218822Sdim BFD_RELOC_ARM_T32_ADD_IMM, 3073218822Sdim BFD_RELOC_ARM_T32_IMM12, 3074218822Sdim BFD_RELOC_ARM_T32_ADD_PC12, 307533965Sjdp BFD_RELOC_ARM_SHIFT_IMM, 3076218822Sdim BFD_RELOC_ARM_SMC, 307733965Sjdp BFD_RELOC_ARM_SWI, 307833965Sjdp BFD_RELOC_ARM_MULTI, 307933965Sjdp BFD_RELOC_ARM_CP_OFF_IMM, 3080130561Sobrien BFD_RELOC_ARM_CP_OFF_IMM_S2, 3081218822Sdim BFD_RELOC_ARM_T32_CP_OFF_IMM, 3082218822Sdim BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, 308333965Sjdp BFD_RELOC_ARM_ADR_IMM, 308433965Sjdp BFD_RELOC_ARM_LDR_IMM, 308533965Sjdp BFD_RELOC_ARM_LITERAL, 308633965Sjdp BFD_RELOC_ARM_IN_POOL, 308733965Sjdp BFD_RELOC_ARM_OFFSET_IMM8, 3088218822Sdim BFD_RELOC_ARM_T32_OFFSET_U8, 3089218822Sdim BFD_RELOC_ARM_T32_OFFSET_IMM, 309033965Sjdp BFD_RELOC_ARM_HWLITERAL, 309133965Sjdp BFD_RELOC_ARM_THUMB_ADD, 309233965Sjdp BFD_RELOC_ARM_THUMB_IMM, 309333965Sjdp BFD_RELOC_ARM_THUMB_SHIFT, 309433965Sjdp 3095130561Sobrien/* Renesas / SuperH SH relocs. Not all of these appear in object files. */ 309633965Sjdp BFD_RELOC_SH_PCDISP8BY2, 309733965Sjdp BFD_RELOC_SH_PCDISP12BY2, 3098218822Sdim BFD_RELOC_SH_IMM3, 3099218822Sdim BFD_RELOC_SH_IMM3U, 3100218822Sdim BFD_RELOC_SH_DISP12, 3101218822Sdim BFD_RELOC_SH_DISP12BY2, 3102218822Sdim BFD_RELOC_SH_DISP12BY4, 3103218822Sdim BFD_RELOC_SH_DISP12BY8, 3104218822Sdim BFD_RELOC_SH_DISP20, 3105218822Sdim BFD_RELOC_SH_DISP20BY8, 310633965Sjdp BFD_RELOC_SH_IMM4, 310733965Sjdp BFD_RELOC_SH_IMM4BY2, 310833965Sjdp BFD_RELOC_SH_IMM4BY4, 310933965Sjdp BFD_RELOC_SH_IMM8, 311033965Sjdp BFD_RELOC_SH_IMM8BY2, 311133965Sjdp BFD_RELOC_SH_IMM8BY4, 311233965Sjdp BFD_RELOC_SH_PCRELIMM8BY2, 311333965Sjdp BFD_RELOC_SH_PCRELIMM8BY4, 311433965Sjdp BFD_RELOC_SH_SWITCH16, 311533965Sjdp BFD_RELOC_SH_SWITCH32, 311633965Sjdp BFD_RELOC_SH_USES, 311733965Sjdp BFD_RELOC_SH_COUNT, 311833965Sjdp BFD_RELOC_SH_ALIGN, 311933965Sjdp BFD_RELOC_SH_CODE, 312033965Sjdp BFD_RELOC_SH_DATA, 312133965Sjdp BFD_RELOC_SH_LABEL, 312277298Sobrien BFD_RELOC_SH_LOOP_START, 312377298Sobrien BFD_RELOC_SH_LOOP_END, 312477298Sobrien BFD_RELOC_SH_COPY, 312577298Sobrien BFD_RELOC_SH_GLOB_DAT, 312677298Sobrien BFD_RELOC_SH_JMP_SLOT, 312777298Sobrien BFD_RELOC_SH_RELATIVE, 312877298Sobrien BFD_RELOC_SH_GOTPC, 312999461Sobrien BFD_RELOC_SH_GOT_LOW16, 313099461Sobrien BFD_RELOC_SH_GOT_MEDLOW16, 313199461Sobrien BFD_RELOC_SH_GOT_MEDHI16, 313299461Sobrien BFD_RELOC_SH_GOT_HI16, 313399461Sobrien BFD_RELOC_SH_GOTPLT_LOW16, 313499461Sobrien BFD_RELOC_SH_GOTPLT_MEDLOW16, 313599461Sobrien BFD_RELOC_SH_GOTPLT_MEDHI16, 313699461Sobrien BFD_RELOC_SH_GOTPLT_HI16, 313799461Sobrien BFD_RELOC_SH_PLT_LOW16, 313899461Sobrien BFD_RELOC_SH_PLT_MEDLOW16, 313999461Sobrien BFD_RELOC_SH_PLT_MEDHI16, 314099461Sobrien BFD_RELOC_SH_PLT_HI16, 314199461Sobrien BFD_RELOC_SH_GOTOFF_LOW16, 314299461Sobrien BFD_RELOC_SH_GOTOFF_MEDLOW16, 314399461Sobrien BFD_RELOC_SH_GOTOFF_MEDHI16, 314499461Sobrien BFD_RELOC_SH_GOTOFF_HI16, 314599461Sobrien BFD_RELOC_SH_GOTPC_LOW16, 314699461Sobrien BFD_RELOC_SH_GOTPC_MEDLOW16, 314799461Sobrien BFD_RELOC_SH_GOTPC_MEDHI16, 314899461Sobrien BFD_RELOC_SH_GOTPC_HI16, 314999461Sobrien BFD_RELOC_SH_COPY64, 315099461Sobrien BFD_RELOC_SH_GLOB_DAT64, 315199461Sobrien BFD_RELOC_SH_JMP_SLOT64, 315299461Sobrien BFD_RELOC_SH_RELATIVE64, 315399461Sobrien BFD_RELOC_SH_GOT10BY4, 315499461Sobrien BFD_RELOC_SH_GOT10BY8, 315599461Sobrien BFD_RELOC_SH_GOTPLT10BY4, 315699461Sobrien BFD_RELOC_SH_GOTPLT10BY8, 315799461Sobrien BFD_RELOC_SH_GOTPLT32, 315899461Sobrien BFD_RELOC_SH_SHMEDIA_CODE, 315999461Sobrien BFD_RELOC_SH_IMMU5, 316099461Sobrien BFD_RELOC_SH_IMMS6, 316199461Sobrien BFD_RELOC_SH_IMMS6BY32, 316299461Sobrien BFD_RELOC_SH_IMMU6, 316399461Sobrien BFD_RELOC_SH_IMMS10, 316499461Sobrien BFD_RELOC_SH_IMMS10BY2, 316599461Sobrien BFD_RELOC_SH_IMMS10BY4, 316699461Sobrien BFD_RELOC_SH_IMMS10BY8, 316799461Sobrien BFD_RELOC_SH_IMMS16, 316899461Sobrien BFD_RELOC_SH_IMMU16, 316999461Sobrien BFD_RELOC_SH_IMM_LOW16, 317099461Sobrien BFD_RELOC_SH_IMM_LOW16_PCREL, 317199461Sobrien BFD_RELOC_SH_IMM_MEDLOW16, 317299461Sobrien BFD_RELOC_SH_IMM_MEDLOW16_PCREL, 317399461Sobrien BFD_RELOC_SH_IMM_MEDHI16, 317499461Sobrien BFD_RELOC_SH_IMM_MEDHI16_PCREL, 317599461Sobrien BFD_RELOC_SH_IMM_HI16, 317699461Sobrien BFD_RELOC_SH_IMM_HI16_PCREL, 317799461Sobrien BFD_RELOC_SH_PT_16, 3178130561Sobrien BFD_RELOC_SH_TLS_GD_32, 3179130561Sobrien BFD_RELOC_SH_TLS_LD_32, 3180130561Sobrien BFD_RELOC_SH_TLS_LDO_32, 3181130561Sobrien BFD_RELOC_SH_TLS_IE_32, 3182130561Sobrien BFD_RELOC_SH_TLS_LE_32, 3183130561Sobrien BFD_RELOC_SH_TLS_DTPMOD32, 3184130561Sobrien BFD_RELOC_SH_TLS_DTPOFF32, 3185130561Sobrien BFD_RELOC_SH_TLS_TPOFF32, 318633965Sjdp 318777298Sobrien/* ARC Cores relocs. 318838889SjdpARC 22 bit pc-relative branch. The lowest two bits must be zero and are 318938889Sjdpnot stored in the instruction. The high 20 bits are installed in bits 26 319091041Sobrienthrough 7 of the instruction. */ 319138889Sjdp BFD_RELOC_ARC_B22_PCREL, 319238889Sjdp 319338889Sjdp/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not 319438889Sjdpstored in the instruction. The high 24 bits are installed in bits 23 319591041Sobrienthrough 0. */ 319638889Sjdp BFD_RELOC_ARC_B26, 319738889Sjdp 3198218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc. */ 3199218822Sdim BFD_RELOC_BFIN_16_IMM, 3200218822Sdim 3201218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */ 3202218822Sdim BFD_RELOC_BFIN_16_HIGH, 3203218822Sdim 3204218822Sdim/* ADI Blackfin 'a' part of LSETUP. */ 3205218822Sdim BFD_RELOC_BFIN_4_PCREL, 3206218822Sdim 3207218822Sdim/* ADI Blackfin. */ 3208218822Sdim BFD_RELOC_BFIN_5_PCREL, 3209218822Sdim 3210218822Sdim/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */ 3211218822Sdim BFD_RELOC_BFIN_16_LOW, 3212218822Sdim 3213218822Sdim/* ADI Blackfin. */ 3214218822Sdim BFD_RELOC_BFIN_10_PCREL, 3215218822Sdim 3216218822Sdim/* ADI Blackfin 'b' part of LSETUP. */ 3217218822Sdim BFD_RELOC_BFIN_11_PCREL, 3218218822Sdim 3219218822Sdim/* ADI Blackfin. */ 3220218822Sdim BFD_RELOC_BFIN_12_PCREL_JUMP, 3221218822Sdim 3222218822Sdim/* ADI Blackfin Short jump, pcrel. */ 3223218822Sdim BFD_RELOC_BFIN_12_PCREL_JUMP_S, 3224218822Sdim 3225218822Sdim/* ADI Blackfin Call.x not implemented. */ 3226218822Sdim BFD_RELOC_BFIN_24_PCREL_CALL_X, 3227218822Sdim 3228218822Sdim/* ADI Blackfin Long Jump pcrel. */ 3229218822Sdim BFD_RELOC_BFIN_24_PCREL_JUMP_L, 3230218822Sdim 3231218822Sdim/* ADI Blackfin FD-PIC relocations. */ 3232218822Sdim BFD_RELOC_BFIN_GOT17M4, 3233218822Sdim BFD_RELOC_BFIN_GOTHI, 3234218822Sdim BFD_RELOC_BFIN_GOTLO, 3235218822Sdim BFD_RELOC_BFIN_FUNCDESC, 3236218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOT17M4, 3237218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTHI, 3238218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTLO, 3239218822Sdim BFD_RELOC_BFIN_FUNCDESC_VALUE, 3240218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, 3241218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, 3242218822Sdim BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, 3243218822Sdim BFD_RELOC_BFIN_GOTOFF17M4, 3244218822Sdim BFD_RELOC_BFIN_GOTOFFHI, 3245218822Sdim BFD_RELOC_BFIN_GOTOFFLO, 3246218822Sdim 3247218822Sdim/* ADI Blackfin GOT relocation. */ 3248218822Sdim BFD_RELOC_BFIN_GOT, 3249218822Sdim 3250218822Sdim/* ADI Blackfin PLTPC relocation. */ 3251218822Sdim BFD_RELOC_BFIN_PLTPC, 3252218822Sdim 3253218822Sdim/* ADI Blackfin arithmetic relocation. */ 3254218822Sdim BFD_ARELOC_BFIN_PUSH, 3255218822Sdim 3256218822Sdim/* ADI Blackfin arithmetic relocation. */ 3257218822Sdim BFD_ARELOC_BFIN_CONST, 3258218822Sdim 3259218822Sdim/* ADI Blackfin arithmetic relocation. */ 3260218822Sdim BFD_ARELOC_BFIN_ADD, 3261218822Sdim 3262218822Sdim/* ADI Blackfin arithmetic relocation. */ 3263218822Sdim BFD_ARELOC_BFIN_SUB, 3264218822Sdim 3265218822Sdim/* ADI Blackfin arithmetic relocation. */ 3266218822Sdim BFD_ARELOC_BFIN_MULT, 3267218822Sdim 3268218822Sdim/* ADI Blackfin arithmetic relocation. */ 3269218822Sdim BFD_ARELOC_BFIN_DIV, 3270218822Sdim 3271218822Sdim/* ADI Blackfin arithmetic relocation. */ 3272218822Sdim BFD_ARELOC_BFIN_MOD, 3273218822Sdim 3274218822Sdim/* ADI Blackfin arithmetic relocation. */ 3275218822Sdim BFD_ARELOC_BFIN_LSHIFT, 3276218822Sdim 3277218822Sdim/* ADI Blackfin arithmetic relocation. */ 3278218822Sdim BFD_ARELOC_BFIN_RSHIFT, 3279218822Sdim 3280218822Sdim/* ADI Blackfin arithmetic relocation. */ 3281218822Sdim BFD_ARELOC_BFIN_AND, 3282218822Sdim 3283218822Sdim/* ADI Blackfin arithmetic relocation. */ 3284218822Sdim BFD_ARELOC_BFIN_OR, 3285218822Sdim 3286218822Sdim/* ADI Blackfin arithmetic relocation. */ 3287218822Sdim BFD_ARELOC_BFIN_XOR, 3288218822Sdim 3289218822Sdim/* ADI Blackfin arithmetic relocation. */ 3290218822Sdim BFD_ARELOC_BFIN_LAND, 3291218822Sdim 3292218822Sdim/* ADI Blackfin arithmetic relocation. */ 3293218822Sdim BFD_ARELOC_BFIN_LOR, 3294218822Sdim 3295218822Sdim/* ADI Blackfin arithmetic relocation. */ 3296218822Sdim BFD_ARELOC_BFIN_LEN, 3297218822Sdim 3298218822Sdim/* ADI Blackfin arithmetic relocation. */ 3299218822Sdim BFD_ARELOC_BFIN_NEG, 3300218822Sdim 3301218822Sdim/* ADI Blackfin arithmetic relocation. */ 3302218822Sdim BFD_ARELOC_BFIN_COMP, 3303218822Sdim 3304218822Sdim/* ADI Blackfin arithmetic relocation. */ 3305218822Sdim BFD_ARELOC_BFIN_PAGE, 3306218822Sdim 3307218822Sdim/* ADI Blackfin arithmetic relocation. */ 3308218822Sdim BFD_ARELOC_BFIN_HWPAGE, 3309218822Sdim 3310218822Sdim/* ADI Blackfin arithmetic relocation. */ 3311218822Sdim BFD_ARELOC_BFIN_ADDR, 3312218822Sdim 331333965Sjdp/* Mitsubishi D10V relocs. 331433965SjdpThis is a 10-bit reloc with the right 2 bits 331591041Sobrienassumed to be 0. */ 331633965Sjdp BFD_RELOC_D10V_10_PCREL_R, 331733965Sjdp 331833965Sjdp/* Mitsubishi D10V relocs. 331933965SjdpThis is a 10-bit reloc with the right 2 bits 332033965Sjdpassumed to be 0. This is the same as the previous reloc 332133965Sjdpexcept it is in the left container, i.e., 332291041Sobrienshifted left 15 bits. */ 332333965Sjdp BFD_RELOC_D10V_10_PCREL_L, 332433965Sjdp 332533965Sjdp/* This is an 18-bit reloc with the right 2 bits 332691041Sobrienassumed to be 0. */ 332733965Sjdp BFD_RELOC_D10V_18, 332833965Sjdp 332933965Sjdp/* This is an 18-bit reloc with the right 2 bits 333091041Sobrienassumed to be 0. */ 333133965Sjdp BFD_RELOC_D10V_18_PCREL, 333233965Sjdp 333360484Sobrien/* Mitsubishi D30V relocs. 333491041SobrienThis is a 6-bit absolute reloc. */ 333560484Sobrien BFD_RELOC_D30V_6, 333633965Sjdp 333760484Sobrien/* This is a 6-bit pc-relative reloc with 333891041Sobrienthe right 3 bits assumed to be 0. */ 333960484Sobrien BFD_RELOC_D30V_9_PCREL, 334033965Sjdp 334160484Sobrien/* This is a 6-bit pc-relative reloc with 334260484Sobrienthe right 3 bits assumed to be 0. Same 334360484Sobrienas the previous reloc but on the right side 334491041Sobrienof the container. */ 334560484Sobrien BFD_RELOC_D30V_9_PCREL_R, 334660484Sobrien 334760484Sobrien/* This is a 12-bit absolute reloc with the 334891041Sobrienright 3 bitsassumed to be 0. */ 334960484Sobrien BFD_RELOC_D30V_15, 335060484Sobrien 335160484Sobrien/* This is a 12-bit pc-relative reloc with 335291041Sobrienthe right 3 bits assumed to be 0. */ 335360484Sobrien BFD_RELOC_D30V_15_PCREL, 335460484Sobrien 335560484Sobrien/* This is a 12-bit pc-relative reloc with 335660484Sobrienthe right 3 bits assumed to be 0. Same 335760484Sobrienas the previous reloc but on the right side 335891041Sobrienof the container. */ 335960484Sobrien BFD_RELOC_D30V_15_PCREL_R, 336060484Sobrien 336160484Sobrien/* This is an 18-bit absolute reloc with 336291041Sobrienthe right 3 bits assumed to be 0. */ 336360484Sobrien BFD_RELOC_D30V_21, 336460484Sobrien 336560484Sobrien/* This is an 18-bit pc-relative reloc with 336691041Sobrienthe right 3 bits assumed to be 0. */ 336760484Sobrien BFD_RELOC_D30V_21_PCREL, 336860484Sobrien 336960484Sobrien/* This is an 18-bit pc-relative reloc with 337060484Sobrienthe right 3 bits assumed to be 0. Same 337160484Sobrienas the previous reloc but on the right side 337291041Sobrienof the container. */ 337360484Sobrien BFD_RELOC_D30V_21_PCREL_R, 337460484Sobrien 337591041Sobrien/* This is a 32-bit absolute reloc. */ 337660484Sobrien BFD_RELOC_D30V_32, 337760484Sobrien 337891041Sobrien/* This is a 32-bit pc-relative reloc. */ 337960484Sobrien BFD_RELOC_D30V_32_PCREL, 338060484Sobrien 3381104834Sobrien/* DLX relocs */ 3382104834Sobrien BFD_RELOC_DLX_HI16_S, 3383104834Sobrien 3384104834Sobrien/* DLX relocs */ 3385104834Sobrien BFD_RELOC_DLX_LO16, 3386104834Sobrien 3387104834Sobrien/* DLX relocs */ 3388104834Sobrien BFD_RELOC_DLX_JMP26, 3389104834Sobrien 3390218822Sdim/* Renesas M16C/M32C Relocations. */ 3391218822Sdim BFD_RELOC_M32C_HI8, 3392218822Sdim BFD_RELOC_M32C_RL_JUMP, 3393218822Sdim BFD_RELOC_M32C_RL_1ADDR, 3394218822Sdim BFD_RELOC_M32C_RL_2ADDR, 3395218822Sdim 3396130561Sobrien/* Renesas M32R (formerly Mitsubishi M32R) relocs. 339791041SobrienThis is a 24 bit absolute address. */ 339833965Sjdp BFD_RELOC_M32R_24, 339933965Sjdp 340091041Sobrien/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */ 340133965Sjdp BFD_RELOC_M32R_10_PCREL, 340233965Sjdp 340391041Sobrien/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */ 340433965Sjdp BFD_RELOC_M32R_18_PCREL, 340533965Sjdp 340691041Sobrien/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */ 340733965Sjdp BFD_RELOC_M32R_26_PCREL, 340833965Sjdp 340933965Sjdp/* This is a 16-bit reloc containing the high 16 bits of an address 341091041Sobrienused when the lower 16 bits are treated as unsigned. */ 341133965Sjdp BFD_RELOC_M32R_HI16_ULO, 341233965Sjdp 341333965Sjdp/* This is a 16-bit reloc containing the high 16 bits of an address 341491041Sobrienused when the lower 16 bits are treated as signed. */ 341533965Sjdp BFD_RELOC_M32R_HI16_SLO, 341633965Sjdp 341791041Sobrien/* This is a 16-bit reloc containing the lower 16 bits of an address. */ 341833965Sjdp BFD_RELOC_M32R_LO16, 341933965Sjdp 342033965Sjdp/* This is a 16-bit reloc containing the small data area offset for use in 342191041Sobrienadd3, load, and store instructions. */ 342233965Sjdp BFD_RELOC_M32R_SDA16, 342333965Sjdp 3424130561Sobrien/* For PIC. */ 3425130561Sobrien BFD_RELOC_M32R_GOT24, 3426130561Sobrien BFD_RELOC_M32R_26_PLTREL, 3427130561Sobrien BFD_RELOC_M32R_COPY, 3428130561Sobrien BFD_RELOC_M32R_GLOB_DAT, 3429130561Sobrien BFD_RELOC_M32R_JMP_SLOT, 3430130561Sobrien BFD_RELOC_M32R_RELATIVE, 3431130561Sobrien BFD_RELOC_M32R_GOTOFF, 3432218822Sdim BFD_RELOC_M32R_GOTOFF_HI_ULO, 3433218822Sdim BFD_RELOC_M32R_GOTOFF_HI_SLO, 3434218822Sdim BFD_RELOC_M32R_GOTOFF_LO, 3435130561Sobrien BFD_RELOC_M32R_GOTPC24, 3436130561Sobrien BFD_RELOC_M32R_GOT16_HI_ULO, 3437130561Sobrien BFD_RELOC_M32R_GOT16_HI_SLO, 3438130561Sobrien BFD_RELOC_M32R_GOT16_LO, 3439130561Sobrien BFD_RELOC_M32R_GOTPC_HI_ULO, 3440130561Sobrien BFD_RELOC_M32R_GOTPC_HI_SLO, 3441130561Sobrien BFD_RELOC_M32R_GOTPC_LO, 3442130561Sobrien 344391041Sobrien/* This is a 9-bit reloc */ 344438889Sjdp BFD_RELOC_V850_9_PCREL, 344533965Sjdp 344691041Sobrien/* This is a 22-bit reloc */ 344738889Sjdp BFD_RELOC_V850_22_PCREL, 344838889Sjdp 344991041Sobrien/* This is a 16 bit offset from the short data area pointer. */ 345038889Sjdp BFD_RELOC_V850_SDA_16_16_OFFSET, 345138889Sjdp 345238889Sjdp/* This is a 16 bit offset (of which only 15 bits are used) from the 345391041Sobrienshort data area pointer. */ 345438889Sjdp BFD_RELOC_V850_SDA_15_16_OFFSET, 345538889Sjdp 345691041Sobrien/* This is a 16 bit offset from the zero data area pointer. */ 345738889Sjdp BFD_RELOC_V850_ZDA_16_16_OFFSET, 345838889Sjdp 345938889Sjdp/* This is a 16 bit offset (of which only 15 bits are used) from the 346091041Sobrienzero data area pointer. */ 346138889Sjdp BFD_RELOC_V850_ZDA_15_16_OFFSET, 346238889Sjdp 346338889Sjdp/* This is an 8 bit offset (of which only 6 bits are used) from the 346491041Sobrientiny data area pointer. */ 346538889Sjdp BFD_RELOC_V850_TDA_6_8_OFFSET, 346638889Sjdp 346738889Sjdp/* This is an 8bit offset (of which only 7 bits are used) from the tiny 346891041Sobriendata area pointer. */ 346938889Sjdp BFD_RELOC_V850_TDA_7_8_OFFSET, 347038889Sjdp 347191041Sobrien/* This is a 7 bit offset from the tiny data area pointer. */ 347238889Sjdp BFD_RELOC_V850_TDA_7_7_OFFSET, 347338889Sjdp 347491041Sobrien/* This is a 16 bit offset from the tiny data area pointer. */ 347538889Sjdp BFD_RELOC_V850_TDA_16_16_OFFSET, 347638889Sjdp 347760484Sobrien/* This is a 5 bit offset (of which only 4 bits are used) from the tiny 347891041Sobriendata area pointer. */ 347960484Sobrien BFD_RELOC_V850_TDA_4_5_OFFSET, 348038889Sjdp 348191041Sobrien/* This is a 4 bit offset from the tiny data area pointer. */ 348260484Sobrien BFD_RELOC_V850_TDA_4_4_OFFSET, 348360484Sobrien 348460484Sobrien/* This is a 16 bit offset from the short data area pointer, with the 3485130561Sobrienbits placed non-contiguously in the instruction. */ 348660484Sobrien BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, 348760484Sobrien 348860484Sobrien/* This is a 16 bit offset from the zero data area pointer, with the 3489130561Sobrienbits placed non-contiguously in the instruction. */ 349060484Sobrien BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, 349160484Sobrien 349291041Sobrien/* This is a 6 bit offset from the call table base pointer. */ 349360484Sobrien BFD_RELOC_V850_CALLT_6_7_OFFSET, 349460484Sobrien 349591041Sobrien/* This is a 16 bit offset from the call table base pointer. */ 349660484Sobrien BFD_RELOC_V850_CALLT_16_16_OFFSET, 349760484Sobrien 3498130561Sobrien/* Used for relaxing indirect function calls. */ 3499130561Sobrien BFD_RELOC_V850_LONGCALL, 350060484Sobrien 3501130561Sobrien/* Used for relaxing indirect jumps. */ 3502130561Sobrien BFD_RELOC_V850_LONGJUMP, 3503130561Sobrien 3504130561Sobrien/* Used to maintain alignment whilst relaxing. */ 3505130561Sobrien BFD_RELOC_V850_ALIGN, 3506130561Sobrien 3507218822Sdim/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu 3508218822Sdiminstructions. */ 3509218822Sdim BFD_RELOC_V850_LO16_SPLIT_OFFSET, 3510218822Sdim 351133965Sjdp/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the 351291041Sobrieninstruction. */ 351333965Sjdp BFD_RELOC_MN10300_32_PCREL, 351433965Sjdp 351533965Sjdp/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the 351691041Sobrieninstruction. */ 351733965Sjdp BFD_RELOC_MN10300_16_PCREL, 351838889Sjdp 351938889Sjdp/* This is a 8bit DP reloc for the tms320c30, where the most 352038889Sjdpsignificant 8 bits of a 24 bit word are placed into the least 352191041Sobriensignificant 8 bits of the opcode. */ 352238889Sjdp BFD_RELOC_TIC30_LDP, 352360484Sobrien 352477298Sobrien/* This is a 7bit reloc for the tms320c54x, where the least 352577298Sobriensignificant 7 bits of a 16 bit word are placed into the least 352691041Sobriensignificant 7 bits of the opcode. */ 352777298Sobrien BFD_RELOC_TIC54X_PARTLS7, 352877298Sobrien 352977298Sobrien/* This is a 9bit DP reloc for the tms320c54x, where the most 353077298Sobriensignificant 9 bits of a 16 bit word are placed into the least 353191041Sobriensignificant 9 bits of the opcode. */ 353277298Sobrien BFD_RELOC_TIC54X_PARTMS9, 353377298Sobrien 353491041Sobrien/* This is an extended address 23-bit reloc for the tms320c54x. */ 353577298Sobrien BFD_RELOC_TIC54X_23, 353677298Sobrien 353777298Sobrien/* This is a 16-bit reloc for the tms320c54x, where the least 353877298Sobriensignificant 16 bits of a 23-bit extended address are placed into 353991041Sobrienthe opcode. */ 354077298Sobrien BFD_RELOC_TIC54X_16_OF_23, 354177298Sobrien 354277298Sobrien/* This is a reloc for the tms320c54x, where the most 354377298Sobriensignificant 7 bits of a 23-bit extended address are placed into 354491041Sobrienthe opcode. */ 354577298Sobrien BFD_RELOC_TIC54X_MS7_OF_23, 354677298Sobrien 354791041Sobrien/* This is a 48 bit reloc for the FR30 that stores 32 bits. */ 354860484Sobrien BFD_RELOC_FR30_48, 354960484Sobrien 355060484Sobrien/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into 355191041Sobrientwo sections. */ 355260484Sobrien BFD_RELOC_FR30_20, 355360484Sobrien 355460484Sobrien/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in 355591041Sobrien4 bits. */ 355660484Sobrien BFD_RELOC_FR30_6_IN_4, 355760484Sobrien 355860484Sobrien/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset 355991041Sobrieninto 8 bits. */ 356060484Sobrien BFD_RELOC_FR30_8_IN_8, 356160484Sobrien 356260484Sobrien/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset 356391041Sobrieninto 8 bits. */ 356460484Sobrien BFD_RELOC_FR30_9_IN_8, 356560484Sobrien 356660484Sobrien/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset 356791041Sobrieninto 8 bits. */ 356860484Sobrien BFD_RELOC_FR30_10_IN_8, 356960484Sobrien 357060484Sobrien/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 357191041Sobrienshort offset into 8 bits. */ 357260484Sobrien BFD_RELOC_FR30_9_PCREL, 357360484Sobrien 357460484Sobrien/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative 357591041Sobrienshort offset into 11 bits. */ 357660484Sobrien BFD_RELOC_FR30_12_PCREL, 357760484Sobrien 357891041Sobrien/* Motorola Mcore relocations. */ 357960484Sobrien BFD_RELOC_MCORE_PCREL_IMM8BY4, 358060484Sobrien BFD_RELOC_MCORE_PCREL_IMM11BY2, 358160484Sobrien BFD_RELOC_MCORE_PCREL_IMM4BY2, 358260484Sobrien BFD_RELOC_MCORE_PCREL_32, 358360484Sobrien BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, 358460484Sobrien BFD_RELOC_MCORE_RVA, 358560484Sobrien 3586218822Sdim/* Toshiba Media Processor Relocations. */ 3587218822Sdim BFD_RELOC_MEP_8, 3588218822Sdim BFD_RELOC_MEP_16, 3589218822Sdim BFD_RELOC_MEP_32, 3590218822Sdim BFD_RELOC_MEP_PCREL8A2, 3591218822Sdim BFD_RELOC_MEP_PCREL12A2, 3592218822Sdim BFD_RELOC_MEP_PCREL17A2, 3593218822Sdim BFD_RELOC_MEP_PCREL24A2, 3594218822Sdim BFD_RELOC_MEP_PCABS24A2, 3595218822Sdim BFD_RELOC_MEP_LOW16, 3596218822Sdim BFD_RELOC_MEP_HI16U, 3597218822Sdim BFD_RELOC_MEP_HI16S, 3598218822Sdim BFD_RELOC_MEP_GPREL, 3599218822Sdim BFD_RELOC_MEP_TPREL, 3600218822Sdim BFD_RELOC_MEP_TPREL7, 3601218822Sdim BFD_RELOC_MEP_TPREL7A2, 3602218822Sdim BFD_RELOC_MEP_TPREL7A4, 3603218822Sdim BFD_RELOC_MEP_UIMM24, 3604218822Sdim BFD_RELOC_MEP_ADDR24A4, 3605218822Sdim BFD_RELOC_MEP_GNU_VTINHERIT, 3606218822Sdim BFD_RELOC_MEP_GNU_VTENTRY, 3607218822Sdim 3608218822Sdim 360991041Sobrien/* These are relocations for the GETA instruction. */ 361089857Sobrien BFD_RELOC_MMIX_GETA, 361189857Sobrien BFD_RELOC_MMIX_GETA_1, 361289857Sobrien BFD_RELOC_MMIX_GETA_2, 361389857Sobrien BFD_RELOC_MMIX_GETA_3, 361489857Sobrien 361591041Sobrien/* These are relocations for a conditional branch instruction. */ 361689857Sobrien BFD_RELOC_MMIX_CBRANCH, 361789857Sobrien BFD_RELOC_MMIX_CBRANCH_J, 361889857Sobrien BFD_RELOC_MMIX_CBRANCH_1, 361989857Sobrien BFD_RELOC_MMIX_CBRANCH_2, 362089857Sobrien BFD_RELOC_MMIX_CBRANCH_3, 362189857Sobrien 362291041Sobrien/* These are relocations for the PUSHJ instruction. */ 362389857Sobrien BFD_RELOC_MMIX_PUSHJ, 362489857Sobrien BFD_RELOC_MMIX_PUSHJ_1, 362589857Sobrien BFD_RELOC_MMIX_PUSHJ_2, 362689857Sobrien BFD_RELOC_MMIX_PUSHJ_3, 3627130561Sobrien BFD_RELOC_MMIX_PUSHJ_STUBBABLE, 362889857Sobrien 362991041Sobrien/* These are relocations for the JMP instruction. */ 363089857Sobrien BFD_RELOC_MMIX_JMP, 363189857Sobrien BFD_RELOC_MMIX_JMP_1, 363289857Sobrien BFD_RELOC_MMIX_JMP_2, 363389857Sobrien BFD_RELOC_MMIX_JMP_3, 363489857Sobrien 363589857Sobrien/* This is a relocation for a relative address as in a GETA instruction or 363691041Sobriena branch. */ 363789857Sobrien BFD_RELOC_MMIX_ADDR19, 363889857Sobrien 363991041Sobrien/* This is a relocation for a relative address as in a JMP instruction. */ 364089857Sobrien BFD_RELOC_MMIX_ADDR27, 364189857Sobrien 364289857Sobrien/* This is a relocation for an instruction field that may be a general 364391041Sobrienregister or a value 0..255. */ 364489857Sobrien BFD_RELOC_MMIX_REG_OR_BYTE, 364589857Sobrien 364689857Sobrien/* This is a relocation for an instruction field that may be a general 364791041Sobrienregister. */ 364889857Sobrien BFD_RELOC_MMIX_REG, 364989857Sobrien 365089857Sobrien/* This is a relocation for two instruction fields holding a register and 365191041Sobrienan offset, the equivalent of the relocation. */ 365289857Sobrien BFD_RELOC_MMIX_BASE_PLUS_OFFSET, 365389857Sobrien 365489857Sobrien/* This relocation is an assertion that the expression is not allocated as 365591041Sobriena global register. It does not modify contents. */ 365689857Sobrien BFD_RELOC_MMIX_LOCAL, 365789857Sobrien 365860484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative 365991041Sobrienshort offset into 7 bits. */ 366060484Sobrien BFD_RELOC_AVR_7_PCREL, 366160484Sobrien 366260484Sobrien/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative 366391041Sobrienshort offset into 12 bits. */ 366460484Sobrien BFD_RELOC_AVR_13_PCREL, 366560484Sobrien 366660484Sobrien/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually 366791041Sobrienprogram memory address) into 16 bits. */ 366860484Sobrien BFD_RELOC_AVR_16_PM, 366960484Sobrien 367060484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 367191041Sobriendata memory address) into 8 bit immediate value of LDI insn. */ 367260484Sobrien BFD_RELOC_AVR_LO8_LDI, 367360484Sobrien 367460484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 367591041Sobrienof data memory address) into 8 bit immediate value of LDI insn. */ 367660484Sobrien BFD_RELOC_AVR_HI8_LDI, 367760484Sobrien 367860484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 367991041Sobrienof program memory address) into 8 bit immediate value of LDI insn. */ 368060484Sobrien BFD_RELOC_AVR_HH8_LDI, 368160484Sobrien 3682218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 3683218822Sdimof 32 bit value) into 8 bit immediate value of LDI insn. */ 3684218822Sdim BFD_RELOC_AVR_MS8_LDI, 3685218822Sdim 368660484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 368791041Sobrien(usually data memory address) into 8 bit immediate value of SUBI insn. */ 368860484Sobrien BFD_RELOC_AVR_LO8_LDI_NEG, 368960484Sobrien 369060484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 369160484Sobrien(high 8 bit of data memory address) into 8 bit immediate value of 369291041SobrienSUBI insn. */ 369360484Sobrien BFD_RELOC_AVR_HI8_LDI_NEG, 369460484Sobrien 369560484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 369660484Sobrien(most high 8 bit of program memory address) into 8 bit immediate value 369791041Sobrienof LDI or SUBI insn. */ 369860484Sobrien BFD_RELOC_AVR_HH8_LDI_NEG, 369960484Sobrien 3700218822Sdim/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb 3701218822Sdimof 32 bit value) into 8 bit immediate value of LDI insn. */ 3702218822Sdim BFD_RELOC_AVR_MS8_LDI_NEG, 3703218822Sdim 370460484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 370591041Sobriencommand address) into 8 bit immediate value of LDI insn. */ 370660484Sobrien BFD_RELOC_AVR_LO8_LDI_PM, 370760484Sobrien 3708218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value 3709218822Sdim(command address) into 8 bit immediate value of LDI insn. If the address 3710218822Sdimis beyond the 128k boundary, the linker inserts a jump stub for this reloc 3711218822Sdimin the lower 128k. */ 3712218822Sdim BFD_RELOC_AVR_LO8_LDI_GS, 3713218822Sdim 371460484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 371591041Sobrienof command address) into 8 bit immediate value of LDI insn. */ 371660484Sobrien BFD_RELOC_AVR_HI8_LDI_PM, 371760484Sobrien 3718218822Sdim/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 3719218822Sdimof command address) into 8 bit immediate value of LDI insn. If the address 3720218822Sdimis beyond the 128k boundary, the linker inserts a jump stub for this reloc 3721218822Sdimbelow 128k. */ 3722218822Sdim BFD_RELOC_AVR_HI8_LDI_GS, 3723218822Sdim 372460484Sobrien/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 372591041Sobrienof command address) into 8 bit immediate value of LDI insn. */ 372660484Sobrien BFD_RELOC_AVR_HH8_LDI_PM, 372760484Sobrien 372860484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 372991041Sobrien(usually command address) into 8 bit immediate value of SUBI insn. */ 373060484Sobrien BFD_RELOC_AVR_LO8_LDI_PM_NEG, 373160484Sobrien 373260484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 373360484Sobrien(high 8 bit of 16 bit command address) into 8 bit immediate value 373491041Sobrienof SUBI insn. */ 373560484Sobrien BFD_RELOC_AVR_HI8_LDI_PM_NEG, 373660484Sobrien 373760484Sobrien/* This is a 16 bit reloc for the AVR that stores negated 8 bit value 373860484Sobrien(high 6 bit of 22 bit command address) into 8 bit immediate 373991041Sobrienvalue of SUBI insn. */ 374060484Sobrien BFD_RELOC_AVR_HH8_LDI_PM_NEG, 374160484Sobrien 374260484Sobrien/* This is a 32 bit reloc for the AVR that stores 23 bit value 374391041Sobrieninto 22 bits. */ 374460484Sobrien BFD_RELOC_AVR_CALL, 374560484Sobrien 3746218822Sdim/* This is a 16 bit reloc for the AVR that stores all needed bits 3747218822Sdimfor absolute addressing with ldi with overflow check to linktime */ 3748218822Sdim BFD_RELOC_AVR_LDI, 3749218822Sdim 3750218822Sdim/* This is a 6 bit reloc for the AVR that stores offset for ldd/std 3751218822Sdiminstructions */ 3752218822Sdim BFD_RELOC_AVR_6, 3753218822Sdim 3754218822Sdim/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw 3755218822Sdiminstructions */ 3756218822Sdim BFD_RELOC_AVR_6_ADIW, 3757218822Sdim 375891041Sobrien/* Direct 12 bit. */ 375989857Sobrien BFD_RELOC_390_12, 376089857Sobrien 376191041Sobrien/* 12 bit GOT offset. */ 376289857Sobrien BFD_RELOC_390_GOT12, 376389857Sobrien 376491041Sobrien/* 32 bit PC relative PLT address. */ 376589857Sobrien BFD_RELOC_390_PLT32, 376689857Sobrien 376791041Sobrien/* Copy symbol at runtime. */ 376889857Sobrien BFD_RELOC_390_COPY, 376989857Sobrien 377091041Sobrien/* Create GOT entry. */ 377189857Sobrien BFD_RELOC_390_GLOB_DAT, 377289857Sobrien 377391041Sobrien/* Create PLT entry. */ 377489857Sobrien BFD_RELOC_390_JMP_SLOT, 377589857Sobrien 377691041Sobrien/* Adjust by program base. */ 377789857Sobrien BFD_RELOC_390_RELATIVE, 377889857Sobrien 377991041Sobrien/* 32 bit PC relative offset to GOT. */ 378089857Sobrien BFD_RELOC_390_GOTPC, 378189857Sobrien 378291041Sobrien/* 16 bit GOT offset. */ 378389857Sobrien BFD_RELOC_390_GOT16, 378489857Sobrien 378591041Sobrien/* PC relative 16 bit shifted by 1. */ 378689857Sobrien BFD_RELOC_390_PC16DBL, 378789857Sobrien 378891041Sobrien/* 16 bit PC rel. PLT shifted by 1. */ 378989857Sobrien BFD_RELOC_390_PLT16DBL, 379089857Sobrien 379191041Sobrien/* PC relative 32 bit shifted by 1. */ 379289857Sobrien BFD_RELOC_390_PC32DBL, 379389857Sobrien 379491041Sobrien/* 32 bit PC rel. PLT shifted by 1. */ 379589857Sobrien BFD_RELOC_390_PLT32DBL, 379689857Sobrien 379791041Sobrien/* 32 bit PC rel. GOT shifted by 1. */ 379889857Sobrien BFD_RELOC_390_GOTPCDBL, 379989857Sobrien 380091041Sobrien/* 64 bit GOT offset. */ 380189857Sobrien BFD_RELOC_390_GOT64, 380289857Sobrien 380391041Sobrien/* 64 bit PC relative PLT address. */ 380489857Sobrien BFD_RELOC_390_PLT64, 380589857Sobrien 380691041Sobrien/* 32 bit rel. offset to GOT entry. */ 380789857Sobrien BFD_RELOC_390_GOTENT, 380889857Sobrien 3809130561Sobrien/* 64 bit offset to GOT. */ 3810130561Sobrien BFD_RELOC_390_GOTOFF64, 3811130561Sobrien 3812130561Sobrien/* 12-bit offset to symbol-entry within GOT, with PLT handling. */ 3813130561Sobrien BFD_RELOC_390_GOTPLT12, 3814130561Sobrien 3815130561Sobrien/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 3816130561Sobrien BFD_RELOC_390_GOTPLT16, 3817130561Sobrien 3818130561Sobrien/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 3819130561Sobrien BFD_RELOC_390_GOTPLT32, 3820130561Sobrien 3821130561Sobrien/* 64-bit offset to symbol-entry within GOT, with PLT handling. */ 3822130561Sobrien BFD_RELOC_390_GOTPLT64, 3823130561Sobrien 3824130561Sobrien/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ 3825130561Sobrien BFD_RELOC_390_GOTPLTENT, 3826130561Sobrien 3827130561Sobrien/* 16-bit rel. offset from the GOT to a PLT entry. */ 3828130561Sobrien BFD_RELOC_390_PLTOFF16, 3829130561Sobrien 3830130561Sobrien/* 32-bit rel. offset from the GOT to a PLT entry. */ 3831130561Sobrien BFD_RELOC_390_PLTOFF32, 3832130561Sobrien 3833130561Sobrien/* 64-bit rel. offset from the GOT to a PLT entry. */ 3834130561Sobrien BFD_RELOC_390_PLTOFF64, 3835130561Sobrien 3836130561Sobrien/* s390 tls relocations. */ 3837130561Sobrien BFD_RELOC_390_TLS_LOAD, 3838130561Sobrien BFD_RELOC_390_TLS_GDCALL, 3839130561Sobrien BFD_RELOC_390_TLS_LDCALL, 3840130561Sobrien BFD_RELOC_390_TLS_GD32, 3841130561Sobrien BFD_RELOC_390_TLS_GD64, 3842130561Sobrien BFD_RELOC_390_TLS_GOTIE12, 3843130561Sobrien BFD_RELOC_390_TLS_GOTIE32, 3844130561Sobrien BFD_RELOC_390_TLS_GOTIE64, 3845130561Sobrien BFD_RELOC_390_TLS_LDM32, 3846130561Sobrien BFD_RELOC_390_TLS_LDM64, 3847130561Sobrien BFD_RELOC_390_TLS_IE32, 3848130561Sobrien BFD_RELOC_390_TLS_IE64, 3849130561Sobrien BFD_RELOC_390_TLS_IEENT, 3850130561Sobrien BFD_RELOC_390_TLS_LE32, 3851130561Sobrien BFD_RELOC_390_TLS_LE64, 3852130561Sobrien BFD_RELOC_390_TLS_LDO32, 3853130561Sobrien BFD_RELOC_390_TLS_LDO64, 3854130561Sobrien BFD_RELOC_390_TLS_DTPMOD, 3855130561Sobrien BFD_RELOC_390_TLS_DTPOFF, 3856130561Sobrien BFD_RELOC_390_TLS_TPOFF, 3857130561Sobrien 3858130561Sobrien/* Long displacement extension. */ 3859130561Sobrien BFD_RELOC_390_20, 3860130561Sobrien BFD_RELOC_390_GOT20, 3861130561Sobrien BFD_RELOC_390_GOTPLT20, 3862130561Sobrien BFD_RELOC_390_TLS_GOTIE20, 3863130561Sobrien 3864218822Sdim/* Score relocations */ 3865218822Sdim BFD_RELOC_SCORE_DUMMY1, 3866218822Sdim 3867218822Sdim/* Low 16 bit for load/store */ 3868218822Sdim BFD_RELOC_SCORE_GPREL15, 3869218822Sdim 3870218822Sdim/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */ 3871218822Sdim BFD_RELOC_SCORE_DUMMY2, 3872218822Sdim BFD_RELOC_SCORE_JMP, 3873218822Sdim 3874218822Sdim/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */ 3875218822Sdim BFD_RELOC_SCORE_BRANCH, 3876218822Sdim 3877218822Sdim/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */ 3878218822Sdim BFD_RELOC_SCORE16_JMP, 3879218822Sdim 3880218822Sdim/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */ 3881218822Sdim BFD_RELOC_SCORE16_BRANCH, 3882218822Sdim 3883218822Sdim/* Undocumented Score relocs */ 3884218822Sdim BFD_RELOC_SCORE_GOT15, 3885218822Sdim BFD_RELOC_SCORE_GOT_LO16, 3886218822Sdim BFD_RELOC_SCORE_CALL15, 3887218822Sdim BFD_RELOC_SCORE_DUMMY_HI16, 3888218822Sdim 3889130561Sobrien/* Scenix IP2K - 9-bit register number / data address */ 3890130561Sobrien BFD_RELOC_IP2K_FR9, 3891130561Sobrien 3892130561Sobrien/* Scenix IP2K - 4-bit register/data bank number */ 3893130561Sobrien BFD_RELOC_IP2K_BANK, 3894130561Sobrien 3895130561Sobrien/* Scenix IP2K - low 13 bits of instruction word address */ 3896130561Sobrien BFD_RELOC_IP2K_ADDR16CJP, 3897130561Sobrien 3898130561Sobrien/* Scenix IP2K - high 3 bits of instruction word address */ 3899130561Sobrien BFD_RELOC_IP2K_PAGE3, 3900130561Sobrien 3901130561Sobrien/* Scenix IP2K - ext/low/high 8 bits of data address */ 3902130561Sobrien BFD_RELOC_IP2K_LO8DATA, 3903130561Sobrien BFD_RELOC_IP2K_HI8DATA, 3904130561Sobrien BFD_RELOC_IP2K_EX8DATA, 3905130561Sobrien 3906130561Sobrien/* Scenix IP2K - low/high 8 bits of instruction word address */ 3907130561Sobrien BFD_RELOC_IP2K_LO8INSN, 3908130561Sobrien BFD_RELOC_IP2K_HI8INSN, 3909130561Sobrien 3910130561Sobrien/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ 3911130561Sobrien BFD_RELOC_IP2K_PC_SKIP, 3912130561Sobrien 3913130561Sobrien/* Scenix IP2K - 16 bit word address in text section. */ 3914130561Sobrien BFD_RELOC_IP2K_TEXT, 3915130561Sobrien 3916130561Sobrien/* Scenix IP2K - 7-bit sp or dp offset */ 3917130561Sobrien BFD_RELOC_IP2K_FR_OFFSET, 3918130561Sobrien 3919130561Sobrien/* Scenix VPE4K coprocessor - data/insn-space addressing */ 3920130561Sobrien BFD_RELOC_VPE4KMATH_DATA, 3921130561Sobrien BFD_RELOC_VPE4KMATH_INSN, 3922130561Sobrien 392360484Sobrien/* These two relocations are used by the linker to determine which of 392460484Sobrienthe entries in a C++ virtual function table are actually used. When 392560484Sobrienthe --gc-sections option is given, the linker will zero out the entries 392660484Sobrienthat are not used, so that the code for those functions need not be 392760484Sobrienincluded in the output. 392860484Sobrien 392960484SobrienVTABLE_INHERIT is a zero-space relocation used to describe to the 3930130561Sobrienlinker the inheritance tree of a C++ virtual function table. The 393160484Sobrienrelocation's symbol should be the parent class' vtable, and the 393260484Sobrienrelocation should be located at the child vtable. 393360484Sobrien 393460484SobrienVTABLE_ENTRY is a zero-space relocation that describes the use of a 393560484Sobrienvirtual function table entry. The reloc's symbol should refer to the 393660484Sobrientable of the class mentioned in the code. Off of that base, an offset 393760484Sobriendescribes the entry that is being used. For Rela hosts, this offset 393860484Sobrienis stored in the reloc's addend. For Rel hosts, we are forced to put 393991041Sobrienthis offset in the reloc's section offset. */ 394060484Sobrien BFD_RELOC_VTABLE_INHERIT, 394160484Sobrien BFD_RELOC_VTABLE_ENTRY, 394277298Sobrien 394391041Sobrien/* Intel IA64 Relocations. */ 394477298Sobrien BFD_RELOC_IA64_IMM14, 394577298Sobrien BFD_RELOC_IA64_IMM22, 394677298Sobrien BFD_RELOC_IA64_IMM64, 394777298Sobrien BFD_RELOC_IA64_DIR32MSB, 394877298Sobrien BFD_RELOC_IA64_DIR32LSB, 394977298Sobrien BFD_RELOC_IA64_DIR64MSB, 395077298Sobrien BFD_RELOC_IA64_DIR64LSB, 395177298Sobrien BFD_RELOC_IA64_GPREL22, 395277298Sobrien BFD_RELOC_IA64_GPREL64I, 395377298Sobrien BFD_RELOC_IA64_GPREL32MSB, 395477298Sobrien BFD_RELOC_IA64_GPREL32LSB, 395577298Sobrien BFD_RELOC_IA64_GPREL64MSB, 395677298Sobrien BFD_RELOC_IA64_GPREL64LSB, 395777298Sobrien BFD_RELOC_IA64_LTOFF22, 395877298Sobrien BFD_RELOC_IA64_LTOFF64I, 395977298Sobrien BFD_RELOC_IA64_PLTOFF22, 396077298Sobrien BFD_RELOC_IA64_PLTOFF64I, 396177298Sobrien BFD_RELOC_IA64_PLTOFF64MSB, 396277298Sobrien BFD_RELOC_IA64_PLTOFF64LSB, 396377298Sobrien BFD_RELOC_IA64_FPTR64I, 396477298Sobrien BFD_RELOC_IA64_FPTR32MSB, 396577298Sobrien BFD_RELOC_IA64_FPTR32LSB, 396677298Sobrien BFD_RELOC_IA64_FPTR64MSB, 396777298Sobrien BFD_RELOC_IA64_FPTR64LSB, 396877298Sobrien BFD_RELOC_IA64_PCREL21B, 396977298Sobrien BFD_RELOC_IA64_PCREL21BI, 397077298Sobrien BFD_RELOC_IA64_PCREL21M, 397177298Sobrien BFD_RELOC_IA64_PCREL21F, 397277298Sobrien BFD_RELOC_IA64_PCREL22, 397377298Sobrien BFD_RELOC_IA64_PCREL60B, 397477298Sobrien BFD_RELOC_IA64_PCREL64I, 397577298Sobrien BFD_RELOC_IA64_PCREL32MSB, 397677298Sobrien BFD_RELOC_IA64_PCREL32LSB, 397777298Sobrien BFD_RELOC_IA64_PCREL64MSB, 397877298Sobrien BFD_RELOC_IA64_PCREL64LSB, 397977298Sobrien BFD_RELOC_IA64_LTOFF_FPTR22, 398077298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64I, 398189857Sobrien BFD_RELOC_IA64_LTOFF_FPTR32MSB, 398289857Sobrien BFD_RELOC_IA64_LTOFF_FPTR32LSB, 398377298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64MSB, 398477298Sobrien BFD_RELOC_IA64_LTOFF_FPTR64LSB, 398577298Sobrien BFD_RELOC_IA64_SEGREL32MSB, 398677298Sobrien BFD_RELOC_IA64_SEGREL32LSB, 398777298Sobrien BFD_RELOC_IA64_SEGREL64MSB, 398877298Sobrien BFD_RELOC_IA64_SEGREL64LSB, 398977298Sobrien BFD_RELOC_IA64_SECREL32MSB, 399077298Sobrien BFD_RELOC_IA64_SECREL32LSB, 399177298Sobrien BFD_RELOC_IA64_SECREL64MSB, 399277298Sobrien BFD_RELOC_IA64_SECREL64LSB, 399377298Sobrien BFD_RELOC_IA64_REL32MSB, 399477298Sobrien BFD_RELOC_IA64_REL32LSB, 399577298Sobrien BFD_RELOC_IA64_REL64MSB, 399677298Sobrien BFD_RELOC_IA64_REL64LSB, 399777298Sobrien BFD_RELOC_IA64_LTV32MSB, 399877298Sobrien BFD_RELOC_IA64_LTV32LSB, 399977298Sobrien BFD_RELOC_IA64_LTV64MSB, 400077298Sobrien BFD_RELOC_IA64_LTV64LSB, 400177298Sobrien BFD_RELOC_IA64_IPLTMSB, 400277298Sobrien BFD_RELOC_IA64_IPLTLSB, 400377298Sobrien BFD_RELOC_IA64_COPY, 4004104834Sobrien BFD_RELOC_IA64_LTOFF22X, 4005104834Sobrien BFD_RELOC_IA64_LDXMOV, 4006104834Sobrien BFD_RELOC_IA64_TPREL14, 400777298Sobrien BFD_RELOC_IA64_TPREL22, 4008104834Sobrien BFD_RELOC_IA64_TPREL64I, 400977298Sobrien BFD_RELOC_IA64_TPREL64MSB, 401077298Sobrien BFD_RELOC_IA64_TPREL64LSB, 4011104834Sobrien BFD_RELOC_IA64_LTOFF_TPREL22, 4012104834Sobrien BFD_RELOC_IA64_DTPMOD64MSB, 4013104834Sobrien BFD_RELOC_IA64_DTPMOD64LSB, 4014104834Sobrien BFD_RELOC_IA64_LTOFF_DTPMOD22, 4015104834Sobrien BFD_RELOC_IA64_DTPREL14, 4016104834Sobrien BFD_RELOC_IA64_DTPREL22, 4017104834Sobrien BFD_RELOC_IA64_DTPREL64I, 4018104834Sobrien BFD_RELOC_IA64_DTPREL32MSB, 4019104834Sobrien BFD_RELOC_IA64_DTPREL32LSB, 4020104834Sobrien BFD_RELOC_IA64_DTPREL64MSB, 4021104834Sobrien BFD_RELOC_IA64_DTPREL64LSB, 4022104834Sobrien BFD_RELOC_IA64_LTOFF_DTPREL22, 402377298Sobrien 402477298Sobrien/* Motorola 68HC11 reloc. 4025130561SobrienThis is the 8 bit high part of an absolute address. */ 402677298Sobrien BFD_RELOC_M68HC11_HI8, 402777298Sobrien 402877298Sobrien/* Motorola 68HC11 reloc. 4029130561SobrienThis is the 8 bit low part of an absolute address. */ 403077298Sobrien BFD_RELOC_M68HC11_LO8, 403177298Sobrien 403277298Sobrien/* Motorola 68HC11 reloc. 4033130561SobrienThis is the 3 bit of a value. */ 403477298Sobrien BFD_RELOC_M68HC11_3B, 403577298Sobrien 4036130561Sobrien/* Motorola 68HC11 reloc. 4037130561SobrienThis reloc marks the beginning of a jump/call instruction. 4038130561SobrienIt is used for linker relaxation to correctly identify beginning 4039130561Sobrienof instruction and change some branches to use PC-relative 4040130561Sobrienaddressing mode. */ 4041130561Sobrien BFD_RELOC_M68HC11_RL_JUMP, 4042130561Sobrien 4043130561Sobrien/* Motorola 68HC11 reloc. 4044130561SobrienThis reloc marks a group of several instructions that gcc generates 4045130561Sobrienand for which the linker relaxation pass can modify and/or remove 4046130561Sobriensome of them. */ 4047130561Sobrien BFD_RELOC_M68HC11_RL_GROUP, 4048130561Sobrien 4049130561Sobrien/* Motorola 68HC11 reloc. 4050130561SobrienThis is the 16-bit lower part of an address. It is used for 'call' 4051130561Sobrieninstruction to specify the symbol address without any special 4052130561Sobrientransformation (due to memory bank window). */ 4053130561Sobrien BFD_RELOC_M68HC11_LO16, 4054130561Sobrien 4055130561Sobrien/* Motorola 68HC11 reloc. 4056130561SobrienThis is a 8-bit reloc that specifies the page number of an address. 4057130561SobrienIt is used by 'call' instruction to specify the page number of 4058130561Sobrienthe symbol. */ 4059130561Sobrien BFD_RELOC_M68HC11_PAGE, 4060130561Sobrien 4061130561Sobrien/* Motorola 68HC11 reloc. 4062130561SobrienThis is a 24-bit reloc that represents the address with a 16-bit 4063130561Sobrienvalue and a 8-bit page number. The symbol address is transformed 4064130561Sobriento follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ 4065130561Sobrien BFD_RELOC_M68HC11_24, 4066130561Sobrien 4067130561Sobrien/* Motorola 68HC12 reloc. 4068130561SobrienThis is the 5 bits of a value. */ 4069130561Sobrien BFD_RELOC_M68HC12_5B, 4070130561Sobrien 4071218822Sdim/* NS CR16C Relocations. */ 4072218822Sdim BFD_RELOC_16C_NUM08, 4073218822Sdim BFD_RELOC_16C_NUM08_C, 4074218822Sdim BFD_RELOC_16C_NUM16, 4075218822Sdim BFD_RELOC_16C_NUM16_C, 4076218822Sdim BFD_RELOC_16C_NUM32, 4077218822Sdim BFD_RELOC_16C_NUM32_C, 4078218822Sdim BFD_RELOC_16C_DISP04, 4079218822Sdim BFD_RELOC_16C_DISP04_C, 4080218822Sdim BFD_RELOC_16C_DISP08, 4081218822Sdim BFD_RELOC_16C_DISP08_C, 4082218822Sdim BFD_RELOC_16C_DISP16, 4083218822Sdim BFD_RELOC_16C_DISP16_C, 4084218822Sdim BFD_RELOC_16C_DISP24, 4085218822Sdim BFD_RELOC_16C_DISP24_C, 4086218822Sdim BFD_RELOC_16C_DISP24a, 4087218822Sdim BFD_RELOC_16C_DISP24a_C, 4088218822Sdim BFD_RELOC_16C_REG04, 4089218822Sdim BFD_RELOC_16C_REG04_C, 4090218822Sdim BFD_RELOC_16C_REG04a, 4091218822Sdim BFD_RELOC_16C_REG04a_C, 4092218822Sdim BFD_RELOC_16C_REG14, 4093218822Sdim BFD_RELOC_16C_REG14_C, 4094218822Sdim BFD_RELOC_16C_REG16, 4095218822Sdim BFD_RELOC_16C_REG16_C, 4096218822Sdim BFD_RELOC_16C_REG20, 4097218822Sdim BFD_RELOC_16C_REG20_C, 4098218822Sdim BFD_RELOC_16C_ABS20, 4099218822Sdim BFD_RELOC_16C_ABS20_C, 4100218822Sdim BFD_RELOC_16C_ABS24, 4101218822Sdim BFD_RELOC_16C_ABS24_C, 4102218822Sdim BFD_RELOC_16C_IMM04, 4103218822Sdim BFD_RELOC_16C_IMM04_C, 4104218822Sdim BFD_RELOC_16C_IMM16, 4105218822Sdim BFD_RELOC_16C_IMM16_C, 4106218822Sdim BFD_RELOC_16C_IMM20, 4107218822Sdim BFD_RELOC_16C_IMM20_C, 4108218822Sdim BFD_RELOC_16C_IMM24, 4109218822Sdim BFD_RELOC_16C_IMM24_C, 4110218822Sdim BFD_RELOC_16C_IMM32, 4111218822Sdim BFD_RELOC_16C_IMM32_C, 4112218822Sdim 4113218822Sdim/* NS CR16 Relocations. */ 4114218822Sdim BFD_RELOC_CR16_NUM8, 4115218822Sdim BFD_RELOC_CR16_NUM16, 4116218822Sdim BFD_RELOC_CR16_NUM32, 4117218822Sdim BFD_RELOC_CR16_NUM32a, 4118218822Sdim BFD_RELOC_CR16_REGREL0, 4119218822Sdim BFD_RELOC_CR16_REGREL4, 4120218822Sdim BFD_RELOC_CR16_REGREL4a, 4121218822Sdim BFD_RELOC_CR16_REGREL14, 4122218822Sdim BFD_RELOC_CR16_REGREL14a, 4123218822Sdim BFD_RELOC_CR16_REGREL16, 4124218822Sdim BFD_RELOC_CR16_REGREL20, 4125218822Sdim BFD_RELOC_CR16_REGREL20a, 4126218822Sdim BFD_RELOC_CR16_ABS20, 4127218822Sdim BFD_RELOC_CR16_ABS24, 4128218822Sdim BFD_RELOC_CR16_IMM4, 4129218822Sdim BFD_RELOC_CR16_IMM8, 4130218822Sdim BFD_RELOC_CR16_IMM16, 4131218822Sdim BFD_RELOC_CR16_IMM20, 4132218822Sdim BFD_RELOC_CR16_IMM24, 4133218822Sdim BFD_RELOC_CR16_IMM32, 4134218822Sdim BFD_RELOC_CR16_IMM32a, 4135218822Sdim BFD_RELOC_CR16_DISP4, 4136218822Sdim BFD_RELOC_CR16_DISP8, 4137218822Sdim BFD_RELOC_CR16_DISP16, 4138218822Sdim BFD_RELOC_CR16_DISP20, 4139218822Sdim BFD_RELOC_CR16_DISP24, 4140218822Sdim BFD_RELOC_CR16_DISP24a, 4141218822Sdim 4142218822Sdim/* NS CRX Relocations. */ 4143218822Sdim BFD_RELOC_CRX_REL4, 4144218822Sdim BFD_RELOC_CRX_REL8, 4145218822Sdim BFD_RELOC_CRX_REL8_CMP, 4146218822Sdim BFD_RELOC_CRX_REL16, 4147218822Sdim BFD_RELOC_CRX_REL24, 4148218822Sdim BFD_RELOC_CRX_REL32, 4149218822Sdim BFD_RELOC_CRX_REGREL12, 4150218822Sdim BFD_RELOC_CRX_REGREL22, 4151218822Sdim BFD_RELOC_CRX_REGREL28, 4152218822Sdim BFD_RELOC_CRX_REGREL32, 4153218822Sdim BFD_RELOC_CRX_ABS16, 4154218822Sdim BFD_RELOC_CRX_ABS32, 4155218822Sdim BFD_RELOC_CRX_NUM8, 4156218822Sdim BFD_RELOC_CRX_NUM16, 4157218822Sdim BFD_RELOC_CRX_NUM32, 4158218822Sdim BFD_RELOC_CRX_IMM16, 4159218822Sdim BFD_RELOC_CRX_IMM32, 4160218822Sdim BFD_RELOC_CRX_SWITCH8, 4161218822Sdim BFD_RELOC_CRX_SWITCH16, 4162218822Sdim BFD_RELOC_CRX_SWITCH32, 4163218822Sdim 416477298Sobrien/* These relocs are only used within the CRIS assembler. They are not 416591041Sobrien(at present) written to any object files. */ 416677298Sobrien BFD_RELOC_CRIS_BDISP8, 416777298Sobrien BFD_RELOC_CRIS_UNSIGNED_5, 416877298Sobrien BFD_RELOC_CRIS_SIGNED_6, 416977298Sobrien BFD_RELOC_CRIS_UNSIGNED_6, 4170218822Sdim BFD_RELOC_CRIS_SIGNED_8, 4171218822Sdim BFD_RELOC_CRIS_UNSIGNED_8, 4172218822Sdim BFD_RELOC_CRIS_SIGNED_16, 4173218822Sdim BFD_RELOC_CRIS_UNSIGNED_16, 4174218822Sdim BFD_RELOC_CRIS_LAPCQ_OFFSET, 417577298Sobrien BFD_RELOC_CRIS_UNSIGNED_4, 417677298Sobrien 417791041Sobrien/* Relocs used in ELF shared libraries for CRIS. */ 417889857Sobrien BFD_RELOC_CRIS_COPY, 417989857Sobrien BFD_RELOC_CRIS_GLOB_DAT, 418089857Sobrien BFD_RELOC_CRIS_JUMP_SLOT, 418189857Sobrien BFD_RELOC_CRIS_RELATIVE, 418289857Sobrien 418391041Sobrien/* 32-bit offset to symbol-entry within GOT. */ 418489857Sobrien BFD_RELOC_CRIS_32_GOT, 418589857Sobrien 418691041Sobrien/* 16-bit offset to symbol-entry within GOT. */ 418789857Sobrien BFD_RELOC_CRIS_16_GOT, 418889857Sobrien 418991041Sobrien/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 419089857Sobrien BFD_RELOC_CRIS_32_GOTPLT, 419189857Sobrien 419291041Sobrien/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 419389857Sobrien BFD_RELOC_CRIS_16_GOTPLT, 419489857Sobrien 419591041Sobrien/* 32-bit offset to symbol, relative to GOT. */ 419689857Sobrien BFD_RELOC_CRIS_32_GOTREL, 419789857Sobrien 419891041Sobrien/* 32-bit offset to symbol with PLT entry, relative to GOT. */ 419989857Sobrien BFD_RELOC_CRIS_32_PLT_GOTREL, 420089857Sobrien 420191041Sobrien/* 32-bit offset to symbol with PLT entry, relative to this relocation. */ 420289857Sobrien BFD_RELOC_CRIS_32_PLT_PCREL, 420389857Sobrien 420491041Sobrien/* Intel i860 Relocations. */ 420577298Sobrien BFD_RELOC_860_COPY, 420677298Sobrien BFD_RELOC_860_GLOB_DAT, 420777298Sobrien BFD_RELOC_860_JUMP_SLOT, 420877298Sobrien BFD_RELOC_860_RELATIVE, 420977298Sobrien BFD_RELOC_860_PC26, 421077298Sobrien BFD_RELOC_860_PLT26, 421177298Sobrien BFD_RELOC_860_PC16, 421277298Sobrien BFD_RELOC_860_LOW0, 421377298Sobrien BFD_RELOC_860_SPLIT0, 421477298Sobrien BFD_RELOC_860_LOW1, 421577298Sobrien BFD_RELOC_860_SPLIT1, 421677298Sobrien BFD_RELOC_860_LOW2, 421777298Sobrien BFD_RELOC_860_SPLIT2, 421877298Sobrien BFD_RELOC_860_LOW3, 421977298Sobrien BFD_RELOC_860_LOGOT0, 422077298Sobrien BFD_RELOC_860_SPGOT0, 422177298Sobrien BFD_RELOC_860_LOGOT1, 422277298Sobrien BFD_RELOC_860_SPGOT1, 422377298Sobrien BFD_RELOC_860_LOGOTOFF0, 422477298Sobrien BFD_RELOC_860_SPGOTOFF0, 422577298Sobrien BFD_RELOC_860_LOGOTOFF1, 422677298Sobrien BFD_RELOC_860_SPGOTOFF1, 422777298Sobrien BFD_RELOC_860_LOGOTOFF2, 422877298Sobrien BFD_RELOC_860_LOGOTOFF3, 422977298Sobrien BFD_RELOC_860_LOPC, 423077298Sobrien BFD_RELOC_860_HIGHADJ, 423177298Sobrien BFD_RELOC_860_HAGOT, 423277298Sobrien BFD_RELOC_860_HAGOTOFF, 423377298Sobrien BFD_RELOC_860_HAPC, 423477298Sobrien BFD_RELOC_860_HIGH, 423577298Sobrien BFD_RELOC_860_HIGOT, 423677298Sobrien BFD_RELOC_860_HIGOTOFF, 423789857Sobrien 423891041Sobrien/* OpenRISC Relocations. */ 423989857Sobrien BFD_RELOC_OPENRISC_ABS_26, 424089857Sobrien BFD_RELOC_OPENRISC_REL_26, 424189857Sobrien 424291041Sobrien/* H8 elf Relocations. */ 424389857Sobrien BFD_RELOC_H8_DIR16A8, 424489857Sobrien BFD_RELOC_H8_DIR16R8, 424589857Sobrien BFD_RELOC_H8_DIR24A8, 424689857Sobrien BFD_RELOC_H8_DIR24R8, 424789857Sobrien BFD_RELOC_H8_DIR32A16, 424889857Sobrien 424991041Sobrien/* Sony Xstormy16 Relocations. */ 425089857Sobrien BFD_RELOC_XSTORMY16_REL_12, 4251130561Sobrien BFD_RELOC_XSTORMY16_12, 425289857Sobrien BFD_RELOC_XSTORMY16_24, 425389857Sobrien BFD_RELOC_XSTORMY16_FPTR16, 4254104834Sobrien 4255218822Sdim/* Self-describing complex relocations. */ 4256218822Sdim BFD_RELOC_RELC, 4257218822Sdim 4258218822Sdim 4259218822Sdim/* Infineon Relocations. */ 4260218822Sdim BFD_RELOC_XC16X_PAG, 4261218822Sdim BFD_RELOC_XC16X_POF, 4262218822Sdim BFD_RELOC_XC16X_SEG, 4263218822Sdim BFD_RELOC_XC16X_SOF, 4264218822Sdim 4265104834Sobrien/* Relocations used by VAX ELF. */ 4266104834Sobrien BFD_RELOC_VAX_GLOB_DAT, 4267104834Sobrien BFD_RELOC_VAX_JMP_SLOT, 4268104834Sobrien BFD_RELOC_VAX_RELATIVE, 4269130561Sobrien 4270218822Sdim/* Morpho MT - 16 bit immediate relocation. */ 4271218822Sdim BFD_RELOC_MT_PC16, 4272218822Sdim 4273218822Sdim/* Morpho MT - Hi 16 bits of an address. */ 4274218822Sdim BFD_RELOC_MT_HI16, 4275218822Sdim 4276218822Sdim/* Morpho MT - Low 16 bits of an address. */ 4277218822Sdim BFD_RELOC_MT_LO16, 4278218822Sdim 4279218822Sdim/* Morpho MT - Used to tell the linker which vtable entries are used. */ 4280218822Sdim BFD_RELOC_MT_GNU_VTINHERIT, 4281218822Sdim 4282218822Sdim/* Morpho MT - Used to tell the linker which vtable entries are used. */ 4283218822Sdim BFD_RELOC_MT_GNU_VTENTRY, 4284218822Sdim 4285218822Sdim/* Morpho MT - 8 bit immediate relocation. */ 4286218822Sdim BFD_RELOC_MT_PCINSN8, 4287218822Sdim 4288130561Sobrien/* msp430 specific relocation codes */ 4289130561Sobrien BFD_RELOC_MSP430_10_PCREL, 4290130561Sobrien BFD_RELOC_MSP430_16_PCREL, 4291130561Sobrien BFD_RELOC_MSP430_16, 4292130561Sobrien BFD_RELOC_MSP430_16_PCREL_BYTE, 4293130561Sobrien BFD_RELOC_MSP430_16_BYTE, 4294218822Sdim BFD_RELOC_MSP430_2X_PCREL, 4295218822Sdim BFD_RELOC_MSP430_RL_PCREL, 4296130561Sobrien 4297130561Sobrien/* IQ2000 Relocations. */ 4298130561Sobrien BFD_RELOC_IQ2000_OFFSET_16, 4299130561Sobrien BFD_RELOC_IQ2000_OFFSET_21, 4300130561Sobrien BFD_RELOC_IQ2000_UHI16, 4301130561Sobrien 4302130561Sobrien/* Special Xtensa relocation used only by PLT entries in ELF shared 4303130561Sobrienobjects to indicate that the runtime linker should set the value 4304130561Sobriento one of its own internal functions or data structures. */ 4305130561Sobrien BFD_RELOC_XTENSA_RTLD, 4306130561Sobrien 4307130561Sobrien/* Xtensa relocations for ELF shared objects. */ 4308130561Sobrien BFD_RELOC_XTENSA_GLOB_DAT, 4309130561Sobrien BFD_RELOC_XTENSA_JMP_SLOT, 4310130561Sobrien BFD_RELOC_XTENSA_RELATIVE, 4311130561Sobrien 4312130561Sobrien/* Xtensa relocation used in ELF object files for symbols that may require 4313130561SobrienPLT entries. Otherwise, this is just a generic 32-bit relocation. */ 4314130561Sobrien BFD_RELOC_XTENSA_PLT, 4315130561Sobrien 4316218822Sdim/* Xtensa relocations to mark the difference of two local symbols. 4317218822SdimThese are only needed to support linker relaxation and can be ignored 4318218822Sdimwhen not relaxing. The field is set to the value of the difference 4319218822Sdimassuming no relaxation. The relocation encodes the position of the 4320218822Sdimfirst symbol so the linker can determine whether to adjust the field 4321218822Sdimvalue. */ 4322218822Sdim BFD_RELOC_XTENSA_DIFF8, 4323218822Sdim BFD_RELOC_XTENSA_DIFF16, 4324218822Sdim BFD_RELOC_XTENSA_DIFF32, 4325218822Sdim 4326218822Sdim/* Generic Xtensa relocations for instruction operands. Only the slot 4327218822Sdimnumber is encoded in the relocation. The relocation applies to the 4328218822Sdimlast PC-relative immediate operand, or if there are no PC-relative 4329218822Sdimimmediates, to the last immediate operand. */ 4330218822Sdim BFD_RELOC_XTENSA_SLOT0_OP, 4331218822Sdim BFD_RELOC_XTENSA_SLOT1_OP, 4332218822Sdim BFD_RELOC_XTENSA_SLOT2_OP, 4333218822Sdim BFD_RELOC_XTENSA_SLOT3_OP, 4334218822Sdim BFD_RELOC_XTENSA_SLOT4_OP, 4335218822Sdim BFD_RELOC_XTENSA_SLOT5_OP, 4336218822Sdim BFD_RELOC_XTENSA_SLOT6_OP, 4337218822Sdim BFD_RELOC_XTENSA_SLOT7_OP, 4338218822Sdim BFD_RELOC_XTENSA_SLOT8_OP, 4339218822Sdim BFD_RELOC_XTENSA_SLOT9_OP, 4340218822Sdim BFD_RELOC_XTENSA_SLOT10_OP, 4341218822Sdim BFD_RELOC_XTENSA_SLOT11_OP, 4342218822Sdim BFD_RELOC_XTENSA_SLOT12_OP, 4343218822Sdim BFD_RELOC_XTENSA_SLOT13_OP, 4344218822Sdim BFD_RELOC_XTENSA_SLOT14_OP, 4345218822Sdim 4346218822Sdim/* Alternate Xtensa relocations. Only the slot is encoded in the 4347218822Sdimrelocation. The meaning of these relocations is opcode-specific. */ 4348218822Sdim BFD_RELOC_XTENSA_SLOT0_ALT, 4349218822Sdim BFD_RELOC_XTENSA_SLOT1_ALT, 4350218822Sdim BFD_RELOC_XTENSA_SLOT2_ALT, 4351218822Sdim BFD_RELOC_XTENSA_SLOT3_ALT, 4352218822Sdim BFD_RELOC_XTENSA_SLOT4_ALT, 4353218822Sdim BFD_RELOC_XTENSA_SLOT5_ALT, 4354218822Sdim BFD_RELOC_XTENSA_SLOT6_ALT, 4355218822Sdim BFD_RELOC_XTENSA_SLOT7_ALT, 4356218822Sdim BFD_RELOC_XTENSA_SLOT8_ALT, 4357218822Sdim BFD_RELOC_XTENSA_SLOT9_ALT, 4358218822Sdim BFD_RELOC_XTENSA_SLOT10_ALT, 4359218822Sdim BFD_RELOC_XTENSA_SLOT11_ALT, 4360218822Sdim BFD_RELOC_XTENSA_SLOT12_ALT, 4361218822Sdim BFD_RELOC_XTENSA_SLOT13_ALT, 4362218822Sdim BFD_RELOC_XTENSA_SLOT14_ALT, 4363218822Sdim 4364218822Sdim/* Xtensa relocations for backward compatibility. These have all been 4365218822Sdimreplaced by BFD_RELOC_XTENSA_SLOT0_OP. */ 4366130561Sobrien BFD_RELOC_XTENSA_OP0, 4367130561Sobrien BFD_RELOC_XTENSA_OP1, 4368130561Sobrien BFD_RELOC_XTENSA_OP2, 4369130561Sobrien 4370218822Sdim/* Xtensa relocation to mark that the assembler expanded the 4371130561Sobrieninstructions from an original target. The expansion size is 4372130561Sobrienencoded in the reloc size. */ 4373130561Sobrien BFD_RELOC_XTENSA_ASM_EXPAND, 4374130561Sobrien 4375218822Sdim/* Xtensa relocation to mark that the linker should simplify 4376218822Sdimassembler-expanded instructions. This is commonly used 4377218822Sdiminternally by the linker after analysis of a 4378130561SobrienBFD_RELOC_XTENSA_ASM_EXPAND. */ 4379130561Sobrien BFD_RELOC_XTENSA_ASM_SIMPLIFY, 4380218822Sdim 4381218822Sdim/* 8 bit signed offset in (ix+d) or (iy+d). */ 4382218822Sdim BFD_RELOC_Z80_DISP8, 4383218822Sdim 4384218822Sdim/* DJNZ offset. */ 4385218822Sdim BFD_RELOC_Z8K_DISP7, 4386218822Sdim 4387218822Sdim/* CALR offset. */ 4388218822Sdim BFD_RELOC_Z8K_CALLR, 4389218822Sdim 4390218822Sdim/* 4 bit value. */ 4391218822Sdim BFD_RELOC_Z8K_IMM4L, 439233965Sjdp BFD_RELOC_UNUSED }; 439333965Sjdptypedef enum bfd_reloc_code_real bfd_reloc_code_real_type; 4394130561Sobrienreloc_howto_type *bfd_reloc_type_lookup 4395130561Sobrien (bfd *abfd, bfd_reloc_code_real_type code); 4396218822Sdimreloc_howto_type *bfd_reloc_name_lookup 4397218822Sdim (bfd *abfd, const char *reloc_name); 439833965Sjdp 4399130561Sobrienconst char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); 440033965Sjdp 4401104834Sobrien/* Extracted from syms.c. */ 440233965Sjdp 4403130561Sobrientypedef struct bfd_symbol 440433965Sjdp{ 440591041Sobrien /* A pointer to the BFD which owns the symbol. This information 440691041Sobrien is necessary so that a back end can work out what additional 440791041Sobrien information (invisible to the application writer) is carried 440891041Sobrien with the symbol. 440933965Sjdp 441091041Sobrien This field is *almost* redundant, since you can use section->owner 441191041Sobrien instead, except that some symbols point to the global sections 441291041Sobrien bfd_{abs,com,und}_section. This could be fixed by making 441391041Sobrien these globals be per-bfd (or per-target-flavor). FIXME. */ 4414130561Sobrien struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 441533965Sjdp 441691041Sobrien /* The text of the symbol. The name is left alone, and not copied; the 441791041Sobrien application may not alter it. */ 441889857Sobrien const char *name; 441933965Sjdp 442091041Sobrien /* The value of the symbol. This really should be a union of a 442191041Sobrien numeric value with a pointer, since some flags indicate that 442291041Sobrien a pointer to another symbol is stored here. */ 442333965Sjdp symvalue value; 442433965Sjdp 442591041Sobrien /* Attributes of a symbol. */ 442633965Sjdp#define BSF_NO_FLAGS 0x00 442733965Sjdp 442891041Sobrien /* The symbol has local scope; <<static>> in <<C>>. The value 442991041Sobrien is the offset into the section of the data. */ 443038889Sjdp#define BSF_LOCAL 0x01 443133965Sjdp 443291041Sobrien /* The symbol has global scope; initialized data in <<C>>. The 443391041Sobrien value is the offset into the section of the data. */ 443438889Sjdp#define BSF_GLOBAL 0x02 443533965Sjdp 443691041Sobrien /* The symbol has global scope and is exported. The value is 443791041Sobrien the offset into the section of the data. */ 443891041Sobrien#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ 443933965Sjdp 444091041Sobrien /* A normal C symbol would be one of: 444191041Sobrien <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or 444291041Sobrien <<BSF_GLOBAL>>. */ 444333965Sjdp 4444130561Sobrien /* The symbol is a debugging record. The value has an arbitrary 444591041Sobrien meaning, unless BSF_DEBUGGING_RELOC is also set. */ 444638889Sjdp#define BSF_DEBUGGING 0x08 444733965Sjdp 444891041Sobrien /* The symbol denotes a function entry point. Used in ELF, 444991041Sobrien perhaps others someday. */ 445033965Sjdp#define BSF_FUNCTION 0x10 445133965Sjdp 445291041Sobrien /* Used by the linker. */ 445333965Sjdp#define BSF_KEEP 0x20 445433965Sjdp#define BSF_KEEP_G 0x40 445533965Sjdp 445691041Sobrien /* A weak global symbol, overridable without warnings by 445791041Sobrien a regular global symbol of the same name. */ 445833965Sjdp#define BSF_WEAK 0x80 445933965Sjdp 446091041Sobrien /* This symbol was created to point to a section, e.g. ELF's 446191041Sobrien STT_SECTION symbols. */ 446233965Sjdp#define BSF_SECTION_SYM 0x100 446333965Sjdp 446491041Sobrien /* The symbol used to be a common symbol, but now it is 446591041Sobrien allocated. */ 446633965Sjdp#define BSF_OLD_COMMON 0x200 446733965Sjdp 446891041Sobrien /* The default value for common data. */ 446933965Sjdp#define BFD_FORT_COMM_DEFAULT_VALUE 0 447033965Sjdp 447191041Sobrien /* In some files the type of a symbol sometimes alters its 447291041Sobrien location in an output file - ie in coff a <<ISFCN>> symbol 447391041Sobrien which is also <<C_EXT>> symbol appears where it was 447491041Sobrien declared and not at the end of a section. This bit is set 447591041Sobrien by the target BFD part to convey this information. */ 447633965Sjdp#define BSF_NOT_AT_END 0x400 447733965Sjdp 447891041Sobrien /* Signal that the symbol is the label of constructor section. */ 447933965Sjdp#define BSF_CONSTRUCTOR 0x800 448033965Sjdp 448191041Sobrien /* Signal that the symbol is a warning symbol. The name is a 448291041Sobrien warning. The name of the next symbol is the one to warn about; 448391041Sobrien if a reference is made to a symbol with the same name as the next 448491041Sobrien symbol, a warning is issued by the linker. */ 448533965Sjdp#define BSF_WARNING 0x1000 448633965Sjdp 448791041Sobrien /* Signal that the symbol is indirect. This symbol is an indirect 448891041Sobrien pointer to the symbol with the same name as the next symbol. */ 448933965Sjdp#define BSF_INDIRECT 0x2000 449033965Sjdp 449191041Sobrien /* BSF_FILE marks symbols that contain a file name. This is used 449291041Sobrien for ELF STT_FILE symbols. */ 449333965Sjdp#define BSF_FILE 0x4000 449433965Sjdp 449591041Sobrien /* Symbol is from dynamic linking information. */ 449638889Sjdp#define BSF_DYNAMIC 0x8000 449733965Sjdp 449891041Sobrien /* The symbol denotes a data object. Used in ELF, and perhaps 449991041Sobrien others someday. */ 450038889Sjdp#define BSF_OBJECT 0x10000 450133965Sjdp 450291041Sobrien /* This symbol is a debugging symbol. The value is the offset 450391041Sobrien into the section of the data. BSF_DEBUGGING should be set 450491041Sobrien as well. */ 450560484Sobrien#define BSF_DEBUGGING_RELOC 0x20000 450660484Sobrien 4507104834Sobrien /* This symbol is thread local. Used in ELF. */ 4508104834Sobrien#define BSF_THREAD_LOCAL 0x40000 4509104834Sobrien 4510218822Sdim /* This symbol represents a complex relocation expression, 4511218822Sdim with the expression tree serialized in the symbol name. */ 4512218822Sdim#define BSF_RELC 0x80000 4513218822Sdim 4514218822Sdim /* This symbol represents a signed complex relocation expression, 4515218822Sdim with the expression tree serialized in the symbol name. */ 4516218822Sdim#define BSF_SRELC 0x100000 4517218822Sdim 451833965Sjdp flagword flags; 451933965Sjdp 452091041Sobrien /* A pointer to the section to which this symbol is 452191041Sobrien relative. This will always be non NULL, there are special 452291041Sobrien sections for undefined and absolute symbols. */ 4523130561Sobrien struct bfd_section *section; 452433965Sjdp 452591041Sobrien /* Back end special data. */ 452633965Sjdp union 452733965Sjdp { 4528130561Sobrien void *p; 452933965Sjdp bfd_vma i; 453091041Sobrien } 453191041Sobrien udata; 453291041Sobrien} 453391041Sobrienasymbol; 453433965Sjdp 453533965Sjdp#define bfd_get_symtab_upper_bound(abfd) \ 453633965Sjdp BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) 453791041Sobrien 4538130561Sobrienbfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); 453933965Sjdp 4540130561Sobrienbfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); 454133965Sjdp 454233965Sjdp#define bfd_is_local_label_name(abfd, name) \ 4543130561Sobrien BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) 454491041Sobrien 4545218822Sdimbfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); 4546218822Sdim 4547218822Sdim#define bfd_is_target_special_symbol(abfd, sym) \ 4548218822Sdim BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) 4549218822Sdim 455033965Sjdp#define bfd_canonicalize_symtab(abfd, location) \ 4551130561Sobrien BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) 455291041Sobrien 4553130561Sobrienbfd_boolean bfd_set_symtab 4554130561Sobrien (bfd *abfd, asymbol **location, unsigned int count); 455533965Sjdp 4556130561Sobrienvoid bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); 455733965Sjdp 455833965Sjdp#define bfd_make_empty_symbol(abfd) \ 4559130561Sobrien BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 456091041Sobrien 4561130561Sobrienasymbol *_bfd_generic_make_empty_symbol (bfd *); 456289857Sobrien 456333965Sjdp#define bfd_make_debug_symbol(abfd,ptr,size) \ 4564130561Sobrien BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) 456591041Sobrien 4566130561Sobrienint bfd_decode_symclass (asymbol *symbol); 456733965Sjdp 4568130561Sobrienbfd_boolean bfd_is_undefined_symclass (int symclass); 456960484Sobrien 4570130561Sobrienvoid bfd_symbol_info (asymbol *symbol, symbol_info *ret); 457133965Sjdp 4572130561Sobrienbfd_boolean bfd_copy_private_symbol_data 4573130561Sobrien (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); 457433965Sjdp 457533965Sjdp#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ 4576130561Sobrien BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ 4577130561Sobrien (ibfd, isymbol, obfd, osymbol)) 457891041Sobrien 4579104834Sobrien/* Extracted from bfd.c. */ 4580130561Sobrienstruct bfd 458133965Sjdp{ 4582130561Sobrien /* A unique identifier of the BFD */ 4583130561Sobrien unsigned int id; 4584130561Sobrien 458591041Sobrien /* The filename the application opened the BFD with. */ 458691041Sobrien const char *filename; 458733965Sjdp 458891041Sobrien /* A pointer to the target jump table. */ 458991041Sobrien const struct bfd_target *xvec; 459033965Sjdp 4591218822Sdim /* The IOSTREAM, and corresponding IO vector that provide access 4592218822Sdim to the file backing the BFD. */ 4593130561Sobrien void *iostream; 4594218822Sdim const struct bfd_iovec *iovec; 459533965Sjdp 459691041Sobrien /* Is the file descriptor being cached? That is, can it be closed as 459791041Sobrien needed, and re-opened when accessed later? */ 4598130561Sobrien bfd_boolean cacheable; 459933965Sjdp 460091041Sobrien /* Marks whether there was a default target specified when the 460191041Sobrien BFD was opened. This is used to select which matching algorithm 460291041Sobrien to use to choose the back end. */ 4603130561Sobrien bfd_boolean target_defaulted; 460433965Sjdp 460591041Sobrien /* The caching routines use these to maintain a 460691041Sobrien least-recently-used list of BFDs. */ 4607130561Sobrien struct bfd *lru_prev, *lru_next; 460833965Sjdp 460991041Sobrien /* When a file is closed by the caching routines, BFD retains 461091041Sobrien state information on the file here... */ 461191041Sobrien ufile_ptr where; 461233965Sjdp 461391041Sobrien /* ... and here: (``once'' means at least once). */ 4614130561Sobrien bfd_boolean opened_once; 461533965Sjdp 461691041Sobrien /* Set if we have a locally maintained mtime value, rather than 461791041Sobrien getting it from the file each time. */ 4618130561Sobrien bfd_boolean mtime_set; 461933965Sjdp 4620130561Sobrien /* File modified time, if mtime_set is TRUE. */ 462191041Sobrien long mtime; 462233965Sjdp 462391041Sobrien /* Reserved for an unimplemented file locking extension. */ 462491041Sobrien int ifd; 462533965Sjdp 462691041Sobrien /* The format which belongs to the BFD. (object, core, etc.) */ 462791041Sobrien bfd_format format; 462833965Sjdp 462991041Sobrien /* The direction with which the BFD was opened. */ 463091041Sobrien enum bfd_direction 463191041Sobrien { 463291041Sobrien no_direction = 0, 463391041Sobrien read_direction = 1, 463491041Sobrien write_direction = 2, 463591041Sobrien both_direction = 3 463691041Sobrien } 463791041Sobrien direction; 463833965Sjdp 463991041Sobrien /* Format_specific flags. */ 464091041Sobrien flagword flags; 464133965Sjdp 464291041Sobrien /* Currently my_archive is tested before adding origin to 464391041Sobrien anything. I believe that this can become always an add of 464491041Sobrien origin, with origin set to 0 for non archive files. */ 464591041Sobrien ufile_ptr origin; 464633965Sjdp 464791041Sobrien /* Remember when output has begun, to stop strange things 464891041Sobrien from happening. */ 4649130561Sobrien bfd_boolean output_has_begun; 465033965Sjdp 465191041Sobrien /* A hash table for section names. */ 465291041Sobrien struct bfd_hash_table section_htab; 465333965Sjdp 465491041Sobrien /* Pointer to linked list of sections. */ 4655130561Sobrien struct bfd_section *sections; 465633965Sjdp 4657218822Sdim /* The last section on the section list. */ 4658218822Sdim struct bfd_section *section_last; 465933965Sjdp 466091041Sobrien /* The number of sections. */ 466191041Sobrien unsigned int section_count; 466233965Sjdp 466391041Sobrien /* Stuff only useful for object files: 466491041Sobrien The start address. */ 466591041Sobrien bfd_vma start_address; 466633965Sjdp 466791041Sobrien /* Used for input and output. */ 466891041Sobrien unsigned int symcount; 466933965Sjdp 467091041Sobrien /* Symbol table for output BFD (with symcount entries). */ 4671130561Sobrien struct bfd_symbol **outsymbols; 467233965Sjdp 4673104834Sobrien /* Used for slurped dynamic symbol tables. */ 4674104834Sobrien unsigned int dynsymcount; 4675104834Sobrien 467691041Sobrien /* Pointer to structure which contains architecture information. */ 467791041Sobrien const struct bfd_arch_info *arch_info; 467833965Sjdp 4679218822Sdim /* Flag set if symbols from this BFD should not be exported. */ 4680218822Sdim bfd_boolean no_export; 4681218822Sdim 468291041Sobrien /* Stuff only useful for archives. */ 4683130561Sobrien void *arelt_data; 4684130561Sobrien struct bfd *my_archive; /* The containing archive BFD. */ 4685218822Sdim struct bfd *archive_next; /* The next BFD in the archive. */ 4686130561Sobrien struct bfd *archive_head; /* The first BFD in the archive. */ 4687130561Sobrien bfd_boolean has_armap; 468833965Sjdp 468991041Sobrien /* A chain of BFD structures involved in a link. */ 4690130561Sobrien struct bfd *link_next; 469133965Sjdp 469291041Sobrien /* A field used by _bfd_generic_link_add_archive_symbols. This will 469391041Sobrien be used only for archive elements. */ 469491041Sobrien int archive_pass; 469533965Sjdp 469691041Sobrien /* Used by the back end to hold private data. */ 469791041Sobrien union 469891041Sobrien { 469933965Sjdp struct aout_data_struct *aout_data; 470033965Sjdp struct artdata *aout_ar_data; 470133965Sjdp struct _oasys_data *oasys_obj_data; 470233965Sjdp struct _oasys_ar_data *oasys_ar_data; 470333965Sjdp struct coff_tdata *coff_obj_data; 470433965Sjdp struct pe_tdata *pe_obj_data; 470533965Sjdp struct xcoff_tdata *xcoff_obj_data; 470633965Sjdp struct ecoff_tdata *ecoff_obj_data; 470733965Sjdp struct ieee_data_struct *ieee_data; 470833965Sjdp struct ieee_ar_data_struct *ieee_ar_data; 470933965Sjdp struct srec_data_struct *srec_data; 471033965Sjdp struct ihex_data_struct *ihex_data; 471133965Sjdp struct tekhex_data_struct *tekhex_data; 471233965Sjdp struct elf_obj_tdata *elf_obj_data; 471333965Sjdp struct nlm_obj_tdata *nlm_obj_data; 471433965Sjdp struct bout_data_struct *bout_data; 471589857Sobrien struct mmo_data_struct *mmo_data; 471633965Sjdp struct sun_core_struct *sun_core_data; 471760484Sobrien struct sco5_core_struct *sco5_core_data; 471833965Sjdp struct trad_core_struct *trad_core_data; 471933965Sjdp struct som_data_struct *som_data; 472033965Sjdp struct hpux_core_struct *hpux_core_data; 472133965Sjdp struct hppabsd_core_struct *hppabsd_core_data; 472233965Sjdp struct sgi_core_struct *sgi_core_data; 472333965Sjdp struct lynx_core_struct *lynx_core_data; 472433965Sjdp struct osf_core_struct *osf_core_data; 472533965Sjdp struct cisco_core_struct *cisco_core_data; 472633965Sjdp struct versados_data_struct *versados_data; 472733965Sjdp struct netbsd_core_struct *netbsd_core_data; 4728130561Sobrien struct mach_o_data_struct *mach_o_data; 4729130561Sobrien struct mach_o_fat_data_struct *mach_o_fat_data; 4730130561Sobrien struct bfd_pef_data_struct *pef_data; 4731130561Sobrien struct bfd_pef_xlib_data_struct *pef_xlib_data; 4732130561Sobrien struct bfd_sym_data_struct *sym_data; 4733130561Sobrien void *any; 473491041Sobrien } 473591041Sobrien tdata; 473677298Sobrien 473791041Sobrien /* Used by the application to hold private data. */ 4738130561Sobrien void *usrdata; 473933965Sjdp 474077298Sobrien /* Where all the allocated stuff under this BFD goes. This is a 4741130561Sobrien struct objalloc *, but we use void * to avoid requiring the inclusion 4742130561Sobrien of objalloc.h. */ 4743130561Sobrien void *memory; 474433965Sjdp}; 474533965Sjdp 474633965Sjdptypedef enum bfd_error 474733965Sjdp{ 474833965Sjdp bfd_error_no_error = 0, 474933965Sjdp bfd_error_system_call, 475033965Sjdp bfd_error_invalid_target, 475133965Sjdp bfd_error_wrong_format, 475289857Sobrien bfd_error_wrong_object_format, 475333965Sjdp bfd_error_invalid_operation, 475433965Sjdp bfd_error_no_memory, 475533965Sjdp bfd_error_no_symbols, 475633965Sjdp bfd_error_no_armap, 475733965Sjdp bfd_error_no_more_archived_files, 475833965Sjdp bfd_error_malformed_archive, 475933965Sjdp bfd_error_file_not_recognized, 476033965Sjdp bfd_error_file_ambiguously_recognized, 476133965Sjdp bfd_error_no_contents, 476233965Sjdp bfd_error_nonrepresentable_section, 476333965Sjdp bfd_error_no_debug_section, 476433965Sjdp bfd_error_bad_value, 476533965Sjdp bfd_error_file_truncated, 476633965Sjdp bfd_error_file_too_big, 4767218822Sdim bfd_error_on_input, 476833965Sjdp bfd_error_invalid_error_code 476991041Sobrien} 477091041Sobrienbfd_error_type; 477133965Sjdp 4772130561Sobrienbfd_error_type bfd_get_error (void); 477333965Sjdp 4774218822Sdimvoid bfd_set_error (bfd_error_type error_tag, ...); 477533965Sjdp 4776130561Sobrienconst char *bfd_errmsg (bfd_error_type error_tag); 477733965Sjdp 4778130561Sobrienvoid bfd_perror (const char *message); 477933965Sjdp 4780130561Sobrientypedef void (*bfd_error_handler_type) (const char *, ...); 478133965Sjdp 4782130561Sobrienbfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); 478333965Sjdp 4784130561Sobrienvoid bfd_set_error_program_name (const char *); 478533965Sjdp 4786130561Sobrienbfd_error_handler_type bfd_get_error_handler (void); 478738889Sjdp 4788130561Sobrienlong bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); 478933965Sjdp 4790130561Sobrienlong bfd_canonicalize_reloc 4791130561Sobrien (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); 479233965Sjdp 4793130561Sobrienvoid bfd_set_reloc 4794130561Sobrien (bfd *abfd, asection *sec, arelent **rel, unsigned int count); 479533965Sjdp 4796130561Sobrienbfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); 479733965Sjdp 4798130561Sobrienint bfd_get_arch_size (bfd *abfd); 479977298Sobrien 4800130561Sobrienint bfd_get_sign_extend_vma (bfd *abfd); 480177298Sobrien 4802130561Sobrienbfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); 480333965Sjdp 4804130561Sobrienunsigned int bfd_get_gp_size (bfd *abfd); 480533965Sjdp 4806130561Sobrienvoid bfd_set_gp_size (bfd *abfd, unsigned int i); 480733965Sjdp 4808130561Sobrienbfd_vma bfd_scan_vma (const char *string, const char **end, int base); 480933965Sjdp 4810218822Sdimbfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); 4811218822Sdim 4812218822Sdim#define bfd_copy_private_header_data(ibfd, obfd) \ 4813218822Sdim BFD_SEND (obfd, _bfd_copy_private_header_data, \ 4814218822Sdim (ibfd, obfd)) 4815130561Sobrienbfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); 481633965Sjdp 481733965Sjdp#define bfd_copy_private_bfd_data(ibfd, obfd) \ 481833965Sjdp BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ 481938889Sjdp (ibfd, obfd)) 4820130561Sobrienbfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); 482133965Sjdp 482233965Sjdp#define bfd_merge_private_bfd_data(ibfd, obfd) \ 482333965Sjdp BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ 482438889Sjdp (ibfd, obfd)) 4825130561Sobrienbfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); 482633965Sjdp 482733965Sjdp#define bfd_set_private_flags(abfd, flags) \ 4828130561Sobrien BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) 4829218822Sdim#define bfd_sizeof_headers(abfd, info) \ 4830218822Sdim BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) 483133965Sjdp 483233965Sjdp#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ 4833130561Sobrien BFD_SEND (abfd, _bfd_find_nearest_line, \ 4834130561Sobrien (abfd, sec, syms, off, file, func, line)) 483533965Sjdp 4836218822Sdim#define bfd_find_line(abfd, syms, sym, file, line) \ 4837218822Sdim BFD_SEND (abfd, _bfd_find_line, \ 4838218822Sdim (abfd, syms, sym, file, line)) 4839218822Sdim 4840218822Sdim#define bfd_find_inliner_info(abfd, file, func, line) \ 4841218822Sdim BFD_SEND (abfd, _bfd_find_inliner_info, \ 4842218822Sdim (abfd, file, func, line)) 4843218822Sdim 484433965Sjdp#define bfd_debug_info_start(abfd) \ 4845130561Sobrien BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) 484633965Sjdp 484733965Sjdp#define bfd_debug_info_end(abfd) \ 4848130561Sobrien BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) 484933965Sjdp 485033965Sjdp#define bfd_debug_info_accumulate(abfd, section) \ 4851130561Sobrien BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 485233965Sjdp 485333965Sjdp#define bfd_stat_arch_elt(abfd, stat) \ 4854130561Sobrien BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) 485533965Sjdp 485633965Sjdp#define bfd_update_armap_timestamp(abfd) \ 4857130561Sobrien BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) 485833965Sjdp 485933965Sjdp#define bfd_set_arch_mach(abfd, arch, mach)\ 4860130561Sobrien BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) 486133965Sjdp 486233965Sjdp#define bfd_relax_section(abfd, section, link_info, again) \ 486333965Sjdp BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) 486433965Sjdp 486560484Sobrien#define bfd_gc_sections(abfd, link_info) \ 486660484Sobrien BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) 486760484Sobrien 486889857Sobrien#define bfd_merge_sections(abfd, link_info) \ 486989857Sobrien BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) 487089857Sobrien 4871218822Sdim#define bfd_is_group_section(abfd, sec) \ 4872218822Sdim BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) 4873218822Sdim 4874104834Sobrien#define bfd_discard_group(abfd, sec) \ 4875104834Sobrien BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) 4876104834Sobrien 487733965Sjdp#define bfd_link_hash_table_create(abfd) \ 487838889Sjdp BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) 487933965Sjdp 4880104834Sobrien#define bfd_link_hash_table_free(abfd, hash) \ 4881104834Sobrien BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) 4882104834Sobrien 488333965Sjdp#define bfd_link_add_symbols(abfd, info) \ 488438889Sjdp BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) 488533965Sjdp 4886218822Sdim#define bfd_link_just_syms(abfd, sec, info) \ 4887104834Sobrien BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) 4888104834Sobrien 488933965Sjdp#define bfd_final_link(abfd, info) \ 489038889Sjdp BFD_SEND (abfd, _bfd_final_link, (abfd, info)) 489133965Sjdp 489233965Sjdp#define bfd_free_cached_info(abfd) \ 489333965Sjdp BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) 489433965Sjdp 489533965Sjdp#define bfd_get_dynamic_symtab_upper_bound(abfd) \ 489638889Sjdp BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) 489733965Sjdp 489833965Sjdp#define bfd_print_private_bfd_data(abfd, file)\ 489938889Sjdp BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) 490033965Sjdp 490133965Sjdp#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ 490238889Sjdp BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) 490333965Sjdp 4904218822Sdim#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ 4905218822Sdim BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ 4906218822Sdim dyncount, dynsyms, ret)) 4907218822Sdim 490833965Sjdp#define bfd_get_dynamic_reloc_upper_bound(abfd) \ 490938889Sjdp BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) 491033965Sjdp 491133965Sjdp#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ 491238889Sjdp BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) 491333965Sjdp 491433965Sjdpextern bfd_byte *bfd_get_relocated_section_contents 4915130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, 4916130561Sobrien bfd_boolean, asymbol **); 491733965Sjdp 4918130561Sobrienbfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); 491989857Sobrien 4920130561Sobrienstruct bfd_preserve 4921130561Sobrien{ 4922130561Sobrien void *marker; 4923130561Sobrien void *tdata; 4924130561Sobrien flagword flags; 4925130561Sobrien const struct bfd_arch_info *arch_info; 4926130561Sobrien struct bfd_section *sections; 4927218822Sdim struct bfd_section *section_last; 4928130561Sobrien unsigned int section_count; 4929130561Sobrien struct bfd_hash_table section_htab; 4930130561Sobrien}; 4931130561Sobrien 4932130561Sobrienbfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); 4933130561Sobrien 4934130561Sobrienvoid bfd_preserve_restore (bfd *, struct bfd_preserve *); 4935130561Sobrien 4936130561Sobrienvoid bfd_preserve_finish (bfd *, struct bfd_preserve *); 4937130561Sobrien 4938218822Sdimbfd_vma bfd_emul_get_maxpagesize (const char *); 4939218822Sdim 4940218822Sdimvoid bfd_emul_set_maxpagesize (const char *, bfd_vma); 4941218822Sdim 4942218822Sdimbfd_vma bfd_emul_get_commonpagesize (const char *); 4943218822Sdim 4944218822Sdimvoid bfd_emul_set_commonpagesize (const char *, bfd_vma); 4945218822Sdim 4946218822Sdimchar *bfd_demangle (bfd *, const char *, int); 4947218822Sdim 4948104834Sobrien/* Extracted from archive.c. */ 4949130561Sobriensymindex bfd_get_next_mapent 4950130561Sobrien (bfd *abfd, symindex previous, carsym **sym); 495133965Sjdp 4952130561Sobrienbfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); 495333965Sjdp 4954130561Sobrienbfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); 495533965Sjdp 4956104834Sobrien/* Extracted from corefile.c. */ 4957130561Sobrienconst char *bfd_core_file_failing_command (bfd *abfd); 495833965Sjdp 4959130561Sobrienint bfd_core_file_failing_signal (bfd *abfd); 496033965Sjdp 4961130561Sobrienbfd_boolean core_file_matches_executable_p 4962130561Sobrien (bfd *core_bfd, bfd *exec_bfd); 496333965Sjdp 4964218822Sdimbfd_boolean generic_core_file_matches_executable_p 4965218822Sdim (bfd *core_bfd, bfd *exec_bfd); 4966218822Sdim 4967104834Sobrien/* Extracted from targets.c. */ 496833965Sjdp#define BFD_SEND(bfd, message, arglist) \ 4969130561Sobrien ((*((bfd)->xvec->message)) arglist) 497033965Sjdp 497133965Sjdp#ifdef DEBUG_BFD_SEND 497233965Sjdp#undef BFD_SEND 497333965Sjdp#define BFD_SEND(bfd, message, arglist) \ 497433965Sjdp (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ 497533965Sjdp ((*((bfd)->xvec->message)) arglist) : \ 497633965Sjdp (bfd_assert (__FILE__,__LINE__), NULL)) 497733965Sjdp#endif 497833965Sjdp#define BFD_SEND_FMT(bfd, message, arglist) \ 4979130561Sobrien (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) 498033965Sjdp 498133965Sjdp#ifdef DEBUG_BFD_SEND 498233965Sjdp#undef BFD_SEND_FMT 498333965Sjdp#define BFD_SEND_FMT(bfd, message, arglist) \ 498433965Sjdp (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ 498577298Sobrien (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ 498633965Sjdp (bfd_assert (__FILE__,__LINE__), NULL)) 498733965Sjdp#endif 498891041Sobrien 498991041Sobrienenum bfd_flavour 499091041Sobrien{ 499133965Sjdp bfd_target_unknown_flavour, 499233965Sjdp bfd_target_aout_flavour, 499333965Sjdp bfd_target_coff_flavour, 499433965Sjdp bfd_target_ecoff_flavour, 499577298Sobrien bfd_target_xcoff_flavour, 499633965Sjdp bfd_target_elf_flavour, 499733965Sjdp bfd_target_ieee_flavour, 499833965Sjdp bfd_target_nlm_flavour, 499933965Sjdp bfd_target_oasys_flavour, 500033965Sjdp bfd_target_tekhex_flavour, 500133965Sjdp bfd_target_srec_flavour, 500233965Sjdp bfd_target_ihex_flavour, 500333965Sjdp bfd_target_som_flavour, 500433965Sjdp bfd_target_os9k_flavour, 500533965Sjdp bfd_target_versados_flavour, 500633965Sjdp bfd_target_msdos_flavour, 500760484Sobrien bfd_target_ovax_flavour, 500889857Sobrien bfd_target_evax_flavour, 5009130561Sobrien bfd_target_mmo_flavour, 5010130561Sobrien bfd_target_mach_o_flavour, 5011130561Sobrien bfd_target_pef_flavour, 5012130561Sobrien bfd_target_pef_xlib_flavour, 5013130561Sobrien bfd_target_sym_flavour 501433965Sjdp}; 501533965Sjdp 501633965Sjdpenum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; 501733965Sjdp 501877298Sobrien/* Forward declaration. */ 501933965Sjdptypedef struct bfd_link_info _bfd_link_info; 502033965Sjdp 502133965Sjdptypedef struct bfd_target 502233965Sjdp{ 502391041Sobrien /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ 502433965Sjdp char *name; 502591041Sobrien 502691041Sobrien /* The "flavour" of a back end is a general indication about 502791041Sobrien the contents of a file. */ 502833965Sjdp enum bfd_flavour flavour; 502991041Sobrien 503091041Sobrien /* The order of bytes within the data area of a file. */ 503133965Sjdp enum bfd_endian byteorder; 503291041Sobrien 503391041Sobrien /* The order of bytes within the header parts of a file. */ 503433965Sjdp enum bfd_endian header_byteorder; 503591041Sobrien 503691041Sobrien /* A mask of all the flags which an executable may have set - 503791041Sobrien from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */ 503877298Sobrien flagword object_flags; 503991041Sobrien 504091041Sobrien /* A mask of all the flags which a section may have set - from 504191041Sobrien the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */ 504233965Sjdp flagword section_flags; 504391041Sobrien 504491041Sobrien /* The character normally found at the front of a symbol. 504591041Sobrien (if any), perhaps `_'. */ 504633965Sjdp char symbol_leading_char; 504791041Sobrien 504891041Sobrien /* The pad character for file names within an archive header. */ 504977298Sobrien char ar_pad_char; 505091041Sobrien 505191041Sobrien /* The maximum number of characters in an archive header. */ 505233965Sjdp unsigned short ar_max_namelen; 505391041Sobrien 505491041Sobrien /* Entries for byte swapping for data. These are different from the 5055218822Sdim other entry points, since they don't take a BFD as the first argument. 505691041Sobrien Certain other handlers could do the same. */ 5057130561Sobrien bfd_uint64_t (*bfd_getx64) (const void *); 5058130561Sobrien bfd_int64_t (*bfd_getx_signed_64) (const void *); 5059130561Sobrien void (*bfd_putx64) (bfd_uint64_t, void *); 5060130561Sobrien bfd_vma (*bfd_getx32) (const void *); 5061130561Sobrien bfd_signed_vma (*bfd_getx_signed_32) (const void *); 5062130561Sobrien void (*bfd_putx32) (bfd_vma, void *); 5063130561Sobrien bfd_vma (*bfd_getx16) (const void *); 5064130561Sobrien bfd_signed_vma (*bfd_getx_signed_16) (const void *); 5065130561Sobrien void (*bfd_putx16) (bfd_vma, void *); 506691041Sobrien 506791041Sobrien /* Byte swapping for the headers. */ 5068130561Sobrien bfd_uint64_t (*bfd_h_getx64) (const void *); 5069130561Sobrien bfd_int64_t (*bfd_h_getx_signed_64) (const void *); 5070130561Sobrien void (*bfd_h_putx64) (bfd_uint64_t, void *); 5071130561Sobrien bfd_vma (*bfd_h_getx32) (const void *); 5072130561Sobrien bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); 5073130561Sobrien void (*bfd_h_putx32) (bfd_vma, void *); 5074130561Sobrien bfd_vma (*bfd_h_getx16) (const void *); 5075130561Sobrien bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); 5076130561Sobrien void (*bfd_h_putx16) (bfd_vma, void *); 507791041Sobrien 507891041Sobrien /* Format dependent routines: these are vectors of entry points 507991041Sobrien within the target vector structure, one for each format to check. */ 508091041Sobrien 508191041Sobrien /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */ 5082130561Sobrien const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); 508391041Sobrien 508491041Sobrien /* Set the format of a file being written. */ 5085130561Sobrien bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); 508691041Sobrien 508791041Sobrien /* Write cached information into a file being written, at <<bfd_close>>. */ 5088130561Sobrien bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); 508933965Sjdp 509091041Sobrien 509177298Sobrien /* Generic entry points. */ 509289857Sobrien#define BFD_JUMP_TABLE_GENERIC(NAME) \ 5093130561Sobrien NAME##_close_and_cleanup, \ 5094130561Sobrien NAME##_bfd_free_cached_info, \ 5095130561Sobrien NAME##_new_section_hook, \ 5096130561Sobrien NAME##_get_section_contents, \ 5097130561Sobrien NAME##_get_section_contents_in_window 509833965Sjdp 509977298Sobrien /* Called when the BFD is being closed to do any necessary cleanup. */ 5100130561Sobrien bfd_boolean (*_close_and_cleanup) (bfd *); 510177298Sobrien /* Ask the BFD to free all cached information. */ 5102130561Sobrien bfd_boolean (*_bfd_free_cached_info) (bfd *); 510377298Sobrien /* Called when a new section is created. */ 5104130561Sobrien bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); 510577298Sobrien /* Read the contents of a section. */ 5106130561Sobrien bfd_boolean (*_bfd_get_section_contents) 5107130561Sobrien (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); 5108130561Sobrien bfd_boolean (*_bfd_get_section_contents_in_window) 5109130561Sobrien (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); 511033965Sjdp 511177298Sobrien /* Entry points to copy private data. */ 511289857Sobrien#define BFD_JUMP_TABLE_COPY(NAME) \ 5113130561Sobrien NAME##_bfd_copy_private_bfd_data, \ 5114130561Sobrien NAME##_bfd_merge_private_bfd_data, \ 5115218822Sdim _bfd_generic_init_private_section_data, \ 5116130561Sobrien NAME##_bfd_copy_private_section_data, \ 5117130561Sobrien NAME##_bfd_copy_private_symbol_data, \ 5118218822Sdim NAME##_bfd_copy_private_header_data, \ 5119130561Sobrien NAME##_bfd_set_private_flags, \ 5120130561Sobrien NAME##_bfd_print_private_bfd_data 5121130561Sobrien 512277298Sobrien /* Called to copy BFD general private data from one object file 512333965Sjdp to another. */ 5124130561Sobrien bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); 512577298Sobrien /* Called to merge BFD general private data from one object file 512633965Sjdp to a common output file when linking. */ 5127130561Sobrien bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); 5128218822Sdim /* Called to initialize BFD private section data from one object file 5129218822Sdim to another. */ 5130218822Sdim#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ 5131218822Sdim BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) 5132218822Sdim bfd_boolean (*_bfd_init_private_section_data) 5133218822Sdim (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); 513477298Sobrien /* Called to copy BFD private section data from one object file 513533965Sjdp to another. */ 5136130561Sobrien bfd_boolean (*_bfd_copy_private_section_data) 5137130561Sobrien (bfd *, sec_ptr, bfd *, sec_ptr); 513877298Sobrien /* Called to copy BFD private symbol data from one symbol 513933965Sjdp to another. */ 5140130561Sobrien bfd_boolean (*_bfd_copy_private_symbol_data) 5141130561Sobrien (bfd *, asymbol *, bfd *, asymbol *); 5142218822Sdim /* Called to copy BFD private header data from one object file 5143218822Sdim to another. */ 5144218822Sdim bfd_boolean (*_bfd_copy_private_header_data) 5145218822Sdim (bfd *, bfd *); 514691041Sobrien /* Called to set private backend flags. */ 5147130561Sobrien bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); 514833965Sjdp 514991041Sobrien /* Called to print private BFD data. */ 5150130561Sobrien bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); 515133965Sjdp 515277298Sobrien /* Core file entry points. */ 515389857Sobrien#define BFD_JUMP_TABLE_CORE(NAME) \ 5154130561Sobrien NAME##_core_file_failing_command, \ 5155130561Sobrien NAME##_core_file_failing_signal, \ 5156130561Sobrien NAME##_core_file_matches_executable_p 515733965Sjdp 5158130561Sobrien char * (*_core_file_failing_command) (bfd *); 5159130561Sobrien int (*_core_file_failing_signal) (bfd *); 5160130561Sobrien bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); 5161130561Sobrien 516277298Sobrien /* Archive entry points. */ 516389857Sobrien#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 5164130561Sobrien NAME##_slurp_armap, \ 5165130561Sobrien NAME##_slurp_extended_name_table, \ 5166130561Sobrien NAME##_construct_extended_name_table, \ 5167130561Sobrien NAME##_truncate_arname, \ 5168130561Sobrien NAME##_write_armap, \ 5169130561Sobrien NAME##_read_ar_hdr, \ 5170130561Sobrien NAME##_openr_next_archived_file, \ 5171130561Sobrien NAME##_get_elt_at_index, \ 5172130561Sobrien NAME##_generic_stat_arch_elt, \ 5173130561Sobrien NAME##_update_armap_timestamp 517433965Sjdp 5175130561Sobrien bfd_boolean (*_bfd_slurp_armap) (bfd *); 5176130561Sobrien bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); 5177130561Sobrien bfd_boolean (*_bfd_construct_extended_name_table) 5178130561Sobrien (bfd *, char **, bfd_size_type *, const char **); 5179130561Sobrien void (*_bfd_truncate_arname) (bfd *, const char *, char *); 5180130561Sobrien bfd_boolean (*write_armap) 5181130561Sobrien (bfd *, unsigned int, struct orl *, unsigned int, int); 5182130561Sobrien void * (*_bfd_read_ar_hdr_fn) (bfd *); 5183130561Sobrien bfd * (*openr_next_archived_file) (bfd *, bfd *); 5184130561Sobrien#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) 5185130561Sobrien bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); 5186130561Sobrien int (*_bfd_stat_arch_elt) (bfd *, struct stat *); 5187130561Sobrien bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); 5188130561Sobrien 518977298Sobrien /* Entry points used for symbols. */ 519089857Sobrien#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 5191130561Sobrien NAME##_get_symtab_upper_bound, \ 5192130561Sobrien NAME##_canonicalize_symtab, \ 5193130561Sobrien NAME##_make_empty_symbol, \ 5194130561Sobrien NAME##_print_symbol, \ 5195130561Sobrien NAME##_get_symbol_info, \ 5196130561Sobrien NAME##_bfd_is_local_label_name, \ 5197218822Sdim NAME##_bfd_is_target_special_symbol, \ 5198130561Sobrien NAME##_get_lineno, \ 5199130561Sobrien NAME##_find_nearest_line, \ 5200218822Sdim _bfd_generic_find_line, \ 5201218822Sdim NAME##_find_inliner_info, \ 5202130561Sobrien NAME##_bfd_make_debug_symbol, \ 5203130561Sobrien NAME##_read_minisymbols, \ 5204130561Sobrien NAME##_minisymbol_to_symbol 520533965Sjdp 5206130561Sobrien long (*_bfd_get_symtab_upper_bound) (bfd *); 5207130561Sobrien long (*_bfd_canonicalize_symtab) 5208130561Sobrien (bfd *, struct bfd_symbol **); 5209130561Sobrien struct bfd_symbol * 5210130561Sobrien (*_bfd_make_empty_symbol) (bfd *); 5211130561Sobrien void (*_bfd_print_symbol) 5212130561Sobrien (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); 5213130561Sobrien#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) 5214130561Sobrien void (*_bfd_get_symbol_info) 5215130561Sobrien (bfd *, struct bfd_symbol *, symbol_info *); 5216130561Sobrien#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) 5217130561Sobrien bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); 5218218822Sdim bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); 5219130561Sobrien alent * (*_get_lineno) (bfd *, struct bfd_symbol *); 5220130561Sobrien bfd_boolean (*_bfd_find_nearest_line) 5221130561Sobrien (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, 5222130561Sobrien const char **, const char **, unsigned int *); 5223218822Sdim bfd_boolean (*_bfd_find_line) 5224218822Sdim (bfd *, struct bfd_symbol **, struct bfd_symbol *, 5225218822Sdim const char **, unsigned int *); 5226218822Sdim bfd_boolean (*_bfd_find_inliner_info) 5227218822Sdim (bfd *, const char **, const char **, unsigned int *); 522877298Sobrien /* Back-door to allow format-aware applications to create debug symbols 522933965Sjdp while using BFD for everything else. Currently used by the assembler 523033965Sjdp when creating COFF files. */ 5231130561Sobrien asymbol * (*_bfd_make_debug_symbol) 5232130561Sobrien (bfd *, void *, unsigned long size); 523333965Sjdp#define bfd_read_minisymbols(b, d, m, s) \ 523433965Sjdp BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 5235130561Sobrien long (*_read_minisymbols) 5236130561Sobrien (bfd *, bfd_boolean, void **, unsigned int *); 523733965Sjdp#define bfd_minisymbol_to_symbol(b, d, m, f) \ 523833965Sjdp BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 5239130561Sobrien asymbol * (*_minisymbol_to_symbol) 5240130561Sobrien (bfd *, bfd_boolean, const void *, asymbol *); 524133965Sjdp 524277298Sobrien /* Routines for relocs. */ 524389857Sobrien#define BFD_JUMP_TABLE_RELOCS(NAME) \ 5244130561Sobrien NAME##_get_reloc_upper_bound, \ 5245130561Sobrien NAME##_canonicalize_reloc, \ 5246218822Sdim NAME##_bfd_reloc_type_lookup, \ 5247218822Sdim NAME##_bfd_reloc_name_lookup 5248130561Sobrien 5249130561Sobrien long (*_get_reloc_upper_bound) (bfd *, sec_ptr); 5250130561Sobrien long (*_bfd_canonicalize_reloc) 5251130561Sobrien (bfd *, sec_ptr, arelent **, struct bfd_symbol **); 525277298Sobrien /* See documentation on reloc types. */ 525333965Sjdp reloc_howto_type * 5254130561Sobrien (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); 5255218822Sdim reloc_howto_type * 5256218822Sdim (*reloc_name_lookup) (bfd *, const char *); 525733965Sjdp 5258218822Sdim 525977298Sobrien /* Routines used when writing an object file. */ 526089857Sobrien#define BFD_JUMP_TABLE_WRITE(NAME) \ 5261130561Sobrien NAME##_set_arch_mach, \ 5262130561Sobrien NAME##_set_section_contents 526333965Sjdp 5264130561Sobrien bfd_boolean (*_bfd_set_arch_mach) 5265130561Sobrien (bfd *, enum bfd_architecture, unsigned long); 5266130561Sobrien bfd_boolean (*_bfd_set_section_contents) 5267130561Sobrien (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); 5268130561Sobrien 526977298Sobrien /* Routines used by the linker. */ 527089857Sobrien#define BFD_JUMP_TABLE_LINK(NAME) \ 5271130561Sobrien NAME##_sizeof_headers, \ 5272130561Sobrien NAME##_bfd_get_relocated_section_contents, \ 5273130561Sobrien NAME##_bfd_relax_section, \ 5274130561Sobrien NAME##_bfd_link_hash_table_create, \ 5275130561Sobrien NAME##_bfd_link_hash_table_free, \ 5276130561Sobrien NAME##_bfd_link_add_symbols, \ 5277130561Sobrien NAME##_bfd_link_just_syms, \ 5278130561Sobrien NAME##_bfd_final_link, \ 5279130561Sobrien NAME##_bfd_link_split_section, \ 5280130561Sobrien NAME##_bfd_gc_sections, \ 5281130561Sobrien NAME##_bfd_merge_sections, \ 5282218822Sdim NAME##_bfd_is_group_section, \ 5283218822Sdim NAME##_bfd_discard_group, \ 5284218822Sdim NAME##_section_already_linked \ 528533965Sjdp 5286218822Sdim int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); 5287130561Sobrien bfd_byte * (*_bfd_get_relocated_section_contents) 5288130561Sobrien (bfd *, struct bfd_link_info *, struct bfd_link_order *, 5289130561Sobrien bfd_byte *, bfd_boolean, struct bfd_symbol **); 529033965Sjdp 5291130561Sobrien bfd_boolean (*_bfd_relax_section) 5292130561Sobrien (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); 5293130561Sobrien 529477298Sobrien /* Create a hash table for the linker. Different backends store 529533965Sjdp different information in this table. */ 5296130561Sobrien struct bfd_link_hash_table * 5297130561Sobrien (*_bfd_link_hash_table_create) (bfd *); 529833965Sjdp 5299104834Sobrien /* Release the memory associated with the linker hash table. */ 5300130561Sobrien void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); 5301104834Sobrien 530277298Sobrien /* Add symbols from this object file into the hash table. */ 5303130561Sobrien bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); 530433965Sjdp 5305104834Sobrien /* Indicate that we are only retrieving symbol values from this section. */ 5306130561Sobrien void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); 5307104834Sobrien 530877298Sobrien /* Do a link based on the link_order structures attached to each 530933965Sjdp section of the BFD. */ 5310130561Sobrien bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); 531133965Sjdp 531277298Sobrien /* Should this section be split up into smaller pieces during linking. */ 5313130561Sobrien bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); 531433965Sjdp 531577298Sobrien /* Remove sections that are not referenced from the output. */ 5316130561Sobrien bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); 531760484Sobrien 531889857Sobrien /* Attempt to merge SEC_MERGE sections. */ 5319130561Sobrien bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); 532089857Sobrien 5321218822Sdim /* Is this section a member of a group? */ 5322218822Sdim bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); 5323218822Sdim 5324104834Sobrien /* Discard members of a group. */ 5325130561Sobrien bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); 5326104834Sobrien 5327218822Sdim /* Check if SEC has been already linked during a reloceatable or 5328218822Sdim final link. */ 5329218822Sdim void (*_section_already_linked) (bfd *, struct bfd_section *, 5330218822Sdim struct bfd_link_info *); 5331218822Sdim 533277298Sobrien /* Routines to handle dynamic symbols and relocs. */ 533389857Sobrien#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 5334130561Sobrien NAME##_get_dynamic_symtab_upper_bound, \ 5335130561Sobrien NAME##_canonicalize_dynamic_symtab, \ 5336218822Sdim NAME##_get_synthetic_symtab, \ 5337130561Sobrien NAME##_get_dynamic_reloc_upper_bound, \ 5338130561Sobrien NAME##_canonicalize_dynamic_reloc 5339130561Sobrien 534091041Sobrien /* Get the amount of memory required to hold the dynamic symbols. */ 5341130561Sobrien long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); 534277298Sobrien /* Read in the dynamic symbols. */ 5343130561Sobrien long (*_bfd_canonicalize_dynamic_symtab) 5344130561Sobrien (bfd *, struct bfd_symbol **); 5345218822Sdim /* Create synthetized symbols. */ 5346218822Sdim long (*_bfd_get_synthetic_symtab) 5347218822Sdim (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, 5348218822Sdim struct bfd_symbol **); 534977298Sobrien /* Get the amount of memory required to hold the dynamic relocs. */ 5350130561Sobrien long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); 535177298Sobrien /* Read in the dynamic relocs. */ 5352130561Sobrien long (*_bfd_canonicalize_dynamic_reloc) 5353130561Sobrien (bfd *, arelent **, struct bfd_symbol **); 535433965Sjdp 535591041Sobrien /* Opposite endian version of this target. */ 535691041Sobrien const struct bfd_target * alternative_target; 535777298Sobrien 535891041Sobrien /* Data for use by back-end routines, which isn't 535991041Sobrien generic enough to belong in this structure. */ 5360130561Sobrien const void *backend_data; 536177298Sobrien 536233965Sjdp} bfd_target; 536391041Sobrien 5364130561Sobrienbfd_boolean bfd_set_default_target (const char *name); 536533965Sjdp 5366130561Sobrienconst bfd_target *bfd_find_target (const char *target_name, bfd *abfd); 536733965Sjdp 5368130561Sobrienconst char ** bfd_target_list (void); 536933965Sjdp 5370130561Sobrienconst bfd_target *bfd_search_for_target 5371130561Sobrien (int (*search_func) (const bfd_target *, void *), 5372130561Sobrien void *); 537360484Sobrien 5374104834Sobrien/* Extracted from format.c. */ 5375130561Sobrienbfd_boolean bfd_check_format (bfd *abfd, bfd_format format); 537633965Sjdp 5377130561Sobrienbfd_boolean bfd_check_format_matches 5378130561Sobrien (bfd *abfd, bfd_format format, char ***matching); 537933965Sjdp 5380130561Sobrienbfd_boolean bfd_set_format (bfd *abfd, bfd_format format); 538133965Sjdp 5382130561Sobrienconst char *bfd_format_string (bfd_format format); 538333965Sjdp 5384130561Sobrien/* Extracted from linker.c. */ 5385130561Sobrienbfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); 5386130561Sobrien 5387130561Sobrien#define bfd_link_split_section(abfd, sec) \ 5388130561Sobrien BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) 5389130561Sobrien 5390218822Sdimvoid bfd_section_already_linked (bfd *abfd, asection *sec, 5391218822Sdim struct bfd_link_info *info); 5392218822Sdim 5393218822Sdim#define bfd_section_already_linked(abfd, sec, info) \ 5394218822Sdim BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) 5395218822Sdim 5396130561Sobrien/* Extracted from simple.c. */ 5397130561Sobrienbfd_byte *bfd_simple_get_relocated_section_contents 5398130561Sobrien (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); 5399130561Sobrien 540033965Sjdp#ifdef __cplusplus 540133965Sjdp} 540233965Sjdp#endif 540333965Sjdp#endif 5404