Linker Parameters

When the linker is run, it must be given the name of the main module of the program, as its only command line parameter. The linker then reads further parameters from a file with the same name as the module, plus a ".lnk" extension or, alternatively, a ".lkr" extension. The use of the extension is significant to the compiler, which invokes the linker if is compiling a file with an associated linker parameter file bearing the ".lnk" extension.

The contents of the linker parameter file must be a list of the names of the all the modules imported, directly or indirectly, from the main module of the program being linked. For example, if the file contains

  [main mod1 modb]
the linker is instructed to link together modules main, mod1, and modb, to form an executable corresponding to the program and bearing the same name as the main module.

All the modules being linked together must have been compiled into object files by the compiler, and must reside in the same directory, which should be the current directory when the linker is invoked.

Predefined library modules, such as opsys, which are located together with the compiler, must be mentioned in a second list. For example:

  [main mod1 modb] [opsys]

I realize that this is a clumsy way of doing things and plan to do away with compiling and linking in the future. Meanwhile, the interpreter offers an alternative.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.