This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: Proper way of replacing crt0.o/GCC search path for startup files


> -----Original Message-----
> From: Nicholas Clifton [mailto:nickc@redhat.com]
> > I have written an alternative crt0.o (the startup file placed at
> the
> > beginning of the executable) for a bare-metal system.
> >
> > For GCC to use this, it requires a new specs file.
> 
> Have you considered using --nostartfiles instead ?

I think this would require getting the user to explicitly add
<gcc-startup-dir>/crti.o and <gcc-startup-dir>/crtbegin.o, in addition
to the special crt0.o, to the link, and seems more painful.

> > I was unable to find precise documentation on how GCC searches for
> > specs files and for startup files.  It seems like directories added
> by
> > -L are not searched for spec or startup files, for example.  (I.e.,
> > my_crt0%o%s was not found by GCC, despite an appropriate -L
> argument).
> 
> Have you tried using -B instead of -L ?

-B seems to change a lot more things.

In any case, thanks very much for your suggestions!

Regards

Konrad


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