ild is invoked automatically by the compilation system in place of ld under certain conditions. When you invoke a compilation system, you are invoking a compiler driver. When you pass certain options to the driver, the driver uses ild. The compiler driver reads the options from the command line and executes various programs in the correct order and adds files from the list of arguments that are passed.
For example, cc first runs acomp (the front-end of the compiler), then acomp runs the optimizing code generator, then cc does the same thing for the other source files listed on the command line. The driver then generates a call to either ild or ld, depending on the options, passing it all of the files just compiled, plus other files and libraries needed to make the program complete
Figure B-1 shows an example of incremental linking.
.
The compilation system options that control whether a link step is performed by ild or ld are listed here:
-xildon Always use ild
-xildoff Always use ld
If -xildon and -xildoff are both present, the last governs.
-g When neither -xildoff or -G are given, use ild for link-only invocations (no source files on the command line)
-G Prevents the -g option from having any effect on linker selection
Both -g and -G have other meanings which are documented as part of the compilation systems.
When you use the -g option to invoke debugging, and you have the default Makefile structure (which includes compile-time options such as -g on the link command line), you use ild automatically when doing development.