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