From sacadmin Tue Dec 19 11:22:24 2006
Received: from jurassic.eng.sun.com (jurassic.SFBay.Sun.COM [129.146.226.130])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id kBJJMOY6015019
	for <psarc@sac.sfbay.sun.com>; Tue, 19 Dec 2006 11:22:24 -0800 (PST)
Received: from [129.146.226.100] (chaz.SFBay.Sun.COM [129.146.226.100])
	by jurassic.eng.sun.com (8.13.8+Sun/8.13.8) with ESMTP id kBJJMMPI666545
	for <psarc@sac.sfbay.sun.com>; Tue, 19 Dec 2006 11:22:22 -0800 (PST)
Message-ID: <45883BA7.4030207@sun.com>
Date: Tue, 19 Dec 2006 11:21:11 -0800
From: Rod Evans <Rod.Evans@sun.com>
Reply-To: Rod.Evans@sun.com
Organization: Sun Microsystems Inc.
User-Agent: Mail/News 1.5.0.4 (X11/20060731)
MIME-Version: 1.0
To: psarc@sac.sfbay.sun.com
Subject: 2006/714: ld(1) mapfile: symbol interpose definition
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 1980

I'm sponsoring the following case for myself.   This case qualifies for
Architectural self-review, but I wish to record the following
information.

------------------------------------------------------------------------

An object can be defined to be an interposer using ld(1)'s -zinterpose
option.  This option results in all global symbols offered by the object
to act as interposers.  Identifying interposers is important within a
directly-bound environment as this identification ensures the interposer
intercepts any directly-bound symbol binding.

Work on direct bindings has uncovered numerous applications that provide
one or two symbols that act as interposers.   Identifying the whole
object as -zinterpose is a rather large hammer, as the evolution of the
dependencies of these applications may result in additional symbols
acting as interposers when this was not the intent of the original
application designed.

ie.  an application defines foo() and bar(), and foo() is intended to
interpose on libc's version of foo().  bar() is simply used by the
application.  libc gets updated with a new interface bar().  The
application will now interpose on bar().

------------------------------------------------------------------------

A new mapfile symbol directive will allow individual symbols within
a dynamic executable to be identified as interposers:

	{
		global:
			foo = INTERPOSE;
	};

At runtime, should direct bindings be in effect, any interposer is first
inspected to determine if an appropriate binding can be established.  An
application that has been built with INTERPOSE directives will allow just
the symbols defined as interposers to intercept any direct bindings.
Other global symbols within the application will remain available to any
standard symbol search as they are today.

------------------------------------------------------------------------

Release Binding:               Patch/Micro
mapfile INTERPOSE directive    Committed

-- 

Rod.

