Make the compiled ASM binary small?
Posted: Mon Jun 01, 2009 9:44 pm
Hi,
I am writing some (32bit) ASM code, and compile it with gcc. The output binary is quite big, however. I want to make it as small as possible.
The current gcc options I am using is like:
gcc -nostdlib -fno-builtin -c a.S -o a.bin
And the size of a.bin is around 400 bytes.
I am sure I can reduce the size of a.bin, as the similar code compiled with nasm has the size of only 123 bytes.
Which gcc options should I use now?
Thanks a lot,
J
I am writing some (32bit) ASM code, and compile it with gcc. The output binary is quite big, however. I want to make it as small as possible.
The current gcc options I am using is like:
gcc -nostdlib -fno-builtin -c a.S -o a.bin
And the size of a.bin is around 400 bytes.
I am sure I can reduce the size of a.bin, as the similar code compiled with nasm has the size of only 123 bytes.
Which gcc options should I use now?
Thanks a lot,
J