- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pa-risc & dlopen for 32-bit
Operating System - HP-UX
1748249
Members
3821
Online
108760
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-19-2008 05:23 PM
тАО11-19-2008 05:23 PM
pa-risc & dlopen for 32-bit
I'm trying to open a shared lib on a pa-risc system like this:
dlhdl = dlopen("libmydll.sl",RTLD_LAZY|RTLD_GLOBAL);
printf("%s\n",dlerror());
When the DLL & app are compiled as 32-bit this always fails - with an error saying that the it cannot open the shared lib libmydll.sl ...
However it works when I compile both the DLL & app as 64-bit (+DD64).
Is there any additional settings to get dlopen to work in 32-bit mode
(all the env settings are the same when I try the tests i.e. SHLIB_PATH, LD_LIBRARY_PATH etc are all the same)
dlhdl = dlopen("libmydll.sl",RTLD_LAZY|RTLD_GLOBAL);
printf("%s\n",dlerror());
When the DLL & app are compiled as 32-bit this always fails - with an error saying that the it cannot open the shared lib libmydll.sl ...
However it works when I compile both the DLL & app as 64-bit (+DD64).
Is there any additional settings to get dlopen to work in 32-bit mode
(all the env settings are the same when I try the tests i.e. SHLIB_PATH, LD_LIBRARY_PATH etc are all the same)
- Tags:
- dlopen
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2008 10:04 PM
тАО11-19-2008 10:04 PM
Re: pa-risc & dlopen for 32-bit
If you expect to use SHLIB_PATH with the SOM dld.sl, you must link with -Wl,+s. Or use "chatr +s enable executable".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2008 11:50 AM
тАО11-21-2008 11:50 AM
Re: pa-risc & dlopen for 32-bit
the chatr seems to work. Now its a different issue. My shared library is built with "-mt" (linked with pthreads).
So when I do a dlopen/shl_load of this library I get:
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
The documentation seems to suggest that I can compile my shared library with the +tls=dynamic option and I should'nt see this anymore ... however that does not seem to work. I still get the same error messsage.
By the way the versions I have is:
aCC: HP ANSI C++ B3910B A.03.60
HPUX B.11.11 U 9000/800
(exporting LD_PRELOAD does solve the problem - but I'd like to be able to resolve it without having users do this)
Thanks
So when I do a dlopen/shl_load of this library I get:
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
The documentation seems to suggest that I can compile my shared library with the +tls=dynamic option and I should'nt see this anymore ... however that does not seem to work. I still get the same error messsage.
By the way the versions I have is:
aCC: HP ANSI C++ B3910B A.03.60
HPUX B.11.11 U 9000/800
(exporting LD_PRELOAD does solve the problem - but I'd like to be able to resolve it without having users do this)
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2008 03:01 PM
тАО11-21-2008 03:01 PM
Re: pa-risc & dlopen for 32-bit
>"-mt" (linked with pthreads).
You shouldn't link shlibs with libpthread. -mt has been fixed to no longer do that with -b. Only the executable should be linked with libpthread.
>I can compile my shared library with the +tls=dynamic option and I shouldn't see this anymore
That only works for your shlib, not for libpthread. And +tls=dynamic doesn't work for PA.
>exporting LD_PRELOAD does solve the problem
As I mentioned, if you are actually creating threads, then link your executables with libpthread.
If you aren't creating threads, then don't link your shlibs with -mt.
You shouldn't link shlibs with libpthread. -mt has been fixed to no longer do that with -b. Only the executable should be linked with libpthread.
>I can compile my shared library with the +tls=dynamic option and I shouldn't see this anymore
That only works for your shlib, not for libpthread. And +tls=dynamic doesn't work for PA.
>exporting LD_PRELOAD does solve the problem
As I mentioned, if you are actually creating threads, then link your executables with libpthread.
If you aren't creating threads, then don't link your shlibs with -mt.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP