Add option to nm to change the characters displayed for ifunc symbols. Add a configure time option to change the default characters.

PR 22967
	* nm.c (ifunc_type_chars): New variable.
	(long_options): Add --ifunc-chars.
	(print_symbol): Use ifunc_type_chars for ifunc symbols.
	(main): Handle the new option.
	* doc/binutils.texi: Document the new option.
	* configure.ac: Add --enable-f-for-ifunc-symbols option which
	changes the default symbol displayed by nm.
	* NEWS: Mention the new feature.
	* testsuite/binutils-all/nm.exp: Test the new feature.
	* config.in: Regenerate.
	* configure: Regenerate.
This commit is contained in:
Nick Clifton
2020-11-20 13:04:56 +00:00
parent 8881640c80
commit e6f6aa8d18
8 changed files with 172 additions and 16 deletions

View File

@@ -797,6 +797,7 @@ nm [@option{-A}|@option{-o}|@option{--print-file-name}] [@option{-a}|@option{--d
[@option{-B}|@option{--format=bsd}] [@option{-C}|@option{--demangle}[=@var{style}]]
[@option{-D}|@option{--dynamic}] [@option{-f}@var{format}|@option{--format=}@var{format}]
[@option{-g}|@option{--extern-only}] [@option{-h}|@option{--help}]
[@option{--ifunc-chars=@var{CHARS}}]
[@option{-l}|@option{--line-numbers}] [@option{--inlines}]
[@option{-n}|@option{-v}|@option{--numeric-sort}]
[@option{-P}|@option{--portability}] [@option{-p}|@option{--no-sort}]
@@ -869,12 +870,21 @@ such as a global int variable as opposed to a large global array.
@item i
For PE format files this indicates that the symbol is in a section
specific to the implementation of DLLs. For ELF format files this
indicates that the symbol is an indirect function. This is a GNU
extension to the standard set of ELF symbol types. It indicates a
symbol which if referenced by a relocation does not evaluate to its
address, but instead must be invoked at runtime. The runtime
execution will then return the value to be used in the relocation.
specific to the implementation of DLLs.
For ELF format files this indicates that the symbol is an indirect
function. This is a GNU extension to the standard set of ELF symbol
types. It indicates a symbol which if referenced by a relocation does
not evaluate to its address, but instead must be invoked at runtime.
The runtime execution will then return the value to be used in the
relocation.
Note - the actual symbols display for GNU indirect symbols is
controlled by the @option{--ifunc-chars} command line option. If this
option has been provided then the first character in the string will
be used for global indirect function symbols. If the string contains
a second character then that will be used for local indirect function
symbols.
@item I
The symbol is an indirect reference to another symbol.
@@ -1029,6 +1039,15 @@ Display only external symbols.
@itemx --help
Show a summary of the options to @command{nm} and exit.
@item --ifunc-chars=@var{CHARS}
When display GNU indirect function symbols @command{nm} will default
to using the @code{i} character for both local indirect functions and
global indirect functions. The @option{--ifunc-chars} option allows
the user to specify a string containing one or two characters. The
first character will be used for global indirect function symbols and
the second character, if present, will be used for local indirect
function symbols.
@item -l
@itemx --line-numbers
@cindex symbol line numbers