From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EZnvq-0007Ga-Ia for mharc-grub-devel@gnu.org; Wed, 09 Nov 2005 06:15:59 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZnvc-00073M-Cd for grub-devel@gnu.org; Wed, 09 Nov 2005 06:15:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZnvS-0006vC-A0 for grub-devel@gnu.org; Wed, 09 Nov 2005 06:15:35 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZnrv-0005J8-Bu for grub-devel@gnu.org; Wed, 09 Nov 2005 06:11:56 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZnru-00079D-Mt for grub-devel@gnu.org; Wed, 09 Nov 2005 06:11:55 -0500 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id F24358892 for ; Wed, 9 Nov 2005 12:10:36 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 03392-01 for ; Wed, 9 Nov 2005 12:10:36 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 1A1F489B4 for ; Wed, 9 Nov 2005 12:10:36 +0100 (CET) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 9C86AC047 for ; Wed, 9 Nov 2005 12:10:35 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <87wtjibufi.fsf@student.han.nl> <7e77098236cf144d2d2aa39833380e21@penguinppc.org> From: Marco Gerards Date: Wed, 09 Nov 2005 12:10:38 +0100 In-Reply-To: <7e77098236cf144d2d2aa39833380e21@penguinppc.org> (Hollis Blanchard's message of "Wed, 9 Nov 2005 00:02:32 -0600") Message-ID: <8764r2vzyp.fsf@student.han.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-cn.han.nl Subject: Re: Generating init and fini functions X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2005 11:15:54 -0000 Hollis Blanchard writes: > On Nov 8, 2005, at 5:18 PM, Marco Gerards wrote: >> >> At the moment I am working on things that irritate me while I am >> working on GRUB. One thing is writing a duplicate _init and _fini >> function (duplicate because it already is added in GRUB_MOD_INIT). >> And another thing that irritates me is that I have to add a init line >> to grub-emu. >> >> Here is a patch that solves that. First I removed all the init and >> fini functions and let GRUB_MOD_INIT and GRUB_MOD_FINI generate these >> functions. I have added a script that creates a header file with all >> the function prototypes for these generated functions. And finally I >> have added a script that can generate a C file with the functions >> `grub_init_all' and `grub_fini_all'. > > This is good. :) > > The way Linux does this, avoiding shell scripting, is by inserting > function pointers into a special ELF section, and that section is > looped over using linker symbols defining the beginning and end. Right, but this is not for modules, but for the cases that modules are not used. And this matches the way how other scripts in GRUB 2 work. -- Marco