[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shared Libs



> Waldi wrote:
> >Sure, most library modules will want to use some static variables(*),
> >which must be allocated in different data sections for different pro-
> >cesses. So the trap code should pass the proper base address of a mo-
> >dules' data section before jumping to a function within that module.
> 
> Unless the shared library manages the data sections itself, in which case
> we'd avoid using up another register.

How shall the shared library do that? You have to keep a separate
instance of the data section for each process that uses the
library. So if you are not going to use some swapping trick (like in
the implementation of fork), you need to use position independent
code, i.e. use a base register in the code!

Regards
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