gcc plain binary format

cihan cihan at edu.enderunix.org
Thu Apr 5 23:21:18 UTC 2007


Hi all 

How can I convert c source code to plain binary file?
gcc -s -o foo.S foo.c
as -o foo.o foo.S
ld -Ttext 0x0 -e main -s --oformat binary -o foo.bin foo.o 

But I give linker error like a "undefined reference to putchar"
then I tried 

ld -Ttext 0x0 -e main -s --oformat binary -o foo.bin foo.o -lc
It give me this error
"/usr/lib/libc.so: could not read symbols: invalid operation" 


Cihan Kömeçoğlu 

Enderunix Edu ST
www.enderunix.org


More information about the freebsd-hackers mailing list