This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Re: gas preprocessor


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


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