ORACLE在HP-UX下的系列問題處理(50)
2024-08-29 13:39:58
供稿:網友
問題
我碰到了一個關于第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.