{"id":808864,"url":"http://patchwork.ozlabs.org/api/1.0/patches/808864/?format=json","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.0/projects/41/?format=json","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":""},"msgid":"<20170901180029.9527-11-hjl.tools@gmail.com>","date":"2017-09-01T17:59:41","name":"[10/58] Mark internal gmp functions with attribute_hidden [BZ #18822]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"135e67a9837240101d0bb3371280d9f8c28fe542","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/1.0/people/4387/?format=json","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/20170901180029.9527-11-hjl.tools@gmail.com/mbox/","series":[{"id":1088,"url":"http://patchwork.ozlabs.org/api/1.0/series/1088/?format=json","date":"2017-09-01T18:00:21","name":"Hide internal functions in libc.so","version":1,"mbox":"http://patchwork.ozlabs.org/series/1088/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/808864/checks/","tags":{},"headers":{"Return-Path":"<libc-alpha-return-84061-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-84061-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=\"R7qADZxF\"; 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 3xkRvJ6WKMz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 04:03:56 +1000 (AEST)","(qmail 85230 invoked by alias); 1 Sep 2017 18:00:51 -0000","(qmail 85080 invoked by uid 89); 1 Sep 2017 18:00:50 -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=y5xFMniPszlTd/yxIG98Z6pZPX2UbKN\n\tE5b5M8WtSYpJGLVNFMzVtozLPOCb7zIWWKxpHhV0Sd4w7zs8wTLpZf27TZU1iGNv\n\tHoC9v3l+S6td2TKEhXBnlCdss8mQ6PloqS+NITctal35grVkazr+sP57urTjZEkL\n\taUiSwtu92R3k=","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=0PXeqUrykJO1AXq89wHRIaJMum4=; b=R7qAD\n\tZxFioIR29LBf3vOKUTS84ZWeUo6KGxje9cdhM5KrVg57icLIwnRHJeOLaptSMhy8\n\t0kSsSQkN4gdEmcuJN3qxfgvGARUpdcoaTbAGu4Bx5kqTFiO6yR1RXLsrSOqpj4QB\n\tAZrR+rmZ5y4Cns1+z2bj15AlBs1Mt7GB/VnJ4M=","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,\n\tSPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*m:gmail","X-HELO":"mga02.intel.com","X-ExtLoop1":"1","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","To":"libc-alpha@sourceware.org","Subject":"[PATCH 10/58] Mark internal gmp functions with attribute_hidden [BZ\n\t#18822]","Date":"Fri,  1 Sep 2017 10:59:41 -0700","Message-Id":"<20170901180029.9527-11-hjl.tools@gmail.com>","In-Reply-To":"<20170901180029.9527-1-hjl.tools@gmail.com>","References":"<20170901180029.9527-1-hjl.tools@gmail.com>"},"content":"Mark internal gmp functions with attribute_hidden to allow direct\naccess within libc.so and libc.a without using GOT nor PLT.\n\n\t[BZ #18822]\n\t* include/gmp.h: Declare internal functions only if _ISOMAC is\n\tundefined.\n\t(__mpn_extract_double): Add attribute_hidden.\n\t(__mpn_extract_long_double): Likewise.\n\t(__mpn_extract_float128): Likewise.\n\t(__mpn_construct_float): Likewise.\n\t(__mpn_construct_double): Likewise.\n\t(__mpn_construct_long_double): Likewise.\n\t(__mpn_construct_float128): Likewise.\n\t(mpn_add_1): Likewise.\n\t(mpn_addmul_1): Likewise.\n\t(mpn_add_n): Likewise.\n\t(mpn_cmp): Likewise.\n\t(mpn_divrem): Likewise.\n\t(mpn_lshift): Likewise.\n\t(mpn_mul): Likewise.\n\t(mpn_mul_1): Likewise.\n\t(mpn_rshift): Likewise.\n\t(mpn_sub_1): Likewise.\n\t(mpn_submul_1): Likewise.\n\t(mpn_sub_n): Likewise.\n---\n include/gmp.h     | 33 ++++++++++++++++++++++++++-------\n stdlib/gmp-impl.h | 12 ++++++++----\n 2 files changed, 34 insertions(+), 11 deletions(-)","diff":"diff --git a/include/gmp.h b/include/gmp.h\nindex 3590acf408..657c7a0148 100644\n--- a/include/gmp.h\n+++ b/include/gmp.h\n@@ -8,32 +8,51 @@\n \n #include <bits/floatn.h>\n \n+#ifndef _ISOMAC\n /* Now define the internal interfaces.  */\n extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,\n \t\t\t\t       int *expt, int *is_neg,\n-\t\t\t\t       double value);\n+\t\t\t\t       double value) attribute_hidden;\n \n extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,\n \t\t\t\t\t    int *expt, int *is_neg,\n-\t\t\t\t\t    long double value);\n+\t\t\t\t\t    long double value)\n+     attribute_hidden;\n \n #if __HAVE_DISTINCT_FLOAT128\n extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,\n \t\t\t\t\t int *expt, int *is_neg,\n-\t\t\t\t\t _Float128 value);\n+\t\t\t\t\t _Float128 value)\n+     attribute_hidden;\n #endif\n \n-extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);\n+extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign)\n+     attribute_hidden;\n \n extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,\n-\t\t\t\t      int negative);\n+\t\t\t\t      int negative) attribute_hidden;\n \n extern long double __mpn_construct_long_double (mp_srcptr frac_ptr, int expt,\n-\t\t\t\t\t\tint sign);\n+\t\t\t\t\t\tint sign)\n+     attribute_hidden;\n \n #if __HAVE_DISTINCT_FLOAT128\n extern _Float128 __mpn_construct_float128 (mp_srcptr frac_ptr, int expt,\n-\t\t\t\t\t   int sign);\n+\t\t\t\t\t   int sign) attribute_hidden;\n+#endif\n+\n+extern __typeof (mpn_add_1) mpn_add_1 attribute_hidden;\n+extern __typeof (mpn_addmul_1) mpn_addmul_1 attribute_hidden;\n+extern __typeof (mpn_add_n) mpn_add_n attribute_hidden;\n+extern __typeof (mpn_cmp) mpn_cmp attribute_hidden;\n+extern __typeof (mpn_divrem) mpn_divrem attribute_hidden;\n+extern __typeof (mpn_lshift) mpn_lshift attribute_hidden;\n+extern __typeof (mpn_mul) mpn_mul attribute_hidden;\n+extern __typeof (mpn_mul_1) mpn_mul_1 attribute_hidden;\n+extern __typeof (mpn_rshift) mpn_rshift attribute_hidden;\n+extern __typeof (mpn_sub_1) mpn_sub_1 attribute_hidden;\n+extern __typeof (mpn_submul_1) mpn_submul_1 attribute_hidden;\n+extern __typeof (mpn_sub_n) mpn_sub_n attribute_hidden;\n #endif\n \n #endif\ndiff --git a/stdlib/gmp-impl.h b/stdlib/gmp-impl.h\nindex 42d3e4afac..cbbf9479ac 100644\n--- a/stdlib/gmp-impl.h\n+++ b/stdlib/gmp-impl.h\n@@ -308,13 +308,17 @@ typedef unsigned int UHWtype;\n \n /* Prototypes for internal mpn calls.  */\n extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,\n-\t\t\t\t\t mp_srcptr vp, mp_size_t size));\n+\t\t\t\t\t mp_srcptr vp, mp_size_t size))\n+     attribute_hidden;\n extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,\n-\t\t\t\tmp_size_t size, mp_ptr tspace));\n+\t\t\t\tmp_size_t size, mp_ptr tspace))\n+     attribute_hidden;\n extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,\n-\t\t\t\t\t mp_size_t size));\n+\t\t\t\t\t mp_size_t size))\n+     attribute_hidden;\n extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,\n-\t\t\t\tmp_ptr tspace));\n+\t\t\t\tmp_ptr tspace))\n+     attribute_hidden;\n \n \n \n","prefixes":["10/58"]}