diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2003-12-07 21:24:28 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2003-12-07 21:24:28 +0000 |
commit | 11a2be4ddc6e706b7a5c501af297a7cd6726a2b8 (patch) | |
tree | e75e7963c30d203cf2a5b90d70910cb9c1ea1065 /bfd | |
parent | e7ebf6d61f345206115f0d9168ea13d33c555f9a (diff) | |
download | gdb-11a2be4ddc6e706b7a5c501af297a7cd6726a2b8.zip gdb-11a2be4ddc6e706b7a5c501af297a7cd6726a2b8.tar.gz gdb-11a2be4ddc6e706b7a5c501af297a7cd6726a2b8.tar.bz2 |
* elf32-mips.c, elfn32-mips.c, elf64-mips.c: Convert prototypes.
Remove casts that were only needed for K&R compatibility.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-mips.c | 271 | ||||
-rw-r--r-- | bfd/elf64-mips.c | 395 | ||||
-rw-r--r-- | bfd/elfn32-mips.c | 262 |
4 files changed, 325 insertions, 608 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 371f4a8..ec2958a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-12-07 Richard Sandiford <rsandifo@redhat.com> + + * elf32-mips.c, elfn32-mips.c, elf64-mips.c: Convert prototypes. + Remove casts that were only needed for K&R compatibility. + 2003-12-05 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru> * coff-arm.c (aoutarm_std_reloc_howto [ARM_WINCE]): Set diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index b17008e..299c395 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -48,48 +48,47 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ecoffswap.h" static bfd_reloc_status_type mips_elf_generic_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_hi16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_lo16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_got16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type gprel32_with_gp - PARAMS ((bfd *, asymbol *, arelent *, asection *, bfd_boolean, PTR, - bfd_vma)); + (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma); static bfd_reloc_status_type mips_elf_gprel32_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips32_64bit_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); + (bfd *, bfd_reloc_code_real_type); static reloc_howto_type *mips_elf32_rtype_to_howto - PARAMS ((unsigned int, bfd_boolean)); + (unsigned int, bfd_boolean); static void mips_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static void mips_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean mips_elf_sym_is_global - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); static bfd_boolean mips_elf32_object_p - PARAMS ((bfd *)); + (bfd *); static bfd_boolean mips_elf_is_local_label_name - PARAMS ((bfd *, const char *)); + (bfd *, const char *); static bfd_reloc_status_type mips16_jump_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_final_gp - PARAMS ((bfd *, asymbol *, bfd_boolean, char **, bfd_vma *)); + (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *); static bfd_boolean mips_elf_assign_gp - PARAMS ((bfd *, bfd_vma *)); + (bfd *, bfd_vma *); static bfd_boolean elf32_mips_grok_prstatus - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); static bfd_boolean elf32_mips_grok_psinfo - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); static irix_compat_t elf32_mips_irix_compat - PARAMS ((bfd *)); + (bfd *); extern const bfd_target bfd_elf32_bigmips_vec; extern const bfd_target bfd_elf32_littlemips_vec; @@ -724,19 +723,14 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto = /* We use this instead of bfd_elf_generic_reloc because the latter gets the handling of zero addends wrong. */ static bfd_reloc_status_type -mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -775,15 +769,9 @@ struct mips_hi16 static struct mips_hi16 *mips_hi16_list; static bfd_reloc_status_type -mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_reloc_status_type ret; bfd_vma relocation; @@ -791,7 +779,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -826,8 +814,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, } else { - if (bfd_is_und_section (symbol->section) - && output_bfd == (bfd *) NULL) + if (bfd_is_und_section (symbol->section) && output_bfd == NULL) ret = bfd_reloc_undefined; if (bfd_is_com_section (symbol->section)) @@ -844,7 +831,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_outofrange; /* Save the information, and let LO16 do the actual relocation. */ - n = (struct mips_hi16 *) bfd_malloc ((bfd_size_type) sizeof *n); + n = bfd_malloc (sizeof *n); if (n == NULL) return bfd_reloc_outofrange; n->addr = (bfd_byte *) data + reloc_entry->address; @@ -852,7 +839,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, n->next = mips_hi16_list; mips_hi16_list = n; - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) reloc_entry->address += input_section->output_offset; return ret; @@ -863,15 +850,9 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, R_MIPS_HI16 relocation described above. */ static bfd_reloc_status_type -mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_lo16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { arelent gp_disp_relent; @@ -921,7 +902,7 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, insn &= ~ (bfd_vma) 0xffff; insn |= val; - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); + bfd_put_32 (abfd, insn, l->addr); } next = l->next; @@ -975,19 +956,13 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, not yet know how to create global offset tables. */ static bfd_reloc_status_type -mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_got16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1003,9 +978,7 @@ mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, dangerous relocation. */ static bfd_boolean -mips_elf_assign_gp (output_bfd, pgp) - bfd *output_bfd; - bfd_vma *pgp; +mips_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp) { unsigned int count; asymbol **sym; @@ -1021,7 +994,7 @@ mips_elf_assign_gp (output_bfd, pgp) /* The linker script will have created a symbol named `_gp' with the appropriate value. */ - if (sym == (asymbol **) NULL) + if (sym == NULL) i = count; else { @@ -1057,12 +1030,8 @@ mips_elf_assign_gp (output_bfd, pgp) external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) - bfd *output_bfd; - asymbol *symbol; - bfd_boolean relocatable; - char **error_message; - bfd_vma *pgp; +mips_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable, + char **error_message, bfd_vma *pgp) { if (bfd_is_und_section (symbol->section) && ! relocatable) @@ -1100,15 +1069,10 @@ mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) merged. */ bfd_reloc_status_type -_bfd_mips_elf32_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +_bfd_mips_elf32_gprel16_reloc (bfd *abfd, arelent *reloc_entry, + asymbol *symbol, void *data, + asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1116,7 +1080,7 @@ _bfd_mips_elf32_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1124,7 +1088,7 @@ _bfd_mips_elf32_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_ok; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1146,15 +1110,9 @@ _bfd_mips_elf32_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, become the offset from the gp register. */ static bfd_reloc_status_type -mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1162,7 +1120,7 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1171,7 +1129,7 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_outofrange; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1189,15 +1147,9 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, } static bfd_reloc_status_type -gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, - gp) - bfd *abfd; - asymbol *symbol; - arelent *reloc_entry; - asection *input_section; - bfd_boolean relocatable; - PTR data; - bfd_vma gp; +gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, + asection *input_section, bfd_boolean relocatable, + void *data, bfd_vma gp) { bfd_vma relocation; bfd_vma val; @@ -1242,15 +1194,9 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, sign extension. */ static bfd_reloc_status_type -mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips32_64bit_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_reloc_status_type r; arelent reloc32; @@ -1279,7 +1225,7 @@ mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section, addr = reloc_entry->address; if (bfd_little_endian (abfd)) addr += 4; - bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + addr); + bfd_put_32 (abfd, val, (bfd_byte *) data + addr); return r; } @@ -1287,17 +1233,12 @@ mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 jump. */ static bfd_reloc_status_type -mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && reloc_entry->addend == 0) { @@ -1322,15 +1263,9 @@ mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type -mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1397,13 +1332,10 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->howto->partial_inplace) { bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((val >> 11) & 0x1f) - | (val & 0x7e0)), + (extend & 0xf800) | ((val >> 11) & 0x1f) | (val & 0x7e0), (bfd_byte *) data + reloc_entry->address); bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (val & 0x1f)), + (insn & 0xffe0) | (val & 0x1f), (bfd_byte *) data + reloc_entry->address + 2); } else @@ -1453,9 +1385,7 @@ static const struct elf_reloc_map mips_reloc_map[] = /* Given a BFD reloc type, return a howto structure. */ static reloc_howto_type * -bfd_elf32_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; +bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { unsigned int i; reloc_howto_type *howto_table = elf_mips_howto_table_rel; @@ -1507,9 +1437,8 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf32_rtype_to_howto (r_type, rela_p) - unsigned int r_type; - bfd_boolean rela_p ATTRIBUTE_UNUSED; +mips_elf32_rtype_to_howto (unsigned int r_type, + bfd_boolean rela_p ATTRIBUTE_UNUSED) { switch (r_type) { @@ -1540,10 +1469,7 @@ mips_elf32_rtype_to_howto (r_type, rela_p) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static void -mips_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -1563,10 +1489,7 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst) /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */ static void -mips_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +mips_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { mips_info_to_howto_rel (abfd, cache_ptr, dst); @@ -1581,9 +1504,7 @@ mips_info_to_howto_rela (abfd, cache_ptr, dst) and externally visible symbols. */ static bfd_boolean -mips_elf_sym_is_global (abfd, sym) - bfd *abfd ATTRIBUTE_UNUSED; - asymbol *sym; +mips_elf_sym_is_global (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) { if (SGI_COMPAT (abfd)) return (sym->flags & BSF_SECTION_SYM) == 0; @@ -1596,8 +1517,7 @@ mips_elf_sym_is_global (abfd, sym) /* Set the right machine number for a MIPS ELF file. */ static bfd_boolean -mips_elf32_object_p (abfd) - bfd *abfd; +mips_elf32_object_p (bfd *abfd) { unsigned long mach; @@ -1619,9 +1539,7 @@ mips_elf32_object_p (abfd) /* MIPS ELF local labels start with '$', not 'L'. */ static bfd_boolean -mips_elf_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; +mips_elf_is_local_label_name (bfd *abfd, const char *name) { if (name[0] == '$') return TRUE; @@ -1633,9 +1551,7 @@ mips_elf_is_local_label_name (abfd, name) /* Support for core dump NOTE sections. */ static bfd_boolean -elf32_mips_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; unsigned int raw_size; @@ -1665,9 +1581,7 @@ elf32_mips_grok_prstatus (abfd, note) } static bfd_boolean -elf32_mips_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -1699,8 +1613,7 @@ elf32_mips_grok_psinfo (abfd, note) /* Depending on the target vector we generate some version of Irix executables or "normal" MIPS ELF ABI executables. */ static irix_compat_t -elf32_mips_irix_compat (abfd) - bfd *abfd; +elf32_mips_irix_compat (bfd *abfd) { if ((abfd->xvec == &bfd_elf32_bigmips_vec) || (abfd->xvec == &bfd_elf32_littlemips_vec)) @@ -1717,12 +1630,9 @@ elf32_mips_irix_compat (abfd) objects, and before the final_link entry point is called. */ bfd_boolean -bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) - bfd *abfd; - struct bfd_link_info *info; - asection *datasec; - asection *relsec; - char **errmsg; +bfd_mips_elf32_create_embedded_relocs (bfd *abfd, struct bfd_link_info *info, + asection *datasec, asection *relsec, + char **errmsg) { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Sym *isymbuf = NULL; @@ -1752,13 +1662,12 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) } /* Get a copy of the native relocations. */ - internal_relocs = (_bfd_elf_link_read_relocs - (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); + internal_relocs = _bfd_elf_link_read_relocs (abfd, datasec, NULL, NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_return; - relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); + relsec->contents = bfd_alloc (abfd, datasec->reloc_count * 12); if (relsec->contents == NULL) goto error_return; diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 4422ade..998c5df 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -62,79 +62,76 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ecoffswap.h" static void mips_elf64_swap_reloc_in - PARAMS ((bfd *, const Elf64_Mips_External_Rel *, - Elf64_Mips_Internal_Rela *)); + (bfd *, const Elf64_Mips_External_Rel *, Elf64_Mips_Internal_Rela *); static void mips_elf64_swap_reloca_in - PARAMS ((bfd *, const Elf64_Mips_External_Rela *, - Elf64_Mips_Internal_Rela *)); + (bfd *, const Elf64_Mips_External_Rela *, Elf64_Mips_Internal_Rela *); static void mips_elf64_swap_reloc_out - PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *, - Elf64_Mips_External_Rel *)); + (bfd *, const Elf64_Mips_Internal_Rela *, Elf64_Mips_External_Rel *); static void mips_elf64_swap_reloca_out - PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *, - Elf64_Mips_External_Rela *)); + (bfd *, const Elf64_Mips_Internal_Rela *, Elf64_Mips_External_Rela *); static void mips_elf64_be_swap_reloc_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); static void mips_elf64_be_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); static void mips_elf64_be_swap_reloca_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); static void mips_elf64_be_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); + (bfd *, bfd_reloc_code_real_type); static reloc_howto_type *mips_elf64_rtype_to_howto - PARAMS ((unsigned int, bfd_boolean)); + (unsigned int, bfd_boolean); static void mips_elf64_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static void mips_elf64_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static long mips_elf64_get_reloc_upper_bound - PARAMS ((bfd *, asection *)); + (bfd *, asection *); static long mips_elf64_canonicalize_reloc - PARAMS ((bfd *, asection *, arelent **, asymbol **)); -static long mips_elf64_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); + (bfd *, asection *, arelent **, asymbol **); +static long mips_elf64_get_dynamic_reloc_upper_bound + (bfd *); static long mips_elf64_canonicalize_dynamic_reloc - PARAMS ((bfd *, arelent **, asymbol **)); + (bfd *, arelent **, asymbol **); static bfd_boolean mips_elf64_slurp_one_reloc_table - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, - arelent *, asymbol **, bfd_boolean)); + (bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, arelent *, + asymbol **, bfd_boolean); static bfd_boolean mips_elf64_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); + (bfd *, asection *, asymbol **, bfd_boolean); static void mips_elf64_write_relocs - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); static void mips_elf64_write_rel - PARAMS((bfd *, asection *, Elf_Internal_Shdr *, int *, PTR)); + (bfd *, asection *, Elf_Internal_Shdr *, int *, void *); static void mips_elf64_write_rela - PARAMS((bfd *, asection *, Elf_Internal_Shdr *, int *, PTR)); + (bfd *, asection *, Elf_Internal_Shdr *, int *, void *); static bfd_reloc_status_type mips_elf64_hi16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_gprel16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_literal_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_gprel32_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_shift6_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf64_got16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_jump_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_boolean mips_elf64_assign_gp - PARAMS ((bfd *, bfd_vma *)); + (bfd *, bfd_vma *); static bfd_reloc_status_type mips_elf64_final_gp - PARAMS ((bfd *, asymbol *, bfd_boolean, char **, bfd_vma *)); + (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *); static bfd_boolean mips_elf64_object_p - PARAMS ((bfd *)); + (bfd *); static irix_compat_t elf64_mips_irix_compat - PARAMS ((bfd *)); + (bfd *); static bfd_boolean elf64_mips_grok_prstatus - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); static bfd_boolean elf64_mips_grok_psinfo - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); extern const bfd_target bfd_elf64_bigmips_vec; extern const bfd_target bfd_elf64_littlemips_vec; @@ -1262,10 +1259,8 @@ static reloc_howto_type elf_mips_gnu_rela16_s2 = /* Swap in a MIPS 64-bit Rel reloc. */ static void -mips_elf64_swap_reloc_in (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_External_Rel *src; - Elf64_Mips_Internal_Rela *dst; +mips_elf64_swap_reloc_in (bfd *abfd, const Elf64_Mips_External_Rel *src, + Elf64_Mips_Internal_Rela *dst) { dst->r_offset = H_GET_64 (abfd, src->r_offset); dst->r_sym = H_GET_32 (abfd, src->r_sym); @@ -1279,10 +1274,8 @@ mips_elf64_swap_reloc_in (abfd, src, dst) /* Swap in a MIPS 64-bit Rela reloc. */ static void -mips_elf64_swap_reloca_in (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_External_Rela *src; - Elf64_Mips_Internal_Rela *dst; +mips_elf64_swap_reloca_in (bfd *abfd, const Elf64_Mips_External_Rela *src, + Elf64_Mips_Internal_Rela *dst) { dst->r_offset = H_GET_64 (abfd, src->r_offset); dst->r_sym = H_GET_32 (abfd, src->r_sym); @@ -1296,10 +1289,8 @@ mips_elf64_swap_reloca_in (abfd, src, dst) /* Swap out a MIPS 64-bit Rel reloc. */ static void -mips_elf64_swap_reloc_out (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_Internal_Rela *src; - Elf64_Mips_External_Rel *dst; +mips_elf64_swap_reloc_out (bfd *abfd, const Elf64_Mips_Internal_Rela *src, + Elf64_Mips_External_Rel *dst) { H_PUT_64 (abfd, src->r_offset, dst->r_offset); H_PUT_32 (abfd, src->r_sym, dst->r_sym); @@ -1312,10 +1303,8 @@ mips_elf64_swap_reloc_out (abfd, src, dst) /* Swap out a MIPS 64-bit Rela reloc. */ static void -mips_elf64_swap_reloca_out (abfd, src, dst) - bfd *abfd; - const Elf64_Mips_Internal_Rela *src; - Elf64_Mips_External_Rela *dst; +mips_elf64_swap_reloca_out (bfd *abfd, const Elf64_Mips_Internal_Rela *src, + Elf64_Mips_External_Rela *dst) { H_PUT_64 (abfd, src->r_offset, dst->r_offset); H_PUT_32 (abfd, src->r_sym, dst->r_sym); @@ -1329,10 +1318,8 @@ mips_elf64_swap_reloca_out (abfd, src, dst) /* Swap in a MIPS 64-bit Rel reloc. */ static void -mips_elf64_be_swap_reloc_in (abfd, src, dst) - bfd *abfd; - const bfd_byte *src; - Elf_Internal_Rela *dst; +mips_elf64_be_swap_reloc_in (bfd *abfd, const bfd_byte *src, + Elf_Internal_Rela *dst) { Elf64_Mips_Internal_Rela mirel; @@ -1354,10 +1341,8 @@ mips_elf64_be_swap_reloc_in (abfd, src, dst) /* Swap in a MIPS 64-bit Rela reloc. */ static void -mips_elf64_be_swap_reloca_in (abfd, src, dst) - bfd *abfd; - const bfd_byte *src; - Elf_Internal_Rela *dst; +mips_elf64_be_swap_reloca_in (bfd *abfd, const bfd_byte *src, + Elf_Internal_Rela *dst) { Elf64_Mips_Internal_Rela mirela; @@ -1379,10 +1364,8 @@ mips_elf64_be_swap_reloca_in (abfd, src, dst) /* Swap out a MIPS 64-bit Rel reloc. */ static void -mips_elf64_be_swap_reloc_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rela *src; - bfd_byte *dst; +mips_elf64_be_swap_reloc_out (bfd *abfd, const Elf_Internal_Rela *src, + bfd_byte *dst) { Elf64_Mips_Internal_Rela mirel; @@ -1405,10 +1388,8 @@ mips_elf64_be_swap_reloc_out (abfd, src, dst) /* Swap out a MIPS 64-bit Rela reloc. */ static void -mips_elf64_be_swap_reloca_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rela *src; - bfd_byte *dst; +mips_elf64_be_swap_reloca_out (bfd *abfd, const Elf_Internal_Rela *src, + bfd_byte *dst) { Elf64_Mips_Internal_Rela mirela; @@ -1433,19 +1414,14 @@ mips_elf64_be_swap_reloca_out (abfd, src, dst) /* Do a R_MIPS_HI16 relocation. */ static bfd_reloc_status_type -mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf64_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1477,19 +1453,13 @@ mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, not yet know how to create global offset tables. */ static bfd_reloc_status_type -mips_elf64_got16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf64_got16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { /* If we're relocating, and this is a local symbol, we can handle it just like an R_MIPS_HI16. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && ((symbol->flags & BSF_SECTION_SYM) != 0 || (symbol->flags & BSF_LOCAL) == 0)) return mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, @@ -1505,9 +1475,7 @@ mips_elf64_got16_reloc (abfd, reloc_entry, symbol, data, input_section, dangerous relocation. */ static bfd_boolean -mips_elf64_assign_gp (output_bfd, pgp) - bfd *output_bfd; - bfd_vma *pgp; +mips_elf64_assign_gp (bfd *output_bfd, bfd_vma *pgp) { unsigned int count; asymbol **sym; @@ -1523,7 +1491,7 @@ mips_elf64_assign_gp (output_bfd, pgp) /* The linker script will have created a symbol named `_gp' with the appropriate value. */ - if (sym == (asymbol **) NULL) + if (sym == NULL) i = count; else { @@ -1559,12 +1527,8 @@ mips_elf64_assign_gp (output_bfd, pgp) external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, pgp) - bfd *output_bfd; - asymbol *symbol; - bfd_boolean relocatable; - char **error_message; - bfd_vma *pgp; +mips_elf64_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable, + char **error_message, bfd_vma *pgp) { if (bfd_is_und_section (symbol->section) && ! relocatable) @@ -1599,15 +1563,9 @@ mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, pgp) become the offset from the gp register. */ static bfd_reloc_status_type -mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf64_gprel16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1615,7 +1573,7 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1623,7 +1581,7 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_ok; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1644,15 +1602,9 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, /* Do a R_MIPS_LITERAL relocation. */ static bfd_reloc_status_type -mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf64_literal_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1660,7 +1612,7 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1669,7 +1621,7 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, } /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1691,15 +1643,9 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, become the offset from the gp register. */ static bfd_reloc_status_type -mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf64_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1709,7 +1655,7 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1718,7 +1664,7 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_outofrange; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1770,19 +1716,14 @@ mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, the rest is at bits 6-10. The bitpos already got right by the howto. */ static bfd_reloc_status_type -mips_elf64_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf64_shift6_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { /* If we're relocating, and this is an external symbol, we don't want to change anything. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1802,17 +1743,12 @@ mips_elf64_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 jump. */ static bfd_reloc_status_type -mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (! reloc_entry->howto->partial_inplace || reloc_entry->addend == 0)) @@ -1838,15 +1774,9 @@ mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type -mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1913,13 +1843,10 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->howto->partial_inplace) { bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((val >> 11) & 0x1f) - | (val & 0x7e0)), + (extend & 0xf800) | ((val >> 11) & 0x1f) | (val & 0x7e0), (bfd_byte *) data + reloc_entry->address); bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (val & 0x1f)), + (insn & 0xffe0) | (val & 0x1f), (bfd_byte *) data + reloc_entry->address + 2); } else @@ -1982,9 +1909,8 @@ static const struct elf_reloc_map mips_reloc_map[] = /* Given a BFD reloc type, return a howto structure. */ static reloc_howto_type * -bfd_elf64_bfd_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { unsigned int i; /* FIXME: We default to RELA here instead of choosing the right @@ -2019,9 +1945,7 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf64_rtype_to_howto (r_type, rela_p) - unsigned int r_type; - bfd_boolean rela_p; +mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) { switch (r_type) { @@ -2051,19 +1975,17 @@ mips_elf64_rtype_to_howto (r_type, rela_p) /* Prevent relocation handling by bfd for MIPS ELF64. */ static void -mips_elf64_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf_Internal_Rela *dst ATTRIBUTE_UNUSED; +mips_elf64_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr ATTRIBUTE_UNUSED, + Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) { BFD_ASSERT (0); } static void -mips_elf64_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf_Internal_Rela *dst ATTRIBUTE_UNUSED; +mips_elf64_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr ATTRIBUTE_UNUSED, + Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) { BFD_ASSERT (0); } @@ -2072,16 +1994,13 @@ mips_elf64_info_to_howto_rela (abfd, cache_ptr, dst) to three relocs, we must tell the user to allocate more space. */ static long -mips_elf64_get_reloc_upper_bound (abfd, sec) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; +mips_elf64_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) { return (sec->reloc_count * 3 + 1) * sizeof (arelent *); } static long -mips_elf64_get_dynamic_reloc_upper_bound (abfd) - bfd *abfd; +mips_elf64_get_dynamic_reloc_upper_bound (bfd *abfd) { return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 3; } @@ -2092,11 +2011,8 @@ mips_elf64_get_dynamic_reloc_upper_bound (abfd) 3 to obtain the internal relocation count. */ static long -mips_elf64_canonicalize_reloc (abfd, section, relptr, symbols) - bfd *abfd; - sec_ptr section; - arelent **relptr; - asymbol **symbols; +mips_elf64_canonicalize_reloc (bfd *abfd, sec_ptr section, + arelent **relptr, asymbol **symbols) { arelent *tblptr; unsigned int i; @@ -2115,13 +2031,10 @@ mips_elf64_canonicalize_reloc (abfd, section, relptr, symbols) } static long -mips_elf64_canonicalize_dynamic_reloc (abfd, storage, syms) - bfd *abfd; - arelent **storage; - asymbol **syms; +mips_elf64_canonicalize_dynamic_reloc (bfd *abfd, arelent **storage, + asymbol **syms) { - bfd_boolean (*slurp_relocs) - PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); + bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); asection *s; long ret; @@ -2164,24 +2077,20 @@ mips_elf64_canonicalize_dynamic_reloc (abfd, storage, syms) generic code seems to depend on this. */ static bfd_boolean -mips_elf64_slurp_one_reloc_table (abfd, asect, rel_hdr, reloc_count, - relents, symbols, dynamic) - bfd *abfd; - asection *asect; - Elf_Internal_Shdr *rel_hdr; - bfd_size_type reloc_count; - arelent *relents; - asymbol **symbols; - bfd_boolean dynamic; +mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect, + Elf_Internal_Shdr *rel_hdr, + bfd_size_type reloc_count, + arelent *relents, asymbol **symbols, + bfd_boolean dynamic) { - PTR allocated = NULL; + void *allocated; bfd_byte *native_relocs; arelent *relent; bfd_vma i; int entsize; reloc_howto_type *howto_table; - allocated = (PTR) bfd_malloc (rel_hdr->sh_size); + allocated = bfd_malloc (rel_hdr->sh_size); if (allocated == NULL) return FALSE; @@ -2190,7 +2099,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, rel_hdr, reloc_count, != rel_hdr->sh_size)) goto error_return; - native_relocs = (bfd_byte *) allocated; + native_relocs = allocated; entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf64_Mips_External_Rel) @@ -2338,11 +2247,8 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, rel_hdr, reloc_count, zero before processing the relocs of a section. */ static bfd_boolean -mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic) - bfd *abfd; - asection *asect; - asymbol **symbols; - bfd_boolean dynamic; +mips_elf64_slurp_reloc_table (bfd *abfd, asection *asect, + asymbol **symbols, bfd_boolean dynamic) { struct bfd_elf_section_data * const d = elf_section_data (asect); Elf_Internal_Shdr *rel_hdr; @@ -2388,7 +2294,7 @@ mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic) /* Allocate space for 3 arelent structures for each Rel structure. */ amt = (reloc_count + reloc_count2) * 3 * sizeof (arelent); - relents = (arelent *) bfd_alloc (abfd, amt); + relents = bfd_alloc (abfd, amt); if (relents == NULL) return FALSE; @@ -2416,12 +2322,9 @@ mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic) /* Write out the relocations. */ static void -mips_elf64_write_relocs (abfd, sec, data) - bfd *abfd; - asection *sec; - PTR data; +mips_elf64_write_relocs (bfd *abfd, asection *sec, void *data) { - bfd_boolean *failedp = (bfd_boolean *) data; + bfd_boolean *failedp = data; int count; Elf_Internal_Shdr *rel_hdr; unsigned int idx; @@ -2482,21 +2385,18 @@ mips_elf64_write_relocs (abfd, sec, data) } static void -mips_elf64_write_rel (abfd, sec, rel_hdr, count, data) - bfd *abfd; - asection *sec; - Elf_Internal_Shdr *rel_hdr; - int *count; - PTR data; +mips_elf64_write_rel (bfd *abfd, asection *sec, + Elf_Internal_Shdr *rel_hdr, + int *count, void *data) { - bfd_boolean *failedp = (bfd_boolean *) data; + bfd_boolean *failedp = data; Elf64_Mips_External_Rel *ext_rel; unsigned int idx; asymbol *last_sym = 0; int last_sym_idx = 0; - rel_hdr->sh_size = (bfd_vma)(rel_hdr->sh_entsize * *count); - rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size); + rel_hdr->sh_size = rel_hdr->sh_entsize * *count; + rel_hdr->contents = bfd_alloc (abfd, rel_hdr->sh_size); if (rel_hdr->contents == NULL) { *failedp = TRUE; @@ -2581,21 +2481,18 @@ mips_elf64_write_rel (abfd, sec, rel_hdr, count, data) } static void -mips_elf64_write_rela (abfd, sec, rela_hdr, count, data) - bfd *abfd; - asection *sec; - Elf_Internal_Shdr *rela_hdr; - int *count; - PTR data; +mips_elf64_write_rela (bfd *abfd, asection *sec, + Elf_Internal_Shdr *rela_hdr, + int *count, void *data) { - bfd_boolean *failedp = (bfd_boolean *) data; + bfd_boolean *failedp = data; Elf64_Mips_External_Rela *ext_rela; unsigned int idx; asymbol *last_sym = 0; int last_sym_idx = 0; - rela_hdr->sh_size = (bfd_vma)(rela_hdr->sh_entsize * *count); - rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size); + rela_hdr->sh_size = rela_hdr->sh_entsize * *count; + rela_hdr->contents = bfd_alloc (abfd, rela_hdr->sh_size); if (rela_hdr->contents == NULL) { *failedp = TRUE; @@ -2683,8 +2580,7 @@ mips_elf64_write_rela (abfd, sec, rela_hdr, count, data) /* Set the right machine number for a MIPS ELF file. */ static bfd_boolean -mips_elf64_object_p (abfd) - bfd *abfd; +mips_elf64_object_p (bfd *abfd) { unsigned long mach; @@ -2702,8 +2598,7 @@ mips_elf64_object_p (abfd) /* Depending on the target vector we generate some version of Irix executables or "normal" MIPS ELF ABI executables. */ static irix_compat_t -elf64_mips_irix_compat (abfd) - bfd *abfd; +elf64_mips_irix_compat (bfd *abfd) { if ((abfd->xvec == &bfd_elf64_bigmips_vec) || (abfd->xvec == &bfd_elf64_littlemips_vec)) @@ -2714,9 +2609,7 @@ elf64_mips_irix_compat (abfd) /* Support for core dump NOTE sections. */ static bfd_boolean -elf64_mips_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf64_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; unsigned int raw_size; @@ -2746,9 +2639,7 @@ elf64_mips_grok_prstatus (abfd, note) } static bfd_boolean -elf64_mips_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf64_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -2948,9 +2839,9 @@ const struct elf_size_info mips_elf64_size_info = /* MIPS ELF64 archive functions. */ #define bfd_elf64_archive_functions extern bfd_boolean bfd_elf64_archive_slurp_armap - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean bfd_elf64_archive_write_armap - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); + (bfd *, unsigned int, struct orl *, unsigned int, int); #define bfd_elf64_archive_slurp_extended_name_table \ _bfd_archive_coff_slurp_extended_name_table #define bfd_elf64_archive_construct_extended_name_table \ diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 4d6327c..49cf898 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -48,50 +48,49 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ecoffswap.h" static bfd_reloc_status_type mips_elf_generic_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_hi16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_lo16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_got16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_boolean mips_elf_assign_gp - PARAMS ((bfd *, bfd_vma *)); + (bfd *, bfd_vma *); static bfd_reloc_status_type mips_elf_final_gp - PARAMS ((bfd *, asymbol *, bfd_boolean, char **, bfd_vma *)); + (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *); static bfd_reloc_status_type mips_elf_gprel16_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_literal_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips_elf_gprel32_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type gprel32_with_gp - PARAMS ((bfd *, asymbol *, arelent *, asection *, bfd_boolean, PTR, - bfd_vma)); + (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma); static bfd_reloc_status_type mips_elf_shift6_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_jump_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type mips16_gprel_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); + (bfd *, bfd_reloc_code_real_type); static reloc_howto_type *mips_elf_n32_rtype_to_howto - PARAMS ((unsigned int, bfd_boolean)); + (unsigned int, bfd_boolean); static void mips_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static void mips_info_to_howto_rela - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean mips_elf_sym_is_global - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); static bfd_boolean mips_elf_n32_object_p - PARAMS ((bfd *)); + (bfd *); static bfd_boolean elf32_mips_grok_prstatus - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); static bfd_boolean elf32_mips_grok_psinfo - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); static irix_compat_t elf_n32_mips_irix_compat - PARAMS ((bfd *)); + (bfd *); extern const bfd_target bfd_elf32_nbigmips_vec; extern const bfd_target bfd_elf32_nlittlemips_vec; @@ -1240,7 +1239,7 @@ static reloc_howto_type elf_mips_gnu_rela16_s2 = { \ /* If we're relocating, and this is an external symbol, we don't \ want to change anything. */ \ - if ((obfd) != (bfd *) NULL \ + if ((obfd) != NULL \ && ((sym)->flags & BSF_SECTION_SYM) == 0 \ && (! (entry)->howto->partial_inplace \ || (entry)->addend == 0)) \ @@ -1268,15 +1267,10 @@ static reloc_howto_type elf_mips_gnu_rela16_s2 = } static bfd_reloc_status_type -mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) @@ -1310,15 +1304,9 @@ struct mips_hi16 static struct mips_hi16 *mips_hi16_list; static bfd_reloc_status_type -mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data, asection *input_section, + bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) { bfd_reloc_status_type ret; bfd_vma relocation; @@ -1328,7 +1316,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, ret = bfd_reloc_ok; - if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) + if (bfd_is_und_section (symbol->section) && output_bfd == NULL) ret = bfd_reloc_undefined; if (bfd_is_com_section (symbol->section)) @@ -1344,7 +1332,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_outofrange; /* Save the information, and let LO16 do the actual relocation. */ - n = (struct mips_hi16 *) bfd_malloc ((bfd_size_type) sizeof *n); + n = bfd_malloc (sizeof *n); if (n == NULL) return bfd_reloc_outofrange; n->addr = (bfd_byte *) data + reloc_entry->address; @@ -1352,7 +1340,7 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, n->next = mips_hi16_list; mips_hi16_list = n; - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) reloc_entry->address += input_section->output_offset; return ret; @@ -1363,15 +1351,9 @@ mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, R_MIPS_HI16 relocation described above. */ static bfd_reloc_status_type -mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_lo16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { if (mips_hi16_list != NULL) { @@ -1412,7 +1394,7 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, insn &= ~ (bfd_vma) 0xffff; insn |= val; - bfd_put_32 (abfd, (bfd_vma) insn, l->addr); + bfd_put_32 (abfd, insn, l->addr); next = l->next; free (l); @@ -1442,19 +1424,13 @@ mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, not yet know how to create global offset tables. */ static bfd_reloc_status_type -mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_got16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { /* If we're relocating, and this is a local symbol, we can handle it just like an R_MIPS_HI16. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && ((symbol->flags & BSF_SECTION_SYM) != 0 || (symbol->flags & BSF_LOCAL) == 0)) return mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, @@ -1469,9 +1445,7 @@ mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, dangerous relocation. */ static bfd_boolean -mips_elf_assign_gp (output_bfd, pgp) - bfd *output_bfd; - bfd_vma *pgp; +mips_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp) { unsigned int count; asymbol **sym; @@ -1487,7 +1461,7 @@ mips_elf_assign_gp (output_bfd, pgp) /* The linker script will have created a symbol named `_gp' with the appropriate value. */ - if (sym == (asymbol **) NULL) + if (sym == NULL) i = count; else { @@ -1523,12 +1497,8 @@ mips_elf_assign_gp (output_bfd, pgp) external symbol if we are producing relocatable output. */ static bfd_reloc_status_type -mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) - bfd *output_bfd; - asymbol *symbol; - bfd_boolean relocatable; - char **error_message; - bfd_vma *pgp; +mips_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable, + char **error_message, bfd_vma *pgp) { if (bfd_is_und_section (symbol->section) && ! relocatable) @@ -1563,15 +1533,10 @@ mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp) become the offset from the gp register. */ static bfd_reloc_status_type -mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf_gprel16_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1579,7 +1544,7 @@ mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1600,15 +1565,9 @@ mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, /* Do a R_MIPS_LITERAL relocation. */ static bfd_reloc_status_type -mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_literal_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1617,7 +1576,7 @@ mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) relocatable = TRUE; else { @@ -1639,15 +1598,9 @@ mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, become the offset from the gp register. */ static bfd_reloc_status_type -mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1656,7 +1609,7 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) /* R_MIPS_GPREL32 relocations are defined for local symbols only. */ - if (output_bfd != (bfd *) NULL + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (symbol->flags & BSF_LOCAL) != 0) { @@ -1665,7 +1618,7 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_outofrange; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) { relocatable = TRUE; gp = _bfd_get_gp_value (output_bfd); @@ -1686,15 +1639,9 @@ mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, } static bfd_reloc_status_type -gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, - gp) - bfd *abfd; - asymbol *symbol; - arelent *reloc_entry; - asection *input_section; - bfd_boolean relocatable; - PTR data; - bfd_vma gp; +gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, + asection *input_section, bfd_boolean relocatable, + void *data, bfd_vma gp) { bfd_vma relocation; unsigned long val; @@ -1725,7 +1672,7 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; - bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address); + bfd_put_32 (abfd, val, (bfd_byte *) data + reloc_entry->address); if (relocatable) reloc_entry->address += input_section->output_offset; @@ -1737,15 +1684,10 @@ gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data, the rest is at bits 6-10. The bitpos already got right by the howto. */ static bfd_reloc_status_type -mips_elf_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips_elf_shift6_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) @@ -1763,15 +1705,10 @@ mips_elf_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 jump. */ static bfd_reloc_status_type -mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +mips16_jump_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry, + asymbol *symbol, void *data ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { static bfd_boolean warned = FALSE; @@ -1790,15 +1727,9 @@ mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, /* Handle a mips16 GP relative reloc. */ static bfd_reloc_status_type -mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, bfd *output_bfd, + char **error_message) { bfd_boolean relocatable; bfd_reloc_status_type ret; @@ -1857,13 +1788,10 @@ mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, if (reloc_entry->howto->partial_inplace) { bfd_put_16 (abfd, - (bfd_vma) ((extend & 0xf800) - | ((val >> 11) & 0x1f) - | (val & 0x7e0)), + (extend & 0xf800) | ((val >> 11) & 0x1f) | (val & 0x7e0), (bfd_byte *) data + reloc_entry->address); bfd_put_16 (abfd, - (bfd_vma) ((insn & 0xffe0) - | (val & 0x1f)), + (insn & 0xffe0) | (val & 0x1f), (bfd_byte *) data + reloc_entry->address + 2); } else @@ -1929,9 +1857,8 @@ static const struct elf_reloc_map mips_reloc_map[] = /* Given a BFD reloc type, return a howto structure. */ static reloc_howto_type * -bfd_elf32_bfd_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { unsigned int i; /* FIXME: We default to RELA here instead of choosing the right @@ -1966,9 +1893,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf_n32_rtype_to_howto (r_type, rela_p) - unsigned int r_type; - bfd_boolean rela_p; +mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) { switch (r_type) { @@ -1998,10 +1923,7 @@ mips_elf_n32_rtype_to_howto (r_type, rela_p) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static void -mips_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -2021,10 +1943,8 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst) /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */ static void -mips_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf_Internal_Rela *dst; +mips_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -2040,9 +1960,7 @@ mips_info_to_howto_rela (abfd, cache_ptr, dst) and externally visible symbols. */ static bfd_boolean -mips_elf_sym_is_global (abfd, sym) - bfd *abfd ATTRIBUTE_UNUSED; - asymbol *sym; +mips_elf_sym_is_global (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) { if (SGI_COMPAT (abfd)) return (sym->flags & BSF_SECTION_SYM) == 0; @@ -2055,8 +1973,7 @@ mips_elf_sym_is_global (abfd, sym) /* Set the right machine number for a MIPS ELF file. */ static bfd_boolean -mips_elf_n32_object_p (abfd) - bfd *abfd; +mips_elf_n32_object_p (bfd *abfd) { unsigned long mach; @@ -2077,9 +1994,7 @@ mips_elf_n32_object_p (abfd) /* Support for core dump NOTE sections. */ static bfd_boolean -elf32_mips_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; unsigned int raw_size; @@ -2109,9 +2024,7 @@ elf32_mips_grok_prstatus (abfd, note) } static bfd_boolean -elf32_mips_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { @@ -2143,8 +2056,7 @@ elf32_mips_grok_psinfo (abfd, note) /* Depending on the target vector we generate some version of Irix executables or "normal" MIPS ELF ABI executables. */ static irix_compat_t -elf_n32_mips_irix_compat (abfd) - bfd *abfd; +elf_n32_mips_irix_compat (bfd *abfd) { if ((abfd->xvec == &bfd_elf32_nbigmips_vec) || (abfd->xvec == &bfd_elf32_nlittlemips_vec)) |