[fpc-pascal]GO32V2 EXE architecture...
kanzelsberger at rekt.umb.sk
Tue Jul 17 13:19:46 CEST 2001
Ah okies! Going to give it a try, I will inform you :)
From: marcov at stack.nl [mailto:marcov at stack.nl]
Sent: Tuesday, July 17, 2001 1:14 PM
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: Re: [fpc-pascal]GO32V2 EXE architecture...
> Oh, that's not what I mean exactly...
> That DXEGEN cannot convert .o file to .dxe because it doesn't
> understands these symbols, I want to find way how to remove them (or
> do anything else) so DXEGEN can successfully convert .o file...
I mean do a
as bla.s -o bla.o
And then add bla.o to the DXEGEN commandline. The symbols are added but
Their functionality is reasonably unneeded, at least for this initial
testing. (deal with unit initialisation)
Also note that you might get into problems with namemangling.
Define the entry procedure with
function add(a,b:longint):longint; external '_add'
and then use _add for "symbol" on the dxegen line below.
So something like
DXEGEN add.dxe _add add.o bla.o
DXE allows you to dynamically load code and data from a file and execute it.
Limitations: you cannot do I/O (and some other functions) directly from a
DXE loaded image. There is a single entry point (subroutine or data block
There are two parts to DXE - the generator and the loader.
The DXE generator is a program with the usage:
C:\> dxegen output.dxe symbol input.o [input2.o ... -lgcc -lc]
output.dxe is the name you want to contain your dynamic load code. symbol is
the procedure name (or data structure) you want a pointer to, remember to
add the initial underscore for most symbols. The input.o is created with GCC
from your source. Additional arguments on the command line (.o and .a
files; or other ld options) are passed to ld to resolve references to build
The loader only adds around 300 bytes to your image, and the prototype
is found in <sys/dxe.h>:
void *_dxe_load(char *filename);
It takes a single argument which is the file on disk containing the dynamic
execution code. It returns a pointer to the symbol you specified at DXE
generation time. See the documentation of dxe_load' in the library docs,
for more details ("info libc alpha _dxe_load" from the DOS prompt).
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal