LDCONFIG
Section: Linux Programmer's Manual (8)
Updated: 2020-06-09
Index
JM Home Page
roff page
 
名前
ldconfig - 動的リンカーによる実行時の結合関係を設定する
 
書式
/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r
root] directory...
/sbin/ldconfig -l [-v] library...
/sbin/ldconfig -p
 
説明
ldconfig creates the necessary links and cache to the most recent shared
libraries found in the directories specified on the command line, in the
file /etc/ld.so.conf, and in the trusted directories, /lib and
/usr/lib (on some 64-bit architectures such as x86-64, /lib and
/usr/lib are the trusted directories for 32-bit libraries, while
/lib64 and /usr/lib64 are used for 64-bit libraries).
キャッシュは実行時リンカー ld.so または ld-linux.so によって使われる。 ldconfig
は処理するライブラリのヘッダー部分とファイル名をチェックし、 どのバージョンに対してリンクを更新すべきかを判断する。
ldconfig は ELF ライブラリの種類 (libc5 か libc6/glibc か) を判断するとき、 そのライブラリがリンクしている
C ライブラリを参考にする。
すでに存在しているライブラリの中には、種類を区別するために充分な 情報が含まれていないものもある。 このため /etc/ld.so.conf
ファイルでライブラリの形式を指定することができるようになっている。 これは区別不能な ELF ライブラリ「だけ」に用いるものである。 フォーマットは
"dirname=TYPE" とする。 ここで TYPE は libc4, libc5, libc6 のいずれかである
(この書式はコマンドラインでも使える)。 「スペースを入れてはならない」。 -p オプションも見ておくこと。 ldconfig
は通常スーパーユーザー権限で実行しなければならない。 root が所有しているディレクトリやファイルへの書き込み権限が 必要になるからである。
Note that ldconfig will only look at files that are named lib*.so*
(for regular shared objects) or ld-*.so* (for the dynamic loader
itself).  Other files will be ignored.  Also, ldconfig expects a certain
pattern to how the symlinks are set up, like this example, where the middle
file (libfoo.so.1 here) is the SONAME for the library:
libfoo.so -> libfoo.so.1 -> libfoo.so.1.12
Failure to follow this pattern may result in compatibility issues after an
upgrade.
 
オプション
- -c fmt, --format=fmt
 - 
(Since glibc 2.2)  Cache format to use: old, new, or compat.  Since
glibc 2.32, the default is new.  Before that, it was compat.
 - -C cache
 - 
cache を /etc/ld.so.cache の代わりに用いる。
 - -f conf
 - 
conf を /etc/ld.so.conf の代わりに用いる。
 - -i, --ignore-aux-cache
 - 
(Since glibc 2.7)  Ignore auxiliary cache file.
 - -l
 - 
(glibc 2.2 以降) ライブラリモード。それぞれのライブラリを手動でリンクする。 熟練者のみが用いるべきである。
 - -n
 - 
コマンドラインで指定されたディレクトリのみを処理する。 通常共有ライブラリが置かれるディレクトリや /etc/ld.so.conf
で指定されたディレクトリは処理しない。 暗黙のうちに -N が指定される。
 - -N
 - 
キャッシュを再構成しない。 同時に -X が同時に指定されなければ、リンクのほうは更新される。
 - -p, --print-cache
 - 
現在のキャッシュに保存されているディレクトリのリストと、 ライブラリの候補を表示する。
 - -r root
 - 
root にカレントディレクトリを変更し、ここをルートディレクトリとして用いる。
 - -v, --verbose
 - 
詳細表示モード。 現在のバージョン番号を表示する。 またそれぞれのディレクトリをスキャンし、 新しいリンクを生成するたびに、その内容を表示する。
メッセージ抑制モードを上書きする。
 - -V, --version
 - 
プログラムのバージョンを表示する。
 - -X
 - 
リンクを更新しない。 -N が同時に指定されなければ、キャッシュのほうは再構成される。
 
 
ファイル
- /lib/ld.so
 - 
実行時リンカー/ローダー。
 - /etc/ld.so.conf
 - 
ディレクトリのリストが入ったファイル。 1 行に 1 エントリー。それぞれのディレクトリでライブラリが検索される。
 - /etc/ld.so.cache
 - 
/etc/ld.so.conf で指定されたディレクトリにあるライブラリ、および信頼されたディレクトリにあるライブラリの順序付きリスト。
 
 
関連項目
ldd(1), ld.so(8)
 
この文書について
この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
https://www.kernel.org/doc/man-pages/ に書かれている。
 Index
- 名前
 - 
 - 書式
 - 
 - 説明
 - 
 - オプション
 - 
 - ファイル
 - 
 - 関連項目
 - 
 - この文書について
 - 
 
This document was created by
man2html,
using the manual pages.
Time: 16:46:41 GMT, November 24, 2023