readelf: add binutils-style --syms option
Commit Message
This helps people with a lot of built up muscle memory :)
Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
---
Hi there!
I often use the "medium length" form of --symbols when using readelf, and I've
been trying to switch to eu-readelf lately (for various reasons); this alias
comes in handy for this reason. I also added the matching tests, though I'm
not sure if they're strictly necessary (but I added them anyway).
Some of the .po files need regenerating, I didn't include that here because it
was a massive diff.
Thanks in advance, and have a great evening!
doc/ChangeLog | 4 ++++
doc/readelf.1 | 5 ++++-
src/ChangeLog | 4 ++++
src/readelf.c | 1 +
tests/ChangeLog | 4 ++++
tests/run-readelf-s.sh | 6 ++++++
6 files changed, 23 insertions(+), 1 deletion(-)
Comments
Hi Arsen,
On Fri, Oct 28, 2022 at 10:44:47PM +0200, Arsen Arsenović via Elfutils-devel wrote:
> This helps people with a lot of built up muscle memory :)
>
> Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
> ---
>
> I often use the "medium length" form of --symbols when using readelf, and I've
> been trying to switch to eu-readelf lately (for various reasons); this alias
> comes in handy for this reason. I also added the matching tests, though I'm
> not sure if they're strictly necessary (but I added them anyway).
Awesome. ChangeLog entries, updated documentation and tests. How can I
not merge this? :) Pushed.
> Some of the .po files need regenerating, I didn't include that here because it
> was a massive diff.
Yeah, we only do that before a release.
Thanks,
Mark
Hi,
On Sunday, 30 October 2022 02:49:24 CET Mark Wielaard wrote:
> Awesome. ChangeLog entries, updated documentation and tests. How can I
> not merge this? :) Pushed.
Thanks! :)
> Yeah, we only do that before a release.
Ah, I see, that makes sense. Good to know I wasn't missing anything.
Have a good day!
@@ -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.
@@ -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
@@ -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
@@ -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 },
@@ -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
@@ -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