Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
LDCONFIG(8)		FreeBSD	System Manager's Manual		   LDCONFIG(8)

NAME
     ldconfig -- configure the dynamic linker search path for shared libraries

SYNOPSIS
     ldconfig [-32] [-Rimrv] [-f hints_file] [directory	| file ...]

DESCRIPTION
     ldconfig utility is used to configure the set of paths used by the	dy-
     namic linker ld-elf.so.1(1) when searching	for shared libraries.  The dy-
     namic linker looks	for libraries in a set of built-in system directories
     and any directories specified in the hints	file.  This obviates the need
     for storing search	paths within the executable, see the -rpath option for
     the static	linker ld(1).

     The hints file is maintained by ldconfig.	The directories	list to	be
     stored in the hints file is supplied on the command line.

     Alternatively to the directories list on the command line,	files may be
     specified;	these are expected to contain directories to scan for shared
     libraries.	 Each directory's pathname must	start on a new line.  Blank
     lines and lines starting with the comment character `#' are ignored.

     For security reasons, directories which are world or group-writable or
     which are not owned by root produce warning messages and are skipped, un-
     less the -i option	is present.

     The LD_LIBRARY_PATH environment variable can be used to specify addi-
     tional shared library search directories.	LD_LIBRARY_PATH	is a `:' sepa-
     rated list	of directory paths which are searched by the dynamic linker
     when it needs to load a shared library.  It can be	viewed as the run-time
     equivalent	of the -L switch of ld(1).

     The following options are recognized by ldconfig:

     -32     Generate the hints	for 32-bit ABI shared libraries	on 64-bit sys-
	     tems that support running 32-bit binaries.

     -elf    Ignored for backwards compatibility.

     -R	     Appends pathnames on the command line to the directory list from
	     the hints file.

	     This is the default action	when no	options	are given.

     -f	hints_file
	     Read and/or update	the specified hints file, instead of the stan-
	     dard file.	 This option is	provided primarily for testing.

     -i	     Run in insecure mode.  The	security checks	will not be performed.

     -m	     Instead of	replacing the list of the directories to search	with
	     the directories specified on the command line, merge existing
	     list with the specified directories, and write the	result to the
	     hints file.

     -r	     List the current list of the directories from the hints file on
	     the standard output.  The hints file is not modified.

	     Scan and print all	libraries found	on the directories list.

     -v	     Switch on verbose mode.

SECURITY
     Special care must be taken	when loading shared libraries into the address
     space of set-user-Id programs.  Whenever such a program is	run by any
     user except the owner of the program, the dynamic linker will only	load
     shared libraries from paths found in the hints file.  In particular, the
     LD_LIBRARY_PATH is	not used to search for libraries.  Thus, ldconfig
     serves to specify the trusted collection of directories from which	shared
     objects can be safely loaded.

FILES
     /var/run/ld-elf.so.hints	  Standard hints file for the ELF dynamic
				  linker.
     /etc/ld-elf.so.conf	  Conventional configuration file containing
				  directory names for invocations with -elf.
     /var/run/ld-elf32.so.hints	  Conventional configuration files containing
				  directory names for invocations with -32.

SEE ALSO
     ld(1), ld-elf.so.1, link(5)

HISTORY
     A ldconfig	utility	first appeared in SunOS	4.0, it	appeared in its	cur-
     rent form in FreeBSD 1.1.

     The name 'hints file' is historic from the	times when the file also con-
     tained hints to the dynamic linker.  This functionality is	not provided
     for ELF.

FreeBSD	13.0			 May 15, 2021			  FreeBSD 13.0

NAME | SYNOPSIS | DESCRIPTION | SECURITY | FILES | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=ldconfig&sektion=8&manpath=FreeBSD+13.1-RELEASE>

home | help