问题
我碰到了一个关于第3方Oracle library libcltnsh.sl.1.0的问题
我的应用程序产生了下面的错误信息:
/usr/lib/dld.sl: invalid version for library: /.../lib/libcltnsh.sl
/usr/lib/dld.sl: exec format error
我应该怎样解决这个问题呢?
配置信息
操作系统 - HP-UX
版本 - 10.20
硬件系统 - HP9000
系列 -K200
应用程序 - Oracle
子系统 - Threads
解决方法
要想解决您的问题,在链接行使用-lpthread 进行编译。
发生了这个问题是因为编写动态加载程序(/usr/lib/dld.sl)
拒绝使用Thread Local Storage的shl_load libraries 。 library上的 chatr(1),
chatr /.../lib/libcltnsh.sl
显示了 'shared library list:'中包含 /usr/lib/libpthread.1,
它使用Thread
Local Storage。
由于链接程序没有指定Thread Local Storage,导致动态加载程序出现错误而失败。假如链接行引用了一个共享库,然后装载libpthread
链接程序并不知道它需要处理Thread Local Storage。但是,假如 libpthread library 位于链接行,它就会正常工作。
.........following with all English text ....PROBLEM
I am having a problem with a third-party Oracle library,
libcltnsh.sl.1.0. My application generates the following
messages:
/usr/lib/dld.sl: invalid version for library: /.../lib/libcltnsh.sl
/usr/lib/dld.sl: exec format error
How can I resolve these errors?
CONFIGURATION
Operating System - HP-UX
Version - 10.20
Hardware System - HP9000
Series - K200
Application - Oracle
Subsystem - Threads
RESOLUTION
To resolve your errors, compile with -lpthread on the link line.
The problem exists because the dynamic loader (/usr/lib/dld.sl)
is written sUCh that it refuses to shl_load libraries which use Thread Local Storage. A chatr(1) upon the library,
chatr /.../lib/libcltnsh.sl, revealed a 'shared library list:'
containing /usr/lib/libpthread.1, which is known to use Thread Local Storage.
Since the linker did not specify Thread Local Storage, the dynamic loader errored out. If the link line references a shared library that then loads libpthread, the linker doesn't know that it will need to deal with Thread Local Storage. However, it does work if
the libpthread library is on the link line.