[patch i386]: Enable trampoline code for nx-protected stack Windows

Kai Tietz Kai.Tietz@onevision.com
Mon Apr 7 12:16:00 GMT 2008


gcc-patches-owner@gcc.gnu.org wrote on 07.04.2008 11:14:23:

> On Sun, Apr 6, 2008 at 5:57 AM, Kai Tietz <ktietz70@googlemail.com> 
wrote:
> > Hi,
> >
> >  Till MS uses the nx-protection feature of amd64 and itanium cpu's,
> >  trampoline calls via stack caused an exception. This feature was
> >  introduced by XP SP2 and newer oses have this feature too.
> >  This patch uses the ENABLE_EXECUTE_STACK macro as netbsd does.
> >
> >  2008-04-05  Kai Tietz  <kai.tietz@onevision.com>
> >
> >         * config/i386/mingw32.h (ENABLE_EXECUTE_STACK): New.
> >         (MINGW_ENABLE_EXECUTE_STACK): New.
> >         * libgcc2.c (ENABLE_EXECUTE_STACK): Add include file
> >         windows.h for function declarations.
> >
> >  Is this patch ok for apply?
> >
> 
> What testcases fail without this patch? On what versions of windows?
> Thanks
> Danny

The testcases in gcc gcc.c-torture/execute/nestfunc-1*.c are affected 
failing on XP (32-bit) Service Pack 2 and for XP 64.
As I wrote above, all new Windows OSes with feature set of XP+SP2 running 
on amd64 or itanium CPUs are affected. See
google search "nx stack VirtualProtect". I found the article related to nx 
and .net by MS just on a German page, but I assume it exists in English, 
too.

Cheers,
  Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.



More information about the Gcc-patches mailing list