]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: add binutils-style --syms option
authorArsen Arsenović <arsen@aarsen.me>
Fri, 28 Oct 2022 20:44:47 +0000 (22:44 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 30 Oct 2022 01:33:01 +0000 (02:33 +0100)
This helps people with a lot of built up muscle memory :)

Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
doc/ChangeLog
doc/readelf.1
src/ChangeLog
src/readelf.c
tests/ChangeLog
tests/run-readelf-s.sh

index 073023b4bf6e5155b4d09f44162b5412656c5b8c..269ed06e567ed31bbf2d8d6946012bda30621dc5 100644 (file)
@@ -1,3 +1,7 @@
+2022-10-28  Arsen Arsenović  <arsen@aarsen.me>
+
+       * readelf.1: Document the --syms alias.
+
 2022-10-18  Daniel Thornburgh  <dthorn@google.com>
 
        * debuginfod_find_debuginfo.3: Document DEBUGINFOD_HEADERS_FILE.
index 6a843f6606f079b4b4847e59bac600af21f31fc1..1d182071dcd07ed1cd9382ce6952de03e5f09f2b 100644 (file)
@@ -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
index 1f369ef626d3b9a82b06dac97704498e38046c41..d3399a5caf9240aff07c7e3c45e4b12d1cf6b869 100644 (file)
@@ -1,3 +1,7 @@
+2022-10-28  Arsen Arsenović  <arsen@aarsen.me>
+
+       * readelf.c (options): Add Binutils-style --syms alias.
+
 2022-10-19  Mark Wielaard  <mark@klomp.org>
 
        * readelf.c (dwarf_loc_list_encoding_string): Handle
index 7671a31df032c671aeffab13568a839e3da69f46..0e0b05c44edf64e6395effbdcd8207207ac28d2d 100644 (file)
@@ -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 },
index be90832a72bbf5039067eadbb23ad75f000dc646..949dab8af4af3b85802f2f0f155503e290d3b15b 100644 (file)
@@ -1,3 +1,7 @@
+2022-10-28  Arsen Arsenović  <arsen@aarsen.me>
+
+       * run-readelf-s.sh: Add tests for the --syms alias.
+
 2022-10-27  Mark Wielaard  <mark@klomp.org>
 
        * backtrace-subr.sh: Use grep -E instead of egrep, use grep -F
index 527c436c2f02c3fe3735d1fea6560a3ac03d5cce..ee1c0e8278a97371df3ef1159aaa85207b328b6e 100755 (executable)
@@ -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