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. --- include/sys/sysinfo.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h index c33eae2883..7388356a19 100644 --- a/include/sys/sysinfo.h +++ b/include/sys/sysinfo.h @@ -7,18 +7,22 @@ /* Return number of configured processors. */ extern int __get_nprocs_conf (void); +libc_hidden_proto (__get_nprocs_conf) /* Return number of available processors. */ extern int __get_nprocs (void); +libc_hidden_proto (__get_nprocs) /* Return number of physical pages of memory in the system. */ extern long int __get_phys_pages (void); +libc_hidden_proto (__get_phys_pages) /* Return number of available physical pages of memory in the system. */ extern long int __get_avphys_pages (void); +libc_hidden_proto (__get_avphys_pages) /* Return maximum number of processes this real user ID can have. */ -extern long int __get_child_max (void); +extern long int __get_child_max (void) attribute_hidden; # endif /* !_ISOMAC */ #endif /* sys/sysinfo.h */ -- cgit 1.4.1