diff options
author | Mark Wielaard <mark@klomp.org> | 2019-08-27 16:09:39 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-08-29 18:05:34 +0200 |
commit | 1b9d343a8cbe14c2b2a3adebc962b2634a2be98a (patch) | |
tree | bfad3875ddb23e2e884aa1e69778f03e98c139a7 /src | |
parent | df33285b60290fadefd140ee2fe616f750105d2f (diff) | |
download | elfutils-1b9d343a8cbe14c2b2a3adebc962b2634a2be98a.tar.gz |
readelf: Actually dump hex or strings when -p or -x get section number.
The readelf code did parse section numbers, but then failed to actually
dump the section found. Fixed by actually calling the dump function
(either the hex or string variant). Add testcase for readelf -x num.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/readelf.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index cb64f7d9..a945c429 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2019-08-27 Mark Wielaard <mark@klomp.org> + + * readelf.c (for_each_section_argument): Call (*dump) also for + section numbers. + 2019-08-26 Mark Wielaard <mark@klomp.org> * nm.c (show_symbols): Remember nentries_orig and check before diff --git a/src/readelf.c b/src/readelf.c index 24be7a9a..77f9c3a3 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -12634,6 +12634,7 @@ for_each_section_argument (Elf *elf, const struct section_argument *list, error (EXIT_FAILURE, 0, gettext ("cannot get section header: %s"), elf_errmsg (-1)); name = elf_strptr (elf, shstrndx, shdr_mem.sh_name); + (*dump) (scn, &shdr_mem, name); } else { |