[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Loadable libraries urgently needed (was: Coreutils)
Le Tue, 10 Aug 2004 15:22:38 -0400
Mark Duckworth <mduckworth@atari-source.com> a écrit:
> This is a bit of a touchy subject but this coreutils, since we are
> linking statically is costing about 800+K for something like ls where as
> this tool used to be only 100-200K. This means the coreutils binary RPM
> is a whopping 47 megs! I've been trying to shrink binary sizes but to
> no avail. I must be missing something.
Unfortunately, it just shows how we urgently need to make libraries
loadable (and shareable using MMU), so we don't have to recompile all
packages depending on a library when it is updated.
Does anybody else think we should stop porting new software, and
concentrate on making this possible ?
I know it would need a bit of support from the kernel, but modifying the
a.out binary format we uses, to add a section relative to external
dependencies should be possible. There was a new header added to support
GNU binutils/gcc a.out format in an easier manner. The switch to ELF
format would be costly in terms of time, so maybe extending the GEMDOS
a.out format is a better option.
My proposal:
- 1. Add a new section, which marks external addresses (like the
relocation table), and give the function name, and the library name to
use.
- 2. On load, either the kernel, or a custom crt0.o seeks to load needed
libraries. In this case, we repeat step 2 recursively on this library,
taking care of not loading the same library twice -> infinite loop.
- 3. Once loaded, browse the section, and retrieve the needed pointers
from the loaded library.
- 4. ELF format defines _init() and _fini() to initialize and close
properly a library, so we can also use these names.
--
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Spécialité: Développement, jeux