Mail Archives: djgpp/1998/05/16/04:16:40
"Paul Derbyshire" <pderbysh AT usa DOT net> writes:
>Using DJGPP (but not Allegro) is there a simple way to add an arbitrary chunk
>of binary data after the DJGPP exe, and have it available for read/write as if
>it were a file? Is there some sort of pointer in the exe to the end to allow a
>simple seek to the start of the added data (if any) and read/write data there?
Check the default ld script for the symbol that marks the end of the COFF
image: it's 'end' or '_end' (or both), IIRC. You'd probably just
declare it as an 'extern int' (the datatype doesn't matter) and then take
the address of it with '&'; however, keep in mind that the compiler will
automatically prefix the declared variable name with an underscore (as,
of course, you already know).
I had to use this for PUNIX, in order to calculate some memory-related
values; however, I think I did it with ASM (or inline ASM).
- Raw text -