* configure.in: Check for strcoll.
authorAlan Modra <amodra@gmail.com>
Fri, 21 Jun 2002 02:34:38 +0000 (02:34 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 21 Jun 2002 02:34:38 +0000 (02:34 +0000)
* configure: Regenerate.
* config.in: Regenerate.
* nm.c (main): Set locale for LC_COLLATE category.
(non_numeric_forward): Use strcoll if available.

binutils/ChangeLog
binutils/config.in
binutils/configure
binutils/configure.in
binutils/nm.c

index f606846879f4740af574f5d50c2ddf7a1ee70a2e..920a9a024c4d930779ec7569af46864834bd9895 100644 (file)
@@ -1,3 +1,11 @@
+2002-06-21  Mitsru Chinen  <chinen@jp.ibm.com>
+
+       * configure.in: Check for strcoll.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * nm.c (main): Set locale for LC_COLLATE category.
+       (non_numeric_forward): Use strcoll if available.
+
 2002-06-20  Dave Brolley  <brolley@redhat.com>
 
        * MAINTAINERS: Add self as fr30 and frv maintainer.
index 02ec0a7d2736876e255d0f922c5d391b39239561..d4047628d588dacf3e62cd875fba251eee794430 100644 (file)
@@ -97,6 +97,9 @@
 /* Define if you have the strchr function.  */
 #undef HAVE_STRCHR
 
+/* Define if you have the strcoll function.  */
+#undef HAVE_STRCOLL
+
 /* Define if you have the utimes function.  */
 #undef HAVE_UTIMES
 
index ea51d7fbc429feecf03aac6bb8568de424d29701..fc59b1d653a57e16c01a9aa7bf604419b7d2006b 100755 (executable)
@@ -4902,7 +4902,7 @@ EOF
 
 fi
 
-for ac_func in sbrk utimes setmode getc_unlocked
+for ac_func in sbrk utimes setmode getc_unlocked strcoll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:4909: checking for $ac_func" >&5
index 8c6ecb83f3a9ea39f1c8af18263b15ef71921789..63631411e1faad4c07e93d81ca19e27c48aa8565 100644 (file)
@@ -100,7 +100,7 @@ AC_SUBST(DEMANGLER_NAME)
 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
 AC_HEADER_SYS_WAIT
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked)
+AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
 
 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
 # needs to be defined for it
index 79658fe48d159ef9fb4a060f02df6dfecc274745..306f2c60e3e352acc9f23e346943e957aa44ded6 100644 (file)
@@ -51,7 +51,7 @@ struct get_relocs_info
   asymbol **syms;
 };
 
-struct extended_symbol_info 
+struct extended_symbol_info
 {
   symbol_info *sinfo;
   bfd_vma ssize;
@@ -355,6 +355,7 @@ main (argc, argv)
 #endif
 #if defined (HAVE_SETLOCALE)
   setlocale (LC_CTYPE, "");
+  setlocale (LC_COLLATE, "");
 #endif
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -705,8 +706,23 @@ non_numeric_forward (P_x, P_y)
   xn = bfd_asymbol_name (x);
   yn = bfd_asymbol_name (y);
 
-  return ((xn == NULL) ? ((yn == NULL) ? 0 : -1) :
-         ((yn == NULL) ? 1 : strcmp (xn, yn)));
+  if (yn == NULL)
+    return xn != NULL;
+  if (xn == NULL)
+    return -1;
+
+#ifdef HAVE_STRCOLL
+  /* Solaris 2.5 has a bug in strcoll.
+     strcoll returns invalid values when confronted with empty strings.  */
+  if (*yn == '\0')
+    return *xn != '\0';
+  if (*xn == '\0')
+    return -1;
+
+  return strcoll (xn, yn);
+#else
+  return strcmp (xn, yn);
+#endif
 }
 
 static int
@@ -886,7 +902,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp)
 
       sec = bfd_get_section (sym);
 
-      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) 
+      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
        sz = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
       else if (bfd_is_com_section (sec))
        sz = sym->value;
@@ -1186,7 +1202,7 @@ print_symbol (abfd, sym, ssize, archive_bfd)
       bfd_get_symbol_info (abfd, sym, &syminfo);
       info.sinfo = &syminfo;
       info.ssize = ssize;
-      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) 
+      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
        info.elfinfo = (elf_symbol_type *) sym;
       else
        info.elfinfo = NULL;
@@ -1545,7 +1561,7 @@ print_symbol_info_sysv (info, abfd)
       printf ("|     |");                              /* Line, Section */
     }
   else
-    {  
+    {
       /* Type, Size, Line, Section */
       if (info->elfinfo)
        printf ("%18s|",
This page took 0.02938 seconds and 4 git commands to generate.