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]

[patch] Add split DWARF (Fission) support to objcopy/strip


This patch adds support to objcopy/strip for the split debug (Fission)
extensions to DWARF:

  http://gcc.gnu.org/wiki/DebugFission

We've added two options to objcopy:

  --extract-dwo: copies the .dwo DWARF sections to a new file.
  --strip-dwo: removes the .dwo DWARF sections from the file.

GCC generates all DWARF sections in a single output file, then after
the assembly step is done, invokes objcopy twice:

  objcopy --extract-dwo object.o object.dwo
  objcopy --strip-dwo object.o

Tested on x86_64, with a compiler that generates split DWARF files.

OK to commit?

-cary


2012-05-04  Cary Coutant  <ccoutant@google.com>

binutils/

	* doc/binutils.texi (objcopy): Add --strip-dwo, --extract-dwo options.
	(strip): Add --strip-dwo option.
	* objcopy.c (enum strip_action): Add STRIP_DWO, STRIP_NONDWO.
	(enum command_line_switch): Add OPTION_EXTRACT_DWO, OPTION_STRIP_DWO.
	(strip_options): Add --strip-dwo option.
	(copy_options): Add --extract-dwo, --strip-dwo options.
	(copy_usage): Likewise.
	(strip_usage): Add --strip-dwo option.
	(is_dwo_section): New function.
	(is_strip_section_1): Check for DWO sections.
	(copy_object): Check for --strip-dwo, --extract-dwo options.
	(copy_relocations_in_section): Discard relocations for DWO sections.
	Discard entire relocation section when no relocations.
	(strip_main): Add --strip-dwo option.
	(copy_main): Add --strip-dwo, --extract-dwo options.

Attachment: binutils-fission-patch-2.txt
Description: Text document


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