diff options
-rw-r--r-- | bfd/ChangeLog | 58 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 6 | ||||
-rw-r--r-- | bfd/elf.c | 4 | ||||
-rw-r--r-- | bfd/elf32-arm.h | 8 | ||||
-rw-r--r-- | bfd/elf32-cris.c | 8 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 9 | ||||
-rw-r--r-- | bfd/elf32-m68k.c | 8 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 9 | ||||
-rw-r--r-- | bfd/elf32-s390.c | 9 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 8 | ||||
-rw-r--r-- | bfd/elf32-sparc.c | 8 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 8 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 9 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 9 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 9 | ||||
-rw-r--r-- | bfd/elflink.h | 23 | ||||
-rw-r--r-- | bfd/elfxx-ia64.c | 8 |
17 files changed, 115 insertions, 86 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2f424e9..b9bcb5c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,27 @@ +2001-09-24 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire + reloc rather than just the type. + (_bfd_elf_reloc_type_class): Likewise. + * elf.c (_bfd_elf_reloc_type_class): Likewise. + * elf32-arm.h (elf32_arm_reloc_type_class): Likewise. + * elf32-cris.c (elf_cris_reloc_type_class): Likewise. + * elf32-i386.c (elf_i386_reloc_type_class): Likewise. + * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise. + * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise. + * elf32-s390.c (elf_s390_reloc_type_class): Likewise. + * elf32-sh.c (sh_elf_reloc_type_class): Likewise. + * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise. + * elf64-s390.c (elf_s390_reloc_type_class): Likewise. + * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise. + * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise. + * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise. + * elflink.h: Formatting fixes. + (elf_link_sort_relocs): Make "count" and "size" bfd_size_type. + Call bfd_zmalloc rather than calloc. Remove unnecessary cast of + o->contents to PTR. Update call to elf_backend_reloc_type_class. + 2001-09-22 John Reiser <jreiser@BitWagon.com> * elfcode.h (elf_object_p): Allow for no section header at all in @@ -90,23 +114,23 @@ 2001-09-20 John Reiser <jreiser@BitWagon.com> - * elf32-i386.c (elf_i386_relocate_section): coordinate info->symbolic - and info->allow_shlib_undefined. - * elf32-cris.c: likewise - * elf32-hppa.c: likewise - * elf32-m68k.c: likewise - * elf32-mips.c: likewise - * elf32-ppc.c: likewise - * elf32-s390.c: likewise - * elf32-sh.c: likewise - * elf32-sparc.c: likewise - * elf64-alpha.c: likewise - * elf64-hppa.c: likewise - * elf64-ppc.c: likewise - * elf64-s390.c: likewise - * elf64-sparc.c: likewise - * elf64-x86-64.c: likewise - * elfxx-ia64.c: likewise + * elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic + and info->allow_shlib_undefined. + * elf32-cris.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. 2001-09-18 Bruno Haible <haible@clisp.cons.org> diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index eaf37fe..ec3b21d 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -665,8 +665,8 @@ struct elf_backend_data PARAMS ((bfd *, PTR, bfd_vma)); /* This function returns class of a reloc type. */ - enum elf_reloc_type_class (* elf_backend_reloc_type_class) - PARAMS ((int)); + enum elf_reloc_type_class (*elf_backend_reloc_type_class) + PARAMS ((const Elf_Internal_Rela *)); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -1044,7 +1044,7 @@ extern void _bfd_elf_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); extern enum elf_reloc_type_class _bfd_elf_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); extern unsigned long bfd_elf_hash PARAMS ((const char *)); @@ -5982,8 +5982,8 @@ _bfd_elf_fprintf_vma (abfd, stream, value) } enum elf_reloc_type_class -_bfd_elf_reloc_type_class (type) - int type ATTRIBUTE_UNUSED; +_bfd_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED; { return reloc_class_normal; } diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index a4e0e90..071af98 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -92,7 +92,7 @@ boolean bfd_elf32_arm_get_bfd_for_interworking boolean bfd_elf32_arm_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int)); static enum elf_reloc_type_class elf32_arm_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); #define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) @@ -3459,10 +3459,10 @@ elf32_arm_post_process_headers (abfd, link_info) } static enum elf_reloc_type_class -elf32_arm_reloc_type_class (type) - int type; +elf32_arm_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_ARM_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index e50d05c..aca0852 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -86,7 +86,7 @@ static boolean elf_cris_finish_dynamic_sections static void elf_cris_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static enum elf_reloc_type_class elf_cris_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); static reloc_howto_type cris_elf_howto_table [] = { @@ -2981,10 +2981,10 @@ cris_elf_merge_private_bfd_data (ibfd, obfd) static enum elf_reloc_type_class -elf_cris_reloc_type_class (type) - int type; +elf_cris_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_CRIS_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 4b01066..211f93a 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -63,7 +63,8 @@ static boolean elf_i386_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_i386_fake_sections PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); -static enum elf_reloc_type_class elf_i386_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class elf_i386_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); static boolean elf_i386_grok_prstatus PARAMS ((bfd *abfd, Elf_Internal_Note *note)); static boolean elf_i386_grok_psinfo @@ -2186,10 +2187,10 @@ elf_i386_fake_sections (abfd, hdr, sec) } static enum elf_reloc_type_class -elf_i386_reloc_type_class (type) - int type; +elf_i386_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_386_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index d381be9..80613f1 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -64,7 +64,7 @@ static boolean elf32_m68k_merge_private_bfd_data static boolean elf32_m68k_print_private_bfd_data PARAMS ((bfd *, PTR)); static enum elf_reloc_type_class elf32_m68k_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); static reloc_howto_type howto_table[] = { HOWTO(R_68K_NONE, 0, 0, 0, false,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", false, 0, 0x00000000,false), @@ -2308,10 +2308,10 @@ error_return: } static enum elf_reloc_type_class -elf32_m68k_reloc_type_class (type) - int type; +elf32_m68k_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_68K_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index a859956..d770b2b 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -108,7 +108,8 @@ static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *, Elf_Internal_Sym *)); static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static enum elf_reloc_type_class ppc_elf_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class ppc_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); static boolean ppc_elf_grok_prstatus PARAMS ((bfd *abfd, Elf_Internal_Note *note)); static boolean ppc_elf_grok_psinfo @@ -3717,10 +3718,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } static enum elf_reloc_type_class -ppc_elf_reloc_type_class (type) - int type; +ppc_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_PPC_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 088d5d1..73db3f7 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -56,7 +56,8 @@ static boolean elf_s390_finish_dynamic_symbol static boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_s390_object_p PARAMS ((bfd *)); -static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class elf_s390_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); #define USE_RELA 1 /* We want RELA relocations, not REL. */ @@ -2139,10 +2140,10 @@ elf_s390_object_p (abfd) } static enum elf_reloc_type_class -elf_s390_reloc_type_class (type) - int type; +elf_s390_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_390_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 6f94095..b91e838 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -84,7 +84,7 @@ static boolean sh_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static enum elf_reloc_type_class sh_elf_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -4434,10 +4434,10 @@ sh_elf_finish_dynamic_sections (output_bfd, info) } static enum elf_reloc_type_class -sh_elf_reloc_type_class (type) - int type; +sh_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_SH_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index c50e445..889d83f 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -53,7 +53,7 @@ static boolean elf32_sparc_object_p static void elf32_sparc_final_write_processing PARAMS ((bfd *, boolean)); static enum elf_reloc_type_class elf32_sparc_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); static asection * elf32_sparc_gc_mark_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); @@ -2082,10 +2082,10 @@ elf32_sparc_final_write_processing (abfd, linker) } static enum elf_reloc_type_class -elf32_sparc_reloc_type_class (type) - int type; +elf32_sparc_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF32_R_TYPE (rela->r_info)) { case R_SPARC_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 7d9206e..0dd6c09 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -136,7 +136,7 @@ static boolean elf64_alpha_merge_ind_symbols static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); static enum elf_reloc_type_class elf64_alpha_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); struct alpha_elf_link_hash_entry { @@ -4131,10 +4131,10 @@ elf64_alpha_final_link (abfd, info) } static enum elf_reloc_type_class -elf64_alpha_reloc_type_class (type) - int type; +elf64_alpha_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF64_R_TYPE (rela->r_info)) { case R_ALPHA_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index a8b71dd..02a436f 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -56,7 +56,8 @@ static boolean elf_s390_finish_dynamic_symbol static boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_s390_object_p PARAMS ((bfd *)); -static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class elf_s390_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); #define USE_RELA 1 /* We want RELA relocations, not REL. */ @@ -2100,10 +2101,10 @@ elf_s390_object_p (abfd) static enum elf_reloc_type_class -elf_s390_reloc_type_class (type) - int type; +elf_s390_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF64_R_TYPE (rela->r_info)) { case R_390_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 7a18d9b..6fd24f9 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -96,7 +96,8 @@ static boolean sparc64_elf_slurp_reloc_table static long sparc64_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR)); -static enum elf_reloc_type_class sparc64_elf_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class sparc64_elf_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); /* The relocation "howto" table. */ @@ -2917,10 +2918,10 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) } static enum elf_reloc_type_class -sparc64_elf_reloc_type_class (type) - int type; +sparc64_elf_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF64_R_TYPE (rela->r_info)) { case R_SPARC_RELATIVE: return reloc_class_relative; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c86a50f..0359b16 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -153,7 +153,8 @@ static boolean elf64_x86_64_finish_dynamic_symbol Elf_Internal_Sym *sym)); static boolean elf64_x86_64_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static enum elf_reloc_type_class elf64_x86_64_reloc_type_class PARAMS ((int)); +static enum elf_reloc_type_class elf64_x86_64_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); /* Given a BFD reloc type, return a HOWTO structure. */ static reloc_howto_type * @@ -1936,10 +1937,10 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) } static enum elf_reloc_type_class -elf64_x86_64_reloc_type_class (type) - int type; +elf64_x86_64_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELF64_R_TYPE (rela->r_info)) { case R_X86_64_RELATIVE: return reloc_class_relative; diff --git a/bfd/elflink.h b/bfd/elflink.h index 393f932..e38f0d5 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -4338,8 +4338,8 @@ elf_link_sort_cmp1 (A, B) const PTR A; const PTR B; { - struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A; - struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B; + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B; int relativea, relativeb; relativea = a->type == reloc_class_relative; @@ -4365,8 +4365,8 @@ elf_link_sort_cmp2 (A, B) const PTR A; const PTR B; { - struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A; - struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B; + struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A; + struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B; int copya, copyb; if (a->offset < b->offset) @@ -4395,7 +4395,8 @@ elf_link_sort_relocs (abfd, info, psec) bfd *dynobj = elf_hash_table (info)->dynobj; asection *reldyn, *o; boolean rel = false; - size_t count, size, i, j, ret; + bfd_size_type count, size; + size_t i, j, ret; struct elf_link_sort_rela *rela; struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -4421,7 +4422,7 @@ elf_link_sort_relocs (abfd, info, psec) if (size != reldyn->_raw_size) return 0; - rela = (struct elf_link_sort_rela *) calloc (sizeof (*rela), count); + rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count); if (rela == NULL) { (*info->callbacks->warning) @@ -4441,7 +4442,7 @@ elf_link_sort_relocs (abfd, info, psec) struct elf_link_sort_rela *s; erel = (Elf_External_Rel *) o->contents; - erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size); + erelend = (Elf_External_Rel *) (o->contents + o->_raw_size); s = rela + o->output_offset / sizeof (Elf_External_Rel); for (; erel < erelend; erel++, s++) { @@ -4450,8 +4451,7 @@ elf_link_sort_relocs (abfd, info, psec) else elf_swap_reloc_in (abfd, erel, &s->u.rel); - s->type = ((*bed->elf_backend_reloc_type_class) - ((int) ELF_R_TYPE (s->u.rel.r_info))); + s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela); } } else @@ -4460,7 +4460,7 @@ elf_link_sort_relocs (abfd, info, psec) struct elf_link_sort_rela *s; erela = (Elf_External_Rela *) o->contents; - erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size); + erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size); s = rela + o->output_offset / sizeof (Elf_External_Rela); for (; erela < erelaend; erela++, s++) { @@ -4470,8 +4470,7 @@ elf_link_sort_relocs (abfd, info, psec) else elf_swap_reloca_in (dynobj, erela, &s->u.rela); - s->type = ((*bed->elf_backend_reloc_type_class) - ((int) ELF_R_TYPE (s->u.rel.r_info))); + s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela); } } } diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index ef18ec3..739fe7a 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -301,7 +301,7 @@ static boolean elfNN_ia64_merge_private_bfd_data static boolean elfNN_ia64_print_private_bfd_data PARAMS ((bfd *abfd, PTR ptr)); static enum elf_reloc_type_class elfNN_ia64_reloc_type_class - PARAMS ((int)); + PARAMS ((const Elf_Internal_Rela *)); /* ia64-specific relocation */ @@ -4330,10 +4330,10 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) } static enum elf_reloc_type_class -elfNN_ia64_reloc_type_class (type) - int type; +elfNN_ia64_reloc_type_class (rela) + const Elf_Internal_Rela *rela; { - switch (type) + switch ((int) ELFNN_R_TYPE (rela->r_info)) { case R_IA64_REL32MSB: case R_IA64_REL32LSB: |