diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 27 | ||||
-rw-r--r-- | gas/config/tc-h8500.c | 74 | ||||
-rw-r--r-- | gas/config/tc-h8500.h | 3 |
3 files changed, 73 insertions, 31 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index d681a18..05a6cbb 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,32 @@ 2002-12-13 Alan Modra <amodra@bigpond.net.au> + * config/tc-h8500.c (cons): Delete declaration. + (md_begin <opcode>): Constify. + (displacement_size, immediate_size, absolute_size): Remove. + (build_relaxable_instruction <operand>): Add ATTRIBUTE_UNUSED. + (tc_crawl_symbol_chain <headers>): Likewise. + (md_undefined_symbol <name>): Likewise. + (tc_headers_hook <headers>): Likewise. + (md_parse_option <c,arg>): Likewise. + (md_show_usage <stream>): Likewise. + (md_convert_frag <headers, seg>): Likewise. + (tc_coff_symbol_emit_hook <ignore>): Likewise. + (md_atof): Remove declaration of atof_ieee. + (tc_aout_fix_to_chars): Remove unused function. + (parse_reg): Prototype. + (parse_exp): Prototype. + (skip_colonthing): Prototype. Use &&, not & in logical expressions. + (parse_reglist): Prototype. + (get_operand): Prototype. + (get_operands): Prototype. + (get_specific): Prototype. Make "this_index" signed. + (check): Prototype, make static. + (insert): Prototype + (build_relaxable_instruction): Prototype, make static. + (build_bytes): Prototype. + (wordify_scb): Prototype. + * config/tc-h8500.h (start_label): Declare. + (tc_coff_sizemachdep): Declare. * config/tc-i370.c (i370_ebcdic <unused>): Add ATTRIBUTE_UNUSED. (i370_rmode <unused>): Likewise. (i370_csect <unused>): Likewise. diff --git a/gas/config/tc-h8500.c b/gas/config/tc-h8500.c index 002854d..a013595 100644 --- a/gas/config/tc-h8500.c +++ b/gas/config/tc-h8500.c @@ -41,8 +41,6 @@ const char line_comment_chars[] = "!#"; Integer arg to pass to the function */ -void cons (); - const pseudo_typeS md_pseudo_table[] = { {"int", cons, 2}, @@ -122,7 +120,7 @@ static struct hash_control *opcode_hash_control; /* Opcode mnemonics */ void md_begin () { - h8500_opcode_info *opcode; + const h8500_opcode_info *opcode; char prev_buffer[100]; int idx = 0; @@ -148,14 +146,11 @@ static int crw; /* word sized cr */ static int cr; /* unknown size cr */ static expressionS displacement;/* displacement expression */ -static int displacement_size; /* and size if given */ static int immediate_inpage; static expressionS immediate; /* immediate expression */ -static int immediate_size; /* and size if given */ static expressionS absolute; /* absolute expression */ -static int absolute_size; /* and size if given */ typedef struct { @@ -169,6 +164,8 @@ h8500_operand_info; /* Try to parse a reg name. Return the number of chars consumed. */ +static int parse_reg PARAMS ((char *, int *, int *)); + static int parse_reg (src, mode, reg) char *src; @@ -246,6 +243,8 @@ parse_reg (src, mode, reg) return 0; } +static char *parse_exp PARAMS ((char *, expressionS *, int *)); + static char * parse_exp (s, op, page) char *s; @@ -292,6 +291,9 @@ typedef enum exp_signed, exp_unsigned, exp_sandu } sign_type; +static char *skip_colonthing + PARAMS ((sign_type, char *, h8500_operand_info *, int, int, int, int)); + static char * skip_colonthing (sign, ptr, exp, def, size8, size16, size24) sign_type sign; @@ -311,12 +313,12 @@ skip_colonthing (sign, ptr, exp, def, size8, size16, size24) ptr++; exp->type = size8; } - else if (ptr[0] == '1' & ptr[1] == '6') + else if (ptr[0] == '1' && ptr[1] == '6') { ptr += 2; exp->type = size16; } - else if (ptr[0] == '2' & ptr[1] == '4') + else if (ptr[0] == '2' && ptr[1] == '4') { if (!size24) { @@ -362,6 +364,8 @@ skip_colonthing (sign, ptr, exp, def, size8, size16, size24) return ptr; } +static int parse_reglist PARAMS ((char *, h8500_operand_info *)); + static int parse_reglist (src, op) char *src; @@ -431,6 +435,8 @@ parse_reglist (src, op) */ +static void get_operand PARAMS ((char **, h8500_operand_info *, char)); + static void get_operand (ptr, op, ispage) char **ptr; @@ -559,12 +565,14 @@ get_operand (ptr, op, ispage) } } +static char *get_operands + PARAMS ((h8500_opcode_info *, char *, h8500_operand_info *)); + static char * get_operands (info, args, operand) h8500_opcode_info *info; char *args; h8500_operand_info *operand; - { char *ptr = args; @@ -602,6 +610,9 @@ get_operands (info, args, operand) int pcrel8; /* Set when we've seen a pcrel operand */ +static h8500_opcode_info *get_specific + PARAMS ((h8500_opcode_info *, h8500_operand_info *)); + static h8500_opcode_info * get_specific (opcode, operands) h8500_opcode_info *opcode; @@ -610,8 +621,7 @@ get_specific (opcode, operands) h8500_opcode_info *this_try = opcode; int found = 0; unsigned int noperands = opcode->nargs; - - unsigned int this_index = opcode->idx; + int this_index = opcode->idx; while (this_index == opcode->idx && !found) { @@ -843,7 +853,9 @@ get_specific (opcode, operands) return 0; } -int +static int check PARAMS ((expressionS *, int, int)); + +static int check (operand, low, high) expressionS *operand; int low; @@ -858,6 +870,8 @@ check (operand, low, high) return operand->X_add_number; } +static void insert PARAMS ((char *, int, expressionS *, int, int)); + static void insert (output, index, exp, reloc, pcrel) char *output; @@ -874,10 +888,13 @@ insert (output, index, exp, reloc, pcrel) reloc); } -void +static void build_relaxable_instruction + PARAMS ((h8500_opcode_info *, h8500_operand_info *)); + +static void build_relaxable_instruction (opcode, operand) h8500_opcode_info *opcode; - h8500_operand_info *operand; + h8500_operand_info *operand ATTRIBUTE_UNUSED; { /* All relaxable instructions start life as two bytes but can become three bytes long if a lonely branch and up to 9 bytes if long @@ -917,11 +934,12 @@ build_relaxable_instruction (opcode, operand) /* Now we know what sort of opcodes it is, let's build the bytes. */ +static void build_bytes PARAMS ((h8500_opcode_info *, h8500_operand_info *)); + static void build_bytes (opcode, operand) h8500_opcode_info *opcode; h8500_operand_info *operand; - { int index; @@ -1116,21 +1134,21 @@ md_assemble (str) void tc_crawl_symbol_chain (headers) - object_headers *headers; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_crawl_symbol_chain \n")); } symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } void tc_headers_hook (headers) - object_headers *headers; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_headers_hook \n")); } @@ -1154,7 +1172,6 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE *wordP; char *t; - char *atof_ieee (); switch (type) { @@ -1207,24 +1224,19 @@ size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) - int c; - char *arg; + int c ATTRIBUTE_UNUSED; + char *arg ATTRIBUTE_UNUSED; { return 0; } void md_show_usage (stream) - FILE *stream; + FILE *stream ATTRIBUTE_UNUSED; { } -void -tc_aout_fix_to_chars () -{ - printf (_("call to tc_aout_fix_to_chars \n")); - abort (); -} +static void wordify_scb PARAMS ((char *, int *, int *)); static void wordify_scb (buffer, disp_size, inst_size) @@ -1296,8 +1308,8 @@ wordify_scb (buffer, disp_size, inst_size) void md_convert_frag (headers, seg, fragP) - object_headers *headers; - segT seg; + object_headers *headers ATTRIBUTE_UNUSED; + segT seg ATTRIBUTE_UNUSED; fragS *fragP; { int disp_size = 0; @@ -1492,7 +1504,7 @@ md_pcrel_from (fixP) void tc_coff_symbol_emit_hook (ignore) - symbolS *ignore; + symbolS *ignore ATTRIBUTE_UNUSED; { } diff --git a/gas/config/tc-h8500.h b/gas/config/tc-h8500.h index 9f7b627..861c268 100644 --- a/gas/config/tc-h8500.h +++ b/gas/config/tc-h8500.h @@ -46,7 +46,10 @@ extern void tc_reloc_mangle #define RELOC_32 1234 #define TC_START_LABEL(ch, ptr) (ch == ':' && start_label(ptr)) +int start_label PARAMS ((char *)); + #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag) +int tc_coff_sizemachdep PARAMS ((struct frag *)); #define md_operand(x) |