Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Relocation error with an embedded perl interpreter

by Stevie-O (Friar)
on May 11, 2004 at 15:11 UTC ( #352465=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Relocation error with an embedded perl interpreter
in thread Relocation error with an embedded perl interpreter

Well, I would imagine that if Perl can do it, so can you. You have the source; I would start looking at Dynaloader since that seems to be the guts behind everything.

I admit that I'm not sure how well that would work; you might need to do some dynamic linking tricks to get the address of your function *after* the .so is loaded by Perl.

--Stevie-O
$"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc


Comment on Re: Re: Re: Relocation error with an embedded perl interpreter
Download Code
Re: Relocation error with an embedded perl interpreter
by tigger^ (Initiate) on May 11, 2004 at 21:16 UTC
    I can't find how to get at dl_find_symbol_anywhere() either :(
    My C is being compiled using ExtUtils::Embed ldopts which links it against libperl and DynaLoader.a, which doesn't seem to include the dl_find_symbol_anywhere() symbol. Nor does "require DynaLoader" allow me to call it from Perl.
    I'm stumped :(
Re: Re: Re: Re: Relocation error with an embedded perl interpreter
by tigger^ (Initiate) on May 11, 2004 at 22:37 UTC
    I've now managed to get a CODEREF to the routine I was after like this:
    eval_pv( "use DynaLoader;" \ "use XML::LibXML;" \ "my $pnts_symref = DynaLoader::dl_find_symbol_anywhere('PmmNod +eToSv');" \ "my $coderef = DynaLoader::dl_install_xsub('kousei::PmmNodeToS +v', $pnts_symref);" TRUE );
    Trouble is, now I can't find how to call it from C with the args I need to pass. Calling it from perl is fine via &$coderef(), but the xmlNode I want to pass to it is in C.
    Any clues?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://352465]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-12-20 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls