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.
{
S_SET_OTHER (symbolP, 0);
S_SET_DESC (symbolP, 0);
- return;
-} /* obj_symbol_new_hook() */
+}
static void
obj_bout_line (ignore)
void
obj_read_begin_hook ()
{
- return;
-} /* obj_read_begin_hook() */
+}
void
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.
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 */
SF_SET_STRING (symbolP);
if (!underscore && S_IS_LOCAL (symbolP))
SF_SET_LOCAL (symbolP);
-
- return;
-} /* obj_symbol_new_hook() */
+}
/* stack stuff */
static stack *
}
#endif
demand_empty_rest_of_line ();
- return;
-} /* obj_coff_line() */
+}
/*
* def()
*input_line_pointer = name_end;
demand_empty_rest_of_line ();
- return;
-} /* obj_coff_def() */
+}
unsigned int dim_index;
def_symbol_in_progress = NULL;
demand_empty_rest_of_line ();
- return;
}
static void
} /* for each dimension */
demand_empty_rest_of_line ();
- return;
-} /* obj_coff_dim() */
+}
static void
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)
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)
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)
*input_line_pointer = name_end;
demand_empty_rest_of_line ();
- return;
-} /* obj_coff_tag() */
+}
static void
obj_coff_type (ignore)
} /* is a function */
demand_empty_rest_of_line ();
- return;
-} /* obj_coff_type() */
+}
static void
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.
tag_init ()
{
tag_hash = hash_new ();
- return;
-} /* tag_init() */
+}
static void
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)
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 */
H_SET_SYMBOL_TABLE_SIZE (h, tie_tags ());
know (symbol_externP == NULL);
know (symbol_extern_lastP == NULL);
-
- return;
}
/*
}
}
-
}
static void
void
obj_read_begin_hook ()
{
- return;
-} /* obj_read_begin_hook() */
+}
void
obj_crawl_symbol_chain (headers)
if (*Name == '_')
Name++;
}
- /*
- * Done
- */
- return;
}
\f
as_bad ("Unknown segment type");
demand_empty_rest_of_line ();
- return;
}
static void
{
subseg_set (SEG_DATA, 1);
demand_empty_rest_of_line ();
- return;
}
#endif /* OBJ_COFF */
void
md_end ()
{
- return;
}
/* Assemble a single instruction. Its label has already been handled
as_bad ("bad relocation type: 0x%02x", fixP->fx_r_type);
break;
}
- return;
}
#ifdef OBJ_COFF
fprintf (stderr, "\t\tX_add_number = %d\n",
insn->exp.X_add_number);
fprintf (stderr, "}\n");
- return;
}
#endif
pa_spaces_begin ();
op_hash = hash_new ();
- if (op_hash == NULL)
- as_fatal ("Virtual memory exhausted");
while (i < NUMOPCODES)
{
void
md_end ()
{
- return;
}
/* Assemble a single instruction storing it into a frag. */
}
the_insn.opcode = opcode;
- return;
}
/* Turn a string in input_line_pointer into a floating point constant of type
pa_undefine_label ();
demand_empty_rest_of_line ();
- return;
}
/* Handle a .CALL pseudo-op. This involves storing away information
{
pa_call_args (&last_call_desc);
demand_empty_rest_of_line ();
- return;
}
/* Do the dirty work of building a call descriptor which describes
}
demand_empty_rest_of_line ();
- return;
}
/* Switch into the code subspace. */
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,
int unused;
{
demand_empty_rest_of_line ();
- return;
}
/* Process a .ENTER pseudo-op. This is not supported. */
int unused;
{
abort ();
- return;
}
/* Process a .ENTRY pseudo-op. .ENTRY marks the beginning of the
(char *) &last_call_info->ci_unwind.descriptor);
}
#endif
-
- return;
}
/* Handle a .EQU pseudo-op. */
pa_undefine_label ();
demand_empty_rest_of_line ();
- return;
}
/* Helper function. Does processing for the end of a function. This
}
}
demand_empty_rest_of_line ();
- return;
}
/* Process a .EXPORT directive. This makes functions external
}
demand_empty_rest_of_line ();
- return;
}
/* Helper function to process arguments to a .EXPORT pseudo-op. */
}
demand_empty_rest_of_line ();
- return;
}
/* Handle a .LABEL pseudo-op. */
ignore_rest_of_line ();
}
demand_empty_rest_of_line ();
- return;
}
/* Handle a .LEAVE pseudo-op. This is not supported yet. */
{
s_org (0);
pa_undefine_label ();
- return;
}
/* Handle a .PARAM pseudo-op. This is much like a .EXPORT, except it
}
demand_empty_rest_of_line ();
- return;
}
/* Handle a .PROC pseudo-op. It is used to mark the beginning
}
demand_empty_rest_of_line ();
- return;
}
/* Process the syntatical end of a procedure. Make sure all the
within_procedure = FALSE;
demand_empty_rest_of_line ();
- return;
}
/* Parse the parameters to a .SPACE directive; if CREATE_FLAG is nonzero,
sd_chain->sd_last_subseg);
demand_empty_rest_of_line ();
}
- return;
}
/* Switch to a new space. (I think). FIXME. */
*input_line_pointer = c;
demand_empty_rest_of_line ();
- return;
}
/* If VALUE is an exact power of two between zero and 2^31, then
subseg_set (current_subspace->ssd_seg, current_subspace->ssd_subseg);
}
SUBSPACE_DEFINED (current_subspace) = 1;
- return;
}
/* Switch back to the original segment. */
subseg_set (save_seg, save_subseg);
-
- return;
}
/* Make the symbol extension section. */
/* 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 */
append (&next_object_file_charP, (char *) &ri, sizeof (ri));
}
}
- return;
}
#endif /* 0 */
{
input_line_pointer++;
}
-
- return;
}
#endif /* 0 */
}
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)
++input_line_pointer;
}
++input_line_pointer;
- return;
-} /* s_proc() */
+}
/* start-sanitize-v9 */
#ifndef NO_V9
register unsigned int i = 0;
op_hash = hash_new ();
- if (op_hash == NULL)
- as_fatal ("Virtual memory exhausted");
while (i < NUMOPCODES)
{
++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;
}
the_insn.reloc = BFD_RELOC_LO10;
the_insn.exp.X_add_number >>= 32;
break;
+ default:
+ break;
}
#endif
/* end-sanitize-v9 */
} /* forever looking for a match */
the_insn.opcode = opcode;
- return;
-} /* sparc_ip() */
+}
static int
getExpression (str)
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. */
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;
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 *
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)
{
}
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 */
print_insn (insn)
struct sparc_it *insn;
{
- char *Reloc[] =
- {
+ const char *const Reloc[] = {
"RELOC_8",
"RELOC_16",
"RELOC_32",
};
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");
fprintf (stderr, "\t\tX_add_number = %d\n",
insn->exp.X_add_number);
fprintf (stderr, "}\n");
- return;
-} /* print_insn() */
-
+}
#endif
/*
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);
}
void
md_end ()
{
-} /* md_end */
+}
\f
int
md_parse_option (argP, cntP, vecP)
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)
? 2
: 42)))) << 5) & 0x60)
| ((!S_IS_DEFINED (fixP->fx_addsy) << 4) & 0x10));
-
- return;
-} /* tc_aout_fix_to_chars() */
+}
/* Relocate byte stuff */
\f