From patchwork Thu Aug 17 20:56:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 22198 Received: (qmail 115392 invoked by alias); 17 Aug 2017 20:56:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115363 invoked by uid 89); 17 Aug 2017 20:56:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga06.intel.com X-ExtLoop1: 1 Date: Thu, 17 Aug 2017 13:56:52 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH 4/4] Mark internal argp functions with attribute_hidden [BZ #18822] Message-ID: <20170817205652.GD7700@gmail.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) Mark internal argp functions with attribute_hidden to allow direct access to them within libc.so and libc.a without using GOT nor PLT. Tested on i686 and x86-64. OK for master? H.J. --- [BZ #18822] * argp/argp-fmtstream.c: Include . * argp/argp-fs-xinl.c: Likewise. * argp/argp-help.c: Include and . * argp/argp-parse.c: Include . * argp/argp-xinl.c: Likewise. * include/argp-fmtstream.h: New file. * include/argp.h (__argp_error): Add attribute_hidden. (__argp_failure): Likewise. (__argp_input): Likewise. (__argp_state_help): Likewise. --- argp/argp-fmtstream.c | 2 +- argp/argp-fs-xinl.c | 2 +- argp/argp-help.c | 4 ++-- argp/argp-parse.c | 2 +- argp/argp-xinl.c | 2 +- include/argp-fmtstream.h | 19 +++++++++++++++++++ include/argp.h | 10 ++++++++++ 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 include/argp-fmtstream.h diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c index 9e41708cbd..f12c265196 100644 --- a/argp/argp-fmtstream.c +++ b/argp/argp-fmtstream.c @@ -30,7 +30,7 @@ #include #include -#include "argp-fmtstream.h" +#include #include "argp-namefrob.h" #ifndef ARGP_FMTSTREAM_USE_LINEWRAP diff --git a/argp/argp-fs-xinl.c b/argp/argp-fs-xinl.c index f0ce509040..8ebbb8eb1f 100644 --- a/argp/argp-fs-xinl.c +++ b/argp/argp-fs-xinl.c @@ -24,7 +24,7 @@ #define ARGP_FS_EI #undef __OPTIMIZE__ #define __OPTIMIZE__ 1 -#include "argp-fmtstream.h" +#include #if 0 /* Not exported. */ diff --git a/argp/argp-help.c b/argp/argp-help.c index e704c5a3aa..821d98c3d6 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -79,8 +79,8 @@ char *strerror (int errnum); # endif #endif -#include "argp.h" -#include "argp-fmtstream.h" +#include +#include #include "argp-namefrob.h" #ifndef SIZE_MAX diff --git a/argp/argp-parse.c b/argp/argp-parse.c index 662eed32ad..691c4623ac 100644 --- a/argp/argp-parse.c +++ b/argp/argp-parse.c @@ -62,7 +62,7 @@ char *alloca (); # define N_(msgid) (msgid) #endif -#include "argp.h" +#include #include "argp-namefrob.h" /* Getopt return values. */ diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c index 0b45bdc86b..206d0e46c7 100644 --- a/argp/argp-xinl.c +++ b/argp/argp-xinl.c @@ -31,7 +31,7 @@ #define ARGP_EI #undef __OPTIMIZE__ #define __OPTIMIZE__ 1 -#include "argp.h" +#include /* Add weak aliases. */ #if _LIBC - 0 && defined (weak_alias) diff --git a/include/argp-fmtstream.h b/include/argp-fmtstream.h new file mode 100644 index 0000000000..45c65ce834 --- /dev/null +++ b/include/argp-fmtstream.h @@ -0,0 +1,19 @@ +#ifndef _ARGP_FMTSTREAM_H +#include + +#ifndef _ISOMAC +extern __typeof (__argp_fmtstream_ensure) __argp_fmtstream_ensure + attribute_hidden; +extern __typeof (__argp_fmtstream_free) __argp_fmtstream_free + attribute_hidden; +extern __typeof (__argp_fmtstream_printf) __argp_fmtstream_printf + attribute_hidden; +extern __typeof (__argp_fmtstream_update) __argp_fmtstream_update + attribute_hidden; +extern __typeof (__argp_fmtstream_write) __argp_fmtstream_write + attribute_hidden; +extern __typeof (__argp_make_fmtstream) __argp_make_fmtstream + attribute_hidden; +#endif + +#endif diff --git a/include/argp.h b/include/argp.h index 92be5f90f1..6cf8782060 100644 --- a/include/argp.h +++ b/include/argp.h @@ -1 +1,11 @@ +#ifndef _ARGP_H #include + +#ifndef _ISOMAC +extern __typeof (__argp_error) __argp_error attribute_hidden; +extern __typeof (__argp_failure) __argp_failure attribute_hidden; +extern __typeof (__argp_input) __argp_input attribute_hidden; +extern __typeof (__argp_state_help) __argp_state_help attribute_hidden; +#endif + +#endif