Mail Archives: djgpp-workers/1999/10/26/09:02:14
When crt0.S allocates memory for the stubinfo structure, it doesn't check
whether the allocation failed (while this is not very likely, it's
possible, and I can send you a version of MWDPMI for which it does). The
following patch is only meant to indicate the place of the problem, it
doesn't solve it since the exit code references __stubinfo, and I'm not
sure how to fix that. I was also wondering why the code at no_memory
(currently called only when stack can't be allocated) doesn't print an
error message. BTW, MWDPMI is available at
http://www.helsinki.fi/~peuha/english/djgpp/mwdpmi00.zip ; please try it
and tell what you think.
Index: crt0.S
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/crt0/crt0.S,v
retrieving revision 1.4
diff -c -r1.4 crt0.S
*** crt0.S 1999/08/11 06:24:37 1.4
--- crt0.S 1999/10/25 12:51:11
***************
*** 238,243 ****
--- 238,245 ----
movl STUBINFO_SIZE, %eax
pushl %eax
call ___sbrk
+ cmpl $-1, %eax
+ je no_memory
movl %eax, __stubinfo
movl %eax, %edi
.byte 0x64 /* fs: */
--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
- Raw text -