Mail Archives: djgpp/1996/02/24/14:03:48
> Is there any way to have more than one entry point in a dxe file?
Yes, one way is to to create a structure which contains the pointers
to the entry points and/or variables. You then return the pointer to
the structure when building the DXE. When I create such a structure,
I usually include version and size fields, so I can add more things to
the loadable module in the future, and still remain backward compatible
with other modules which only use the first few pointers in the DXE
structure.
> Can the dxe module access global variables of the calling program
> or vice versa?
You can access global variables in the dxe module (see above), but the
dxe module cannot access variables (or routines) in the main code. This
design limitation was intentional to keep DXEs as simple as possible.
The code to load a DXE is very tiny (a few hundred bytes) and was suitable
for including in every DJGPP V2 image (to load the emu387 if needed). A
full DLL package would have features not needed and take several thousand
bytes of space in every image.
> If neither was possible, how to build a dynamic link library?
There are lots of ways to attack it (and there are a few prototypes out
there). The most advanced code that I remember worked for just about
everything except for some writeable variables we had in the text area.
I had an idea to fix that problem, but I never got around to it, and it
might be fixed by now (that was like 6 months ago, sigh).
Eventually, it would be nice to put almost all of the libc into a DLL
to have the potential for dynamic linking (easy bug fixes, smaller images,
etc) for programs not needing to be distributed.
- Raw text -