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

From: Erwin Authried (eauth@softsys.co.at)
Date: Thu Jan 06 2000 - 13:14:24 EST

You are right, Vadim, the data offsets must be the same.
You will have to make sure that the linker puts the
library data segment before the application's data.
And you have to link against ALL library files, instead
of the objects needed by each application.
The only disadvantage that I can see now is the fact
that each application reserves data+bss for the full library.
This way, the library text segment should be equivalent for
all applications, right?



        .data libc/app1 (starting at offset 0)
        .data app1

        .data libc/app2 (starting at offset 0)
        .data app2
        .text app1
        .text app2

        .text libc (common for all app's)

Vadim Lebedev[SMTP:vlebedev@aplio.fr] wrote:
> Ok,
> I'll try to explain:
> suupose you have library rootine foo(), which updates global variable
> errno, with the code like this:
> foo()
> {
> errno = 5;
> }
> it will be compiled to simething like:
> 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.....
> Regards
> Vadim

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