Mail Archives: djgpp/1997/02/14/13:56:09
Lennart Steinke <steinke AT zeus DOT adv-boeblingen DOT de> wrote:
: Hi!
: I'm currently playing with the idea of loading function dynamically
: (for plug ins). It's working, but I've some questions:
: 1) Do I have to lock the memory of the funtion after loading or
: not?
: 2) Are there already libs for djgpp which allow dynamic binding?
There is a rather simple dynamic loader in the for of .dxe files
(mainly used for the FPU-emulator) that allows loading a program piece
that doesn't have any external references (libraries etc) and just a
single entry point. It takes care of relocating the code to the new
location and all. Since it doesn't handle references, it would be
necessary to return a struct that contains function pointers to all
available functions and variables (and probably pass one for functions
in the main program), which would make porting a library to dxe a bit
difficult (could be done with cpp directives, though).
Maybe it would be better to write a full-fleged dll or so-like library
support, but this would be much more complicated, of course (but would
be a very welcome addition to djgpp, I think).
bye, Alexander
PS. i saw a commercial solution for something similar advertised for
Watcom C recently. Having a freeware equivalent would be very cool.
--
Alexander Lehmann, alex AT hal DOT rhein-main DOT de | "On the Internet,
lehmann AT mathematik DOT th-darmstadt DOT de | nobody knows
lehmann AT usa DOT net (permanent forward) | you're a dog."
<url:http://home.pages.de/~lehmann/>
- Raw text -