Operating System - HP-UX
1830898 Members
3412 Online
110017 Solutions
New Discussion

shl_load returns error 22

 
ArieMo
Occasional Advisor

shl_load returns error 22

 
1 REPLY 1
Steve Steel
Honored Contributor

Re: shl_load returns error 22

Hi


I can guess that you need the latest linker patch and then use the LD_PRELOAD functionality to avoide this

You can use the LD_PRELOAD environment variable to load a shared library that contains thread-local storage to avoid the following error when loading the library dynamically:

/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1

Also error 22

The load order and symbol resolution order may be different in a PA32 program than in the same PA64 program because the dynamic loader uses depth-first search order in PA32 mode and breadth-first search order in PA64 mode.
The dynamic loader uses the LD_PRELOAD environment variable even if you use the +noenvvar in the link line. This insures that LD_PRELOAD is enabled even in a +compat link. The LD_PRELOAD variable is always enabled except for setuid and setgid programs.

Note: Using LD_PRELOAD can cause a core dump when used with applications which mix shared and archived libraries, especially when both the shared library and the application are built with aC++ or use libc.

You can specify multiple libraries as part of the LD_PRELOAD environment variable. Separate the libraries by spaces or colons as in LD_LIBRARY_PATH. (Multi-byte support is not provided as part of parsing the LD_PRELOAD library list). You can specify LD_PRELOAD libraries with absolute paths or relative paths. The LD_PRELOAD libraries can also consist of just the library names, in which case the dynamic loader uses the directory path list in the environment variables LD_LIBRARY_PATH and/or SHLIB_PATH or the embedded path list (if enabled) to search for the libraries.

The dynamic loader does not issue an error or warning message if it cannot find a library specified by LD_PRELOAD. However, if it does not find a dependent of the LD_PRELOAD libraries, the dynamic loader issues the same error message as if the LD_PRELOAD library is specified in the link line.



See man dld.sl when patch is loaded


Steve steel
If you want truly to understand something, try to change it. (Kurt Lewin)