Kenwood HP 9000 Personal Computer User Manual


 
Chapter 5 161
Creating and Using Libraries
Switching from Archive to Shared Libraries
Debugger Limitations
Shared libraries can be debugged just like archive libraries with few
exceptions. For details on debugging shared libraries, refer to the
HP/DDE Debugger User's Guide or the HP-UX Symbolic Debugger
User's Guide.
Using the chroot Command with Shared
Libraries
Some users may use the chroot super-user command when developing
and using shared libraries. This affects the path name that the linker
stores in the executable file. For example, if you chroot to the directory
/users/hyperturbo and develop an application there that uses the
shared library libhype.sl in the same directory, ld records the path
name of the library as /libhype.sl. If you then exit from the chrooted
directory and attempt to run the application, the dynamic loader won't
find the shared library because it is actually stored in
/users/hyperturbo/libhype.sl, not in /libhype.sl.
Conversely, if you move a program that uses shared libraries into a
chrooted environment, you must have a copy of the dynamic loader,
dld.sl, and all required shared libraries in the correct locations.
Profiling Limitations
Profiling with the prof(1) and gprof(1) commands and the monitor
library function is only possible on a contiguous chunk of the main
program (a.out). Since shared libraries are not contiguous with the
main program in virtual memory, they cannot be profiled. You can still
profile the main program, though. If profiling of libraries is required,
relink the application with the archive version of the library, using the
-a archive option.