#include "elf-bfd.h"
#include "elf/i860.h"
-/* Prototypes. */
-static reloc_howto_type *lookup_howto
- PARAMS ((unsigned int));
-
-static reloc_howto_type *elf32_i860_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-
-static void elf32_i860_info_to_howto_rela
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-
-static bfd_reloc_status_type elf32_i860_relocate_splitn
- PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-
-static bfd_reloc_status_type elf32_i860_relocate_pc16
- PARAMS ((bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-
-static bfd_reloc_status_type elf32_i860_relocate_pc26
- PARAMS ((bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-
-static bfd_reloc_status_type elf32_i860_relocate_highadj
- PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-
-static bfd_boolean elf32_i860_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-
-static bfd_reloc_status_type i860_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, bfd_vma));
-
-static bfd_boolean elf32_i860_is_local_label_name
- PARAMS ((bfd *, const char *));
/* This howto table is preliminary. */
static reloc_howto_type elf32_i860_howto_table [] =
static unsigned char elf_code_to_howto_index[R_860_max + 1];
static reloc_howto_type *
-lookup_howto (rtype)
- unsigned int rtype;
+lookup_howto (unsigned int rtype)
{
static int initialized = 0;
int i;
/* Given a BFD reloc, return the matching HOWTO structure. */
static reloc_howto_type *
-elf32_i860_reloc_type_lookup (abfd, code)
- bfd * abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+elf32_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int rtype;
/* Given a ELF reloc, return the matching HOWTO structure. */
static void
-elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *bfd_reloc;
- Elf_Internal_Rela *elf_reloc;
+elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
bfd_reloc->howto
= lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));
/* Specialized relocation handler for R_860_SPLITn. These relocations
involves a 16-bit field that is split into two contiguous parts. */
static bfd_reloc_status_type
-elf32_i860_relocate_splitn (input_bfd, rello, contents, value)
- bfd *input_bfd;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma value;
+elf32_i860_relocate_splitn (bfd *input_bfd,
+ Elf_Internal_Rela *rello,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
reloc_howto_type *howto;
involves a 16-bit, PC-relative field that is split into two contiguous
parts. */
static bfd_reloc_status_type
-elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma value;
+elf32_i860_relocate_pc16 (bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *rello,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
reloc_howto_type *howto;
/* Specialized relocation handler for R_860_PC26. This relocation
involves a 26-bit, PC-relative field which must be adjusted by 4. */
static bfd_reloc_status_type
-elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value)
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma value;
+elf32_i860_relocate_pc26 (bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *rello,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
reloc_howto_type *howto;
/* Specialized relocation handler for R_860_HIGHADJ. */
static bfd_reloc_status_type
-elf32_i860_relocate_highadj (input_bfd, rel, contents, value)
- bfd *input_bfd;
- Elf_Internal_Rela *rel;
- bfd_byte *contents;
- bfd_vma value;
+elf32_i860_relocate_highadj (bfd *input_bfd,
+ Elf_Internal_Rela *rel,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
/* Perform a single relocation. By default we use the standard BFD
routines. However, we handle some specially. */
static bfd_reloc_status_type
-i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation)
- reloc_howto_type * howto;
- bfd * input_bfd;
- asection * input_section;
- bfd_byte * contents;
- Elf_Internal_Rela * rel;
- bfd_vma relocation;
+i860_final_link_relocate (reloc_howto_type *howto,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *rel,
+ bfd_vma relocation)
{
return _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset, relocation,
section, which means that the addend must be adjusted
accordingly. */
static bfd_boolean
-elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
+elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
??? Do any other SVR4 compilers have this convention? If so, this should
be added to the generic routine. */
static bfd_boolean
-elf32_i860_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+elf32_i860_is_local_label_name (bfd *abfd, const char *name)
{
if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.')
return TRUE;
static int target_xp = 0;
/* Prototypes. */
-static void i860_process_insn PARAMS ((char *));
-static void s_dual PARAMS ((int));
-static void s_enddual PARAMS ((int));
-static void s_atmp PARAMS ((int));
-static int i860_get_expression PARAMS ((char *));
-static bfd_reloc_code_real_type obtain_reloc_for_imm16
- PARAMS ((fixS *, long *));
+static void i860_process_insn (char *);
+static void s_dual (int);
+static void s_enddual (int);
+static void s_atmp (int);
+static int i860_get_expression (char *);
+static bfd_reloc_code_real_type obtain_reloc_for_imm16 (fixS *, long *);
#ifdef DEBUG_I860
-static void print_insn PARAMS ((struct i860_it *));
+static void print_insn (struct i860_it *);
#endif
const pseudo_typeS md_pseudo_table[] =
/* Handle ".dual" directive. */
static void
-s_dual (ignore)
- int ignore ATTRIBUTE_UNUSED;
+s_dual (int ignore ATTRIBUTE_UNUSED)
{
dual_mode = DUAL_ON;
}
/* Handle ".enddual" directive. */
static void
-s_enddual (ignore)
- int ignore ATTRIBUTE_UNUSED;
+s_enddual (int ignore ATTRIBUTE_UNUSED)
{
dual_mode = DUAL_OFF;
}
static int atmp = 31;
static void
-s_atmp (ignore)
- int ignore ATTRIBUTE_UNUSED;
+s_atmp (int ignore ATTRIBUTE_UNUSED)
{
register int temp;
if (strncmp (input_line_pointer, "sp", 2) == 0)
set up all the tables and data structures that the MD part of the
assembler will need. */
void
-md_begin ()
+md_begin (void)
{
const char *retval = NULL;
int lose = 0;
machine dependent instruction. This function emits the frags/bytes
it assembles to. */
void
-md_assemble (str)
- char *str;
+md_assemble (char *str)
{
char *destp;
int num_opcodes = 1;
/* Assemble the instruction pointed to by STR. */
static void
-i860_process_insn (str)
- char *str;
+i860_process_insn (char *str)
{
char *s;
const char *args;
}
static int
-i860_get_expression (str)
- char *str;
+i860_get_expression (char *str)
{
char *save_in;
segT seg;
#define MAX_LITTLENUMS 6
char *
-md_atof (type, litP, sizeP)
- char type;
- char *litP;
- int *sizeP;
+md_atof (int type, char *litP, int *sizeP)
{
int prec;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
/* Write out in current endian mode. */
void
-md_number_to_chars (buf, val, n)
- char *buf;
- valueT val;
- int n;
+md_number_to_chars (char *buf, valueT val, int n)
{
if (target_big_endian)
number_to_chars_bigendian (buf, val, n);
/* This should never be called for i860. */
int
-md_estimate_size_before_relax (fragP, segtype)
- register fragS *fragP ATTRIBUTE_UNUSED;
- segT segtype ATTRIBUTE_UNUSED;
+md_estimate_size_before_relax (register fragS *fragP ATTRIBUTE_UNUSED,
+ segT segtype ATTRIBUTE_UNUSED)
{
as_fatal (_("i860_estimate_size_before_relax\n"));
}
#ifdef DEBUG_I860
static void
-print_insn (insn)
- struct i860_it *insn;
+print_insn (struct i860_it *insn)
{
if (insn->error)
fprintf (stderr, "ERROR: %s\n", insn->error);
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (c, arg)
- int c;
- char *arg ATTRIBUTE_UNUSED;
+md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
}
void
-md_show_usage (stream)
- FILE *stream;
+md_show_usage (FILE *stream)
{
fprintf (stream, _("\
-EL generate code for little endian mode (default)\n\
\f
/* We have no need to default values of symbols. */
symbolS *
-md_undefined_symbol (name)
- char *name ATTRIBUTE_UNUSED;
+md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
{
return 0;
}
/* The i860 denotes auto-increment with '++'. */
void
-md_operand (exp)
- expressionS *exp;
+md_operand (expressionS *exp)
{
char *s;
/* Round up a section size to the appropriate boundary. */
valueT
-md_section_align (segment, size)
- segT segment ATTRIBUTE_UNUSED;
- valueT size ATTRIBUTE_UNUSED;
+md_section_align (segT segment ATTRIBUTE_UNUSED,
+ valueT size ATTRIBUTE_UNUSED)
{
/* Byte alignment is fine. */
return size;
/* On the i860, a PC-relative offset is relative to the address of the
of the offset plus its size. */
long
-md_pcrel_from (fixP)
- fixS *fixP;
+md_pcrel_from (fixS *fixP)
{
return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address;
}
Also adjust the given immediate as necessary. Finally, check that
all constraints (such as alignment) are satisfied. */
static bfd_reloc_code_real_type
-obtain_reloc_for_imm16 (fix, val)
- fixS *fix;
- long *val;
+obtain_reloc_for_imm16 (fixS *fix, long *val)
{
valueT fup = fix->fx_addnumber;
bfd_reloc_code_real_type reloc;
we will have to generate a reloc entry. */
void
-md_apply_fix3 (fix, valP, seg)
- fixS * fix;
- valueT * valP;
- segT seg ATTRIBUTE_UNUSED;
+md_apply_fix3 (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED)
{
char *buf;
long val = *valP;
/* Generate a machine dependent reloc from a fixup. */
arelent*
-tc_gen_reloc (section, fixp)
- asection *section ATTRIBUTE_UNUSED;
- fixS *fixp;
+tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
+ fixS *fixp)
{
arelent *reloc;