To Preset Or Not To Preset, And Creation Of The Lic - HP eld Manual

Table of Contents

Advertisement

Binding of References
To Preset or Not to Preset, and Creation of the
LIC
LIC is the 'Library Import Characterisation', a section in the object file that encodes
information about the current loadfile, plus each DLL or import library that was used to
do the presetting, in the search list order, noting its export digest and whether it was
used to resolve any references. The LIC is essentially a data string that characterizes
the information used by a linker or loader to bind the global symbols of a particular
loadfile. If the same loadfile is bound on two occasions, and its LIC has not changed,
the two bindings are the same. Thus it is possible to reuse a set of bindings if it has the
same LIC as that determined for this loadlfile in the presence of the other loadfiles with
which it is being loaded.
By default, the linker tries to preset the loadfile that it is creating. The following are
reasons why the linker will decide not to preset:
The linker will not preset if the -no_preset option is specified.
The linker will not preset if there is any address overlap among the DLLs or import
libraries in the search list, including this file itself. If there are any overlaps then the
linker emits a warning message. The linker always checks for this among the DLLs and
import libraries that it has opened, even if it is not trying to preset. However, the linker
does not check for overlap against the import library that represents the set of implicit
libraries (because, it can be assumed that the implicit libraries have been correctly built
in a separate place). Also, when some DLL has the same filename as the user library,
and their memory segments overlap, the linker does not consider that a reason to stop
presetting.
The linker will decide not to preset if it was unable to locate an item specified in a -l
option in the command stream or in a .liblist section entry of a DLL.
The linker will decide not to preset if this is a program that has a user library, but the
linker was unable to open the user library.
The linker will decide not to preset if it encountered any incomplete import libraries.
The linker will also decide not to preset in certain cases if there are unresolved
references, as explained in
The linker sets the EF_TANDEM_PRESET bit in the e_flags field of the ELF header of
the loadfile to tell that it was preset.
When the linker presets a file it calculates the LIC and stores it in the .lic section. The
LIC encodes information about this loadfile itself, plus each DLL or import library that
was used to do the presetting, in the search list order, noting its export digest and
whether it was used to resolve any references. Thus, the LIC begins with an entry for
this loadfile itself, then has an entry for the user library if this is a program that has a
user library, then has entries for each of the elements of the .liblist section, then has
entries for each of the additional elements the linker found by pursuing the transitive
closure of .liblist sections, and then has an entry for the import library that represents

To Preset or Not to Preset, and Creation of the LIC

Handling Unresolved References
eld Manual—527255-009
3-7
on page 3-8.

Advertisement

Table of Contents
loading

Table of Contents