From 600357743f270e08b67bd97aa1b710d9be25ce99 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 15 Feb 2012 08:13:22 +0000 Subject: [PATCH] re PR target/51921 (EH unwinding support is broken) PR target/51921 PR target/52205 * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Add support for Solaris 11 and slightly reformat. (sparc_is_sighandler): Likewise. From-SVN: r184256 --- gcc/ChangeLog | 8 ++++++++ gcc/config/sparc/sol2-unwind.h | 24 ++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b2a34e78e242..084bb1135c4d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-02-15 Eric Botcazou + + PR target/51921 + PR target/52205 + * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Add support for + Solaris 11 and slightly reformat. + (sparc_is_sighandler): Likewise. + 2012-02-14 Jakub Jelinek Backported from mainline diff --git a/gcc/config/sparc/sol2-unwind.h b/gcc/config/sparc/sol2-unwind.h index db1080742508..d6c4f6c1fe7e 100644 --- a/gcc/config/sparc/sol2-unwind.h +++ b/gcc/config/sparc/sol2-unwind.h @@ -119,7 +119,12 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) unsigned int cuh_pattern = *(unsigned int *)(*(unsigned long *)(cfa + 15*8) - 4); - if (cuh_pattern == 0xd25fa7ef) + if (cuh_pattern == 0x92100019) + /* This matches the call_user_handler pattern for Solaris 11. + This is the same setup as for Solaris 9, see below. */ + *nframes = 3; + + else if (cuh_pattern == 0xd25fa7ef) { /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the @@ -140,6 +145,7 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 2; } + else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013) /* This matches the call_user_handler pattern for Solaris 9 and for Solaris 8 running inside Solaris Containers respectively @@ -152,7 +158,8 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 3; - else + + else /* cuh_pattern == 0xe0272010 */ /* This is the default Solaris 8 case. We need to move up two frames: @@ -162,6 +169,7 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 2; + return 1; } @@ -287,7 +295,12 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) unsigned int cuh_pattern = *(unsigned int *)(*(unsigned int *)(cfa + 15*4) - 4); - if (cuh_pattern == 0xd407a04c) + if (cuh_pattern == 0x92100019) + /* This matches the call_user_handler pattern for Solaris 11. + This is the same setup as for Solaris 9, see below. */ + *nframes = 3; + + else if (cuh_pattern == 0xd407a04c) { /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the @@ -308,6 +321,7 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 2; } + else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) /* This matches the call_user_handler pattern for Solaris 9 and for Solaris 8 running inside Solaris Containers respectively. @@ -320,7 +334,8 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 3; - else + + else /* cuh_pattern == 0x90100018 */ /* This is the default Solaris 8 case. We need to move up two frames: @@ -330,6 +345,7 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) */ *nframes = 2; + return 1; } -- 2.47.2