From dd3121df08d5ee44ba770d12365022aa802fb364 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 1 Oct 2017 17:46:39 -0700 Subject: 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. --- sysdeps/mach/hurd/setrlimit.c | 1 + sysdeps/unix/sysv/linux/setrlimit.c | 1 + sysdeps/unix/sysv/linux/setrlimit64.c | 3 +++ 3 files changed, 5 insertions(+) (limited to 'sysdeps') 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 -- cgit 1.4.1