FS#10756 - Free unused init code
Opened by Thomas Martitz (kugel.) - Tuesday, 03 November 2009, 13:24 GMT
Last edited by Thomas Martitz (kugel.) - Friday, 02 April 2010, 17:10 GMT
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.
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.
Where the init code lands (codec or plugin buffer), and if the mechanism is really used, is entirely up to 1 ifdef in config.h and the target's app.lds.
Friday, 02 April 2010, 17:10 GMT
Reason for closing: Accepted
Additional comments about closing: Committed as of r25013.