It will give me this error:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../crt1.o:(.text+0x0):
first defined here
So how to stop gcc using its build-in crt.o?
thanks
from Peter (cmk...@hotmail.com)
ok, may be I know the answer now. if your type in "ld --verbose", you
will see the build-in linker script, and it used the buildin crt.o. If
I compile it by my own linker script, then I can force gcc to use my
own crt.o.
correct me if I am wrong. thanks
I think you could also specify a parameter like -nostdlib to force it
not to link in the standard libraries.
Alex
Or just invoke "ld" yourself and skip the hassle of battling gcc.
--
Andy Valencia
Home page: http://www.vsta.org/andy/
To contact me: http://www.vsta.org/contact/andy.html
After I can load ELF in my OS, then I probably can move some
foundation library from linux, hopefully can finish it before 2012, my
progress is very slow.
thanks for the answers
thanks
If you're wanting to create a kernel without crt.o you could link
with LD instead of letting GCC call LD to do the linking. With
LD you can create a linker script which also allows you to
specify where each section of the executable should be loaded as
well as specify the entry point.
If you want to specify your own crt.o when compiling applications
then you can create your own target when making a cross-compiler.
Look through the configuration files in GCC an Binutils for some
of the simpler OSes, and duplicate what they do, replacing with
your own OS's name. I think there is a few config files where
you can specify your own crt0.o and load address that GCC/LD
will use in the default linker script.
--
Marv