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 trampolines to access local variables, which require an executable stack.

Thanks a lot for your answer ! That explains it :-)

I tried linking with -Wl,-z,execstack, but with no success, even though readelf shows a new header with this option:

Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

But the problem may come from NetBSD's default policy of non-executable stack on i386 (http://www.netbsd.org/docs/kernel/non-exec.html).

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 :).

 --S
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to