- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shl_load problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2009 11:02 PM
тАО11-17-2009 11:02 PM
shl_load problem
I just want to shl_load a dynamic library just with the name of libray, but it not work.
I load the dynamic library as following:
shl_load("libxxx.sl",BIND_IMMEDIATE,0);
but it will not load library successfully.
When using shl_load with absolute path is will load successfully.
shl_loa("/usr/lib/libxxx.sl",BIND_IMMEDIATE,0);
So is there way to load the dynamic library not with absolute path?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2009 11:42 PM
тАО11-17-2009 11:42 PM
Re: shl_load problem
Check shl_load(3):
shl_load("libxxx.sl", DYNAMIC_PATH|BIND_IMMEDIATE, 0);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2009 01:19 AM
тАО11-18-2009 01:19 AM
Re: shl_load problem
I have try your method but it seems that it also does not work.
shl = shl_load("libcrypto.sl",DYNAMIC_PATH|BIND_IMMEDIATE, 0);
even if I use the putenv to set the SHLIB_PATH=/usr/lib and dld_getenv befor calling the shl_load, it also don't work.
Here is my code:
....
sprintf(strpath, "%s%s","SHLIB_PATH=",argv[1]);
printf("strpath is %s\n",strpath);
putenv(strpath);
str=getenv("SHLIB_PATH");
printf("str is %s\n",str);
dld_getenv();
shl = shl_load("libcrypto.sl",DYNAMIC_PATH | BIND_IMMEDIATE ,0);
if(!shl)
{
printf("shl_load failed\n");
printf("shl_load.rc=%s\n",strerror(errno));
exit(-1);
}
printf("shl_load successed\n");
...
compile the code as following:
cc -g -o shl_load shl_load.c
and run shl_load with /usr/lib args
But it can not load successfully.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2009 01:21 AM
тАО11-18-2009 01:21 AM
Re: shl_load problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-20-2009 09:34 PM
тАО11-20-2009 09:34 PM
Re: shl_load problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2009 10:24 AM
тАО11-21-2009 10:24 AM
Re: shl_load problem
Since this is the default, it is a waste of time doing that. And if you know it, why not add it to the library string?
As Suprateeka mentioned, the PA default is not to enable SHLIB_PATH. For Integrity, LD_LIBRARY_PATH is enabled by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2009 02:02 AM
тАО11-23-2009 02:02 AM
Re: shl_load problem
Ok, now in the code , there is just some lines:
shl_t shl;
shl = shl_load("libcrypto.sl",DYNAMIC_PATH|BIND_IMMEDIATE, 0);
if(shl)
{
printf("shl_load ok\n");
return 0;
}
else
printf("shl_load error\n");
and I compile the code like:
cc -g -o shl_load shl_load.c
and chatr +s enable shl_load
and run ./shl_load
and the error : error: No such file or directory.
It seems that the shl_load is try to load the libcrypto.sl in the current directory,but there is no libcrypto.sl then
it says that no such files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2009 08:38 AM
тАО11-23-2009 08:38 AM
Re: shl_load problem
Have you exported SHLIB_PATH where it should look? Perhaps I was incorrect about a default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 06:35 PM
тАО11-25-2009 06:35 PM
Re: shl_load problem
I have try to export SHLIB_LIB=/usr/lib/,
then it works.
But I just want to know why I use the putenv to set the SHLIB_LIB, it does not work well
as export SHLIB_PATH.
It is so weird to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2009 07:16 PM
тАО11-25-2009 07:16 PM
Re: shl_load problem
dld has already read the value of SHLIB_LIB, why should it look again?