Add -p option to readelf so that sections can be dumped as strings
Nick Clifton
nickc@redhat.com
Thu Aug 30 12:36:00 GMT 2007
Hi Guys,
I am going to check in the attached patch which adds a -p command
line option to readelf. This option can be used to dump the
contents of a named or numbered section section as a sequence of
strings and it is modelled after the same ability in the readelf tool
in the elfutils package.
The patch includes an update to the documentation and a test case
for the new ability. I have tested it with loads of different
toolchains and found no problems or regressions.
Cheers
Nick
binutils/ChangeLog
2007-08-30 Nick Clifton <nickc@redhat.com>
* readelf.c (dump_type): New type used to classify the kinds of
dump requested by the user.
(dump_sects, cmdline_dump_sects): Use the new type.
(options): Add --string-dump option.
(request_dump): Rename to request_dump_bynumber. Use dump_type.
(request_dump_byname): Use dump_type.
(parse_args): Parse --string-dump option.
(process_section_headers): Fix calls to request_dump.
(initialise_dumps_byname): Likewise.
(dump_section): Rename to dump_section_as_bytes.
(dump_section_as_strings): New function. Display the contents of
a section as printable strings.
(process_section_contents): String dump the section if requested.
(process_object): Use dump_type.
(main): Likewise.
* Makefile.am: Add dependency for readelf.c on safe-ctype.h.
* Makefile.in: Regenerate.
* NEWS: Mention the new feature.
* doc/binutils.texi: Document the new feature.
binutils/testsuite/ChangeLog
2007-08-30 Nick Clifton <nickc@redhat.com>
* binutils-all/dumptest.s: New test file.
* readelf.exp: Add test of readelf's -p switch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readelf-p.patch.bz2
Type: application/x-bzip2
Size: 6209 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070830/b391cc76/attachment.bz2>
More information about the Binutils
mailing list