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

Re: question regarding prelinking (was: (inc. note from dpkg developers) (was:Bug#XXXXXX: (far too many packages) needs rebuilt for prelinking))

Emile van Bergen <emile-deb@evbergen.xs4all.nl> writes:

> But then, notice that L uses library M. And suppose that in process X, M
> got mapped at a different address than where M got mapped in process Y.
> I see no reason for that to be impossible or unlikely, if applications X
> and Y each map a different set of libraries before mapping L.
> That would mean that all instructions in L that refer to functions or
> data in library M, will have to be fixed up using different addresses,
> for the applications X and Y. That means that the pages of L containing
> those instructions, can suddenly no longer be shared among X and Y.

To solve this problem, the ELF format uses tables for all the
addresses needed from other libraries, which the dynamic linker fills
in as needed at runtime.  (IIRC this is called the global offset
table, or GOT.)  So there are pages which can't be shared for the
reasons you outlined, but they're all isolated and compressed into a
minimal number of pages.
Daniel Schepler              "Please don't disillusion me.  I
schepler@math.berkeley.edu    haven't had breakfast yet."
                                 -- Orson Scott Card

Reply to: