Date: Sat, 28 Feb 1998 12:07:43 -0800 (PST) Message-Id: <199802282007.MAA15184@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Pieter van Ginkel" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Using COFF files. Precedence: bulk At 10:10 2/27/1998 GMT, Pieter van Ginkel wrote: >I want to create a library that dynamically loads routines from COFF files >into memory and then returns the pointer to the routines in the COFF file to >the program. I've been reading the COFF things from the Delorie DJGPP site >and there are a few things I don't really understand. Can anybody help me? > >* First, How can I just load the whole COFF file into memory and let the >whole thing run. Is that at all possible or is there more to be done before >the file runs. The best answer to this is probably to look at how DJGPP does it. Get the `djlsr201.zip' package and see `src/stub/stub.asm'. >* I suppose that the entries in the header files are converted to external >symbols. Do I have to do something's with these? >* Suppose I open the COFF file, locate a function, load that one into memory >and that return the pointer to the begin of that function to the user. I >don't think that's the right thing to do? If I use functions from the libc >library, how do I ensure that the routine has access to these? Do I need to >collect all the pointers to these routines that are already into memory (the >loading program) and give them to the function? How do I do this. > >Could somebody give me some guidelines so I can get starting at my loader??? Be aware that you are re-inventing the wheel here. Several dynamic loaders exist for DJGPP. Look in the `v2tk' directory of Simtelnet. Even if you do want to write your own, these packages will probably help you figure out what to do. Nate Eldredge eldredge AT ap DOT net