How the Linker Resolves External References

ID Number: Q31998

3.x 5.x

MS-DOS

Summary:

Define a pass through a library as follows:

1. Find all modules in the library that define current unresolved

externals.

2. Process those modules (you may pick up more unresolved

externals).

The linker keeps making passes through the library until no new

unresolved externals are picked up. It then advances to the next

library.

In a similar manner, the linker makes a pass through the entire set of

libraries. After the last library is searched, if new unresolved

externals have been picked up, it returns to the first library and

makes another pass.

Problems can be avoided if you do not use bidirectional cross-library

references (i.e., avoid library A calling something in library B that

calls something else in library A). Try to make each library as

self-contained as possible.

For more information, refer to Page 704 of the "MS-DOS Encyclopedia,

Article: 20."