/* tc-pj.c -- Assemble code for Pico Java
- Copyright (C) 1999-2020 Free Software Foundation, Inc.
+ Copyright (C) 1999-2022 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
void
md_operand (expressionS *op)
{
- if (strncmp (input_line_pointer, "%hi16", 5) == 0)
+ if (startswith (input_line_pointer, "%hi16"))
{
if (pending_reloc)
as_bad (_("confusing relocation expressions"));
expression (op);
}
- if (strncmp (input_line_pointer, "%lo16", 5) == 0)
+ if (startswith (input_line_pointer, "%lo16"))
{
if (pending_reloc)
as_bad (_("confusing relocation expressions"));
fake->opcode = -1;
fake->opcode_next = -1;
fake->u.func = func;
- str_hash_insert (opcode_hash_control, name, (char *) fake);
+ str_hash_insert (opcode_hash_control, name, fake, 0);
}
/* Enter another entry into the opcode hash table so the same opcode
alias (const char *new_name, const char *old)
{
str_hash_insert (opcode_hash_control, new_name,
- (char *) str_hash_find (opcode_hash_control, old));
+ str_hash_find (opcode_hash_control, old), 0);
}
/* This function is called once, at assembler startup time. It sets
/* Insert names into hash table. */
for (opcode = pj_opc_info; opcode->u.name; opcode++)
- str_hash_insert (opcode_hash_control, opcode->u.name, (char *) opcode);
+ str_hash_insert (opcode_hash_control, opcode->u.name, opcode, 0);
/* Insert the only fake opcode. */
fake_opcode ("ipush", ipush_code);
}
else
{
- int an;
+ unsigned int an;
output = frag_more (opcode->len);
output[idx++] = opcode->opcode;
if (opcode->opcode_next != -1)
output[idx++] = opcode->opcode_next;
- for (an = 0; opcode->arg[an]; an++)
+ for (an = 0; an < ARRAY_SIZE (opcode->arg) && opcode->arg[an]; an++)
{
expressionS arg;
break;
case BFD_RELOC_PJ_CODE_DIR32:
+ case BFD_RELOC_PJ_CODE_REL32:
*buf++ = val >> 24;
*buf++ = val >> 16;
*buf++ = val >> 8;
}
break;
- case BFD_RELOC_PJ_CODE_REL32:
- fixP->fx_done = 0;
- return;
-
default:
abort ();
}