Shared Object library problem

Hi,

When using shared objects on AIX 4.3 i am getting runtime problems.
I have a small sample program which links to a shared object libray, oracle and system related libraries.
At runtime it fails (gives segmentation fault and coredump ) in one proc file when executing login statement.

But the same program instead of using shared object library if i use archives and static linking runs fine.
What could go wrong? Any environment variable problem?
my LIBPATH variable points = "$ORACLE_HOME/lib32:$ORACLE_HOME/lib" and at linking phase i use "-L$(ORACLE_HOME)/lib32 -lc -lnsl -L$(ORACLE_HOME)/lib -lclntsh $(ORACLE_HOME)
/lib/libsql9.a -lnsl -ldl -lC -lm" arguments.

Debugging shows failure occurs when
"sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);" is executed.
Which follows

Illegal instruction (reserved addressing fault) in . at 0x0 ($t1)
0x00000000 00000000 Invalid opcode.
I have urgent requirement of developing my application. :frowning:
Any help is appreciated.

Thanks
-------------
Suman