This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Reducing eh_frame table size


   From: Bruno Haible <haible@ilog.fr>
   Date: Mon, 17 Nov 1997 21:39:17 +0100 (MET)

   Can we hope that this will be implemented in gas in the near future?

I certainly think this would be a good idea.  I personally am quite
busy on other projects.  However, as always, I am happy to accept
contributed patches, and to answer questions about how such patches
should be implemented.

I've appended a note from Jason Merrill about various dwarf2
optimizations that could be implemented in the assembler and linker.

Ian

Date: Mon, 15 Sep 1997 19:18:43 -0700
From: Jason Merrill <jason@cygnus.com>

Now that the dwarf2 EH unwinder code is in gcc, it would be nice to have
the assembler and/or linker do some optimization thereof.  The unwind
information lives in .eh_frame, a loaded section, and looks like the
following.  The most obvious optimizations are sharing of CIEs and
shrinking offset fields.  

Each FDE (function descriptor) contains a pointer to the CIE for that
translation unit, but there can be more or fewer than one CIE per TU.
Currently all CIEs are the same, so they could all be merged into a single
CIE.

Because the compiler doesn't know how large insns are, and because it
doesn't know about relaxations, it uses five bytes (opcode + 4byte delta)
for the PC advance insns; this can be reduced to one, two or three bytes
depending on the actual delta.

It would also be nice to factor out common insn patterns into the CIE;
currently the only insns in the CIE set up the initial CFA and return addr
location, but since most prologues start the same way all those insns could
be moved into the CIE.

Just a future direction...

Jason

__FRAME_BEGIN__:
	.4byte	.LECIE1-.LSCIE1	/ Length of Common Information Entry
.LSCIE1:
	.4byte	0xffffffff	/ CIE Identifier Tag
	.byte	0x1	/ CIE Version
	.ascii "e\0"	/ CIE Augmentation
	.byte	0x1	/ ULEB128 0x1 (CIE Code Alignment Factor)
	.byte	0x7c	/ SLEB128 -4 (CIE Data Alignment Factor)
	.byte	0x8	/ CIE RA Column
	.byte	0xc	/ DW_CFA_def_cfa
	.byte	0x4	/ ULEB128 0x4
	.byte	0x4	/ ULEB128 0x4
	.byte	0x88	/ DW_CFA_offset, column 0x8
	.byte	0x1	/ ULEB128 0x1
	.align 4
.LECIE1:
	.4byte	.LEFDE1-.LSFDE1	/ FDE Length
.LSFDE1:
	.4byte	__FRAME_BEGIN__	/ FDE CIE offset
	.4byte	.LFB1	/ FDE initial location
	.4byte	.LFE1-.LFB1	/ FDE address range
	.4byte	__EXCEPTION_TABLE__	/ pointer to exception region info
	.byte	0x4	/ DW_CFA_advance_loc4
	.4byte	.LCFI0-.LFB1
	.byte	0xe	/ DW_CFA_def_cfa_offset
	.byte	0x8	/ ULEB128 0x8
	.byte	0x85	/ DW_CFA_offset, column 0x5
	.byte	0x2	/ ULEB128 0x2
	.byte	0x4	/ DW_CFA_advance_loc4
	.4byte	.LCFI1-.LCFI0
	.byte	0xd	/ DW_CFA_def_cfa_register
	.byte	0x5	/ ULEB128 0x5
	.byte	0x4	/ DW_CFA_advance_loc4
	.4byte	.LCFI2-.LCFI1
	.byte	0x2e	/ DW_CFA_GNU_args_size
	.byte	0x4	/ ULEB128 0x4
	.byte	0x4	/ DW_CFA_advance_loc4
	.4byte	.LCFI3-.LCFI2
	.byte	0x2e	/ DW_CFA_GNU_args_size
	.byte	0x0	/ ULEB128 0x0
	.align 4
.LEFDE1:



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