about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-01 17:46:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-01 17:46:54 -0700
commitdd3121df08d5ee44ba770d12365022aa802fb364 (patch)
tree679bb661f8835c1ba69229daad5b4f3b8c838e32 /sysdeps
parent047d1a81fd82db4cd7458fec37230f3b31b414e9 (diff)
downloadglibc-dd3121df08d5ee44ba770d12365022aa802fb364.tar.gz
glibc-dd3121df08d5ee44ba770d12365022aa802fb364.tar.xz
glibc-dd3121df08d5ee44ba770d12365022aa802fb364.zip
Hide internal __setrlimit function [BZ #18822]
Hide internal __setrlimit function to allow direct access within libc.so
and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/resource.h (__setrlimit): Add libc_hidden_proto.
	* resource/setrlimit.c (__setrlimit): Add libc_hidden_def.
	* sysdeps/mach/hurd/setrlimit.c (__setrlimit): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Likewise.
	* sysdeps/unix/sysv/linux/setrlimit64.c (__GI___setrlimit): New.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit64.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/setrlimit.c b/sysdeps/mach/hurd/setrlimit.c
index 3ea9af2e7c..693422a537 100644
--- a/sysdeps/mach/hurd/setrlimit.c
+++ b/sysdeps/mach/hurd/setrlimit.c
@@ -53,4 +53,5 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)
   return 0;
 }
 
+libc_hidden_def (__setrlimit)
 weak_alias (__setrlimit, setrlimit)
diff --git a/sysdeps/unix/sysv/linux/setrlimit.c b/sysdeps/unix/sysv/linux/setrlimit.c
index 8773c78236..50a21636ef 100644
--- a/sysdeps/unix/sysv/linux/setrlimit.c
+++ b/sysdeps/unix/sysv/linux/setrlimit.c
@@ -48,6 +48,7 @@ __setrlimit (enum __rlimit_resource resource, const struct rlimit *rlim)
   return INLINE_SYSCALL_CALL (prlimit64, 0, resource, &rlim64, NULL);
 }
 
+libc_hidden_def (__setrlimit)
 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
 strong_alias (__setrlimit, __setrlimit_1)
 compat_symbol (libc, __setrlimit, setrlimit, GLIBC_2_0);
diff --git a/sysdeps/unix/sysv/linux/setrlimit64.c b/sysdeps/unix/sysv/linux/setrlimit64.c
index db1960fc18..ff835c8733 100644
--- a/sysdeps/unix/sysv/linux/setrlimit64.c
+++ b/sysdeps/unix/sysv/linux/setrlimit64.c
@@ -43,4 +43,7 @@ weak_alias (__setrlimit64, setrlimit64)
 #if __RLIM_T_MATCHES_RLIM64_T
 strong_alias (__setrlimit64, __setrlimit)
 weak_alias (__setrlimit64, setrlimit)
+# ifdef SHARED
+__hidden_ver1 (__setrlimit64, __GI___setrlimit, __setrlimit64);
+# endif
 #endif