From patchwork Sun Oct 18 17:25:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 531993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 82AC7140D97 for ; Mon, 19 Oct 2015 04:26:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=eMh1rena; dkim-atps=neutral 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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=AWoYKUjDPTInfM6OWbfK4jl9sMURvoe KjKioSjbuV0jfy+4K0s9NQ3E3f1wV9L4IrC0LrnDgyIu+D3UwyCU9ZkIl6PIMK2A x8BaoRDMWnGFt0ko+v7iUUCDJZaq72+zpyBfL4tUJhhXHAdsG8TMrUTMvaR8JFym RMplefiyqgew= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=GBkvnQo91bttiNwWGTGZrPqU88U=; b=eMh1r enaLWj6yeJ9AACiEMRBW3lE8IBOyVNTJpXIKTqt5HupBNEM/vPQxaOgJBCRrn9sQ yHXS87q//57rMMU15RWDE+Eo6oUFn06zbRDLVUc27bzqOW3ao/07MzUEgtD8mD4z nQwIlqzlpNWa1fFI/j4ctgneAxaxSdtyKrx51w= Received: (qmail 108471 invoked by alias); 18 Oct 2015 17:26:06 -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 108375 invoked by uid 89); 18 Oct 2015 17:26:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga14.intel.com X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: "H.J. Lu" Subject: [PATCH 3/3] Mark internel unistd functions hidden Date: Sun, 18 Oct 2015 10:25:41 -0700 Message-Id: <1445189141-18068-3-git-send-email-hjl.tools@gmail.com> In-Reply-To: <1445189141-18068-1-git-send-email-hjl.tools@gmail.com> References: <1445189141-18068-1-git-send-email-hjl.tools@gmail.com> Since internal unistd functions are only used internally in ld.so and libc.so, they can be made hidden. [BZ #19122] * include/unistd.h (__libc_check_standard_fds): Add attribute_hidden. IS_IN (rtld)] (__access): Likewise. IS_IN (rtld)] (__brk): Likewise. IS_IN (rtld)] (__lseek): Likewise. IS_IN (rtld)] (__profil): Likewise. IS_IN (rtld)] (__read): Likewise. IS_IN (rtld)] (__sbrk): Likewise. IS_IN (rtld)] (__close): Add attribute_hidden if not compiling for Hurd. IS_IN (rtld)] (__getcwd): Likewise. IS_IN (rtld)] (__getpid): Likewise. IS_IN (rtld)] (__libc_read): Likewise. IS_IN (rtld)] (__libc_write): Likewise. --- include/unistd.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/unistd.h b/include/unistd.h index cb41637..9a77e89 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -158,7 +158,7 @@ rtld_hidden_proto (__libc_enable_secure) /* Various internal function. */ -extern void __libc_check_standard_fds (void); +extern void __libc_check_standard_fds (void) attribute_hidden; /* Internal name for fork function. */ @@ -176,6 +176,24 @@ extern int __have_dup3 attribute_hidden; extern int __getlogin_r_loginuid (char *name, size_t namesize) attribute_hidden; +# if IS_IN (rtld) +extern __typeof (__access) __access attribute_hidden; +extern __typeof (__brk) __brk attribute_hidden; +extern __typeof (__lseek) __lseek attribute_hidden; +extern __typeof (__profil) __profil attribute_hidden; +extern __typeof (__read) __read attribute_hidden; +extern __typeof (__sbrk) __sbrk attribute_hidden; +# ifndef __gnu_hurd__ +/* On Hurd, these in ld.so will be preempted by the ones in libc.so after + bootstrap. */ +extern __typeof (__close) __close attribute_hidden; +extern __typeof (__getcwd) __getcwd attribute_hidden; +extern __typeof (__getpid) __getpid attribute_hidden; +extern __typeof (__libc_read) __libc_read attribute_hidden; +extern __typeof (__libc_write) __libc_write attribute_hidden; +# endif +# endif + __END_DECLS # endif