Bug 26331 - readelf: Add -C/--demangle option (like nm & objdump)
Summary: readelf: Add -C/--demangle option (like nm & objdump)
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-02 22:02 UTC by Fangrui Song
Modified: 2020-08-12 12:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 cvs-commit@gcc.gnu.org 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.