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());
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to