Remove casts that were only needed for K&R compatibility.
+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
#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;
/* 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)
{
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;
/* 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)
{
}
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))
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;
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;
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;
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;
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)
{
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;
/* The linker script will have created a symbol named `_gp' with the
appropriate value. */
- if (sym == (asymbol **) NULL)
+ if (sym == NULL)
i = count;
else
{
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)
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;
/* 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)
{
return bfd_reloc_ok;
}
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
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;
/* 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)
{
return bfd_reloc_outofrange;
}
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
}
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;
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;
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;
}
/* 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)
{
/* 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;
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
/* 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;
/* 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)
{
/* 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;
/* 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);
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;
/* 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;
/* 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;
\f
/* 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;
}
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)
{
/* 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))
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;
}
/* 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;
#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;
/* 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);
/* 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);
/* 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);
/* 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);
/* 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;
/* 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;
/* 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;
/* 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;
/* 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)
{
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,
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;
/* The linker script will have created a symbol named `_gp' with the
appropriate value. */
- if (sym == (asymbol **) NULL)
+ if (sym == NULL)
i = count;
else
{
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)
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;
/* 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)
{
return bfd_reloc_ok;
}
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
/* 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;
/* 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)
{
}
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
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;
/* 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)
{
return bfd_reloc_outofrange;
}
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
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)
{
/* 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))
/* 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;
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
/* 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
/* 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)
{
/* 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);
}
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;
}
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;
}
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;
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;
!= 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)
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;
/* 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;
/* 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;
}
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;
}
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;
/* 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;
/* 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))
\f
/* 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;
}
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)
{
/* 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 \
#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;
{ \
/* 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)) \
}
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)
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;
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))
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;
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;
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)
{
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);
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,
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;
/* The linker script will have created a symbol named `_gp' with the
appropriate value. */
- if (sym == (asymbol **) NULL)
+ if (sym == NULL)
i = count;
else
{
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)
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;
GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section)
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
relocatable = TRUE;
else
{
/* 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;
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
{
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;
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)
{
return bfd_reloc_outofrange;
}
- if (output_bfd != (bfd *) NULL)
+ if (output_bfd != NULL)
{
relocatable = TRUE;
gp = _bfd_get_gp_value (output_bfd);
}
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;
|| (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;
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)
/* 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;
/* 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;
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
/* 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
/* 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)
{
/* 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;
/* 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;
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;
/* 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;
\f
/* 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;
}
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)
{
/* 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))