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

Re: Including non-PIC code in a shared library?

Charles Briscoe-Smith <cpbs@debian.org> writes:
> I asked about this on ggi-devel, and the responses I got indicated that
> it probably wasn't a problem, because there would only ever be one
> libGGI program running the xf86dga target at once on a given machine
> (not true for multi-headed machines) and that if multiple copies were
> run, the kernel would simply load multiple copies of the code.  I'm a
> little worried that mixing PIC and non-PIC code might do some other harm.
> Does it?  Or will it just make this "shared" object unsharable?

It will "work" it's just very inefficient.

The loader needs to fix every memory reference in the code to point to the
location it loaded the library code. It also can't load the library using
shared memory, it has to make private mappings for each process using the

It's not the end of the world, it just defeats the purpose of using shared
libraries. In fact it's worse than statically linking which can at least
share memory across invocations of the same executable.


To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: