>From 851f8bb89d9fae664a0d6018fce251ab64d737b7 Mon Sep 17 00:00:00 2001 From: Markus Wichmann Date: Mon, 7 Jan 2019 18:07:34 +0100 Subject: [PATCH 4/4] Add weak reference to reduce static size. Commit 84d061d5a31c9c773e29e1e2b1ffe8cb9557bc58 claimed to try and reduce the static size for programs referencing pthread_key_create() but not pthread_key_delete(). Unfortunately, the critical reference was still strong, so the __synccall() mechanism was pulled in, anyway. This commit makes the reference weak, so it is resolved to NULL if pthread_key_delete() is not used, but in that case the function is unreachable, anyway. --- src/thread/pthread_key_create.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c index e26f199c..31ed0826 100644 --- a/src/thread/pthread_key_create.c +++ b/src/thread/pthread_key_create.c @@ -35,6 +35,8 @@ static void clean_dirty_tsd_callback(void *p) if (args->caller == self) args->ret = 0; } +extern hidden weak void __pthread_key_delete_synccall(void (*f)(void *), void *p); + static int clean_dirty_tsd(void) { struct cleanup_args args = { -- 2.19.1