--- old/usr/src/cmd/mdb/common/libstandctf/mapfile	2015-04-17 12:29:23.890558509 -0400
+++ new/usr/src/cmd/mdb/common/libstandctf/mapfile	2015-04-17 12:29:23.918922870 -0400
@@ -77,6 +77,7 @@
 		ctf_member_iter;
 		ctf_open;
 		ctf_parent_name;
+		ctf_parent_label;
 		ctf_setmodel;
 		ctf_setspecific;
 		ctf_type_align;
--- old/usr/src/common/ctf/ctf_open.c	2015-04-17 12:29:24.761178718 -0400
+++ new/usr/src/common/ctf/ctf_open.c	2015-04-17 12:29:24.773045297 -0400
@@ -980,6 +980,16 @@
 }
 
 /*
+ * Return the label of the parent CTF container, if one exists.  Otherwise
+ * return NULL.
+ */
+const char *
+ctf_parent_label(ctf_file_t *fp)
+{
+	return (fp->ctf_parlabel);
+}
+
+/*
  * Import the types from the specified parent container by storing a pointer
  * to it in ctf_parent and incrementing its reference count.  Only one parent
  * is allowed: if a parent already exists, it is replaced by the new parent.
--- old/usr/src/lib/libctf/common/mapfile-vers	2015-04-17 12:29:25.235501054 -0400
+++ new/usr/src/lib/libctf/common/mapfile-vers	2015-04-17 12:29:25.246945606 -0400
@@ -74,6 +74,7 @@
 	ctf_member_info;
 	ctf_parent_file;
 	ctf_parent_name;
+	ctf_parent_label;
 	ctf_set_array;
 	ctf_type_align;
 	ctf_type_cmp;
--- old/usr/src/lib/libdtrace/common/dt_cg.c	2015-04-17 12:29:25.663227385 -0400
+++ new/usr/src/lib/libdtrace/common/dt_cg.c	2015-04-17 12:29:25.675436015 -0400
@@ -41,6 +41,7 @@
 
 #include <dt_impl.h>
 #include <dt_grammar.h>
+#include <dt_module.h>
 #include <dt_parser.h>
 #include <dt_provider.h>
 
@@ -70,18 +71,7 @@
 static ctf_file_t *
 dt_cg_membinfo(ctf_file_t *fp, ctf_id_t type, const char *s, ctf_membinfo_t *mp)
 {
-	while (ctf_type_kind(fp, type) == CTF_K_FORWARD) {
-		char n[DT_TYPE_NAMELEN];
-		dtrace_typeinfo_t dtt;
-
-		if (ctf_type_name(fp, type, n, sizeof (n)) == NULL ||
-		    dt_type_lookup(n, &dtt) == -1 || (
-		    dtt.dtt_ctfp == fp && dtt.dtt_type == type))
-			break; /* unable to improve our position */
-
-		fp = dtt.dtt_ctfp;
-		type = ctf_type_resolve(fp, dtt.dtt_type);
-	}
+	dt_resolve_forward_decl(&fp, &type);
 
 	if (ctf_member_info(fp, type, s, mp) == CTF_ERR)
 		return (NULL); /* ctf_errno is set for us */
--- old/usr/src/lib/libdtrace/common/dt_error.c	2015-04-17 12:29:26.226903515 -0400
+++ new/usr/src/lib/libdtrace/common/dt_error.c	2015-04-17 12:29:26.239067349 -0400
@@ -112,6 +112,7 @@
 	{ EDT_ENABLING_ERR, "Failed to enable probe" },
 	{ EDT_NOPROBES, "No probe sites found for declared provider" },
 	{ EDT_CANTLOAD, "Failed to load module" },
+	{ EDT_BADCTF, "Module contains invalid or incomplete CTF information" }
 };
 
 static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]);
--- old/usr/src/lib/libdtrace/common/dt_impl.h	2015-04-17 12:29:26.656777562 -0400
+++ new/usr/src/lib/libdtrace/common/dt_impl.h	2015-04-17 12:29:26.668902790 -0400
@@ -530,7 +530,8 @@
 	EDT_OVERSION,		/* client is requesting deprecated version */
 	EDT_ENABLING_ERR,	/* failed to enable probe */
 	EDT_NOPROBES,		/* no probes sites for declared provider */
-	EDT_CANTLOAD		/* failed to load a module */
+	EDT_CANTLOAD,		/* failed to load a module */
+	EDT_BADCTF		/* module contains invalid CTF */
 };
 
 /*
--- old/usr/src/lib/libdtrace/common/dt_module.c	2015-04-17 12:29:27.169112842 -0400
+++ new/usr/src/lib/libdtrace/common/dt_module.c	2015-04-17 12:29:27.181132366 -0400
@@ -843,6 +843,17 @@
 			goto err;
 		}
 
+		/*
+		 * If the label we claim the parent must have is not actually
+		 * present in the parent module, ignore the CTF entirely
+		 * rather than acquiring possibly bad type references.
+		 */
+		if (ctf_label_info(pfp, ctf_parent_label(dmp->dm_ctfp),
+		    NULL) == CTF_ERR) {
+			(void) dt_set_errno(dtp, EDT_BADCTF);
+			goto err;
+		}
+
 		if (ctf_import(dmp->dm_ctfp, pfp) == CTF_ERR) {
 			dtp->dt_ctferr = ctf_errno(dmp->dm_ctfp);
 			(void) dt_set_errno(dtp, EDT_CTF);
@@ -856,6 +867,8 @@
 	return (dmp->dm_ctfp);
 
 err:
+	dt_dprintf("could not load CTF container for %s: %s\n",
+	    dmp->dm_name, dtrace_errmsg(dtp, dtrace_errno(dtp)));
 	ctf_close(dmp->dm_ctfp);
 	dmp->dm_ctfp = NULL;
 	return (NULL);
@@ -1372,6 +1385,39 @@
 	return (0);
 }
 
+boolean_t
+dt_is_forward_decl(ctf_file_t *file, ctf_id_t type)
+{
+	ctf_id_t kind = ctf_type_kind(file, type);
+
+	while ((type = ctf_type_reference(file, type)) != CTF_ERR) {
+		type = ctf_type_resolve(file, type);
+		kind = ctf_type_kind(file, type);
+	}
+
+	return (kind == CTF_K_FORWARD);
+}
+
+void
+dt_resolve_forward_decl(ctf_file_t **ctfp, ctf_id_t *type)
+{
+	char name[DT_TYPE_NAMELEN];
+
+	while (dt_is_forward_decl(*ctfp, *type)) {
+		char *tag = ctf_type_name(*ctfp, *type, name, sizeof (name));
+		dtrace_typeinfo_t dtt;
+
+		if (tag != NULL && dt_type_lookup(tag, &dtt) == 0 &&
+		    (dtt.dtt_ctfp != *ctfp) || dtt.dtt_type != *type) {
+			*ctfp = dtt.dtt_ctfp;
+			*type = dtt.dtt_type;
+		} else {
+			/* All we have is the forward definition */
+			break;
+		}
+	}
+}
+
 int
 dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object, const char *name,
     dtrace_typeinfo_t *tip)
@@ -1463,8 +1509,7 @@
 			tip->dtt_object = dmp->dm_name;
 			tip->dtt_ctfp = fp;
 			tip->dtt_type = id;
-			if (ctf_type_kind(fp, ctf_type_resolve(fp, id)) !=
-			    CTF_K_FORWARD)
+			if (!dt_is_forward_decl(fp, ctf_type_resolve(fp, id)))
 				return (0);
 
 			found++;
--- old/usr/src/lib/libdtrace/common/dt_module.h	2015-04-17 12:29:27.687795735 -0400
+++ new/usr/src/lib/libdtrace/common/dt_module.h	2015-04-17 12:29:27.699472857 -0400
@@ -55,6 +55,9 @@
 extern ctf_file_t *dt_module_getctflib(dtrace_hdl_t *, dt_module_t *,
     const char *);
 
+extern boolean_t dt_is_forward_decl(ctf_file_t *, ctf_id_t);
+extern void dt_resolve_forward_decl(ctf_file_t **, ctf_id_t *);
+
 #ifdef	__cplusplus
 }
 #endif
--- old/usr/src/lib/libdtrace/common/dt_parser.c	2015-04-17 12:29:28.098918987 -0400
+++ new/usr/src/lib/libdtrace/common/dt_parser.c	2015-04-17 12:29:28.111774151 -0400
@@ -1369,7 +1369,8 @@
 	dnp->dn_op = DT_TOK_IDENT;
 	dnp->dn_string = name;
 
-	dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, dtt.dtt_flags);
+	dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
+	    dtt.dtt_flags & DTT_FL_USER ? B_TRUE : B_FALSE);
 
 	if (dtt.dtt_ctfp == dtp->dt_cdefs->dm_ctfp ||
 	    dtt.dtt_ctfp == dtp->dt_ddefs->dm_ctfp)
@@ -1798,6 +1799,7 @@
 
 	ctf_membinfo_t ctm;
 	ctf_id_t type;
+	ctf_file_t *ctfp;
 	uint_t kind;
 
 	name = strdupa(s);
@@ -1823,7 +1825,15 @@
 	}
 
 	bzero(&dn, sizeof (dn));
-	dt_node_type_assign(&dn, dtt.dtt_ctfp, ctm.ctm_type, B_FALSE);
+	/*
+	 * Resolution of CTF_K_FORWARD is unnecessary here, since it can't be
+	 * both forward _and_ a bitfield, but is done for completeness.
+	 */
+	type = ctm.ctm_type;
+	ctfp = dtt.dtt_ctfp;
+
+	dt_resolve_forward_decl(&ctfp, &type);
+	dt_node_type_assign(&dn, ctfp, type, B_FALSE);
 
 	if (dn.dn_flags & DT_NF_BITFIELD) {
 		xyerror(D_OFFSETOF_BITFIELD,
@@ -2423,7 +2433,7 @@
 
 	if (ddp != NULL)
 		dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
-		    dtt.dtt_flags);
+		    dtt.dtt_flags & DTT_FL_USER ? B_TRUE : B_FALSE);
 
 	return (dnp);
 }
@@ -2780,7 +2790,7 @@
 		dnp->dn_flags |= DT_NF_LVALUE;
 
 		dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
-		    dtt.dtt_flags);
+		    dtt.dtt_flags & DTT_FL_USER ? B_TRUE : B_FALSE);
 		dt_node_attr_assign(dnp, _dtrace_symattr);
 
 		if (uref) {
@@ -2932,7 +2942,7 @@
 
 		dt_ident_type_assign(cp->dn_ident, dtt.dtt_ctfp, dtt.dtt_type);
 		dt_node_type_assign(cp, dtt.dtt_ctfp, dtt.dtt_type,
-		    dtt.dtt_flags);
+		    dtt.dtt_flags & DTT_FL_USER ? B_TRUE : B_FALSE);
 	}
 
 	if (cp->dn_kind == DT_NODE_VAR)
@@ -3725,24 +3735,16 @@
 		 * If we follow a reference to a forward declaration tag,
 		 * search the entire type space for the actual definition.
 		 */
-		while (kind == CTF_K_FORWARD) {
-			char *tag = ctf_type_name(ctfp, type, n1, sizeof (n1));
-			dtrace_typeinfo_t dtt;
-
-			if (tag != NULL && dt_type_lookup(tag, &dtt) == 0 &&
-			    (dtt.dtt_ctfp != ctfp || dtt.dtt_type != type)) {
-				ctfp = dtt.dtt_ctfp;
-				type = ctf_type_resolve(ctfp, dtt.dtt_type);
-				kind = ctf_type_kind(ctfp, type);
-			} else {
-				xyerror(D_OP_INCOMPLETE,
-				    "operator %s cannot be applied to a "
-				    "forward declaration: no %s definition "
-				    "is available\n", opstr(op), tag);
-			}
-		}
+		dt_resolve_forward_decl(&ctfp, &type);
+		kind = ctf_type_kind(ctfp, type);
 
-		if (kind != CTF_K_STRUCT && kind != CTF_K_UNION) {
+		if (kind == CTF_K_FORWARD) {
+			xyerror(D_OP_INCOMPLETE,
+			    "operator %s cannot be applied to a "
+			    "forward declaration: no %s definition "
+			    "is available\n", opstr(op),
+			    ctf_type_name(ctfp, type, n1, sizeof (n1)));
+		} else if (kind != CTF_K_STRUCT && kind != CTF_K_UNION) {
 			if (op == DT_TOK_PTR) {
 				xyerror(D_OP_SOU, "operator -> cannot be "
 				    "applied to pointer to type \"%s\"; must "
@@ -3762,12 +3764,15 @@
 			    ctf_type_name(ctfp, type, n1, sizeof (n1)));
 		}
 
-		type = ctf_type_resolve(ctfp, m.ctm_type);
-		kind = ctf_type_kind(ctfp, type);
+		type = m.ctm_type;
 
-		dt_node_type_assign(dnp, ctfp, m.ctm_type, B_FALSE);
+		dt_resolve_forward_decl(&ctfp, &type);
+		dt_node_type_assign(dnp, ctfp, type, B_FALSE);
 		dt_node_attr_assign(dnp, lp->dn_attr);
 
+		type = ctf_type_resolve(ctfp, type);
+		kind = ctf_type_kind(ctfp, type);
+
 		if (op == DT_TOK_PTR && (kind != CTF_K_ARRAY ||
 		    dt_node_is_string(dnp)))
 			dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.3.3] */
@@ -4275,6 +4280,8 @@
 
 	dtrace_attribute_t attr = _dtrace_maxattr;
 	ctf_membinfo_t ctm;
+	ctf_id_t type;
+	ctf_file_t *ctfp;
 
 	/*
 	 * Before cooking each translator member, we push a reference to the
@@ -4293,7 +4300,16 @@
 		}
 
 		(void) dt_node_cook(mnp, DT_IDFLG_REF);
-		dt_node_type_assign(mnp, dxp->dx_dst_ctfp, ctm.ctm_type,
+		ctfp = dxp->dx_dst_ctfp;
+		type = ctm.ctm_type;
+
+		/*
+		 *
+		 * This probably doesn't need to be resolved, because it's of
+		 * the translator, but is done for completeness right now.
+		 */
+		dt_resolve_forward_decl(&ctfp, &type);
+		dt_node_type_assign(mnp, ctfp, type,
 		    B_FALSE);
 		attr = dt_attr_min(attr, mnp->dn_attr);
 
--- old/usr/src/lib/libdtrace/common/dt_xlator.c	2015-04-17 12:29:29.207975767 -0400
+++ new/usr/src/lib/libdtrace/common/dt_xlator.c	2015-04-17 12:29:29.224102655 -0400
@@ -50,6 +50,7 @@
 	dt_xlator_t *dxp = arg;
 	dtrace_hdl_t *dtp = dxp->dx_hdl;
 	dt_node_t *enp, *mnp;
+	ctf_file_t *ctfp;
 
 	if ((enp = dt_node_xalloc(dtp, DT_NODE_XLATOR)) == NULL)
 		return (dt_set_errno(dtp, EDT_NOMEM));
@@ -71,7 +72,14 @@
 	enp->dn_op = DT_TOK_XLATE;
 	enp->dn_xlator = dxp;
 	enp->dn_xmember = mnp;
-	dt_node_type_assign(enp, dxp->dx_dst_ctfp, type, B_FALSE);
+	/*
+	 * XXX: Is it ok for the CTF of the type to not be from the dst ctf?
+	 *
+	 * I suspect it's actually unnecessary, but I'm also unclear on
+	 * dynamic translators
+	 */
+	dt_resolve_forward_decl(&ctfp, &type);
+	dt_node_type_assign(enp, ctfp, type, B_FALSE);
 
 	/*
 	 * For the member itself, we use a DT_NODE_MEMBER as usual with the
--- old/usr/src/uts/Makefile	2015-04-17 12:29:30.197239317 -0400
+++ new/usr/src/uts/Makefile	2015-04-17 12:29:30.209901213 -0400
@@ -111,14 +111,6 @@
 $($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC
 	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
 
-$(PMTMO_FILE) pmtmo_file: $(PATCH_MAKEUP_TABLE)
-	@if [ -z "$(PATCH_MAKEUP_TABLE)" ] ; then \
-		echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
-		    'in environment' >&2 ; \
-		exit 1 ; \
-	fi
-	RELEASE="$(RELEASE)" MACH="$(MACH)" \
-	    $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
 
 #
 # The following is the list of directories which contain Makefiles with
@@ -197,10 +189,6 @@
 	@cd common/klm; pwd; $(MAKE) $@
 
 clean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
-	@if [ '$(PATCH_BUILD)' != '#' ] ; then \
-		echo $(RM) $(PMTMO_FILE) ; \
-		$(RM) $(PMTMO_FILE) ; \
-	fi
 
 # testing convenience
 clobber_h: $(DYNHDRDIRS)
--- old/usr/src/uts/Makefile.targ	2015-04-17 12:29:30.641191407 -0400
+++ new/usr/src/uts/Makefile.targ	2015-04-17 12:29:30.653089283 -0400
@@ -52,7 +52,7 @@
 #
 $(BINARY):		$(OBJECTS)
 	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 	$(ELFSIGN_MOD)
 
--- old/usr/src/uts/Makefile.uts	2015-04-17 12:29:31.073371073 -0400
+++ new/usr/src/uts/Makefile.uts	2015-04-17 12:29:31.085732088 -0400
@@ -309,53 +309,8 @@
 INS.conffile= \
 	$(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE)
 
-#
-# The CTF merge of child kernel modules is performed against one of the genunix
-# modules.  For Intel builds, all modules will be used with a single genunix:
-# the one built in intel/genunix.  For SPARC builds, a given
-# module may be
-# used with one of a number of genunix files, depending on what platform the
-# module is deployed on.  We merge against the sun4u genunix to optimize for
-# the common case.  We also merge against the ip driver since networking is
-# typically loaded and types defined therein are shared between many modules.
-#
-CTFMERGE_GUDIR_sparc	= sun4u
-CTFMERGE_GUDIR_i386	= intel
-CTFMERGE_GUDIR		= $(CTFMERGE_GUDIR_$(MACH))
-
-CTFMERGE_GENUNIX 	= \
-	$(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix
-
-#
-# Used to uniquify a non-genunix module against genunix. $VERSION is used
-# for the label.
-#
-# For the ease of developers dropping modules onto possibly unrelated systems,
-# you can set NO_GENUNIX_UNIQUIFY= in the environment to skip uniquifying
-# against genunix.
-#
-NO_GENUNIX_UNIQUIFY=$(POUND_SIGN)
-CTFMERGE_GENUNIX_DFLAG=-d $(CTFMERGE_GENUNIX)
-$(NO_GENUNIX_UNIQUIFY)CTF_GENUNIX_DFLAG=
-
-CTFMERGE_UNIQUIFY_AGAINST_GENUNIX	= \
-	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION \
-	$(CTFMERGE_GENUNIX_DFLAG) -o $@ $(OBJECTS) $(CTFEXTRAOBJS)
-
-#
-# Used to merge the genunix module.
-#
-CTFMERGE_GENUNIX_MERGE		= \
-	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION -o $@ \
-	$(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)
-
-#
-# We ctfmerge the ip objects into genunix to maximize the number of common types
-# found there, thus maximizing the effectiveness of uniquification.  We don't
-# want the genunix build to have to know about the individual ip objects, so we
-# put them in an archive.  The genunix ctfmerge then includes this archive.
-#
-IPCTF		= $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a
+CTFMERGE_MODULE=	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION -o $@ $(OBJECTS) \
+    $(CTFEXTRAOBJS)
 
 #
 # Rule for building fake shared libraries used for symbol resolution
--- old/usr/src/uts/common/ctf/mapfile	2015-04-17 12:29:31.517331181 -0400
+++ new/usr/src/uts/common/ctf/mapfile	2015-04-17 12:29:31.528894595 -0400
@@ -82,6 +82,7 @@
 		ctf_open;
 		ctf_parent_file;
 		ctf_parent_name;
+		ctf_parent_label;
 		ctf_setmodel;
 		ctf_setspecific;
 		ctf_set_array;
--- old/usr/src/uts/common/sys/ctf_api.h	2015-04-17 12:29:31.923547843 -0400
+++ new/usr/src/uts/common/sys/ctf_api.h	2015-04-17 12:29:31.935330092 -0400
@@ -156,6 +156,7 @@
 
 extern ctf_file_t *ctf_parent_file(ctf_file_t *);
 extern const char *ctf_parent_name(ctf_file_t *);
+extern const char *ctf_parent_label(ctf_file_t *);
 
 extern int ctf_import(ctf_file_t *, ctf_file_t *);
 extern int ctf_setmodel(ctf_file_t *, int);
--- old/usr/src/uts/i86pc/unix/Makefile	2015-04-17 12:29:32.389067665 -0400
+++ new/usr/src/uts/i86pc/unix/Makefile	2015-04-17 12:29:32.401597585 -0400
@@ -185,7 +185,7 @@
 	    $(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
 	    $(DTRACESTUBS)
 	$(MBH_PATCH) $(UNIX_BIN)
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 $(UNIX_O):	$(OBJECTS) $(OBJS_DIR)/vers.o
--- old/usr/src/uts/i86xpv/unix/Makefile	2015-04-17 12:29:32.867524329 -0400
+++ new/usr/src/uts/i86xpv/unix/Makefile	2015-04-17 12:29:32.879583719 -0400
@@ -178,7 +178,7 @@
 	$(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
 	    $(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
 	    $(DTRACESTUBS)
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 $(UNIX_O):	$(OBJECTS) $(OBJS_DIR)/vers.o
--- old/usr/src/uts/intel/dtrace/fbt.c	2015-04-17 12:29:33.306731753 -0400
+++ new/usr/src/uts/intel/dtrace/fbt.c	2015-04-17 12:29:33.318660683 -0400
@@ -629,6 +629,16 @@
 			goto err;
 		}
 
+		/*
+		 * If the parent module does not have the label we expect,
+		 * ignore it and fail to avoid presenting non-sensical data.
+		 */
+		if (ctf_label_info(pfp, ctf_parent_label(fp),
+		    NULL) == CTF_ERR) {
+			ctf_close(pfp);
+			goto err;
+		}
+
 		if (ctf_import(fp, pfp) != 0) {
 			ctf_close(pfp);
 			goto err;
--- old/usr/src/uts/intel/genunix/Makefile	2015-04-17 12:29:33.777290974 -0400
+++ new/usr/src/uts/intel/genunix/Makefile	2015-04-17 12:29:33.789717244 -0400
@@ -72,16 +72,6 @@
 CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
 BINARY		=
 
-#
-# Non-patch genunix builds merge a version of the ip module called ipctf.  This
-# is to ensure that the common network-related types are included in genunix and
-# can thus be uniquified out of other modules.  We don't want to do this for
-# patch builds, since we can't guarantee that ip and genunix will be in the same
-# patch.
-#
-IPCTF_TARGET	= $(IPCTF)
-$(PATCH_BUILD)IPCTF_TARGET =
-
 CPPFLAGS	+= -I$(SRC)/common
 CPPFLAGS	+= -I$(SRC)/uts/common/fs/zfs
 
@@ -140,13 +130,9 @@
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
 	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
-$(IPCTF_TARGET) ipctf_target: FRC
-	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
-	@pwd
-
-$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
+$(GENUNIX): $(OBJECTS)
 	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
-	$(CTFMERGE_GENUNIX_MERGE)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 #
--- old/usr/src/uts/intel/ip/Makefile	2015-04-17 12:29:34.472492663 -0400
+++ new/usr/src/uts/intel/ip/Makefile	2015-04-17 12:29:34.687074303 -0400
@@ -124,29 +124,5 @@
 #
 include $(UTSBASE)/intel/Makefile.targ
 
-#
-# The ip CTF data is merged into the genunix module because these types are
-# complex and heavily shared.  The genunix build will execute one of the
-# rules below to create an archive, ipctf.a, containing the ip objects.  The
-# real ip will be uniquified against genunix later in the build, and will
-# emerge containing very few types.
-#
-$(OBJS_DIR)/ipctf.a: $(OBJECTS)
-	-$(RM) $@
-	$(AR) -r $@ $(OBJECTS)
 
 $(OBJECTS): $(OBJS_DIR)
-
-CLOBBERFILES += $(OBJS_DIR)/ipctf.a
-
-ipctf.obj32: FRC
-	@BUILD_TYPE=OBJ32 VERSION='$(VERSION)' $(MAKE) obj32/ipctf.a
-
-ipctf.debug32: FRC
-	@BUILD_TYPE=DBG32 VERSION='$(VERSION)' $(MAKE) debug32/ipctf.a
-
-ipctf.obj64: FRC
-	@BUILD_TYPE=OBJ64 VERSION='$(VERSION)' $(MAKE) obj64/ipctf.a
-
-ipctf.debug64: FRC
-	@BUILD_TYPE=DBG64 VERSION='$(VERSION)' $(MAKE) debug64/ipctf.a
--- old/usr/src/uts/sparc/dtrace/fbt.c	2015-04-17 12:29:35.192769826 -0400
+++ new/usr/src/uts/sparc/dtrace/fbt.c	2015-04-17 12:29:35.204813220 -0400
@@ -1657,6 +1657,16 @@
 		if ((pfp = ctf_modopen(mod->mod_mp, &error)) == NULL)
 			goto err;
 
+		/*
+		 * If the parent module does not have the label we expect,
+		 * ignore it and fail to avoid presenting non-sensical data.
+		 */
+		if (ctf_label_info(pfp, ctf_parent_label(fp),
+		    NULL) == CTF_ERR) {
+			ctf_close(pfp);
+			goto err;
+		}
+
 		if (ctf_import(fp, pfp) != 0) {
 			ctf_close(pfp);
 			goto err;
--- old/usr/src/uts/sparc/ip/Makefile	2015-04-17 12:29:35.725618346 -0400
+++ new/usr/src/uts/sparc/ip/Makefile	2015-04-17 12:29:35.738139555 -0400
@@ -121,23 +121,4 @@
 #
 include $(UTSBASE)/sparc/Makefile.targ
 
-#
-# The ip CTF data is merged into the genunix module because these types are
-# complex and heavily shared.  The genunix build will execute one of the
-# rules below to create an archive, ipctf.a, containing the ip objects.  The
-# real ip will be uniquified against genunix later in the build, and will
-# emerge containing very few types.
-#
-$(OBJS_DIR)/ipctf.a: $(OBJECTS)
-	-$(RM) $@
-	$(AR) -r $@ $(OBJECTS)
-
 $(OBJECTS): $(OBJS_DIR)
-
-CLOBBERFILES += $(OBJS_DIR)/ipctf.a
-
-ipctf.obj64: FRC
-	@BUILD_TYPE=OBJ64 VERSION='$(VERSION)' $(MAKE) obj64/ipctf.a
-
-ipctf.debug64: FRC
-	@BUILD_TYPE=DBG64 VERSION='$(VERSION)' $(MAKE) debug64/ipctf.a
--- old/usr/src/uts/sun4u/genunix/Makefile	2015-04-17 12:29:36.311697587 -0400
+++ new/usr/src/uts/sun4u/genunix/Makefile	2015-04-17 12:29:36.324587122 -0400
@@ -79,16 +79,6 @@
 
 CLOBBERFILES	+= $(GENUNIX)
 
-#
-# Non-patch genunix builds merge a version of the ip module called ipctf.  This
-# is to ensure that the common network-related types are included in genunix and
-# can thus be uniquified out of other modules.  We don't want to do this for
-# patch builds, since we can't guarantee that ip and genunix will be in the same
-# patch.
-#
-IPCTF_TARGET	= $(IPCTF)
-$(PATCH_BUILD)IPCTF_TARGET =
-
 # 
 # lint pass one enforcement 
 # 
@@ -155,13 +145,9 @@
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
 	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
-$(IPCTF_TARGET) ipctf_target: FRC
-	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
-	@pwd
-
-$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
+$(GENUNIX): $(OBJECTS)
 	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
-	$(CTFMERGE_GENUNIX_MERGE)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 $(OBJECTS): $(OBJS_DIR)
--- old/usr/src/uts/sun4u/opl/unix/Makefile	2015-04-17 12:29:36.725034655 -0400
+++ new/usr/src/uts/sun4u/opl/unix/Makefile	2015-04-17 12:29:36.737504204 -0400
@@ -151,7 +151,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 symcheck.targ:	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS) 
--- old/usr/src/uts/sun4u/serengeti/unix/Makefile	2015-04-17 12:29:37.203738839 -0400
+++ new/usr/src/uts/sun4u/serengeti/unix/Makefile	2015-04-17 12:29:37.228992858 -0400
@@ -150,7 +150,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 symcheck.targ:	$(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS)
--- old/usr/src/uts/sun4u/starcat/unix/Makefile	2015-04-17 12:29:37.659497887 -0400
+++ new/usr/src/uts/sun4u/starcat/unix/Makefile	2015-04-17 12:29:37.671522001 -0400
@@ -150,7 +150,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 	$(CHK4UBINARY)
 
--- old/usr/src/uts/sun4u/starfire/unix/Makefile	2015-04-17 12:29:38.102311011 -0400
+++ new/usr/src/uts/sun4u/starfire/unix/Makefile	2015-04-17 12:29:38.114376904 -0400
@@ -141,7 +141,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 	$(CHK4UBINARY)
 
--- old/usr/src/uts/sun4u/unix/Makefile	2015-04-17 12:29:38.558084694 -0400
+++ new/usr/src/uts/sun4u/unix/Makefile	2015-04-17 12:29:38.570125340 -0400
@@ -156,7 +156,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 	$(CHK4UBINARY)
 
--- old/usr/src/uts/sun4v/Makefile.sun4v	2015-04-17 12:29:39.201358905 -0400
+++ new/usr/src/uts/sun4v/Makefile.sun4v	2015-04-17 12:29:39.215486686 -0400
@@ -161,8 +161,6 @@
 #
 include $(UTSBASE)/Makefile.uts
 
-CTFMERGE_GUDIR	= sun4v
-
 #
 #	machine specific optimization, override default in Makefile.master
 #
--- old/usr/src/uts/sun4v/genunix/Makefile	2015-04-17 12:29:39.824294599 -0400
+++ new/usr/src/uts/sun4v/genunix/Makefile	2015-04-17 12:29:39.836590690 -0400
@@ -87,16 +87,6 @@
 
 CLOBBERFILES	+= $(GENUNIX)
 
-#
-# Non-patch genunix builds merge a version of the ip module called ipctf.  This
-# is to ensure that the common network-related types are included in genunix and
-# can thus be uniquified out of other modules.  We don't want to do this for
-# patch builds, since we can't guarantee that ip and genunix will be in the same
-# patch.
-#
-IPCTF_TARGET	= $(IPCTF)
-$(PATCH_BUILD)IPCTF_TARGET =
-
 # 
 # lint pass one enforcement 
 # 
@@ -161,10 +151,10 @@
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
 	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
-$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
+$(GENUNIX): $(OBJECTS)
 	@pwd
 	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
-	$(CTFMERGE_GENUNIX_MERGE)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 $(OBJECTS): $(OBJS_DIR)
--- old/usr/src/uts/sun4v/unix/Makefile	2015-04-17 12:29:40.288552508 -0400
+++ new/usr/src/uts/sun4v/unix/Makefile	2015-04-17 12:29:40.307733441 -0400
@@ -155,7 +155,7 @@
 		$(DTRACESTUBS) 
 	$(LD) -dy -b -o $@ -e _start -M $(MAPFILE) \
 	    $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
-	$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
+	$(CTFMERGE_MODULE)
 	$(POST_PROCESS)
 
 $(UNIX32_LINK):	$(ROOT_PSM_KERN_DIR_32) $(UNIX_BIN)
