DMD1 binaries a lot bigger than DMD2 due to weird zero blocks?

Vladimir Panteleev vladimir at thecybershadow.net
Wed Aug 4 16:23:20 PDT 2010


Consider a simple "Hello, world" program:

import std.c.stdio;

void main()
{
	printf("Hello, world!\n");
}

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?

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list