diff options
Diffstat (limited to 'usr/src')
27 files changed, 163 insertions, 73 deletions
diff --git a/usr/src/cmd/Makefile.cmd b/usr/src/cmd/Makefile.cmd index 09e3e1d378..0f1ea15e91 100644 --- a/usr/src/cmd/Makefile.cmd +++ b/usr/src/cmd/Makefile.cmd @@ -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 @@ PLATEXEC= $(ROOT)/usr/lib/platexec LDLIBS = $(LDLIBS.cmd) LDFLAGS.cmd = \ - $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \ + $(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \ $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) LDFLAGS = $(LDFLAGS.cmd) diff --git a/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com b/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com index 58d4ac839f..3f32b0c205 100644 --- a/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com +++ b/usr/src/cmd/dtrace/test/cmd/chkargs/Makefile.com @@ -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 @@ $(ROOTBIN64)/%: % $(INS.file) $(ROOTISAEXEC): - $(RM) $@; $(CP) -p /usr/lib/isaexec $@ + -$(LN) $(ISAEXEC) $@ $(ROOTBIN)/%: $(ROOTBIN) $(INS.dir) diff --git a/usr/src/cmd/dtrace/test/tst/i386/Makefile b/usr/src/cmd/dtrace/test/tst/i386/Makefile index 6a1c326598..5eecf2885e 100644 --- a/usr/src/cmd/dtrace/test/tst/i386/Makefile +++ b/usr/src/cmd/dtrace/test/tst/i386/Makefile @@ -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 @@ ASFLAGS += -P -D_ASM $(CPPFLAGS) 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 \ diff --git a/usr/src/cmd/lp/lib/papi/Makefile b/usr/src/cmd/lp/lib/papi/Makefile index 2622951255..0db8138e89 100644 --- a/usr/src/cmd/lp/lib/papi/Makefile +++ b/usr/src/cmd/lp/lib/papi/Makefile @@ -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 @@ LDLIBS += -L$(SRC)/cmd/lp/lib/lp -llp MAPFILES = mapfile -DYNFLAGS += $(BDIRECT) - LIBS = $(DYNLIB) SRCS= $(OBJECTS:%.o=%.c) diff --git a/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib b/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib index c559d39e2e..88ec1861d4 100644 --- a/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib +++ b/usr/src/cmd/perl/5.6.1/distrib/Makefile.lib @@ -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 @@ include ../Makefile.perlcfg # 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) diff --git a/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib b/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib index b5e6a6950f..8bcb2db4b5 100644 --- a/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib +++ b/usr/src/cmd/perl/5.8.4/distrib/Makefile.lib @@ -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 @@ include ../Makefile.perlcfg # 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) diff --git a/usr/src/cmd/sgs/ld/Makefile.com b/usr/src/cmd/sgs/ld/Makefile.com index bfb3c79767..4c655d5941 100644 --- a/usr/src/cmd/sgs/ld/Makefile.com +++ b/usr/src/cmd/sgs/ld/Makefile.com @@ -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 @@ OBJS = $(BLTOBJ) $(COMOBJS) 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) diff --git a/usr/src/cmd/sgs/libld/Makefile.com b/usr/src/cmd/sgs/libld/Makefile.com index 8f7df55423..46a4e4ddeb 100644 --- a/usr/src/cmd/sgs/libld/Makefile.com +++ b/usr/src/cmd/sgs/libld/Makefile.com @@ -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 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \ 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) diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README index e98ee1d44b..373fc7be98 100644 --- a/usr/src/cmd/sgs/packages/common/SUNWonld-README +++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README @@ -1307,3 +1307,4 @@ Bugid Risk Synopsis 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) diff --git a/usr/src/cmd/sgs/rtld/common/elf.c b/usr/src/cmd/sgs/rtld/common/elf.c index 42589fff1e..45e64a557b 100644 --- a/usr/src/cmd/sgs/rtld/common/elf.c +++ b/usr/src/cmd/sgs/rtld/common/elf.c @@ -351,8 +351,8 @@ elf_lazy_load(Rt_map *clmp, uint_t ndx, const char *sym) * 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; /* diff --git a/usr/src/lib/Makefile.lib b/usr/src/lib/Makefile.lib index 714618b165..7ef968999c 100644 --- a/usr/src/lib/Makefile.lib +++ b/usr/src/lib/Makefile.lib @@ -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 @@ SONAME= $(DYNLIB) 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 @@ HSONAMECCC= -h $(SONAMECCC) # $(DYNLIBCCC):= DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) $(ZCOMBRELOC) \ $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \ - $(NORUNPATH) + $(BDIRECT) $(NORUNPATH) # build rule for "portable" source diff --git a/usr/src/lib/libast/mapfile-vers b/usr/src/lib/libast/mapfile-vers index d4818d7a61..3d87a87a3b 100644 --- a/usr/src/lib/libast/mapfile-vers +++ b/usr/src/lib/libast/mapfile-vers @@ -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 @@ SUNWprivate_1.1 { _ast_procclose; _ast_procfree; _ast_procopen; - _ast_procrun; + _ast_procrun = NODIRECT; # Allow libshell to override _ast_putc_unlocked; _ast_putchar_unlocked; _ast_putenv; diff --git a/usr/src/lib/libldap5/Makefile.com b/usr/src/lib/libldap5/Makefile.com index 878f872a6e..e63c755ce7 100644 --- a/usr/src/lib/libldap5/Makefile.com +++ b/usr/src/lib/libldap5/Makefile.com @@ -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 @@ SRCS= $(BEROBJS:%.o=../sources/ldap/ber/%.c) \ $(UTILOBJS:%.o=../sources/ldap/util/%.c) LIBS = $(DYNLIB) $(LINTLIB) -DYNFLAGS += $(ZNODELETE) $(BDIRECT) +DYNFLAGS += $(ZNODELETE) CPPFLAGS= $(COM_INC) $(CPPFLAGS.master) diff --git a/usr/src/lib/libmp/i386/Makefile b/usr/src/lib/libmp/i386/Makefile index 1a8e40aba8..9c62a2b7ac 100644 --- a/usr/src/lib/libmp/i386/Makefile +++ b/usr/src/lib/libmp/i386/Makefile @@ -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 @@ $(ROOTLIBDIR)/$(OLIBRARY) := FILEMODE= 755 $(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) diff --git a/usr/src/lib/libmp/sparc/Makefile b/usr/src/lib/libmp/sparc/Makefile index 1a8e40aba8..9c62a2b7ac 100644 --- a/usr/src/lib/libmp/sparc/Makefile +++ b/usr/src/lib/libmp/sparc/Makefile @@ -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 @@ $(ROOTLIBDIR)/$(OLIBRARY) := FILEMODE= 755 $(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) diff --git a/usr/src/lib/libnisdb/Makefile b/usr/src/lib/libnisdb/Makefile index 82c08530fd..96066c55fd 100644 --- a/usr/src/lib/libnisdb/Makefile +++ b/usr/src/lib/libnisdb/Makefile @@ -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 @@ ZDEFS= 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 diff --git a/usr/src/lib/libproc/Makefile.com b/usr/src/lib/libproc/Makefile.com index f6f48e0531..74ccc23c36 100644 --- a/usr/src/lib/libproc/Makefile.com +++ b/usr/src/lib/libproc/Makefile.com @@ -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 @@ MAPFILES += mapfile-vers 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: diff --git a/usr/src/lib/libsldap/Makefile.com b/usr/src/lib/libsldap/Makefile.com index 304965e8b2..746421900e 100644 --- a/usr/src/lib/libsldap/Makefile.com +++ b/usr/src/lib/libsldap/Makefile.com @@ -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 @@ CFLAGS += $(CCVERBOSE) 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 diff --git a/usr/src/lib/nsswitch/ldap/Makefile.com b/usr/src/lib/nsswitch/ldap/Makefile.com index c0bf5c6d44..9876ccc0f2 100644 --- a/usr/src/lib/nsswitch/ldap/Makefile.com +++ b/usr/src/lib/nsswitch/ldap/Makefile.com @@ -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 @@ OBJECTS = getauthattr.o \ 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 diff --git a/usr/src/lib/pam_modules/ldap/Makefile.com b/usr/src/lib/pam_modules/ldap/Makefile.com index 4488ed556c..a0251f7355 100644 --- a/usr/src/lib/pam_modules/ldap/Makefile.com +++ b/usr/src/lib/pam_modules/ldap/Makefile.com @@ -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 @@ include ../../Makefile.pam_modules LDLIBS += -lpam -lsldap -lc CPPFLAGS += -I$(SRC)/lib/libsldap/common -DYNFLAGS += $(BDIRECT) all: $(LIBS) diff --git a/usr/src/lib/passwdutil/Makefile.com b/usr/src/lib/passwdutil/Makefile.com index eabde734c5..0203e0c143 100644 --- a/usr/src/lib/passwdutil/Makefile.com +++ b/usr/src/lib/passwdutil/Makefile.com @@ -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 @@ LDLIBS += -lsldap -lnsl -lc 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 diff --git a/usr/src/lib/print/libpapi-ipp/Makefile.com b/usr/src/lib/print/libpapi-ipp/Makefile.com index c141ab545e..e7c55ff51a 100644 --- a/usr/src/lib/print/libpapi-ipp/Makefile.com +++ b/usr/src/lib/print/libpapi-ipp/Makefile.com @@ -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../../libpapi-common/common 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 diff --git a/usr/src/lib/print/libpapi-lpd/Makefile.com b/usr/src/lib/print/libpapi-lpd/Makefile.com index 9d4d6a1575..ac0f9bcada 100644 --- a/usr/src/lib/print/libpapi-lpd/Makefile.com +++ b/usr/src/lib/print/libpapi-lpd/Makefile.com @@ -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 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) CPPFLAGS += -I../../libpapi-common/common -DYNFLAGS += $(BDIRECT) - MAPFILES = $(SRCDIR)/mapfile LDLIBS += -lc @@ -77,7 +75,7 @@ PROG_OBJS = $(LPD_PORT_OBJS:%=pics/%) OBJS += $(PROG_OBJS) LDFLAGS.cmd = \ - $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \ + $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) $(BDIRECT) \ $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) $(PROG): $(PROG_OBJS) diff --git a/usr/src/lib/print/libprint/Makefile.com b/usr/src/lib/print/libprint/Makefile.com index 93b6c24ed6..8d885ada45 100644 --- a/usr/src/lib/print/libprint/Makefile.com +++ b/usr/src/lib/print/libprint/Makefile.com @@ -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 @@ $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) CPPFLAGS += -I../../head -D_REENTRANT -DYNFLAGS += $(BDIRECT) LDLIBS += -lnsl -lsocket -lc -lldap diff --git a/usr/src/tools/scripts/check_rtime.1 b/usr/src/tools/scripts/check_rtime.1 index 0b56ff6853..7f1cc966ac 100644 --- a/usr/src/tools/scripts/check_rtime.1 +++ b/usr/src/tools/scripts/check_rtime.1 @@ -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 @@ See also the section ENVIRONMENT VARIABLES. 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. -.sp -Not inheriting \fB$(DYNFLAGS)\fP from -\fIlib/Makefile.lib\fP is the typical reason for not having a +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 +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 @@ foo: .SUNW_dynsymsort: duplicate ADDRESS: sym1, sym2 .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 diff --git a/usr/src/tools/scripts/check_rtime.pl b/usr/src/tools/scripts/check_rtime.pl index 891904e530..52d76434dd 100644 --- a/usr/src/tools/scripts/check_rtime.pl +++ b/usr/src/tools/scripts/check_rtime.pl @@ -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 @@ $SkipTextrelFiles = qr{ ^(?: )$ }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 @@ sub ProcFile { 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 @@ sub ProcFile { # 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 @@ LDD: foreach my $Line (@Ldd) { $Sun = $Relsz = $Pltsz = $Dyn = $Stab = $SymSort = 0; $Tex = $Strip = 1; + $HasDirectBinding = 0; $Header = 'None'; ELF: foreach my $Line (@Elf) { @@ -802,7 +818,30 @@ ELF: foreach my $Line (@Elf) { } 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 @@ ELF: foreach my $Line (@Elf) { 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 @@ ELF: foreach my $Line (@Elf) { "\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 diff --git a/usr/src/ucblib/Makefile.ucb b/usr/src/ucblib/Makefile.ucb index e1b60f0428..e6822431f8 100644 --- a/usr/src/ucblib/Makefile.ucb +++ b/usr/src/ucblib/Makefile.ucb @@ -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 @@ include $(SRC)/lib/Makefile.lib # 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 = |