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]

Re: Can't get ASSERT() to work in ld script.


On 14 Feb 2001, Ian Lance Taylor wrote:

> Grant Edwards <grante@visi.com> writes:
> 
> > I've spend hours trying to get a simple ASSSERT() statement to
> > work in a linker script.
> 
> Something like this works for me:
> 
> . = ASSERT ( 0, error );
> 
> It always helps to give an example of what doesn't work.

It also pays to take a glance at ld/ldgram.y.  That would have told you an
ASSERT is considered an expression, so can appear anywhere an expression
is valid.

I'm not so sure this makes sense really.  Ian's example is rather
contrived, and you probably don't want to assign the result of an ASSERT
to anything.  Should ASSERT_K move to ifile_p1?

Alan Modra
-- 
Linuxcare.  Support for the Revolution.



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