Operating System - HP-UX
1748151 Members
3626 Online
108758 Solutions
New Discussion юеВ

+nodefaultrpath not working on HPUX

 
SOLVED
Go to solution
bivian
Advisor

+nodefaultrpath not working on HPUX

I am trying to create a shared object file on HPUX PARISC with +nodefaultrpath option. This is not working. The library search path given using -L options are getting embedded into the object.

The format of the shared object created is PA-RISC1.1 shared library -not stripped

The "ld" options used are /usr/ccs/bin/ld +nodefaultrpath +s -G -b -o
15 REPLIES 15
bivian
Advisor

Re: +nodefaultrpath not working on HPUX

I guess this is due to the fact that +nodefaultrpath option is not supported for 32 bit SOM objects. Is that right?

If so, what is the equivalen?
James R. Ferguson
Acclaimed Contributor
Solution

Re: +nodefaultrpath not working on HPUX

Hi:

> I guess this is due to the fact that +nodefaultrpath option is not supported for 32 bit SOM objects.

Given the manpages for 'ld', I would agree.

> If so, what is the equivalen?

Maybe you can fiddle with '+cdp'

Regards!

...JRF...

Dennis Handly
Acclaimed Contributor

Re: +nodefaultrpath not working on HPUX

>I guess this is due to the fact that +nodefaultrpath option is not supported for SOM objects. Is that right?

Exactly, there is no such option. What are you trying to do and why do you care?

>JRF: Maybe you can fiddle with '+cdp'

Perhaps. All you can do with +cdp is to add a bogus path.

Re: +nodefaultrpath not working on HPUX

first thing, please use the latest linker patches:
11.11 - PHSS_40549
11.23 - PHSS_40537
11.31 - PHSS_40538

secondly, +nodefaultrpath is not required on PA32, because by default the embedded path is not recorded. you have to explicitly use +b option to record embedded path.

and if you are using the word "embedded" to mean the path that gets recorded as seen in shared library list in the chatr(1) output, then it is not embedded path that can be removed using +nodefaultrpath. you have to use say something like
"+cdp /my/path/mylib.sl:mylib.sl". this will remove the path information.

and +cdp is available only on PA32.
bivian
Advisor

Re: +nodefaultrpath not working on HPUX

Hi,

Thanks for the suggestions.

Yes, i am talking about the shared library list shown by chatr command. I thought this was the embedded path.

Is there a subtle difference between embedded path and the one shown in shared library list. I guess the later is a path and the other points to a library.

So "+nodefaultrpath" option is used for objects where the search paths get added by
default without specifying the +b option.

In my case where the format of the file is "PA-RISC1.1 shared library -not stripped", which is PA32 i need to use the "+cdp" option for each library path specified through "-L" option. This is the only
way to avoid it being added along with the path to the shared object.

Actually, the problem i am trying to solve is that the shared object is linked at one place and it is being used in another place. So the loader throws an error when it sees the non-existent path while loading a library.

Finally, if we don't have the patches you mentioned, will it affect the above solution.

- Prashant




Dennis Handly
Acclaimed Contributor

Re: +nodefaultrpath not working on HPUX

>Is there a subtle difference between embedded path and the one shown in shared library list. I guess the later is a path and the other points to a library.

The one in the list is used as plan B if the other paths aren't found.
Can you provide your chatr output for your shlib and the module that is referring to it.

>the shared object is linked at one place and it is being used in another place. So the loader throws an error when it sees the non-existent path while loading a library.

How are you telling dld where the shlib is? Are you using SHLIB_PATH? Or are you using +b?

>if we don't have the patches you mentioned, will it affect the above solution.

Better if you have the latest, how old is yours?
bivian
Advisor

Re: +nodefaultrpath not working on HPUX

The chatr output is something like this:
shared library
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path disabled second Not Defined
shared library list:
dynamic /home/prash/jdk14/jre/lib/PA_RISC2.0/libjava.sl
dynamic /home/prash/oracle/jdk14/jre/lib/PA_RISC2.0/hotspot/libjvm.sl
dynamic /usr/lib/libcl.2
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libnss_dns.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libnsl.1
dynamic /usr/lib/libm.2

No, i am not using +b option. It uses the SHLIB_PATH or LD_LIBRARY_PATH.
Dennis Handly
Acclaimed Contributor

Re: +nodefaultrpath not working on HPUX

>The chatr output is something like this:
>SHLIB_PATH enabled first
dynamic /home/prash/jdk14/jre/lib/PA_RISC2.0/libjava.sl
dynamic /home/prash/oracle/jdk14/jre/lib/PA_RISC2.0/hotspot/libjvm.sl

You're saying it can't find the libjava.sl and libjvm.sl in your SHLIB_PATH?

(It won't use LD_LIBRARY_PATH.)
Dennis Handly
Acclaimed Contributor

Re: +nodefaultrpath not working on HPUX

I forgot to ask, is this a SETUID executable?