This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: writing linker scripts...
On Sat, Apr 28, 2001 at 09:40:36AM +0100, Nick Clifton wrote:
> Hi Alan,
>
> > Nick,
> >
> > The -no-check-sections was just the ticket.
> >
> > Is there anyway to set that from inside the linker script, so that it's ALWAYS
> > asserted?
> >
> > I know I could make gcc always pass -Wl,-no-check-sections to every compile, but
> > I want to catch people who think that they can do 'ld' commands directly too.
>
> I thought about this at the time I wrote my original reply, but I do
> not believe that there is a way (currently) to do this.
Why not? I have done that in the gcc specs file before. You can add
%{!rcheck-sections: -no-check-sections}
to LINK_SPEC. Then you can do
# gcc ...
it will pass -no-check-sections to ld. When you do
# gcc -rcheck-sections ...
-no-check-sections won't be passed to ld. BTW, `r' is one of the
safe letters you can use for this purpose.
H.J.