[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared Libs for MiNT
>> But problems arise if the shared library calls functions (passed as pointers
>> to the shared library routine) that are part of the text segment of the
>> application that is compiled -mbaserel. (One prominent candidat is the qsort
>> function). Then when the comparision function that is passed to qsort is
>> called the base pointer would still point to the DATA/BSS segment of the
>> library where the application code expects it to point to the app's own
>> DATA/BSS segment.
>
>Not only function pointers will present problems. Global symbols like _errno
>must also be shared between executable and library, but *not* between different
>executables.
>In HP-UX, for example, *all* global symbols are accessed by indirect reference
>from a shared library; when an executable first binds to the library, it has
>to set up an indirection table to resolve these references.
I think the best solution would be if we somehow could force the linker to place
the global variables declared by the shared library at the start of each
program's
global data segment. That way, we don't have to fiddle with A4 when
traversing the border between shared lib and program.
Other problems to be solved : how do we install the shared lib and how do
we make
sure we are linking with a compatible version at runtime ? I suppose these
questions
are already solved in many different ways for several Unix versions, but
I'm not a
real Unix hacker ...
And don't forget to make an /sbin directory !!!
Joris.