PIC and shared libraries (was Re: Fundamental defect of the concept of shared libraries)
Masataka Ohta
mohta at necom830.cc.titech.ac.jp
Mon May 27 19:13:45 AEST 1991
Sorry for my misunderstanding about PIC and shared libraries.
In article <8029 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
>>As I already said, PIC (Position Independent Code) imposes several
>>restrictions to hardware, which many architectures can't obey.
>
>Which architectures?
If the code must be strictly Position Independent, MIPS, HP-PA, RS/6000 and
many other architectures can not support sharing of PIC, because of virtual
address aliasing and inverted page tables. I am corrct here.
The problem is that, to support shared libraries, strict PIC is not required.
Instead, it is required that the same code runs if the relocation is
multiple of some constant. To support many libraries at once, the
constant should be small enough compared to the size of address
space. For example, with most segmented architectures, Segment number
Independent Code is enough, though extra overhead to reload segment
registers costs for inter-object-module call.
So, the remaining problem is the performance.
Masataka Ohta
More information about the Comp.unix.internals
mailing list