
Binding of References
eld Manual—527255-009
3-15
Ignoring Optional Libraries
the omitted .liblist entries had never been present. For example, some of the DLL's in
the search list addition set of such a .liblist entry may still be present in the LIC, and
some not, and if present their positions in the LIC may change, depending on other
ways of getting to those DLL's indirectly.
When some elements of the .liblist section have been omitted, with corresponding
changes to the LIC if present, we say that the .liblist and LIC have been abbreviated.
Note that
eld
always does this
-optional_lib
processing. It doesn't depend, for
example, on whether
eld
is presetting the loadfile.
If all the same direct and indirect DLL's as were found by the linker would also have
been found at runtime regardless of whether the .liblist was abbreviated, as described
above, and all these DLL's would have been found in the same order and with the
same export digests, then the linker's presetting would give the same results as what
would happen at runtime with no such abbreviation. In this case, the -optional_lib
option is just an optimization, preventing some DLL's from being loaded into a process
when those DLL's would not have affected how the loadfile would be fixed up when it
was loaded into memory. The abbreviated LIC, if present, corresponding to the
abbreviated .liblist, will similarly lead to the conclusion that the linker fixed up all the
reference sites correctly, so the file can run without being rebound at load time (except,
of course, that references to globalized symbols always need to be rebound).
In other cases, the use of the
-optional_lib
option is not just an optimization, but
rather can cause the loadfile to run differently. These are the cases where the DLL's
that were omitted from the abbreviated .liblist or abbreviated LIC would have been
found at runtime, and would have had different export digests from the ones that the
linker saw, or would have been found in a different order, or would have indirectly
brought in other DLL's that the linker didn't see. In such cases, the abbreviated .liblist
and abbreviated LIC might lead to the conclusion that the file was fixed up correctly by
the linker, and allowed to run without being rebound, even though if it were rebound at
load time based on a .liblist that had not been abbreviated then some of the bindings
might have been different. Or, if the abbreviated .liblist and abbreviated LIC don't lead
to the conclusion that the file had been correctly fixed up by the linker, the file is
rebound at load time, but the use of the abbreviated .liblist could still lead to different
bindings from what would have occurred with a .liblist that was not abbreviated.
The use of the
-optional_lib
option can also affect how things are fixed up at load
time with regard to globalized symbols, because
eld
does not take globalized symbols
into account when it decides which DLL's are unnecessary.
Also, even if the abbreviated .liblist and LIC don't affect how the loadfile itself is fixed
up at load time, the abbreviations will result in different DLL's being present in memory,
or being loaded in a different order, in a way that could cause the dlsym runtime routine
to give different results.
In any case, the use of the
-optional_lib
option can affect a program's semantics,
so it should not be used unless the consequences are understood.
A special case is when
eld
finds a DLL on the command line that is the same file as
what was specified for the user library. In such a case, an entry is still made in the
Summary of Contents for eld
Page 4: ......
Page 8: ...Contents eld Manual 527255 009 iv ...
Page 12: ...What s New in This Manual eld Manual 527255 009 viii Changes to the 527255 005 Manual ...
Page 34: ...Introduction to eld eld Manual 527255 009 1 14 Example of Use ...
Page 54: ...eld Input and Output eld Manual 527255 009 2 20 Using Archives ...
Page 98: ...Other eld Processing eld Manual 527255 009 4 20 Merging Source RTDUs ...
Page 242: ...Output Listings and Error Handling eld Manual 527255 009 6 132 Glossary of Errors ...