[build, driver] RFC: Support compressed debug sections

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Thu Apr 11 12:36:00 GMT 2013

There's some interest inside Oracle to support compressed debug sections
inside their toolchain, both on Solaris and Linux.  So far, there's the
GNU style supported by gas, gld, gold, and gdb, which mangles section
names (.debug_* -> .zdebug_*), but consultation with the Solaris linker
engineers resulted in a different style, now (almost) approved for the
ELF gABI.  The final proposal can be found here:


I've now started to implement this for gcc and probably other parts of
the GNU toolchain.  This patch proposes to add a


option to gcc, enabling (or disabling) compressed debug sections in
either format, and passing the necessary options to assembler and/or

It probably has rough edges since this is the first time I've been
dealing with the option handling machinery, and may or may not be
appropriate for approval at this time.

I'm asking for both comments on the general approach and specific review

So far, the patch has been tested on i386-pc-solaris2.11 with gas 2.23.2
and a version of the Solaris linker that supports -z compress-debug-sections.


2013-04-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_compress_debug): Check for assembler
	compressed debug support.
	(gcc_cv_ld_compress_debug): Check for linker compressed debug
	* configure: Regenerate.
	* config.in: Regenerate.
	* common.opt (gz, gz=): New options.
	(asm_options): Invoke ASM_COMPRESS_DEBUG_SPEC.
	* opts.c (common_handle_option): Handle OPT_gz, OPT_gz_.
	* doc/invoke.texi (Option Summary, Debugging Options): Add
	(Debugging Options): Document -gz[=type].

-------------- next part --------------
A non-text attachment was scrubbed...
Name: compress-debug-sections.patch
Type: text/x-patch
Size: 8912 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130411/0232b419/attachment.bin>
-------------- next part --------------

Rainer Orth, Center for Biotechnology, Bielefeld University

More information about the Gcc-patches mailing list