Mail Archives: djgpp-workers/1997/06/19/09:36:22
And also the patch for v2load.c to load the stub correct
if we change sometimes the stub:
--- src/debug/common/v2load.c~ Tue Jul 23 22:57:48 1996
+++ src/debug/common/v2load.c Tue Jun 17 23:11:16 1997
@@ -50,9 +50,9 @@
int v2loadimage(const char *program, const char *cmdline, jmp_buf load_state)
{
- unsigned short header[3];
+ unsigned short header[5];
int pf,i, envp;
- unsigned coff_offset;
+ unsigned coff_offset,exe_start;
_GO32_StubInfo si;
unsigned long coffhdr[42];
unsigned start_eip, text_foffset, text_soffset, text_size, data_foffset;
@@ -73,7 +73,8 @@
coff_offset = (long)header[2]*512L;
if (header[1])
coff_offset += (long)header[1] - 512L;
- lseek(pf, 512, 0); /* Position of V2 stubinfo */
+ exe_start = (unsigned)header[4]*16;
+ lseek(pf, exe_start, 0); /* Position of V2 stubinfo */
read(pf, si.magic, 8);
if (memcmp(SIMAGIC, si.magic, 8) != 0) {
close(pf);
- Raw text -