I've been working for some time on elf loader for codecs and plugins.
Currently it is in Proof-of-concept stage. Latest snapshot is
available here: http://gerrit.rockbox.org/r/#/c/326/
What can it bring good for rockbox:
- It removes the need for overlays. If plugin load fails in pluginbuf
due to lack of ram, audiobuf is grabbed and plugin is loaded there.
This is transparent and properly coded plugin doesn't need to know
where it is loaded.
- It opens possibility to have multiple plugins loaded at the same time.
- It opens the possibility to unify codecbuf and pluginbuf and
moreover share iram between codecs and plugins (well this is more
theoretical one as codecs usually utilize pretty much iram)
- It is the first step to move some functionality from the core to the
loaded on demand plugins (core plugins?)
- Maybe even dynamicaly sized pluginbuf and codecbuf

TODOs/others:
If this change would be integrated into mainline code it implies a few things:
- SH and MIPS toolchains are too old to support this reliably and need updating.
- It is questionable if this is desired thing for SH. This targets are
very limited both in binsize allowed and in ram. If someone move some
parts of the core to the loaded on demand core plugins (like database
for example) it may still be beneficial. New toolchain with -flto and
-Os will more or less counterbalance elfloader size. It is technically
possible to use old scheme for SH and elfloader for others but it is a
bit of work to properly ifdef code, makefiles and linker scripts.

Before I move forward I would like to hear Your opinion about all
this. Do you see inclusion of such loader beneficial? What to do with
SH?