Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 17:03:21 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339864 - head/lib/csu/tests
Message-ID:  <201810291703.w9TH3LFv017805@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon Oct 29 17:03:20 2018
New Revision: 339864
URL: https://svnweb.freebsd.org/changeset/base/339864

Log:
  Check __dso_handle is NULL in non-DSO objects. It should only be non-NULL
  when accessed from a shared object.
  
  MFC with:	r339738
  Sponsored by:	DARPA, AFRL

Modified:
  head/lib/csu/tests/fini_test.c

Modified: head/lib/csu/tests/fini_test.c
==============================================================================
--- head/lib/csu/tests/fini_test.c	Mon Oct 29 15:12:15 2018	(r339863)
+++ head/lib/csu/tests/fini_test.c	Mon Oct 29 17:03:20 2018	(r339864)
@@ -119,11 +119,22 @@ ATF_TC_BODY(fini_array_test, tc)
 	}
 }
 
+extern void *__dso_handle;
+
+ATF_TC_WITHOUT_HEAD(dso_handle_test);
+ATF_TC_BODY(dso_handle_test, tc)
+{
+
+	ATF_REQUIRE_MSG(__dso_handle == NULL,
+	    "Invalid __dso_handle in non-DSO");
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, dtors_test);
 	ATF_TP_ADD_TC(tp, fini_array_test);
+	ATF_TP_ADD_TC(tp, dso_handle_test);
 
 	return (atf_no_error());
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810291703.w9TH3LFv017805>