From: locke AT mcs DOT net (Peter Johnson) Newsgroups: comp.os.msdos.djgpp Subject: Re: Dynamic loading of functions Date: Fri, 14 Feb 1997 23:20:28 GMT Organization: BiLogic Lines: 39 Message-ID: <3304f2e0.997764@news> References: <5e23ma$p39 AT rs18 DOT hrz DOT th-darmstadt DOT de> Reply-To: locke AT mcs DOT net NNTP-Posting-Host: locke.pr.mcs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 14 Feb 1997 16:25:46 GMT, Alexander Lehmann wrote: >Lennart Steinke 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). One already exists... DLMs. http://spy.isp.nsc.ru/djgpp/dlm.htm ------------------------------------- Peter Johnson ------------------------------------- locke AT mcs DOT net http://locke.home.ml.org ------------------------------------- Freelance C/C++/Pascal/Asm programmer for DJGPP, Borland, and Watcom compilers Member of BiLogic demo group -------------------------------------