This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: nm -C no longer strips leading underscores?
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: binutils at sourceware dot org
- Cc: "binutils:nm-Cdoesn'tdemangle"@ednor.casa.cgf.cx
- Date: Tue, 8 Jul 2008 18:14:12 -0400
- Subject: Re: nm -C no longer strips leading underscores?
- References: <20080625031840.GA22222@ednor.casa.cgf.cx> <20080707114712.GD3535@bubble.grove.modra.org>
On Mon, Jul 07, 2008 at 09:17:12PM +0930, Alan Modra wrote:
>On Tue, Jun 24, 2008 at 11:18:40PM -0400, Christopher Faylor wrote:
>> A Cygwin user has noticed that "nm -C" no longer removes the leading
>> underscore from symbols despite documentation to the contrary.
>>
>> That behavior seems to have been caused by the introduction of the
>> bfd_demangle function which returns NULL when a symbol is not translated
>> by cplus_demangle rather than returning the symbol without the leading
>> underscore.
>>
>> I think this is a bug
>[snip]
>
>Agreed. If the name is demangled we remove bfd_symbol_leading_char,
>so I think bfd_demangle ought to always remove it.
>
> * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
That does seem to solve the problem. Sorry for not submitting a patch
myself. I wasn't sure if changing bfd_demangle would have a deletorious
effect on things besides "nm".
Thanks for the fix.
cgf