about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ctype/ctype-info.c24
-rw-r--r--locale/lc-ctype.c27
-rw-r--r--wcsmbs/wcsmbsload.c19
4 files changed, 41 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f66d5ceab..e89d95984e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-05  Roland McGrath  <roland@redhat.com>
+
+	* ctype/ctype-info.c: Renamed __ctype_old_* symbols to __ctype_*.
+	* locale/lc-ctype.c (_nl_postload_ctype): Likewise.
+
 2002-09-05  Jakub Jelinek  <jakub@redhat.com>
 
         * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in
diff --git a/ctype/ctype-info.c b/ctype/ctype-info.c
index 30c6d55444..35f2fb540f 100644
--- a/ctype/ctype-info.c
+++ b/ctype/ctype-info.c
@@ -48,18 +48,18 @@ extern const char _nl_C_LC_CTYPE_class_alnum[] attribute_hidden;
 
 #define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o)
 
-const unsigned short int *__ctype_old_b = b (unsigned short int, class, 128);
-const __uint32_t *__ctype32_old_b = b (__uint32_t, class32, 0);
-const __int32_t *__ctype_old_tolower = b (__int32_t, tolower, 128);
-const __int32_t *__ctype_old_toupper = b (__int32_t, toupper, 128);
-const __uint32_t *__ctype32_old_tolower = b (__uint32_t, tolower, 128);
-const __uint32_t *__ctype32_old_toupper = b (__uint32_t, toupper, 128);
+const unsigned short int *__ctype_b = b (unsigned short int, class, 128);
+const __uint32_t *__ctype32_b = b (__uint32_t, class32, 0);
+const __int32_t *__ctype_tolower = b (__int32_t, tolower, 128);
+const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128);
+const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128);
+const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128);
 
-compat_symbol (libc, __ctype_old_b, __ctype_b, GLIBC_2_0);
-compat_symbol (libc, __ctype_old_tolower, __ctype_tolower, GLIBC_2_0);
-compat_symbol (libc, __ctype_old_toupper, __ctype_toupper, GLIBC_2_0);
-compat_symbol (libc, __ctype32_old_b, __ctype32_b, GLIBC_2_0);
-compat_symbol (libc, __ctype32_old_tolower, __ctype32_tolower, GLIBC_2_2);
-compat_symbol (libc, __ctype32_old_toupper, __ctype32_toupper, GLIBC_2_2);
+compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
+compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
+compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
+compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0);
+compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2);
+compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2);
 
 #endif
diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c
index 3011f4e697..ad815dfcbf 100644
--- a/locale/lc-ctype.c
+++ b/locale/lc-ctype.c
@@ -54,19 +54,22 @@ _nl_postload_ctype (void)
 
 #include <shlib-compat.h>
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
-  extern __const unsigned short int *__ctype_old_b; /* Characteristics.  */
-  extern __const __int32_t *__ctype_old_tolower; /* Case conversions.  */
-  extern __const __int32_t *__ctype_old_toupper; /* Case conversions.  */
+  /* We must use the exported names to access these so we are sure to
+     be accessing the main executable's copy if it has COPY relocs.  */
 
-  extern const uint32_t *__ctype32_old_b;
-  extern const uint32_t *__ctype32_old_toupper;
-  extern const uint32_t *__ctype32_old_tolower;
+  extern __const unsigned short int *__ctype_b; /* Characteristics.  */
+  extern __const __int32_t *__ctype_tolower; /* Case conversions.  */
+  extern __const __int32_t *__ctype_toupper; /* Case conversions.  */
 
-  __ctype_old_b = current (uint16_t, CLASS, 128);
-  __ctype_old_toupper = current (uint32_t, TOUPPER, 128);
-  __ctype_old_tolower = current (uint32_t, TOLOWER, 128);
-  __ctype32_old_b = current (uint32_t, CLASS32, 0);
-  __ctype32_old_toupper = current (uint32_t, TOUPPER32, 0);
-  __ctype32_old_tolower = current (uint32_t, TOLOWER32, 0);
+  extern const uint32_t *__ctype32_b;
+  extern const uint32_t *__ctype32_toupper;
+  extern const uint32_t *__ctype32_tolower;
+
+  __ctype_b = current (uint16_t, CLASS, 128);
+  __ctype_toupper = current (uint32_t, TOUPPER, 128);
+  __ctype_tolower = current (uint32_t, TOLOWER, 128);
+  __ctype32_b = current (uint32_t, CLASS32, 0);
+  __ctype32_toupper = current (uint32_t, TOUPPER32, 0);
+  __ctype32_tolower = current (uint32_t, TOLOWER32, 0);
 #endif
 }
diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
index b2ee83459b..bf23d25cac 100644
--- a/wcsmbs/wcsmbsload.c
+++ b/wcsmbs/wcsmbsload.c
@@ -166,12 +166,7 @@ __wcsmbs_load_conv (struct locale_data *new_category)
       /* Allocate the gconv_fcts structure.  */
       new_fcts = malloc (sizeof *new_fcts);
       if (new_fcts == NULL)
-	{
-	failed:
-	  new_category->private.ctype = &__wcsmbs_gconv_fcts_c;
-	  __libc_lock_unlock (__libc_setlocale_lock);
-	  return;
-	}
+	goto failed;
 
       /* Get name of charset of the locale.  */
       charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string;
@@ -203,11 +198,15 @@ __wcsmbs_load_conv (struct locale_data *new_category)
 	    __gconv_close_transform (new_fcts->towc, new_fcts->towc_nsteps);
 
 	  free (new_fcts);
-	  goto failed;
-	}
 
-      new_category->private.ctype = new_fcts;
-      new_category->private.cleanup = &_nl_cleanup_ctype;
+	failed:
+	  new_category->private.ctype = &__wcsmbs_gconv_fcts_c;
+	}
+      else
+	{
+	  new_category->private.ctype = new_fcts;
+	  new_category->private.cleanup = &_nl_cleanup_ctype;
+	}
     }
 
   __libc_lock_unlock (__libc_setlocale_lock);