Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808886/?format=api
{ "id": 808886, "url": "http://patchwork.ozlabs.org/api/patches/808886/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20170901180029.9527-26-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-26-hjl.tools@gmail.com>", "list_archive_url": null, "date": "2017-09-01T17:59:56", "name": "[25/58] Hide internal sysinfo functions [BZ #18822]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "ef6f8d487cc3fcbc63e751d07ef175deb2e99899", "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-26-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/808886/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808886/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-84078-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-84078-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=\"AEOjagjR\"; 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 3xkRyY3H80z9t2x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 2 Sep 2017 04:06:45 +1000 (AEST)", "(qmail 87882 invoked by alias); 1 Sep 2017 18:01:04 -0000", "(qmail 87819 invoked by uid 89); 1 Sep 2017 18:01:03 -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=YA+qiztoEeVPyEjYxfxHzJ/f8XXl9pV\n\tF6crDxqLcm2pIN6nprGpuQjkiobFOG5r5mjhrE8QgWv1aHlcWa4Zg6uVZlxiBcAb\n\tiF/MlQNbGQIDur/m70KFxgjXQU8RAiIg81cBPlnIyA+SEwiksWI0Rltqqr+cRmU7\n\tb5WnZhP7N2yo=", "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=7K86VYJO6K7D8clQA0xlwwGHdIM=; b=AEOja\n\tgjRZVNeOgPhazYL24Dfgamq7pUN8Ui7WPQ4ZjuMkLxIS9TuIu5vaQf2Q37r8tOjI\n\td2elA0g/U3zLjrpmQuFJn4eXNIouHSKUHLBq2/dSQnofrwbsxKb015Z3ilREgwlB\n\tEVcTLkgRfqLcHkIbI5o1LmlLKzfPhZ4MmVaNis=", "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 25/58] Hide internal sysinfo functions [BZ #18822]", "Date": "Fri, 1 Sep 2017 10:59:56 -0700", "Message-Id": "<20170901180029.9527-26-hjl.tools@gmail.com>", "In-Reply-To": "<20170901180029.9527-1-hjl.tools@gmail.com>", "References": "<20170901180029.9527-1-hjl.tools@gmail.com>" }, "content": "Hide internal sysinfo functions to allow direct access within libc.so\nand libc.a without using GOT nor PLT.\n\n\t[BZ #18822]\n\t* include/sys/sysinfo.h (__get_nprocs_conf): Add\n\tlibc_hidden_proto.\n\t(__get_nprocs): Likewise.\n\t(__get_phys_pages): Likewise.\n\t(__get_avphys_pages): Likewise.\n\t(__get_child_max): Add attribute_hidden.\n\t* misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def.\n\t(__get_nprocs): Likewise.\n\t(__get_phys_pages): Likewise.\n\t(__get_avphys_pages): Likewise.\n\t* sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add\n\tlibc_hidden_def.\n\t(__get_nprocs): Likewise.\n\t(__get_phys_pages): Likewise.\n\t(__get_avphys_pages): Likewise.\n\t* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add\n\tlibc_hidden_def.\n\t(__get_nprocs_conf): Likewise.\n\t(__get_phys_pages): Likewise.\n\t(__get_avphys_pages): Likewise.\n---\n include/sys/sysinfo.h | 6 +++++-\n misc/getsysstats.c | 4 ++++\n sysdeps/mach/getsysstats.c | 4 ++++\n sysdeps/unix/sysv/linux/getsysstats.c | 4 ++++\n 4 files changed, 17 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h\nindex c33eae2883..7388356a19 100644\n--- a/include/sys/sysinfo.h\n+++ b/include/sys/sysinfo.h\n@@ -7,18 +7,22 @@\n \n /* Return number of configured processors. */\n extern int __get_nprocs_conf (void);\n+libc_hidden_proto (__get_nprocs_conf)\n \n /* Return number of available processors. */\n extern int __get_nprocs (void);\n+libc_hidden_proto (__get_nprocs)\n \n /* Return number of physical pages of memory in the system. */\n extern long int __get_phys_pages (void);\n+libc_hidden_proto (__get_phys_pages)\n \n /* Return number of available physical pages of memory in the system. */\n extern long int __get_avphys_pages (void);\n+libc_hidden_proto (__get_avphys_pages)\n \n /* Return maximum number of processes this real user ID can have. */\n-extern long int __get_child_max (void);\n+extern long int __get_child_max (void) attribute_hidden;\n \n # endif /* !_ISOMAC */\n #endif /* sys/sysinfo.h */\ndiff --git a/misc/getsysstats.c b/misc/getsysstats.c\nindex d25770ec52..cbad87a3a2 100644\n--- a/misc/getsysstats.c\n+++ b/misc/getsysstats.c\n@@ -26,6 +26,7 @@ __get_nprocs_conf (void)\n /* We don't know how to determine the number. Simply return always 1. */\n return 1;\n }\n+libc_hidden_def (__get_nprocs_conf)\n weak_alias (__get_nprocs_conf, get_nprocs_conf)\n \n link_warning (get_nprocs_conf, \"warning: get_nprocs_conf will always return 1\")\n@@ -38,6 +39,7 @@ __get_nprocs (void)\n /* We don't know how to determine the number. Simply return always 1. */\n return 1;\n }\n+libc_hidden_def (__get_nprocs)\n weak_alias (__get_nprocs, get_nprocs)\n \n link_warning (get_nprocs, \"warning: get_nprocs will always return 1\")\n@@ -50,6 +52,7 @@ __get_phys_pages (void)\n __set_errno (ENOSYS);\n return -1;\n }\n+libc_hidden_def (__get_phys_pages)\n weak_alias (__get_phys_pages, get_phys_pages)\n \n stub_warning (get_phys_pages)\n@@ -62,6 +65,7 @@ __get_avphys_pages (void)\n __set_errno (ENOSYS);\n return -1;\n }\n+libc_hidden_def (__get_avphys_pages)\n weak_alias (__get_avphys_pages, get_avphys_pages)\n \n stub_warning (get_avphys_pages)\ndiff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c\nindex 0dacab0300..3aabd61382 100644\n--- a/sysdeps/mach/getsysstats.c\n+++ b/sysdeps/mach/getsysstats.c\n@@ -39,6 +39,7 @@ __get_nprocs_conf (void)\n \n return hbi.max_cpus;\n }\n+libc_hidden_def (__get_nprocs_conf)\n weak_alias (__get_nprocs_conf, get_nprocs_conf)\n \n /* Return the number of processors currently available on the system. */\n@@ -58,6 +59,7 @@ __get_nprocs (void)\n \n return hbi.avail_cpus;\n }\n+libc_hidden_def (__get_nprocs)\n weak_alias (__get_nprocs, get_nprocs)\n \n /* Return the number of physical pages on the system. */\n@@ -77,6 +79,7 @@ __get_phys_pages (void)\n \n return hbi.memory_size / __vm_page_size;\n }\n+libc_hidden_def (__get_phys_pages)\n weak_alias (__get_phys_pages, get_phys_pages)\n \n /* Return the number of available physical pages */\n@@ -102,4 +105,5 @@ __get_avphys_pages (void)\n \n return vs.free_count;\n }\n+libc_hidden_def (__get_avphys_pages)\n weak_alias (__get_avphys_pages, get_avphys_pages)\ndiff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c\nindex d02c86d739..c245b3c662 100644\n--- a/sysdeps/unix/sysv/linux/getsysstats.c\n+++ b/sysdeps/unix/sysv/linux/getsysstats.c\n@@ -226,6 +226,7 @@ __get_nprocs (void)\n \n return result;\n }\n+libc_hidden_def (__get_nprocs)\n weak_alias (__get_nprocs, get_nprocs)\n \n \n@@ -279,6 +280,7 @@ __get_nprocs_conf (void)\n \n return result;\n }\n+libc_hidden_def (__get_nprocs_conf)\n weak_alias (__get_nprocs_conf, get_nprocs_conf)\n \n \n@@ -320,6 +322,7 @@ __get_phys_pages (void)\n __sysinfo (&info);\n return sysinfo_mempages (info.totalram, info.mem_unit);\n }\n+libc_hidden_def (__get_phys_pages)\n weak_alias (__get_phys_pages, get_phys_pages)\n \n long int\n@@ -330,4 +333,5 @@ __get_avphys_pages (void)\n __sysinfo (&info);\n return sysinfo_mempages (info.freeram, info.mem_unit);\n }\n+libc_hidden_def (__get_avphys_pages)\n weak_alias (__get_avphys_pages, get_avphys_pages)\n", "prefixes": [ "25/58" ] }