This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] gas/gasp.c


This patch makes gasp print labels before expanding macros if a label
appears before the macro call.  Here's an example:

Before

.MACRO foo X
	\X
.ENDM

test:	foo 123

produced

	123

after applying the patch it produces

test:	123

which I think is the desirable behavior.

2000-04-26  Geoff Berry  <geoffb@bops.com>

	* gasp.c (process_file): Print label even if processing a macro.

*** gasp.c	Tue Apr 07 19:47:32 1998
--- gasp.c~	Wed Apr 26 23:41:43 2000
***************
***************
*** 1969,1974 ****
--- 1999,2009 ----
  		}
  	      else if (condass_on ())
  		{
+ 		  if (label.len)
+ 		    {
+ 		      fprintf (outfile, "%s:", sb_name (&label));
+ 		    }
+ 
  		  if (macro_op (l, &line))
  		    {
  
***************
*** 1977,1988 ****
  		  else
  		    {
  		      {
! 			if (label.len)
! 			  {
! 			    fprintf (outfile, "%s:\t", sb_name (&label));
! 			  }
! 			else
! 			  fprintf (outfile, "\t");
  			sb_reset(&t1);
  			process_assigns (l, &line, &t1);
  			sb_reset (&t2);
--- 2012,2018 ----
  		  else
  		    {
  		      {
! 			fprintf (outfile, "\t");
  			sb_reset(&t1);
  			process_assigns (l, &line, &t1);
  			sb_reset (&t2);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]