HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 52 (of 101)
Chapter 11 Software Development
October 29, 2013
$ what x.c x.o a.out core
x.c:
x.c version 0.1 from Jan 04 2002
x.o:
x.c version 0.1 from Jan 04 2002
a.out:
x.c version 0.1 from Jan 04 2002
core:
x.c version 0.1 from Jan 04 2002
$ PATCH/11.00:PHCO_24723 Sep 13 2001 05:01:45 $
92453-07 dld dld dld.sl B.11.30 011005
The core file contains some more what strings than just ours. These come from the shared
libraries used by the program, in this case libc.sl and dld.sl (or on IA libc.so.1 and
dld respectively). The library what strings returned from a core file are very helpful when
the core file needs to be debugged.
chatr(1)
The chatr(1) command can display and change internal attributes of a program or shared
library. Most interesting at this point is that it prints the list of shared libraries that are loaded
when the program is run. See the Executables section of the chapter "The Build Process" for a
complete chatr(1) output.
chatr(1) can also change the way how libraries are searched when they are loaded. There are
several possible resources where the dynamic loader expects paths to search for shared libraries:
SHLIB_PATH
LD_LIBRARY_PATH (not for PA-RISC 32-bit)
embedded path
default path
The paths will be searched in the above order.
SHLIB_PATH and LD_LIBRARY_PATH are environment variables that can be set at runtime, but
using them must be enabled by a flag in the executable. The default is that they are disabled for
32-bit PA-RISC and enabled for all other types of executables. Enabling them can be done
explicitly with the +s linker option. To disable them, use the +noenvar linker option. Or you can
use chatr +s [enable|disable] on the executable. chatr(1) will then show the search paths
as follows:
$ chatr +s enable a.out
a.out:
shared executable
shared library dynamic path search: