Proper way of replacing crt0.o/GCC search path for startup files

Schwarz, Konrad konrad.schwarz@siemens.com
Tue May 19 18:48:00 GMT 2015


> -----Original Message-----
> From: David Paterson [mailto:dnpaterson@gmail.com]
> Sent: Montag, 18. Mai 2015 12:09
> To: Schwarz, Konrad
> Cc: Nicholas Clifton; newlib@sourceware.org
> Subject: Re: Proper way of replacing crt0.o/GCC search path for
> startup files
> 
> Hi Konrad,
> 
> I've done something similar, and used a customised linker script to
> provide extra information (as well as the memory mapping for my
> particular system).  The linker scrip I'm using has commands similar
> to :
> 
>     ENTRY(_start)
>     STARTUP(my-crt0.o)
>     INPUT(crti.o crtbegin.o crtend.o crtn.o)
>     GROUP(-lmylib -lc -lstdc++ -lgcc)
> 
> and is invoked by using gcc -nostartfiles -Tmyscript.ld ... etc.

Hi David,

thanks for the suggestion.  As it turns out, I already have a custom linker script
for an orthogonal part of the system; but of course I could add another.

As my spec file solution works, is fairly tiny, and includes (re-uses) the nosys spec file,
I'll leave it for now and remember your solution as a fall back.
Libgloss uses the spec file solution, so its use to map to different
sorts of hardware should be familiar to users of newlib.

Konrad

> 
> To me, this seemed the easiest way to include my crt0, rather than
> modifying spec files.
> 
> Regards,
> 
> DavidP
> 



More information about the Newlib mailing list