Re: -z preinitarray

From: Casper H.S. Dik (Casper.Dik_at_Sun.COM)
Date: 04/30/05


Date: 30 Apr 2005 08:40:05 GMT


"Dan Koren" <dankoren@yahoo.com> writes:

>Does this imply, in effect, that there is no way for an
>interposer shared library (e.g. a memory allocator) to
>arrange to always initialize itself first, before any
>other library or code in the main executable, and
>regardless of how the main executable may have
>been built?

Not that reliably; but there are two "ld" flags
an interposer should use:

        -z initfirst -z interpose

-z initfirst has the effect you want (in the absence
of other such objects) and -z interpose is an absolute
requirement for interposers.

Casper

-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Quantcast