This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Speeding up the dynamic linker with 100s of DSOs?


On Fri, 2006-01-27 at 12:11 +0000, Nix wrote:
> Interposing via LD_PRELOAD is more common. dmalloc could work that way
> (but doesn't).

	Sure.

> Symbol interposition is a lovely *idea* if you have a library with a
> strict ABI and want to alter its behaviour from other libraries.

	Sure - as an idea it's certainly elegant.

>  And it has horrible consequences for performance and definite negative
> consequences for reliability, as you note.

	Quite.

> I think perhaps interposition should be something like PT_GNU_STACK,
> turnable-on by ELF binaries that explicitly declare that they need it
> (and when it's turned on it obviously `contaminates' the whole process);

	Well - of course, my -Bdirect implementation provides a way to do
direct (non-interposing) linkage, in a way that honors linking with a
mix of old & new style libraries, and handles the tricky C++ vague
linkage issues - so it's nearly what you ask for. Clearly though you
check for DT_DIRECT rather than the absence of something else. Of course
on Solaris the (somewhat different) -Bdirect support is there as
standard & widely used.

> (Obviously, using LD_PRELOAD would also enable interposition.

	Sure - as soon as you LD_PRELOAD we turn all -Bdirect stuff off - of
course, it'd be trivial to optimize that, but would require some
re-factoring, that'd look unpleasant in patch form.

> LD_PRELOAD is definitely the instance of interposition that would have
> people screaming if we took it away, given how many nifty debugging
> hacks and diagnostic tricks it enables.)

	Of course /me uses it himself all the time.

	HTH,

		Michael.

-- 
 michael.meeks@novell.com  <><, Pseudo Engineer, itinerant idiot


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]