diff options
author | Ken Raeburn <raeburn@cygnus> | 1993-12-16 21:31:22 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1993-12-16 21:31:22 +0000 |
commit | c999fd9fc23a159a286f9b129992dd5a2969db39 (patch) | |
tree | 03370ad2c756ba88c5b5c53e2c50b2cf9c1eb24d | |
parent | a8a72d7480f75d02490bfb14c2377ddd158f4889 (diff) | |
download | gdb-c999fd9fc23a159a286f9b129992dd5a2969db39.zip gdb-c999fd9fc23a159a286f9b129992dd5a2969db39.tar.gz gdb-c999fd9fc23a159a286f9b129992dd5a2969db39.tar.bz2 |
* config/tc-vax.c (tc_aout_fix_to_chars): Local variable NBYTES_R_LENGTH now
const.
* config/obj-*.c, config/tc-*.c: Omit superfluous "return" statements at ends
of functions. Don't check for null return from hash_new, since it won't return
at all if there's no memory available. Also, check for null return from
hash_insert, rather than zero-length string, as success indicator.
-rw-r--r-- | gas/config/obj-bout.c | 14 | ||||
-rw-r--r-- | gas/config/obj-coffbfd.c | 45 | ||||
-rw-r--r-- | gas/config/obj-vms.c | 7 | ||||
-rw-r--r-- | gas/config/tc-a29k.c | 5 | ||||
-rw-r--r-- | gas/config/tc-hppa.c | 26 | ||||
-rw-r--r-- | gas/config/tc-m88k.c | 5 | ||||
-rw-r--r-- | gas/config/tc-sparc.c | 147 | ||||
-rw-r--r-- | gas/config/tc-tahoe.c | 37 |
8 files changed, 69 insertions, 217 deletions
diff --git a/gas/config/obj-bout.c b/gas/config/obj-bout.c index cbbffae..c08406f 100644 --- a/gas/config/obj-bout.c +++ b/gas/config/obj-bout.c @@ -208,8 +208,7 @@ obj_symbol_new_hook (symbolP) { S_SET_OTHER (symbolP, 0); S_SET_DESC (symbolP, 0); - return; -} /* obj_symbol_new_hook() */ +} static void obj_bout_line (ignore) @@ -225,8 +224,7 @@ obj_bout_line (ignore) void obj_read_begin_hook () { - return; -} /* obj_read_begin_hook() */ +} void obj_crawl_symbol_chain (headers) @@ -302,9 +300,7 @@ obj_crawl_symbol_chain (headers) } /* for each symbol */ H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number); - - return; -} /* obj_crawl_symbol_chain() */ +} /* * Find strings by crawling along symbol table chain. @@ -329,8 +325,6 @@ obj_emit_strings (where) if (S_GET_NAME (symbolP)) append (where, S_GET_NAME (symbolP), (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1)); } /* walk symbol chain */ - - return; -} /* obj_emit_strings() */ +} /* end of obj-bout.c */ diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c index 1b2a033..3a93f36 100644 --- a/gas/config/obj-coffbfd.c +++ b/gas/config/obj-coffbfd.c @@ -714,9 +714,7 @@ obj_symbol_new_hook (symbolP) SF_SET_STRING (symbolP); if (!underscore && S_IS_LOCAL (symbolP)) SF_SET_LOCAL (symbolP); - - return; -} /* obj_symbol_new_hook() */ +} /* stack stuff */ static stack * @@ -822,8 +820,7 @@ obj_coff_ln (appline) } #endif demand_empty_rest_of_line (); - return; -} /* obj_coff_line() */ +} /* * def() @@ -896,8 +893,7 @@ DEFUN (obj_coff_def, (what), *input_line_pointer = name_end; demand_empty_rest_of_line (); - return; -} /* obj_coff_def() */ +} unsigned int dim_index; @@ -1067,7 +1063,6 @@ obj_coff_endef (ignore) def_symbol_in_progress = NULL; demand_empty_rest_of_line (); - return; } static void @@ -1108,8 +1103,7 @@ obj_coff_dim (ignore) } /* for each dimension */ demand_empty_rest_of_line (); - return; -} /* obj_coff_dim() */ +} static void obj_coff_line (ignore) @@ -1143,8 +1137,7 @@ obj_coff_line (ignore) SA_SET_SYM_LNNO (def_symbol_in_progress, line_base); demand_empty_rest_of_line (); - return; -} /* obj_coff_line() */ +} static void obj_coff_size (ignore) @@ -1160,8 +1153,7 @@ obj_coff_size (ignore) S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); SA_SET_SYM_SIZE (def_symbol_in_progress, get_absolute_expression ()); demand_empty_rest_of_line (); - return; -} /* obj_coff_size() */ +} static void obj_coff_scl (ignore) @@ -1176,8 +1168,7 @@ obj_coff_scl (ignore) S_SET_STORAGE_CLASS (def_symbol_in_progress, get_absolute_expression ()); demand_empty_rest_of_line (); - return; -} /* obj_coff_scl() */ +} static void obj_coff_tag (ignore) @@ -1209,8 +1200,7 @@ obj_coff_tag (ignore) *input_line_pointer = name_end; demand_empty_rest_of_line (); - return; -} /* obj_coff_tag() */ +} static void obj_coff_type (ignore) @@ -1232,8 +1222,7 @@ obj_coff_type (ignore) } /* is a function */ demand_empty_rest_of_line (); - return; -} /* obj_coff_type() */ +} static void obj_coff_val (ignore) @@ -1293,8 +1282,7 @@ obj_coff_val (ignore) } /* if symbol based */ demand_empty_rest_of_line (); - return; -} /* obj_coff_val() */ +} /* * Maintain a list of the tagnames of the structres. @@ -1304,8 +1292,7 @@ static void tag_init () { tag_hash = hash_new (); - return; -} /* tag_init() */ +} static void tag_insert (name, symbolP) @@ -1319,8 +1306,7 @@ tag_insert (name, symbolP) as_fatal ("Inserting \"%s\" into structure table failed: %s", name, error_string); } - return; -} /* tag_insert() */ +} static symbolS * tag_find_or_make (name) @@ -1361,9 +1347,7 @@ obj_read_begin_hook () know (SYMESZ == AUXESZ); #endif tag_init (); - - return; -} /* obj_read_begin_hook() */ +} /* This function runs through the symbol table and puts all the externals onto another chain */ @@ -1680,8 +1664,6 @@ DEFUN (crawl_symbols, (h, abfd), H_SET_SYMBOL_TABLE_SIZE (h, tie_tags ()); know (symbol_externP == NULL); know (symbol_extern_lastP == NULL); - - return; } /* @@ -1712,7 +1694,6 @@ DEFUN (w_strings, (where), } } - } static void diff --git a/gas/config/obj-vms.c b/gas/config/obj-vms.c index 4bbb67d..704141f 100644 --- a/gas/config/obj-vms.c +++ b/gas/config/obj-vms.c @@ -377,8 +377,7 @@ vms_resolve_symbol_redef (sym) void obj_read_begin_hook () { - return; -} /* obj_read_begin_hook() */ +} void obj_crawl_symbol_chain (headers) @@ -3423,10 +3422,6 @@ VMS_Modify_Psect_Attributes (Name, Attribute_Pointer) if (*Name == '_') Name++; } - /* - * Done - */ - return; } diff --git a/gas/config/tc-a29k.c b/gas/config/tc-a29k.c index 24414b3..ef929e4 100644 --- a/gas/config/tc-a29k.c +++ b/gas/config/tc-a29k.c @@ -168,7 +168,6 @@ s_use (ignore) as_bad ("Unknown segment type"); demand_empty_rest_of_line (); - return; } static void @@ -176,7 +175,6 @@ s_data1 () { subseg_set (SEG_DATA, 1); demand_empty_rest_of_line (); - return; } #endif /* OBJ_COFF */ @@ -349,7 +347,6 @@ md_begin () void md_end () { - return; } /* Assemble a single instruction. Its label has already been handled @@ -874,7 +871,6 @@ md_apply_fix (fixP, val) as_bad ("bad relocation type: 0x%02x", fixP->fx_r_type); break; } - return; } #ifdef OBJ_COFF @@ -1000,7 +996,6 @@ print_insn (insn) fprintf (stderr, "\t\tX_add_number = %d\n", insn->exp.X_add_number); fprintf (stderr, "}\n"); - return; } #endif diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index d06d27e..735bf84 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -1322,8 +1322,6 @@ md_begin () pa_spaces_begin (); op_hash = hash_new (); - if (op_hash == NULL) - as_fatal ("Virtual memory exhausted"); while (i < NUMOPCODES) { @@ -1362,7 +1360,6 @@ md_begin () void md_end () { - return; } /* Assemble a single instruction storing it into a frag. */ @@ -2436,7 +2433,6 @@ pa_ip (str) } the_insn.opcode = opcode; - return; } /* Turn a string in input_line_pointer into a floating point constant of type @@ -3964,7 +3960,6 @@ pa_block (z) pa_undefine_label (); demand_empty_rest_of_line (); - return; } /* Handle a .CALL pseudo-op. This involves storing away information @@ -3977,7 +3972,6 @@ pa_call (unused) { pa_call_args (&last_call_desc); demand_empty_rest_of_line (); - return; } /* Do the dirty work of building a call descriptor which describes @@ -4242,7 +4236,6 @@ pa_callinfo (unused) } demand_empty_rest_of_line (); - return; } /* Switch into the code subspace. */ @@ -4269,7 +4262,6 @@ pa_code (unused) SPACE_DEFINED (sdchain) = 1; subseg_set (text_section, SUBSEG_CODE); demand_empty_rest_of_line (); - return; } /* This is different than the standard GAS s_comm(). On HP9000/800 machines, @@ -4330,7 +4322,6 @@ pa_end (unused) int unused; { demand_empty_rest_of_line (); - return; } /* Process a .ENTER pseudo-op. This is not supported. */ @@ -4339,7 +4330,6 @@ pa_enter (unused) int unused; { abort (); - return; } /* Process a .ENTRY pseudo-op. .ENTRY marks the beginning of the @@ -4381,8 +4371,6 @@ pa_entry (unused) (char *) &last_call_info->ci_unwind.descriptor); } #endif - - return; } /* Handle a .EQU pseudo-op. */ @@ -4410,7 +4398,6 @@ pa_equ (reg) pa_undefine_label (); demand_empty_rest_of_line (); - return; } /* Helper function. Does processing for the end of a function. This @@ -4471,7 +4458,6 @@ pa_exit (unused) } } demand_empty_rest_of_line (); - return; } /* Process a .EXPORT directive. This makes functions external @@ -4512,7 +4498,6 @@ pa_export (unused) } demand_empty_rest_of_line (); - return; } /* Helper function to process arguments to a .EXPORT pseudo-op. */ @@ -4694,7 +4679,6 @@ pa_import (unused) } demand_empty_rest_of_line (); - return; } /* Handle a .LABEL pseudo-op. */ @@ -4725,7 +4709,6 @@ pa_label (unused) ignore_rest_of_line (); } demand_empty_rest_of_line (); - return; } /* Handle a .LEAVE pseudo-op. This is not supported yet. */ @@ -4745,7 +4728,6 @@ pa_origin (unused) { s_org (0); pa_undefine_label (); - return; } /* Handle a .PARAM pseudo-op. This is much like a .EXPORT, except it @@ -4781,7 +4763,6 @@ pa_param (unused) } demand_empty_rest_of_line (); - return; } /* Handle a .PROC pseudo-op. It is used to mark the beginning @@ -4847,7 +4828,6 @@ pa_proc (unused) } demand_empty_rest_of_line (); - return; } /* Process the syntatical end of a procedure. Make sure all the @@ -4875,7 +4855,6 @@ pa_procend (unused) within_procedure = FALSE; demand_empty_rest_of_line (); - return; } /* Parse the parameters to a .SPACE directive; if CREATE_FLAG is nonzero, @@ -5107,7 +5086,6 @@ pa_space (unused) sd_chain->sd_last_subseg); demand_empty_rest_of_line (); } - return; } /* Switch to a new space. (I think). FIXME. */ @@ -5134,7 +5112,6 @@ pa_spnum (unused) *input_line_pointer = c; demand_empty_rest_of_line (); - return; } /* If VALUE is an exact power of two between zero and 2^31, then @@ -5378,7 +5355,6 @@ pa_subspace (unused) subseg_set (current_subspace->ssd_seg, current_subspace->ssd_subseg); } SUBSPACE_DEFINED (current_subspace) = 1; - return; } @@ -6251,8 +6227,6 @@ hppa_tc_make_sections (abfd) /* Switch back to the original segment. */ subseg_set (save_seg, save_subseg); - - return; } /* Make the symbol extension section. */ diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c index 432b606..eaf994f 100644 --- a/gas/config/tc-m88k.c +++ b/gas/config/tc-m88k.c @@ -188,8 +188,6 @@ md_begin () /* initialize hash table */ op_hash = hash_new (); - if (op_hash == NULL) - as_fatal ("Could not initialize hash table"); /* loop until you see the end of the list */ @@ -1228,7 +1226,6 @@ emit_relocations (fixP, segment_address_in_file) append (&next_object_file_charP, (char *) &ri, sizeof (ri)); } } - return; } #endif /* 0 */ @@ -1313,8 +1310,6 @@ s_bss () { input_line_pointer++; } - - return; } #endif /* 0 */ diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 068b3f2..1a05748 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -466,16 +466,14 @@ s_seg (ignore) } as_bad ("Unknown segment type"); demand_empty_rest_of_line (); - return; -} /* s_seg() */ +} static void s_data1 () { subseg_set (data_section, 1); demand_empty_rest_of_line (); - return; -} /* s_data1() */ +} static void s_proc (ignore) @@ -486,8 +484,7 @@ s_proc (ignore) ++input_line_pointer; } ++input_line_pointer; - return; -} /* s_proc() */ +} /* start-sanitize-v9 */ #ifndef NO_V9 @@ -560,8 +557,6 @@ md_begin () register unsigned int i = 0; op_hash = hash_new (); - if (op_hash == NULL) - as_fatal ("Virtual memory exhausted"); while (i < NUMOPCODES) { @@ -789,23 +784,30 @@ sparc_ip (str) ++s; } } - else if (isdigit (*s)) + else { + expressionS exp; + char *hold; char *send; - kmask = strtol (s, &send, 0); - if (kmask < 0 || kmask > 127) + hold = input_line_pointer; + input_line_pointer = s; + expression (&exp); + send = input_line_pointer; + input_line_pointer = hold; + + kmask = exp.X_add_number; + if (exp.X_op != O_constant + || kmask < 0 + || kmask > 127) { error_message = ": invalid membar mask number"; goto error; } + s = send; } - else - { - error_message = ": unrecognizable membar mask"; - goto error; - } + opcode |= SIMM13 (kmask); continue; } @@ -1472,6 +1474,8 @@ sparc_ip (str) the_insn.reloc = BFD_RELOC_LO10; the_insn.exp.X_add_number >>= 32; break; + default: + break; } #endif /* end-sanitize-v9 */ @@ -1713,8 +1717,7 @@ sparc_ip (str) } /* forever looking for a match */ the_insn.opcode = opcode; - return; -} /* sparc_ip() */ +} static int getExpression (str) @@ -1819,30 +1822,8 @@ md_number_to_chars (buf, val, n) valueT val; int n; { - - switch (n) - { - /* start-sanitize-v9 */ - case 8: - *buf++ = val >> 56; - *buf++ = val >> 48; - *buf++ = val >> 40; - *buf++ = val >> 32; - /* end-sanitize-v9 */ - case 4: - *buf++ = val >> 24; - *buf++ = val >> 16; - case 2: - *buf++ = val >> 8; - case 1: - *buf = val; - break; - - default: - as_fatal ("failed sanity check."); - } - return; -} /* md_number_to_chars() */ + number_to_chars_bigendian (buf, val, n); +} /* Apply a fixS to the frags, now that we know the value it ought to hold. */ @@ -1869,18 +1850,14 @@ md_apply_fix (fixP, value) return 1; #endif - /* - * This is a hack. There should be a better way to - * handle this. - */ + /* This is a hack. There should be a better way to + handle this. Probably in terms of howto fields, once + we can look at these fixups in terms of howtos. */ if (fixP->fx_r_type == BFD_RELOC_32_PCREL_S2 && fixP->fx_addsy) - { - val += fixP->fx_where + fixP->fx_frag->fr_address; - } + val += fixP->fx_where + fixP->fx_frag->fr_address; switch (fixP->fx_r_type) { - case BFD_RELOC_16: buf[0] = val >> 8; buf[1] = val; @@ -2051,18 +2028,6 @@ md_apply_fix (fixP, value) return 1; } -/* should never be called for sparc */ -void -md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr; - addressT to_addr; - fragS *frag; - symbolS *to_symbol; -{ - as_fatal ("sparc_create_short_jmp\n"); -} - /* Translate internal representation of relocation info to BFD target format. */ arelent * @@ -2078,24 +2043,6 @@ tc_gen_reloc (section, fixp) reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym; reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - reloc->addend = 0; - if (fixp->fx_pcrel == 0) - reloc->addend += fixp->fx_addnumber; - else - { - reloc->addend += fixp->fx_offset; - switch (OUTPUT_FLAVOR) - { - case bfd_target_elf_flavour: - break; - case bfd_target_aout_flavour: - reloc->addend -= reloc->address; - break; - default: - /* What's a good default here? Is there any?? */ - abort (); - } - } switch (fixp->fx_r_type) { @@ -2124,30 +2071,19 @@ tc_gen_reloc (section, fixp) } reloc->howto = bfd_reloc_type_lookup (stdoutput, code); assert (reloc->howto != 0); + assert (!fixp->fx_pcrel == !reloc->howto->pc_relative); + + /* @@ Why fx_addnumber sometimes and fx_offset other times? */ + if (reloc->howto->pc_relative == 0) + reloc->addend = fixp->fx_addnumber; + else if (reloc->howto->pcrel_offset) + reloc->addend = fixp->fx_offset - reloc->address; + else + reloc->addend = fixp->fx_offset; return reloc; } -/* should never be called for sparc */ -void -md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol) - char *ptr; - addressT from_addr, to_addr; - fragS *frag; - symbolS *to_symbol; -{ - as_fatal ("sparc_create_long_jump\n"); -} /* md_create_long_jump() */ - -/* should never be called for sparc */ -int -md_estimate_size_before_relax (fragP, segtype) - fragS *fragP; - segT segtype; -{ - as_fatal ("sparc_estimate_size_before_relax\n"); - return (1); -} /* md_estimate_size_before_relax() */ #if 0 /* for debugging only */ @@ -2155,8 +2091,7 @@ static void print_insn (insn) struct sparc_it *insn; { - char *Reloc[] = - { + const char *const Reloc[] = { "RELOC_8", "RELOC_16", "RELOC_32", @@ -2185,9 +2120,7 @@ print_insn (insn) }; if (insn->error) - { - fprintf (stderr, "ERROR: %s\n"); - } + fprintf (stderr, "ERROR: %s\n"); fprintf (stderr, "opcode=0x%08x\n", insn->opcode); fprintf (stderr, "reloc = %s\n", Reloc[insn->reloc]); fprintf (stderr, "exp = {\n"); @@ -2206,9 +2139,7 @@ print_insn (insn) fprintf (stderr, "\t\tX_add_number = %d\n", insn->exp.X_add_number); fprintf (stderr, "}\n"); - return; -} /* print_insn() */ - +} #endif /* diff --git a/gas/config/tc-tahoe.c b/gas/config/tc-tahoe.c index 7670be3..f8a1fc5 100644 --- a/gas/config/tc-tahoe.c +++ b/gas/config/tc-tahoe.c @@ -358,24 +358,15 @@ md_begin () char *errorval = 0; int synthetic_too = 1; /* If 0, just use real opcodes. */ - if ((op_hash = hash_new ())) - { - for (tP = totstrs; *tP->name && !*errorval; tP++) - { - errorval = hash_insert (op_hash, tP->name, &tP->detail); - } - if (synthetic_too) - { - for (tP = synthetic_totstrs; *tP->name && !*errorval; tP++) - { - errorval = hash_insert (op_hash, tP->name, &tP->detail); - } - } - } - else - { - errorval = "Virtual memory exceeded"; - } + op_hash = hash_new (); + + for (tP = totstrs; *tP->name && !errorval; tP++) + errorval = hash_insert (op_hash, tP->name, &tP->detail); + + if (synthetic_too) + for (tP = synthetic_totstrs; *tP->name && !errorval; tP++) + errorval = hash_insert (op_hash, tP->name, &tP->detail); + if (errorval) as_fatal (errorval); } @@ -383,7 +374,7 @@ md_begin () void md_end () { -} /* md_end */ +} int md_parse_option (argP, cntP, vecP) @@ -480,11 +471,9 @@ tc_apply_fix (fixP, val) fixS *fixP; long val; { - /* char *place = fixP->fx_where + fixP->fx_frag->fr_literal; */ /* should never be called */ know (0); - return; -} /* tc_apply_fix() */ +} void /* Knows about order of bytes in address. */ md_number_to_disp (con, value, nbytes) @@ -574,9 +563,7 @@ tc_aout_fix_to_chars (where, fixP, segment_address_in_file) ? 2 : 42)))) << 5) & 0x60) | ((!S_IS_DEFINED (fixP->fx_addsy) << 4) & 0x10)); - - return; -} /* tc_aout_fix_to_chars() */ +} /* Relocate byte stuff */ |