From patchwork Fri Sep 1 18:00:10 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: 22553 Received: (qmail 90137 invoked by alias); 1 Sep 2017 18:01:17 -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 90070 invoked by uid 89); 1 Sep 2017 18:01:17 -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 39/58] Hide internal __get_sol function [BZ #18822] Date: Fri, 1 Sep 2017 11:00:10 -0700 Message-Id: <20170901180029.9527-40-hjl.tools@gmail.com> In-Reply-To: <20170901180029.9527-1-hjl.tools@gmail.com> References: <20170901180029.9527-1-hjl.tools@gmail.com> Hide internal __get_sol function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/unix/sysv/linux/getsourcefilter.c: Include "getsourcefilter.h". * sysdeps/unix/sysv/linux/getsourcefilter.h: New file. * sysdeps/unix/sysv/linux/setsourcefilter.c: Include "getsourcefilter.h". (__get_sol): Removed. --- sysdeps/unix/sysv/linux/getsourcefilter.c | 1 + sysdeps/unix/sysv/linux/getsourcefilter.h | 20 ++++++++++++++++++++ sysdeps/unix/sysv/linux/setsourcefilter.c | 5 +---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/getsourcefilter.h diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.c b/sysdeps/unix/sysv/linux/getsourcefilter.c index 806cb161e4..1465d69348 100644 --- a/sysdeps/unix/sysv/linux/getsourcefilter.c +++ b/sysdeps/unix/sysv/linux/getsourcefilter.c @@ -31,6 +31,7 @@ #include #include #include +#include "getsourcefilter.h" static const struct diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.h b/sysdeps/unix/sysv/linux/getsourcefilter.h new file mode 100644 index 0000000000..ac49290881 --- /dev/null +++ b/sysdeps/unix/sysv/linux/getsourcefilter.h @@ -0,0 +1,20 @@ +/* __get_sol function prototype. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Defined in getsourcefilter.c. */ +extern int __get_sol (int af, socklen_t len) attribute_hidden; diff --git a/sysdeps/unix/sysv/linux/setsourcefilter.c b/sysdeps/unix/sysv/linux/setsourcefilter.c index b4160ff4d8..ade424bbac 100644 --- a/sysdeps/unix/sysv/linux/setsourcefilter.c +++ b/sysdeps/unix/sysv/linux/setsourcefilter.c @@ -24,10 +24,7 @@ #include #include #include - - -/* Defined in getsourcefilter.c. */ -extern int __get_sol (int af, socklen_t len); +#include "getsourcefilter.h" int