From df2c87b5803750d21f03b7d36f8d1abace3e1e14 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 Nov 2016 11:49:45 +0000 Subject: Add the ability for nm to display symbol version information. PR binutils/20751 * nm.c (with_symbol_versions): New local variable. (long_options): Add --with-symbol-versions. (usage): Mention --with-symbol-versions. (print_symbol): If with_symbol_versions is set then display the version information associated with the symbol. * NEWS: Mention the new feature. * doc/binutils.texi (nm): Document the new option. (objdump): Describe how symbol version information is displayed for dynamic symbol dumps. (readelf): Describe how symbol version information is displayed. * testsuite/binutils-all/nm.exp: Add a test of the new feature. --- binutils/doc/binutils.texi | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'binutils/doc') diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 5174625a51..6db3b6d413 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -743,7 +743,7 @@ nm [@option{-A}|@option{-o}|@option{--print-file-name}] [@option{-a}|@option{--d [@option{-u}|@option{--undefined-only}] [@option{-V}|@option{--version}] [@option{-X 32_64}] [@option{--defined-only}] [@option{--no-demangle}] [@option{--plugin} @var{name}] [@option{--size-sort}] [@option{--special-syms}] - [@option{--synthetic}] [@option{--target=}@var{bfdname}] + [@option{--synthetic}] [@option{--with-symbol-versions}] [@option{--target=}@var{bfdname}] [@var{objfile}@dots{}] @c man end @end smallexample @@ -1031,6 +1031,14 @@ Include synthetic symbols in the output. These are special symbols created by the linker for various purposes. They are not shown by default since they are not part of the binary's original source code. +@item --with-symbol-versions +Enables the display of symbol version information if any exists. The +version string is displayed as a suffix to the symbol name, preceeded by +an @@ character. For example @samp{foo@@VER_1}. If the version is +the default version to be used when resolving unversioned references +to the symbol then it is displayed as a suffix preceeded by two @@ +characters. For example @samp{foo@@@@VER_2}. + @item --target=@var{bfdname} @cindex object code format Specify an object code format other than your system's default format. @@ -2618,6 +2626,10 @@ meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the @samp{nm} program when given the @option{-D} (@option{--dynamic}) option. +The output format is similar to that produced by the @option{--syms} +option, except that an extra field is inserted before the symbol's +name, giving the version information associated with the symbol. + @item --special-syms When displaying symbols include those which the target considers to be special in some way and which would not normally be of interest to the @@ -4591,11 +4603,19 @@ Displays the detailed section information. Implies @option{-S}. @itemx --syms @cindex ELF symbol table information Displays the entries in symbol table section of the file, if it has one. +If a symbol has version information associated with it then this is +displayed as well. The version string is displayed as a suffix to the +symbol name, preceeded by an @@ character. For example +@samp{foo@@VER_1}. If the version is the default version to be used +when resolving unversioned references to the symbol then it is +displayed as a suffix preceeded by two @@ characters. For example +@samp{foo@@@@VER_2}. @item --dyn-syms @cindex ELF dynamic symbol table information Displays the entries in dynamic symbol table section of the file, if it -has one. +has one. The output format is the same as the format used by the +@option{--syms} option. @item -e @itemx --headers -- cgit v1.2.3