changeset 5368:0557ad79abbf

6617855 nodirect tag can be ignored when other syminfo tags are available
author rie
date Mon, 29 Oct 2007 17:19:25 -0700
parents c40abbe796be
children 27c1235ef9a4
files usr/src/cmd/sgs/lari/lari.pl usr/src/cmd/sgs/libld/common/args.c usr/src/cmd/sgs/libld/common/syms.c usr/src/cmd/sgs/liblddbg/common/liblddbg.msg usr/src/cmd/sgs/librtld_db/common/mapfile-vers usr/src/cmd/sgs/packages/common/SUNWonld-README usr/src/lib/libaio/amd64/mapfile-vers usr/src/lib/libaio/i386/mapfile-vers usr/src/lib/libaio/sparc/mapfile-vers usr/src/lib/libaio/sparcv9/mapfile-vers usr/src/lib/libresolv/mapfile-vers usr/src/lib/libresolv2/common/mapfile-vers usr/src/lib/librt/amd64/mapfile-vers usr/src/lib/librt/i386/mapfile-vers usr/src/lib/librt/sparc/mapfile-vers usr/src/lib/librt/sparcv9/mapfile-vers usr/src/lib/libxnet/common/mapfile-vers
diffstat 17 files changed, 89 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/sgs/lari/lari.pl	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/lari/lari.pl	Mon Oct 29 17:19:25 2007 -0700
@@ -33,7 +33,7 @@
 use vars  qw($Prog $DestDir $ObjRef $ObjFlag $ObjSize $ObjVis $TmpDir);
 use vars  qw($LddArgs $SymFlag);
 use vars  qw($Glob $Intp $Dirc $Cpyr $Prot $Extn $Self $Gfte $Plta $User $Func);
-use vars  qw($Sfte $Afte $Objt $Nodi $Osft $Oaft $Ssft $Saft $Msft);
+use vars  qw($Rejt $Sfte $Afte $Objt $Nodi $Osft $Oaft $Ssft $Saft $Msft);
 use vars  qw($Rtld $GlobWeak $MultSyms $CrtSyms $Platform $DbgSeed %opt);
 
 # Global arrays that must be cleared for multi input file use.
@@ -97,6 +97,7 @@
 $Prot = 0x00080;	# symbol is protected (symbolic)
 $Extn = 0x00100;	# symbol has been bound to from an external reference
 $Self = 0x00200;	# symbol has been bound to from the same object
+$Rejt = 0x00400;	# symbol binding was (at some point) rejected
 $Plta = 0x00800;	# symbol bound to executables plt address
 $User = 0x01000;	# symbol binding originates from user (dlsym) request
 $Func = 0x02000;	# symbol is of type function
@@ -550,7 +551,7 @@
 			# and walk each field until we find what we need.
 			@Fields = split(' ', $Line);
 
-			# The referencing file, "... binding file=".*".
+			# The referencing file, "... binding file=.* ".
 			while ($Fields[$Offset]) {
 				if ($Fields[$Offset] =~ /^file=(.*)/) {
 					$RefFile = $1;
@@ -572,10 +573,14 @@
 				$Detail = 1;
 				$Offset++;
 			}
-			# The destination file, "... to file=".*".
+			# The destination file, "... to file=.* ".  Note, in the
+			# case of a rejection message, the file is terminated
+			# with a colon, "... to file=.*: ", which must be
+			# removed
 			while ($Fields[$Offset]) {
 				if ($Fields[$Offset] =~ /^file=(.*)/) {
 					$DstFile = $1;
+					$DstFile =~ s/:$//;
 					$Offset++;
 					last;
 				}
@@ -590,10 +595,12 @@
 				}
 				$Offset++;
 			}
-			# Possible trailing binding info, "... (direct,.*)$".
+			# Possible trailing binding info, "... (direct,...", or
+			# a rejection, "... (rejected - ...".
 			while ($Fields[$Offset]) {
-				if ($Fields[$Offset] =~ /^\((.*)\)$/) {
+				if ($Fields[$Offset] =~ /^\((.*)/) {
 					$BndInfo = $1;
+					$Detail = 1;
 					$Offset++;
 					last;
 				}
@@ -652,6 +659,10 @@
 				$Symbols{$SymName}{$DstFile}[$ObjFlag] |= $Plta;
 				$Objects{$DstFile}{$SymName} |= $Plta;
 			}
+			if ($BndInfo =~ /rejected/) {
+				$Symbols{$SymName}{$DstFile}[$ObjFlag] |= $Rejt;
+				$Objects{$DstFile}{$SymName} |= $Rejt;
+			}
 			if ($Dlsym) {
 				$Symbols{$SymName}{$DstFile}[$ObjFlag] |= $User;
 				$Objects{$DstFile}{$SymName} |= $User;
@@ -893,10 +904,10 @@
 				my ($DisVis) = "";
 
 				# Do we just want overhead symbols.  Consider
-				# copy-relocations, and plt address binding,
-				# as overhead too.
+				# copy-relocations, rejections, and plt address
+				# binding, as overhead too.
 				if ($opt{o} && (($Flag &
-				    ($Extn | $Cpyr | $Plta)) == $Extn)) {
+				    ($Rejt | $Extn | $Cpyr | $Plta)) == $Extn)) {
 					next;
 				}
 
@@ -912,12 +923,14 @@
 				# bound to, as the number of reserved symbols
 				# can be quite excessive.  Also, remove any
 				# standard filters, as nothing can bind to these
-				# symbols anyway.
+				# symbols anyway, provided they have not
+				# contributed to a rejected binding.
 				if (!$opt{a} && ((($SymName =~ $MultSyms) &&
 				    (($Flag & ($Extn | $Self)) == 0)) ||
 				    (($SymName =~ $CrtSyms) && (($Flag &
 				    ($Extn | $Self | $Prot)) == 0)) ||
-				    ($Flag & ($Ssft | $Osft)))) {
+				    (($Flag & ($Ssft | $Osft)) &&
+				    (($Flag & $Rejt) == 0)))) {
 					next;
 				}
 
@@ -985,6 +998,11 @@
 				if ($Flag & $Nodi) {
 					$Str = $Str . 'N';
 				}
+				# Was a binding to this definition rejected at
+				# some point.
+				if ($Flag & $Rejt) {
+					$Str = $Str . 'r';
+				}
 
 				# Determine whether this is a function or a data
 				# object.  For the latter, display the symbol
@@ -1041,14 +1059,14 @@
 {
 	my ($SymName) = @_;
 	my ($ObjCnt, $GFlags, $BndCnt, $FltCnt, $NodiCnt, $RdirCnt, $ExRef);
-	my ($TotCnt);
+	my ($RejCnt, $TotCnt);
 
 	# Scan all definitions of this symbol, thus determining the definition
 	# count, the number of filters, redirections, executable references
 	# (copy-relocations, or plt addresses), no-direct bindings, and the
 	# number of definitions that have been bound to.
 	$ObjCnt = $GFlags = $BndCnt = $FltCnt =
-	    $NodiCnt = $RdirCnt = $ExRef = $TotCnt = 0;
+	    $NodiCnt = $RdirCnt = $ExRef = $RejCnt = $TotCnt = 0;
 	foreach my $Obj (keys(%{$Symbols{$SymName}})) {
 		my ($Flag) = $Symbols{$SymName}{$Obj}[$ObjFlag];
 
@@ -1079,6 +1097,9 @@
 		if ($Flag & $Msft) {
 			$RdirCnt++;
 		}
+		if ($Flag & $Rejt) {
+			$RejCnt++;
+		}
 
 		# Ignore bindings to undefined .plts, and copy-relocation
 		# references.  These are implementation details, rather than
@@ -1102,6 +1123,11 @@
 		return $TotCnt;
 	}
 
+	# Any rejected symbol is interesting
+	if ($RejCnt) {
+		return $TotCnt;
+	}
+
 	# Single instance symbol definitions aren't very interesting.
 	if ($ObjCnt == 1) {
 		return 0;
--- a/usr/src/cmd/sgs/libld/common/args.c	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/args.c	Mon Oct 29 17:19:25 2007 -0700
@@ -411,14 +411,17 @@
 
 		} else {
 			/*
-			 * Dynamic relocatable object
-			 */
-			/*
-			 * By default we print relocation errors for
-			 * executables but *not* for a shared object
+			 * Dynamic relocatable object.
 			 */
 			if (ztflag == 0)
 				ofl->ofl_flags1 |= FLG_OF1_TEXTOFF;
+
+			if (ofl->ofl_interp) {
+				eprintf(ofl->ofl_lml, ERR_FATAL,
+				    MSG_INTL(MSG_ARG_INCOMP),
+				    MSG_ORIG(MSG_ARG_R), MSG_ORIG(MSG_ARG_CI));
+				ofl->ofl_flags |= FLG_OF_FATAL;
+			}
 		}
 	} else {
 		ofl->ofl_flags |= FLG_OF_STATIC;
@@ -487,7 +490,7 @@
 		if (rflag) {
 			/*
 			 * We can only strip the symbol table and string table
-			 * if no output relocations will refer to them
+			 * if no output relocations will refer to them.
 			 */
 			if (sflag) {
 				eprintf(ofl->ofl_lml, ERR_WARNING,
--- a/usr/src/cmd/sgs/libld/common/syms.c	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/syms.c	Mon Oct 29 17:19:25 2007 -0700
@@ -166,8 +166,7 @@
 		char		*str;
 		Sym_desc	*sdp;
 
-		if (((sifdata->si_flags & SYMINFO_FLG_NOEXTDIRECT) == 0) ||
-		    (sifdata->si_boundto < SYMINFO_BT_LOWRESERVE))
+		if ((sifdata->si_flags & SYMINFO_FLG_NOEXTDIRECT) == 0)
 			continue;
 
 		sym = (Sym *)(symdata + _cnt);
--- a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg	Mon Oct 29 17:19:25 2007 -0700
@@ -303,7 +303,10 @@
 @ MSG_BND_WEAK_2	"binding file=%s (%#llx:%#llx) to 0x0 \
 			 (undefined weak): symbol `%s'"
 
-@ MSG_BND_REJECT	"binding file=%s to file=%s: symbol `%s': rejected: %s"
+# NOTE: the rejected message is used by lari(1), use care when changing.  This
+# message is formatted to conform to the pattern used by the MSG_BINFO messages.
+@ MSG_BND_REJECT	"binding file=%s to file=%s: symbol `%s'  \
+			 (rejected: %s)"
 @ MSG_BNDREJ_NODIR	"attempt to directly bind to a NODIRECT definition"
 @ MSG_BNDREJ_SINGLE	"attempt to bind to a SINGLETON definition without \
 			 following default search model"
--- a/usr/src/cmd/sgs/librtld_db/common/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/librtld_db/common/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -47,11 +47,11 @@
 #Externally defined symbols
 {
     global:
-	ps_pauxv = PARENT;
-	ps_pdmodel = PARENT;
-	ps_pglobal_lookup = PARENT;
-	ps_pglobal_sym = PARENT;
-	ps_plog = PARENT;
-	ps_pread = PARENT;
-	ps_pwrite = PARENT;
+	ps_pauxv =		NODIRECT PARENT;
+	ps_pdmodel =		NODIRECT PARENT;
+	ps_pglobal_lookup =	NODIRECT PARENT;
+	ps_pglobal_sym =	NODIRECT PARENT;
+	ps_plog =		NODIRECT PARENT;
+	ps_pread =		NODIRECT PARENT;
+	ps_pwrite =		NODIRECT PARENT;
 };
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README	Mon Oct 29 17:19:25 2007 -0700
@@ -1294,3 +1294,5 @@
 6614968 elfedit needs string table module (D)
 6620533 HWCAP filtering can leave uninitialized data behind - results in
 	"rejected: Invalid argument"
+6617855 nodirect tag can be ignored when other syminfo tags are available
+	(link-editor components only)
--- a/usr/src/lib/libaio/amd64/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libaio/amd64/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -50,8 +50,8 @@
 	aioread = FUNCTION;
 	aiowait = FUNCTION;
 	aiowrite = FUNCTION;
-	close = FUNCTION;
-	fork = FUNCTION;
+	close = NODIRECT FUNCTION;
+	fork = NODIRECT FUNCTION;
 	sigaction = FUNCTION;
 };
 
--- a/usr/src/lib/libaio/i386/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libaio/i386/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -51,8 +51,8 @@
 	aioread = FUNCTION;
 	aiowait = FUNCTION;
 	aiowrite = FUNCTION;
-	close = FUNCTION;
-	fork = FUNCTION;
+	close = NODIRECT FUNCTION;
+	fork = NODIRECT FUNCTION;
 	sigaction = FUNCTION;
 };
 
--- a/usr/src/lib/libaio/sparc/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libaio/sparc/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -47,8 +47,8 @@
 
 SUNW_0.7 {
     global:
-	close = FUNCTION;
-	fork = FUNCTION;
+	close = NODIRECT FUNCTION;
+	fork = NODIRECT FUNCTION;
 	sigaction = FUNCTION;
 } SISCD_2.3;
 
--- a/usr/src/lib/libaio/sparcv9/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libaio/sparcv9/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -50,8 +50,8 @@
 	aioread = FUNCTION;
 	aiowait = FUNCTION;
 	aiowrite = FUNCTION;
-	close = FUNCTION;
-	fork = FUNCTION;
+	close = NODIRECT FUNCTION;
+	fork = NODIRECT FUNCTION;
 	sigaction = FUNCTION;
 };
 
--- a/usr/src/lib/libresolv/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libresolv/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -42,7 +42,7 @@
 	fp_query;
 	_getlong;
 	_getshort;
-	h_errno = FILTER libnsl.so.1;
+	h_errno = NODIRECT FILTER libnsl.so.1;
 	hostalias;
 	p_cdname;
 	p_class;
--- a/usr/src/lib/libresolv2/common/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libresolv2/common/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -54,7 +54,7 @@
 	__fp_query;
 	_getlong;
 	_getshort;
-	h_errno = FILTER libnsl.so.1;
+	h_errno = NODIRECT FILTER libnsl.so.1;
 	__hostalias;
 	hstrerror;
 	__p_cdname;
--- a/usr/src/lib/librt/amd64/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/librt/amd64/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -52,12 +52,12 @@
 
 SUNW_1.2 {
     global:
-	close = FUNCTION;
+	close = NODIRECT FUNCTION;
 } SUNW_1.1;
 
 SUNW_1.1 {
     global:
-	fork = FUNCTION;
+	fork = NODIRECT FUNCTION;
 } SUNW_0.7;
 
 SUNW_0.7 {
--- a/usr/src/lib/librt/i386/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/librt/i386/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -53,7 +53,7 @@
 
 SUNW_1.2 {
     global:
-	close = FUNCTION;
+	close = NODIRECT FUNCTION;
 } SUNW_1.1;
 
 SUNW_1.1 {
@@ -65,7 +65,7 @@
 	aio_return64 = FUNCTION;
 	aio_suspend64 = FUNCTION;
 	aio_write64 = FUNCTION;
-	fork = FUNCTION;
+	fork = NODIRECT FUNCTION;
 	lio_listio64 = FUNCTION;
 } SUNW_0.7;
 
--- a/usr/src/lib/librt/sparc/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/librt/sparc/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -53,7 +53,7 @@
 
 SUNW_1.2 {
     global:
-	close = FUNCTION;
+	close = NODIRECT FUNCTION;
 } SUNW_1.1;
 
 SUNW_1.1 {
@@ -65,7 +65,7 @@
 	aio_return64 = FUNCTION;
 	aio_suspend64 = FUNCTION;
 	aio_write64 = FUNCTION;
-	fork = FUNCTION;
+	fork = NODIRECT FUNCTION;
 	lio_listio64 = FUNCTION;
 } SUNW_0.7;
 
--- a/usr/src/lib/librt/sparcv9/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/librt/sparcv9/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -52,12 +52,12 @@
 
 SUNW_1.2 {
     global:
-	close = FUNCTION;
+	close = NODIRECT FUNCTION;
 } SUNW_1.1;
 
 SUNW_1.1 {
     global:
-	fork = FUNCTION;
+	fork = NODIRECT FUNCTION;
 } SUNW_0.7;
 
 SUNW_0.7 {
--- a/usr/src/lib/libxnet/common/mapfile-vers	Mon Oct 29 17:12:17 2007 -0700
+++ b/usr/src/lib/libxnet/common/mapfile-vers	Mon Oct 29 17:19:25 2007 -0700
@@ -118,7 +118,7 @@
 	getservent =		FUNCTION FILTER libsocket.so.1;
 	getsockname = 		FUNCTION FILTER libsocket.so.1;
 	getsockopt = 		FUNCTION FILTER libsocket.so.1;
-	h_errno =		FILTER libnsl.so.1;
+	h_errno =		NODIRECT FILTER libnsl.so.1;
 	htonl =			FUNCTION FILTER libc.so.1;
 	htons =			FUNCTION FILTER libc.so.1;
 	inet_addr =		FUNCTION FILTER libnsl.so.1;