[PATCH] don't make __errno_location / __h_errno_location hidden

Peter Korsgaard jacmet at sunsite.dk
Mon Jul 5 12:12:22 UTC 2010


Closes #2089 (https://bugs.busybox.net/show_bug.cgi?id=2089)

__errno_location / __h_errno_location access has to go through the PLT
like malloc/free, so the linuxthread variants gets used instead when
compiling with -pthread.

Based on http://github.com/mat-c/uClibc/commit/328d392c54aa5dc2b8e7f398a419087de497de2b

Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
---
 include/netdb.h                               |    1 -
 libc/misc/internals/__errno_location.c        |    3 ---
 libc/misc/internals/__h_errno_location.c      |    1 -
 libc/sysdeps/linux/common/bits/errno.h        |    1 -
 libc/sysdeps/linux/common/bits/uClibc_errno.h |    3 ---
 5 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/include/netdb.h b/include/netdb.h
index 9d3807d..ac411ab 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -59,7 +59,6 @@ __BEGIN_DECLS
 
 /* Function to get address of global `h_errno' variable.  */
 extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
-libc_hidden_proto(__h_errno_location)
 
 /* Macros for accessing h_errno from inside libc.  */
 #ifdef _LIBC
diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c
index aec7641..71c5461 100644
--- a/libc/misc/internals/__errno_location.c
+++ b/libc/misc/internals/__errno_location.c
@@ -15,6 +15,3 @@ __errno_location (void)
 {
     return &errno;
 }
-#ifdef IS_IN_libc /* not really need, only to keep in sync w/ libc_hidden_proto */
-libc_hidden_weak(__errno_location)
-#endif
diff --git a/libc/misc/internals/__h_errno_location.c b/libc/misc/internals/__h_errno_location.c
index 213d398..235df4e 100644
--- a/libc/misc/internals/__h_errno_location.c
+++ b/libc/misc/internals/__h_errno_location.c
@@ -10,4 +10,3 @@ int * weak_const_function __h_errno_location (void)
 {
     return &h_errno;
 }
-libc_hidden_weak(__h_errno_location)
diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h
index 0bf6354..de9688a 100644
--- a/libc/sysdeps/linux/common/bits/errno.h
+++ b/libc/sysdeps/linux/common/bits/errno.h
@@ -43,7 +43,6 @@
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
 extern int *__errno_location (void) __THROW __attribute__ ((__const__));
-libc_hidden_proto(__errno_location)
 
 #  ifdef __UCLIBC_HAS_THREADS__
 /* When using threads, errno is a per-thread value.  */
diff --git a/libc/sysdeps/linux/common/bits/uClibc_errno.h b/libc/sysdeps/linux/common/bits/uClibc_errno.h
index 9c15618..79eb7e6 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_errno.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_errno.h
@@ -33,9 +33,6 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__))
 ;
 # if defined __UCLIBC_HAS_THREADS__
 #  include <tls.h>
-#  if defined USE___THREAD && USE___THREAD
-libc_hidden_proto(__errno_location)
-#  endif
 # endif
 
 #endif /* !__ASSEMBLER__ */
-- 
1.7.1



More information about the uClibc mailing list