package binutils tags 274544 + patch thanksI have found what looks like a solution to this problem. Please see attached patch. The error is actually quite obvious when spotted; the function bfd_demangle, according to its documentation, is perfectly able to return NULL.
I think it might be a good idea to send the bug upstream; I am a little concerned that this might not be the best solution, mainly because this solution would not work in the 2.16.1cvs20060413-1 version, where a different variant of this problem occurred.
But the fix does seem to solve both the original problem (garbage output) and the new variant of the problem (segmentation fault).
best regards -- Peder Chr. Nørgaard Senior System Developer, M. Sc. Ericsson Denmark A/S, Telebit Division Skanderborgvej 232 tel: +45 30 91 84 31 DK-8260 Viby J, Denmark fax: +45 89 38 51 01 e-mail: [EMAIL PROTECTED] (old e-mail 2000-2003: [EMAIL PROTECTED]) (old e-mail 1992-2000: [EMAIL PROTECTED]) ---------------------------------------------------------------- This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.
--- binutils-2.17cvs20070426.orig/ld/ldcref.c +++ binutils-2.17cvs20070426/ld/ldcref.c @@ -327,7 +327,10 @@ ASSERT (h->demangled == NULL); h->demangled = bfd_demangle (output_bfd, h->root.string, DMGL_ANSI | DMGL_PARAMS); - + if (h->demangled == NULL) + { + h->demangled = xstrdup (h->root.string); + } **pph = h; ++*pph;