diff options
author | Nick Clifton <nickc@redhat.com> | 2020-08-12 13:31:59 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-08-12 13:31:59 +0100 |
commit | 79bc120c7be00596098c09cecd25383ae6ddce34 (patch) | |
tree | 52603d55375f972945e4e25f611f7bd89f637a1e /binutils/doc | |
parent | 79ddc88496c3c18eac94b7776dc75b05c33abf25 (diff) | |
download | fsf-binutils-gdb-79bc120c7be00596098c09cecd25383ae6ddce34.zip fsf-binutils-gdb-79bc120c7be00596098c09cecd25383ae6ddce34.tar.gz fsf-binutils-gdb-79bc120c7be00596098c09cecd25383ae6ddce34.tar.bz2 |
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.
Diffstat (limited to 'binutils/doc')
-rw-r--r-- | binutils/doc/binutils.texi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 0822b5c..968da2c 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -4694,6 +4694,8 @@ readelf [@option{-a}|@option{--all}] [@option{-e}|@option{--headers}] [@option{-s}|@option{--syms}|@option{--symbols}] [@option{--dyn-syms}] + [@option{--demangle@var{=style}}|@option{--no-demangle}] + [@option{--recurse-limit}|@option{--no-recurse-limit}] [@option{-n}|@option{--notes}] [@option{-r}|@option{--relocs}] [@option{-u}|@option{--unwind}] @@ -4809,6 +4811,34 @@ Displays the entries in dynamic symbol table section of the file, if it has one. The output format is the same as the format used by the @option{--syms} option. +@item -C +@itemx --demangle[=@var{style}] +@cindex demangling in nm +Decode (@dfn{demangle}) low-level symbol names into user-level names. +This makes C++ function names readable. Different compilers have +different mangling styles. The optional demangling style argument can +be used to choose an appropriate demangling style for your +compiler. @xref{c++filt}, for more information on demangling. + +@item --no-demangle +Do not demangle low-level symbol names. This is the default. + +@item --recurse-limit +@itemx --no-recurse-limit +@itemx --recursion-limit +@itemx --no-recursion-limit +Enables or disables a limit on the amount of recursion performed +whilst demangling strings. Since the name mangling formats allow for +an inifinite level of recursion it is possible to create strings whose +decoding will exhaust the amount of stack space available on the host +machine, triggering a memory fault. The limit tries to prevent this +from happening by restricting recursion to 2048 levels of nesting. + +The default is for this limit to be enabled, but disabling it may be +necessary in order to demangle truly complicated names. Note however +that if the recursion limit is disabled then stack exhaustion is +possible and any bug reports about such an event will be rejected. + @item -e @itemx --headers Display all the headers in the file. Equivalent to @option{-h -l -S}. |