1 .\" This is in the public domain
3 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
4 .\" Translated 1998-05-23, NAKANO Takeo <nakano@apm.seikei.ac.jp>
5 .\" Updated & Modified 1999-09-14, NAKANO Takeo
6 .\" Updated & Modified 2002-01-17, Yuichi SATO <ysato@h4.dion.ne.jp>
7 .\" Updated & Modified 2002-07-15, Yuichi SATO
8 .\" Updated 2007-06-13, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.55
9 .\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24
11 .TH LD.SO 8 2009-01-12 "GNU" "Linux Programmer's Manual"
13 .\"O ld.so, ld-linux.so* \- dynamic linker/loader
15 ld.so, ld-linux.so* \- 動的なリンカ/ローダ
18 .\"O The dynamic linker can be run either indirectly by running some
19 .\"O dynamically linked program or library (in which case no command-line options
20 .\"O to the dynamic linker can be passed and, in the ELF case, the dynamic linker
21 .\"O which is stored in the
23 .\"O section of the program is executed) or directly by running:
25 .\"O .I /lib/ld-linux.so.*
26 .\"O [OPTIONS] [PROGRAM [ARGUMENTS]]
27 動的リンカは、動的にリンクされたプログラムやライブラリの実行によって
29 (ELF の場合、動的リンカにコマンドラインオプションを渡すことはできず、
32 セクションに入っている動的リンカが実行される)。
36 [OPTIONS] [PROGRAM [ARGUMENTS]]
43 .\"O find and load the shared libraries needed by a program, prepare
44 .\"O the program to run, and then run it.
49 はプログラムに必要な共有ライブラリを見つけてロードし、
52 .\"O Linux binaries require dynamic linking (linking at run time)
55 .\"O option was given to
57 .\"O during compilation.
62 オプションが指定されていない限り、動的リンク (実行時リンク) が必要となる。
66 .\"O handles a.out binaries, a format used long ago;
70 これはずっと昔に使われていたフォーマットである。
72 .\"O handles ELF (\fI/lib/ld-linux.so.1\fP for libc5, \fI/lib/ld-linux.so.2\fP
73 .\"O for glibc2), which everybody has been using for years now.
75 (libc5 では \fI/lib/ld-linux.so.1\fP,
76 glibc2 では \fI/lib/ld-linux.so.2\fP)
78 このフォーマットは多くの人が最近何年も使っている。
79 .\"O Otherwise both have the same behavior, and use the same
80 .\"O support files and programs
84 .\"O .IR /etc/ld.so.conf .
92 .\"O The shared libraries needed by the program are searched for
93 .\"O in the following order:
97 .\"O (ELF only) Using the directories specified in the
98 .\"O DT_RPATH dynamic section attribute
99 .\"O of the binary if present and DT_RUNPATH attribute does not exist.
100 .\"O Use of DT_RPATH is deprecated.
102 バイナリの動的セクション属性 DT_RPATH が存在し、
103 DT_RUNPATH 属性が存在しない場合は、
104 DT_RPATH で指定されたディレクトリを使用する。
107 .\"O Using the environment variable
108 .\"O .BR LD_LIBRARY_PATH .
109 .\"O Except if the executable is a set-user-ID/set-group-ID binary,
110 .\"O in which case it is ignored.
114 ただし実行ファイルが set-user-ID/set-group-ID バイナリの場合、
117 .\"O (ELF only) Using the directories specified in the
118 .\"O DT_RUNPATH dynamic section attribute
119 .\"O of the binary if present.
121 バイナリの動的セクション属性 DT_RUNPATH が存在すれば、
122 DT_RUNPATH で指定されたディレクトリを使用する。
124 .\"O From the cache file
125 .\"O .I /etc/ld.so.cache
126 .\"O which contains a compiled list of candidate libraries previously found
127 .\"O in the augmented library path.
128 .\"O If, however, the binary was linked with the
130 .\"O linker option, libraries in the default library paths are skipped.
134 (ld.so.conf で追加指定されたものも含めた) ライブラリ検索パスから
135 見つかったライブラリファイルの情報を集めたものである。
138 でリンクされている場合は、デフォルトのライブラリパスにある
141 .\"O In the default path
150 .\"O If the binary was linked with the
152 .\"O linker option, this step is skipped.
155 でリンクされている場合、このステップはスキップされる。
156 .\"O .SS $ORIGIN and rpath
160 .\"O understands the string
162 .\"O (or equivalently
164 .\"O in an rpath specification (DT_RPATH or DT_RUNPATH) to mean
165 .\"O the directory containing the application executable.
167 では、rpath 指定 (DT_RPATH や DT_RUNPATH) 中に
173 はアプリケーションの実行ファイルが入っているディレクトリを表す。
174 .\"O Thus, an application located in
176 .\"O could be compiled with
177 .\"O .I gcc -Wl,-rpath,\(aq$ORIGIN/../lib\(aq
178 .\"O so that it finds an associated shared library in
182 .\"O is located in the directory hierarchy.
186 .I gcc -Wl,-rpath,'$ORIGIN/../lib'
189 がディレクトリ階層のどこにあっても、アプリケーションは
191 にある対応する共有ライブラリを見つけることができる。
192 .\"O This facilitates the creation of "turn-key" applications that
193 .\"O do not need to be installed into special directories,
194 .\"O but can instead be unpacked into any directory
195 .\"O and still find their own shared libraries.
197 特別なディレクトリではなく任意のディレクトリにインストールしても
199 独自の共有ライブラリを使えるアプリケーションを作成することができる。
200 .\" ld.so also understands $LIB, with the same meaning as $ORIGIN/lib,
203 .\" There is also $PLATFORM. This is a kind of wildcard
204 .\" of directories related at AT_HWCAP. To get an idea of the
205 .\" places that $PLATFORM would match, look at the output of the
209 .\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d
211 .\" ld.so lets names be abbreviated, so $O will work for $ORIGIN;
217 .\"O List all dependencies and how they are resolved.
221 .\"O Verify that program is dynamically linked and this dynamic linker can handle
224 動的リンカがそのプログラムを扱えるかを検証する。
226 .B \-\-library\-path PATH
228 .\"O .B LD_LIBRARY_PATH
229 .\"O environment variable setting (see below).
231 環境変数の設定を上書きする (下記参照)。
233 .B \-\-inhibit\-rpath LIST
234 .\"O Ignore RPATH and RUNPATH information in object names in LIST.
235 .\"O This option is ignored if
237 .\"O is set-user-ID or set-group-ID.
238 LIST にあるオブジェクト名の RPATH と RUNPATH の情報を無視する。
240 が set-user-ID か set-group-ID されている場合、
244 .\"O There are four important environment variables.
248 .\"O (libc5; glibc since 2.1.1)
249 .\"O If set to a nonempty string,
250 .\"O causes the dynamic linker to resolve all symbols
251 .\"O at program startup instead of deferring function call resolution to the point
252 .\"O when they are first referenced.
253 .\"O This is useful when using a debugger.
254 (libc5; glibc 2.1.1 以降)
256 動的リンカはプログラムの開始時に全てのシンボルを解決する。
257 空文字列の場合、解決しなければならない関数呼び出しが
262 .\"O A colon-separated list of directories in which to search for
263 .\"O ELF libraries at execution-time.
266 .\"O environment variable.
268 実行時に ELF ライブラリを検索するディレクトリを指定する。
273 .\"O A whitespace-separated list of additional, user-specified, ELF shared
274 .\"O libraries to be loaded before all others.
275 .\"O This can be used to selectively override functions in other shared libraries.
276 スペース区切りで ELF 共有ライブラリを指定する。
277 これはユーザーが指定でき、すべてのライブラリに先立ってロードされる。
278 他の共有ライブラリにある関数を選択的に置き換えるために用いることができる。
279 .\"O For set-user-ID/set-group-ID ELF binaries,
280 .\"O only libraries in the standard search
281 .\"O directories that are also set-user-ID will be loaded.
282 set-user-ID/set-group-ID された ELF バイナリに対して、
283 標準的な検索パスにあるライブラリのうち set-user-ID されているものはロードしない。
285 .B LD_TRACE_LOADED_OBJECTS
287 .\"O If set to a nonempty string, causes the program to list its dynamic library
288 .\"O dependencies, as if run by
290 .\"O instead of running normally.
295 を実行したときのように動的ライブラリの依存関係をリスト表示させる。
297 .\"O Then there are lots of more or less obscure variables,
298 .\"O many obsolete or only for internal use.
299 そして、それほど知られていない環境変数もある。
300 多くは廃れてしまったものか内部でのみ使用される環境変数である。
302 .B LD_AOUT_LIBRARY_PATH
305 .\"O .B LD_LIBRARY_PATH
306 .\"O for a.out binaries only.
307 .\"O Old versions of ld\-linux.so.1 also supported
308 .\"O .BR LD_ELF_LIBRARY_PATH .
309 a.out バイナリにのみ使われる環境変数で、
312 ld\-linux.so.1 の古いバージョンでは
313 .B LD_ELF_LIBRARY_PATH
320 .\"O for a.out binaries only.
321 .\"O Old versions of ld\-linux.so.1 also supported
322 .\"O .BR LD_ELF_PRELOAD .
323 a.out バイナリにのみ使われる環境変数で、
326 ld\-linux.so.1 の古いバージョンでは
331 .\"O (glibc since 2.4)
333 .\"O A colon-separated list of user-specified, ELF shared objects
334 .\"O to be loaded before all others in a separate linker namespace
335 .\"O (i.e., one that does not intrude upon the normal symbol bindings that
336 .\"O would occur in the process).
337 .\"O These libraries can be used to audit the operation of the dynamic linker.
339 .\"O is ignored for set-user-ID/set-group-ID binaries.
340 他のオブジェクトよりも前に、別のリンカ名前空間 (そのプロセスで行われる
341 通常のシンボル結合 (symbol bindigns) には関与しない名前空間) で
342 ロードされる、ユーザ指定の ELF 共有オブジェクトのコロン区切りのリスト。
343 これらのライブラリを使って、動的リンカの動作を監査することができる。
344 set-user-ID/set-group-ID されたバイナリでは、
348 .\"O The dynamic linker will notify the audit
349 .\"O libraries at so-called auditing checkpoints\(emfor example,
350 .\"O loading a new library, resolving a symbol,
351 .\"O or calling a symbol from another shared object\(emby
352 .\"O calling an appropriate function within the audit library.
353 動的リンカは、いわゆる監査チェックポイント (auditing checkpoints)
354 において、監査 (audit) ライブラリの適切な関数を呼び出すことで、
355 監査ライブラリへの通知を行う。監査チェックポイントの例としては、
356 新たなライブラリのロード、シンボルの解決、別の共有オブジェクト
358 .\"O For details, see
359 .\"O .BR rtld-audit (7).
360 .\"O The auditing interface is largely compatible with that provided on Solaris,
361 .\"O as described in its
362 .\"O .IR "Linker and Libraries Guide" ,
364 .\"O .IR "Runtime Linker Auditing Interface" .
368 audit インタフェースは、Solaris で提供されているものと
369 大部分は互換性がある。Solaris の audit インタフェースについては、
370 .I "Linker and Libraries Guide"
372 .I "Runtime Linker Auditing Interface"
376 .\"O (glibc since 2.1.95)
377 .\"O Do not update the GOT (global offset table) and PLT (procedure linkage table)
378 .\"O after resolving a symbol.
380 シンボルを解決した後、GOT (global offset table) と
381 PLT (procedure linkage table) を更新しない。
384 .\"O (glibc since 2.1)
385 .\"O Output verbose debugging information about the dynamic linker.
388 .\"O prints all debugging information it has, if set to
390 .\"O prints a help message about which categories can be specified in this
391 .\"O environment variable.
392 .\"O Since glibc 2.3.4,
394 .\"O is ignored for set-user-ID/set-group-ID binaries.
396 動的リンカの詳細なデバッグ情報を出力する。
398 に設定した場合、全ての動的リンカが持つデバッグ情報を表示する。
400 に設定した場合、この環境変数で指定されるカテゴリのヘルプ情報を表示する。
402 set-user-ID/set-group-ID されたバイナリでは
407 .\"O (glibc since 2.1)
410 .\"O output should be fed into, default is standard output.
411 .\"O .B LD_DEBUG_OUTPUT
412 .\"O is ignored for set-user-ID/set-group-ID binaries.
417 set-user-ID/set-group-ID されたバイナリでは、
422 .\"O (glibc since 2.1.91)
423 .\"O Allow weak symbols to be overridden (reverting to old glibc behavior).
424 .\"O For security reasons, since glibc 2.3.4,
425 .\"O .B LD_DYNAMIC_WEAK
426 .\"O is ignored for set-user-ID/set-group-ID binaries.
428 上書きされる弱いシンボル (昔の glibc の挙動を逆にする)。
429 セキュリティ上の理由から、glibc 2.3.4 以降、
430 set-user-ID/set-group-ID されたバイナリでは
435 .\"O (glibc since 2.1)
436 .\"O Mask for hardware capabilities.
441 .\"O (a.out only)(libc5)
442 .\"O Don't ignore the directory in the names of a.out libraries to be loaded.
443 .\"O Use of this option is strongly discouraged.
445 ロードする a.out ライブラリの名前において、ディレクトリを無視しない。
449 .\"O (a.out only)(libc5)
450 .\"O Suppress warnings about a.out libraries with incompatible minor
451 .\"O version numbers.
453 a.out ライブラリにおけるマイナーバージョン番号の非互換に
457 .\"O (glibc since 2.1)
458 .\"O Path where the binary is found (for non-set-user-ID programs).
459 .\"O For security reasons, since glibc 2.4,
460 .\"O .B LD_ORIGIN_PATH
461 .\"O is ignored for set-user-ID/set-group-ID binaries.
463 バイナリへのパス (set-user-ID されていないプログラムについて)。
464 セキュリティ上の理由から、glibc 2.3.4 以降、
465 set-user-ID/set-group-ID されたバイナリでは
468 .\" Only used if $ORIGIN can't be determined by normal means
469 .\" (from the origin path saved at load time, or from /proc/self/exe)?
472 .\"O (glibc since 2.4)
474 .\"O Set to 0 to disable pointer guarding.
475 .\"O Any other value enables pointer guarding, which is also the default.
476 .\"O Pointer guarding is a security mechanism whereby some pointers to code
477 .\"O stored in writable program memory (return addresses saved by
479 .\"O or function pointers used by various glibc internals) are mangled
480 .\"O semi-randomly to make it more difficult for an attacker to hijack
481 .\"O the pointers for use in the event of a buffer overrun or
482 .\"O stack-smashing attack.
483 0 に設定すると、ポインタ保護 (pointer guarding) が無効になる。
484 それ以外の値の場合はポインタ保護が有効になる。
486 ポインタ保護はセキュリティ機構の一つで、書き込み可能なプログラムメモリ
487 に格納されたコードへのポインタをほぼランダム化することで、
488 攻撃者がバッファオーバーランやスタック破壊 (stack-smashing) 攻撃の際に
489 ポインタを乗っ取ることを困難にするものである。
492 .\"O (glibc since 2.1)
493 .\"O Shared object to be profiled,
494 .\"O specified either as a pathname or a soname.
495 .\"O Profiling output is written to the file whose name is:
496 .\"O "\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile".
499 パス名か共有オブジェクト名 (soname) で指定される。
501 "\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile" という名前の
505 .\"O (glibc since 2.1)
508 .\"O output should be written.
509 .\"O If this variable is not defined, or is defined as an empty string,
510 .\"O then the default is
512 .\"O .B LD_PROFILE_OUTPUT
513 .\"O is ignored for set-user-ID and set-group-ID programs,
514 .\"O which always use
515 .\"O .IR /var/profile .
519 この変数が定義されていないか、空の文字列が定義されている場合、
523 set-user-ID/set-group-ID されたプログラムでは、
524 LD_PROFILE_OUTPUT は無視される。
530 .\"O (glibc since 2.1)
531 .\"O Show auxiliary array passed up from the kernel.
532 .\"O For security reasons, since glibc 2.3.5,
534 .\"O is ignored for set-user-ID/set-group-ID binaries.
536 カーネルから渡される補助的な (パラメータの) 配列を表示する。
537 セキュリティ上の理由から、glibc 2.3.4 以降、
538 set-user-ID/set-group-ID されたバイナリでは
542 .\" Document LD_TRACE_PRELINKING (e.g.: LD_TRACE_PRELINKING=libx1.so ./prog)
544 .\" Also enables DL_DEBUG_PRELINK
547 .\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html
548 .\" Subject: [PATCH] Support LD_USE_LOAD_BIAS
550 .\"O By default (i.e., if this variable is not defined)
551 .\"O executables and prelinked
552 .\"O shared objects will honor base addresses of their dependent libraries
553 .\"O and (nonprelinked) position-independent executables (PIEs)
554 .\"O and other shared objects will not honor them.
555 デフォルトでは (つまり、この変数が定義されていない場合)、
556 実行ファイルと prelink された共有オブジェクトでは、それらが依存する
557 ライブラリのベースアドレスが尊重される一方、
558 (prelink されていない) position-independent executables (PIEs) と
559 他の共有オブジェクトでは依存するライブラリのベースアドレスは
562 .\"O .B LD_USE_LOAD_BIAS
563 .\"O is defined wit the value, both executables and PIEs
564 .\"O will honor the base addresses.
566 に値が定義された場合、実行ファイルと PIE のどちらでも
569 .\"O .B LD_USE_LOAD_BIAS
570 .\"O is defined with the value 0,
571 .\"O neither executables nor PIEs will honor the base addresses.
573 が値 0 で定義された場合、実行ファイルと PIE のどちらでも
575 .\"O This variable is ignored by set-user-ID and set-group-ID programs.
576 set-user-ID や set-group-ID されたプログラムでは、
580 .\"O (glibc since 2.1)
581 .\"O If set to a nonempty string,
582 .\"O output symbol versioning information about the
583 .\"O program if querying information about the program (i.e., either
584 .\"O .B LD_TRACE_LOADED_OBJECTS
585 .\"O has been set, or
589 .\"O options have been given to the dynamic linker).
592 .RB ( LD_TRACE_LOADED_OBJECTS
597 オプションを動的リンカに指定することにより)
598 プログラムについての情報を問い合わせると、
599 プログラムのシンボルバージョン情報を表示する。
602 .\"O (ELF only)(glibc since 2.1.3)
603 .\"O If set to a nonempty string, warn about unresolved symbols.
604 (ELF のみ)(glibc 2.1.3 以降)
605 空文字列でない場合、解決されていないシンボルがあれば警告を出す。
612 .\"O when none is present.
623 .\"O a.out dynamic linker/loader
626 .IR /lib/ld\-linux.so. { 1 , 2 }
627 .\"O ELF dynamic linker/loader
631 .\"O File containing a compiled list of directories in which to search for
632 .\"O libraries and an ordered list of candidate libraries.
633 ライブラリを検索するディレクトリを集めたリストと、
634 共有ライブラリの候補の整列リストを含むファイル。
636 .I /etc/ld.so.preload
637 .\"O File containing a whitespace separated list of ELF shared libraries to
638 .\"O be loaded before the program.
639 プログラムの前にロードすべき ELF 共有ライブラリを
640 スペースで区切ったリストが書かれているファイル。
643 .\"O shared libraries
650 .\"O functionality is available for executables compiled using libc version
651 .\"O 4.4.3 or greater.
653 の機能は libc のバージョン 4.4.3 以上を用いてコンパイルされた
655 .\"O ELF functionality is available since Linux 1.1.52 and libc5.
656 ELF の機能は Linux 1.1.52 以降と libc5 以降で使用可能である。
664 .\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
665 .\" Torvalds, Lars Wirzenius and Mitch D'Souza
666 .\"O .\" ld-linux.so: Roland McGrath, Ulrich Drepper and others.
667 .\" ld-linux.so: Roland McGrath, Ulrich Drepper, その他の人々
669 .\"O .\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so.
670 .\" 上記の説明において、(libc5) は David Engel の
671 .\" ld.so/ld-linux.so を表している。