INF: Link Method May Cause Unexpected Increase in .EXE Size

ID Number: Q58689

3.x 4.x 5.0x 5.10 5.11 5.13 5.15 | 5.0x 5.10 5.11 5.13 5.15

MS-DOS | OS/2

Summary:

The method used to link a program will determine the size of the

resulting executable file. For example, a program linked with the

following command

link file1.obj file2.obj library.lib;

results in an .EXE that is much larger than the resulting .EXE from

the following LINK command:

link file1.obj file2.obj,,,library.lib;

More Information:

This is expected behavior.

The first method has the library name in the same field as the object

files. Libraries entered in this field are called "load libraries" as

opposed to "regular libraries." LINK automatically links in every

object module in a load library; it does not search for unresolved

external references first.

The effect of using a load library is exactly the same as if you had

entered all the names of the library's object modules as separate

object files on the LINK command line. This feature is useful if you

are developing software using many modules and want to avoid having to

retype each module on the LINK command line.

With the second method, LINK links in only the objects from the

library that are required for program execution.

For more information, refer to Article 20 of the "MS-DOS

Encyclopedia," particularly pages 701-702.

Additional reference words: 1.08 1.10 2.00 2.01 2.10 2.40 2.41 2.44

2.50 3.00 3.01 3.02 3.04 3.05 3.06 3.51 3.55 3.60 3.61 3.64 3.65 3.69

4.06 4.07 4.10 5.01.20 5.01.21 5.02 5.03 5.05 5.10 5.11 5.13 5.15