Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kxq84-0002j4-Jb for mharc-grub-devel@gnu.org; Wed, 05 Nov 2008 16:41:32 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kxq82-0002iD-Av for grub-devel@gnu.org; Wed, 05 Nov 2008 16:41:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kxq80-0002hR-Lj for grub-devel@gnu.org; Wed, 05 Nov 2008 16:41:29 -0500 Received: from [199.232.76.173] (port=48936 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kxq80-0002hN-Dv for grub-devel@gnu.org; Wed, 05 Nov 2008 16:41:28 -0500 Received: from mailout08.t-online.de ([194.25.134.20]:36417) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kxq80-0001Rg-73 for grub-devel@gnu.org; Wed, 05 Nov 2008 16:41:28 -0500 Received: from fwd04.aul.t-online.de by mailout08.sul.t-online.de with smtp id 1Kxq7z-00006W-03; Wed, 05 Nov 2008 22:41:27 +0100 Received: from [10.3.2.2] (r1XfneZ6ghogsmbIZUytenJzO4hjWmijnev942Uq4Xo3L2DMJCEWwWYCU5V7FW4ZVF@[217.235.239.162]) by fwd04.aul.t-online.de with esmtp id 1Kxq7v-0W3IS80; Wed, 5 Nov 2008 22:41:23 +0100 Message-ID: <49121300.2050506@t-online.de> Date: Wed, 05 Nov 2008 22:41:20 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 MIME-Version: 1.0 To: The development of GRUB 2 References: <20081101123229.GA14438@thorin> <20081101190204.GB4639@thorin> <49109AB8.4010509@nic.fi> <20081104190751.GA25519@thorin> <49109EE7.6050406@nic.fi> <20081104193911.GA26419@thorin> <491143E2.4040705@t-online.de> <20081105094240.GA12201@thorin> In-Reply-To: <20081105094240.GA12201@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: r1XfneZ6ghogsmbIZUytenJzO4hjWmijnev942Uq4Xo3L2DMJCEWwWYCU5V7FW4ZVF X-TOI-MSGID: bb55a9d5-c5e1-44c8-9286-3f7ff74d6108 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] framework for building modules externally 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, 05 Nov 2008 21:41:30 -0000 Robert Millan wrote: > On Wed, Nov 05, 2008 at 07:57:38AM +0100, Christian Franke wrote: > >> Alternative: Export a symbol describing the ABI version in kernel >> ("grub_abi_3_14"). >> > > That requires more bytes than a 32-bit integer. > > The symbol value does not matter, the symbol name string provides enough space to describe any version. GCC apparently uses a similar method ("_gcc/gxx_personality_*") to ensure that the correct libgcc is linked. >> Access this symbol in each module (this can be hidden >> in GRUB_MOD_INIT). >> > > And this adds code in every module, but for non-external modules we already > have reassurance that their abi is consistent (users should never bypass > grub-install; if they do, it's likely going to break for them anyway). > > I understand there's a minor benefit for programmers of external modules, > but both things are at the expense of extra size to kernel and core.img > modules. External modules will only provide non-essential functionality, so > it's not a problem they have to check the ABI IMHO. > > I agree, such a check is not necessary for the non-external modules. But, exporting one extra "grub_abi_VERSION" symbol would only require one entry in the kernel symbol table and no other code. Then, a module author has the option to check the ABI version by importing this symbol (possibly by simply adding '-u grub_abi_VERSION' to ld command) -- Christian Franke PS: The current use of __FILE__ may also add extra unexpected size: For packaging, configure is often run outside of $srcdir with a absolute path name. This may result in long __FILE__ strings, like /home/maintainer/packaging/grub/tmp/grub-1.96+20081105-1/src/grub-1.96/kern/disk.c