This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Can't get ASSERT() to work in ld script.
On Thu, Feb 15, 2001 at 10:56:48AM +1100, Alan Modra wrote:
> 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.
Sure, it's obvious now that I un-tarred the sources and had you
point it out. ;)
The source of my confusion was the info file referring to it as
a "command"
> 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?
I think the current usage is a bit counter-intuitive. One
solution would be to add a note to the info file entry.
--
Grant Edwards
grante@visi.com