>>94
if you link explicitly instead of letting gcc do it, you gain a lot of flexibility. dump
ld --help to a file and peruse it. there's lots of goodies there.
as for executable size, I don't think you can cut it down much below 2kb:
~% echo 'int hi(){puts("hello world");return 0;}' > test.c
~% i486-mingw32-gcc -Os -fomit-frame-pointer -c test.c
~% i486-mingw32-ld -s -O -init=hi test.o -lmsvcrt -o test.exe
~% wc -c test.exe
2048 test.exe
~% wine test.exe
hello world
naturally if you don't use
puts you can cut it down because you don't need to link anything. doing the same as above (except for the -lmsvcrt of course) I ended up with a 1536 byte file. far cry from the 15kb or even 5kb that
>>92 mentions, though it's certainly not 400 bytes it's not horrible either.
I know there's
some way to strip off the DOS mode header from the file, I did it before, but I don't remember how. this can save some space. collapsing .idata into .text would help too, but I don't think there's any way to do that with mingw unfortunately.