LIBCHK(1) FreeBSD General Commands Manual LIBCHK(1)
NAME
libchk β checks shared library links of binaries
SYNOPSIS
libchk [ββhsv] [ββx directory] [directory ...]
DESCRIPTION
libchk is a tool to help users obtain the following information:
ββ A list of executables that have unresolvable shared library
links
ββ A list of shared libraries that are not referenced by any
binary
ββ A list of binaries for each shared library that are linked with
the library
Directories that libchk searches for executables and libraries include:
/bin
/sbin
/usr/bin
/usr/games
/usr/libexec
/usr/sbin
$LOCALBASE/bin
$LOCALBASE/libexec
$LOCALBASE/sbin
$X11BASE/bin
$X11BASE/libexec
$X11BASE/sbin
And the directories listed in PATH and the library search path that
ldconfig(8) tells. In addition, a user can specify additional directoβ
ries to search via the command line.
e.g.:
$ libchk /home/*/bin
The directory list is automatically optimized to avoid duplicated search.
libchk recursively looks into those directories and checks shared library
links for each binary. If a dead library link is found, it is immediβ
ately reported.
When it is done though all directories, libchk lists the shared libraries
in the library search path that are not referenced by (linked with) any
binary.
WARNING
Do not blindly delete libraries that libchk reports as unreferenced,
because there are many reasons that libchk cannot perfectly detect if a
shared library is referenced by:
ββ A library may be referenced by an executable hidden under a
user directory or an application specific directory.
ββ A library may be put there for future use.
ββ A library on an NFS exported or NFS mounted file system may be
referenced by an executable on another host.
ββ A library can be dynamically linked with by calling dlopen(3),
which libchk can never detect.
OPTIONS
The following command line arguments are supported:
ββs
ββββstrict By default, libchk does not regard a reference to a library in
the same directory as dead, but this option makes libchk warn
of that as well.
ββv
ββββverbose Make a detailed report. libchk will also check and report
what executables and libraries each library is referenced
(used) by.
ββx directory
ββββexclude directory
Exclude the specified directory from the list of directories
that libchk searches for executables and libraries.
directory ...
Additional directories to search for binaries.
ENVIRONMENT
PATH The command search path.
LOCALBASE The local base directory. (default: /usr/local)
X11BASE The X11 base directory. (default: /usr/X11R6)
SEE ALSO
ldconfig(8)
BUGS
ββ Currently, libchk only checks FreeBSD ELF executables and libraries.
AUTHORS
Akinori MUSHA β¨knu@iDaemons.orgβ©
FreeBSD September 2, 2002 FreeBSD