www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/14/13:56:09

From: Alexander Lehmann <lehmann AT mathematik DOT th-darmstadt DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Dynamic loading of functions
Date: 14 Feb 1997 16:25:46 GMT
Organization: Technische Hochschule Darmstadt
Lines: 35
Message-ID: <5e23ma$p39@rs18.hrz.th-darmstadt.de>
References: <Pine DOT VUL DOT 3 DOT 91 DOT 970214094133 DOT 8488I-100000 AT zeus DOT adv-boeblingen DOT de>
NNTP-Posting-Host: fb0403.mathematik.th-darmstadt.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019