This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: Proper way of replacing crt0.o/GCC search path for startup files
- From: "Schwarz, Konrad" <konrad dot schwarz at siemens dot com>
- To: David Paterson <dnpaterson at gmail dot com>
- Cc: Nicholas Clifton <nickc at redhat dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Mon, 18 May 2015 10:42:11 +0000
- Subject: RE: Proper way of replacing crt0.o/GCC search path for startup files
- Authentication-results: sourceware.org; auth=none
- References: <A45B1767F1002449A37508C2CC6003D711E2CB at DEFTHW99EJ1MSX dot ww902 dot siemens dot net> <55508869 dot 5000908 at redhat dot com> <A45B1767F1002449A37508C2CC6003D71210D3 at DEFTHW99EJ1MSX dot ww902 dot siemens dot net> <CAM1kHc1wEdmHNLzamZS8ya6xf24nH7uz1sRszvskk+icyRBmHA at mail dot gmail dot com>
> -----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
>