From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] framework for building modules externally
Date: Wed, 05 Nov 2008 22:41:20 +0100 [thread overview]
Message-ID: <49121300.2050506@t-online.de> (raw)
In-Reply-To: <20081105094240.GA12201@thorin>
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
next prev parent reply other threads:[~2008-11-05 21:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-01 12:32 [PATCH] framework for building modules externally Robert Millan
2008-11-01 19:02 ` Robert Millan
2008-11-04 18:55 ` Vesa Jääskeläinen
2008-11-04 19:07 ` Robert Millan
2008-11-04 19:13 ` Vesa Jääskeläinen
2008-11-04 19:39 ` Robert Millan
2008-11-05 6:57 ` Christian Franke
2008-11-05 9:42 ` Robert Millan
2008-11-05 21:41 ` Christian Franke [this message]
2008-11-06 14:52 ` __FILE__ (Re: [PATCH] framework for building modules externally) Robert Millan
2008-11-06 21:10 ` Christian Franke
2008-11-07 19:02 ` Robert Millan
2008-11-10 20:39 ` Christian Franke
2008-11-06 14:54 ` [PATCH] framework for building modules externally Robert Millan
2008-11-06 20:43 ` Christian Franke
2008-11-07 19:05 ` Robert Millan
2008-11-08 11:33 ` Robert Millan
2008-11-10 20:44 ` Christian Franke
2009-04-10 23:19 ` phcoder
2009-04-13 13:55 ` Robert Millan
2008-11-05 9:51 ` Robert Millan
2008-11-08 11:29 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49121300.2050506@t-online.de \
--to=christian.franke@t-online.de \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.