This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix SH linuxthreads vfork


Hi,

I'd like to forward a mail from SUGIOKA Toshinobu because he has
a trouble with subscribing libc-hacker.
I've confirmed his patch below in my environment.

BTW, does anyone know about any trouble to subscribe libc-hacker?

Regards,
	kaz
--
Hi,

Appended patch fixes segmentation fault in vfork on sh[34]-linux target
which is caused by un-initialized register usage.

ChangeLog:
2004-04-22  SUGIOKA Toshinobu <sugioka@itonet.co.jp>

	* linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S: Fix wrong function
	pointer reference in PIC case.

Index: linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S,v
retrieving revision 1.3
diff -u -r1.3 vfork.S
--- linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S	11 Feb 2003 06:27:54 -0000	1.3
+++ linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S	22 Apr 2004 05:10:49 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,8 +27,11 @@
 
 ENTRY (__vfork)
 #ifdef SHARED
+	mov.l	.Lgot, r1
+	mova	.Lgot, r0
+	add	r0, r1
 	mov.l	.Lpthread_func, r0
-	mov.l	@(r0,r12), r0
+	mov.l	@(r0,r1), r0
 #else
 	mov.l	.Lpthread_create, r0
 #endif
@@ -50,6 +53,8 @@
 .L1:	.word	__NR_vfork
 	.align	2
 #ifdef SHARED
+.Lgot:
+	.long	_GLOBAL_OFFSET_TABLE_
 .Lpthread_func:
 	.long	__libc_pthread_functions@GOTOFF
 #else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]