This commit is contained in:
gferg 2001-03-23 14:35:12 +00:00
parent 983bf7763c
commit 787f4ede4a
1 changed files with 38 additions and 11 deletions

View File

@ -10,7 +10,7 @@
<author><firstname>David A.</firstname> <surname>Wheeler</surname>
</author>
<address><email>dwheeler@dwheeler.com</email></address>
<pubdate>version 0.86, 6 March 2001</pubdate>
<pubdate>version 0.87, 22 March 2001</pubdate>
<abstract>
<para>
This HOWTO for programmers
@ -362,6 +362,16 @@ managers when installing a library.
On start-up, then, the dynamic loader actually uses
the file /etc/ld.so.cache and then loads the libraries it needs.
</para>
<para>
By the way, FreeBSD uses slightly different filenames for this cache.
In FreeBSD, the ELF cache is /var/run/ld-elf.so.hints
and the a.out cache is /var/run/ld.so.hints.
These are still updated by ldconfig(8), so this difference in location
should only matter in a few exotic situations.
<!-- Advanced Unix Programming by Warren W. Gay, Sams Publishing, 2000,
Indianapolis, Indiana, page 258. -->
</para>
</sect2>
<sect2>
@ -382,16 +392,24 @@ override the standard set, just as /etc/ld.so.preload does.
These are implemented by the loader /lib/ld-linux.so.
I should note that, while LD_LIBRARY_PATH works on many
Unix-like systems, it doesn't work on all;
for example, similar functionality is available on HP-UX but as
SHLIB_PATH, and on AIX this functionality is through LIBPATH.
for example, this functionality is available on HP-UX but as
the environment variable SHLIB_PATH,
and on AIX this functionality is through the variable LIBPATH
(with the same syntax, a colon-separated list).
<!-- Source for the systems that don't use LD_LIBRARY_PATH:
Drazen Kacar dave@srce.hr, 20 Jul 2000 13:27:53 +0200,
Mailing list gnome-devel-list@gnome.org -->
Also, LD_LIBRARY_PATH is handy for development and testing, but shouldn't
be modified by an installation process for normal use; see
Mailing list gnome-devel-list@gnome.org.
Confirmed by "Advanced Unix Programming", page 259. -->
</para>
<para>
LD_LIBRARY_PATH is handy for development and testing, but shouldn't
be modified by an installation process for normal use by normal users; see
``Why LD_LIBRARY_PATH is Bad'' at
<ulink url="http://www.visi.com/~barr/ldpath.html">http://www.visi.com/~barr/ldpath.html</ulink>
for an explanation of why.
But it's still useful for development or testing, and for working around
problems that can't be worked around otherwise.
</para>
<para>
@ -400,7 +418,8 @@ the loading process; their names begin with LD_ or RTLD_.
Most of the others are for low-level debugging of the loader process or
for implementing specialized capabilities.
Most of them aren't well-documented; if you need to know about them, the
best way to learn about them is to read the source code.
best way to learn about them is to read the source code of the loader
(part of gcc).
</para>
<para>
@ -1062,9 +1081,16 @@ For more information, see its documentation at
All the symbols included in generated files are useful for debugging,
but take up space.
If you need space, you can eliminate some of it.
The best approach is to use strip(1), which gives you control over
what symbols to eliminate, and it also lets you do debugging with the
symbols and afterwards strip the symbols.
</para>
<para>
The best approach is to first generate the object files normally,
and do all your debugging and testing first
(debugging and testing is much easier with them).
Afterwards, once you've tested the program thoroughly, use
strip(1) to remove the symbols.
The strip(1) command gives you a good deal of control over
what symbols to eliminate; see its documentation for details.
</para>
<para>
Another approach is to use the GNU ld options ``-S'' and ``-s'';
@ -1072,6 +1098,8 @@ Another approach is to use the GNU ld options ``-S'' and ``-s'';
from the output file, while
``-s'' omits all symbol information from the output file.
You can invoke these options through gcc as ``-Wl,-S'' and ``-Wl,-s''.
If you always strip the symbols and these options are sufficient, feel
free, but this is a less flexible approach.
</para>
</sect2>
@ -1467,4 +1495,3 @@ integrated with everyone else's changes into the master copy.
</article>