Subject: Bug fix for instruction annotations
From: [email-masked] (Manoj Plakal)
To: [email-masked]
Date: Mon, 30 Jun 1997 17:51:50 -0500

Hi,

I had posted a mail to this list earlier regarding the SimpleScalar
version of gas not accepting instruction annotations. I have since
managed to fix a couple of bugs in the SimpleScalar-specific portion
of the gas code (functions ss_ip, ParseInsnFlags and ProcessInsnFlag in
targ-cpu.c, which is a link to config/tc-ss.c; all paths are relative to the
binutils-2.5.2/gas directory).

The modified gas now accepts and correctly processes annotations 
(verified using objdump's full disassembly option). Below, I have
included a patch file which can be applied to the offending gas source
code.

Instructions for applying the patch :-

	- Copy the text between the dashes into a file (say bugfix.patch).
	- Goto the binutils-2.5.2/gas directory 
	- Verify file sizes :
		targ-cpu.c : 121741 bytes
		bugfix.patch : 685 bytes
	- Execute : `cat bugfix.patch | ed - targ-cpu.c > targ-cpu.c.fixed'
	- Verify file size : targ-cpu.c.fixed = 122082 bytes
	- Make a backup copy of targ-cpu.c and rename targ-cpu.c.fixed to
	  targ-cpu.c
	- Now, move to the binutils-2.5.2 directory and issue a `make'
	  and a `make install' (assuming you've already executed configure
	  and installed it once).

Hope that helps

Manoj

-------------------PATCH-----CUT HERE--------------------------------------
2411a
    case '/' :   /* -- Added on 06/30/97 by [email-masked],
                  * -- this fixes the annotation-ignoring problem 
                  */
.
2407c
    continue; 
.
2405c
  for (t=opc,s=str; islower (*s) || (*s>='0' && *s<='3') || (*s=='.'); ++s) {
.
2350a
  else if (sscanf(s, "/%c/", &c) == 1) {
    if (!islower(c))
      as_fatal ("Unknown flag: `/%c'", c);
    insn_flags |= 1 << (c - 'a');
  }
.
2336,2341c
  /* -- Changed on 06/30/97 by [email-masked] : 
   * -- The order of the flag checks has been reversed, otherwise
   * -- the field annotations ( /N:M(X) ) aren't recognized
   */

  if (sscanf(s, "/%d:%d(%d)/", &end, &start, &value) == 3) {
.
1,$p
-------------------PATCH-----CUT HERE--------------------------------------