* ldmisc.c (demangle): Put back dots when string not demangled.
authorAlan Modra <amodra@gmail.com>
Fri, 25 Jan 2002 12:22:42 +0000 (12:22 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 25 Jan 2002 12:22:42 +0000 (12:22 +0000)
ld/ChangeLog
ld/ldmisc.c

index d1352ee9736a76787a6432bfba6e789c8c647439..12f639e582862bb87dc8a818c99fa25dd096ab1c 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-25  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldmisc.c (demangle): Put back dots when string not demangled.
+
 2002-01-22  Richard Henderson  <rth@redhat.com>
 
        * emulparams/elf64alpha.sh (NOP): Use unop.
index 25b7857a998c82057fcbf430f52e3f69f8f92b94..42adceeac3eecfa5eafae5f3ddaf18e90a7a4507 100644 (file)
@@ -1,5 +1,6 @@
 /* ldmisc.c
-   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support.
 
@@ -69,18 +70,20 @@ demangle (string)
      const char *string;
 {
   char *res;
+  const char *p;
 
   if (output_bfd != NULL
       && bfd_get_symbol_leading_char (output_bfd) == string[0])
     ++string;
 
-  /* This is a hack for better error reporting on XCOFF, or the MS PE
-     format.  Xcoff has a single '.', while the NT PE for PPC has
-     '..'.  So we remove all of them.  */
-  while (string[0] == '.')
-    ++string;
+  /* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
+     or the MS PE format.  These formats have a number of leading '.'s
+     on at least some symbols, so we remove all dots.  */
+  p = string;
+  while (*p == '.')
+    ++p;
 
-  res = cplus_demangle (string, DMGL_ANSI | DMGL_PARAMS);
+  res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS);
   return res ? res : xstrdup (string);
 }
 
This page took 0.040756 seconds and 4 git commands to generate.