--- old/usr/src/cmd/Makefile.check	2013-01-02 21:49:14.807439246 -0500
+++ new/usr/src/cmd/Makefile.check	2013-01-02 21:49:14.832909831 -0500
@@ -145,11 +145,9 @@
 	ypcmd/ypupdated			\
 	zonestat/zonestatd
 
-$(CLOSED_BUILD)MANIFEST_SUBDIRS +=		\
-	$(CLOSED)/cmd/cmd-inet/usr.lib/in.iked
-
-DTEST_SUBDIRS= \
-	dtrace/test/tst
+MISC_SUBDIRS=		\
+	dtrace/test/tst \
+	sgs
 
 .KEEP_STATE:
 
@@ -163,13 +161,13 @@
 
 .NO_PARALLEL:
 
-check: svccfg_check $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS)
+check: svccfg_check $(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(MISC_SUBDIRS)
 
 svccfg_check:
 	@$(ECHO) "building requirements for svccfg check ..."; \
 	(cd $(SRC)/cmd/svc/seed && pwd && $(MAKE) $(MFLAGS) global.db)
 
-$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(DTEST_SUBDIRS): FRC
+$(MANIFEST_TOPDIRS) $(MANIFEST_SUBDIRS) $(MISC_SUBDIRS): FRC
 	@cd $@; pwd; $(MAKE) check
 
 FRC:
--- old/usr/src/cmd/sgs/Makefile	2013-01-02 21:49:15.298629065 -0500
+++ new/usr/src/cmd/sgs/Makefile	2013-01-02 21:49:15.309918744 -0500
@@ -136,6 +136,8 @@
 
 chkmsg:		libconv $(MSGSUBDIRS) FRC
 
+check:		chkmsg
+
 # built from lib/Makefile
 install_lib:	FRC
 		@ cd lex; pwd; $(MAKE) $@
--- old/usr/src/cmd/sgs/libld/common/libld.msg	2013-01-02 21:49:15.856653470 -0500
+++ new/usr/src/cmd/sgs/libld/common/libld.msg	2013-01-02 21:49:15.868356449 -0500
@@ -1263,6 +1263,11 @@
 @ MSG_DBG_AOUT_FMT	"debug: a.out: "
 @ MSG_DBG_NAME_FMT	"debug: %s: "
 
+# -z assert-deflib strings
+
+@ MSG_ARG_ASSDEFLIB_MALFORMED	"library name malformed: %s"
+@ MSG_ARG_ASSDEFLIB_FOUND	"dynamic library found on default search path \
+				(%s): lib%s.so"
 
 @ _END_
 
@@ -1469,11 +1474,6 @@
 @ MSG_ARG_GUIDE_NO_TEXT		"notext"
 @ MSG_ARG_GUIDE_NO_UNUSED	"nounused"
 
-# -z assert-deflib strings
-@ MSG_ARG_ASSDEFLIB_MALFORMED	"library name malformed: %s"
-@ MSG_ARG_ASSDEFLIB_FOUND	"dynamic library found on default search path \
-				(%s): lib%s.so"
-
 # Environment variable strings
 
 @ MSG_LD_RUN_PATH	"LD_RUN_PATH"
--- old/usr/src/cmd/sgs/libld/common/place.c	2013-01-02 21:49:16.327886309 -0500
+++ new/usr/src/cmd/sgs/libld/common/place.c	2013-01-02 21:49:16.339101289 -0500
@@ -851,6 +851,13 @@
 	}
 
 	/*
+	 * When building relocatable objects, we must not redirect COMDAT
+	 * section names into their outputs, such that our output object may
+	 * be successfully used as an input object also requiring COMDAT
+	 * processing
+	 */
+
+	/*
 	 * GNU section names may follow the convention:
 	 *
 	 *	.gnu.linkonce.*
@@ -863,13 +870,15 @@
 	 * because we know the name is not NULL, and therefore must have
 	 * at least one character plus a NULL termination.
 	 */
-	if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
-	    (isp->is_name == oname) && (isp->is_name[1] == 'g') &&
+	if ((isp->is_name == oname) && (isp->is_name[1] == 'g') &&
 	    (strncmp(MSG_ORIG(MSG_SCN_GNU_LINKONCE), isp->is_name,
 	    MSG_SCN_GNU_LINKONCE_SIZE) == 0)) {
-		if ((oname =
-		    (char *)gnu_linkonce_sec(isp->is_name)) != isp->is_name) {
-			DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+		if ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) {
+			if ((oname = (char *)gnu_linkonce_sec(isp->is_name)) !=
+			    isp->is_name) {
+				DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp,
+				    oname));
+			}
 		}
 
 		/*
@@ -894,16 +903,17 @@
 	 * sections, and this identification can be triggered by a pattern
 	 * match section names.
 	 */
-	if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
-	    (isp->is_name == oname) && (isp->is_flags & FLG_IS_COMDAT) &&
+	if ((isp->is_name == oname) && (isp->is_flags & FLG_IS_COMDAT) &&
 	    ((sname = gnu_comdat_sym(ifl, isp)) != NULL)) {
 		size_t	size = sname - isp->is_name;
 
-		if ((oname = libld_malloc(size + 1)) == NULL)
-			return ((Os_desc *)S_ERROR);
-		(void) strncpy(oname, isp->is_name, size);
-		oname[size] = '\0';
-		DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+		if ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) {
+			if ((oname = libld_malloc(size + 1)) == NULL)
+				return ((Os_desc *)S_ERROR);
+			(void) strncpy(oname, isp->is_name, size);
+			oname[size] = '\0';
+			DBG_CALL(Dbg_sec_redirected(ofl->ofl_lml, isp, oname));
+		}
 
 		/*
 		 * Enable relaxed relocation processing, as this is
@@ -1199,6 +1209,7 @@
 	 * so that they can be updated as a group later.
 	 */
 	if ((shdr->sh_type == SHT_GROUP) &&
+	    ((isp->is_flags & FLG_IS_DISCARD) == 0) &&
 	    (aplist_append(&ofl->ofl_osgroups, osp,
 	    AL_CNT_OFL_OSGROUPS) == NULL))
 		return ((Os_desc *)S_ERROR);
--- old/usr/src/cmd/sgs/librtld_db/demo/Makefile.com	2013-01-02 21:49:16.766489800 -0500
+++ new/usr/src/cmd/sgs/librtld_db/demo/Makefile.com	2013-01-02 21:49:16.787516199 -0500
@@ -66,6 +66,10 @@
 LINTFLAGS +=	$(LDLIBS) -L../../$(MACH) $(LINTERRS)
 LINTFLAGS64 +=	$(LDLIBS) -L../../$(MACH) $(LINTERRS)
 CLEANFILES +=	$(LINTOUT)
+
+CERRWARN +=	-_gcc=-Wno-parentheses
+CERRWARN +=	-_gcc=-Wno-unused-label
+CERRWARN +=	-_gcc=-Wno-unused-variable
 # DEMO DELETE END
 
 test-sparc=	test-sparc-regs
--- old/usr/src/cmd/sgs/librtld_db/demo/common/dis.c	2013-01-02 21:49:17.137689820 -0500
+++ new/usr/src/cmd/sgs/librtld_db/demo/common/dis.c	2013-01-02 21:49:17.154724262 -0500
@@ -79,7 +79,7 @@
 			/*
 			 * Embed SOName in symbol name
 			 */
-			if (mip = addr_to_map(ph, address)) {
+			if ((mip = addr_to_map(ph, address)) != 0) {
 				(void) strcpy(buf, mip->mi_name);
 				(void) strcat(buf, ":");
 			} else
--- old/usr/src/cmd/sgs/packages/common/SUNWonld-README	2013-01-02 21:49:17.540440075 -0500
+++ new/usr/src/cmd/sgs/packages/common/SUNWonld-README	2013-01-02 21:49:17.555761594 -0500
@@ -1640,3 +1640,5 @@
 3260	linker is insufficiently careful with strtok
 3261	linker should ignore unknown hardware capabilities
 3265	link-editor builds bogus .eh_frame_hdr on ia32
+3439	discarded sections shouldn't end up on output lists
+3436	relocatable objects also need sloppy relocation
--- old/usr/src/cmd/sgs/rtld/common/rtld.msg	2013-01-02 21:49:18.011409710 -0500
+++ new/usr/src/cmd/sgs/rtld/common/rtld.msg	2013-01-02 21:49:18.036285953 -0500
@@ -273,6 +273,8 @@
 @ MSG_USD_RUNPATH	"   unused search path=%s  (RUNPATH/RPATH from \
 			 file %s)\n"
 
+@ MSG_CAP_IGN_UNKCAP	"ignoring unknown capability: %s"
+
 @ _END_
 
 # The following strings represent reserved words, files, pathnames and symbols.
@@ -300,7 +302,6 @@
 @ MSG_STR_ONE		"1"
 
 @ MSG_CAP_DELIMIT	","
-@ MSG_CAP_IGN_UNKCAP	"ignoring unknown capability: %s"
 
 @ MSG_SUNW_OST_SGS	"SUNW_OST_SGS"
 @ MSG_SUNW_OST_OSLIB	"SUNW_OST_OSLIB"
