changeset 5905:056b84d6bf52

4947191 OSNet should use direct bindings
author rie
date Thu, 24 Jan 2008 16:39:56 -0800
parents ac17ccc8902b
children 2e18cd516e53
files usr/src/cmd/Makefile.cmd usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com usr/src/cmd/dtrace/test/tst/i386/Makefile usr/src/cmd/lp/lib/papi/Makefile usr/src/cmd/perl/5.6.1/distrib/Makefile.lib usr/src/cmd/perl/5.8.4/distrib/Makefile.lib usr/src/cmd/sgs/ld/Makefile.com usr/src/cmd/sgs/libld/Makefile.com usr/src/cmd/sgs/packages/common/SUNWonld-README usr/src/cmd/sgs/rtld/common/elf.c usr/src/lib/Makefile.lib usr/src/lib/libast/mapfile-vers usr/src/lib/libldap5/Makefile.com usr/src/lib/libmp/i386/Makefile usr/src/lib/libmp/sparc/Makefile usr/src/lib/libnisdb/Makefile usr/src/lib/libproc/Makefile.com usr/src/lib/libsldap/Makefile.com usr/src/lib/nsswitch/ldap/Makefile.com usr/src/lib/pam_modules/ldap/Makefile.com usr/src/lib/passwdutil/Makefile.com usr/src/lib/print/libpapi-ipp/Makefile.com usr/src/lib/print/libpapi-lpd/Makefile.com usr/src/lib/print/libprint/Makefile.com usr/src/tools/scripts/check_rtime.1 usr/src/tools/scripts/check_rtime.pl usr/src/ucblib/Makefile.ucb
diffstat 27 files changed, 162 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/Makefile.cmd	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/Makefile.cmd	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -138,7 +138,7 @@
 LDLIBS =	$(LDLIBS.cmd)
 
 LDFLAGS.cmd = \
-	$(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
+	$(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
 	$(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 
 LDFLAGS =	$(LDFLAGS.cmd)
--- a/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -66,7 +66,7 @@
 	$(INS.file)
 
 $(ROOTISAEXEC):
-	$(RM) $@; $(CP) -p /usr/lib/isaexec $@
+	-$(LN) $(ISAEXEC) $@
 
 $(ROOTBIN)/%: $(ROOTBIN)
 	$(INS.dir)
--- a/usr/src/cmd/dtrace/test/tst/i386/Makefile	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/dtrace/test/tst/i386/Makefile	Thu Jan 24 16:39:56 2008 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -32,7 +32,7 @@
 CLOBBER_FILES += helper_helper.o annotated_helper.o
 
 # For the helper test we require an executable data section.
-ustack/tst.helper.exe := LDFLAGS = -M$(MAPFILE.NES)
+ustack/tst.helper.exe := LDFLAGS += -M$(MAPFILE.NES)
 
 ustack/tst.helper.exe: ustack/tst.helper.o ustack/helper_helper.o
 	$(LINK.c) -o ustack/tst.helper.exe \
--- a/usr/src/cmd/lp/lib/papi/Makefile	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/lp/lib/papi/Makefile	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -56,8 +56,6 @@
 
 MAPFILES =	mapfile
 
-DYNFLAGS +=	$(BDIRECT)
-
 LIBS = $(DYNLIB)
 SRCS= $(OBJECTS:%.o=%.c)
  
--- a/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -76,6 +76,12 @@
 # There should be a mapfile here
 MAPFILES =
 
+# Disable perl from directly binding to itself, but allow perl to directly bind
+# to its dependencies (ie. map -Bdirect -> -zdirect).  Ensure lazy loading is
+# established (which is enabled automatically with -Bdirect).
+BDIRECT =	$(ZDIRECT)
+LDFLAGS +=	$(ZLAZYLOAD)
+
 # Add in the perl-specific flags (including largefile flags).
 CPPFLAGS += $(PERL_COREFLAGS) $(PERL_LFFLAGS)
 
--- a/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -82,6 +82,12 @@
 # There should be a mapfile here
 MAPFILES =
 
+# Disable perl from directly binding to itself, but allow perl to directly bind
+# to its dependencies (ie. map -Bdirect -> -zdirect).  Ensure lazy loading is
+# established (which is enabled automatically with -Bdirect).
+BDIRECT =	$(ZDIRECT)
+LDFLAGS +=	$(ZLAZYLOAD)
+
 # Add in the perl-specific flags (including largefile flags).
 CPPFLAGS += $(PERL_COREFLAGS) $(PERL_LFFLAGS)
 
--- a/usr/src/cmd/sgs/ld/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/sgs/ld/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -40,7 +40,7 @@
 MAPFILES =	../common/mapfile-intf $(MAPFILE.NGB)
 MAPOPTS =	$(MAPFILES:%=-M%)
 
-LDFLAGS +=	$(VERSREF) $(LAZYLOAD) $(BDIRECT) $(USE_PROTO) $(MAPOPTS) \
+LDFLAGS +=	$(VERSREF) $(LAZYLOAD) $(USE_PROTO) $(MAPOPTS) \
 		    $(VAR_LD_LLDFLAGS)
 LDLIBS +=	$(LDLIBDIR) $(LD_LIB) $(ELFLIBDIR) -lelf \
 		    $(LDDBGLIBDIR) $(LDDBG_LIB) $(CONVLIBDIR) $(CONV_LIB)
--- a/usr/src/cmd/sgs/libld/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/sgs/libld/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -82,8 +82,7 @@
 LINTFLAGS +=	-u -D_REENTRANT
 LINTFLAGS64 +=	-u -D_REENTRANT
 
-DYNFLAGS +=	$(BDIRECT) $(VERSREF) \
-		$(ZLAZYLOAD) $(USE_PROTO) '-R$$ORIGIN'
+DYNFLAGS +=	$(VERSREF) $(ZLAZYLOAD) $(USE_PROTO) '-R$$ORIGIN'
 
 $(VAR_POUND_3)DEFS=
 native:=	DYNFLAGS	+= $(CONVLIBDIR)
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README	Thu Jan 24 16:39:56 2008 -0800
@@ -1307,3 +1307,4 @@
 	PSARC/2008/006: make ld(1) -z combreloc become default behavior
 6634436 XFFLAG should be updated.  (link-editor components only)
 6492726 Merge SHF_MERGE|SHF_STRINGS input sections
+4947191 OSNet should use direct bindings  (link-editor components only)
--- a/usr/src/cmd/sgs/rtld/common/elf.c	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/cmd/sgs/rtld/common/elf.c	Thu Jan 24 16:39:56 2008 -0800
@@ -351,8 +351,8 @@
 	 * create an association between the caller and this dependency.
 	 */
 	if (nlmp && (((analyze_lmc(lml, lmco, nlmp) == 0)) ||
-	    (relocate_lmc(lml, lmco, clmp, nlmp) == 0) ||
-	    (bind_one(clmp, nlmp, BND_NEEDED) == 0)))
+	    (bind_one(clmp, nlmp, BND_NEEDED) == 0) ||
+	    (relocate_lmc(lml, lmco, clmp, nlmp) == 0)))
 		dip->di_info = nlmp = 0;
 
 	/*
--- a/usr/src/lib/Makefile.lib	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/Makefile.lib	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -171,7 +171,7 @@
 
 
 HSONAME=	-h$(SONAME)
-DYNFLAGS=	$(HSONAME) $(ZTEXT) $(ZDEFS) $(ZCOMBRELOC) \
+DYNFLAGS=	$(HSONAME) $(ZTEXT) $(ZDEFS) $(ZCOMBRELOC) $(BDIRECT) \
 		$(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 
 LDLIBS=		$(LDLIBS.lib)
@@ -247,7 +247,7 @@
 #
 $(DYNLIBCCC):=	DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) $(ZCOMBRELOC) \
 		$(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
-		$(NORUNPATH)
+		$(BDIRECT) $(NORUNPATH)
 
 
 # build rule for "portable" source 
--- a/usr/src/lib/libast/mapfile-vers	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libast/mapfile-vers	Thu Jan 24 16:39:56 2008 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -178,7 +178,7 @@
 	_ast_procclose;
 	_ast_procfree;
 	_ast_procopen;
-	_ast_procrun;
+	_ast_procrun =		NODIRECT;	# Allow libshell to override
 	_ast_putc_unlocked;
 	_ast_putchar_unlocked;
 	_ast_putenv;
--- a/usr/src/lib/libldap5/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libldap5/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -83,7 +83,7 @@
 		$(UTILOBJS:%.o=../sources/ldap/util/%.c)
 
 LIBS =		$(DYNLIB) $(LINTLIB)
-DYNFLAGS +=	$(ZNODELETE) $(BDIRECT)
+DYNFLAGS +=	$(ZNODELETE)
 
 CPPFLAGS=	$(COM_INC) $(CPPFLAGS.master)
 
--- a/usr/src/lib/libmp/i386/Makefile	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libmp/i386/Makefile	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -41,7 +41,7 @@
 
 $(OLIBRARY):	pics/pics_mp.o libmp.so.2 $(OMAPFILE)
 	$(CC) $(CFLAGS) -o $@ $(GSHARED) -h $(OLIBRARY) $(ZTEXT) $(ZDEFS) \
-	    $(ZCOMBRELOC) pics/pics_mp.o libmp.so.2 -M$(OMAPFILE) \
+	    $(BDIRECT) $(ZCOMBRELOC) pics/pics_mp.o libmp.so.2 -M$(OMAPFILE) \
 	    $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 	$(POST_PROCESS_SO)
 
--- a/usr/src/lib/libmp/sparc/Makefile	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libmp/sparc/Makefile	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -41,7 +41,7 @@
 
 $(OLIBRARY):	pics/pics_mp.o libmp.so.2 $(OMAPFILE)
 	$(CC) $(CFLAGS) -o $@ $(GSHARED) -h $(OLIBRARY) $(ZTEXT) $(ZDEFS) \
-	    $(ZCOMBRELOC) pics/pics_mp.o libmp.so.2 -M$(OMAPFILE) \
+	    $(BDIRECT) $(ZCOMBRELOC) pics/pics_mp.o libmp.so.2 -M$(OMAPFILE) \
 	    $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 	$(POST_PROCESS_SO)
 
--- a/usr/src/lib/libnisdb/Makefile	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libnisdb/Makefile	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -145,9 +145,14 @@
 LDLIBS += -lnsl -lldap -lc
 
 # A number of interfaces are interposed by numerous applications, therefore
-# prevent direct binding to anything in this shared object.  In addition,
-# libnisdb.so.1 interposes on socket().
-DYNFLAGS +=	$(BNODIRECT) $(ZINTERPOSE)
+# prevent direct binding to anything in libnisdb.  Disable libnisdb from
+# directly binding to itself, but allow libnisdb to directly bind to its
+# dependencies (ie. map -Bdirect -> -zdirect).  Ensure lazy loading is
+# established (which is enabled automatically with -Bdirect).  In addition,
+# libnisdb interposes on socket(), so tag this library as an interposer.
+# dependencies (lazyload).
+BDIRECT =
+DYNFLAGS +=	$(BNODIRECT) $(ZINTERPOSE) $(ZDIRECT) $(ZLAZYLOAD)
 
 all :=		TARGET= all
 clean :=	TARGET= clean
--- a/usr/src/lib/libproc/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libproc/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -94,9 +94,12 @@
 CFLAGS +=	$(CCVERBOSE)
 CPPFLAGS +=	-I$(SRCDIR)
 
-# All interfaces are interposable, therefore don't allow direct binding to this
-# shared object.
-DYNFLAGS +=	$(BNODIRECT)
+# All interfaces are interposable, therefore don't allow direct binding to
+# libproc.  Disable libproc from directly binding to itself, but allow libperl
+# to directly bind to its dependencies (ie. map -Bdirect -> -zdirect).  Ensure
+# lazy loading is established (which is enabled automatically with -Bdirect).
+BDIRECT =
+DYNFLAGS +=	$(BNODIRECT) $(ZDIRECT) $(ZLAZYLOAD)
 
 .KEEP_STATE:
 
--- a/usr/src/lib/libsldap/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/libsldap/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 #ident	"%Z%%M%	%I%	%E% SMI"
@@ -50,7 +50,6 @@
 LOCFLAGS +=	-D_REENTRANT -DSUNW_OPTIONS
 CPPFLAGS +=	-I../common -I$(SRC)/lib/libldap5/include/ldap \
 		-I/usr/include/mps $(LOCFLAGS)
-DYNFLAGS +=	$(BDIRECT)
 LINTFLAGS +=	-erroff=E_BAD_PTR_CAST_ALIGN
 LINTFLAGS64 +=	-erroff=E_BAD_PTR_CAST_ALIGN
 
--- a/usr/src/lib/nsswitch/ldap/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/nsswitch/ldap/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -23,7 +23,7 @@
 #
 #ident	"%Z%%M%	%I%	%E% SMI"
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # lib/nsswitch/ldap/Makefile.com
@@ -61,7 +61,6 @@
 include		../../Makefile.com
 
 CPPFLAGS +=	-I../../../libsldap/common
-DYNFLAGS +=	$(BDIRECT)
 LDLIBS +=	-lsldap -lnsl -lsocket -lldap
 LINTFLAGS +=	-erroff=E_GLOBAL_COULD_BE_STATIC2 
 LINTFLAGS64 +=	-erroff=E_GLOBAL_COULD_BE_STATIC2 
--- a/usr/src/lib/pam_modules/ldap/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/pam_modules/ldap/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # usr/src/lib/pam_modules/ldap/Makefile.com
@@ -42,7 +42,6 @@
 
 LDLIBS +=	-lpam -lsldap -lc
 CPPFLAGS +=	-I$(SRC)/lib/libsldap/common
-DYNFLAGS +=	$(BDIRECT)
 
 all:	$(LIBS)
 
--- a/usr/src/lib/passwdutil/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/passwdutil/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -63,7 +63,6 @@
 CPPFLAGS	+= -DENABLE_SUNOS_AGING -D_REENTRANT \
 		   -I$(SRC)/lib/libsldap/common -I$(SRC)/lib/libnsl/include
 CFLAGS		+= $(CCVERBOSE)
-DYNFLAGS 	+= $(BDIRECT)
 
 #
 # We depend upon a rpcgen file. Specify some additional macros
--- a/usr/src/lib/print/libpapi-ipp/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/print/libpapi-ipp/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -52,8 +52,6 @@
 CPPFLAGS +=	-I../../libipp-core/common
 CPPFLAGS +=	-I../../libhttp-core/common
 
-DYNFLAGS +=	$(BDIRECT)
-
 MAPFILES =	$(SRCDIR)/mapfile
 
 LDLIBS +=	-L$(ROOTLIBDIR) -R/usr/lib/print -lhttp-core -lmd5
--- a/usr/src/lib/print/libpapi-lpd/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/print/libpapi-lpd/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -51,8 +51,6 @@
 CPPFLAGS +=	-I$(SRCDIR)
 CPPFLAGS +=	-I../../libpapi-common/common
 
-DYNFLAGS +=	$(BDIRECT)
-
 MAPFILES =	$(SRCDIR)/mapfile
 
 LDLIBS +=	-lc
@@ -77,7 +75,7 @@
 OBJS += $(PROG_OBJS)
 
 LDFLAGS.cmd = \
-        $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
+        $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) $(BDIRECT) \
         $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 
 $(PROG):	$(PROG_OBJS)
--- a/usr/src/lib/print/libprint/Makefile.com	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/lib/print/libprint/Makefile.com	Thu Jan 24 16:39:56 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -45,7 +45,6 @@
 CFLAGS +=	$(CCVERBOSE)
 CPPFLAGS +=	-I$(SRCDIR)
 CPPFLAGS +=	-I../../head -D_REENTRANT
-DYNFLAGS +=	$(BDIRECT)
 
 LDLIBS +=	-lnsl -lsocket -lc -lldap
 
--- a/usr/src/tools/scripts/check_rtime.1	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/tools/scripts/check_rtime.1	Thu Jan 24 16:39:56 2008 -0800
@@ -1,5 +1,5 @@
 .\" ident	"%Z%%M%	%I%	%E% SMI"
-.\" Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+.\" Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 .\" Use is subject to license terms.
 .\"
 .\" CDDL HEADER START
@@ -21,7 +21,7 @@
 .\"
 .\" CDDL HEADER END
 .\"
-.TH check_rtime 1 "23 Apr 2007"
+.TH check_rtime 1 "10 Jan 2008"
 .SH NAME
 .I check_rtime
 \- check ELF runtime attributes
@@ -129,20 +129,23 @@
 uses \fBelfdump(1)\fP to look for a concatenated relocation
 section in shared objects, the existence of text relocations,
 whether debugging or symbol table information exists, whether
-applications have a non-executable stack defined, and for duplicate
-entries in the symbol sorting sections.
+applications have a non-executable stack defined, duplicate
+entries in the symbol sorting sections, and for direct bindings.
 These checks are carried out for the following reasons:
 .TP 4
 \(bu
 A concatenated relocation section (\fI.SUNW_reloc\fP)
 provides optimal symbol table
 access as runtime, and thus reduces the overhead of relocating
-the shared object.  The link-edit of a dynamic object with
-the \fB-z combreloc\fP option is required to generate a combined
-relocation section.
+the shared object.  In past releases, the link-edit of a dynamic object with
+the \fB-z combreloc\fP option was required to generate a combined
+relocation section.  However, with the integration of 6642769, this section
+combination is a default behavior of the link-editor.
 .sp
-Not inheriting \fB$(DYNFLAGS)\fP from
-\fIlib/Makefile.lib\fP is the typical reason for not having a
+In past releases, not inheriting \fB$(DYNFLAGS)\fP from
+\fIlib/Makefile.lib\fP was the typical reason for not having a
+concatenated relocation section. The misguided use of the
+\fB-z nocombreloc\fP option will also prevent the creation of a
 concatenated relocation section. A missing concatenated relocation section
 is displayed as:
 .sp
@@ -258,6 +261,24 @@
 .br
 foo: .SUNW_dyntlssort: duplicate OFFSET: sym1, sym2
 .RE
+.sp
+.TP
+\(bu
+\fBOSNet\fP dynamic ELF objects are expected to employ direct bindings whenever
+feasible.  This runtime binding technique helps to avoid accidental
+interposition problems, and provides a more optimal
+runtime symbol search model.
+.sp
+Not inheriting the correct \fB$(LDFLAGS)\fP from \fIcmd/Makefile.cmd\fP,
+or the correct \fB$(DYNFLAGS)\fP from \fIlib/Makefile.lib\fP, are the
+typical reasons for not enabling direct bindings. Dynamic objects that
+do not contain direct binding information are displayed as:
+.sp
+.RS 6
+foo: object has no direct bindings \\
+.br
+	<no -B direct or -z direct?>
+.RE
 
 .sp
 .LP
--- a/usr/src/tools/scripts/check_rtime.pl	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/tools/scripts/check_rtime.pl	Thu Jan 24 16:39:56 2008 -0800
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -59,12 +59,12 @@
 
 
 # Define all global variables (required for strict)
-use vars  qw($SkipDirs $SkipFiles $SkipTextrelFiles);
+use vars  qw($SkipDirs $SkipFiles $SkipTextrelFiles $SkipDirectBindFiles);
 use vars  qw($SkipUndefDirs $SkipUndefFiles $SkipUnusedDirs $SkipUnusedFiles);
 use vars  qw($SkipStabFiles $SkipNoExStkFiles $SkipCrleConf);
 use vars  qw($UnusedNoise $Prog $Mach $Isalist $Env $Ena64 $Tmpdir $Error);
 use vars  qw($UnusedFiles $UnusedPaths $LddNoU $Crle32 $Crle64 $Conf32 $Conf64);
-use vars  qw($SkipInterps $SkipSymSort $OldDeps %opt);
+use vars  qw($SkipDirectBindDirs $SkipInterps $SkipSymSort $OldDeps %opt);
 
 use strict;
 
@@ -107,6 +107,20 @@
 	)$
 }x;
 
+# Define any directories or files that are allowed to have no direct bound
+# symbols
+$SkipDirectBindDirs = qr{
+	usr/ucb
+}x;
+
+$SkipDirectBindFiles = qr{ ^(?:
+	unix |
+	sbcp |
+	libproc.so.1 |
+	libnisdb.so.2
+	)$
+}x;
+
 # Define any files that are allowed undefined references.
 $SkipUndefDirs = qr{
 	usr/lib/elfedit/ |		# elfedit modules have callbacks
@@ -465,6 +479,7 @@
 	my(@Elf, @Ldd, $Dyn, $Intp, $Dll, $Ttl, $Sym, $Interp, $Stack);
 	my($Sun, $Relsz, $Pltsz, $Uns, $Tex, $Stab, $Strip, $Lddopt, $SymSort);
 	my($Val, $Header, $SkipLdd, $IsX86, $RWX);
+	my($HasDirectBinding);
 
 	# Ignore symbolic links.
 	if (-l $FullPath) {
@@ -490,7 +505,7 @@
 
 	# Determine whether we have a executable (static or dynamic) or a
 	# shared object.
-	@Elf = split(/\n/, `elfdump -epdic $FullPath 2>&1`);
+	@Elf = split(/\n/, `elfdump -epdicy $FullPath 2>&1`);
 
 	$Dyn = $Intp = $Dll = $Stack = $IsX86 = $RWX = 0;
 	$Interp = 1;
@@ -772,6 +787,7 @@
 
 	$Sun = $Relsz = $Pltsz = $Dyn = $Stab = $SymSort = 0;
 	$Tex = $Strip = 1;
+	$HasDirectBinding = 0;
 
 	$Header = 'None';
 ELF:	foreach my $Line (@Elf) {
@@ -802,7 +818,30 @@
 		} elsif ($Line =~ /^Dynamic Section/) {
 			$Header = 'Dyn';
 			next;
-		} elsif ($Header ne 'Dyn') {
+		} elsif ($Line =~ /^Syminfo Section/) {
+			$Header = 'Syminfo';
+			next;
+		} elsif (($Header ne 'Dyn') && ($Header ne 'Syminfo')) {
+			next;
+		}
+
+		# Look into the Syminfo section.
+		# Does this object have at least one Directly Bound symbol?
+		if (($Header eq 'Syminfo')) {
+			my(@Symword);
+
+			if ($HasDirectBinding == 1) {
+				next;
+			}
+
+			@Symword = split(' ', $Line);
+
+			if (!defined($Symword[1])) {
+				next;
+			}
+			if ($Symword[1] =~ /B/) {
+				$HasDirectBinding = 1;
+			}
 			next;
 		}
 
@@ -854,6 +893,11 @@
 			next;
 		}
 
+		# Is this object built with -B direct flag on?
+		if ($Line =~ / DIRECT /) {
+			$HasDirectBinding = 1;
+		}
+
 		# Does this object specify a runpath.
 		if ($opt{i} && ($Line =~ /RPATH/)) {
 			my($Rpath) = (split(' ', $Line))[3];
@@ -881,6 +925,17 @@
 		    "\tdebugging sections should be deleted\t<no strip -x?>");
 	}
 
+	# Identify an object that is not built with either -B direct or
+	# -z direct.
+	if (($RelPath =~ $SkipDirectBindDirs) ||
+	    ($File =~ $SkipDirectBindFiles)) {
+		goto DONESTAB;
+	}
+	if ($Relsz && ($HasDirectBinding == 0)) {
+		OutMsg($Ttl++, $RelPath,
+		    "\tobject has no direct bindings\t<no -B direct or -z direct?>");
+	}
+
 DONESTAB:
 
 	# All objects should have a full symbol table to provide complete
--- a/usr/src/ucblib/Makefile.ucb	Thu Jan 24 15:00:53 2008 -0800
+++ b/usr/src/ucblib/Makefile.ucb	Thu Jan 24 16:39:56 2008 -0800
@@ -2,9 +2,8 @@
 # CDDL HEADER START
 #
 # The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
 #
 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 # or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -32,3 +31,9 @@
 # Tweak XRINCDIRS so that cross-reference include paths prefer UCB headers.
 #
 XRINCDIRS = ../../ucbhead
+
+#
+# Turn off direct bindings, as there is so much symbol duplication between
+# these libraries and libc.
+#
+BDIRECT =