From 79bc120c7be00596098c09cecd25383ae6ddce34 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 12 Aug 2020 13:31:59 +0100 Subject: [PATCH] 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. --- binutils/ChangeLog | 17 +++ binutils/NEWS | 4 + binutils/doc/binutils.texi | 30 ++++ binutils/readelf.c | 132 +++++++++++++----- binutils/testsuite/binutils-all/mangled.s | 6 + .../testsuite/binutils-all/readelf.demangled | 5 + binutils/testsuite/binutils-all/readelf.exp | 16 +++ 7 files changed, 172 insertions(+), 38 deletions(-) create mode 100644 binutils/testsuite/binutils-all/mangled.s create mode 100644 binutils/testsuite/binutils-all/readelf.demangled diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 4d2ac2b63e3..162159f5cf8 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,20 @@ +2020-08-12 Nick Clifton + + 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. + 2020-08-12 Nick Clifton * po/sr.po: Updated Serbian translation. diff --git a/binutils/NEWS b/binutils/NEWS index e776f5a8267..c0dc73d7d8f 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,9 @@ -*- text -*- +* Readelf now accepts the -C command line option to enable the demangling of + symbol names. In addition the --demangle=