浏览代码

Use "__pthread_once", since that is weak and present in both
glibc and uClibc.

Eric Andersen 21 年之前
父节点
当前提交
6c5a1f2eaa
共有 2 个文件被更改,包括 3 次插入7 次删除
  1. 1 1
      test/dlopen/dltest.c
  2. 2 6
      test/dlopen/libtest.c

+ 1 - 1
test/dlopen/dltest.c

@@ -29,7 +29,7 @@ int main(int argc, char **argv)
 	}
 
 	mydltest(&value1, &value2);
-	printf("dltest: __pthread_return_0=%p\n", value1);
+	printf("dltest: __pthread_once=%p\n", value1);
 	printf("dltest: pthread_self=%p\n", value2);
 	if (value1 == value2) {
 	    ret = EXIT_FAILURE;

+ 2 - 6
test/dlopen/libtest.c

@@ -2,15 +2,11 @@
 #include <pthread.h>
 #include <stdint.h>
 
-extern int __pthread_return_0(void);
+extern int __pthread_once(void);
 
 void dltest(uint32_t **value1, uint32_t **value2)
 {
-	*value1 = (uint32_t *) __pthread_return_0;
+	*value1 = (uint32_t *) __pthread_once;
 	*value2 = (uint32_t *) pthread_self;
-#if 0
-	printf("dltest: __pthread_return_0=%p\n", __pthread_return_0);
-	printf("dltest: pthread_self=%p\n", pthread_self);
-#endif
 }