This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PATCH: Make _errno/errno available in GLIBC_2_0.
- From: "H. J. Lu" <hjl at lucon dot org>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Tue, 16 Sep 2003 13:42:31 -0700
- Subject: PATCH: Make _errno/errno available in GLIBC_2_0.
When nptl is enabled, libc.so has
343: 00000008 4 TLS GLOBAL DEFAULT 23 errno@@GLIBC_PRIVATE
7802: 00000008 4 TLS GLOBAL DEFAULT 23 errno
With Linuxthreads, libc.so has
1046: 0012c600 4 OBJECT GLOBAL DEFAULT 27 _errno@GLIBC_2.0
1174: 0012c600 4 OBJECT GLOBAL DEFAULT 27 errno@GLIBC_2.0
Applications which reference errno@GLIBC_2.0 won't run with nptl. This
patch makes _errno/errno available in GLIBC_2_0. Now I got
365: 00000008 4 TLS GLOBAL DEFAULT 23 errno@@GLIBC_PRIVATE
1039: 00000008 4 TLS GLOBAL DEFAULT 23 _errno@GLIBC_2.0
6679: 00000008 4 TLS LOCAL HIDDEN 23 errno@GLIBC_2.0
H.J.
-----
2003-09-16 H.J. Lu <hongjiu.lu@intel.com>
* csu/Versions (_errno): Always available in GLIBC_2_0.
(_errno): Likewise.
* sysdeps/generic/errno.c: Likewise.
--- libc/csu/Versions.errno 2002-11-14 19:36:52.000000000 -0800
+++ libc/csu/Versions 2003-09-16 12:38:59.000000000 -0700
@@ -5,13 +5,11 @@ libc {
# helper functions
__libc_init_first; __libc_start_main;
-%if !(USE_TLS && HAVE___THREAD)
# global variables
_errno;
# variables in normal name space
errno;
-%endif
}
GLIBC_2.1 {
# New special glibc functions.
--- libc/sysdeps/generic/errno.c.errno 2002-11-14 19:36:51.000000000 -0800
+++ libc/sysdeps/generic/errno.c 2003-09-16 13:21:23.000000000 -0700
@@ -19,12 +19,20 @@
#include <errno.h>
#include <tls.h>
+#include <shlib-compat.h>
+
#undef errno
#if USE___THREAD
-__thread int errno;
-extern __thread int __libc_errno __attribute__ ((alias ("errno")))
+__thread int __libc_thread_errno;
+extern __thread int __libc_errno __attribute__ ((alias ("__libc_thread_errno")))
attribute_hidden;
+strong_alias (__libc_thread_errno, _errno)
+versioned_symbol (libc, __libc_thread_errno, errno, GLIBC_PRIVATE);
+# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+compat_symbol (libc, __libc_errno, errno, GLIBC_2_0);
+compat_symbol (libc, _errno, _errno, GLIBC_2_0);
+# endif
#else
/* This differs from plain `int errno;' in that it doesn't create
a common definition, but a plain symbol that resides in .bss,
@@ -35,7 +43,6 @@ strong_alias (errno, _errno)
/* We declare these with compat_symbol so that they are not
visible at link time. Programs must use the accessor functions. */
# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
-# include <shlib-compat.h>
compat_symbol (libc, errno, errno, GLIBC_2_0);
compat_symbol (libc, _errno, _errno, GLIBC_2_0);
# endif