/* BFD back-end data structures for ELF files.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
Written by Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _LIBELF_H_
#define _LIBELF_H_ 1
} elf_symbol_type;
\f
+struct elf_strtab_hash;
+
/* ELF linker hash table entries. */
struct elf_link_hash_entry
set to -2 if the symbol is used by a reloc. */
long indx;
- /* Symbol size. */
- bfd_size_type size;
-
/* Symbol index as a dynamic symbol. Initialized to -1, and remains
-1 if this is not a dynamic symbol. */
/* ??? Note that this is consistently used as a synonym for tests
/* String table index in .dynstr if this is a dynamic symbol. */
unsigned long dynstr_index;
+ /* Hash value of the name computed using the ELF hash function. */
+ unsigned long elf_hash_value;
+
/* If this is a weak defined symbol from a dynamic object, this
field points to a defined symbol with the same value, if there is
one. Otherwise it is NULL. */
struct elf_link_hash_entry *weakdef;
- /* If this symbol requires an entry in the global offset table, the
- processor specific backend uses this field to track usage and
- final offset. We use a union and two names primarily to document
- the intent of any particular piece of code. The field should be
- used as a count until size_dynamic_sections, at which point the
- contents of the .got is fixed. Afterward, if this field is -1,
- then the symbol does not require a global offset table entry. */
- union
- {
- bfd_signed_vma refcount;
- bfd_vma offset;
- } got;
-
- /* Same, but tracks a procedure linkage table entry. */
- union
- {
- bfd_signed_vma refcount;
- bfd_vma offset;
- } plt;
-
/* If this symbol is used in the linker created sections, the processor
specific backend uses this field to map the field into the offset
from the beginning of the section. */
/* Virtual table derivation info. */
struct elf_link_hash_entry *vtable_parent;
+ /* If this symbol requires an entry in the global offset table, the
+ processor specific backend uses this field to track usage and
+ final offset. We use a union and two names primarily to document
+ the intent of any particular piece of code. The field should be
+ used as a count until size_dynamic_sections, at which point the
+ contents of the .got is fixed. Afterward, if this field is -1,
+ then the symbol does not require a global offset table entry. */
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } got;
+
+ /* Same, but tracks a procedure linkage table entry. */
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } plt;
+
+ /* Symbol size. */
+ bfd_size_type size;
+
/* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
char type;
/* Symbol st_other value, symbol visibility. */
unsigned char other;
- /* Hash value of the name computed using the ELF hash function. */
- unsigned long elf_hash_value;
-
/* Some flags; legal values follow. */
unsigned short elf_link_hash_flags;
/* Symbol is referenced by a non-shared object. */
Elf_Internal_Sym isym;
};
+struct elf_link_loaded_list
+{
+ struct elf_link_loaded_list *next;
+ bfd *abfd;
+};
+
+enum elf_link_info_type
+{
+ ELF_INFO_TYPE_NONE,
+ ELF_INFO_TYPE_STABS,
+ ELF_INFO_TYPE_MERGE,
+ ELF_INFO_TYPE_EH_FRAME,
+ ELF_INFO_TYPE_EH_FRAME_HDR,
+ ELF_INFO_TYPE_JUST_SYMS,
+ ELF_INFO_TYPE_LAST
+};
+
+/* Cached start, size and alignment of PT_TLS segment. */
+struct elf_link_tls_segment
+{
+ bfd_vma start;
+ bfd_size_type size;
+ unsigned int align;
+};
+
/* ELF linker hash table. */
struct elf_link_hash_table
/* The string table of dynamic symbols, which becomes the .dynstr
section. */
- struct bfd_strtab_hash *dynstr;
+ struct elf_strtab_hash *dynstr;
/* The number of buckets in the hash table in the .hash section.
This is based on the number of dynamic symbols. */
/* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic
objects included in the link. */
struct bfd_link_needed_list *runpath;
+
+ /* Cached start, size and alignment of PT_TLS segment. */
+ struct elf_link_tls_segment *tls_segment;
+
+ /* A linked list of BFD's loaded in the link. */
+ struct elf_link_loaded_list *loaded;
};
/* Look up an entry in an ELF linker hash table. */
/* Returns true if the hash table is a struct elf_link_hash_table. */
#define is_elf_hash_table(p) \
((p)->hash->type == bfd_link_elf_hash_table)
+
+/* Used by bfd_section_from_r_symndx to cache a small number of local
+ symbol to section mappings. */
+#define LOCAL_SYM_CACHE_SIZE 32
+struct sym_sec_cache
+{
+ bfd *abfd;
+ unsigned long indx[LOCAL_SYM_CACHE_SIZE];
+ asection *sec[LOCAL_SYM_CACHE_SIZE];
+};
\f
/* Constant information held for an ELF backend. */
PARAMS ((bfd *));
void (*write_relocs)
PARAMS ((bfd *, asection *, PTR));
+ void (*swap_symbol_in)
+ PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
void (*swap_symbol_out)
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
+ PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
boolean (*slurp_reloc_table)
PARAMS ((bfd *, asection *, asymbol **, boolean));
long (*slurp_symbol_table)
reloc_class_copy
};
+struct elf_reloc_cookie
+{
+ Elf_Internal_Rela *rels, *rel, *relend;
+ Elf_Internal_Sym *locsyms;
+ bfd *abfd;
+ size_t locsymcount;
+ size_t extsymoff;
+ struct elf_link_hash_entry **sym_hashes;
+ boolean bad_symtab;
+};
+
+/* The level of IRIX compatibility we're striving for. */
+
+typedef enum {
+ ict_none,
+ ict_irix5,
+ ict_irix6
+} irix_compat_t;
+
struct elf_backend_data
{
/* The architecture for this backend. */
/* A function to handle unusual section types when creating BFD
sections from ELF sections. */
boolean (*elf_backend_section_from_shdr)
- PARAMS ((bfd *, Elf32_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf32_Internal_Shdr *, const char *));
/* A function to convert machine dependent section header flags to
BFD internal section header flags. */
section, *RETVAL should be left unchanged. If it is not a normal
ELF section *RETVAL should be set to the SHN_xxxx index. */
boolean (*elf_backend_section_from_bfd_section)
- PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *retval));
+ PARAMS ((bfd *, asection *, int *retval));
/* If this field is not NULL, it is called by the add_symbols phase
of a link just before adding a symbol to the global linker hash
PARAMS ((bfd *));
/* This function is called during section gc to discover the section a
- particular relocation refers to. It need not be defined for hosts
- that have no queer relocation types. */
+ particular relocation refers to. */
asection * (*gc_mark_hook)
- PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *,
+ PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *h, Elf_Internal_Sym *));
/* This function, if defined, is called during the sweep phase of gc
PARAMS ((bfd *, struct bfd_link_info *, PTR,
boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *)));
- /* Copy any information related to dynamic linking from a pre-existing
+ /* Copy any information related to dynamic linking from a pre-existing
symbol to a newly created symbol. Also called to copy flags and
other back-end info to a weakdef, in which case the symbol is not
newly created and plt/got refcounts and dynamic indices should not
be copied. */
void (*elf_backend_copy_indirect_symbol)
- PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+ PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ struct elf_link_hash_entry *));
/* Modify any information related to dynamic linking such that the
symbol is not exported. */
void (*elf_backend_hide_symbol)
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean));
/* Emit relocations. Overrides default routine for emitting relocs,
except during a relocatable link, or if all relocs are being emitted. */
- void (*elf_backend_emit_relocs)
+ boolean (*elf_backend_emit_relocs)
PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
/* Count relocations. Not called for relocatable links
enum elf_reloc_type_class (*elf_backend_reloc_type_class)
PARAMS ((const Elf_Internal_Rela *));
+ /* This function, if defined, removes information about discarded functions
+ from other sections which mention them. */
+ boolean (*elf_backend_discard_info)
+ PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *));
+
+ /* This function, if defined, signals that the function above has removed
+ the discarded relocations for this section. */
+ boolean (*elf_backend_ignore_discarded_relocs)
+ PARAMS ((asection *));
+
+ /* This function, if defined, may write out the given section.
+ Returns true if it did so and false if the caller should. */
+ boolean (*elf_backend_write_section)
+ PARAMS ((bfd *, asection *, bfd_byte *));
+
+ /* This function, if defined, sets up the file positions for non PT_LOAD
+ segments, especially for segments containing non-allocated sections. */
+ void (*set_nonloadable_filepos)
+ PARAMS ((bfd *, Elf_Internal_Phdr *));
+
+ /* This function, if defined, returns true if the section is contained
+ within the segment. File positions are compared. */
+ boolean (*is_contained_by_filepos)
+ PARAMS ((asection *, Elf_Internal_Phdr *));
+
+ /* This function, if defined, returns true if copy_private_bfd_data
+ should be called. It provides a way of overriding default
+ test conditions in _bfd_elf_copy_private_section_data. */
+ boolean (*copy_private_bfd_data_p)
+ PARAMS ((bfd *, asection *, bfd *, asection *));
+
+ /* The level of IRIX compatibility we're striving for.
+ MIPS ELF specific function. */
+ irix_compat_t (*elf_backend_mips_irix_compat)
+ PARAMS ((bfd *));
+
+ reloc_howto_type *(*elf_backend_mips_rtype_to_howto)
+ PARAMS ((unsigned int, boolean));
+
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
section. */
unsigned default_use_rela_p : 1;
+ /* Set if RELA relocations for a relocatable link can be handled by
+ generic code. Backends that set this flag need do nothing in the
+ backend relocate_section routine for relocatable linking. */
+ unsigned rela_normal : 1;
+
/* True if addresses "naturally" sign extend. This is used when
swapping in from Elf32 when BFD64. */
unsigned sign_extend_vma : 1;
unsigned can_refcount : 1;
unsigned want_got_sym : 1;
unsigned want_dynbss : 1;
+ /* Targets which do not support physical addressing often require
+ that the p_paddr field in the section header to be set to zero.
+ This field indicates whether this behavior is required. */
+ unsigned want_p_paddr_set_to_zero : 1;
};
/* Information stored for each BFD section in an ELF file. This
/* The number of relocations currently assigned to REL_HDR2. */
unsigned int rel_count2;
- /* The number of dynamic relocs copied for local symbols. */
- unsigned int local_dynrel;
+ /* A pointer to a linked list tracking dynamic relocs copied for
+ local symbols. */
+ PTR local_dynrel;
/* A pointer to the bfd section used for dynamic relocs. */
asection *sreloc;
no dynamic symbol for this section. */
long dynindx;
- /* A pointer used for .stab linking optimizations. */
- PTR stab_info;
+ /* A pointer used for various section optimizations. */
+ PTR sec_info;
- /* A pointer used for SEC_MERGE optimizations. */
- PTR merge_info;
+ /* Type of that information. */
+ enum elf_link_info_type sec_info_type;
+
+ union {
+ /* Group name, if this section is a member of a group. */
+ const char *name;
+
+ /* Group signature sym, if this is the SHT_GROUP section. */
+ struct symbol_cache_entry *id;
+ } group;
+
+ /* A linked list of sections in the group. Circular when used by
+ the linker. */
+ asection *next_in_group;
/* A pointer available for the processor specific ELF backend. */
PTR tdata;
/* Nonzero if this section uses RELA relocations, rather than REL. */
unsigned int use_rela_p:1;
+
+ /* Nonzero when a group is COMDAT. */
+ unsigned int linkonce_p:1;
};
#define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
+#define elf_group_name(sec) (elf_section_data(sec)->group.name)
+#define elf_group_id(sec) (elf_section_data(sec)->group.id)
+#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group)
+#define elf_linkonce_p(sec) (elf_section_data(sec)->linkonce_p)
+
+/* Return true if section has been discarded. */
+#define elf_discarded_section(sec) \
+ (!bfd_is_abs_section(sec) \
+ && bfd_is_abs_section((sec)->output_section) \
+ && elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
+ && elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
#define get_elf_backend_data(abfd) \
((struct elf_backend_data *) (abfd)->xvec->backend_data)
Elf_Internal_Shdr **elf_sect_ptr;
Elf_Internal_Phdr *phdr;
struct elf_segment_map *segment_map;
- struct bfd_strtab_hash *strtab_ptr;
+ struct elf_strtab_hash *strtab_ptr;
int num_locals;
int num_globals;
+ unsigned int num_elf_sections; /* elf_sect_ptr size */
int num_section_syms;
asymbol **section_syms; /* STT_SECTION symbols for each section */
Elf_Internal_Shdr symtab_hdr;
Elf_Internal_Shdr dynversym_hdr;
Elf_Internal_Shdr dynverref_hdr;
Elf_Internal_Shdr dynverdef_hdr;
+ Elf_Internal_Shdr symtab_shndx_hdr;
unsigned int symtab_section, shstrtab_section;
unsigned int strtab_section, dynsymtab_section;
+ unsigned int symtab_shndx_section;
unsigned int dynversym_section, dynverdef_section, dynverref_section;
file_ptr next_file_pos;
#if 0
void *prstatus; /* The raw /proc prstatus structure */
void *prpsinfo; /* The raw /proc prpsinfo structure */
#endif
- bfd_vma gp; /* The gp value (MIPS only, for now) */
- unsigned int gp_size; /* The gp size (MIPS only, for now) */
+ bfd_vma gp; /* The gp value */
+ unsigned int gp_size; /* The gp size */
+
+ Elf_Internal_Shdr **group_sect_ptr;
+ int num_group;
/* Information grabbed from an elf core file. */
int core_signal;
/* Used to determine if the e_flags field has been initialized */
boolean flags_init;
+ /* Used to determine if PT_GNU_EH_FRAME segment header should be
+ created. */
+ boolean eh_frame_hdr;
+
/* Number of symbol version definitions we are about to emit. */
unsigned int cverdefs;
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
#define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header)
#define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr)
+#define elf_numsections(bfd) (elf_tdata(bfd) -> num_elf_sections)
#define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr)
#define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section)
+#define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section)
#define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section)
#define elf_dynversym(bfd) (elf_tdata(bfd) -> dynversym_section)
#define elf_dynverdef(bfd) (elf_tdata(bfd) -> dynverdef_section)
PARAMS ((bfd *, unsigned, unsigned));
extern char *bfd_elf_get_str_section
PARAMS ((bfd *, unsigned));
+extern Elf_Internal_Sym *bfd_elf_get_elf_syms
+ PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t,
+ Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *));
+extern boolean _bfd_elf_copy_private_bfd_data
+ PARAMS ((bfd *, bfd *));
extern boolean _bfd_elf_print_private_bfd_data
PARAMS ((bfd *, PTR));
extern void bfd_elf_print_symbol
extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
PARAMS ((const Elf_Internal_Rela *));
+extern bfd_vma _bfd_elf_rela_local_sym
+ PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *));
+extern bfd_vma _bfd_elf_rel_local_sym
+ PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma));
+extern bfd_vma _bfd_elf_section_offset
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma));
extern unsigned long bfd_elf_hash
PARAMS ((const char *));
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
PARAMS ((bfd *));
extern void _bfd_elf_link_hash_copy_indirect
- PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+ PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ struct elf_link_hash_entry *));
extern void _bfd_elf_link_hash_hide_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean));
extern boolean _bfd_elf_link_hash_table_init
PARAMS ((struct elf_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
const char *)));
extern boolean _bfd_elf_slurp_version_tables
PARAMS ((bfd *));
-
extern boolean _bfd_elf_merge_sections
PARAMS ((bfd *, struct bfd_link_info *));
-
+extern boolean bfd_elf_discard_group
+ PARAMS ((bfd *, struct sec *));
+extern void bfd_elf_set_group_contents
+ PARAMS ((bfd *, asection *, PTR));
+extern void _bfd_elf_link_just_syms
+ PARAMS ((asection *, struct bfd_link_info *));
extern boolean _bfd_elf_copy_private_symbol_data
PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
extern boolean _bfd_elf_copy_private_section_data
extern int _bfd_elf_symbol_from_bfd_symbol
PARAMS ((bfd *, asymbol **));
+extern asection *bfd_section_from_r_symndx
+ PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
extern asection *bfd_section_from_elf_index
PARAMS ((bfd *, unsigned int));
extern boolean _bfd_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
PARAMS ((void));
+
+extern struct elf_strtab_hash * _bfd_elf_strtab_init
+ PARAMS ((void));
+extern void _bfd_elf_strtab_free
+ PARAMS ((struct elf_strtab_hash *));
+extern bfd_size_type _bfd_elf_strtab_add
+ PARAMS ((struct elf_strtab_hash *, const char *, boolean));
+extern void _bfd_elf_strtab_addref
+ PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+extern void _bfd_elf_strtab_delref
+ PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+extern void _bfd_elf_strtab_clear_all_refs
+ PARAMS ((struct elf_strtab_hash *));
+extern bfd_size_type _bfd_elf_strtab_size
+ PARAMS ((struct elf_strtab_hash *));
+extern bfd_size_type _bfd_elf_strtab_offset
+ PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+extern boolean _bfd_elf_strtab_emit
+ PARAMS ((bfd *, struct elf_strtab_hash *));
+extern void _bfd_elf_strtab_finalize
+ PARAMS ((struct elf_strtab_hash *));
+
+extern boolean _bfd_elf_discard_section_eh_frame
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *,
+ boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *));
+extern boolean _bfd_elf_discard_section_eh_frame_hdr
+ PARAMS ((bfd *, struct bfd_link_info *, asection *));
+extern bfd_vma _bfd_elf_eh_frame_section_offset
+ PARAMS ((bfd *, asection *, bfd_vma));
+extern boolean _bfd_elf_write_section_eh_frame
+ PARAMS ((bfd *, asection *, asection *, bfd_byte *));
+extern boolean _bfd_elf_write_section_eh_frame_hdr
+ PARAMS ((bfd *, asection *));
+extern boolean _bfd_elf_maybe_strip_eh_frame_hdr
+ PARAMS ((struct bfd_link_info *));
+
extern boolean _bfd_elf_link_record_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
extern long _bfd_elf_link_lookup_local_dynindx
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf32_swap_symbol_in
- PARAMS ((bfd *, const Elf32_External_Sym *, Elf_Internal_Sym *));
+ PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
extern void bfd_elf32_swap_symbol_out
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
+ PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf32_swap_reloc_in
PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *));
extern void bfd_elf32_swap_reloc_out
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf64_swap_symbol_in
- PARAMS ((bfd *, const Elf64_External_Sym *, Elf_Internal_Sym *));
+ PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
extern void bfd_elf64_swap_symbol_out
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR));
+ PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf64_swap_reloc_in
PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *));
extern void bfd_elf64_swap_reloc_out
#define bfd_elf64_link_record_dynamic_symbol \
_bfd_elf_link_record_dynamic_symbol
-extern boolean _bfd_elf32_link_record_local_dynamic_symbol
- PARAMS ((struct bfd_link_info *, bfd *, long));
-extern boolean _bfd_elf64_link_record_local_dynamic_symbol
+extern int elf_link_record_local_dynamic_symbol
PARAMS ((struct bfd_link_info *, bfd *, long));
+#define _bfd_elf32_link_record_local_dynamic_symbol \
+ elf_link_record_local_dynamic_symbol
+#define _bfd_elf64_link_record_local_dynamic_symbol \
+ elf_link_record_local_dynamic_symbol
extern boolean _bfd_elf_close_and_cleanup
PARAMS ((bfd *));
extern boolean _bfd_elf64_gc_record_vtentry
PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
-/* MIPS ELF specific routines. */
-
-extern boolean _bfd_mips_elf_object_p
- PARAMS ((bfd *));
-extern boolean _bfd_mips_elf_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
-extern boolean _bfd_mips_elf_fake_sections
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
-extern boolean _bfd_mips_elf_section_from_bfd_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, int *));
-extern boolean _bfd_mips_elf_section_processing
- PARAMS ((bfd *, Elf_Internal_Shdr *));
-extern void _bfd_mips_elf_symbol_processing
- PARAMS ((bfd *, asymbol *));
-extern boolean _bfd_mips_elf_read_ecoff_info
- PARAMS ((bfd *, asection *, struct ecoff_debug_info *));
-extern void _bfd_mips_elf_final_write_processing
- PARAMS ((bfd *, boolean));
-extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-extern bfd_reloc_status_type _bfd_mips_elf_gprel16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-extern bfd_reloc_status_type _bfd_mips_elf_gprel32_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-extern boolean _bfd_mips_elf_set_private_flags
- PARAMS ((bfd *, flagword));
-extern boolean _bfd_mips_elf_copy_private_bfd_data
- PARAMS ((bfd *, bfd *));
-extern boolean _bfd_mips_elf_merge_private_bfd_data
- PARAMS ((bfd *, bfd *));
-extern boolean _bfd_mips_elf_find_nearest_line
- PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *));
-extern boolean _bfd_mips_elf_set_section_contents
- PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
-extern boolean _bfd_mips_elf_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern boolean _bfd_mips_elf_add_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
-extern boolean _bfd_mips_elf_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-extern boolean _bfd_mips_elf_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-extern boolean _bfd_mips_elf_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern asection * _bfd_mips_elf_gc_mark_hook
- PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-extern boolean _bfd_mips_elf_gc_sweep_hook
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-extern boolean _bfd_mips_elf_always_size_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern boolean _bfd_mips_elf_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-extern boolean _bfd_mips_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
- PARAMS ((bfd *));
-extern boolean _bfd_mips_elf_print_private_bfd_data
- PARAMS ((bfd *, PTR));
-extern boolean _bfd_mips_elf_link_output_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
- asection *));
-extern boolean _bfd_mips_elf_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-extern int _bfd_mips_elf_additional_program_headers
- PARAMS ((bfd *));
-extern boolean _bfd_mips_elf_modify_segment_map
- PARAMS ((bfd *));
-extern boolean _bfd_mips_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+extern boolean _bfd_elf32_reloc_symbol_deleted_p
+ PARAMS ((bfd_vma, PTR));
+extern boolean _bfd_elf64_reloc_symbol_deleted_p
+ PARAMS ((bfd_vma, PTR));
+
+/* Exported interface for writing elf corefile notes. */
+extern char *elfcore_write_note
+ PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int));
+extern char *elfcore_write_prpsinfo
+ PARAMS ((bfd *, char *, int *, const char *, const char *));
+extern char *elfcore_write_prstatus
+ PARAMS ((bfd *, char *, int *, long, int, const PTR));
+extern char * elfcore_write_pstatus
+ PARAMS ((bfd *, char *, int *, long, int, const PTR));
+extern char *elfcore_write_prfpreg
+ PARAMS ((bfd *, char *, int *, const PTR, int));
+extern char *elfcore_write_prxfpreg
+ PARAMS ((bfd *, char *, int *, const PTR, int));
+extern char *elfcore_write_lwpstatus
+ PARAMS ((bfd *, char *, int *, long, int, const PTR));
/* SH ELF specific routine. */