Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Technical LIBPATH question 2

Status
Not open for further replies.

kevb258

Technical User
Aug 31, 2004
6
GB
Hi,

I have been doing some research, and I am not finding any answers to the following question:

The problem is as follows: an AIX loadmodule has been linked with the ld flag of -bnolibpath, which effectively means that the LIBPATH env variable gets ignored at runtime, instead the ld flags of -L and "link time" LIBPATH values are stored inside the load module. (This is 3rd party software, for which I don't have the source.)

I need to get the runtime LIBPATH to be used... what commands do I need to run against the load module to open it up to use the runtime LIBPATH. E.g. is there a way to call ld with flags to strip the -bnolibpath setting? I need to do this since the "dump -H loadmodule" shows an "index 0" path containing stuff that I don't have, and the things I need to be included are ignored...

Thanks in advance
K
 
Am still waiting for a reply... so I replied to keep this on the "front page
 
I'm not sure how to "relink" the loadmodule, but if the path is the only problem, couldn't you use symbolic links to make it work?

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
Can you use the load subroutine to load a module into the current process, or use dlopen to dynamically load the module into the programs address space? Or is it possible to use ld and relink the program with a new object file that has the LIBPATH?

 
Thanks for the reply... I had thought of that, but it introduces other issues...
Firstly, I don't really want create spurious directory references on my system, and secondly, if the referenced directory does exist and there is a file with the same name, but different content to the one which is required, then I get other problems... E.g. Load Module loadmod1 has a built-in reference to directory /home/user1/lib, which at build time contained libMyLib.so ... I get a copy of loadmod1 installed on my system, which happens to have a valid directory called /home/user1/lib, which also contains a file called libMyLib.so,but this file is completely different to the one which is needed by loadmod1, so I get a runtime "can't resolve symbol inside libMyLib.so" error... hence the need to change the LIBPATH that is built-in to loadmod1 so that I can point the runtime LIBPATH to the directory where the valid libMyLib.so exists...
 
Sounds ugly. Depending on the loadmodule's use, a chroot environment might be the way to go.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
Thanks, I may need to consider that, but will wait to see if anyone else has the desired solution...
 
He got stars for no solution? And you don't even consider my suggestions?
 
Thanks for your suggestions, screwloose. I had not seen it... blame it on the quick scroll wheel...

I don't have the source to use the load subroutine, but may be able to get the "Build-time" LIBPATH set more appropriately just before the link happens, so that at runtime it is referencing the correct LIBPATH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top