From 9c5bfbb7fd76589a332126f99a4e195e46da207f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 7 Aug 2003 08:38:11 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 30 +++++++++++++++++++++++++ bfd/bfd-in2.h | 2 +- bfd/elf-bfd.h | 6 ++--- bfd/elf-m10300.c | 4 ++-- bfd/elf.c | 55 +++++++++++++++++++++------------------------ bfd/elf32-hppa.c | 2 +- bfd/elf32-i386.c | 2 +- bfd/elf32-m68hc1x.c | 2 +- bfd/elf32-ppc.c | 5 +++-- bfd/elf32-s390.c | 4 ++-- bfd/elf32-sh.c | 6 ++--- bfd/elf32-sh64.c | 2 +- bfd/elf32-sparc.c | 4 ++-- bfd/elf32-xtensa.c | 4 ++-- bfd/elf64-mips.c | 2 +- bfd/elf64-ppc.c | 7 +++--- bfd/elf64-s390.c | 4 ++-- bfd/elf64-sh64.c | 4 ++-- bfd/elf64-sparc.c | 2 +- bfd/elf64-x86-64.c | 2 +- bfd/elfcode.h | 10 ++++----- bfd/elfcore.h | 6 ++--- bfd/elflink.c | 26 ++++++++++----------- bfd/elflink.h | 35 +++++++++++++++-------------- bfd/elfxx-ia64.c | 4 ++-- bfd/elfxx-mips.c | 6 ++--- bfd/elfxx-mips.h | 2 +- bfd/elfxx-target.h | 4 ++-- bfd/targets.c | 2 +- 29 files changed, 137 insertions(+), 107 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3fabd26b7ab..13bfca62ebd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,35 @@ 2003-08-07 Alan Modra + * 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. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 11d4e90e34f..0479814767b 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -4339,7 +4339,7 @@ typedef struct bfd_target /* 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; diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 02cb3024fb1..93f265fa147 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -800,7 +800,7 @@ struct elf_backend_data 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 @@ -1029,7 +1029,7 @@ struct bfd_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) + ((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. */ @@ -1319,7 +1319,7 @@ extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc 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); diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 0d68fe5119b..212fde7e8f4 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -562,7 +562,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info) 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. */ @@ -4049,7 +4049,7 @@ _bfd_mn10300_elf_create_dynamic_sections (abfd, info) { 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) diff --git a/bfd/elf.c b/bfd/elf.c index 33848a2b4dc..3868cff6a1d 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -325,7 +325,7 @@ bfd_elf_get_elf_syms (bfd *ibfd, 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; @@ -638,7 +638,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, { asection *newsect; flagword flags; - struct elf_backend_data *bed; + const struct elf_backend_data *bed; if (hdr->bfd_section != NULL) { @@ -1193,7 +1193,7 @@ bfd_elf_print_symbol (bfd *abfd, { 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; @@ -1344,7 +1344,7 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry, 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) { @@ -1649,7 +1649,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { 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); @@ -2123,13 +2123,13 @@ bfd_boolean _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); @@ -2274,7 +2274,7 @@ _bfd_elf_make_section_from_phdr (bfd *abfd, 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) { @@ -2332,7 +2332,7 @@ _bfd_elf_init_reloc_shdr (bfd *abfd, 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); @@ -2362,7 +2362,7 @@ _bfd_elf_init_reloc_shdr (bfd *abfd, 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; @@ -2872,7 +2872,7 @@ static int 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); @@ -3066,7 +3066,7 @@ bfd_boolean _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; @@ -4059,7 +4059,7 @@ get_program_header_size (bfd *abfd) { 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) @@ -4162,7 +4162,7 @@ assign_file_positions_except_relocs (bfd *abfd) 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) @@ -4269,7 +4269,7 @@ prep_headers (bfd *abfd) 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); @@ -4314,11 +4314,8 @@ prep_headers (bfd *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; @@ -4396,7 +4393,7 @@ _bfd_elf_assign_file_positions_for_relocs (bfd *abfd) 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; @@ -4458,7 +4455,7 @@ _bfd_elf_write_corefile_contents (bfd *abfd) 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 @@ -4574,7 +4571,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) 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) @@ -5269,7 +5266,7 @@ swap_out_syms (bfd *abfd, 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; @@ -5601,7 +5598,7 @@ _bfd_elf_canonicalize_reloc (bfd *abfd, { 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; @@ -5618,7 +5615,7 @@ _bfd_elf_canonicalize_reloc (bfd *abfd, 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) @@ -5630,7 +5627,7 @@ long _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) @@ -6758,7 +6755,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) 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) { @@ -7062,7 +7059,7 @@ elfcore_write_note (bfd *abfd, 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); diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 933879379df..ae09096f2be 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -990,7 +990,7 @@ elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) /* 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) { diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 60bccb8078b..23020b417bb 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -711,7 +711,7 @@ elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) /* 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) { diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 7733f05f1fd..b31fc7b454b 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -1119,7 +1119,7 @@ elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section, 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); diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index dff4126e155..b820638a58e 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -285,7 +285,7 @@ ppc_elf_link_hash_table_create (bfd *abfd) /* 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) { @@ -2581,11 +2581,12 @@ elf_finish_pointer_linker_section (bfd *output_bfd, 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 diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 1ce327f96d8..85e9ab6ae0f 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -40,7 +40,7 @@ static bfd_boolean create_got_section 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 *, @@ -856,7 +856,7 @@ elf_s390_create_dynamic_sections (dynobj, info) 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; diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 541786581d6..ac410c2842c 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -57,7 +57,7 @@ static bfd_byte *sh_elf_get_relocated_section_contents (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); @@ -3692,7 +3692,7 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) 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) @@ -6011,7 +6011,7 @@ sh_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, /* 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) { diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 267854867a9..396fedfad43 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -410,7 +410,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { /* 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, diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index c18edda6633..136d80e37d9 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -68,7 +68,7 @@ static bfd_boolean create_got_section 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)); @@ -750,7 +750,7 @@ elf32_sparc_create_dynamic_sections (dynobj, info) 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; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 3322c9efd68..8b09305eab2 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -48,7 +48,7 @@ static bfd_boolean elf_xtensa_check_relocs 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 *, @@ -799,7 +799,7 @@ elf_xtensa_hide_symbol (info, h, force_local) 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); diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index bec1acaa1c3..041c22262be 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -2100,7 +2100,7 @@ mips_elf64_canonicalize_reloc (abfd, section, relptr, symbols) { 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; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index d9f04a5acff..391633378d0 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3277,9 +3277,10 @@ ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) /* 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; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 62ef221392c..23ca8aade00 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -40,7 +40,7 @@ static bfd_boolean create_got_section 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 *, @@ -809,7 +809,7 @@ elf_s390_create_dynamic_sections (dynobj, info) 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; diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 905caddb290..2abf3c135a2 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -2917,7 +2917,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { /* 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, @@ -3238,7 +3238,7 @@ sh64_elf64_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { 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) diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 13f6a5501a4..25c609fc599 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -518,7 +518,7 @@ sparc64_elf_canonicalize_reloc (abfd, section, relptr, symbols) { 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; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 09a072b5b8e..39d5abbe6fd 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -501,7 +501,7 @@ elf64_x86_64_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) /* 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) { diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 7eaac982d82..a627e4854f2 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -492,7 +492,7 @@ elf_object_p (bfd *abfd) 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; @@ -591,11 +591,11 @@ elf_object_p (bfd *abfd) 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) @@ -1008,7 +1008,7 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) 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 @@ -1238,7 +1238,7 @@ elf_slurp_reloc_table_from_section (bfd *abfd, 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; diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 865edcd0650..81c4cff1139 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -76,7 +76,7 @@ elf_core_file_p (bfd *abfd) 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; @@ -153,11 +153,11 @@ elf_core_file_p (bfd *abfd) 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) diff --git a/bfd/elflink.c b/bfd/elflink.c index 740f5d85051..d53571d448a 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -32,7 +32,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) 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. */ @@ -115,7 +115,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) 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; @@ -248,7 +248,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { 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. */ @@ -1164,7 +1164,7 @@ _bfd_elf_merge_symbol (bfd *abfd, /* 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; @@ -1247,7 +1247,7 @@ _bfd_elf_add_default_symbol (bfd *abfd, 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; @@ -1621,7 +1621,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) { 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; @@ -1879,7 +1879,7 @@ elf_link_read_relocs_from_section (bfd *abfd, 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; @@ -1943,7 +1943,7 @@ _bfd_elf_link_read_relocs (bfd *abfd, 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; @@ -2076,7 +2076,7 @@ _bfd_elf_link_output_relocs (bfd *output_bfd, 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; @@ -2223,7 +2223,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, || 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); @@ -2238,7 +2238,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, 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); } @@ -2267,7 +2267,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, 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); @@ -2286,7 +2286,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) { 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; diff --git a/bfd/elflink.h b/bfd/elflink.h index c0b2468b7d8..5e9cb3c0a9e 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -415,7 +415,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) 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; @@ -1888,7 +1888,7 @@ NAME(bfd_elf,size_dynamic_sections) (bfd *output_bfd, { 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; @@ -2859,7 +2859,7 @@ elf_link_adjust_relocs (bfd *abfd, 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 *); @@ -2964,7 +2964,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) 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 *); @@ -3096,7 +3096,7 @@ elf_bfd_final_link (bfd *abfd, struct bfd_link_info *info) 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; @@ -4541,7 +4541,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) || (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) @@ -4687,7 +4687,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) 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; @@ -5321,7 +5321,7 @@ elf_reloc_link_order (bfd *output_bfd, 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; @@ -5509,7 +5509,7 @@ elf_gc_mark (struct bfd_link_info *info, 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; @@ -5727,10 +5727,11 @@ elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp) 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--) { @@ -5751,7 +5752,7 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp) 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) @@ -5914,7 +5915,7 @@ elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED, 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) @@ -5980,7 +5981,7 @@ elf_gc_common_finalize_got_offsets (bfd *abfd, 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 @@ -6183,7 +6184,7 @@ elf_bfd_discard_info (bfd *output_bfd, struct bfd_link_info *info) 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; @@ -6316,7 +6317,7 @@ elf_bfd_discard_info (bfd *output_bfd, struct bfd_link_info *info) 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) { diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 27ffdddeaec..fe1490ac9ab 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -211,7 +211,7 @@ static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry 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)); @@ -1589,7 +1589,7 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string) 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; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 4c5496516a8..99e9fbc0f76 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -4985,7 +4985,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) 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; @@ -6171,7 +6171,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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; @@ -7626,7 +7626,7 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs) 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; diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index f6459a5de2a..71cdc07e79a 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -70,7 +70,7 @@ extern bfd_boolean _bfd_mips_elf_gc_sweep_hook 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)); diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 9329b2b960e..544f8f36478 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -621,7 +621,7 @@ const bfd_target TARGET_BIG_SYM = #endif /* backend_data: */ - (PTR) &elfNN_bed + &elfNN_bed }; #endif @@ -717,6 +717,6 @@ const bfd_target TARGET_LITTLE_SYM = #endif /* backend_data: */ - (PTR) &elfNN_bed + &elfNN_bed }; #endif diff --git a/bfd/targets.c b/bfd/targets.c index 0ce77a935bc..c3212a95642 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -477,7 +477,7 @@ to find an alternative output format that is suitable. . {* 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; . -- 2.30.2