Operating System - HP-UX
1834508 Members
2413 Online
110068 Solutions
New Discussion

Using LD_PRELOAD for Null pointer derefrencing.

 
vamsi sudhakar
Advisor

Using LD_PRELOAD for Null pointer derefrencing.

Hi,
I am porting my code from Sun Solaris to
HP-UX 11.0.I am facing a typical
problem for which I need some help.
In our code there is one function call
which dereferences the NULL
pointer whenever this is called and
this function is called many number of
times from different places of our
project code. So in Sun Solaris we set
LD_PRELAOD=/usr/lib/0@0.so.1 to get rid
of this NULL dereferencing. So now I
want to do the same in HP-UX also to
get rid of this Null dereferencing
problem. So can you please tell me, in
HP-UX 11.0, which library (means
which .sl) I have to include in
LD_PRELOAD.In HP document I found that
by including the option '-Z' at linking
time,will take care of this
dereferencing of the null
pointers. I included this option in
compiling (cc -Z) and linking (ld -Z)
also. But it didn't work for me.
Can any one please help me in finding
out the library which I have to include
in LD_PRELOAD or is there any other way to solve this problem.
Thanks and Regards
Vamsi Sudhakar.

----------------------------
Together we can win....
2 REPLIES 2
Michael Tully
Honored Contributor

Re: Using LD_PRELOAD for Null pointer derefrencing.

Hi,

Do you have a complete compiler installed? If not you can get a GCC version from the porting centre. HPUX by default does not come with a full 'C' compiler.

You can source 'GCC' from here:
http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-3.0.1/

-Michael
Anyone for a Mutiny ?
vamsi sudhakar
Advisor

Re: Using LD_PRELOAD for Null pointer derefrencing.

Hi Michael,
Thank you very much for your response. I am using cc compiler but not GCC. Also all of my components and libraries are compiled succesfully. But i am getting this problem at linking time. At linking time only my component gives core if it is using the library that contains the function lc_gettext. (This is the function which is derefrencing the NULL pointer).As i mentioned earlier also we solved this problem in Solaris by setting LD_PRELOAD to 0@0.so.1. So my question is what i have to do in HP-UX 11.0
I hope now the problem is clear to you.
Thanks and regards
Vamsi Sudhakar.
Together we can win....