about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/lc-ctype.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c
index ad815dfcbf..eb108416d2 100644
--- a/locale/lc-ctype.c
+++ b/locale/lc-ctype.c
@@ -27,6 +27,8 @@ _NL_CURRENT_DEFINE (LC_CTYPE);
 /* We are called after loading LC_CTYPE data to load it into
    the variables used by the ctype.h macros.  */
 
+
+
 void
 _nl_postload_ctype (void)
 {
@@ -65,6 +67,21 @@ _nl_postload_ctype (void)
   extern const uint32_t *__ctype32_toupper;
   extern const uint32_t *__ctype32_tolower;
 
+  /* We need the .symver declarations these macros generate so that
+     our references are explicitly bound to the versioned symbol names
+     rather than the unadorned names that are not exported.  When the
+     linker sees these bound to local symbols (as the unexported names are)
+     then it doesn't generate a proper relocation to the global symbols.
+     We need those relocations so that a versioned definition with a COPY
+     reloc in an executable will override the libc.so definition.  */
+
+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);
+
   __ctype_b = current (uint16_t, CLASS, 128);
   __ctype_toupper = current (uint32_t, TOUPPER, 128);
   __ctype_tolower = current (uint32_t, TOLOWER, 128);