When building an executable file that uses dynamic linking,
the link editor adds a program header element of type
PT_INTERP to an executable file, telling the
system to invoke the dynamic linker as the program
interpreter. exec() and the dynamic linker
cooperate to create the process image for the program,
which entails the following actions:
The location(s) of the system provided dynamic
linker(s) are processor specific.
The link editor also constructs various data that assist
the dynamic linker for executable and shared object files.
As shown previously in
resides in loadable segments, making them available during
Adding the executable file's memory segments to the process image;
Adding shared object memory segments to the process image;
Performing relocations for the executable file and its
Closing the file descriptor that was used to read the
executable file, if one was given to the dynamic linker;
Transferring control to the program, making it look as if
the program had received control directly from
As explained in
``Program loading (processor-specific)'',
shared objects may
occupy virtual memory addresses that are different from the
addresses recorded in the file's program header table. The
dynamic linker relocates the memory image, updating
absolute addresses before the application gains control.
Although the absolute address values would be correct if
the library were loaded at the addresses specified in the
program header table, this normally is not the case.
.dynamic section with type
SHT_DYNAMIC holds various data. The structure
residing at the beginning of the section holds the
addresses of other dynamic linking information.
.hash section with type SHT_HASH
holds a symbol hash table.
.plt sections with
type SHT_PROGBITS hold two separate tables: the
global offset table and the procedure linkage table.
Sections below explain how the dynamic linker uses and
changes the tables to create memory images for object
If the process environment contains a variable named
with a non-null value the dynamic linker processes
all relocations before transferring control to the program.
``Checking for run-time compatibility''
for more information.
For example, all the following environment entries
would specify this behavior.
Otherwise, LD_BIND_NOW either does not occur in
the environment or has a null value. The dynamic linker is
permitted to evaluate procedure linkage table entries
slowly, thus avoiding symbol resolution and relocation
overhead for functions that are not called.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003