14.2 Overview

LINK combines 80x86 object files into either an executable file or a dynamic-link library (DLL). The object-file format is the Microsoft Relocatable Object-Module Format (OMF), which is based on the Intel 8086 OMF. LINK uses library files in Microsoft library format.

LINK creates “relocatable” executable files and DLLs. The operating system can load and execute relocatable files in any unused section of memory. LINK can create DOS executable files with up to 1 megabyte of code and data (or up to 16 megabytes when using overlays). It can create segmented executable files with up to 16 megabytes.

For more information on the OMF, the executable-file format, and the linking process, see the MS-DOS Encyclopedia.

Summary: Use EXEHDR to examine the finished file.

When the file (either executable or DLL) is created, you can examine the information that LINK puts in the file's header by using the Microsoft EXE File Header Utility (EXEHDR). For more information on EXEHDR, see Chapter 17.

Summary: Other programs can call LINK automatically.

The Microsoft Programmer's WorkBench (PWB) invokes LINK to create the final executable file or DLL. Therefore, if you develop your software with PWB, you might not need to read this chapter. However, the detailed explanations of LINK options might be helpful when you use the LINK Options dialog box in PWB. This information is also available in Help.

The compiler or assembler supplied with your language (CL with C, FL with FORTRAN, ML with MASM) also invokes LINK. You can use most of the LINK options described in this chapter with the compiler or assembler. The Microsoft Advisor has more information about the compilers and assembler; select Help for the appropriate language from the Command Line box of the Help Contents screen.

Note:

Unless otherwise noted, all references to “library” in this chapter refer to a static library. This can be either a standard library created by the Microsoft Library Manager (LIB) or an import library created by the Microsoft Import Library Manager (IMPLIB), but not a DLL.