Direct import of Dynamic Link Libraries
Care should be taken on importing DLLs. The mechanism is designed to replace the
importation of "pure" import libraries. It is possible that the .LIB
file contains loadable library code in addition to the imported symbol. In such
cases, the loadable library code is missing from the DLL and so cannot be
loaded. SALFLIBC.LIB is such a library, the DLL SALFLIBC.DLL cannot be loaded
directly since it does not contain, for example, the symbol _SALFStartup which
is necessary for initialisation and to provide the application's entry point.
Direct import of dynamic link libraries require that the exported names in the
DLL follow the following rules
The exported name is created by removing the leading
underscore and does not contain the appended @ and subsequent characters
will be exported as
Symbols beginning with a leading underscore
The leading underscore is removed.
All other symbols are assumed to be exported
Archive and import library generation
Archives and import libraries may be generated without any objects being loaded
For example the following SLINK script will generate a combined RLB and import
library. Note that the
command is necessary to initiate the build. Ignore the comments in brackets
file to be called mylib.LIB)
name set to mylib.DLL)
The executable file needs an entry point that is called by the system loader
immediately after the program has been loaded. This entry point is not the
function as you may think, but library startup code. The Silverfrost entry point
for all executables, including DLLs is _SALFStartup. Object files produced by
other compilers will have a different entry point which you will have to set
The entry point is specified with the
command, omitting the leading underscore. SLINK will automatically set the entry
point to be _SALFStartup unless you use the
before any objects files have been
loaded. In command line mode the
command can be placed anywhere in the command line or script file since commands
are always processed first.
e.g. The following command will set the entry point to be _SALFStartup. This is
redundant since SLINK will do this for you.
You cannot change the entry point after the first object file has been loaded or
entry command has previously been used.