Mail Archives: djgpp/1997/06/01/22:50:21
From: | brendan AT jove DOT acs DOT unt DOT edu (Matthew Brendan Grantz)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Help with COFF & __main
|
Date: | 2 Jun 1997 00:44:35 GMT
|
Organization: | University of North Texas
|
Lines: | 18
|
Message-ID: | <5mt51j$ihf@hermes.acs.unt.edu>
|
NNTP-Posting-Host: | jove.acs.unt.edu
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
The DXE routines that came with DJGPP are, at best, incomplete, and I
have been writing some of my own. Unfortunately, I know little about
what I am doing, and most of what I have done is through trial and
error. I have managed to make a program that will open a DJGPP COFF,
extract all the functions, and relocate them. All except for one, that
is: main(). It requires the relocation of a relative symbol called
__main. This symbol can easily be aquired by including a line in the
loading program, something like
extern unsigned __main;
But using this as a relocation pointer doesn't work. Using a pointer to
this as a relocation doesn't work. As the matter of fact, I can't
manage to fudge this into functioning. Is it POSSIBLE to execute the
main() function in a .O file by loading and relocating it?
-Matt
brendan AT jove DOT acs DOT unt DOT edu
- Raw text -