libffi unwinder data

Andrew Haley aph@cambridge.redhat.com
Tue Jun 5 02:29:00 GMT 2001


Richard Henderson writes:
 > On Sun, Jun 03, 2001 at 02:56:23PM +0100, Andrew Haley wrote:
 > > * src/alpha/osf.S: Add unwind info.
 > 
 > Incidentally, this is only valid for ELF. Tru64 (ECOFF) has to
 > put these things in the data section with special symbol names
 > so that collect2 grabs them.
Thanks. Hmm, I'll try to figure out how to handle this in a clean
way.
This reminds me of something. I've been wondering if it is worth
adding unwinder directives to gas rather than doing it all as .byte
commands in gcc, so this
	.section	.eh_frame,"aw",@progbits
__FRAME_BEGIN__:
	.4byte	$LECIE1-$LSCIE1	 # Length of Common Information Entry
$LSCIE1:
	.4byte	0x0	 # CIE Identifier Tag
	.byte	0x1	 # CIE Version
	.ascii "zR0円"	 # CIE Augmentation
	.byte	0x1	 # uleb128 0x1; CIE Code Alignment Factor
	.byte	0x78	 # sleb128 -8; CIE Data Alignment Factor
	.byte	0x1a	 # CIE RA Column
	.byte	0x1	 # uleb128 0x1; Augmentation size
	.byte	0x1b	 # FDE Encoding (pcrel sdata4)
	.byte	0xc	 # DW_CFA_def_cfa
	.byte	0x1e	 # uleb128 0x1e
	.byte	0x0	 # uleb128 0x0
	.align 3
$LECIE1:
$LSFDE1:
	.4byte	$LEFDE1-$LASFDE1	 # FDE Length
$LASFDE1:
	.4byte	$LASFDE1-__FRAME_BEGIN__	 # FDE CIE offset
	.4byte	$LFB1-.	 # FDE initial location
	.4byte	$LFE1-$LFB1	 # FDE address range
	.byte	0x0	 # uleb128 0x0; Augmentation size
	.byte	0x4	 # DW_CFA_advance_loc4
	.4byte	$LCFI0-$LFB1
would look like more like this:
 .unwind_info
	.4byte	$LECIE1-$LSCIE1	 # Length of Common Information Entry
$LSCIE1:
	.4byte	0x0	 # CIE Identifier Tag
	.byte	0x1	 # CIE Version
	.ascii "zR0円"	 # CIE Augmentation
	.uleb128	 0x1	 # CIE Code Alignment Factor
	.sleb128 -8	 # CIE Data Alignment Factor
	.byte	0x1a	 # CIE RA Column
	.uleb128 0x1	 # Augmentation size
	.byte	0x1b	 # FDE Encoding (pcrel sdata4)
	.DW_CFA_def_cfa 0x1e, 0x0
	.align 3
$LECIE1:
$LSFDE1:
	.4byte	$LEFDE1-$LASFDE1	 # FDE Length
$LASFDE1:
	.4byte	$LASFDE1-__FRAME_BEGIN__ # FDE CIE offset
	.4byte	$LFB1-.	 # FDE initial location
	.4byte	$LFE1-$LFB1	 # FDE address range
	.uleb128 0x0; # Augmentation size
	.DW_CFA_advance_loc4 $LCFI0-$LFB1
(Or something. This is kinda rough.)
This makes it easier to write this stuff by hand, and differences such
as Tru64 could be handled in the assembler.
 > You needn't mark every instruction like this.
 > 
 > ... we don't use LCFI[1-4]. Gcc onlt emits those labels
 > due to a phase ordering problem that wasn't worth fixing.
Yes. I didn't think it was worth taking them out. :-)
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /