public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gas: undefined symbol in immediate operand
@ 2006-08-24 10:05 Jeremy Dexter
  2006-08-24 10:43 ` Richard Earnshaw
  2006-08-24 10:49 ` Nick Clifton
  0 siblings, 2 replies; 6+ messages in thread
From: Jeremy Dexter @ 2006-08-24 10:05 UTC (permalink / raw)
  To: binutils

Hi

I'm finding that if I accidentally enter an undefined symbol name as an
*immediate* operand, then as will accept it without any warning. I've tried
this on binutils 2.14 and 2.17 for ARM and PowerPC.

For example, the ARM assembler produces the following:

                                .equ    Moo,   0x42 
 297 0148 000080E3 	                orr    r0,r0,#moo

Note the typo in the symbol name. The assembler accepts it and adds an
undefined symbol "moo" to the object file, but the linker will not flag it
as undefined, which I presume is because there is no valid reference to it.
So you end up with code that ORs the value 0x00 rather than 0x42.

I would have thought that the assembler is at fault here. An immediate
operand should resolve to a *constant* - an external symbol reference should
not be accepted here. Or am I missing something?

Thanks in advance!

Jeremy

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-08-28  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-24 10:05 gas: undefined symbol in immediate operand Jeremy Dexter
2006-08-24 10:43 ` Richard Earnshaw
2006-08-24 10:49 ` Nick Clifton
2006-08-25  7:44   ` Jeremy Dexter
2006-08-25 10:51     ` Nick Clifton
2006-08-28  2:04       ` Jeremy Dexter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).