This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add -p option to readelf so that sections can be dumped as strings


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.

Attachment: readelf-p.patch.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]