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.
- See FS#10756: Section for initializing functions Thomas Martitz
-