FFI: get function address?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI: get function address?

Schwab,Wilhelm K
Hello all,

Does Squeak/Pharo FFI offer a way to get the address of a function in a library?  The target of interest is probably more of an exported global containing a pointer, but GetProcAddress() worked on Windows, and I am assuming a similar trick will be required on Linux.

Bill


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] FFI: get function address?

johnmci
There usually is an operating system call that you feed a "symbol" to that gives you a memory address.
This address could be:

(a) the start address of executable code.
(b) the start address of read only, or read/write storage for a data element of some sort.

This is kinda of exposed in the VM api via

        VM->ioLoadModuleOfLength = ioLoadModuleOfLength;
        VM->ioLoadSymbolOfLengthFromModule = ioLoadSymbolOfLengthFromModule;



On 2010-03-25, at 7:50 PM, Schwab,Wilhelm K wrote:

> Hello all,
>
> Does Squeak/Pharo FFI offer a way to get the address of a function in a library?  The target of interest is probably more of an exported global containing a pointer, but GetProcAddress() worked on Windows, and I am assuming a similar trick will be required on Linux.
>
> Bill
>
>

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

smime.p7s (3K) Download Attachment