public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 03/58] Mark __internal_statvfs[64] with attribute_hidden [BZ #18822]
Date: Fri, 01 Sep 2017 18:00:00 -0000	[thread overview]
Message-ID: <20170901180029.9527-4-hjl.tools@gmail.com> (raw)
In-Reply-To: <20170901180029.9527-1-hjl.tools@gmail.com>

Mark __internal_statvfs[64] with attribute_hidden to allow direct access
to them within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/fstatvfs.c: Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs): Removed.
	* sysdeps/unix/sysv/linux/fstatvfs64.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs64): Removed.
	* sysdeps/unix/sysv/linux/internal_statvfs.c: Include
	"internal_statvfs.h" instead of <sys/statvfs.h>.
	* sysdeps/unix/sysv/linux/internal_statvfs.h: New file.
	* sysdeps/unix/sysv/linux/statvfs.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs): Removed.
	* sysdeps/unix/sysv/linux/statvfs64.c Include "internal_statvfs.h"
	instead of <sys/statvfs.h>.
	(__internal_statvfs64): Removed.
---
 sysdeps/unix/sysv/linux/fstatvfs.c         |  6 +-----
 sysdeps/unix/sysv/linux/fstatvfs64.c       |  7 +------
 sysdeps/unix/sysv/linux/internal_statvfs.c |  2 +-
 sysdeps/unix/sysv/linux/internal_statvfs.h | 26 ++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/statvfs.c          |  6 +-----
 sysdeps/unix/sysv/linux/statvfs64.c        |  7 +------
 6 files changed, 31 insertions(+), 23 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/internal_statvfs.h

diff --git a/sysdeps/unix/sysv/linux/fstatvfs.c b/sysdeps/unix/sysv/linux/fstatvfs.c
index e07a5b9f3d..1b2f279291 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs.c
@@ -19,11 +19,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
-				struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
 
 int
 __fstatvfs (int fd, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/fstatvfs64.c b/sysdeps/unix/sysv/linux/fstatvfs64.c
index 02a0d7ee42..c923208ea8 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs64.c
@@ -20,14 +20,9 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include <kernel-features.h>
 
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
-				  struct statfs64 *fsbuf, int fd);
-
-
 /* Return information about the filesystem on which FD resides.  */
 int
 __fstatvfs64 (int fd, struct statvfs64 *buf)
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 9a17ca5c17..0a8dc35e16 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -26,7 +26,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include "linux_fsinfo.h"
 #include <kernel-features.h>
 
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.h b/sysdeps/unix/sysv/linux/internal_statvfs.h
new file mode 100644
index 0000000000..1762bbc6c6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.h
@@ -0,0 +1,26 @@
+/* Internal statvfs/statvfs64 function prototypes.
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/statvfs.h>
+
+extern void __internal_statvfs (const char *name, struct statvfs *buf,
+				struct statfs *fsbuf, int fd)
+      attribute_hidden;
+extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
+				  struct statfs64 *fsbuf, int fd)
+      attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c
index 744336e33b..1edf1acca9 100644
--- a/sysdeps/unix/sysv/linux/statvfs.c
+++ b/sysdeps/unix/sysv/linux/statvfs.c
@@ -19,11 +19,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
-
-extern void __internal_statvfs (const char *name, struct statvfs *buf,
-				struct statfs *fsbuf, int fd);
-
+#include "internal_statvfs.h"
 
 int
 __statvfs (const char *file, struct statvfs *buf)
diff --git a/sysdeps/unix/sysv/linux/statvfs64.c b/sysdeps/unix/sysv/linux/statvfs64.c
index a89f720b38..005495fa20 100644
--- a/sysdeps/unix/sysv/linux/statvfs64.c
+++ b/sysdeps/unix/sysv/linux/statvfs64.c
@@ -21,14 +21,9 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <sys/statvfs.h>
+#include "internal_statvfs.h"
 #include <kernel-features.h>
 
-
-extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
-				  struct statfs64 *fsbuf, int fd);
-
-
 /* Return information about the filesystem on which FILE resides.  */
 int
 __statvfs64 (const char *file, struct statvfs64 *buf)
-- 
2.13.5

  parent reply	other threads:[~2017-09-01 18:00 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 18:00 [PATCH 00/58] Hide internal functions in libc.so H.J. Lu
2017-09-01 18:00 ` [PATCH 07/58] Mark internal grp/pwd/shadow functions with attribute_hidden [BZ #18822] H.J. Lu
2017-10-01 21:44   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 18/58] Mark internal utmp " H.J. Lu
2017-09-02 20:58   ` Florian Weimer
2017-10-01 21:14     ` H.J. Lu
2017-09-01 18:00 ` [PATCH 51/58] Hide internal __init_misc function " H.J. Lu
2017-10-02  0:53   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 56/58] Hide internal __glob64 " H.J. Lu
2017-10-02  1:01   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 01/58] Mark internal functions with attribute_hidden " H.J. Lu
2017-10-01 21:37   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 04/58] Mark ____wcsto*_l_internal " H.J. Lu
2017-10-01 21:40   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 54/58] Hide internal __new_exitfn function " H.J. Lu
2017-10-02  0:57   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 09/58] Mark internal wchar functions with attribute_hidden " H.J. Lu
2017-10-01 21:45   ` H.J. Lu
2017-11-13 10:16   ` Stefan Liebler
2017-09-01 18:00 ` [PATCH 57/58] Hide internal __sched_setaffinity_new function " H.J. Lu
2017-10-02  1:03   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 50/58] Hide internal __setfpucw " H.J. Lu
2017-10-02  0:51   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 10/58] Mark internal gmp functions with attribute_hidden " H.J. Lu
2017-10-01 21:46   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 12/58] Mark internal time " H.J. Lu
2017-10-01 22:01   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 08/58] Mark __dso_handle as hidden " H.J. Lu
2017-09-03  8:21   ` Florian Weimer
2017-09-03  9:11     ` Florian Weimer
2017-09-03 13:42       ` H.J. Lu
2017-09-04  7:23         ` Florian Weimer
2017-09-04 21:20           ` H.J. Lu
2017-09-12 15:57             ` H.J. Lu
2017-09-26 22:53               ` H.J. Lu
2017-09-01 18:00 ` [PATCH 11/58] Mark internal nscd functions with attribute_hidden " H.J. Lu
2017-10-01 22:00   ` H.J. Lu
2017-09-01 18:00 ` H.J. Lu [this message]
2017-10-01 21:39   ` [PATCH 03/58] Mark __internal_statvfs[64] " H.J. Lu
2017-09-01 18:00 ` [PATCH 53/58] Hide internal __moncontrol function " H.J. Lu
2017-10-02  0:56   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 19/58] Mark internal stdlib functions with attribute_hidden " H.J. Lu
2017-09-03  9:13   ` Florian Weimer
2017-09-03 21:49     ` H.J. Lu
2017-10-01 21:10       ` H.J. Lu
2017-09-01 18:00 ` [PATCH 55/58] Hide internal __new_getrlimit function " H.J. Lu
2017-10-02  0:59   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 52/58] Hide internal __libc_print_version " H.J. Lu
2017-10-02  0:54   ` H.J. Lu
2017-09-01 18:00 ` [PATCH 15/58] Mark internal stdio functions with attribute_hidden " H.J. Lu
2017-10-01 22:03   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 29/58] Hide internal __mremap function " H.J. Lu
2017-10-01 22:33   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 17/58] Mark internal dirent functions with attribute_hidden " H.J. Lu
2017-10-01 22:23   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 26/58] Mark internal intl " H.J. Lu
2017-10-01 22:25   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 42/58] Hide internal __ifreq function " H.J. Lu
2017-10-02  0:34   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 41/58] Hide internal idna functions " H.J. Lu
2017-10-02  0:32   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 40/58] Hide internal __gettextparse function " H.J. Lu
2017-10-02  0:30   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 37/58] Hide internal __bsd_getpt " H.J. Lu
2017-10-01 22:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 46/58] Hide internal __vstrfmon_l " H.J. Lu
2017-10-02  0:44   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 23/58] Mark internal netlink functions with attribute_hidden " H.J. Lu
2017-10-01 22:25   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 25/58] Hide internal sysinfo functions " H.J. Lu
2017-10-01 22:29   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 48/58] Hide internal __tcgetattr function " H.J. Lu
2017-10-02  0:47   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 47/58] Hide internal __setrlimit " H.J. Lu
2017-10-02  0:46   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 35/58] Hide internal __tdestroy " H.J. Lu
2017-10-01 22:40   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 31/58] Hide internal __strsep " H.J. Lu
2017-10-01 22:36   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 38/58] Move hidden_proto (__dl_iterate_phdr) to include/link.h " H.J. Lu
2017-10-01 22:43   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 14/58] Mark internal gshadow functions with attribute_hidden " H.J. Lu
2017-10-01 22:02   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 22/58] Mark internal rpc " H.J. Lu
2017-10-01 22:24   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 05/58] Mark internal argp " H.J. Lu
2017-10-01 21:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 43/58] Hide internal __hasmntopt function " H.J. Lu
2017-10-02  0:38   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 39/58] Hide internal __get_sol " H.J. Lu
2017-10-01 22:44   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 13/58] Mark internal statfs functions with attribute_hidden " H.J. Lu
2017-10-01 22:02   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 02/58] Mark 3 *_internal " H.J. Lu
2017-10-01 21:21   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 24/58] Hide __chmod and __mkdir " H.J. Lu
2017-09-04  8:05   ` Florian Weimer
2017-09-01 18:01 ` [PATCH 34/58] Hide internal __assert_fail_base function " H.J. Lu
2017-10-01 22:39   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 20/58] Hide internal regex functions " H.J. Lu
2017-10-01 22:27   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 21/58] Hide __readv and __writev " H.J. Lu
2017-09-01 18:01 ` [PATCH 44/58] Hide internal __hash_string function " H.J. Lu
2017-10-02  0:40   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 33/58] Hide internal __sysinfo " H.J. Lu
2017-10-01 22:38   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 58/58] Hide internal fadvise64/fallocate64 functions " H.J. Lu
2017-10-02  1:05   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 32/58] Hide internal signal " H.J. Lu
2017-10-01 22:37   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 16/58] Mark internal getXXXbyYYY functions with attribute_hidden " H.J. Lu
2017-10-01 22:04   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 28/58] Hide internal __malloc_check_init function " H.J. Lu
2017-10-01 22:32   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 49/58] Hide internal __nis_hash " H.J. Lu
2017-10-02  0:49   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 36/58] Hide internal __fopen_maybe_mmap " H.J. Lu
2017-10-01 22:41   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 06/58] Mark internal unistd functions with attribute_hidden " H.J. Lu
2017-10-01 21:43   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 30/58] Hide __posix_spawn_file_actions_realloc/__spawni " H.J. Lu
2017-10-01 22:34   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 45/58] Hide internal __sched_setparam function " H.J. Lu
2017-10-02  0:42   ` H.J. Lu
2017-09-01 18:01 ` [PATCH 27/58] Hide internal __ioctl " H.J. Lu
2017-10-01 22:31   ` H.J. Lu
2017-09-01 18:16 ` [PATCH 00/58] Hide internal functions in libc.so Florian Weimer
2017-09-01 19:42   ` H.J. Lu
2017-09-01 20:14   ` Joseph Myers
2017-09-18 13:59     ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170901180029.9527-4-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).