Home | History | Annotate | Line # | Download | only in ldconfig
ldconfig.8 revision 1.2
      1 .Dd October 3, 1993
      2 .Dt LDCONFIG 8
      3 .Os NetBSD 0.9
      4 .Sh NAME
      5 .Nm ldconfig
      6 .Nd configure the shared library cache
      7 .Sh SYNOPSIS
      8 .Nm ldconfig
      9 .Op Fl rsv
     10 .Op Ar directory Ar ...
     11 .Sh DESCRIPTION
     12 .Nm
     13 is used to prepare a set of
     14 .Dq hints
     15 for use by the run-time linker
     16 .Xr ld.so
     17 to facilitate quick lookup of shared libraries available in multiple
     18 directories.  It scans a set of built-in system directories and any
     19 .Ar directories
     20 specified on the command line (in the given order) looking for shared
     21 libraries and stores the results in the file
     22 .Xr /var/run/ld.so.hints
     23 to forestall the overhead that would otherwise result from the
     24 directory search operations
     25 .Xr ld.so
     26 would have to perform to load the required shared libraries.
     27 .Pp
     28 The shared libraries so found will be automatically available for loading
     29 if needed by the program being prepared for execution. This obviates the need
     30 for storing search paths within the executable.
     31 .Pp
     32 The
     33 .Ev LD_LIBRARY_PATH
     34 environment variable can be used to override the use of
     35 directories (or the order thereof) from the cache or to specify additional
     36 directories where shared libraries might be found.
     37 .Ev LD_LIBRARY_PATH
     38 is a
     39 .Sq \:
     40 separated list of directory paths which are searched by
     41 .Xr ld.so
     42 when it needs to load a shared library. It can be viewed as the run-time
     43 equivalent of the
     44 .Fl L
     45 switch of
     46 .Xr ld.
     47 .Pp
     48 .Nm Ldconfig
     49 is typically run as part of the boot sequence.
     50 .Pp
     51 The following options recognized by
     52 .Nm ldconfig:
     53 .Bl -tag -width indent
     54 .It Fl r
     55 Lists the current contents of
     56 .Xr ld.so.hints
     57 on the standard output. The hints file will not be modified.
     58 .It Fl s
     59 Do not scan the built-in system directory
     60 .Pq Dq /usr/lib
     61 for shared libraries.
     62 .It Fl v
     63 Switch on verbose mode.
     64 .Sh Security
     65 Special care must be taken when loading shared libraries into the address
     66 space of
     67 .Ev set-user-Id
     68 programs. Whenever such a program is run,
     69 .Xr ld.so
     70 will only load shared libraries from the
     71 .Ev ld.so.hints
     72 file. In particular, the
     73 .Ev LD_LIBRARY_PATH
     74 is not used to search for libraries. Thus, the role of ldconfig is dual. In
     75 addition to building a set of hints for quick lookup, it also serves to
     76 specify the trusted collection of directories from which shared objects can
     77 be safely loaded. It is presumed that the set of directories specified to
     78 .Nm ldconfig
     79 are under control of the system's administrator.
     80 .Xr ld.so
     81 further assists set-user-Id programs by erasing the
     82 .Ev LD_LIBRARY_PATH
     83 from the environment.
     84 
     85 .Sh FILES
     86 .Xr /var/run/ld.so.hints
     87 .Sh SEE ALSO
     88 .Xr ld 1 ,
     89 .Xr link 5
     90 .Sh HISTORY
     91 A
     92 .Nm
     93 utility first appeared in SunOS 4.0, it appeared in its current form
     94 in NetBSD 0.9a.
     95