Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NNw8K-0001dA-FA for mharc-grub-devel@gnu.org; Thu, 24 Dec 2009 17:26:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNw8I-0001Xw-BW for grub-devel@gnu.org; Thu, 24 Dec 2009 17:26:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNw8D-0001K5-A1 for grub-devel@gnu.org; Thu, 24 Dec 2009 17:26:09 -0500 Received: from [199.232.76.173] (port=52836 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNw8D-0001Jp-4b for grub-devel@gnu.org; Thu, 24 Dec 2009 17:26:05 -0500 Received: from xvm-190-8.ghst.net ([217.70.190.8]:58747 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NNw8C-0007Q8-QL for grub-devel@gnu.org; Thu, 24 Dec 2009 17:26:05 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1NNvvI-0000Av-LW for grub-devel@gnu.org; Thu, 24 Dec 2009 23:12:44 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1NNvvH-0003La-RB for grub-devel@gnu.org; Thu, 24 Dec 2009 23:12:43 +0100 Date: Thu, 24 Dec 2009 23:12:43 +0100 From: Robert Millan To: The development of GNU GRUB Message-ID: <20091224221243.GT12122@thorin> References: <4B32821F.6050607@labri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Non-static variables and nested function pointers [bug #28392] X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 22:26:11 -0000 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 > access local variables, which require an executable stack. 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 We added this for NetBSD in fact. In that platform, GCC generates references to this function, which are usually satisfied by libc, but we don't link with libc, so we made it happy with an empty stub. But this is only supposed to happen when building real GRUB. For util/ stuff, we should use the libc facility instead. Maybe that's not the case? -- Robert Millan "Be the change you want to see in the world" -- Gandhi