Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808859/?format=api
{ "id": 808859, "url": "http://patchwork.ozlabs.org/api/patches/808859/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20170901180029.9527-9-hjl.tools@gmail.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170901180029.9527-9-hjl.tools@gmail.com>", "list_archive_url": null, "date": "2017-09-01T17:59:39", "name": "[08/58] Mark __dso_handle as hidden [BZ #18822]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0f9230ad0f5884aacb2d0eacffec1f2faa49a716", "submitter": { "id": 4387, "url": "http://patchwork.ozlabs.org/api/people/4387/?format=api", "name": "H.J. Lu", "email": "hjl.tools@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20170901180029.9527-9-hjl.tools@gmail.com/mbox/", "series": [ { "id": 1088, "url": "http://patchwork.ozlabs.org/api/series/1088/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=1088", "date": "2017-09-01T18:00:21", "name": "Hide internal functions in libc.so", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1088/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808859/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808859/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-84056-incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list libc-alpha@sourceware.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84056-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"nni6hfQA\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkRtR3Phxz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 2 Sep 2017 04:03:11 +1000 (AEST)", "(qmail 84895 invoked by alias); 1 Sep 2017 18:00:50 -0000", "(qmail 84594 invoked by uid 89); 1 Sep 2017 18:00:49 -0000" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:in-reply-to\n\t:references; q=dns; s=default; b=Pfmo+fbSWzUUZU2guyDGiZRbxaazHbV\n\t5IIbdbGxt0Abvfen+NTGpHYuhYY6NdeQP6WctX2QOo89l16BrkedA50jtg0CNjoU\n\tTG7MfZTi/I1RKjIcXEfwCMvRU6sl/8uJabWc96UEWztDFzsYEpDQVeEpF2DgKr9Y\n\tcYnxX+7VjpZs=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:in-reply-to\n\t:references; s=default; bh=HtsTnwjtrfmGEGiaA6gNJevy/bA=; b=nni6h\n\tfQAp7jPwavIAeIN/KHgowVvD7paUN3P1MCo6orywjAnYhboDyS+r+H/tvm14CXDl\n\t87CZyYarF2OMuZVtFMDznwMCt811zGTApI68NcE6OpeJcQoTG6dQZJGxrpIbLl5h\n\tp3BjqBI+ZetdDKafbJfiXp+5icjpG18BLngL/U=", "Mailing-List": "contact libc-alpha-help@sourceware.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<libc-alpha.sourceware.org>", "List-Unsubscribe": "<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>", "List-Subscribe": "<mailto:libc-alpha-subscribe@sourceware.org>", "List-Archive": "<http://sourceware.org/ml/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>", "Sender": "libc-alpha-owner@sourceware.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-26.2 required=5.0 tests=BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2,\n\tGIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=", "X-HELO": "mga02.intel.com", "X-ExtLoop1": "1", "From": "\"H.J. Lu\" <hjl.tools@gmail.com>", "To": "libc-alpha@sourceware.org", "Subject": "[PATCH 08/58] Mark __dso_handle as hidden [BZ #18822]", "Date": "Fri, 1 Sep 2017 10:59:39 -0700", "Message-Id": "<20170901180029.9527-9-hjl.tools@gmail.com>", "In-Reply-To": "<20170901180029.9527-1-hjl.tools@gmail.com>", "References": "<20170901180029.9527-1-hjl.tools@gmail.com>" }, "content": "Since __dso_handle is always defined by either crtbegin.o from GCC or\ndso_handle.c, it should be marked as hidden and be passed directly.\n\n\t[BZ #18822]\n\t* dlfcn/modatexit.c (foo): Remove __dso_handle check.\n\t* dlfcn/modcxaatexit.c (__dso_handle): Remove declaration.\n\t* dlfcn/tstatexit.c (__dso_handle): Removed.\n\t(main): Don't check __dso_handle.\n\t* dlfcn/tstcxaatexit.c (__dso_handle): Removed.\n\t(main): Don't check __dso_handle.\n\t* include/stdlib.h (__dso_handle): New.\n\t* malloc/mtrace.c (__dso_handle): Remove declaration.\n\t(mtrace): Pass __dso_handle directly.\n\t* nptl/pthread_atfork.c (__dso_handle): Remove declaration.\n\t(__pthread_atfork): Pass __dso_handle directly.\n\t* nptl/tst-atfork2mod.c (__dso_handle): Removed.\n\t* posix/wordexp-test.c (__dso_handle): Remove declaration.\n\t(__app_register_atfork): Pass __dso_handle directly.\n\t* stdlib/at_quick_exit.c (__dso_handle): Remove declaration.\n\t(at_quick_exit): Pass __dso_handle directly.\n\t* stdlib/atexit.c (__dso_handle): Remove declaration.\n\t(atexit): Pass __dso_handle directly.\n\t* stdlib/tst-tls-atexit-lib.c (__dso_handle): Removed.\n---\n dlfcn/modatexit.c | 2 --\n dlfcn/modcxaatexit.c | 1 -\n dlfcn/tstatexit.c | 8 --------\n dlfcn/tstcxaatexit.c | 8 --------\n include/stdlib.h | 4 ++++\n malloc/mtrace.c | 3 +--\n nptl/pthread_atfork.c | 7 +------\n nptl/tst-atfork2mod.c | 1 -\n posix/wordexp-test.c | 4 +---\n stdlib/at_quick_exit.c | 7 +------\n stdlib/atexit.c | 8 +-------\n stdlib/tst-tls-atexit-lib.c | 2 --\n 12 files changed, 9 insertions(+), 46 deletions(-)", "diff": "diff --git a/dlfcn/modatexit.c b/dlfcn/modatexit.c\nindex e620d10c70..95c18dcbac 100644\n--- a/dlfcn/modatexit.c\n+++ b/dlfcn/modatexit.c\n@@ -35,9 +35,7 @@ dummy (void)\n void\n foo (void *p)\n {\n- extern void *__dso_handle __attribute__ ((__weak__));\n printf (\"This is %s\\n\", __FUNCTION__);\n atexit (dummy);\n- if (&__dso_handle) puts (\"have dso handle\"); else puts (\"no dso handle\");\n ip = p;\n }\ndiff --git a/dlfcn/modcxaatexit.c b/dlfcn/modcxaatexit.c\nindex fbda2f3c9f..b921b5c9ac 100644\n--- a/dlfcn/modcxaatexit.c\n+++ b/dlfcn/modcxaatexit.c\n@@ -34,7 +34,6 @@ fluffy (void *p)\n void\n bar (void *p)\n {\n- extern void *__dso_handle;\n printf (\"This is %s\\n\", __FUNCTION__);\n __cxa_atexit (fluffy, p, __dso_handle);\n }\ndiff --git a/dlfcn/tstatexit.c b/dlfcn/tstatexit.c\nindex 2073843b8f..e25a3f8000 100644\n--- a/dlfcn/tstatexit.c\n+++ b/dlfcn/tstatexit.c\n@@ -20,8 +20,6 @@\n #include <stdlib.h>\n \n \n-extern void *__dso_handle __attribute__ ((__weak__));\n-\n int\n main (void)\n {\n@@ -30,12 +28,6 @@ main (void)\n void (*fp) (void *);\n int v = 0;\n \n- if (&__dso_handle == NULL)\n- {\n- puts (\"__dso_handle not available, cannot perform the test\");\n- exit (0);\n- }\n-\n h = dlopen (fname, RTLD_NOW);\n if (h == NULL)\n {\ndiff --git a/dlfcn/tstcxaatexit.c b/dlfcn/tstcxaatexit.c\nindex fde645c16b..37f25d63d4 100644\n--- a/dlfcn/tstcxaatexit.c\n+++ b/dlfcn/tstcxaatexit.c\n@@ -19,8 +19,6 @@\n #include <stdio.h>\n #include <stdlib.h>\n \n-extern void *__dso_handle __attribute__ ((__weak__));\n-\n int\n main (void)\n {\n@@ -29,12 +27,6 @@ main (void)\n void (*fp) (void *);\n int v = 0;\n \n- if (&__dso_handle == NULL)\n- {\n- puts (\"__dso_handle not available, cannot perform the test\");\n- exit (0);\n- }\n-\n h = dlopen (fname, RTLD_LAZY);\n if (h == NULL)\n {\ndiff --git a/include/stdlib.h b/include/stdlib.h\nindex 2274790a2e..d0dcbf81c3 100644\n--- a/include/stdlib.h\n+++ b/include/stdlib.h\n@@ -5,6 +5,10 @@\n #endif\n #include <stdlib/stdlib.h>\n \n+/* __dso_handle is always defined by either crtbegin.o from GCC or our\n+ dso_handle.c. */\n+extern void *__dso_handle __attribute__ ((visibility (\"hidden\")));\n+\n /* Now define the internal interfaces. */\n #if !defined _ISOMAC\n # include <sys/stat.h>\ndiff --git a/malloc/mtrace.c b/malloc/mtrace.c\nindex 6c362d9679..40dadc2be3 100644\n--- a/malloc/mtrace.c\n+++ b/malloc/mtrace.c\n@@ -315,10 +315,9 @@ mtrace (void)\n #ifdef _LIBC\n if (!added_atexit_handler)\n {\n- extern void *__dso_handle __attribute__ ((__weak__));\n added_atexit_handler = 1;\n __cxa_atexit ((void (*)(void *))release_libc_mem, NULL,\n- &__dso_handle ? __dso_handle : NULL);\n+\t\t\t __dso_handle);\n }\n #endif\n }\ndiff --git a/nptl/pthread_atfork.c b/nptl/pthread_atfork.c\nindex dc2ea07887..dd328b76f1 100644\n--- a/nptl/pthread_atfork.c\n+++ b/nptl/pthread_atfork.c\n@@ -36,10 +36,6 @@\n #include \"pthreadP.h\"\n #include <fork.h>\n \n-/* This is defined by newer gcc version unique for each module. */\n-extern void *__dso_handle __attribute__ ((__weak__,\n-\t\t\t\t\t __visibility__ (\"hidden\")));\n-\n \n /* Hide the symbol so that no definition but the one locally in the\n executable or DSO is used. */\n@@ -51,8 +47,7 @@ attribute_hidden\n __pthread_atfork (void (*prepare) (void), void (*parent) (void),\n \t\t void (*child) (void))\n {\n- return __register_atfork (prepare, parent, child,\n-\t\t\t &__dso_handle == NULL ? NULL : __dso_handle);\n+ return __register_atfork (prepare, parent, child, __dso_handle);\n }\n #ifndef __pthread_atfork\n extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),\ndiff --git a/nptl/tst-atfork2mod.c b/nptl/tst-atfork2mod.c\nindex fe64046d3c..1e49612bdd 100644\n--- a/nptl/tst-atfork2mod.c\n+++ b/nptl/tst-atfork2mod.c\n@@ -46,7 +46,6 @@ static void\n __attribute__ ((constructor))\n init (void)\n {\n- extern void *__dso_handle;\n printf (\"dsohandle = %p\\n\", __dso_handle);\n \n if (pthread_atfork (prepare, parent, child) != 0)\ndiff --git a/posix/wordexp-test.c b/posix/wordexp-test.c\nindex 17ae812346..6ae769678c 100644\n--- a/posix/wordexp-test.c\n+++ b/posix/wordexp-test.c\n@@ -30,13 +30,11 @@\n \n #define IFS \" \\n\\t\"\n \n-extern void *__dso_handle __attribute__ ((__weak__, __visibility__ (\"hidden\")));\n extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);\n \n static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void))\n {\n- return __register_atfork (prepare, parent, child,\n-\t\t\t &__dso_handle == NULL ? NULL : __dso_handle);\n+ return __register_atfork (prepare, parent, child, __dso_handle);\n }\n \n /* Number of forks seen. */\ndiff --git a/stdlib/at_quick_exit.c b/stdlib/at_quick_exit.c\nindex 3b74d0a688..ca54c3f851 100644\n--- a/stdlib/at_quick_exit.c\n+++ b/stdlib/at_quick_exit.c\n@@ -36,15 +36,10 @@\n #include \"exit.h\"\n \n \n-/* This is defined by newer gcc version unique for each module. */\n-extern void *__dso_handle __attribute__ ((__weak__));\n-\n-\n /* Register FUNC to be executed by `quick_exit'. */\n int\n attribute_hidden\n at_quick_exit (void (*func) (void))\n {\n- return __cxa_at_quick_exit ((void (*) (void *)) func,\n-\t\t\t &__dso_handle == NULL ? NULL : __dso_handle);\n+ return __cxa_at_quick_exit ((void (*) (void *)) func, __dso_handle);\n }\ndiff --git a/stdlib/atexit.c b/stdlib/atexit.c\nindex f28b6ba1b7..aec7f5ce1b 100644\n--- a/stdlib/atexit.c\n+++ b/stdlib/atexit.c\n@@ -35,11 +35,6 @@\n #include <stdlib.h>\n #include \"exit.h\"\n \n-\n-/* This is defined by newer gcc version unique for each module. */\n-extern void *__dso_handle __attribute__ ((__weak__));\n-\n-\n /* Register FUNC to be executed by `exit'. */\n int\n #ifndef atexit\n@@ -47,6 +42,5 @@ attribute_hidden\n #endif\n atexit (void (*func) (void))\n {\n- return __cxa_atexit ((void (*) (void *)) func, NULL,\n-\t\t &__dso_handle == NULL ? NULL : __dso_handle);\n+ return __cxa_atexit ((void (*) (void *)) func, NULL, __dso_handle);\n }\ndiff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c\nindex a227e4653c..9bdd690842 100644\n--- a/stdlib/tst-tls-atexit-lib.c\n+++ b/stdlib/tst-tls-atexit-lib.c\n@@ -18,8 +18,6 @@\n \n #include <stdlib.h>\n \n-extern void *__dso_handle;\n-\n typedef struct\n {\n void *val;\n", "prefixes": [ "08/58" ] }