Re: Non-static variables and nested function pointers [bug #28392]

2009-12-26 Thread Grégoire Sutre
Robert Millan wrote: The following snippet (kern/misc.c) comes to mind: #ifdef NEED_ENABLE_EXECUTE_STACK /* Some gcc versions generate a call to this function in trampolines for nested functions. */ void __enable_execute_stack (void *addr __attribute__ ((unused))) { } #endif I was away fr

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-24 Thread Robert Millan
On Wed, Dec 23, 2009 at 02:17:06PM -0800, Seth Goldberg wrote: > Hi, > > Your problem is probably lack of executable stack support, or at least > you haven't linked your application with a linker mapfile that specifies > an executable stack -- the callbacks require the use of trampolines to >

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Seth Goldberg
Quoting Grégoire Sutre, who wrote the following on Thu, 24 Dec 2009: Seth Goldberg wrote: Exactly -- the presence of the execstack attribute in the segment is merely a request -- the kernel is free to discard it, and many OSes do, as you've found :). The problem is more complex: I tried a

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Seth Goldberg
Quoting Grégoire Sutre, who wrote the following on Thu, 24 Dec 2009: Seth Goldberg wrote: Exactly -- the presence of the execstack attribute in the segment is merely a request -- the kernel is free to discard it, and many OSes do, as you've found :). The problem is more complex: I tried

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Grégoire Sutre
Seth Goldberg wrote: Exactly -- the presence of the execstack attribute in the segment is merely a request -- the kernel is free to discard it, and many OSes do, as you've found :). The problem is more complex: I tried a simple example with a pointer to a nested function, and it runs withou

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Seth Goldberg
Quoting Grégoire Sutre, who wrote the following on Thu, 24 Dec 2009: Seth Goldberg wrote: Your problem is probably lack of executable stack support, or at least you haven't linked your application with a linker mapfile that specifies an executable stack -- the callbacks require the use of

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Grégoire Sutre
Seth Goldberg wrote: Your problem is probably lack of executable stack support, or at least you haven't linked your application with a linker mapfile that specifies an executable stack -- the callbacks require the use of trampolines to access local variables, which require an executable stac

Re: Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Seth Goldberg
Hi, Your problem is probably lack of executable stack support, or at least you haven't linked your application with a linker mapfile that specifies an executable stack -- the callbacks require the use of trampolines to access local variables, which require an executable stack. --S Quotin

Non-static variables and nested function pointers [bug #28392]

2009-12-23 Thread Grégoire Sutre
Hi, I am trying to add NetBSD specific code to util/hostdisk.c in order to make grub-probe work. This part is almost finished. However, I had a hard time dealing with segfaults in callbacks (hook function pointers) in a number of places of the vanilla code. Actually, I get segfaults in gru