Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/elf-bfd.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end data structures for ELF files.
    2    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    3    Free Software Foundation, Inc.
     2   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     3   2002, 2003 Free Software Foundation, Inc.
    44   Written by Cygnus Support.
    55
    6 This file is part of BFD, the Binary File Descriptor library.
    7 
    8 This program is free software; you can redistribute it and/or modify
    9 it under the terms of the GNU General Public License as published by
    10 the Free Software Foundation; either version 2 of the License, or
    11 (at your option) any later version.
    12 
    13 This program is distributed in the hope that it will be useful,
    14 but WITHOUT ANY WARRANTY; without even the implied warranty of
    15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 GNU General Public License for more details.
    17 
    18 You should have received a copy of the GNU General Public License
    19 along with this program; if not, write to the Free Software
    20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     6   This file is part of BFD, the Binary File Descriptor library.
     7
     8   This program is free software; you can redistribute it and/or modify
     9   it under the terms of the GNU General Public License as published by
     10   the Free Software Foundation; either version 2 of the License, or
     11   (at your option) any later version.
     12
     13   This program is distributed in the hope that it will be useful,
     14   but WITHOUT ANY WARRANTY; without even the implied warranty of
     15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16   GNU General Public License for more details.
     17
     18   You should have received a copy of the GNU General Public License
     19   along with this program; if not, write to the Free Software
     20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2121
    2222#ifndef _LIBELF_H_
     
    2929
    3030/* The number of entries in a section is its size divided by the size
    31    of a single entry.  This is normally only applicaable to reloc and
     31   of a single entry.  This is normally only applicable to reloc and
    3232   symbol table sections.  */
    3333#define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize)
    3434
    3535/* If size isn't specified as 64 or 32, NAME macro should fail.  */
     36/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
     37   remove whitespace added here, and thus will fail to concatenate
     38   the tokens.  */
    3639#ifndef NAME
    3740#if ARCH_SIZE==64
    38 #define NAME(x,y) CAT4(x,64,_,y)
     41#define NAME(x,y) CONCAT4 (x,64,_,y)
    3942#endif
    4043#if ARCH_SIZE==32
    41 #define NAME(x,y) CAT4(x,32,_,y)
     44#define NAME(x,y) CONCAT4 (x,32,_,y)
    4245#endif
    4346#endif
    4447
    4548#ifndef NAME
    46 #define NAME(x,y) CAT4(x,NOSIZE,_,y)
     49#define NAME(x,y) CONCAT4 (x,NOSIZE,_,y)
    4750#endif
    4851
     
    7881
    7982
     83struct elf_strtab_hash;
     84struct got_entry;
     85struct plt_entry;
     86
    8087/* ELF linker hash table entries.  */
    8188
     
    8794     set to -2 if the symbol is used by a reloc.  */
    8895  long indx;
    89 
    90   /* Symbol size.  */
    91   bfd_size_type size;
    9296
    9397  /* Symbol index as a dynamic symbol.  Initialized to -1, and remains
     
    108112  unsigned long dynstr_index;
    109113
     114  /* Hash value of the name computed using the ELF hash function.  */
     115  unsigned long elf_hash_value;
     116
    110117  /* If this is a weak defined symbol from a dynamic object, this
    111118     field points to a defined symbol with the same value, if there is
    112119     one.  Otherwise it is NULL.  */
    113120  struct elf_link_hash_entry *weakdef;
    114 
    115   /* If this symbol requires an entry in the global offset table, the
    116      processor specific backend uses this field to track usage and
    117      final offset.  We use a union and two names primarily to document
    118      the intent of any particular piece of code.  The field should be
    119      used as a count until size_dynamic_sections, at which point the
    120      contents of the .got is fixed.  Afterward, if this field is -1,
    121      then the symbol does not require a global offset table entry.  */
    122   union
    123     {
    124       bfd_signed_vma refcount;
    125       bfd_vma offset;
    126     } got;
    127 
    128   /* Same, but tracks a procedure linkage table entry.  */
    129   union
    130     {
    131       bfd_signed_vma refcount;
    132       bfd_vma offset;
    133     } plt;
    134121
    135122  /* If this symbol is used in the linker created sections, the processor
     
    156143     via offset/sizeof(target_void_pointer).  */
    157144  size_t vtable_entries_size;
    158   boolean *vtable_entries_used;
     145  bfd_boolean *vtable_entries_used;
    159146
    160147  /* Virtual table derivation info.  */
    161148  struct elf_link_hash_entry *vtable_parent;
    162149
     150  /* If this symbol requires an entry in the global offset table, the
     151     processor specific backend uses this field to track usage and
     152     final offset.  Two schemes are supported:  The first assumes that
     153     a symbol may only have one GOT entry, and uses REFCOUNT until
     154     size_dynamic_sections, at which point the contents of the .got is
     155     fixed.  Afterward, if OFFSET is -1, then the symbol does not
     156     require a global offset table entry.  The second scheme allows
     157     multiple GOT entries per symbol, managed via a linked list
     158     pointed to by GLIST.  */
     159  union gotplt_union
     160    {
     161      bfd_signed_vma refcount;
     162      bfd_vma offset;
     163      struct got_entry *glist;
     164      struct plt_entry *plist;
     165    } got;
     166
     167  /* Same, but tracks a procedure linkage table entry.  */
     168  union gotplt_union plt;
     169
     170  /* Symbol size.  */
     171  bfd_size_type size;
     172
    163173  /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.).  */
    164174  char type;
     
    166176  /* Symbol st_other value, symbol visibility.  */
    167177  unsigned char other;
    168 
    169   /* Hash value of the name computed using the ELF hash function.  */
    170   unsigned long elf_hash_value;
    171178
    172179  /* Some flags; legal values follow.  */
     
    199206     not currently set by all the backends.  */
    200207#define ELF_LINK_NON_GOT_REF 010000
     208  /* Symbol has a definition in a shared object.  */
     209#define ELF_LINK_DYNAMIC_DEF 020000
     210  /* Symbol is weak in all shared objects.  */
     211#define ELF_LINK_DYNAMIC_WEAK 040000
    201212};
    202213
     
    220231};
    221232
     233struct elf_link_loaded_list
     234{
     235  struct elf_link_loaded_list *next;
     236  bfd *abfd;
     237};
     238
     239/* Structures used by the eh_frame optimization code.  */
     240struct cie_header
     241{
     242  unsigned int length;
     243  unsigned int id;
     244};
     245
     246struct cie
     247{
     248  struct cie_header hdr;
     249  unsigned char version;
     250  unsigned char augmentation[20];
     251  unsigned int code_align;
     252  int data_align;
     253  unsigned int ra_column;
     254  unsigned int augmentation_size;
     255  struct elf_link_hash_entry *personality;
     256  unsigned char per_encoding;
     257  unsigned char lsda_encoding;
     258  unsigned char fde_encoding;
     259  unsigned char initial_insn_length;
     260  unsigned char make_relative;
     261  unsigned char make_lsda_relative;
     262  unsigned char initial_instructions[50];
     263};
     264
     265struct eh_cie_fde
     266{
     267  unsigned int offset;
     268  unsigned int size;
     269  asection *sec;
     270  unsigned int new_offset;
     271  unsigned char fde_encoding;
     272  unsigned char lsda_encoding;
     273  unsigned char lsda_offset;
     274  unsigned char cie : 1;
     275  unsigned char removed : 1;
     276  unsigned char make_relative : 1;
     277  unsigned char make_lsda_relative : 1;
     278  unsigned char per_encoding_relative : 1;
     279};
     280
     281struct eh_frame_sec_info
     282{
     283  unsigned int count;
     284  unsigned int alloced;
     285  struct eh_cie_fde entry[1];
     286};
     287
     288struct eh_frame_array_ent
     289{
     290  bfd_vma initial_loc;
     291  bfd_vma fde;
     292};
     293
     294struct eh_frame_hdr_info
     295{
     296  struct cie last_cie;
     297  asection *last_cie_sec;
     298  asection *hdr_sec;
     299  unsigned int last_cie_offset;
     300  unsigned int fde_count, array_count;
     301  struct eh_frame_array_ent *array;
     302  /* TRUE if .eh_frame_hdr should contain the sorted search table.
     303     We build it if we successfully read all .eh_frame input sections
     304     and recognize them.  */
     305  bfd_boolean table;
     306};
     307
     308/* Cached start, size and alignment of PT_TLS segment.  */
     309struct elf_link_tls_segment
     310{
     311  bfd_vma start;
     312  bfd_size_type size;
     313  unsigned int align;
     314};
     315
    222316/* ELF linker hash table.  */
    223317
     
    225319{
    226320  struct bfd_link_hash_table root;
     321
    227322  /* Whether we have created the special dynamic sections required
    228323     when linking against or generating a shared object.  */
    229   boolean dynamic_sections_created;
     324  bfd_boolean dynamic_sections_created;
     325
    230326  /* The BFD used to hold special sections created by the linker.
    231327     This will be the first BFD found which requires these sections to
    232328     be created.  */
    233329  bfd *dynobj;
     330
     331  /* The value to use when initialising got.refcount/offset and
     332     plt.refcount/offset in an elf_link_hash_entry.  Set to zero when
     333     the values are refcounts.  Set to init_offset in
     334     size_dynamic_sections when the values may be offsets.  */
     335  union gotplt_union init_refcount;
     336
     337  /* The value to use for got.refcount/offset and plt.refcount/offset
     338     when the values may be offsets.  Normally (bfd_vma) -1.  */
     339  union gotplt_union init_offset;
     340
    234341  /* The number of symbols found in the link which must be put into
    235342     the .dynsym section.  */
    236343  bfd_size_type dynsymcount;
     344
    237345  /* The string table of dynamic symbols, which becomes the .dynstr
    238346     section.  */
    239   struct bfd_strtab_hash *dynstr;
     347  struct elf_strtab_hash *dynstr;
     348
    240349  /* The number of buckets in the hash table in the .hash section.
    241350     This is based on the number of dynamic symbols.  */
    242351  bfd_size_type bucketcount;
     352
    243353  /* A linked list of DT_NEEDED names found in dynamic objects
    244354     included in the link.  */
    245355  struct bfd_link_needed_list *needed;
     356
    246357  /* The _GLOBAL_OFFSET_TABLE_ symbol.  */
    247358  struct elf_link_hash_entry *hgot;
     359
    248360  /* A pointer to information used to link stabs in sections.  */
    249361  PTR stab_info;
     362
     363  /* A pointer to information used to merge SEC_MERGE sections.  */
     364  PTR merge_info;
     365
     366  /* Used by eh_frame code when editing .eh_frame.  */
     367  struct eh_frame_hdr_info eh_info;
     368
    250369  /* A linked list of local symbols to be added to .dynsym.  */
    251370  struct elf_link_local_dynamic_entry *dynlocal;
     371
    252372  /* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic
    253373     objects included in the link.  */
    254374  struct bfd_link_needed_list *runpath;
     375
     376  /* Cached start, size and alignment of PT_TLS segment.  */
     377  struct elf_link_tls_segment *tls_segment;
     378
     379  /* A linked list of BFD's loaded in the link.  */
     380  struct elf_link_loaded_list *loaded;
    255381};
    256382
     
    267393  (bfd_link_hash_traverse                                               \
    268394   (&(table)->root,                                                     \
    269     (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func),  \
     395    (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
    270396    (info)))
    271397
     
    273399
    274400#define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash))
     401
     402/* Returns TRUE if the hash table is a struct elf_link_hash_table.  */
     403#define is_elf_hash_table(p)                                            \
     404  ((p)->hash->type == bfd_link_elf_hash_table)
     405
     406/* Used by bfd_section_from_r_symndx to cache a small number of local
     407   symbol to section mappings.  */
     408#define LOCAL_SYM_CACHE_SIZE 32
     409struct sym_sec_cache
     410{
     411  bfd *abfd;
     412  unsigned long indx[LOCAL_SYM_CACHE_SIZE];
     413  asection *sec[LOCAL_SYM_CACHE_SIZE];
     414};
    275415
    276416
     
    287427     relocation entry.  */
    288428  unsigned char int_rels_per_ext_rel;
     429  /* We use some fixed size arrays.  This should be large enough to
     430     handle all back-ends.  */
     431#define MAX_INT_RELS_PER_EXT_REL 3
    289432
    290433  unsigned char arch_size, file_align;
    291434  unsigned char elfclass, ev_current;
    292   int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
    293   boolean (*write_shdrs_and_ehdr) PARAMS ((bfd *));
    294   void (*write_relocs) PARAMS ((bfd *, asection *, PTR));
    295   void (*swap_symbol_out) PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
    296   boolean (*slurp_reloc_table)
    297     PARAMS ((bfd *, asection *, asymbol **, boolean));
    298   long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean));
    299   void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
    300   void (*swap_dyn_out) PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
    301 
    302   /* This function, if defined, is called to swap in a REL
    303      relocation.  If an external relocation corresponds to more than
    304      one internal relocation, then all relocations are swapped in at
    305      once.  */
     435  int (*write_out_phdrs)
     436    PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
     437  bfd_boolean (*write_shdrs_and_ehdr)
     438    PARAMS ((bfd *));
     439  void (*write_relocs)
     440    PARAMS ((bfd *, asection *, PTR));
     441  void (*swap_symbol_in)
     442    PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
     443  void (*swap_symbol_out)
     444    PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
     445  bfd_boolean (*slurp_reloc_table)
     446    PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
     447  long (*slurp_symbol_table)
     448    PARAMS ((bfd *, asymbol **, bfd_boolean));
     449  void (*swap_dyn_in)
     450    PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
     451  void (*swap_dyn_out)
     452    PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
     453
     454  /* This function is called to swap in a REL relocation.  If an
     455     external relocation corresponds to more than one internal
     456     relocation, then all relocations are swapped in at once.  */
    306457  void (*swap_reloc_in)
    307     PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *));
    308 
    309   /* This function, if defined, is called to swap out a REL
    310      relocation.  */
     458    PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
     459
     460  /* This function is called to swap out a REL relocation.  */
    311461  void (*swap_reloc_out)
    312     PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *));
    313 
    314   /* This function, if defined, is called to swap in a RELA
    315      relocation.  If an external relocation corresponds to more than
    316      one internal relocation, then all relocations are swapped in at
    317      once.  */
     462    PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
     463
     464  /* This function is called to swap in a RELA relocation.  If an
     465     external relocation corresponds to more than one internal
     466     relocation, then all relocations are swapped in at once.  */
    318467  void (*swap_reloca_in)
    319468    PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
    320469
    321   /* This function, if defined, is called to swap out a RELA
    322      relocation.  */
     470  /* This function is called to swap out a RELA relocation.  */
    323471  void (*swap_reloca_out)
    324472    PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
    325 
    326473};
    327474
     
    332479         : 0)
    333480
     481enum elf_reloc_type_class {
     482  reloc_class_normal,
     483  reloc_class_relative,
     484  reloc_class_plt,
     485  reloc_class_copy
     486};
     487
     488struct elf_reloc_cookie
     489{
     490  Elf_Internal_Rela *rels, *rel, *relend;
     491  Elf_Internal_Sym *locsyms;
     492  bfd *abfd;
     493  size_t locsymcount;
     494  size_t extsymoff;
     495  struct elf_link_hash_entry **sym_hashes;
     496  bfd_boolean bad_symtab;
     497};
     498
     499/* The level of IRIX compatibility we're striving for.  */
     500
     501typedef enum {
     502  ict_none,
     503  ict_irix5,
     504  ict_irix6
     505} irix_compat_t;
     506
    334507struct elf_backend_data
    335508{
     
    345518  /* A function to translate an ELF RELA relocation to a BFD arelent
    346519     structure.  */
    347   void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
    348                                     Elf_Internal_Rela *));
     520  void (*elf_info_to_howto)
     521    PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
    349522
    350523  /* A function to translate an ELF REL relocation to a BFD arelent
    351524     structure.  */
    352   void (*elf_info_to_howto_rel) PARAMS ((bfd *, arelent *,
    353                                          Elf_Internal_Rel *));
     525  void (*elf_info_to_howto_rel)
     526    PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
    354527
    355528  /* A function to determine whether a symbol is global when
     
    358531     thing will be done.  MIPS ELF, at least on the Irix 5, has
    359532     special requirements.  */
    360   boolean (*elf_backend_sym_is_global) PARAMS ((bfd *, asymbol *));
     533  bfd_boolean (*elf_backend_sym_is_global)
     534    PARAMS ((bfd *, asymbol *));
    361535
    362536  /* The remaining functions are hooks which are called only if they
     
    367541     permit the backend to set any global information it wishes.  When
    368542     this is called elf_elfheader is set, but anything else should be
    369      used with caution.  If this returns false, the check_format
     543     used with caution.  If this returns FALSE, the check_format
    370544     routine will return a bfd_error_wrong_format error.  */
    371   boolean (*elf_backend_object_p) PARAMS ((bfd *));
     545  bfd_boolean (*elf_backend_object_p)
     546    PARAMS ((bfd *));
    372547
    373548  /* A function to do additional symbol processing when reading the
    374549     ELF symbol table.  This is where any processor-specific special
    375550     section indices are handled.  */
    376   void (*elf_backend_symbol_processing) PARAMS ((bfd *, asymbol *));
     551  void (*elf_backend_symbol_processing)
     552    PARAMS ((bfd *, asymbol *));
    377553
    378554  /* A function to do additional symbol processing after reading the
    379555     entire ELF symbol table.  */
    380   boolean (*elf_backend_symbol_table_processing) PARAMS ((bfd *,
    381                                                           elf_symbol_type *,
    382                                                           unsigned int));
     556  bfd_boolean (*elf_backend_symbol_table_processing)
     557    PARAMS ((bfd *, elf_symbol_type *, unsigned int));
    383558
    384559   /* A function to set the type of the info field.  Processor-specific
    385560     types should be handled here.  */
    386   int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int));
     561  int (*elf_backend_get_symbol_type)
     562    PARAMS (( Elf_Internal_Sym *, int));
    387563
    388564  /* A function to do additional processing on the ELF section header
     
    390566     type fields for some sections, or to actually write out data for
    391567     unusual sections.  */
    392   boolean (*elf_backend_section_processing) PARAMS ((bfd *,
    393                                                      Elf32_Internal_Shdr *));
     568  bfd_boolean (*elf_backend_section_processing)
     569    PARAMS ((bfd *, Elf_Internal_Shdr *));
    394570
    395571  /* A function to handle unusual section types when creating BFD
    396572     sections from ELF sections.  */
    397   boolean (*elf_backend_section_from_shdr) PARAMS ((bfd *,
    398                                                     Elf32_Internal_Shdr *,
    399                                                     char *));
     573  bfd_boolean (*elf_backend_section_from_shdr)
     574    PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
    400575
    401576  /* A function to convert machine dependent section header flags to
    402577     BFD internal section header flags.  */
    403   boolean (*elf_backend_section_flags) PARAMS ((flagword *,
    404                                                 Elf32_Internal_Shdr *));
     578  bfd_boolean (*elf_backend_section_flags)
     579    PARAMS ((flagword *, Elf_Internal_Shdr *));
    405580
    406581  /* A function to handle unusual program segment types when creating BFD
    407582     sections from ELF program segments.  */
    408   boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
    409                                                     Elf32_Internal_Phdr *,
    410                                                     int));
     583  bfd_boolean (*elf_backend_section_from_phdr)
     584    PARAMS ((bfd *, Elf_Internal_Phdr *, int));
    411585
    412586  /* A function to set up the ELF section header for a BFD section in
    413587     preparation for writing it out.  This is where the flags and type
    414588     fields are set for unusual sections.  */
    415   boolean (*elf_backend_fake_sections) PARAMS ((bfd *, Elf32_Internal_Shdr *,
    416                                                 asection *));
     589  bfd_boolean (*elf_backend_fake_sections)
     590    PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
    417591
    418592  /* A function to get the ELF section index for a BFD section.  If
    419      this returns true, the section was found.  If it is a normal ELF
     593     this returns TRUE, the section was found.  If it is a normal ELF
    420594     section, *RETVAL should be left unchanged.  If it is not a normal
    421595     ELF section *RETVAL should be set to the SHN_xxxx index.  */
    422   boolean (*elf_backend_section_from_bfd_section)
    423     PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *retval));
     596  bfd_boolean (*elf_backend_section_from_bfd_section)
     597    PARAMS ((bfd *, asection *, int *retval));
    424598
    425599  /* If this field is not NULL, it is called by the add_symbols phase
     
    431605     indices, and must set at least *FLAGS and *SEC for each processor
    432606     dependent case; failure to do so will cause a link error.  */
    433   boolean (*elf_add_symbol_hook)
     607  bfd_boolean (*elf_add_symbol_hook)
    434608    PARAMS ((bfd *abfd, struct bfd_link_info *info,
    435609             const Elf_Internal_Sym *, const char **name,
     
    438612  /* If this field is not NULL, it is called by the elf_link_output_sym
    439613     phase of a link for each symbol which will appear in the object file.  */
    440   boolean (*elf_backend_link_output_symbol_hook)
     614  bfd_boolean (*elf_backend_link_output_symbol_hook)
    441615    PARAMS ((bfd *, struct bfd_link_info *info, const char *,
    442616             Elf_Internal_Sym *, asection *));
     
    450624     desired.  This function will normally create the .got and .plt
    451625     sections, but different backends have different requirements.  */
    452   boolean (*elf_backend_create_dynamic_sections)
     626  bfd_boolean (*elf_backend_create_dynamic_sections)
    453627    PARAMS ((bfd *abfd, struct bfd_link_info *info));
    454628
     
    463637     actually uses Rel structures, the r_addend field will always be
    464638     zero.  */
    465   boolean (*check_relocs)
     639  bfd_boolean (*check_relocs)
    466640    PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
    467641             const Elf_Internal_Rela *relocs));
     
    479653     entry to the .plt or .got or some such section, and setting the
    480654     symbol to point to that.  */
    481   boolean (*elf_backend_adjust_dynamic_symbol)
     655  bfd_boolean (*elf_backend_adjust_dynamic_symbol)
    482656    PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h));
    483657
     
    486660     section sizes have been set.  This is called after
    487661     ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS.  */
    488   boolean (*elf_backend_always_size_sections)
     662  bfd_boolean (*elf_backend_always_size_sections)
    489663    PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
    490664
     
    499673     .interp section and any sections created by the
    500674     CREATE_DYNAMIC_SECTIONS entry point.  */
    501   boolean (*elf_backend_size_dynamic_sections)
     675  bfd_boolean (*elf_backend_size_dynamic_sections)
    502676    PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
    503677
     
    530704     section, which means that the addend must be adjusted
    531705     accordingly.  */
    532   boolean (*elf_backend_relocate_section)
     706  bfd_boolean (*elf_backend_relocate_section)
    533707    PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
    534708             bfd *input_bfd, asection *input_section, bfd_byte *contents,
     
    543717     all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called
    544718     on those symbols which are defined by a dynamic object.  */
    545   boolean (*elf_backend_finish_dynamic_symbol)
     719  bfd_boolean (*elf_backend_finish_dynamic_symbol)
    546720    PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
    547721             struct elf_link_hash_entry *h, Elf_Internal_Sym *sym));
     
    551725     output file.  The FINISH_DYNAMIC_SYMBOL will have been called on
    552726     all dynamic symbols.  */
    553   boolean (*elf_backend_finish_dynamic_sections)
     727  bfd_boolean (*elf_backend_finish_dynamic_sections)
    554728    PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
    555729
     
    560734
    561735  /* A function to do any final processing needed for the ELF file
    562      before writing it out.  The LINKER argument is true if this BFD
     736     before writing it out.  The LINKER argument is TRUE if this BFD
    563737     was created by the ELF backend linker.  */
    564738  void (*elf_backend_final_write_processing)
    565     PARAMS ((bfd *, boolean linker));
     739    PARAMS ((bfd *, bfd_boolean linker));
    566740
    567741  /* This function is called by get_program_header_size.  It should
    568742     return the number of additional program segments which this BFD
    569743     will need.  It should return -1 on error.  */
    570   int (*elf_backend_additional_program_headers) PARAMS ((bfd *));
     744  int (*elf_backend_additional_program_headers)
     745    PARAMS ((bfd *));
    571746
    572747  /* This function is called to modify an existing segment map in a
    573748     backend specific fashion.  */
    574   boolean (*elf_backend_modify_segment_map) PARAMS ((bfd *));
     749  bfd_boolean (*elf_backend_modify_segment_map)
     750    PARAMS ((bfd *));
    575751
    576752  /* This function is called during section gc to discover the section a
    577      particular relocation refers to.  It need not be defined for hosts
    578      that have no queer relocation types.  */
     753     particular relocation refers to.  */
    579754  asection * (*gc_mark_hook)
    580     PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *,
     755    PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *,
    581756             struct elf_link_hash_entry *h, Elf_Internal_Sym *));
    582757
     
    584759     in order that a backend might update any data structures it might
    585760     be maintaining.  */
    586   boolean (*gc_sweep_hook)
     761  bfd_boolean (*gc_sweep_hook)
    587762    PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
    588763             const Elf_Internal_Rela *relocs));
     
    604779     section.  It allows the backend to emit special global symbols
    605780     not handled in the hash table.  */
    606   boolean (*elf_backend_output_arch_syms)
     781  bfd_boolean (*elf_backend_output_arch_syms)
    607782    PARAMS ((bfd *, struct bfd_link_info *, PTR,
    608             boolean (*) PARAMS ((PTR, const char *,
    609              Elf_Internal_Sym *, asection *))));
     783            bfd_boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *)));
    610784
    611785  /* Copy any information related to dynamic linking from a pre-existing
    612      symbol IND to a newly created symbol DIR.  */
     786     symbol to a newly created symbol.  Also called to copy flags and
     787     other back-end info to a weakdef, in which case the symbol is not
     788     newly created and plt/got refcounts and dynamic indices should not
     789     be copied.  */
    613790  void (*elf_backend_copy_indirect_symbol)
    614     PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
     791    PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
     792             struct elf_link_hash_entry *));
    615793
    616794  /* Modify any information related to dynamic linking such that the
    617795     symbol is not exported.  */
    618796  void (*elf_backend_hide_symbol)
    619     PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
     797    PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
     798
     799  /* Emit relocations.  Overrides default routine for emitting relocs,
     800     except during a relocatable link, or if all relocs are being emitted.  */
     801  bfd_boolean (*elf_backend_emit_relocs)
     802    PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
     803
     804  /* Count relocations.  Not called for relocatable links
     805     or if all relocs are being preserved in the output.  */
     806  unsigned int (*elf_backend_count_relocs)
     807    PARAMS ((asection *, Elf_Internal_Rela *));
     808
     809  /* This function, if defined, is called when an NT_PRSTATUS note is found
     810     in a core file. */
     811  bfd_boolean (*elf_backend_grok_prstatus)
     812    PARAMS ((bfd *, Elf_Internal_Note *));
     813
     814  /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO
     815     note is found in a core file. */
     816  bfd_boolean (*elf_backend_grok_psinfo)
     817    PARAMS ((bfd *, Elf_Internal_Note *));
     818
     819  /* Functions to print VMAs.  Special code to handle 64 bit ELF files.  */
     820  void (* elf_backend_sprintf_vma)
     821    PARAMS ((bfd *, char *, bfd_vma));
     822  void (* elf_backend_fprintf_vma)
     823    PARAMS ((bfd *, PTR, bfd_vma));
     824
     825  /* This function returns class of a reloc type.  */
     826  enum elf_reloc_type_class (*elf_backend_reloc_type_class)
     827    PARAMS ((const Elf_Internal_Rela *));
     828
     829  /* This function, if defined, removes information about discarded functions
     830     from other sections which mention them.  */
     831  bfd_boolean (*elf_backend_discard_info)
     832    PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *));
     833
     834  /* This function, if defined, signals that the function above has removed
     835     the discarded relocations for this section.  */
     836  bfd_boolean (*elf_backend_ignore_discarded_relocs)
     837    PARAMS ((asection *));
     838
     839  /* This function, if defined, may write out the given section.
     840     Returns TRUE if it did so and FALSE if the caller should.  */
     841  bfd_boolean (*elf_backend_write_section)
     842    PARAMS ((bfd *, asection *, bfd_byte *));
     843
     844  /* The level of IRIX compatibility we're striving for.
     845     MIPS ELF specific function.  */
     846  irix_compat_t (*elf_backend_mips_irix_compat)
     847    PARAMS ((bfd *));
     848
     849  reloc_howto_type *(*elf_backend_mips_rtype_to_howto)
     850    PARAMS ((unsigned int, bfd_boolean));
    620851
    621852  /* The swapping table to use when dealing with ECOFF information.
     
    638869  bfd_vma plt_header_size;
    639870
    640   /* This is true if the linker should act like collect and gather
    641      global constructors and destructors by name.  This is true for
     871  /* This is TRUE if the linker should act like collect and gather
     872     global constructors and destructors by name.  This is TRUE for
    642873     MIPS ELF because the Irix 5 tools can not handle the .init
    643874     section.  */
    644875  unsigned collect : 1;
    645876
    646   /* This is true if the linker should ignore changes to the type of a
    647      symbol.  This is true for MIPS ELF because some Irix 5 objects
     877  /* This is TRUE if the linker should ignore changes to the type of a
     878     symbol.  This is TRUE for MIPS ELF because some Irix 5 objects
    648879     record undefined functions as STT_OBJECT although the definitions
    649880     are STT_FUNC.  */
     
    667898  unsigned default_use_rela_p : 1;
    668899
    669   /* True if addresses "naturally" sign extend.  This is used when
     900  /* Set if RELA relocations for a relocatable link can be handled by
     901     generic code.  Backends that set this flag need do nothing in the
     902     backend relocate_section routine for relocatable linking.  */
     903  unsigned rela_normal : 1;
     904
     905  /* TRUE if addresses "naturally" sign extend.  This is used when
    670906     swapping in from Elf32 when BFD64.  */
    671907  unsigned sign_extend_vma : 1;
     
    677913  unsigned plt_alignment : 4;
    678914  unsigned can_gc_sections : 1;
     915  unsigned can_refcount : 1;
     916  unsigned want_got_sym : 1;
    679917  unsigned want_dynbss : 1;
     918    /* Targets which do not support physical addressing often require
     919       that the p_paddr field in the section header to be set to zero.
     920       This field indicates whether this behavior is required.  */
     921  unsigned want_p_paddr_set_to_zero : 1;
    680922};
    681923
     
    687929  /* The ELF header for this section.  */
    688930  Elf_Internal_Shdr this_hdr;
     931
    689932  /* The ELF header for the reloc section associated with this
    690933     section, if any.  */
    691934  Elf_Internal_Shdr rel_hdr;
     935
    692936  /* If there is a second reloc section associated with this section,
    693937     as can happen on Irix 6, this field points to the header.  */
    694938  Elf_Internal_Shdr *rel_hdr2;
     939
    695940  /* The number of relocations currently assigned to REL_HDR.  */
    696941  unsigned int rel_count;
     942
    697943  /* The number of relocations currently assigned to REL_HDR2.  */
    698944  unsigned int rel_count2;
     945
    699946  /* The ELF section number of this section.  Only used for an output
    700947     file.  */
    701948  int this_idx;
     949
    702950  /* The ELF section number of the reloc section indicated by
    703951     REL_HDR if any.  Only used for an output file.  */
    704952  int rel_idx;
     953
    705954  /* The ELF section number of the reloc section indicated by
    706955     REL_HDR2 if any.  Only used for an output file.  */
    707956  int rel_idx2;
     957
     958  /* Used by the backend linker when generating a shared library to
     959     record the dynamic symbol index for a section symbol
     960     corresponding to this section.  A value of 0 means that there is
     961     no dynamic symbol for this section.  */
     962  int dynindx;
     963
    708964  /* Used by the backend linker to store the symbol hash table entries
    709965     associated with relocs against global symbols.  */
    710966  struct elf_link_hash_entry **rel_hashes;
     967
    711968  /* A pointer to the swapped relocs.  If the section uses REL relocs,
    712969     rather than RELA, all the r_addend fields will be zero.  This
    713970     pointer may be NULL.  It is used by the backend linker.  */
    714971  Elf_Internal_Rela *relocs;
    715   /* Used by the backend linker when generating a shared library to
    716      record the dynamic symbol index for a section symbol
    717      corresponding to this section.  A value of 0 means that there is
    718      no dynamic symbol for this section.  */
    719   long dynindx;
    720   /* A pointer used for .stab linking optimizations.  */
    721   PTR stab_info;
    722   /* A pointer available for the processor specific ELF backend.  */
    723   PTR tdata;
    724   /* Nonzero if this section uses RELA relocations, rather than REL.  */
    725   unsigned int use_rela_p:1;
     972
     973  /* A pointer to a linked list tracking dynamic relocs copied for
     974     local symbols.  */
     975  PTR local_dynrel;
     976
     977  /* A pointer to the bfd section used for dynamic relocs.  */
     978  asection *sreloc;
     979
     980  union {
     981    /* Group name, if this section is a member of a group.  */
     982    const char *name;
     983
     984    /* Group signature sym, if this is the SHT_GROUP section.  */
     985    struct symbol_cache_entry *id;
     986  } group;
     987
     988  /* A linked list of sections in the group.  Circular when used by
     989     the linker.  */
     990  asection *next_in_group;
     991
     992  /* A pointer used for various section optimizations.  */
     993  PTR sec_info;
    726994};
    727995
    728996#define elf_section_data(sec)  ((struct bfd_elf_section_data*)sec->used_by_bfd)
     997#define elf_group_name(sec)    (elf_section_data(sec)->group.name)
     998#define elf_group_id(sec)      (elf_section_data(sec)->group.id)
     999#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group)
     1000
     1001/* Return TRUE if section has been discarded.  */
     1002#define elf_discarded_section(sec)                              \
     1003  (!bfd_is_abs_section (sec)                                    \
     1004   && bfd_is_abs_section ((sec)->output_section)                \
     1005   && sec->sec_info_type != ELF_INFO_TYPE_MERGE                 \
     1006   && sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
    7291007
    7301008#define get_elf_backend_data(abfd) \
     
    7601038  bfd_vma max_hole_offset;              /* maximum offset for the hole */
    7611039  elf_linker_section_enum_t which;      /* which section this is */
    762   boolean hole_written_p;               /* whether the hole has been initialized */
     1040  bfd_boolean hole_written_p;           /* whether the hole has been initialized */
    7631041  unsigned int alignment;               /* alignment for the section */
    7641042  flagword flags;                       /* flags to use to create the section */
     
    7721050  struct elf_linker_section_pointers *next;     /* next allocated pointer for this symbol */
    7731051  bfd_vma offset;                               /* offset of pointer from beginning of section */
    774   bfd_signed_vma addend;                        /* addend used */
     1052  bfd_vma addend;                               /* addend used */
    7751053  elf_linker_section_enum_t which;              /* which linker section this is */
    776   boolean written_address_p;                    /* whether address was written yet */
     1054  bfd_boolean written_address_p;                /* whether address was written yet */
    7771055} elf_linker_section_pointers_t;
    7781056
     
    7861064  Elf_Internal_Phdr *phdr;
    7871065  struct elf_segment_map *segment_map;
    788   struct bfd_strtab_hash *strtab_ptr;
     1066  struct elf_strtab_hash *strtab_ptr;
    7891067  int num_locals;
    7901068  int num_globals;
     1069  unsigned int num_elf_sections;        /* elf_sect_ptr size */
     1070  int num_section_syms;
    7911071  asymbol **section_syms;               /* STT_SECTION symbols for each section */
    7921072  Elf_Internal_Shdr symtab_hdr;
     
    7981078  Elf_Internal_Shdr dynverref_hdr;
    7991079  Elf_Internal_Shdr dynverdef_hdr;
     1080  Elf_Internal_Shdr symtab_shndx_hdr;
    8001081  unsigned int symtab_section, shstrtab_section;
    8011082  unsigned int strtab_section, dynsymtab_section;
     1083  unsigned int symtab_shndx_section;
    8021084  unsigned int dynversym_section, dynverdef_section, dynverref_section;
    8031085  file_ptr next_file_pos;
     
    8081090  void *prpsinfo;                       /* The raw /proc prpsinfo structure */
    8091091#endif
    810   bfd_vma gp;                           /* The gp value (MIPS only, for now) */
    811   unsigned int gp_size;                 /* The gp size (MIPS only, for now) */
     1092  bfd_vma gp;                           /* The gp value */
     1093  unsigned int gp_size;                 /* The gp size */
     1094
     1095  Elf_Internal_Shdr **group_sect_ptr;
     1096  int num_group;
    8121097
    8131098  /* Information grabbed from an elf core file.  */
     
    8181103  char* core_command;
    8191104
    820   /* This is set to true if the object was created by the backend
     1105  /* This is set to TRUE if the object was created by the backend
    8211106     linker.  */
    822   boolean linker;
     1107  bfd_boolean linker;
    8231108
    8241109  /* A mapping from external symbols to entries in the linker hash
     
    8271112  struct elf_link_hash_entry **sym_hashes;
    8281113
    829   /* A mapping from local symbols to offsets into the global offset
    830      table, used when linking.  This is indexed by the symbol index.
    831      Like for the globals, we use a union and two names primarily to
    832      document the intent of any particular piece of code.  The field
    833      should be used as a count until size_dynamic_sections, at which
    834      point the contents of the .got is fixed.  Afterward, if an entry
    835      is -1, then the symbol does not require a global offset table entry.  */
     1114  /* Track usage and final offsets of GOT entries for local symbols.
     1115     This array is indexed by symbol index.  Elements are used
     1116     identically to "got" in struct elf_link_hash_entry.  */
    8361117  union
    8371118    {
    8381119      bfd_signed_vma *refcounts;
    8391120      bfd_vma *offsets;
     1121      struct got_entry **ents;
    8401122    } local_got;
    8411123
     
    8671149     sh_info field in the symbol table header, and always read all the
    8681150     symbols.  */
    869   boolean bad_symtab;
     1151  bfd_boolean bad_symtab;
    8701152
    8711153  /* Records the result of `get_program_header_size'.  */
     
    8921174  asection **local_stubs;
    8931175
     1176  /* Used to determine if PT_GNU_EH_FRAME segment header should be
     1177     created.  */
     1178  asection *eh_frame_hdr;
     1179
    8941180  /* Used to determine if the e_flags field has been initialized */
    895   boolean flags_init;
     1181  bfd_boolean flags_init;
    8961182
    8971183  /* Number of symbol version definitions we are about to emit.  */
     
    9211207#define elf_elfheader(bfd)      (elf_tdata(bfd) -> elf_header)
    9221208#define elf_elfsections(bfd)    (elf_tdata(bfd) -> elf_sect_ptr)
     1209#define elf_numsections(bfd)    (elf_tdata(bfd) -> num_elf_sections)
    9231210#define elf_shstrtab(bfd)       (elf_tdata(bfd) -> strtab_ptr)
    9241211#define elf_onesymtab(bfd)      (elf_tdata(bfd) -> symtab_section)
     1212#define elf_symtab_shndx(bfd)   (elf_tdata(bfd) -> symtab_shndx_section)
    9251213#define elf_dynsymtab(bfd)      (elf_tdata(bfd) -> dynsymtab_section)
    9261214#define elf_dynversym(bfd)      (elf_tdata(bfd) -> dynversym_section)
     
    9301218#define elf_num_globals(bfd)    (elf_tdata(bfd) -> num_globals)
    9311219#define elf_section_syms(bfd)   (elf_tdata(bfd) -> section_syms)
     1220#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> num_section_syms)
    9321221#define core_prpsinfo(bfd)      (elf_tdata(bfd) -> prpsinfo)
    9331222#define core_prstatus(bfd)      (elf_tdata(bfd) -> prstatus)
     
    9371226#define elf_local_got_refcounts(bfd) (elf_tdata(bfd) -> local_got.refcounts)
    9381227#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets)
     1228#define elf_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents)
    9391229#define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers)
    9401230#define elf_dt_name(bfd)        (elf_tdata(bfd) -> dt_name)
     
    9661256  PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *));
    9671257
    968 extern int _bfd_elf_section_from_bfd_section PARAMS ((bfd *, asection *));
     1258extern int _bfd_elf_section_from_bfd_section
     1259  PARAMS ((bfd *, asection *));
    9691260extern char *bfd_elf_string_from_elf_section
    9701261  PARAMS ((bfd *, unsigned, unsigned));
    971 extern char *bfd_elf_get_str_section PARAMS ((bfd *, unsigned));
    972 
    973 extern boolean _bfd_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
    974 extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *,
    975                                           bfd_print_symbol_type));
    976 #define elf_string_from_elf_strtab(abfd,strindex) \
    977      bfd_elf_string_from_elf_section(abfd,elf_elfheader(abfd)->e_shstrndx,strindex)
     1262extern char *bfd_elf_get_str_section
     1263  PARAMS ((bfd *, unsigned));
     1264extern Elf_Internal_Sym *bfd_elf_get_elf_syms
     1265  PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t,
     1266           Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *));
     1267extern const char *bfd_elf_local_sym_name
     1268  PARAMS ((bfd *, Elf_Internal_Sym *));
     1269
     1270extern bfd_boolean _bfd_elf_copy_private_bfd_data
     1271  PARAMS ((bfd *, bfd *));
     1272extern bfd_boolean _bfd_elf_print_private_bfd_data
     1273  PARAMS ((bfd *, PTR));
     1274extern void bfd_elf_print_symbol
     1275  PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
     1276
     1277#define elf_string_from_elf_strtab(abfd, strindex) \
     1278  bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \
     1279                                  strindex)
    9781280
    9791281#define bfd_elf32_print_symbol  bfd_elf_print_symbol
    9801282#define bfd_elf64_print_symbol  bfd_elf_print_symbol
    9811283
    982 extern unsigned long bfd_elf_hash PARAMS ((const char *));
    983 
    984 extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *,
    985                                                             arelent *,
    986                                                             asymbol *,
    987                                                             PTR,
    988                                                             asection *,
    989                                                             bfd *,
    990                                                             char **));
    991 extern boolean bfd_elf_mkobject PARAMS ((bfd *));
    992 extern boolean bfd_elf_mkcorefile PARAMS ((bfd *));
    993 extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *));
    994 extern boolean _bfd_elf_make_section_from_shdr
    995   PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name));
    996 extern boolean _bfd_elf_make_section_from_phdr
    997   PARAMS ((bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename));
     1284extern void _bfd_elf_sprintf_vma
     1285  PARAMS ((bfd *, char *, bfd_vma));
     1286extern void _bfd_elf_fprintf_vma
     1287  PARAMS ((bfd *, PTR, bfd_vma));
     1288
     1289extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
     1290  PARAMS ((const Elf_Internal_Rela *));
     1291extern bfd_vma _bfd_elf_rela_local_sym
     1292  PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *));
     1293extern bfd_vma _bfd_elf_rel_local_sym
     1294  PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma));
     1295extern bfd_vma _bfd_elf_section_offset
     1296  PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma));
     1297
     1298extern unsigned long bfd_elf_hash
     1299  PARAMS ((const char *));
     1300
     1301extern bfd_reloc_status_type bfd_elf_generic_reloc
     1302  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
     1303extern bfd_boolean bfd_elf_mkobject
     1304  PARAMS ((bfd *));
     1305extern bfd_boolean bfd_elf_mkcorefile
     1306  PARAMS ((bfd *));
     1307extern Elf_Internal_Shdr *bfd_elf_find_section
     1308  PARAMS ((bfd *, char *));
     1309extern bfd_boolean _bfd_elf_make_section_from_shdr
     1310  PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
     1311extern bfd_boolean _bfd_elf_make_section_from_phdr
     1312  PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *));
    9981313extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
    9991314  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
     
    10011316  PARAMS ((bfd *));
    10021317extern void _bfd_elf_link_hash_copy_indirect
    1003   PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
     1318  PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
     1319           struct elf_link_hash_entry *));
    10041320extern void _bfd_elf_link_hash_hide_symbol
    1005   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
    1006 extern boolean _bfd_elf_link_hash_table_init
     1321  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
     1322extern bfd_boolean _bfd_elf_link_hash_table_init
    10071323  PARAMS ((struct elf_link_hash_table *, bfd *,
    10081324           struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
    10091325                                       struct bfd_hash_table *,
    10101326                                       const char *)));
    1011 extern boolean _bfd_elf_slurp_version_tables PARAMS ((bfd *));
    1012 
    1013 extern boolean _bfd_elf_copy_private_symbol_data
     1327extern bfd_boolean _bfd_elf_slurp_version_tables
     1328  PARAMS ((bfd *));
     1329extern bfd_boolean _bfd_elf_merge_sections
     1330  PARAMS ((bfd *, struct bfd_link_info *));
     1331extern bfd_boolean bfd_elf_discard_group
     1332  PARAMS ((bfd *, struct sec *));
     1333extern void bfd_elf_set_group_contents
     1334  PARAMS ((bfd *, asection *, PTR));
     1335extern void _bfd_elf_link_just_syms
     1336  PARAMS ((asection *, struct bfd_link_info *));
     1337extern bfd_boolean _bfd_elf_copy_private_symbol_data
    10141338  PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
    1015 extern boolean _bfd_elf_copy_private_section_data
     1339extern bfd_boolean _bfd_elf_copy_private_section_data
    10161340  PARAMS ((bfd *, asection *, bfd *, asection *));
    1017 extern boolean _bfd_elf_write_object_contents PARAMS ((bfd *));
    1018 extern boolean _bfd_elf_write_corefile_contents PARAMS ((bfd *));
    1019 extern boolean _bfd_elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
    1020                                                        file_ptr,
    1021                                                        bfd_size_type));
    1022 extern long _bfd_elf_get_symtab_upper_bound PARAMS ((bfd *));
    1023 extern long _bfd_elf_get_symtab PARAMS ((bfd *, asymbol **));
    1024 extern long _bfd_elf_get_dynamic_symtab_upper_bound PARAMS ((bfd *));
    1025 extern long _bfd_elf_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **));
    1026 extern long _bfd_elf_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
    1027 extern long _bfd_elf_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
    1028                                                   arelent **, asymbol **));
    1029 extern long _bfd_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
    1030 extern long _bfd_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **,
    1031                                                          asymbol **));
    1032 extern asymbol *_bfd_elf_make_empty_symbol PARAMS ((bfd *));
    1033 extern void _bfd_elf_get_symbol_info PARAMS ((bfd *, asymbol *,
    1034                                                symbol_info *));
    1035 extern boolean _bfd_elf_is_local_label_name PARAMS ((bfd *, const char *));
    1036 extern alent *_bfd_elf_get_lineno PARAMS ((bfd *, asymbol *));
    1037 extern boolean _bfd_elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
    1038                                                 unsigned long));
    1039 extern boolean _bfd_elf_find_nearest_line PARAMS ((bfd *, asection *,
    1040                                                     asymbol **,
    1041                                                     bfd_vma, const char **,
    1042                                                     const char **,
    1043                                                     unsigned int *));
     1341extern bfd_boolean _bfd_elf_write_object_contents
     1342  PARAMS ((bfd *));
     1343extern bfd_boolean _bfd_elf_write_corefile_contents
     1344  PARAMS ((bfd *));
     1345extern bfd_boolean _bfd_elf_set_section_contents
     1346  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     1347extern long _bfd_elf_get_symtab_upper_bound
     1348  PARAMS ((bfd *));
     1349extern long _bfd_elf_get_symtab
     1350  PARAMS ((bfd *, asymbol **));
     1351extern long _bfd_elf_get_dynamic_symtab_upper_bound
     1352  PARAMS ((bfd *));
     1353extern long _bfd_elf_canonicalize_dynamic_symtab
     1354  PARAMS ((bfd *, asymbol **));
     1355extern long _bfd_elf_get_reloc_upper_bound
     1356  PARAMS ((bfd *, sec_ptr));
     1357extern long _bfd_elf_canonicalize_reloc
     1358  PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
     1359extern long _bfd_elf_get_dynamic_reloc_upper_bound
     1360  PARAMS ((bfd *));
     1361extern long _bfd_elf_canonicalize_dynamic_reloc
     1362  PARAMS ((bfd *, arelent **, asymbol **));
     1363extern asymbol *_bfd_elf_make_empty_symbol
     1364  PARAMS ((bfd *));
     1365extern void _bfd_elf_get_symbol_info
     1366  PARAMS ((bfd *, asymbol *, symbol_info *));
     1367extern bfd_boolean _bfd_elf_is_local_label_name
     1368  PARAMS ((bfd *, const char *));
     1369extern alent *_bfd_elf_get_lineno
     1370  PARAMS ((bfd *, asymbol *));
     1371extern bfd_boolean _bfd_elf_set_arch_mach
     1372  PARAMS ((bfd *, enum bfd_architecture, unsigned long));
     1373extern bfd_boolean _bfd_elf_find_nearest_line
     1374  PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
     1375           const char **, unsigned int *));
    10441376#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
    10451377#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
    1046 extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean));
    1047 extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *));
    1048 extern boolean _bfd_elf_init_reloc_shdr
    1049   PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean));
     1378extern int _bfd_elf_sizeof_headers
     1379  PARAMS ((bfd *, bfd_boolean));
     1380extern bfd_boolean _bfd_elf_new_section_hook
     1381  PARAMS ((bfd *, asection *));
     1382extern bfd_boolean _bfd_elf_init_reloc_shdr
     1383  PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean));
    10501384
    10511385/* If the target doesn't have reloc handling written yet:  */
    1052 extern void _bfd_elf_no_info_to_howto PARAMS ((bfd *, arelent *,
    1053                                                Elf_Internal_Rela *));
    1054 
    1055 extern boolean bfd_section_from_shdr PARAMS ((bfd *, unsigned int shindex));
    1056 extern boolean bfd_section_from_phdr PARAMS ((bfd *, Elf_Internal_Phdr *, int));
    1057 
    1058 extern int _bfd_elf_symbol_from_bfd_symbol PARAMS ((bfd *, asymbol **));
    1059 
    1060 asection *bfd_section_from_elf_index PARAMS ((bfd *, unsigned int));
    1061 boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *,
    1062                                                   struct bfd_link_info *));
    1063 struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void));
    1064 boolean
    1065 _bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *,
    1066                                              struct elf_link_hash_entry *));
    1067 long
    1068 _bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *,
    1069                                             bfd *, long));
    1070 boolean
    1071 _bfd_elf_compute_section_file_positions PARAMS ((bfd *,
    1072                                                  struct bfd_link_info *));
    1073 void _bfd_elf_assign_file_positions_for_relocs PARAMS ((bfd *));
    1074 file_ptr _bfd_elf_assign_file_position_for_section PARAMS ((Elf_Internal_Shdr *,
    1075                                                             file_ptr,
    1076                                                             boolean));
    1077 
    1078 extern boolean _bfd_elf_validate_reloc PARAMS ((bfd *, arelent *));
    1079 
    1080 boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *,
    1081                                                   struct bfd_link_info *));
    1082 boolean _bfd_elf_create_got_section PARAMS ((bfd *,
    1083                                              struct bfd_link_info *));
    1084 unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *,
    1085                                                       struct bfd_link_info *));
    1086 
    1087 elf_linker_section_t *_bfd_elf_create_linker_section
    1088   PARAMS ((bfd *abfd,
    1089            struct bfd_link_info *info,
    1090            enum elf_linker_section_enum,
    1091            elf_linker_section_t *defaults));
    1092 
    1093 elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section
    1094   PARAMS ((elf_linker_section_pointers_t *linker_pointers,
    1095            bfd_signed_vma addend,
    1096            elf_linker_section_enum_t which));
    1097 
    1098 boolean bfd_elf32_create_pointer_linker_section
    1099   PARAMS ((bfd *abfd,
    1100            struct bfd_link_info *info,
    1101            elf_linker_section_t *lsect,
    1102            struct elf_link_hash_entry *h,
    1103            const Elf32_Internal_Rela *rel));
    1104 
    1105 bfd_vma bfd_elf32_finish_pointer_linker_section
    1106   PARAMS ((bfd *output_abfd,
    1107            bfd *input_bfd,
    1108            struct bfd_link_info *info,
    1109            elf_linker_section_t *lsect,
    1110            struct elf_link_hash_entry *h,
    1111            bfd_vma relocation,
    1112            const Elf32_Internal_Rela *rel,
    1113            int relative_reloc));
    1114 
    1115 boolean bfd_elf64_create_pointer_linker_section
    1116   PARAMS ((bfd *abfd,
    1117            struct bfd_link_info *info,
    1118            elf_linker_section_t *lsect,
    1119            struct elf_link_hash_entry *h,
    1120            const Elf64_Internal_Rela *rel));
    1121 
    1122 bfd_vma bfd_elf64_finish_pointer_linker_section
    1123   PARAMS ((bfd *output_abfd,
    1124            bfd *input_bfd,
    1125            struct bfd_link_info *info,
    1126            elf_linker_section_t *lsect,
    1127            struct elf_link_hash_entry *h,
    1128            bfd_vma relocation,
    1129            const Elf64_Internal_Rela *rel,
    1130            int relative_reloc));
    1131 
    1132 boolean _bfd_elf_make_linker_section_rela
    1133   PARAMS ((bfd *dynobj,
    1134            elf_linker_section_t *lsect,
    1135            int alignment));
    1136 
    1137 boolean _bfd_elfcore_section_from_phdr
     1386extern void _bfd_elf_no_info_to_howto
     1387  PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
     1388
     1389extern bfd_boolean bfd_section_from_shdr
     1390  PARAMS ((bfd *, unsigned int shindex));
     1391extern bfd_boolean bfd_section_from_phdr
    11381392  PARAMS ((bfd *, Elf_Internal_Phdr *, int));
    11391393
    1140 extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *));
    1141 extern const bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *));
    1142 extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *));
    1143 extern int bfd_elf32_core_file_failing_signal PARAMS ((bfd *));
    1144 extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *,
    1145                                                                  bfd *));
    1146 
    1147 extern boolean bfd_elf32_bfd_link_add_symbols
    1148   PARAMS ((bfd *, struct bfd_link_info *));
    1149 extern boolean bfd_elf32_bfd_final_link
     1394extern int _bfd_elf_symbol_from_bfd_symbol
     1395  PARAMS ((bfd *, asymbol **));
     1396
     1397extern asection *bfd_section_from_r_symndx
     1398  PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
     1399extern asection *bfd_section_from_elf_index
     1400  PARAMS ((bfd *, unsigned int));
     1401extern bfd_boolean _bfd_elf_create_dynamic_sections
     1402  PARAMS ((bfd *, struct bfd_link_info *));
     1403extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
     1404  PARAMS ((void));
     1405
     1406extern struct elf_strtab_hash * _bfd_elf_strtab_init
     1407  PARAMS ((void));
     1408extern void _bfd_elf_strtab_free
     1409  PARAMS ((struct elf_strtab_hash *));
     1410extern bfd_size_type _bfd_elf_strtab_add
     1411  PARAMS ((struct elf_strtab_hash *, const char *, bfd_boolean));
     1412extern void _bfd_elf_strtab_addref
     1413  PARAMS ((struct elf_strtab_hash *, bfd_size_type));
     1414extern void _bfd_elf_strtab_delref
     1415  PARAMS ((struct elf_strtab_hash *, bfd_size_type));
     1416extern void _bfd_elf_strtab_clear_all_refs
     1417  PARAMS ((struct elf_strtab_hash *));
     1418extern bfd_size_type _bfd_elf_strtab_size
     1419  PARAMS ((struct elf_strtab_hash *));
     1420extern bfd_size_type _bfd_elf_strtab_offset
     1421  PARAMS ((struct elf_strtab_hash *, bfd_size_type));
     1422extern bfd_boolean _bfd_elf_strtab_emit
     1423  PARAMS ((bfd *, struct elf_strtab_hash *));
     1424extern void _bfd_elf_strtab_finalize
     1425  PARAMS ((struct elf_strtab_hash *));
     1426
     1427extern bfd_boolean _bfd_elf_discard_section_eh_frame
     1428  PARAMS ((bfd *, struct bfd_link_info *, asection *,
     1429           bfd_boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *));
     1430extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr
     1431  PARAMS ((bfd *, struct bfd_link_info *));
     1432extern bfd_vma _bfd_elf_eh_frame_section_offset
     1433  PARAMS ((bfd *, asection *, bfd_vma));
     1434extern bfd_boolean _bfd_elf_write_section_eh_frame
     1435  PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *));
     1436extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
     1437  PARAMS ((bfd *, struct bfd_link_info *));
     1438extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
     1439  PARAMS ((struct bfd_link_info *));
     1440
     1441extern bfd_boolean _bfd_elf_link_record_dynamic_symbol
     1442  PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
     1443extern long _bfd_elf_link_lookup_local_dynindx
     1444  PARAMS ((struct bfd_link_info *, bfd *, long));
     1445extern bfd_boolean _bfd_elf_compute_section_file_positions
     1446  PARAMS ((bfd *, struct bfd_link_info *));
     1447extern void _bfd_elf_assign_file_positions_for_relocs
     1448  PARAMS ((bfd *));
     1449extern file_ptr _bfd_elf_assign_file_position_for_section
     1450  PARAMS ((Elf_Internal_Shdr *, file_ptr, bfd_boolean));
     1451
     1452extern bfd_boolean _bfd_elf_validate_reloc
     1453  PARAMS ((bfd *, arelent *));
     1454
     1455extern bfd_boolean _bfd_elf_create_dynamic_sections
     1456  PARAMS ((bfd *, struct bfd_link_info *));
     1457extern bfd_boolean _bfd_elf_create_got_section
     1458  PARAMS ((bfd *, struct bfd_link_info *));
     1459extern unsigned long _bfd_elf_link_renumber_dynsyms
     1460  PARAMS ((bfd *, struct bfd_link_info *));
     1461
     1462extern bfd_boolean _bfd_elfcore_make_pseudosection
     1463  PARAMS ((bfd *, char *, size_t, ufile_ptr));
     1464extern char *_bfd_elfcore_strndup
     1465  PARAMS ((bfd *, char *, size_t));
     1466
     1467extern elf_linker_section_t *_bfd_elf_create_linker_section
     1468  PARAMS ((bfd *, struct bfd_link_info *, enum elf_linker_section_enum,
     1469           elf_linker_section_t *));
     1470
     1471extern elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section
     1472  PARAMS ((elf_linker_section_pointers_t *, bfd_vma,
     1473           elf_linker_section_enum_t));
     1474
     1475extern bfd_boolean bfd_elf32_create_pointer_linker_section
     1476  PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *,
     1477           struct elf_link_hash_entry *, const Elf_Internal_Rela *));
     1478
     1479extern bfd_vma bfd_elf32_finish_pointer_linker_section
     1480  PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *,
     1481           struct elf_link_hash_entry *, bfd_vma,
     1482           const Elf_Internal_Rela *, int));
     1483
     1484extern bfd_boolean bfd_elf64_create_pointer_linker_section
     1485  PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *,
     1486           struct elf_link_hash_entry *, const Elf_Internal_Rela *));
     1487
     1488extern bfd_vma bfd_elf64_finish_pointer_linker_section
     1489  PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *,
     1490           struct elf_link_hash_entry *, bfd_vma,
     1491           const Elf_Internal_Rela *, int));
     1492
     1493extern bfd_boolean _bfd_elf_make_linker_section_rela
     1494  PARAMS ((bfd *, elf_linker_section_t *, int));
     1495
     1496extern const bfd_target *bfd_elf32_object_p
     1497  PARAMS ((bfd *));
     1498extern const bfd_target *bfd_elf32_core_file_p
     1499  PARAMS ((bfd *));
     1500extern char *bfd_elf32_core_file_failing_command
     1501  PARAMS ((bfd *));
     1502extern int bfd_elf32_core_file_failing_signal
     1503  PARAMS ((bfd *));
     1504extern bfd_boolean bfd_elf32_core_file_matches_executable_p
     1505  PARAMS ((bfd *, bfd *));
     1506
     1507extern bfd_boolean bfd_elf32_bfd_link_add_symbols
     1508  PARAMS ((bfd *, struct bfd_link_info *));
     1509extern bfd_boolean bfd_elf32_bfd_final_link
    11501510  PARAMS ((bfd *, struct bfd_link_info *));
    11511511
    11521512extern void bfd_elf32_swap_symbol_in
    1153   PARAMS ((bfd *, const Elf32_External_Sym *, Elf_Internal_Sym *));
     1513  PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
    11541514extern void bfd_elf32_swap_symbol_out
    1155   PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
     1515  PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
    11561516extern void bfd_elf32_swap_reloc_in
    1157   PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *));
     1517  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
    11581518extern void bfd_elf32_swap_reloc_out
    1159   PARAMS ((bfd *, const Elf_Internal_Rel *, Elf32_External_Rel *));
     1519  PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
    11601520extern void bfd_elf32_swap_reloca_in
    1161   PARAMS ((bfd *, const Elf32_External_Rela *, Elf_Internal_Rela *));
     1521  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
    11621522extern void bfd_elf32_swap_reloca_out
    1163   PARAMS ((bfd *, const Elf_Internal_Rela *, Elf32_External_Rela *));
     1523  PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
    11641524extern void bfd_elf32_swap_phdr_in
    11651525  PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *));
     
    11711531  PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
    11721532extern long bfd_elf32_slurp_symbol_table
    1173   PARAMS ((bfd *, asymbol **, boolean));
    1174 extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *));
     1533  PARAMS ((bfd *, asymbol **, bfd_boolean));
     1534extern bfd_boolean bfd_elf32_write_shdrs_and_ehdr
     1535  PARAMS ((bfd *));
    11751536extern int bfd_elf32_write_out_phdrs
    1176   PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
     1537  PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
    11771538extern void bfd_elf32_write_relocs
    11781539  PARAMS ((bfd *, asection *, PTR));
    1179 extern boolean bfd_elf32_slurp_reloc_table
    1180   PARAMS ((bfd *, asection *, asymbol **, boolean));
    1181 extern boolean bfd_elf32_add_dynamic_entry
     1540extern bfd_boolean bfd_elf32_slurp_reloc_table
     1541  PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
     1542extern bfd_boolean bfd_elf32_add_dynamic_entry
    11821543  PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
    1183 extern boolean bfd_elf32_link_create_dynamic_sections
     1544extern bfd_boolean bfd_elf32_link_create_dynamic_sections
    11841545  PARAMS ((bfd *, struct bfd_link_info *));
    11851546extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs
    1186   PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean));
    1187 
    1188 extern const bfd_target *bfd_elf64_object_p PARAMS ((bfd *));
    1189 extern const bfd_target *bfd_elf64_core_file_p PARAMS ((bfd *));
    1190 extern char *bfd_elf64_core_file_failing_command PARAMS ((bfd *));
    1191 extern int bfd_elf64_core_file_failing_signal PARAMS ((bfd *));
    1192 extern boolean bfd_elf64_core_file_matches_executable_p PARAMS ((bfd *,
    1193                                                                  bfd *));
    1194 extern boolean bfd_elf64_bfd_link_add_symbols
    1195   PARAMS ((bfd *, struct bfd_link_info *));
    1196 extern boolean bfd_elf64_bfd_final_link
     1547  PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
     1548
     1549extern const bfd_target *bfd_elf64_object_p
     1550  PARAMS ((bfd *));
     1551extern const bfd_target *bfd_elf64_core_file_p
     1552  PARAMS ((bfd *));
     1553extern char *bfd_elf64_core_file_failing_command
     1554  PARAMS ((bfd *));
     1555extern int bfd_elf64_core_file_failing_signal
     1556  PARAMS ((bfd *));
     1557extern bfd_boolean bfd_elf64_core_file_matches_executable_p
     1558  PARAMS ((bfd *, bfd *));
     1559extern bfd_boolean bfd_elf64_bfd_link_add_symbols
     1560  PARAMS ((bfd *, struct bfd_link_info *));
     1561extern bfd_boolean bfd_elf64_bfd_final_link
    11971562  PARAMS ((bfd *, struct bfd_link_info *));
    11981563
    11991564extern void bfd_elf64_swap_symbol_in
    1200   PARAMS ((bfd *, const Elf64_External_Sym *, Elf_Internal_Sym *));
     1565  PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
    12011566extern void bfd_elf64_swap_symbol_out
    1202   PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
     1567  PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
    12031568extern void bfd_elf64_swap_reloc_in
    1204   PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *));
     1569  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
    12051570extern void bfd_elf64_swap_reloc_out
    1206   PARAMS ((bfd *, const Elf_Internal_Rel *, Elf64_External_Rel *));
     1571  PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
    12071572extern void bfd_elf64_swap_reloca_in
    1208   PARAMS ((bfd *, const Elf64_External_Rela *, Elf_Internal_Rela *));
     1573  PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
    12091574extern void bfd_elf64_swap_reloca_out
    1210   PARAMS ((bfd *, const Elf_Internal_Rela *, Elf64_External_Rela *));
     1575  PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
    12111576extern void bfd_elf64_swap_phdr_in
    12121577  PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *));
     
    12181583  PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
    12191584extern long bfd_elf64_slurp_symbol_table
    1220   PARAMS ((bfd *, asymbol **, boolean));
    1221 extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *));
     1585  PARAMS ((bfd *, asymbol **, bfd_boolean));
     1586extern bfd_boolean bfd_elf64_write_shdrs_and_ehdr
     1587  PARAMS ((bfd *));
    12221588extern int bfd_elf64_write_out_phdrs
    1223   PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
     1589  PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
    12241590extern void bfd_elf64_write_relocs
    12251591  PARAMS ((bfd *, asection *, PTR));
    1226 extern boolean bfd_elf64_slurp_reloc_table
    1227   PARAMS ((bfd *, asection *, asymbol **, boolean));
    1228 extern boolean bfd_elf64_add_dynamic_entry
     1592extern bfd_boolean bfd_elf64_slurp_reloc_table
     1593  PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
     1594extern bfd_boolean bfd_elf64_add_dynamic_entry
    12291595  PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
    1230 extern boolean bfd_elf64_link_create_dynamic_sections
     1596extern bfd_boolean bfd_elf64_link_create_dynamic_sections
    12311597  PARAMS ((bfd *, struct bfd_link_info *));
    12321598extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
    1233   PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean));
     1599  PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
    12341600
    12351601#define bfd_elf32_link_record_dynamic_symbol \
     
    12381604  _bfd_elf_link_record_dynamic_symbol
    12391605
    1240 boolean _bfd_elf32_link_record_local_dynamic_symbol
     1606extern int elf_link_record_local_dynamic_symbol
    12411607  PARAMS ((struct bfd_link_info *, bfd *, long));
    1242 boolean _bfd_elf64_link_record_local_dynamic_symbol
    1243   PARAMS ((struct bfd_link_info *, bfd *, long));
    1244 
    1245 extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *));
     1608#define _bfd_elf32_link_record_local_dynamic_symbol \
     1609  elf_link_record_local_dynamic_symbol
     1610#define _bfd_elf64_link_record_local_dynamic_symbol \
     1611  elf_link_record_local_dynamic_symbol
     1612
     1613extern bfd_boolean _bfd_elf_close_and_cleanup
     1614  PARAMS ((bfd *));
    12461615extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
    12471616  PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR,
    12481617           asection *, bfd *, char **));
    12491618
    1250 boolean _bfd_elf32_gc_sections
    1251   PARAMS ((bfd *abfd, struct bfd_link_info *info));
    1252 boolean _bfd_elf32_gc_common_finalize_got_offsets
    1253   PARAMS ((bfd *abfd, struct bfd_link_info *info));
    1254 boolean _bfd_elf32_gc_common_final_link
    1255   PARAMS ((bfd *, struct bfd_link_info *));
    1256 boolean _bfd_elf32_gc_record_vtinherit
     1619extern bfd_boolean _bfd_elf32_gc_sections
     1620  PARAMS ((bfd *, struct bfd_link_info *));
     1621extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets
     1622  PARAMS ((bfd *, struct bfd_link_info *));
     1623extern bfd_boolean _bfd_elf32_gc_common_final_link
     1624  PARAMS ((bfd *, struct bfd_link_info *));
     1625extern bfd_boolean _bfd_elf32_gc_record_vtinherit
    12571626  PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
    1258 boolean _bfd_elf32_gc_record_vtentry
     1627extern bfd_boolean _bfd_elf32_gc_record_vtentry
    12591628  PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
    12601629
    1261 boolean _bfd_elf64_gc_sections
    1262   PARAMS ((bfd *abfd, struct bfd_link_info *info));
    1263 boolean _bfd_elf64_gc_common_finalize_got_offsets
    1264   PARAMS ((bfd *abfd, struct bfd_link_info *info));
    1265 boolean _bfd_elf64_gc_common_final_link
    1266   PARAMS ((bfd *, struct bfd_link_info *));
    1267 boolean _bfd_elf64_gc_record_vtinherit
     1630extern bfd_boolean _bfd_elf64_gc_sections
     1631  PARAMS ((bfd *, struct bfd_link_info *));
     1632extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets
     1633  PARAMS ((bfd *, struct bfd_link_info *));
     1634extern bfd_boolean _bfd_elf64_gc_common_final_link
     1635  PARAMS ((bfd *, struct bfd_link_info *));
     1636extern bfd_boolean _bfd_elf64_gc_record_vtinherit
    12681637  PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
    1269 boolean _bfd_elf64_gc_record_vtentry
     1638extern bfd_boolean _bfd_elf64_gc_record_vtentry
    12701639  PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
    12711640
    1272 /* MIPS ELF specific routines.  */
    1273 
    1274 extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *));
    1275 extern boolean _bfd_mips_elf_section_from_shdr
    1276   PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
    1277 extern boolean _bfd_mips_elf_fake_sections
    1278   PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
    1279 extern boolean _bfd_mips_elf_section_from_bfd_section
    1280   PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, int *));
    1281 extern boolean _bfd_mips_elf_section_processing
    1282   PARAMS ((bfd *, Elf_Internal_Shdr *));
    1283 extern void _bfd_mips_elf_symbol_processing PARAMS ((bfd *, asymbol *));
    1284 extern boolean _bfd_mips_elf_read_ecoff_info
    1285   PARAMS ((bfd *, asection *, struct ecoff_debug_info *));
    1286 extern void _bfd_mips_elf_final_write_processing PARAMS ((bfd *, boolean));
    1287 extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc
    1288   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    1289 extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc
    1290   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    1291 extern bfd_reloc_status_type _bfd_mips_elf_gprel16_reloc
    1292   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    1293 extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc
    1294   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    1295 extern bfd_reloc_status_type _bfd_mips_elf_gprel32_reloc
    1296   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    1297 extern boolean _bfd_mips_elf_set_private_flags PARAMS ((bfd *, flagword));
    1298 extern boolean _bfd_mips_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
    1299 extern boolean _bfd_mips_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
    1300 extern boolean _bfd_mips_elf_find_nearest_line
    1301   PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
    1302            const char **, unsigned int *));
    1303 extern boolean _bfd_mips_elf_set_section_contents
    1304   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
    1305 extern boolean _bfd_mips_elf_create_dynamic_sections
    1306   PARAMS ((bfd *, struct bfd_link_info *));
    1307 extern boolean _bfd_mips_elf_add_symbol_hook
    1308   PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
    1309            const char **, flagword *, asection **, bfd_vma *));
    1310 extern boolean _bfd_mips_elf_adjust_dynamic_symbol
    1311   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
    1312 extern boolean _bfd_mips_elf_finish_dynamic_symbol
    1313   PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
    1314            Elf_Internal_Sym *));
    1315 extern boolean _bfd_mips_elf_finish_dynamic_sections
    1316   PARAMS ((bfd *, struct bfd_link_info *));
    1317 extern asection * _bfd_mips_elf_gc_mark_hook
    1318   PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
    1319            struct elf_link_hash_entry *, Elf_Internal_Sym *));
    1320 extern boolean _bfd_mips_elf_gc_sweep_hook
    1321   PARAMS ((bfd *, struct bfd_link_info *, asection *,
    1322            const Elf_Internal_Rela *));
    1323 extern boolean _bfd_mips_elf_always_size_sections
    1324   PARAMS ((bfd *, struct bfd_link_info *));
    1325 extern boolean _bfd_mips_elf_size_dynamic_sections
    1326   PARAMS ((bfd *, struct bfd_link_info *));
    1327 extern boolean _bfd_mips_elf_check_relocs
    1328   PARAMS ((bfd *, struct bfd_link_info *, asection *,
    1329            const Elf_Internal_Rela *));
    1330 extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
    1331   PARAMS ((bfd *));
    1332 extern boolean _bfd_mips_elf_print_private_bfd_data
    1333   PARAMS ((bfd *, PTR));
    1334 extern boolean _bfd_mips_elf_link_output_symbol_hook
    1335   PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
    1336            asection *));
    1337 extern boolean _bfd_mips_elf_final_link
    1338   PARAMS ((bfd *, struct bfd_link_info *));
    1339 extern int _bfd_mips_elf_additional_program_headers PARAMS ((bfd *));
    1340 extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *));
    1341 extern boolean _bfd_mips_elf_relocate_section
    1342   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    1343            Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
     1641extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p
     1642  PARAMS ((bfd_vma, PTR));
     1643extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p
     1644  PARAMS ((bfd_vma, PTR));
     1645
     1646/* Exported interface for writing elf corefile notes. */
     1647extern char *elfcore_write_note
     1648  PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int));
     1649extern char *elfcore_write_prpsinfo
     1650  PARAMS ((bfd *, char *, int *, const char *, const char *));
     1651extern char *elfcore_write_prstatus
     1652  PARAMS ((bfd *, char *, int *, long, int, const PTR));
     1653extern char * elfcore_write_pstatus
     1654  PARAMS ((bfd *, char *, int *, long, int, const PTR));
     1655extern char *elfcore_write_prfpreg
     1656  PARAMS ((bfd *, char *, int *, const PTR, int));
     1657extern char *elfcore_write_prxfpreg
     1658  PARAMS ((bfd *, char *, int *, const PTR, int));
     1659extern char *elfcore_write_lwpstatus
     1660  PARAMS ((bfd *, char *, int *, long, int, const PTR));
    13441661
    13451662/* SH ELF specific routine.  */
    13461663
    1347 extern boolean _sh_elf_set_mach_from_flags PARAMS ((bfd *));
     1664extern bfd_boolean _sh_elf_set_mach_from_flags
     1665  PARAMS ((bfd *));
    13481666
    13491667#endif /* _LIBELF_H_ */
Note: See TracChangeset for help on using the changeset viewer.