grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating init and fini functions


From: Marco Gerards
Subject: Re: Generating init and fini functions
Date: Wed, 09 Nov 2005 12:10:38 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Hollis Blanchard <address@hidden> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]