From b5648377d923d790dd7e995d79d480066b25e6bb Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 1 Oct 2017 15:57:00 -0700 Subject: Hide internal sysinfo functions [BZ #18822] Hide internal sysinfo functions to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/sys/sysinfo.h (__get_nprocs_conf): Add libc_hidden_proto. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. (__get_child_max): Add attribute_hidden. * misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. * sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add libc_hidden_def. (__get_nprocs_conf): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. --- misc/getsysstats.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'misc/getsysstats.c') diff --git a/misc/getsysstats.c b/misc/getsysstats.c index d25770ec52..cbad87a3a2 100644 --- a/misc/getsysstats.c +++ b/misc/getsysstats.c @@ -26,6 +26,7 @@ __get_nprocs_conf (void) /* We don't know how to determine the number. Simply return always 1. */ return 1; } +libc_hidden_def (__get_nprocs_conf) weak_alias (__get_nprocs_conf, get_nprocs_conf) link_warning (get_nprocs_conf, "warning: get_nprocs_conf will always return 1") @@ -38,6 +39,7 @@ __get_nprocs (void) /* We don't know how to determine the number. Simply return always 1. */ return 1; } +libc_hidden_def (__get_nprocs) weak_alias (__get_nprocs, get_nprocs) link_warning (get_nprocs, "warning: get_nprocs will always return 1") @@ -50,6 +52,7 @@ __get_phys_pages (void) __set_errno (ENOSYS); return -1; } +libc_hidden_def (__get_phys_pages) weak_alias (__get_phys_pages, get_phys_pages) stub_warning (get_phys_pages) @@ -62,6 +65,7 @@ __get_avphys_pages (void) __set_errno (ENOSYS); return -1; } +libc_hidden_def (__get_avphys_pages) weak_alias (__get_avphys_pages, get_avphys_pages) stub_warning (get_avphys_pages) -- cgit 1.4.1