GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • OpenBSD

This view

  • Original page
  • New address

GeezerVison is showing man.openbsd.org — ld.so(1) - OpenBSD manual pages

NAME

ld.so — run-time link-editor

DESCRIPTION

ld.so is a self-contained, position independent program image providing run-time support for loading and link-editing shared objects into a process's address space. It uses the data structures (see elf(5)) contained within dynamically linked programs to determine which shared libraries are needed and loads them at a convenient virtual address using the mmap(2) system call.

After all shared libraries have been successfully loaded, ld.so proceeds to resolve external references from both the main program and all objects loaded. A mechanism is provided for initialization routines to be called, on a per-object basis, giving a shared object an opportunity to perform any extra set-up, before execution of the program proper begins.

ld.so is itself a shared object that is initially loaded by the kernel.

To quickly locate the required shared objects in the filesystem, ld.so may use a “hints” file, prepared by the ldconfig(8) utility, in which the full path specification of the shared objects can be looked up by hashing on the 3-tuple ⟨library-name, major-version-number, minor-version-number⟩.

ld.so searches for shared objects in the following lists of paths:

  1. LD_LIBRARY_PATH environment variable if set
  2. DT_RUNPATH of the calling object if set, otherwise:
    1. DT_RPATH of the calling object if set
    2. DT_RPATH of the program if set
    (The use of DT_RPATH is deprecated as its behaviour varies across operating systems.)
  3. default search path set by ldconfig(8)
  4. /usr/lib

ld.so recognises a number of environment variables that can be used to modify its behaviour as follows:

LD_LIBRARY_PATH
A colon separated list of directories, prepending the default search path for shared libraries.

LD_PRELOAD
A colon separated list of library names to load before any of the regular libraries are loaded.

LD_BIND_NOW
Specifies that the dynamic linker should process all relocations before transferring control to the program. Normally, the procedure linkage table entries are handled lazily, avoiding symbol lookup and relocation for unused functions.

LD_TRACE_LOADED_OBJECTS
When set, causes ld.so to exit after loading the shared objects and printing a summary which includes the absolute pathnames of all objects, to standard output.

Many of these environment variables are ignored for executables with set-user-ID, set-group-ID, or which are not readable.

FILES

/var/run/ld.so.hints
library location hints built by ldconfig(8)

SEE ALSO

ld(1), ldd(1), elf(5), ldconfig(8)

HISTORY

The shared library model employed first appeared in SunOS 4.0.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.