Re: [uCsimm] Re: [UCLINUX] Fw: 32-bit PIC patches for the uCsimm !

From: Donald J Dionne (jdionne@ns1.rt-control.com)
Date: Thu Jan 06 2000 - 14:31:22 EST


...

> foo:
> mov d1,5
> mov errno(a5), d1
> ret
>
> Now, when you link this library to the aplllication A, errno offset from the
> beginnig of data segment will be let's say 0x100
> and when you link the library to application B the offset could be 0x200...
> In any case the actual contents of the libaray .text
> segment is different, hence you can't do code sharing.....

The trick here is to collect the library global data and bss into a seperate
section _after_ the executable's .bss and .data. The library then uses a
trampoline on the stub to update %a5 to point at the start of it's own data
when it's called. The executable just uses %a5 normally.

Now I we just need to ask binutils nicely to collect these blocks of
.data and .bss... That should be fairly easy.

Jeff.

>
> Regards
> Vadim
>
>
>
> ----- Original Message -----
> From: Erwin Authried <eauth@softsys.co.at>
> To: Vadim Lebedev <vlebedev@aplio.fr>; <ucsimm@uclinux.com>
> Cc: <uclinux@c3po.kc-inc.net>
> Sent: Thursday, January 06, 2000 12:50 AM
> Subject: Re: [UCLINUX] Fw: 32-bit PIC patches for the uCsimm !
>
>
> > Hello Vadim,
> >
> > maybe I'm missing something obvious, but I don't see any problem right
> now.
> > Maybe it's simply to late for thinking ;-)
> > Currently, the text segment of the library of the library is linked with
> every
> > application. If the complete library is put into a free space with a
> common
> > adress, and the link script is modified to take care of that, the library
> > routines
> > can be executed there because all applications share the same adress
> space,
> > and all the call offsets may be 32 bit with the patch. Of course, all
> > applications
> > have to be linked with the same, complete library.
> > The data + bss segment is handled like before. That shouldn't have to do
> > anything with the kernel, there no such stuff like usage-count or
> something
> > similar to handle. Please let me know if I'm missing something important.
> >
> > Regards,
> >
> > Erwin
> >
> >
> > Vadim Lebedev wrote:
> >
> > > This shared library stuff is more complicated than you think,
> > > fo example what you're going to do with shared library static data?
> > > Another point: the kernel should be modified to handle correctly
> shared
> > > libraries....
> > >
> > > Best regards
> > > Vadim
> > >
> > > ----- Original Message -----
> > > From: Erwin Authried <eauth@softsys.co.at>
> > > To: <ucsimm@uclinux.com>
> > > Cc: <uclinux@c3po.kc-inc.net>
> > > Sent: Wednesday, January 05, 2000 10:49 PM
> > > Subject: [UCLINUX] Fw: 32-bit PIC patches for the uCsimm !
> > >
> > > > I have just recognized that it is not necessary to recompile
> > > > the whole library, sorry. There are just a few library-internal calls
> that
> > > > cannot be relocated because the call is made between the start
> > > > of the text segment to the end of the text segment where the libraries
> > > > are located. When those few calls are fixed, the rest of the library
> can
> > > use the
> > > > faster 16-bit relocation.
> > > >
> > > > Another idea: When all the libraries are linked to some fixed
> > > > location, they could now be shared between all applications, without
> > > > the overhead of having the same library attached to each
> > > > application.
> > > >
> > > > -Erwin
> > > >
> >
> >
>
> This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/
>

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:33 EST