From d72c2763056b9c0de69886f8f3e6c3ed0aaa6dd4 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 21 Jul 2015 07:14:16 +0530 Subject: Remove Linuxism from tst-tls-atexit The tst-tls-atexit test case searches for its module in /proc/PID/maps to verify that it is unloaded, which is a Linux-specific test. This patch makes the test generic by looking for the library in the link map list in the _r_debug structure. Verified that the test continues to succeed on x86_64. There is a bug in the test case where it calls dlclose once again, which is actually incorrect but still manages to unload the DSO thanks to an existing bug in __tls_call_dtors. This will be fixed in a later patch which also fixes up the __cxa_thread_atexit_impl implementation. I have added a FIXME comment to that call momentarily, which I will remove when I fix the problem. * stdlib/tst-tls-atexit-lib.c (do_foo): Rename to reg_dtor. * stdlib/tst-tls-atexit.c: (is_loaded): New function. (spawn_thread): New function. (load): Rename to reg_dtor_and_close. Move dlopen to... (do_test): ... here. Use IS_LOADED to test for its availability. --- stdlib/tst-tls-atexit-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stdlib/tst-tls-atexit-lib.c') diff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c index 2945379..2478d80 100644 --- a/stdlib/tst-tls-atexit-lib.c +++ b/stdlib/tst-tls-atexit-lib.c @@ -31,7 +31,7 @@ void A_dtor (void *obj) ((A *)obj)->val = obj; } -void do_foo (void) +void reg_dtor (void) { static __thread A b; __cxa_thread_atexit_impl (A_dtor, &b, __dso_handle); -- cgit v1.1