From: Arsen Arsenović Date: Fri, 28 Oct 2022 20:44:47 +0000 (+0200) Subject: readelf: add binutils-style --syms option X-Git-Tag: elfutils-0.188~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1dae823985b7336e58a568c00cc5c20c840db9e0;p=thirdparty%2Felfutils.git readelf: add binutils-style --syms option This helps people with a lot of built up muscle memory :) Signed-off-by: Arsen Arsenović --- diff --git a/doc/ChangeLog b/doc/ChangeLog index 073023b4b..269ed06e5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2022-10-28 Arsen Arsenović + + * readelf.1: Document the --syms alias. + 2022-10-18 Daniel Thornburgh * debuginfod_find_debuginfo.3: Document DEBUGINFOD_HEADERS_FILE. diff --git a/doc/readelf.1 b/doc/readelf.1 index 6a843f660..1d182071d 100644 --- a/doc/readelf.1 +++ b/doc/readelf.1 @@ -146,7 +146,7 @@ eu-readelf [\fB\-a\fR|\fB\-\-all\fR] [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR] [\fB\-g\fR|\fB\-\-section\-groups\fR] [\fB\-e\fR|\fB\-\-exception\fR] - [\fB\-s\fR|\fB\-\-symbols\fR] [section name] ] + [\fB\-\-syms\fR|\fB\-s\fR|\fB\-\-symbols\fR [section name] ] [\fB\-\-dyn-syms\fR] [\fB\-n\fR|\fB\-\-notes\fR [section name] ] [\fB\-r\fR|\fB\-\-relocs\fR] @@ -255,6 +255,9 @@ of the symbol tables. .IP "\fB\-s\fR" 4 .IX Item "-s" .PD 0 +.IP "\fB\--syms\fR" 4 +.IX Item "--syms" +.PD 0 .IP "\fB\-\-symbols\fR [section name]" 4 .IX Item "--symbols" .PD diff --git a/src/ChangeLog b/src/ChangeLog index 1f369ef62..d3399a5ca 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2022-10-28 Arsen Arsenović + + * readelf.c (options): Add Binutils-style --syms alias. + 2022-10-19 Mark Wielaard * readelf.c (dwarf_loc_list_encoding_string): Handle diff --git a/src/readelf.c b/src/readelf.c index 7671a31df..0e0b05c44 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -115,6 +115,7 @@ static const struct argp_option options[] = { "sections", 'S', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 }, { "symbols", 's', "SECTION", OPTION_ARG_OPTIONAL, N_("Display the symbol table sections"), 0 }, + { "syms", 's', NULL, OPTION_ALIAS | OPTION_HIDDEN, NULL, 0 }, { "dyn-syms", PRINT_DYNSYM_TABLE, NULL, 0, N_("Display (only) the dynamic symbol table"), 0 }, { "version-info", 'V', NULL, 0, N_("Display versioning information"), 0 }, diff --git a/tests/ChangeLog b/tests/ChangeLog index be90832a7..949dab8af 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2022-10-28 Arsen Arsenović + + * run-readelf-s.sh: Add tests for the --syms alias. + 2022-10-27 Mark Wielaard * backtrace-subr.sh: Use grep -E instead of egrep, use grep -F diff --git a/tests/run-readelf-s.sh b/tests/run-readelf-s.sh index 527c436c2..ee1c0e827 100755 --- a/tests/run-readelf-s.sh +++ b/tests/run-readelf-s.sh @@ -277,10 +277,16 @@ EOF cat testfile.dynsym.in testfile.symtab.in \ | testrun_compare ${abs_top_builddir}/src/readelf -s testfilebaztab +cat testfile.dynsym.in testfile.symtab.in \ + | testrun_compare ${abs_top_builddir}/src/readelf --syms testfilebaztab + # Display just .dynsym cat testfile.dynsym.in \ | testrun_compare ${abs_top_builddir}/src/readelf \ --symbols=.dynsym testfilebaztab +cat testfile.dynsym.in \ + | testrun_compare ${abs_top_builddir}/src/readelf \ + --syms=.dynsym testfilebaztab cat testfile.dynsym.in \ | testrun_compare ${abs_top_builddir}/src/readelf \ --dyn-syms testfilebaztab