Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: See FS#10756: Section for initializing functions

See FS#10756: Section for initializing functions

From: Thomas Martitz <thomas.martitz_at_student.htw-berlin.de>
Date: Tue, 03 Nov 2009 14:26:12 +0100

I've some code here that creates a dedicated section for init functions
(i.e. those that are only called once and very early), inspired by the
Linux Kernel.

There's little point in keeping that code in otherwise usable RAM.
That's why my patch would copy move that code into a section that's
overwritten later.

For example, as my current patch works for e200v1: The code is in the
same address area as bss. Before bss is zeroed, the init code is copied
to the codec buffer. After calling main(), the init code is called from
the codec buffer. The bss, following sections are moved over the init
code, which effectively frees the code size init functions take. I use a
very similar approach as iram code does.

Where the init code lands (plugin or codec buffer) and if the mechanism
is actually used is upto a single #ifdef in config.h and the target's
app.lds

On my e200, it yields ~6.7k. I would like to know if this kind of
self-modifying code is considerable for SVN, or if it's too dirty and/or
dangerous. -6.7k isn't *that* much.

Best regards.
Received on 2009-11-03


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa