I got this issue resolved just now.  I had to use gcc to build the library
instead of ld.  I found that if I used ld, I was having many issues, whereas
if I just used gcc to build the .so, all the issues went away. For example,
__umcpdi2 was a function that my code was getting linked with Glibc.  This
function was marked as hidden and so the load was failing. When I used gcc
as the linker, this problem did not come up.  Similarly, I had to explicitly
pass -shared flag to the ld.  Otherwise the .so was not getting .EX_DYN flag
set.  I'm working with 0.9.8i version of OpenSSL on Linux.


On Wed, Oct 15, 2008 at 7:27 AM, Geoff Thorpe <[EMAIL PROTECTED]> wrote:

> On Monday 13 October 2008 16:08:53 Pirasenna Velandai Thiyagarajan wrote:
> > How to load a DSO from within an engine?
> >
> > I call DSO_load(NULL, "mylibname", NULL, 0);
> >
> > The code path I debugged is as follows:
> > #0  DSO_ctrl (dso=0x48ab98, cmd=2, larg=0, parg=0x0) at dso_lib.c:338
> > #1  0x2abb9c90 in DSO_load (dso=0x0, filename=0x2ae00888 "mylibname",
> > meth=0x0, flags=0) at dso_lib.c:209
> >
> > DSO_load allocates a new DSO and assigns meth if I passed in the
> > DSO_load function, if not it uses a default method.  When I tested, it
> > used DSO_method_dlfcn.
> >
> > The code goes further and calls DSO_ctrl, as the stack shows above.
> > In DSO_ctrl, the function returns UNSUPPORTED error since the
> > DSO_method_dlfcn has not defined dso->meth->dso_ctrl function pointer.
>
> As per my previous response, you'll need to tell me what version of
> openssl you're using. The current 0.9.8 code as well as the development
> HEAD define cmd=2 as "DSO_CTRL_SET_FLAGS" and DSO_ctrl() is supposed to
> handle this internally. DSO_ctrl() should only fall through and return
> UNSUPPORTED in the way you see if the control command isn't handled
> internally, which it clearly should be in this case.
>
> If you built openssl yourself, please let me know what version you
> downloaded and make sure also that you are linking against your own
> openssl library rather than something installed natively on your system.
> OTOH, if you're building against headers and libs that are pre-installed
> on your system, which OS and package version?
>
> Cheers,
> Geoff
>
> --
> Un terrien, c'est un singe avec des clefs de char...
>



-- 
Online Gallery: http://www.deptons.com
You comments and ratings are very welcome!!

Reply via email to