From patchwork Fri Sep 1 17:59:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 808860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-84057-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="id4kDygs"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xkRtc5lZ1z9s7M for ; Sat, 2 Sep 2017 04:03:20 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=WBNHS0Ra/muztmLI3neXKfsB+qFwu3s D+qXWosG66hV5Z602mOXHV72OUMVf37XPi0Hhmo32uMPkgykWPS01NSHPKr16vUy RVYKcTDSqesu/sL4s2ylK+6vSZro0Py5VbUk38xb7OME4O4IfE7qECd+PGpa/tpU rtCgb7d8ghCQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=ph70abtJSTFmWUxLZitErAtbtfs=; b=id4kD ygs3W3EnhGdYpeQ60Zpn/KAXP/Lh6kCwey7BexbXLNn0wLVGUjinnq2MCF7HjE3T 1xj2UOX2kL5OlgDMqDRFrNGK3t1ex+QEP+JcEEDLplUTPtoIN64EQWtVU2HdsQa3 JzsPHLMJnxwQrA5P4CHLqykqKF+nQs8X0FeB+k= Received: (qmail 84927 invoked by alias); 1 Sep 2017 18:00:50 -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 84780 invoked by uid 89); 1 Sep 2017 18:00:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*m:gmail X-HELO: mga02.intel.com X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 05/58] Mark internal argp functions with attribute_hidden [BZ #18822] Date: Fri, 1 Sep 2017 10:59:36 -0700 Message-Id: <20170901180029.9527-6-hjl.tools@gmail.com> In-Reply-To: <20170901180029.9527-1-hjl.tools@gmail.com> References: <20170901180029.9527-1-hjl.tools@gmail.com> Mark internal argp functions with attribute_hidden to allow direct access to them within libc.so and libc.a without using GOT nor PLT. [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