* configure: Regenerate.
* config.in: Regenerate.
* nm.c (main): Set locale for LC_COLLATE category.
(non_numeric_forward): Use strcoll if available.
+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.
2002-06-20 Dave Brolley <brolley@redhat.com>
* MAINTAINERS: Add self as fr30 and frv maintainer.
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* 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
/* Define if you have the utimes function. */
#undef HAVE_UTIMES
-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
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4909: checking for $ac_func" >&5
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_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
# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
# needs to be defined for it
-struct extended_symbol_info
+struct extended_symbol_info
{
symbol_info *sinfo;
bfd_vma ssize;
{
symbol_info *sinfo;
bfd_vma ssize;
#endif
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
#endif
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
+ setlocale (LC_COLLATE, "");
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
xn = bfd_asymbol_name (x);
yn = bfd_asymbol_name (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
sec = bfd_get_section (sym);
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;
sz = ((elf_symbol_type *) sym)->internal_elf_sym.st_size;
else if (bfd_is_com_section (sec))
sz = sym->value;
bfd_get_symbol_info (abfd, sym, &syminfo);
info.sinfo = &syminfo;
info.ssize = ssize;
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;
info.elfinfo = (elf_symbol_type *) sym;
else
info.elfinfo = NULL;
printf ("| |"); /* Line, Section */
}
else
printf ("| |"); /* Line, Section */
}
else
/* Type, Size, Line, Section */
if (info->elfinfo)
printf ("%18s|",
/* Type, Size, Line, Section */
if (info->elfinfo)
printf ("%18s|",