-ffreestanding option of GCC
Ian Lance Taylor
iant@google.com
Wed Jan 5 16:50:00 GMT 2011
ali hagigat <hagigatali@gmail.com> writes:
> Although i specified compiling in a free standing environment but
> still libc.so, libgcc.so (-lc and -lgcc) and some other strange object
> files are being linked with my program like ccYT96w6.o, crt1.o,
> crtend.o...
> Why?
> Can i get rid of all of them some how?
> My interpretation of free standing was a program which does not depend
> on any external files, but why many files are here besides my file?
The -ffreestanding option directs the compiler to not assume that
standard functions have their usual definition, and to not assign any
special semantics to the function main. It does not change the linking
behaviour. You are looking for the -nostdlib option, or possibly
-nostartfiles or -nodefaultlibs.
Ian
More information about the Gcc-help
mailing list