DMD1 binaries a lot bigger than DMD2 due to weird zero blocks?
Don
nospam at nospam.com
Thu Aug 5 00:06:55 PDT 2010
Vladimir Panteleev wrote:
> Consider a simple "Hello, world" program:
> When compiled with DMD 1.062 and DMD 2.047:
>
> C:\Downloads\dmd.1.062\dmd\windows\bin> dmd hello.d
> C:\Downloads\dmd.1.062\dmd\windows\bin> ls -l hello.exe
> -rwxrwxrwx 1 Vladimir 0 177180 2010-08-05 02:17 hello.exe
>
> C:\Downloads\dmd.2.047\dmd2\windows\bin> dmd hello.d
> C:\Downloads\dmd.2.047\dmd2\windows\bin> ls -l hello.exe
> -rwxrwxrwx 1 Vladimir 0 101404 2010-08-05 02:19 hello.exe
>
> Notice that there is a 74 KB difference. A quick look with a hex editor
> / disassembler reveals multiple zero-filled blocks between functions.
>
> What is causing this? Both versions use the same linker, so it would
> have to be caused by DMD or the precompiled libraries?
>
It _might_ be caused by bug 1914, which was fixed in D2, but the patch
was not applied to D1. An n-element array literal gets stored n times in
the exe...
More information about the Digitalmars-d
mailing list