patches/glibc/2.3.2/glibc-2.3.2-sh4-socket.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
permissions -rw-r--r--
Bump version to 0.2.2.
     1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/sh/socket.S.diff?r1=1.5&r2=1.6&cvsroot=glibc
     2 
     3 Ankur Sheth said:
     4 "The problem that I ran into was that multi-threaded apps would crash with a
     5 seg fault when they invoked some of the socket calls (sendto() in my case.
     6 This happened only on the sh4.  Turns out that a certain register (PR) was
     7 not being saved and restored properly before and after invoking the system
     8 call.  This patch fixes it.  It applies cleanly on glibc 2.3.2. 
     9 [Thanks to Kaz for helping us find this.]"
    10 
    11 ===================================================================
    12 RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sh/socket.S,v
    13 retrieving revision 1.5
    14 retrieving revision 1.6
    15 diff -u -r1.5 -r1.6
    16 --- libc/sysdeps/unix/sysv/linux/sh/socket.S	2003/01/05 11:07:44	1.5
    17 +++ libc/sysdeps/unix/sysv/linux/sh/socket.S	2003/07/12 01:25:53	1.6
    18 @@ -94,7 +94,9 @@
    19  #if defined NEED_CANCELLATION && defined CENABLE
    20  .Lsocket_cancel:
    21  	/* Enable asynchronous cancellation.  */
    22 +	sts.l pr,@-r15
    23  	CENABLE
    24 +	lds.l @r15+,pr
    25  
    26  	/* Do the system call trap.  */
    27  	mov #+P(SOCKOP_,socket), r4
    28 @@ -102,9 +104,11 @@
    29  	mov.l .L1,r3
    30  	trapa #0x12
    31  
    32 +	sts.l pr,@-r15
    33  	mov.l r0,@-r15
    34  	CDISABLE
    35  	mov.l @r15+,r0
    36 +	lds.l @r15+,pr
    37  
    38  	/* Pop args off the stack */
    39  	P(POPARGS_,NARGS)