delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/06/19/09:36:22

Date: Thu, 19 Jun 1997 15:35:24 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: patch for v2load.c
Message-Id: <Pine.HPP.3.95q.970619153414.4123L-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019