summaryrefslogtreecommitdiffstats
path: root/gas
diff options
context:
space:
mode:
authorKlee Dienes <kdienes@apple.com>2002-11-21 09:54:12 +0000
committerKlee Dienes <kdienes@apple.com>2002-11-21 09:54:12 +0000
commit5ff3743120dac75a0f2fcb0e7b4a62dc4ca279a9 (patch)
treeb778eae29702dfa436f0bbb3bf33663bcc4ca9d7 /gas
parent444d9f96ab5a5d1273577111553a5af57f567a7e (diff)
downloadppe42-binutils-5ff3743120dac75a0f2fcb0e7b4a62dc4ca279a9.tar.gz
ppe42-binutils-5ff3743120dac75a0f2fcb0e7b4a62dc4ca279a9.zip
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-mcore.c10
-rw-r--r--gas/config/tc-sh.c12
3 files changed, 15 insertions, 17 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6dab2b4d56..34824a875e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+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
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index 538d75b0d5..41e958d5fc 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -432,7 +432,7 @@ mcore_s_comm (needs_align)
void
md_begin ()
{
- mcore_opcode_info * opcode;
+ const mcore_opcode_info * opcode;
char * prev_name = "";
opcode_hash_control = hash_new ();
@@ -440,13 +440,7 @@ md_begin ()
/* 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);
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 664c269493..5c623033ba 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -863,7 +863,7 @@ sh_elf_cons (nbytes)
void
md_begin ()
{
- sh_opcode_info *opcode;
+ const sh_opcode_info *opcode;
char *prev_name = "";
int target_arch;
@@ -879,19 +879,13 @@ md_begin ()
/* 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;
- }
}
}
@@ -1574,7 +1568,7 @@ get_specific (opcode, operands)
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. */
OpenPOWER on IntegriCloud