Bug 26331

Summary: readelf: Add -C/--demangle option (like nm & objdump)
Product: binutils Reporter: Fangrui Song <maskray>
Component: binutilsAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: nickc
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:

Description Fangrui Song 2020-08-02 22:02:32 UTC
We can't use bfd_demangle (which requires libbfd.a) but can just use cplus_demangle (no BFD dependency).
Comment 1 Sourceware Commits 2020-08-12 12:32:23 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=79bc120c7be00596098c09cecd25383ae6ddce34

commit 79bc120c7be00596098c09cecd25383ae6ddce34
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Aug 12 13:31:59 2020 +0100

    Add demangling support to readelf.
    
            PR binutils/26331
            * readelf.c (do_demangle): New option flag.
            (print_symbol): If do_demangle is enabled, demangle the symbol.
            (enum long_option_values): New enum to hold long option values.
            (options): Add demangle, no-demangle, recursion-limit and
            no-recursion-limit options.  Alpha sort the table.
            (usage): Describe the new options.
            (parse_args): Handle the new options.
            * NEWS: Mention the new feature.
            * doc/binutils.texi: Document the new feature.
            * testsuite/binutils-all/readelf.exp: Test the new feature.
            * testsuite/binutils-all/mangled.s: New file - assembler source.
            * testsuite/binutils-all/readelf.demangled: New file - expected
            output from readelf.
Comment 2 Nick Clifton 2020-08-12 12:33:07 UTC
Your wish is my command.