Date: Wed, 5 Feb 2003 14:35:31 +0200 (EET) From: Esa A E Peuha Sender: peuha AT sirppi DOT helsinki DOT fi To: djgpp-workers AT delorie DOT com Subject: Checking for stack overflow Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Gcc apparently allows to define freely what instructions are used to allocate space from the stack. Since we have a fixed stack size, it would be good to check esp againt the stack limit every time it's changed. However, this needs two global symbols in crt0.o; one a variable to hold the current stack limit (equal to ___djgpp_stack_limit when esp points to application stack and equal to exception_stack when that is used), and the other a routine to jump to when the stack is overflown (which would print "out of stack" and exit since there's nothing else it can do). These symbols would need to be implemented first (preferrably before the 2.04 release), and gcc changed later to use them. Does that sound like something worth doing? -- Esa Peuha student of mathematics at the University of Helsinki http://www.helsinki.fi/~peuha/