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>
+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
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
{
+2019-08-27 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-test2.sh: Add -x num testcase.
+
2019-08-29 Mark Wielaard <mark@klomp.org>
* test-subr.sh (self_test_files_exe): replace elfcmp, objdump and
0x00000000 00 .
EOF
+testrun_compare ${abs_top_builddir}/src/readelf -x 6 testfile28 <<\EOF
+
+Hex dump of section [6] '.strtab', 1 bytes at offset 0x290:
+ 0x00000000 00 .
+EOF
+
+
exit 0