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: Re: AS problem


On Thu, Apr 07, 2005 at 04:22:07AM +0000, PatilSubhash Jayadeep wrote:
> Absolute values always get high priority. Now in following case,
> 
> 		.set tuv, _undef1
> 		.long tuv
> 		.set tuv, 1
> 
> Symbol 'tuv' in the .long gets value 1. Result won't change if we reverse the definition of
> 'tuv'. But if last def of 'tuv' is removed then proper relocation is generated in .long.

This is as expected.  gas can't emit the value of .long tuv immediately
because tuv doesn't evaluate to a known value at that point.  Instead,
gas stores information saying a fixup is needed against tuv at that
particular address.  Fixup processing happens after the whole file has
been read, by which time you have set tuv to the value 1.

> Also few of errors are not printed directly. As in following case,
> 
> 		.set tuv, _undef1+_undef2
> 		.long tuv
> 		.set tuv, 1
> 
> No error is generated for expression _undef1+_undef2. But if last def is removed then 
> error is printed.

Again, the same reasoning applies.  No evaluation of _undef1+_undef2 is
attempted, so there is no error.

BTW, please see http://www.eyrie.org/~eagle/faqs/questions.html

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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