Mail Archives: djgpp/1997/09/09/05:21:06
On 9 Sep 97 at 6:37, David Orme wrote:
> Why are the programs I compile using BNU281 are larger than those
> compiled under BNU27?
>
>
> I do this (please tell me if I'm doing something redundant or
> wrong):
>
> gcc -O3 -m486 source.c -o dest.exe
> strip dest.exe
> stubify dest.exe
The stubify is redundant because linking with gcc calls stubify for
you.
Is the difference just shy of 2k (168 bytes I think)? If so, then it
is because of the `strip dest.exe' command. bnu 2.8.1 (maybe 2.8)
aligns coff sections to 4k, and as binutils groks the stub (hence
strip working), the coff section get written out with at 4k
boundaries. In other words, the file strip writes out has a slightly
different format to what it read in, not counting the symbols.
***IMPORTANT NOTE*** DO NOT RUN DJP on a binutils 2.8 modified exe.
djp doesn't handle the sections being moved about. (I know from
experience, it bit me hard!!!). This is not a bug in binutils, but
an incompatability between djp and the new binutils. If you instead
use:
gcc -O3 -m486 source.c -o dest.exe
strip dest
stubify dest
djp dest.exe
there will be no problems with the shifting sections, as they will be
properly aligned in the file when strip sees them.
HTH
Bill
--
Leave others their otherness.
- Raw text -