Change readelf's display of symbol names (when not in --wide mode) so that if they are going to be truncated then "[...]" is displayed at the end. Add a comment line option to disable this enhancement and restore the old behaviour.

PR 26028
binutils* readelf.c (print_symbol): Handle truncation of symbol names.
	(options): Add -T/--silent-truncation option.
	(parse_args): Handle the option.
	(print_dynamic_symbol): Correct calculation of width available to
	display symbol name.
	* doc/binutils.texi: Document the -T option to readelf.
	* NEWS: Mention the new feature.

gas	* testsuite/gas/ia64/group-2.d: Add -T option to readelf
	command line.
	* testsuite/gas/ia64/unwind.d: Likewise.
	* testsuite/gas/mmix/bspec-1.d: Likewise.
	* testsuite/gas/mmix/bspec-2.d: Likewise.
	* testsuite/gas/mmix/comment-1.d: Likewise.
	* testsuite/gas/tic6x/scomm-directive-4.d: Likewise.

ld	* testsuite/ld-powerpc/powerpc.exp: Add -T option to readelf
	command line when running some tests.
	* testsuite/ld-arm/arm-elf.exp: Likewise.
	* testsuite/ld-mips-elf/mips-elf.exp: Likewise.
	* testsuite/ld-mmix/local1.d: Likewise.
	* testsuite/ld-mmix/local3.d: Likewise.
	* testsuite/ld-mmix/local5.d: Likewise.
	* testsuite/ld-mmix/local7.d: Likewise.
	* testsuite/ld-powerpc/powerpc.exp: Likewise.
This commit is contained in:
Nick Clifton 2020-07-02 11:30:52 +01:00
parent 1cdf9e33ea
commit 0942c7ab94
19 changed files with 116 additions and 25 deletions

View file

@ -4726,6 +4726,7 @@ readelf [@option{-a}|@option{--all}]
[@option{-I}|@option{--histogram}]
[@option{-v}|@option{--version}]
[@option{-W}|@option{--wide}]
[@option{-T}|@option{--silent-truncation}]
[@option{-H}|@option{--help}]
@var{elffile}@dots{}
@c man end
@ -4939,6 +4940,15 @@ Don't break output lines to fit into 80 columns. By default
@command{readelf} to print each section header resp. each segment one a
single line, which is far more readable on terminals wider than 80 columns.
@item -T
@itemx --silent-truncation
Normally when readelf is displaying a symbol name, and it has to
truncate the name to fit into an 80 column display, it will add a
suffix of @code{[...]} to the name. This command line option
disables this behaviour, allowing 5 more characters of the name to be
displayed and restoring the old behaviour of readelf (prior to release
2.35).
@item -H
@itemx --help
Display the command-line options understood by @command{readelf}.