* targets.c (bfd_target): Make backend_data const void *.
* elf-bfd.h: Constify all occurrences of struct elf_backend_data.
* elf-m10300.c: Likewise.
* elf.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-sparc.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-mips.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sh64.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elfcode.h: Likewise.
* elfcore.h: Likewise.
* elflink.c: Likewise.
* elflink.h: Likewise.
* elfxx-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* elfxx-mips.h: Likewise.
* elf.c (prep_headers): Remove useless check for null backend_data.
* bfd-in2.h: Regenerate.
2003-08-07 Alan Modra <amodra@bigpond.net.au>
+ * elfxx-target.h: Remove PTR cast.
+ * targets.c (bfd_target): Make backend_data const void *.
+ * elf-bfd.h: Constify all occurrences of struct elf_backend_data.
+ * elf-m10300.c: Likewise.
+ * elf.c: Likewise.
+ * elf32-hppa.c: Likewise.
+ * elf32-i386.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-s390.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * elf32-sh64.c: Likewise.
+ * elf32-sparc.c: Likewise.
+ * elf32-xtensa.c: Likewise.
+ * elf64-mips.c: Likewise.
+ * elf64-ppc.c: Likewise.
+ * elf64-s390.c: Likewise.
+ * elf64-sh64.c: Likewise.
+ * elf64-sparc.c: Likewise.
+ * elf64-x86-64.c: Likewise.
+ * elfcode.h: Likewise.
+ * elfcore.h: Likewise.
+ * elflink.c: Likewise.
+ * elflink.h: Likewise.
+ * elfxx-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * elfxx-mips.h: Likewise.
+ * elf.c (prep_headers): Remove useless check for null backend_data.
+ * bfd-in2.h: Regenerate.
+
* elf-bfd.h: Remove PARAMS macro. Replace PTR with void *.
(NAME): Use ## rather than CONCAT4 macro.
* elfcode.h: Remove one remaining PARAMS macro.
/* Data for use by back-end routines, which isn't
generic enough to belong in this structure. */
- void *backend_data;
+ const void *backend_data;
} bfd_target;
newly created and plt/got refcounts and dynamic indices should not
be copied. */
void (*elf_backend_copy_indirect_symbol)
- (struct elf_backend_data *, struct elf_link_hash_entry *,
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
/* Modify any information related to dynamic linking such that the
&& sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
#define get_elf_backend_data(abfd) \
- ((struct elf_backend_data *) (abfd)->xvec->backend_data)
+ ((const struct elf_backend_data *) (abfd)->xvec->backend_data)
/* This struct is used to pass information to routines called via
elf_link_hash_traverse which must return failure. */
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
(bfd *);
extern void _bfd_elf_link_hash_copy_indirect
- (struct elf_backend_data *, struct elf_link_hash_entry *,
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
extern void _bfd_elf_link_hash_hide_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
flagword pltflags;
asection * s;
struct elf_link_hash_entry * h;
- struct elf_backend_data * bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data * bed = get_elf_backend_data (abfd);
int ptralign;
/* This function may be called more than once. */
{
flagword flags;
asection * s;
- struct elf_backend_data * bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data * bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
Elf_External_Sym_Shndx *shndx;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymend;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
size_t extsym_size;
bfd_size_type amt;
file_ptr pos;
{
asection *newsect;
flagword flags;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (hdr->bfd_section != NULL)
{
{
const char *section_name;
const char *name = NULL;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
unsigned char st_other;
bfd_vma val;
old indirect symbol. Also used for copying flags to a weakdef. */
void
-_bfd_elf_link_hash_copy_indirect (struct elf_backend_data *bed,
+_bfd_elf_link_hash_copy_indirect (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
{
Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex];
Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd);
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
const char *name;
name = elf_string_from_elf_strtab (abfd, hdr->sh_name);
_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr)
{
bfd_boolean found = FALSE;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* See if this is one of the special sections. */
if (name)
{
const struct bfd_elf_special_section *ssect = NULL;
- unsigned int rela = get_elf_backend_data (abfd)->default_use_rela_p;
+ unsigned int rela = bed->default_use_rela_p;
if (bed->special_sections)
ssect = get_special_section (name, bed->special_sections, rela);
bfd_boolean
bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
switch (hdr->p_type)
{
bfd_boolean use_rela_p)
{
char *name;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_size_type amt = sizeof ".rela" + strlen (asect->name);
name = bfd_alloc (abfd, amt);
static void
elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean *failedptr = failedptrarg;
Elf_Internal_Shdr *this_hdr;
sym_is_global (bfd *abfd, asymbol *sym)
{
/* If the backend has a special mapping, use it. */
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (bed->elf_backend_sym_is_global)
return (*bed->elf_backend_sym_is_global) (abfd, sym);
_bfd_elf_compute_section_file_positions (bfd *abfd,
struct bfd_link_info *link_info)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean failed;
struct bfd_strtab_hash *strtab;
Elf_Internal_Shdr *shstrtab_hdr;
{
size_t segs;
asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* We can't return a different result each time we're called. */
if (elf_tdata (abfd)->program_header_size != 0)
Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd);
unsigned int num_sec = elf_numsections (abfd);
file_ptr off;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
&& bfd_get_format (abfd) != bfd_core)
Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */
struct elf_strtab_hash *shstrtab;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
i_ehdrp = elf_elfheader (abfd);
i_shdrp = elf_elfsections (abfd);
Such need can generally be supplied by replacing the tests for
e_machine with the conditions used to determine it. */
default:
- if (get_elf_backend_data (abfd) != NULL)
- i_ehdrp->e_machine = get_elf_backend_data (abfd)->elf_machine_code;
- else
- i_ehdrp->e_machine = EM_NONE;
- }
+ i_ehdrp->e_machine = bed->elf_machine_code;
+ }
i_ehdrp->e_version = bed->s->ev_current;
i_ehdrp->e_ehsize = bed->s->sizeof_ehdr;
bfd_boolean
_bfd_elf_write_object_contents (bfd *abfd)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
Elf_Internal_Ehdr *i_ehdrp;
Elf_Internal_Shdr **i_shdrp;
bfd_boolean failed;
int
_bfd_elf_section_from_bfd_section (bfd *abfd, struct sec *asect)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
int index;
if (elf_section_data (asect) != NULL
bfd_vma maxpagesize;
struct elf_segment_map *phdr_adjust_seg = NULL;
unsigned int phdr_adjust_num = 0;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
struct bfd_strtab_hash **sttp,
int relocatable_p)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
int symcount;
asymbol **syms;
struct bfd_strtab_hash *stt;
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
long
_bfd_elf_get_symtab (bfd *abfd, asymbol **allocation)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE);
if (symcount >= 0)
_bfd_elf_canonicalize_dynamic_symtab (bfd *abfd,
asymbol **allocation)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE);
if (symcount >= 0)
static bfd_boolean
elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
switch (note->type)
{
pad = 0;
if (name != NULL)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
namesz = strlen (name) + 1;
bed = get_elf_backend_data (abfd);
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf32_hppa_copy_indirect_symbol (struct elf_backend_data *bed,
+elf32_hppa_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf_i386_copy_indirect_symbol (struct elf_backend_data *bed,
+elf_i386_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
Elf_Internal_Rela *rel, *relend;
const char *name;
struct m68hc11_page_info *pinfo;
- struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
+ const struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-ppc_elf_copy_indirect_symbol (struct elf_backend_data *bed,
+ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
asection *srel = lsect->rel_section;
Elf_Internal_Rela outrel[MAX_INT_RELS_PER_EXT_REL];
bfd_byte *erel;
- struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+ const struct elf_backend_data *bed;
unsigned int i;
BFD_ASSERT (srel != NULL);
+ bed = get_elf_backend_data (output_bfd);
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
{
outrel[i].r_offset = (lsect->section->output_section->vma
static bfd_boolean elf_s390_create_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
static void elf_s390_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static bfd_boolean elf_s390_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
static void
elf_s390_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf_s390_link_hash_entry *edir, *eind;
(bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
bfd_boolean, asymbol **);
static void sh_elf_copy_indirect_symbol
- (struct elf_backend_data *, struct elf_link_hash_entry *,
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
static int sh_elf_optimized_tls_reloc
(struct bfd_link_info *, int, int);
struct elf_sh_link_hash_table *htab;
flagword flags, pltflags;
register asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-sh_elf_copy_indirect_symbol (struct elf_backend_data *bed,
+sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
{
/* No previous datalabel symbol. Make one. */
struct bfd_link_hash_entry *bh = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
static bfd_boolean elf32_sparc_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static void elf32_sparc_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static int elf32_sparc_tls_transition
PARAMS ((struct bfd_link_info *, bfd *, int, int));
static void
elf32_sparc_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf32_sparc_link_hash_entry *edir, *eind;
static void elf_xtensa_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
static void elf_xtensa_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static asection *elf_xtensa_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
static void
elf_xtensa_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-ppc64_elf_copy_indirect_symbol (struct elf_backend_data *bed ATTRIBUTE_UNUSED,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ppc64_elf_copy_indirect_symbol
+ (const struct elf_backend_data *bed ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct ppc_link_hash_entry *edir, *eind;
flagword mask;
static bfd_boolean elf_s390_create_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
static void elf_s390_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static bfd_boolean elf_s390_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
static void
elf_s390_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf_s390_link_hash_entry *edir, *eind;
{
/* No previous datalabel symbol. Make one. */
struct bfd_link_hash_entry *bh = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
{
flagword flags, pltflags;
register asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf64_x86_64_copy_indirect_symbol (struct elf_backend_data *bed,
+elf64_x86_64_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
unsigned int shindex;
char *shstrtab; /* Internal copy of section header stringtab */
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
struct bfd_preserve preserve;
asection *s;
bfd_size_type amt;
for which we do not have a specific backend. */
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
{
- struct elf_backend_data *back;
+ const struct elf_backend_data *back;
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
- back = (struct elf_backend_data *) (*target_ptr)->backend_data;
+ back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& back->elf_machine_alt1 == i_ehdrp->e_machine)
Elf_Internal_Sym *isymbuf = NULL;
Elf_External_Versym *xver;
Elf_External_Versym *xverbuf = NULL;
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
bfd_size_type amt;
/* Read each raw ELF symbol, converting from external ELF form to
asymbol **symbols,
bfd_boolean dynamic)
{
- struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
+ const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
void *allocated = NULL;
bfd_byte *native_relocs;
arelent *relent;
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form. */
Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form. */
unsigned int phindex;
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
struct bfd_preserve preserve;
bfd_size_type amt;
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
{
- struct elf_backend_data *back;
+ const struct elf_backend_data *back;
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
- back = (struct elf_backend_data *) (*target_ptr)->backend_data;
+ back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& i_ehdrp->e_machine == back->elf_machine_alt1)
asection *s;
struct elf_link_hash_entry *h;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign;
/* This function may be called more than once. */
register asection *s;
struct elf_link_hash_entry *h;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (! is_elf_hash_table (info))
return FALSE;
{
flagword flags, pltflags;
asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
/* Handle the case where we had a versioned symbol in a dynamic
library and now find a definition in a normal object. In this
case, we make the versioned symbol point to the normal one. */
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
flip->root.type = h->root.type;
h->root.type = bfd_link_hash_indirect;
h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
char *shortname;
struct elf_link_hash_entry *hi;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean collect;
bfd_boolean dynamic;
char *p;
{
struct elf_assign_sym_version_info *sinfo;
struct bfd_link_info *info;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_info_failed eif;
char *p;
bfd_size_type amt;
void *external_relocs,
Elf_Internal_Rela *internal_relocs)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
const bfd_byte *erela;
const bfd_byte *erelaend;
Elf_Internal_Shdr *rel_hdr;
void *alloc1 = NULL;
Elf_Internal_Rela *alloc2 = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (elf_section_data (o)->relocs != NULL)
return elf_section_data (o)->relocs;
Elf_Internal_Shdr *output_rel_hdr;
asection *output_section;
unsigned int *rel_countp = NULL;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
output_section = input_section->output_section;
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean force_local;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
&& h->root.type == bfd_link_hash_undefweak)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
(*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
}
h->weakdef = NULL;
else
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
(*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
{
struct elf_info_failed *eif = data;
bfd *dynobj;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (! is_elf_hash_table (eif->info))
return FALSE;
Elf_Internal_Sym *isymbuf = NULL;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymend;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean dt_needed;
struct elf_link_hash_table * hash_table;
bfd_size_type amt;
{
bfd_size_type soname_indx;
bfd *dynobj;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_assign_sym_version_info asvinfo;
*sinterpptr = NULL;
struct elf_link_hash_entry **rel_hash)
{
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_byte *erela;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
size_t i, ret, sort_elt, ext_size;
bfd_byte *sort, *s_non_relative, *p;
struct elf_link_sort_rela *sq;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int i2e = bed->s->int_rels_per_ext_rel;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *symtab_shndx_hdr;
Elf_Internal_Shdr *symstrtab_hdr;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
struct elf_outext_info eoinfo;
bfd_boolean merged;
size_t relativecount = 0;
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (finfo->output_bfd);
if (! ((*bed->elf_backend_finish_dynamic_symbol)
long *pindex;
asection **ppsection;
asection *o;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean emit_relocs;
struct elf_link_hash_entry **sym_hashes;
bfd_vma addend;
struct elf_link_hash_entry **rel_hash_ptr;
Elf_Internal_Shdr *rel_hdr;
- struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL];
bfd_byte *erel;
unsigned int i;
size_t nlocsyms;
size_t extsymoff;
bfd *input_bfd = sec->owner;
- struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
Elf_Internal_Sym *isym = NULL;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
pu = h->vtable_parent->vtable_entries_used;
if (pu != NULL)
{
- asection *sec = h->root.u.def.section;
- struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
- unsigned int log_file_align = bed->s->log_file_align;
+ const struct elf_backend_data *bed;
+ unsigned int log_file_align;
+ bed = get_elf_backend_data (h->root.u.def.section->owner);
+ log_file_align = bed->s->log_file_align;
n = h->vtable_parent->vtable_entries_size >> log_file_align;
while (n--)
{
asection *sec;
bfd_vma hstart, hend;
Elf_Internal_Rela *relstart, *relend, *rel;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
unsigned int log_file_align;
if (h->root.type == bfd_link_hash_warning)
struct elf_link_hash_entry *h,
bfd_vma addend)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int log_file_align = bed->s->log_file_align;
if (addend >= h->vtable_entries_size)
struct bfd_link_info *info)
{
bfd *i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_vma gotoff;
/* The GOT offset is relative to the .got section, but the GOT header is
struct elf_reloc_cookie cookie;
asection *stab, *eh;
Elf_Internal_Shdr *symtab_hdr;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd *abfd;
unsigned int count;
bfd_boolean ret = FALSE;
static bfd_boolean
elf_section_ignore_discarded_relocs (asection *sec)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
switch (sec->sec_info_type)
{
PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
const char *string));
static void elfNN_ia64_hash_copy_indirect
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static void elfNN_ia64_hash_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
static void
elfNN_ia64_hash_copy_indirect (bed, xdir, xind)
- struct elf_backend_data *bed ATTRIBUTE_UNUSED;
+ const struct elf_backend_data *bed ATTRIBUTE_UNUSED;
struct elf_link_hash_entry *xdir, *xind;
{
struct elfNN_ia64_link_hash_entry *dir, *ind;
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *sreloc;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (info->relocatable)
return TRUE;
const Elf_Internal_Rela *relend;
bfd_vma addend = 0;
bfd_boolean use_saved_addend_p = FALSE;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel;
void
_bfd_mips_elf_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct mips_elf_link_hash_entry *dirmips, *indmips;
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
extern void _bfd_mips_elf_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
extern void _bfd_mips_elf_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
#endif
/* backend_data: */
- (PTR) &elfNN_bed
+ &elfNN_bed
};
#endif
#endif
/* backend_data: */
- (PTR) &elfNN_bed
+ &elfNN_bed
};
#endif
. {* Data for use by back-end routines, which isn't
. generic enough to belong in this structure. *}
-. void *backend_data;
+. const void *backend_data;
.
.} bfd_target;
.