[31/58] Hide internal __strsep function [BZ #18822]

Message ID 20170901180029.9527-32-hjl.tools@gmail.com
State Committed
Commit 78cf1d74d28c9312d888dea1ad3de01d38c5fc4a
Headers

Commit Message

H.J. Lu Sept. 1, 2017, 6 p.m. UTC
  Hide internal __strsep function to allow direct access within libc.so and
libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/string.h (__strsep): Add libc_hidden_proto.
	* string/strsep.c (__strsep): Add libc_hidden_def.
---
 include/string.h | 1 +
 string/strsep.c  | 1 +
 2 files changed, 2 insertions(+)
  

Comments

H.J. Lu Oct. 1, 2017, 10:36 p.m. UTC | #1
On 9/1/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hide internal __strsep function to allow direct access within libc.so and
> libc.a without using GOT nor PLT.
>
> 	[BZ #18822]
> 	* include/string.h (__strsep): Add libc_hidden_proto.
> 	* string/strsep.c (__strsep): Add libc_hidden_def.

Tested with build-many-glibcs.py.  I am checking it in.
  

Patch

diff --git a/include/string.h b/include/string.h
index 069efd0b87..968d6fea05 100644
--- a/include/string.h
+++ b/include/string.h
@@ -12,6 +12,7 @@  extern size_t __strnlen (const char *__string, size_t __maxlen)
      __attribute_pure__;
 
 extern char *__strsep (char **__stringp, const char *__delim);
+libc_hidden_proto (__strsep)
 
 extern int __strverscmp (const char *__s1, const char *__s2)
      __attribute_pure__;
diff --git a/string/strsep.c b/string/strsep.c
index 7091234a6c..b6103657a8 100644
--- a/string/strsep.c
+++ b/string/strsep.c
@@ -46,4 +46,5 @@  __strsep (char **stringp, const char *delim)
 }
 weak_alias (__strsep, strsep)
 strong_alias (__strsep, __strsep_g)
+libc_hidden_def (__strsep)
 libc_hidden_def (__strsep_g)