[PATCH] Support .cfi_personality and .cfi_lsda directives
Jakub Jelinek
jakub@redhat.com
Thu Nov 2 14:56:00 GMT 2006
On Wed, Nov 01, 2006 at 09:11:10AM -0800, H. J. Lu wrote:
> On Wed, Nov 01, 2006 at 05:55:49PM +0100, Jakub Jelinek wrote:
> > This is the second part in my attempt to change GCC to emit .eh_frame unwind
> > info using .cfi_* directives.
> >
> > The gas generated .eh_frame never has personality nor LSDA, while for C++,
> > Java or __attribute__((cleanup ())) in C we often need them.
> >
> > This patch adds two new directives, .cfi_personality and .cfi_lsda,
> > which set the personality routine and LSDA of the current FDE (well,
> > personality routine is a CIE thingie, but we generate CIEs on the fly
> > for the FDEs).
>
> Testcases?
Here it is:
2006-11-02 Jakub Jelinek <jakub@redhat.com>
* gas/cfi/cfi-common-6.d: New test.
* gas/cfi/cfi-common-6.s: New.
* gas/cfi/cfi.exp: Add cfi-common-6 test.
--- gas/testsuite/gas/cfi/cfi-common-6.d.jj 2006-11-02 15:05:03.000000000 +0100
+++ gas/testsuite/gas/cfi/cfi-common-6.d 2006-11-02 15:08:39.000000000 +0100
@@ -0,0 +1,73 @@
+#readelf: -wf
+#name: CFI common 6
+The section .eh_frame contains:
+
+00000000 00000018 00000000 CIE
+ Version: 1
+ Augmentation: "zPLR"
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: .*
+ Augmentation data: 03 .. .. .. .. 0c 1b
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+0000001c 00000018 00000020 FDE cie=00000000 pc=00000000..00000004
+ Augmentation data: (00 00 00 00 de ad be ef|ef be ad de 00 00 00 00)
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000038 00000010 00000000 CIE
+ Version: 1
+ Augmentation: "zLR"
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: .*
+ Augmentation data: 0c 1b
+
+ DW_CFA_nop
+
+0000004c 00000018 00000018 FDE cie=00000038 pc=00000004..00000008
+ Augmentation data: (00 00 00 00 de ad be ef|ef be ad de 00 00 00 00)
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000068 00000018 0000006c FDE cie=00000000 pc=00000008..0000000c
+ Augmentation data: (00 00 00 00 be ef de ad|ad de ef be 00 00 00 00)
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000084 00000018 00000000 CIE
+ Version: 1
+ Augmentation: "zPLR"
+ Code alignment factor: .*
+ Data alignment factor: .*
+ Return address column: .*
+ Augmentation data: 1b .. .. .. .. 1b 1b
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+000000a0 00000014 00000020 FDE cie=00000084 pc=0000000c..00000010
+ Augmentation data: .. .. .. ..
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+000000b8 00000014 00000038 FDE cie=00000084 pc=00000010..00000014
+ Augmentation data: .. .. .. ..
+
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
--- gas/testsuite/gas/cfi/cfi-common-6.s.jj 2006-11-02 12:08:09.000000000 +0100
+++ gas/testsuite/gas/cfi/cfi-common-6.s 2006-11-02 12:08:49.000000000 +0100
@@ -0,0 +1,40 @@
+ .text
+ .cfi_startproc simple
+ .cfi_personality 3, my_personality_v0
+ .cfi_lsda 12, 0xdeadbeef
+ .long 0
+ .cfi_endproc
+
+ .cfi_startproc simple
+ .cfi_personality 3, my_personality_v0
+ .cfi_lsda 12, 0xdeadbeef
+ .cfi_personality 0xff
+ .long 0
+ .cfi_endproc
+
+ .cfi_startproc simple
+ .cfi_personality 3, my_personality_v0
+ .cfi_lsda 12, 0xbeefdead
+ .long 0
+ .cfi_endproc
+
+ .cfi_startproc simple
+ .cfi_personality (0x10 | 11), my_personality_v1
+ .cfi_lsda 27, 1f
+ .long 0
+ .cfi_endproc
+
+ .cfi_startproc simple
+ .cfi_personality (0x10 | 11), my_personality_v1
+ .cfi_lsda 27, 2f
+ .long 0
+ .cfi_endproc
+
+my_personality_v0:
+ .long 0
+my_personality_v1:
+ .long 0
+1:
+ .long 0
+2:
+ .long 0
--- gas/testsuite/gas/cfi/cfi.exp.jj 2006-10-31 12:16:09.000000000 +0100
+++ gas/testsuite/gas/cfi/cfi.exp 2006-11-02 15:46:52.000000000 +0100
@@ -73,3 +73,4 @@ run_dump_test "cfi-common-2"
run_dump_test "cfi-common-3"
run_dump_test "cfi-common-4"
run_dump_test "cfi-common-5"
+run_dump_test "cfi-common-6"
Jakub
More information about the Binutils
mailing list