svn commit: branches/uClibc-nptl/test: tls

sjhill at uclibc.org sjhill at uclibc.org
Sun Nov 6 05:21:51 UTC 2005


Author: sjhill
Date: 2005-11-05 21:21:49 -0800 (Sat, 05 Nov 2005)
New Revision: 12168

Log:
Update makefile to add new NPTL tests and fix two tests for usage with uClibc.


Modified:
   branches/uClibc-nptl/test/Makefile
   branches/uClibc-nptl/test/tls/tst-tls7.c
   branches/uClibc-nptl/test/tls/tst-tls8.c


Changeset:
Modified: branches/uClibc-nptl/test/Makefile
===================================================================
--- branches/uClibc-nptl/test/Makefile	2005-11-06 00:17:48 UTC (rev 12167)
+++ branches/uClibc-nptl/test/Makefile	2005-11-06 05:21:49 UTC (rev 12168)
@@ -36,8 +36,8 @@
 ALL_SUBDIRS  += pthread
 endif
 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-	DIRS += tls
-ALL_SUBDIRS  += tls
+	DIRS += tls nptl
+ALL_SUBDIRS  += tls nptl
 endif
 
 

Modified: branches/uClibc-nptl/test/tls/tst-tls7.c
===================================================================
--- branches/uClibc-nptl/test/tls/tst-tls7.c	2005-11-06 00:17:48 UTC (rev 12167)
+++ branches/uClibc-nptl/test/tls/tst-tls7.c	2005-11-06 05:21:49 UTC (rev 12168)
@@ -4,6 +4,10 @@
 
 #include <link.h>
 #include <tls.h>
+#ifdef __UCLIBC__
+#include "dl-elf.h"
+#include "dl-hash.h"
+#endif
 
 
 #define TEST_FUNCTION do_test ()
@@ -30,7 +34,20 @@
       /* Dirty test code here: we peek into a private data structure.
 	 We make sure that the module gets assigned the same ID every
 	 time.  The value of the first round is used.  */
+#ifdef __UCLIBC__
       if (modid == -1)
+	modid = ((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid;
+      else if (((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid
+        != (size_t) modid)
+	{
+	  printf ("round %d: modid now %zu, initially %d\n",
+		  i,
+		  ((struct link_map *)((struct dyn_elf *)h)->dyn)->l_tls_modid,
+		  modid);
+	  result = 1;
+	}
+#else
+      if (modid == -1)
 	modid = ((struct link_map *) h)->l_tls_modid;
       else if (((struct link_map *) h)->l_tls_modid != (size_t) modid)
 	{
@@ -38,6 +55,7 @@
 		  i, ((struct link_map *) h)->l_tls_modid, modid);
 	  result = 1;
 	}
+#endif
 
       fp = dlsym (h, "in_dso2");
       if (fp == NULL)

Modified: branches/uClibc-nptl/test/tls/tst-tls8.c
===================================================================
--- branches/uClibc-nptl/test/tls/tst-tls8.c	2005-11-06 00:17:48 UTC (rev 12167)
+++ branches/uClibc-nptl/test/tls/tst-tls8.c	2005-11-06 05:21:49 UTC (rev 12168)
@@ -4,6 +4,10 @@
 
 #include <link.h>
 #include <tls.h>
+#ifdef __UCLIBC__
+#include "dl-elf.h"
+#include "dl-hash.h"
+#endif
 
 
 #define TEST_FUNCTION do_test ()
@@ -35,7 +39,20 @@
       /* Dirty test code here: we peek into a private data structure.
 	 We make sure that the module gets assigned the same ID every
 	 time.  The value of the first round is used.  */
+#ifdef __UCLIBC__
       if (modid1 == (size_t) -1)
+	modid1 = ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid;
+      else if (((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid
+        != (size_t) modid1)
+	{
+	  printf ("round %d: modid now %zd, initially %zd\n",
+		  i,
+		  ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid,
+		  modid1);
+	  result = 1;
+	}
+#else
+      if (modid1 == (size_t) -1)
 	modid1 = ((struct link_map *) h1)->l_tls_modid;
       else if (((struct link_map *) h1)->l_tls_modid != modid1)
 	{
@@ -43,6 +60,7 @@
 		  i, ((struct link_map *) h1)->l_tls_modid, modid1);
 	  result = 1;
 	}
+#endif
 
       fp1 = dlsym (h1, "in_dso2");
       if (fp1 == NULL)
@@ -65,7 +83,20 @@
       /* Dirty test code here: we peek into a private data structure.
 	 We make sure that the module gets assigned the same ID every
 	 time.  The value of the first round is used.  */
+#ifdef __UCLIBC__
       if (modid2 == (size_t) -1)
+	modid2 = ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid;
+      else if (((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid
+        != (size_t) modid2)
+	{
+	  printf ("round %d: modid now %zd, initially %zd\n",
+		  i,
+		  ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid,
+		  modid2);
+	  result = 1;
+	}
+#else
+      if (modid2 == (size_t) -1)
 	modid2 = ((struct link_map *) h1)->l_tls_modid;
       else if (((struct link_map *) h1)->l_tls_modid != modid2)
 	{
@@ -73,6 +104,7 @@
 		  i, ((struct link_map *) h1)->l_tls_modid, modid2);
 	  result = 1;
 	}
+#endif
 
       bazp = dlsym (h2, "baz");
       if (bazp == NULL)
@@ -106,12 +138,24 @@
       /* Dirty test code here: we peek into a private data structure.
 	 We make sure that the module gets assigned the same ID every
 	 time.  The value of the first round is used.  */
+#ifdef __UCLIBC__
+      if (((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid
+        != modid1)
+	{
+	  printf ("round %d: modid now %zd, initially %zd\n",
+		  i,
+		  ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid,
+		  modid1);
+	  result = 1;
+	}
+#else
       if (((struct link_map *) h1)->l_tls_modid != modid1)
 	{
 	  printf ("round %d: modid now %zd, initially %zd\n",
 		  i, ((struct link_map *) h1)->l_tls_modid, modid1);
 	  result = 1;
 	}
+#endif
 
       fp1 = dlsym (h1, "in_dso2");
       if (fp1 == NULL)
@@ -134,12 +178,24 @@
       /* Dirty test code here: we peek into a private data structure.
 	 We make sure that the module gets assigned the same ID every
 	 time.  The value of the first round is used.  */
+#ifdef __UCLIBC__
+      if (((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid
+        != modid2)
+	{
+	  printf ("round %d: modid now %zd, initially %zd\n",
+		  i,
+		  ((struct link_map *)((struct dyn_elf *)h1)->dyn)->l_tls_modid,
+		  modid2);
+	  result = 1;
+	}
+#else
       if (((struct link_map *) h1)->l_tls_modid != modid2)
 	{
 	  printf ("round %d: modid now %zd, initially %zd\n",
 		  i, ((struct link_map *) h1)->l_tls_modid, modid2);
 	  result = 1;
 	}
+#endif
 
       bazp = dlsym (h2, "baz");
       if (bazp == NULL)




More information about the uClibc-cvs mailing list