[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:

https://groups.google.com/forum/#!msg/generic-abi/dBOS1H47Q64/Fm_Jh9vOlG8J

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

	-gz[=none|zlib|zlib-gnu]

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

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
comments.

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.

	Rainer


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
	support.
	* configure: Regenerate.
	* config.in: Regenerate.
	* common.opt (gz, gz=): New options.
	* gcc.c (LINK_COMPRESS_DEBUG_SPEC, ASM_COMPRESS_DEBUG_SPEC):
	Define.
	(LINK_COMMAND_SPEC): Invoke LINK_COMPRESS_DEBUG_SPEC.
	(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
	-gz[=type].
	(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