diff options
author | Martin Liska <mliska@suse.cz> | 2022-11-25 14:27:19 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-11-28 10:56:27 +0100 |
commit | 2e42dc4328a8944263711ae23b1a34f7f47cb37c (patch) | |
tree | ed98c8870c917236d323f488fbcdea047e11ad65 /tests | |
parent | 274f2376c458ba62534740d1a29e841e930aeda7 (diff) | |
download | elfutils-2e42dc4328a8944263711ae23b1a34f7f47cb37c.tar.gz |
readelf: print warning for -sW
The option -s accepts in elfutils (compared to binutils) a positional
argument that is name of a symbol table section which should be printed.
Thus, print a reasonable warning if -sW is used:
./src/readelf -sW a.out
WARNING: cannot find section: 'W'
PR29719
src/ChangeLog:
* readelf.c (print_symtab): Change signature and return true if
something is printed.
(process_elf_file): Use it and print warning.
tests/ChangeLog:
* run-readelf-s.sh: Test -sW.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run-readelf-s.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/run-readelf-s.sh b/tests/run-readelf-s.sh index ee1c0e82..6b218f10 100755 --- a/tests/run-readelf-s.sh +++ b/tests/run-readelf-s.sh @@ -395,4 +395,7 @@ Symbol table [27] '.symtab' contains 42 entries: 41: 00000000004003a8 0 FUNC GLOBAL DEFAULT 11 _init EOF +testrun ${abs_top_builddir}/src/readelf --elf-section -sW testfilebaxmin 2>&1 \ + | grep "WARNING: cannot find section: 'W'" >/dev/null || exit 2 + exit 0 |