[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared libs.
Michael Hohmuth wrote:
> > What still remainsw is the access to variables in the shared libraries
> > from outside of the library. If these variables were referenced from
> > the main program, the dynamic loader could just patch all references
> > to those variables in the executable (however, only if the executable
> > is not shared itself). Otherwise we end up in modifying the references
> > to those variables into defines, which call a wrapper function to
> > access the variable. I don't know whether this is feasible. It depends
> > on how many such references exist.
>
> I don't like both options. Is there a way to transmogrify external
> memory references into calls to automatically-generated wrappers at
> link time?
>
Just another idea (this time borrowed from Howard Chu
<9511162121.AA57636@troy.la.locus.com>): We'd actually introduce one
of these ugly modifiers (I wouldn't favor FAR) which could be expanded
into nothing if we want to link statically or into a "*" to add a
level of indirection if we are compiling for use with a shared
library. All those indirection cell will be allocated in the program's
data segment and will be filled in by the startup code which actually
links the library. However this time the startup code will get more
complicated and probably use mechanisms like dld to determine which
variables must be filled in.
Though I suspect, this is still not what you thought of. :-(
Wolfgang
----
Wolfgang Lux
WZH Heidelberg, IBM Germany Internet: lux@heidelbg.ibm.com
+49-6221-59-4546 VNET: LUX at HEIDELBG
+49-6221-59-3200 (fax) EARN: LUX at DHDIBMIP