Incremental compilation with DMD

Walter Bright newshound1 at digitalmars.com
Fri Sep 18 00:50:34 PDT 2009


Tom S wrote:
> I tested it on a single-module program before posting. Basically void 
> main() {} and a single unused function void fooBar {}. With -g, 
> something with the function's mangled name ended up in the executable. 
> Without -g, the linker was able to remove the function (I ran a diff on 
> a compiled file with the function removed altogether from source).

The best way to determine what is linked in to an executable is to 
generate a map file with -L/map, and examine it. It will list all the 
symbols in it.

Also, if you specify a .obj file directly to the linker, it will put all 
of the symbols and data in that .obj file into the executable. The 
linker does NOT remove functions.

What it DOES do is pull obj files out of a library to resolve unresolved 
symbols from other obj files already linked in.

In other words, it's an additive process, not a subtractive one.



More information about the Digitalmars-d mailing list