gas preprocessor

Nick Clifton nickc@cambridge.redhat.com
Wed Jan 16 03:37:00 GMT 2002


Hi Crni,

> I tried what you suggested but seems like it doesn't
> work. Here is small assembly program:
> 
> .set result, [ebp-4]
> 	mov	result, dword ptr 42
> 	mov	eax, result

> However, linker reports errors:
> foo.o: In function `answer':
> foo.o(.text+0x14): undefined reference to `ebp'
> foo.o(.text+0x1d): undefined reference to `ebp'

*sigh* Yes, it seems that the assembler does not recheck the
expression in an evaluated .set symbol to see if it is a register
name, so it creates a reference to a symbol called 'ebp'.  I thinkt
you are going to have to use the C preprocessor instead.  Sorry.

Cheers
        Nick



More information about the Binutils mailing list