diff mbox series

Remove pre-Solaris 11/SPARC unwinding support

Message ID yddk1ecf8cb.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
Series Remove pre-Solaris 11/SPARC unwinding support | expand

Commit Message

Rainer Orth May 27, 2019, 11:24 a.m. UTC
One of the last remnants of Solaris 10 (and 9)/SPARC support is the
libgcc unwinder.

To get rid of unused cruft, I've taken a full clone of the Solaris 11
support repository, checked out every since version of 32 and 64-bit
libc.so.1 and checked if the patters looked for in sol2-unwind.h are
present.

* As expected, the 64-bit __sighndlr pattern is present everywhere, as
  is the Solaris 11 cuh_pattern.  However, neither the Solaris 10
  cuh_pattern nor the Solaris 9 one can be found, while both are present
  in the respective versions of libc/libthread.

* In the 32-bit case, __sighndlr is identical everywhere again, and the
  Solaris 11 cuh_pattern is found in most versions of libc.  Unlike the
  64-bit case, the Solaris 10 cuh_pattern is also found in the Solaris
  11 Express (snv_151) versions of libc.  While this in itself doesn't
  matter (I won't be supporting a 9-year old beta version of Solaris 11
  these days), it might be that this is still present in OpenSolaris
  derivatives since snv_147 was the last open version.  So I checked
  Tribblix m20.6, the only known Illumos derivative with SPARC support.
  However, when I looked at 32-bit libc from Tribblix m20.6, I found
  none of the patterns in sol2-unwind.h (neither any of the 64-bit ones
  in the 64-bit libc).  I have to assume that Peter Tribble switched to
  using gcc for his builds.

So all pre-Solaris 11 patterns can go since there's no way that they can
be found on a Solaris 11 system: there's no static libc.a anymore since
Solaris 10 and the system-call interface between libc and kernel changed
so much in Solaris 11 that a local copy of Solaris 10 libc.so.1 wouldn't
work at all on Solaris 11.

Bootstrapped without regressions on sparc-sun-solaris2.11 (Solaris 11.3,
11.4, and 11.5).  I'm going to install the patch in a day or two unless
someone finds fault with my reasoning.

	Rainer
diff mbox series

Patch

# HG changeset patch
# Parent  a471ac842743a60d92dc3c029ee68c655bb00142
Remove pre-Solaris 11/SPARC unwinding support

diff --git a/libgcc/config/sparc/sol2-unwind.h b/libgcc/config/sparc/sol2-unwind.h
--- a/libgcc/config/sparc/sol2-unwind.h
+++ b/libgcc/config/sparc/sol2-unwind.h
@@ -67,51 +67,7 @@  sparc64_is_sighandler (unsigned int *pc,
 	   libc.so.1:
 
 	   <call_user_handler+864>:     mov  %i1, %o1
-	   <call_user_handler+868>:     call __sighndlr
-
-	   This is the same setup as for Solaris 10, see below.  */
-	*nframes = 3;
-
-      else if (cuh_pattern == 0xd25fa7ef)
-	{
-	  /* This matches the call_user_handler pattern in Solaris 10
-	     libc.so.1:
-
-	     <call_user_handler+988>:     ldx  [ %fp + 0x7ef ], %o1
-	     <call_user_handler+992>:     call __sighndlr
-
-	     There are 2 cases so we look for the return address of the
-	     caller's caller frame in order to do more pattern matching.  */
-	  unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8);
-
-          if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019)
-	    /* We need to move up three frames:
-
-		<signal handler>	<-- context->cfa
-		__sighndlr
-		call_user_handler
-		sigacthandler
-		<kernel>  */
-	    *nframes = 3;
-	  else
-	    /* The sigacthandler frame isn't present in the chain.
-	       We need to move up two frames:
-
-		<signal handler>	<-- context->cfa
-		__sighndlr
-		call_user_handler
-		<kernel>  */
-	    *nframes = 2;
-	}
-
-      else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b)
-	/* This matches the call_user_handler pattern in Solaris 9
-	   libthread.so.1:
-
-	   <call_user_handler+600>:     mov  %i2, %o2
-	   <call_user_handler+604>:     call  __sighndlr
-
-	   This is the same setup as for Solaris 10, see above.  */
+	   <call_user_handler+868>:     call __sighndlr  */
 	*nframes = 3;
 
       return 1;
@@ -184,51 +140,7 @@  sparc_is_sighandler (unsigned int *pc, v
 	   libc.so.1:
 
 	   <call_user_handler+876>:     mov  %i1, %o1
-	   <call_user_handler+880>:     call __sighndlr
-
-	   This is the same setup as for Solaris 10, see below.  */
-	*nframes = 3;
-
-      else if (cuh_pattern == 0xd407a04c)
-	{
-	  /* This matches the call_user_handler pattern in Solaris 10
-	     libc.so.1:
-
-	     <call_user_handler+948>:     ld  [ %fp + 0x4c ], %o2
-	     <call_user_handler+952>:     call __sighndlr
-
-	     There are 2 cases so we look for the return address of the
-	     caller's caller frame in order to do more pattern matching.  */
-	  unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4);
-
-          if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019)
-	    /* We need to move up three frames:
-
-		<signal handler>	<-- context->cfa
-		__sighndlr
-		call_user_handler
-		sigacthandler
-		<kernel>  */
-	    *nframes = 3;
-	  else
-	    /* The sigacthandler frame isn't present in the chain.
-	       We need to move up two frames:
-
-		<signal handler>	<-- context->cfa
-		__sighndlr
-		call_user_handler
-		<kernel>  */
-	    *nframes = 2;
-	}
-
-      else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b)
-	/* This matches the call_user_handler pattern in Solaris 9
-	   libthread.so.1:
-
-	   <call_user_handler+560>:      mov  %i2, %o2
-	   <call_user_handler+564>:      call  __sighndlr
-
-	   This is the same setup as for Solaris 10, see above.  */
+	   <call_user_handler+880>:     call __sighndlr  */
 	*nframes = 3;
 
       return 1;