2003-07-30  Jason Eckhardt  <jle@rice.edu>

        * elf32-i860.c: Convert to ISO C90.  Remove superflous prototypes.

gas:
2003-07-30  Jason Eckhardt  <jle@rice.edu>

        * config/tc-i860.c: Convert to ISO C90.
This commit is contained in:
Jason Eckhardt 2003-07-30 20:24:55 +00:00
parent b2884a0c33
commit 7734b6e923
4 changed files with 77 additions and 141 deletions

View file

@ -1,3 +1,7 @@
2003-07-30 Jason Eckhardt <jle@rice.edu>
* elf32-i860.c: Convert to ISO C90. Remove superflous prototypes.
2003-07-30 Randolph Chung <tausq@debian.org> 2003-07-30 Randolph Chung <tausq@debian.org>
* elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak. * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak.

View file

@ -26,38 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf-bfd.h" #include "elf-bfd.h"
#include "elf/i860.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. */ /* This howto table is preliminary. */
static reloc_howto_type elf32_i860_howto_table [] = static reloc_howto_type elf32_i860_howto_table [] =
@ -546,8 +514,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
static unsigned char elf_code_to_howto_index[R_860_max + 1]; static unsigned char elf_code_to_howto_index[R_860_max + 1];
static reloc_howto_type * static reloc_howto_type *
lookup_howto (rtype) lookup_howto (unsigned int rtype)
unsigned int rtype;
{ {
static int initialized = 0; static int initialized = 0;
int i; int i;
@ -572,9 +539,8 @@ lookup_howto (rtype)
/* Given a BFD reloc, return the matching HOWTO structure. */ /* Given a BFD reloc, return the matching HOWTO structure. */
static reloc_howto_type * static reloc_howto_type *
elf32_i860_reloc_type_lookup (abfd, code) elf32_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
bfd * abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code)
bfd_reloc_code_real_type code;
{ {
unsigned int rtype; unsigned int rtype;
@ -691,10 +657,9 @@ elf32_i860_reloc_type_lookup (abfd, code)
/* Given a ELF reloc, return the matching HOWTO structure. */ /* Given a ELF reloc, return the matching HOWTO structure. */
static void static void
elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc) elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc,
arelent *bfd_reloc; Elf_Internal_Rela *elf_reloc)
Elf_Internal_Rela *elf_reloc;
{ {
bfd_reloc->howto bfd_reloc->howto
= lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info)); = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));
@ -703,11 +668,10 @@ elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
/* Specialized relocation handler for R_860_SPLITn. These relocations /* Specialized relocation handler for R_860_SPLITn. These relocations
involves a 16-bit field that is split into two contiguous parts. */ involves a 16-bit field that is split into two contiguous parts. */
static bfd_reloc_status_type static bfd_reloc_status_type
elf32_i860_relocate_splitn (input_bfd, rello, contents, value) elf32_i860_relocate_splitn (bfd *input_bfd,
bfd *input_bfd; Elf_Internal_Rela *rello,
Elf_Internal_Rela *rello; bfd_byte *contents,
bfd_byte *contents; bfd_vma value)
bfd_vma value;
{ {
bfd_vma insn; bfd_vma insn;
reloc_howto_type *howto; reloc_howto_type *howto;
@ -729,12 +693,11 @@ elf32_i860_relocate_splitn (input_bfd, rello, contents, value)
involves a 16-bit, PC-relative field that is split into two contiguous involves a 16-bit, PC-relative field that is split into two contiguous
parts. */ parts. */
static bfd_reloc_status_type static bfd_reloc_status_type
elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value) elf32_i860_relocate_pc16 (bfd *input_bfd,
bfd *input_bfd; asection *input_section,
asection *input_section; Elf_Internal_Rela *rello,
Elf_Internal_Rela *rello; bfd_byte *contents,
bfd_byte *contents; bfd_vma value)
bfd_vma value;
{ {
bfd_vma insn; bfd_vma insn;
reloc_howto_type *howto; reloc_howto_type *howto;
@ -761,12 +724,11 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
/* Specialized relocation handler for R_860_PC26. This relocation /* Specialized relocation handler for R_860_PC26. This relocation
involves a 26-bit, PC-relative field which must be adjusted by 4. */ involves a 26-bit, PC-relative field which must be adjusted by 4. */
static bfd_reloc_status_type static bfd_reloc_status_type
elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value) elf32_i860_relocate_pc26 (bfd *input_bfd,
bfd *input_bfd; asection *input_section,
asection *input_section; Elf_Internal_Rela *rello,
Elf_Internal_Rela *rello; bfd_byte *contents,
bfd_byte *contents; bfd_vma value)
bfd_vma value;
{ {
bfd_vma insn; bfd_vma insn;
reloc_howto_type *howto; reloc_howto_type *howto;
@ -792,11 +754,10 @@ elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value)
/* Specialized relocation handler for R_860_HIGHADJ. */ /* Specialized relocation handler for R_860_HIGHADJ. */
static bfd_reloc_status_type static bfd_reloc_status_type
elf32_i860_relocate_highadj (input_bfd, rel, contents, value) elf32_i860_relocate_highadj (bfd *input_bfd,
bfd *input_bfd; Elf_Internal_Rela *rel,
Elf_Internal_Rela *rel; bfd_byte *contents,
bfd_byte *contents; bfd_vma value)
bfd_vma value;
{ {
bfd_vma insn; bfd_vma insn;
@ -815,13 +776,12 @@ elf32_i860_relocate_highadj (input_bfd, rel, contents, value)
/* Perform a single relocation. By default we use the standard BFD /* Perform a single relocation. By default we use the standard BFD
routines. However, we handle some specially. */ routines. However, we handle some specially. */
static bfd_reloc_status_type static bfd_reloc_status_type
i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation) i860_final_link_relocate (reloc_howto_type *howto,
reloc_howto_type * howto; bfd *input_bfd,
bfd * input_bfd; asection *input_section,
asection * input_section; bfd_byte *contents,
bfd_byte * contents; Elf_Internal_Rela *rel,
Elf_Internal_Rela * rel; bfd_vma relocation)
bfd_vma relocation;
{ {
return _bfd_final_link_relocate (howto, input_bfd, input_section, return _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset, relocation, contents, rel->r_offset, relocation,
@ -860,16 +820,14 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
section, which means that the addend must be adjusted section, which means that the addend must be adjusted
accordingly. */ accordingly. */
static bfd_boolean static bfd_boolean
elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section, elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
contents, relocs, local_syms, local_sections) struct bfd_link_info *info,
bfd *output_bfd ATTRIBUTE_UNUSED; bfd *input_bfd,
struct bfd_link_info *info; asection *input_section,
bfd *input_bfd; bfd_byte *contents,
asection *input_section; Elf_Internal_Rela *relocs,
bfd_byte *contents; Elf_Internal_Sym *local_syms,
Elf_Internal_Rela *relocs; asection **local_sections)
Elf_Internal_Sym *local_syms;
asection **local_sections;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **sym_hashes;
@ -1059,9 +1017,7 @@ elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section,
??? Do any other SVR4 compilers have this convention? If so, this should ??? Do any other SVR4 compilers have this convention? If so, this should
be added to the generic routine. */ be added to the generic routine. */
static bfd_boolean static bfd_boolean
elf32_i860_is_local_label_name (abfd, name) elf32_i860_is_local_label_name (bfd *abfd, const char *name)
bfd *abfd;
const char *name;
{ {
if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.') if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.')
return TRUE; return TRUE;

View file

@ -1,3 +1,7 @@
2003-07-30 Jason Eckhardt <jle@rice.edu>
* config/tc-i860.c: Convert to ISO C90.
2003-07-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2003-07-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* read.c (s_space): Revert 2003-07-28 change. * read.c (s_space): Revert 2003-07-28 change.

View file

@ -92,15 +92,14 @@ static int target_warn_expand = 0;
static int target_xp = 0; static int target_xp = 0;
/* Prototypes. */ /* Prototypes. */
static void i860_process_insn PARAMS ((char *)); static void i860_process_insn (char *);
static void s_dual PARAMS ((int)); static void s_dual (int);
static void s_enddual PARAMS ((int)); static void s_enddual (int);
static void s_atmp PARAMS ((int)); static void s_atmp (int);
static int i860_get_expression PARAMS ((char *)); static int i860_get_expression (char *);
static bfd_reloc_code_real_type obtain_reloc_for_imm16 static bfd_reloc_code_real_type obtain_reloc_for_imm16 (fixS *, long *);
PARAMS ((fixS *, long *));
#ifdef DEBUG_I860 #ifdef DEBUG_I860
static void print_insn PARAMS ((struct i860_it *)); static void print_insn (struct i860_it *);
#endif #endif
const pseudo_typeS md_pseudo_table[] = const pseudo_typeS md_pseudo_table[] =
@ -123,16 +122,14 @@ static enum dual dual_mode = DUAL_OFF;
/* Handle ".dual" directive. */ /* Handle ".dual" directive. */
static void static void
s_dual (ignore) s_dual (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
dual_mode = DUAL_ON; dual_mode = DUAL_ON;
} }
/* Handle ".enddual" directive. */ /* Handle ".enddual" directive. */
static void static void
s_enddual (ignore) s_enddual (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
dual_mode = DUAL_OFF; dual_mode = DUAL_OFF;
} }
@ -141,8 +138,7 @@ s_enddual (ignore)
static int atmp = 31; static int atmp = 31;
static void static void
s_atmp (ignore) s_atmp (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
register int temp; register int temp;
if (strncmp (input_line_pointer, "sp", 2) == 0) if (strncmp (input_line_pointer, "sp", 2) == 0)
@ -175,7 +171,7 @@ s_atmp (ignore)
set up all the tables and data structures that the MD part of the set up all the tables and data structures that the MD part of the
assembler will need. */ assembler will need. */
void void
md_begin () md_begin (void)
{ {
const char *retval = NULL; const char *retval = NULL;
int lose = 0; int lose = 0;
@ -216,8 +212,7 @@ md_begin ()
machine dependent instruction. This function emits the frags/bytes machine dependent instruction. This function emits the frags/bytes
it assembles to. */ it assembles to. */
void void
md_assemble (str) md_assemble (char *str)
char *str;
{ {
char *destp; char *destp;
int num_opcodes = 1; int num_opcodes = 1;
@ -411,8 +406,7 @@ md_assemble (str)
/* Assemble the instruction pointed to by STR. */ /* Assemble the instruction pointed to by STR. */
static void static void
i860_process_insn (str) i860_process_insn (char *str)
char *str;
{ {
char *s; char *s;
const char *args; const char *args;
@ -931,8 +925,7 @@ i860_process_insn (str)
} }
static int static int
i860_get_expression (str) i860_get_expression (char *str)
char *str;
{ {
char *save_in; char *save_in;
segT seg; segT seg;
@ -963,10 +956,7 @@ i860_get_expression (str)
#define MAX_LITTLENUMS 6 #define MAX_LITTLENUMS 6
char * char *
md_atof (type, litP, sizeP) md_atof (int type, char *litP, int *sizeP)
char type;
char *litP;
int *sizeP;
{ {
int prec; int prec;
LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE words[MAX_LITTLENUMS];
@ -1017,10 +1007,7 @@ md_atof (type, litP, sizeP)
/* Write out in current endian mode. */ /* Write out in current endian mode. */
void void
md_number_to_chars (buf, val, n) md_number_to_chars (char *buf, valueT val, int n)
char *buf;
valueT val;
int n;
{ {
if (target_big_endian) if (target_big_endian)
number_to_chars_bigendian (buf, val, n); number_to_chars_bigendian (buf, val, n);
@ -1030,17 +1017,15 @@ md_number_to_chars (buf, val, n)
/* This should never be called for i860. */ /* This should never be called for i860. */
int int
md_estimate_size_before_relax (fragP, segtype) md_estimate_size_before_relax (register fragS *fragP ATTRIBUTE_UNUSED,
register fragS *fragP ATTRIBUTE_UNUSED; segT segtype ATTRIBUTE_UNUSED)
segT segtype ATTRIBUTE_UNUSED;
{ {
as_fatal (_("i860_estimate_size_before_relax\n")); as_fatal (_("i860_estimate_size_before_relax\n"));
} }
#ifdef DEBUG_I860 #ifdef DEBUG_I860
static void static void
print_insn (insn) print_insn (struct i860_it *insn)
struct i860_it *insn;
{ {
if (insn->error) if (insn->error)
fprintf (stderr, "ERROR: %s\n", insn->error); fprintf (stderr, "ERROR: %s\n", insn->error);
@ -1086,9 +1071,7 @@ struct option md_longopts[] = {
size_t md_longopts_size = sizeof (md_longopts); size_t md_longopts_size = sizeof (md_longopts);
int int
md_parse_option (c, arg) md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
int c;
char *arg ATTRIBUTE_UNUSED;
{ {
switch (c) switch (c)
{ {
@ -1128,8 +1111,7 @@ md_parse_option (c, arg)
} }
void void
md_show_usage (stream) md_show_usage (FILE *stream)
FILE *stream;
{ {
fprintf (stream, _("\ fprintf (stream, _("\
-EL generate code for little endian mode (default)\n\ -EL generate code for little endian mode (default)\n\
@ -1147,16 +1129,14 @@ md_show_usage (stream)
/* We have no need to default values of symbols. */ /* We have no need to default values of symbols. */
symbolS * symbolS *
md_undefined_symbol (name) md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
char *name ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
/* The i860 denotes auto-increment with '++'. */ /* The i860 denotes auto-increment with '++'. */
void void
md_operand (exp) md_operand (expressionS *exp)
expressionS *exp;
{ {
char *s; char *s;
@ -1173,9 +1153,8 @@ md_operand (exp)
/* Round up a section size to the appropriate boundary. */ /* Round up a section size to the appropriate boundary. */
valueT valueT
md_section_align (segment, size) md_section_align (segT segment ATTRIBUTE_UNUSED,
segT segment ATTRIBUTE_UNUSED; valueT size ATTRIBUTE_UNUSED)
valueT size ATTRIBUTE_UNUSED;
{ {
/* Byte alignment is fine. */ /* Byte alignment is fine. */
return size; return size;
@ -1184,8 +1163,7 @@ md_section_align (segment, size)
/* On the i860, a PC-relative offset is relative to the address of the /* On the i860, a PC-relative offset is relative to the address of the
of the offset plus its size. */ of the offset plus its size. */
long long
md_pcrel_from (fixP) md_pcrel_from (fixS *fixP)
fixS *fixP;
{ {
return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address;
} }
@ -1194,9 +1172,7 @@ md_pcrel_from (fixP)
Also adjust the given immediate as necessary. Finally, check that Also adjust the given immediate as necessary. Finally, check that
all constraints (such as alignment) are satisfied. */ all constraints (such as alignment) are satisfied. */
static bfd_reloc_code_real_type static bfd_reloc_code_real_type
obtain_reloc_for_imm16 (fix, val) obtain_reloc_for_imm16 (fixS *fix, long *val)
fixS *fix;
long *val;
{ {
valueT fup = fix->fx_addnumber; valueT fup = fix->fx_addnumber;
bfd_reloc_code_real_type reloc; bfd_reloc_code_real_type reloc;
@ -1290,10 +1266,7 @@ obtain_reloc_for_imm16 (fix, val)
we will have to generate a reloc entry. */ we will have to generate a reloc entry. */
void void
md_apply_fix3 (fix, valP, seg) md_apply_fix3 (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED)
fixS * fix;
valueT * valP;
segT seg ATTRIBUTE_UNUSED;
{ {
char *buf; char *buf;
long val = *valP; long val = *valP;
@ -1430,9 +1403,8 @@ md_apply_fix3 (fix, valP, seg)
/* Generate a machine dependent reloc from a fixup. */ /* Generate a machine dependent reloc from a fixup. */
arelent* arelent*
tc_gen_reloc (section, fixp) tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED; fixS *fixp)
fixS *fixp;
{ {
arelent *reloc; arelent *reloc;