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: [PATCH] Add LD_PRELOAD_INIT_EARLY [BZ #14379]


* Vincent Whitchurch:

> Currently, DSOs preloaded with LD_PRELOAD are initialized after
> linked-in DSOs, unless dependencies require otherwise.
>
> However, in some cases it is desirable that preloaded DSO are
> initialized before linked-in DSOs (unless dependencies require
> otherwise).  For example, when malloc is overloaded using a preloaded
> DSO for the purpose of heap profiling, we ideally want the preloaded DSO
> to be initialized before other DSOs so that it has a chance to set up
> its accounting code before their initializers are called.
>
> Changing the default behaviour could lead to breakage, so add a new
> environment variable, LD_PRELOAD_INIT_EARLY, the presence of which will
> ask preloaded libraries to be initialized as early as possible and
> finalized as late as possible.  If multiple DSOs are preloaded, DSOs
> earlier on the LD_PRELOAD list will be initalized earlier and finalized
> later than DSOs present later on the list.
>
> Note that dependencies are still taken into account: DSOs which the
> preloaded DSO depends on are correctly initalized before it and
> finalized after it.

Maybe we should LD_PRELOAD to use this behavior instead?  Isn't that
what users expect?

Thanks,
Florian


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