for (idx = 0; md_pseudo_table[idx].poc_name; idx++)
{
opcode_entry_type *fake_opcode;
- fake_opcode = (opcode_entry_type *) malloc (sizeof (opcode_entry_type));
+ fake_opcode = XNEW (opcode_entry_type);
fake_opcode->name = md_pseudo_table[idx].poc_name;
fake_opcode->func = (void *) (md_pseudo_table + idx);
fake_opcode->opcode = 250;
/* Make sure the mode supplied is the size of a word. */
static void
-regword (int mode, char *string)
+regword (int mode, const char *string)
{
int ok;
/* Make sure the mode supplied is the size of an address. */
static void
-regaddr (int mode, char *string)
+regaddr (int mode, const char *string)
{
int ok;
struct ctrl_names {
int value;
- char *name;
+ const char *name;
};
static struct ctrl_names ctrl_table[] = {
struct flag_names {
int value;
- char *name;
+ const char *name;
};
static struct flag_names flag_table[] = {
struct interrupt_names {
int value;
- char *name;
+ const char *name;
};
static struct interrupt_names intr_table[] = {
struct cc_names {
int value;
- char *name;
+ const char *name;
};
static struct cc_names table[] = {
static char buffer[20];
static void
-newfix (int ptr, int type, int size, expressionS *operand)
+newfix (int ptr, bfd_reloc_code_real_type type, int size, expressionS *operand)
{
- int is_pcrel = 0;
fixS *fixP;
/* Size is in nibbles. */
|| operand->X_op_symbol
|| operand->X_add_number)
{
+ int is_pcrel;
switch(type)
{
case BFD_RELOC_8_PCREL:
case BFD_RELOC_Z8K_CALLR:
case BFD_RELOC_Z8K_DISP7:
is_pcrel = 1;
+ break;
+ default:
+ is_pcrel = 0;
+ break;
}
fixP = fix_new_exp (frag_now, ptr, size / 2,
operand, is_pcrel, type);
}
static char *
-apply_fix (char *ptr, int type, expressionS *operand, int size)
+apply_fix (char *ptr, bfd_reloc_code_real_type type, expressionS *operand,
+ int size)
{
long n = operand->X_add_number;
/* Various routines to kill one day. */
-char *
+const char *
md_atof (int type, char *litP, int *sizeP)
{
return ieee_md_atof (type, litP, sizeP, TRUE);
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
{
arelent *reloc;
- reloc = xmalloc (sizeof (*reloc));
- reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ reloc = XNEW (arelent);
+ reloc->sym_ptr_ptr = XNEW (asymbol *);
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;