Linker scripts

Michael Eager eager@eagercon.com
Sun Sep 10 20:21:00 GMT 2006


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...

There are a number of targets which pass linker scripts
to ld, along with whatever libraries or support files
(like crti.o) are needed.  The spec file insures that
the correct options are passed.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Gcc mailing list