diff options
author | Alan Modra <amodra@gmail.com> | 2002-01-25 12:22:42 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-01-25 12:22:42 +0000 |
commit | 6d39955ebe7b9029474cfa994b74ea86409e9456 (patch) | |
tree | 611da551a47280e4e28a73f3a9aa6dc225d303c3 /ld | |
parent | cc9ff76a522c9e798c72ec034ab0779b9e941fc0 (diff) | |
download | gdb-6d39955ebe7b9029474cfa994b74ea86409e9456.zip gdb-6d39955ebe7b9029474cfa994b74ea86409e9456.tar.gz gdb-6d39955ebe7b9029474cfa994b74ea86409e9456.tar.bz2 |
* ldmisc.c (demangle): Put back dots when string not demangled.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/ldmisc.c | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index d1352ee..12f639e 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -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. diff --git a/ld/ldmisc.c b/ld/ldmisc.c index 25b7857..42adcee 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -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); } |