From: Erwin Authried (eauth@softsys.co.at)
Date: Thu Jul 20 2000 - 16:47:49 EDT
Bjorn Wesen[SMTP:bjorn.wesen@axis.com] wrote:
...
> > 8) implement shared libraries
>
> We did that for our uclinux version. But due to the same problem as in
> fork() and 4), you can only share on the flash and not in-core. Actually
> we have a dependency graph among functions, objects and data in the
> libraries, so those things that don't access global data can indeed be
> shared but in uclibc for example that is quite a small part IIRC.
>
> The sharing in flash saves some precious bytes of flash though - better
> saving some in flash than in DRAM if the choice has to be made.
>
> -Bjorn
>
With the PIC compiler on the uCsimm, data is adressed relative to A5.
What I'd like to do:
* Put the C library to a fixed location in flash. With every application, exactly
the same libc module is included. The linker has to take care that this
module starts at the same, fixed location. The libc part can be discarded
by the linker, since it is available in flash.
* The C library's data+bss must start at offset 0, the application's data
follows afterwards. This way, the code for the library module is identical for
every application.
* The only downside of this method is the fact that data+bss segment
for the libc is wasted in RAM for libc parts that are not used by the application.
This effect can be minimized by excluding those library parts that use
much data+bss. Those modules can be linked in the usual way, if the
application needs them.
* The application must be compiled with 32-bit PIC from my gcc patch to be
able to adress the fixed-libc library part.
With this concept, the size of libc wouldn't matter that much since
it occupies flash space only once. The method will only work if
the code is executed directly from flash.
-Erwin
Application data:
A5: fixed-libc DATA+BSS
application's DATA+BSS
Text segments for applications and libc in flash:
app1 TEXT
additional libc-modules1 TEXT
app2 TEXT
additional libc-modules2 TEXT
...
fixed-libc TEXT (On a fixed location!!)
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/
This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:15 EDT