+2002-11-20 Klee Dienes <kdienes@apple.com>
+
+ * config/tc-mcore.c (md_begin): Use a const iterator. Don't
+ coalesce the name fields to use the same pointer.
+
+ * config/tc-sh.c (md_begin): Use a const iterator. Don't coalesce
+ the name fields to use the same pointer.
+ (get_specific): Check for opcodes with the same name using strcmp
+ as well as comparing the pointer.
+
2002-11-20 Alan Modra <amodra@bigpond.net.au>
* write.c (adjust_reloc_syms): Don't reduce SEC_MERGE fixups with
void
md_begin ()
{
- mcore_opcode_info * opcode;
+ const mcore_opcode_info * opcode;
char * prev_name = "";
opcode_hash_control = hash_new ();
/* Insert unique names into hash table */
for (opcode = mcore_table; opcode->name; opcode ++)
{
- if (streq (prev_name, opcode->name))
- {
- /* Make all the opcodes with the same name point to the same
- string. */
- opcode->name = prev_name;
- }
- else
+ if (! streq (prev_name, opcode->name))
{
prev_name = opcode->name;
hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
void
md_begin ()
{
- sh_opcode_info *opcode;
+ const sh_opcode_info *opcode;
char *prev_name = "";
int target_arch;
/* Insert unique names into hash table. */
for (opcode = sh_table; opcode->name; opcode++)
{
- if (strcmp (prev_name, opcode->name))
+ if (strcmp (prev_name, opcode->name) != 0)
{
if (! (opcode->arch & target_arch))
continue;
prev_name = opcode->name;
hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
}
- else
- {
- /* Make all the opcodes with the same name point to the same
- string. */
- opcode->name = prev_name;
- }
}
}
while (opcode->name)
{
this_try = opcode++;
- if (this_try->name != name)
+ if ((this_try->name != name) && (strcmp (this_try->name, name) != 0))
{
/* We've looked so far down the table that we've run out of
opcodes with the same name. */