From: Alan Modra Date: Sat, 28 Apr 2007 06:04:28 +0000 (+0000) Subject: * ldcref.c (struct cref_hash_entry): Make "demangled" const. X-Git-Tag: binutils-2_18-branchpoint~916 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7d4c8debeaced278c18126aa602c1ce62827f05;p=platform%2Fupstream%2Fbinutils.git * ldcref.c (struct cref_hash_entry): Make "demangled" const. (cref_fill_array): Adjust for changed demangler. * ldlang.c (lang_one_common): Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 893debd..f24102c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2007-04-28 Alan Modra + + * ldcref.c (struct cref_hash_entry): Make "demangled" const. + (cref_fill_array): Adjust for changed demangler. + * ldlang.c (lang_one_common): Likewise. + 2007-04-27 Nathan Froyd * emulparams/elf32_sparc.sh: Update comments. diff --git a/ld/ldcref.c b/ld/ldcref.c index 3966bbc..4fa29de 100644 --- a/ld/ldcref.c +++ b/ld/ldcref.c @@ -57,7 +57,7 @@ struct cref_ref { struct cref_hash_entry { struct bfd_hash_entry root; /* The demangled name. */ - char *demangled; + const char *demangled; /* References to and definitions of this symbol. */ struct cref_ref *refs; }; @@ -327,6 +327,8 @@ cref_fill_array (struct cref_hash_entry *h, void *data) ASSERT (h->demangled == NULL); h->demangled = bfd_demangle (output_bfd, h->root.string, DMGL_ANSI | DMGL_PARAMS); + if (h->demangled == NULL) + h->demangled = h->root.string; **pph = h; diff --git a/ld/ldlang.c b/ld/ldlang.c index 92cb77d..116f2e5 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -5269,9 +5269,17 @@ lang_one_common (struct bfd_link_hash_entry *h, void *info) name = bfd_demangle (output_bfd, h->root.string, DMGL_ANSI | DMGL_PARAMS); - minfo ("%s", name); - len = strlen (name); - free (name); + if (name == NULL) + { + minfo ("%s", h->root.string); + len = strlen (h->root.string); + } + else + { + minfo ("%s", name); + len = strlen (name); + free (name); + } if (len >= 19) {