RE: [uClinux-dev] RE: [UCLINUX] Old kernel, old argument, new (maybe) point(s)

From: Vadim Lebedev (vlebedev@aplio.fr)
Date: Thu Jul 20 2000 - 15:00:45 EDT


Bjorn wrote:
|> 4) implement .text segment sharing (if you launch sh twice only the .text
|> segmnet will be shared between instances
|
|That is the same problem as with making fork() work. After all, two sh's
|with the same .text and different .data, BSS and brk is the same that you
|get after a fork :)

Actualy .text segment sharing should be pretty to use, because it already
work for
program running out of ROM... The only thing to do is to add some
houskepeing info
to avoid reloading a .text sgement which is already present in RAM...

|
|> 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
|

Well, actually this shared libary stuff is easier that one could think...
The gcc when used with -fPIC flag generates a PIC code which is ALMOST good
for ucLinux...
All data refernces to local static data are based on a static base register,
all data references to the global data are indirected throu8g GOT (Global
Offset Table)
the static base register is saved/loaded/restored inf function
prolog/epilogue.
all calls to public function are indirected through the stubs in PLT table.

To make this stuff work for ucLinux we should convince the compiler to skip
save/load/restore of the static base register in the function
prologue/epiloge. The S/L/R seqeunce
should be done in the PLT stubs instead....


Vadim




|This message resent by the uclinux-dev@uclinux.org list server
|http://www.uClinux.org/
|

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