[PATCH] MIPS gas: Fix macro expansions for .set noat

Maciej W. Rozycki macro@linux-mips.org
Thu Feb 17 20:50:00 GMT 2005


On Wed, 16 Feb 2005, Eric Christopher wrote:

> > 2005-02-16  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
> > 
> > 	/gas/ChangeLog
> > 	* config/tc-mips.c (macro): Don't fail but warn on $at uses
> > 	after .set noat, it may only be sloppy coding.  Don't try to
> > 	avoid $at use by sacrificing the target register before it is
> > 	stored, it won't work.
> 
> Actually I disagree. If the user used .set noat and has sloppy coding we
> should fall over like we would for .set nomacro or such.

 What exactly do you mean?

$ cat nomacro.S
	.set	noreorder
	.set	nomacro
	la	$2,foo($3)
$ gcc -c nomacro.S
nomacro.S: Assembler messages:
nomacro.S:3: Warning: Macro instruction expanded into multiple instructions
$ objdump -Sr nomacro.o

nomacro.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <.text>:
   0:	8f820000 	lw	v0,0(gp)
			0: R_MIPS_GOT16	foo
   4:	00000000 	nop
   8:	00431021 	addu	v0,v0,v1
   c:	00000000 	nop

It's always been like this and when I complained once, asking for making 
it an error I was told a warning was The Right Way and it was not going to 
be changed, sigh...

 If the rules have changed now, then I am happy about it as I've never 
seen any benefit from the current behavior.  But then the update should be 
consistent and make all "set noat" and ".set nomacro" violations trigger 
the same action.

  Maciej



More information about the Binutils mailing list