This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Linker scripts


On Sun, Sep 10, 2006 at 10:16:29PM +0200, Segher Boessenkool wrote:
> >GCC passes a linker script to the linker for some
> >targets (e.g., powerpc-eabi with -mads).  If you specify a
> >linker script using -Wl,-T,script.ld, you get both
> >passed to the linker and there may be conflicts.
> >
> >Is there any option to GCC which says to not pass
> >the predefined linker script to the linker?
> 
> If you use your own linker scripts, you really shouldn't use gcc
> to do the linking step; call ld directly, instead.  gcc has no
> idea what your linker script does, so it might well call ld with
> the wrong options...

This is wrong.  Always use GCC to do the linking.  It's simply
astounding the number of bugs I've seen that were caused by someone
thinking they knew everything they needed to invoke ld correctly;
GCC encapsulates this knowledge.

If some GCC configuration passes some specific option that is wrong,
then that GCC configuration is broken and a bug should be filed.

-- 
Daniel Jacobowitz
CodeSourcery


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