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 libc/app2 (starting at offset 0)
.text libc (common for all app's)
Vadim Lebedev[SMTP:email@example.com] wrote:
> I'll try to explain:
> suupose you have library rootine foo(), which updates global variable
> errno, with the code like this:
> errno = 5;
> it will be compiled to simething like:
> mov d1,5
> mov errno(a5), d1
> 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.....
This message resent by the firstname.lastname@example.org list server http://www.uClinux.com/
This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:33 EST