[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r19251 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/unix/sysv/linux/sh/ sysdeps/i386/ sysdeps/mach/ sysdeps/mach/hurd/i386/ s...



Author: eglibc
Date: Sun Jun 24 00:01:32 2012
New Revision: 19251

Log:
Import glibc-mainline for 2012-06-24

Added:
    fsf/trunk/libc/sysdeps/sh/abort-instr.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym
Removed:
    fsf/trunk/libc/sysdeps/mach/start.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
    fsf/trunk/libc/sysdeps/i386/init-first.c
    fsf/trunk/libc/sysdeps/mach/hurd/i386/static-start.S
    fsf/trunk/libc/sysdeps/sh/____longjmp_chk.S
    fsf/trunk/libc/sysdeps/sh/init-first.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Versions
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sysdep.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jun 24 00:01:32 2012
@@ -1,3 +1,49 @@
+2012-06-23  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+	    Thomas Schwinge  <thomas@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/syscalls.list: Add fanotify_mark.
+	* sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.16): Add fanotify_mark.
+	* sysdeps/unix/sysv/linux/sh/nptl/libc.abilist (GLIBC_2.16): Add
+	fanotify_mark.
+
+2012-06-23  Thomas Schwinge  <thomas@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mach/start.c: Remove file.
+	* sysdeps/mach/hurd/i386/static-start.S: Fix start.S include.
+	* sysdeps/i386/init-first.c: Fix comment regarding start.S.
+	* sysdeps/sh/init-first.c: Likewise.
+
+	* sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Preserve r12 and pr
+	registers for frame unwinding purposes, add CFI directives.
+	* sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
+	* sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Likewise
+	* sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
+	Likewise.
+
+	* sysdeps/sh/____longjmp_chk.S (CALL_FAIL): Don't plan for the call to
+	__fortify_fail returning.
+	* sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (CALL_FAIL): Likewise.
+
+	* sysdeps/unix/sysv/linux/sh/____longjmp_chk.S: New file, based on
+	sysdeps/sh/____longjmp_chk.S.
+	* sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym: New file, based
+	on sysdeps/unix/sysv/linux/x86_64/sigaltstack-offsets.sym.
+	* sysdeps/unix/sysv/linux/sh/Makefile [subdir=misc]
+	(gen-as-const-headers): Append sigaltstack-offsets.sym.
+
+	* sysdeps/sh/abort-instr.h: New file.
+	* sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Terminate the
+	process in case exit returns.
+
+	* sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Always
+	initialize the GOT register before use.
+
+	* sysdeps/unix/sysv/linux/sh/makecontext.S (__makecontext): Fix
+	calculation of ARGC > 4.
+
+	* sysdeps/unix/sysv/linux/sh/makecontext.S: Add comments and give more
+	meaningful names to some local labels.
+
 2012-06-22  Nobuhiro Iwamatsu  <iwamatsu@xxxxxxxxxxx>
 	    Kaz Kojima  <kkojima@xxxxxxxxxxxxxx>
 

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Sun Jun 24 00:01:32 2012
@@ -1,3 +1,8 @@
+2012-06-23  Thomas Schwinge  <thomas@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
+	(__lll_robust_timedlock_wait): Simplify CFI directives.
+
 2012-06-20  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
 
 	[BZ #12416]

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S Sun Jun 24 00:01:32 2012
@@ -139,6 +139,8 @@
 	cmp/hs	r0, r1
 	bt	3f
 
+	cfi_remember_state
+
 	mov.l	r11, @-r15
 	cfi_adjust_cfa_offset(4)
 	cfi_rel_offset (r11, 0)
@@ -258,13 +260,9 @@
 8:
 	bra	6b
 	 mov	#ETIMEDOUT, r0
+
+	cfi_restore_state
 3:
-	/* Restore initial state for invalid timeout case.  */
-	cfi_restore (r8)
-	cfi_restore (r9)
-	cfi_restore (r10)
-	cfi_restore (r11)
-	cfi_def_cfa_offset (0)
 	rts
 	 mov	#EINVAL, r0
 	cfi_endproc

Modified: fsf/trunk/libc/sysdeps/i386/init-first.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/init-first.c (original)
+++ fsf/trunk/libc/sysdeps/i386/init-first.c Sun Jun 24 00:01:32 2012
@@ -48,7 +48,7 @@
 
 #ifdef SHARED
 /* This function is called to initialize the shared C library.
-   It is called just before the user _start code from i386/elf/start.S,
+   It is called just before the user _start code from i386/start.S,
    with the stack set up as that code gets it.  */
 
 /* NOTE!  The linker notices the magical name `_init' and sets the DT_INIT

Modified: fsf/trunk/libc/sysdeps/mach/hurd/i386/static-start.S
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/i386/static-start.S (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/i386/static-start.S Sun Jun 24 00:01:32 2012
@@ -1,5 +1,5 @@
 /* Startup code for statically linked Hurd/i386 binaries.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998-2012 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
@@ -24,4 +24,4 @@
 	jmp _start1
 
 #define _start _start1
-#include <sysdeps/i386/elf/start.S>
+#include <sysdeps/i386/start.S>

Removed: fsf/trunk/libc/sysdeps/mach/start.c
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/start.c (original)
+++ fsf/trunk/libc/sysdeps/mach/start.c (removed)
@@ -1,103 +1,0 @@
-/* Copyright (C) 1992, 1993, 1994, 1995, 1997 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
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   In addition to the permissions in the GNU Lesser General Public
-   License, the Free Software Foundation gives you unlimited
-   permission to link the compiled version of this file with other
-   programs, and to distribute those programs without any restriction
-   coming from the use of this file. (The GNU Lesser General Public
-   License restrictions do apply in other respects; for example, they
-   cover modification of the file, and distribution when not linked
-   into another program.)
-
-   Note that people who make modified versions of this file are not
-   obligated to grant this special exception for their modified
-   versions; it is their choice whether to do so. The GNU Lesser
-   General Public License gives permission to release a modified
-   version without this exception; this exception also makes it
-   possible to release a modified version which carries forward this
-   exception.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sysdep.h>
-
-#ifndef	__GNUC__
-  #error This file uses GNU C extensions; you must compile with GCC.
-#endif
-
-/* The first piece of initialized data.  */
-int __data_start = 0;
-
-#ifndef _HURD_THREADVAR_H
-volatile int errno;
-#endif
-
-extern void __mach_init (void);
-extern void __libc_init (int argc, char **argv, char **envp);
-extern int main (int argc, char **argv, char **envp);
-
-/* These are uninitialized common definitions so they will be zero
-   by default.  If the user links in C threads, that will provide initialized
-   definitions that override these.  */
-void *(*_cthread_init_routine) (void); /* Returns new SP to use.  */
-void (*_cthread_exit_routine) (int status);
-
-
-/* These are for communication from _start to start1,
-   where we cannot use the stack for anything.  */
-static int start_argc;
-static char **start_argv;
-
-/* _start calls this on the new stack.  */
-static volatile void
-start1 (void)
-{
-  __libc_init (start_argc, start_argv, __environ);
-
-  (_cthread_exit_routine != NULL ? *_cthread_exit_routine : exit)
-    (main (start_argc, start_argv, __environ));
-
-  /* Should never get here.  */
-  LOSE;
-}
-
-#ifndef START_ARGS
-#define START_ARGS void
-#endif
-#ifdef START_MACHDEP
-START_MACHDEP
-#define _start _start0
-#endif
-
-void
-_start (START_ARGS)
-{
-  SNARF_ARGS (start_argc, start_argv, __environ);
-
-  __mach_init ();
-
-  if (_cthread_init_routine != NULL)
-    CALL_WITH_SP (start1, (*_cthread_init_routine) ());
-  else
-    start1 ();
-
-  /* Should never get here.  */
-  LOSE;
-}

Modified: fsf/trunk/libc/sysdeps/sh/____longjmp_chk.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/____longjmp_chk.S (original)
+++ fsf/trunk/libc/sysdeps/sh/____longjmp_chk.S Sun Jun 24 00:01:32 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2012 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
@@ -28,14 +28,20 @@
 # define CALL_FAIL \
 	mov.l	.Lfail, r1;				\
 	mov.l	.Lstr, r4;				\
+	mov.l	r12, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (r12, 0);			\
 	mova	.Lgot, r0;				\
 	mov.l	.Lgot, r12;				\
 	add	r0, r12;				\
+	sts.l	pr, @-r15;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
 	bsrf	r1;					\
 	 add	r12, r4;				\
+	/* Unreachable.	 */				\
 .Lfail0:						\
-	bra	0f;					\
-	 nop;						\
 	.align	2;					\
 .Lgot:							\
 	.long	_GLOBAL_OFFSET_TABLE_;			\
@@ -43,21 +49,24 @@
 	.long	longjmp_msg@GOTOFF;			\
 .Lfail:							\
 	.long	__GI___fortify_fail@PLT-(.Lfail0-.);	\
-0:
+	cfi_restore_state;
 #else
 # define CALL_FAIL \
 	mov.l	.Lfail, r1;				\
 	mov.l	.Lstr, r4;				\
+	sts.l	pr, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
 	jsr	@r1;					\
 	 nop;						\
-	bra	0f;					\
-	 nop;						\
+	/* Unreachable.	 */				\
 	.align	2;					\
 .Lstr:							\
 	.long	longjmp_msg;				\
 .Lfail:							\
 	.long	__fortify_fail;				\
-0:
+	cfi_restore_state;
 #endif
 
 #define CHECK_SP(reg) \

Added: fsf/trunk/libc/sysdeps/sh/abort-instr.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/abort-instr.h (added)
+++ fsf/trunk/libc/sysdeps/sh/abort-instr.h Sun Jun 24 00:01:32 2012
@@ -1,0 +1,3 @@
+/* An instruction which should crash any program is `sleep'.  */
+#define ABORT_INSTRUCTION_ASM sleep
+#define ABORT_INSTRUCTION asm ("sleep")

Modified: fsf/trunk/libc/sysdeps/sh/init-first.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/init-first.c (original)
+++ fsf/trunk/libc/sysdeps/sh/init-first.c Sun Jun 24 00:01:32 2012
@@ -48,7 +48,7 @@
 
 #ifdef SHARED
 /* This function is called to initialize the shared C library.
-   It is called just before the user _start code from sh/sh[34]/elf/start.S,
+   It is called just before the user _start code from sh/sh[34]/start.S,
    with the stack set up as that code gets it.  */
 
 /* NOTE!  The linker notices the magical name `_init' and sets the DT_INIT

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Makefile Sun Jun 24 00:01:32 2012
@@ -6,6 +6,10 @@
 gen-as-const-headers += ucontext_i.sym
 endif
 
+ifeq ($(subdir),misc)
+gen-as-const-headers += sigaltstack-offsets.sym
+endif
+
 ifeq ($(subdir),math)
 # The libm.so link can't find __fpscr_values
 libm.so-no-z-defs = yes

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Versions
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Versions (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/Versions Sun Jun 24 00:01:32 2012
@@ -27,4 +27,7 @@
   GLIBC_2.11 {
     fallocate64;
   }
+  GLIBC_2.16 {
+    fanotify_mark;
+  }
 }

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S Sun Jun 24 00:01:32 2012
@@ -1,0 +1,122 @@
+/* Copyright (C) 2009-2012 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#include <sigaltstack-offsets.h>
+
+	.section .rodata.str1.1,"aMS",@progbits,1
+	.type	longjmp_msg,@object
+longjmp_msg:
+	.string "longjmp causes uninitialized stack frame"
+	.size	longjmp_msg, .-longjmp_msg
+	.text
+
+#define __longjmp ____longjmp_chk
+
+#ifdef PIC
+# define CALL_FAIL \
+	mov.l	.Lfail, r1;				\
+	mov.l	.Lstr, r4;				\
+	mov.l	r12, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (r12, 0);			\
+	mova	.Lgot, r0;				\
+	mov.l	.Lgot, r12;				\
+	add	r0, r12;				\
+	sts.l	pr, @-r15;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
+	bsrf	r1;					\
+	 add	r12, r4;				\
+.Lfail0:						\
+	/* Unreachable.	 */				\
+	.align	2;					\
+.Lgot:							\
+	.long	_GLOBAL_OFFSET_TABLE_;			\
+.Lstr:							\
+	.long	longjmp_msg@GOTOFF;			\
+.Lfail:							\
+	.long	__GI___fortify_fail@PLT-(.Lfail0-.);	\
+	cfi_restore_state;
+#else
+# define CALL_FAIL \
+	mov.l	.Lfail, r1;				\
+	mov.l	.Lstr, r4;				\
+	sts.l	pr, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
+	jsr	@r1;					\
+	 nop;						\
+	/* Unreachable.	 */				\
+	.align	2;					\
+.Lstr:							\
+	.long	longjmp_msg;				\
+.Lfail:							\
+	.long	__fortify_fail;				\
+	cfi_restore_state;
+#endif
+
+#define CHECK_SP(reg) \
+	/* Jumping to a higher-address frame is always allowed.	 */	\
+	cmp/hs	r15, reg;						\
+	bt	.Lok;							\
+									\
+	mov.l	r0, @-r15; /* The return value is already in here.  */	\
+	cfi_adjust_cfa_offset (4);					\
+	mov.l	r1, @-r15; /* PTR_DEMANGLE helper.  */			\
+	cfi_adjust_cfa_offset (4);					\
+	mov.l	r2, @-r15; /* The new SP value is already in here.  */	\
+	cfi_adjust_cfa_offset (4);					\
+	mov.l	r4, @-r15; /* We'll still need this one.  */		\
+	cfi_adjust_cfa_offset (4);					\
+	add	#-sizeSS, r15;						\
+	cfi_adjust_cfa_offset (sizeSS);					\
+	mov	#0, r4;							\
+	mov	r15, r5;						\
+	DO_CALL (sigaltstack, 2);					\
+	/* Without working sigaltstack we cannot perform the test.  */	\
+	tst	r0, r0;							\
+	bf	.Lok2;							\
+	mov.l	@(oSS_FLAGS, r15), r0;					\
+	tst	#SS_ONSTACK, r0;					\
+	bt	.Lcall_fail;						\
+	mov.l	@(oSS_SIZE, r15), r2;					\
+	mov.l	@(oSS_SP, r15), r1;					\
+	add	r2, r1;							\
+	sub	r8, r1;							\
+	cmp/hi	r1, r2;							\
+	bf	.Lok2;							\
+.Lcall_fail:								\
+	CALL_FAIL							\
+									\
+.Lok2:									\
+	add	#sizeSS, r15;						\
+	cfi_adjust_cfa_offset (-sizeSS);				\
+	mov.l	@r15+, r4;						\
+	cfi_adjust_cfa_offset (-4);					\
+	mov.l	@r15+, r2;						\
+	cfi_adjust_cfa_offset (-4);					\
+	mov.l	@r15+, r1;						\
+	cfi_adjust_cfa_offset (-4);					\
+	mov.l	@r15+, r0;						\
+	cfi_adjust_cfa_offset (-4);					\
+.Lok:
+
+#include <__longjmp.S>

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/makecontext.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/makecontext.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/makecontext.S Sun Jun 24 00:01:32 2012
@@ -1,5 +1,5 @@
 /* Create new context.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 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
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <abort-instr.h>
 
 #include "ucontext_i.h"
 
@@ -33,44 +34,44 @@
 	.align	5
 ENTRY(__makecontext)
 	mov	#4, r3
-	mov.l	@(oSS_SP,r4), r1
-	mov.l	@(oSS_SIZE,r4), r2
-	add	r1, r2
-	cmp/gt	r6, r3
+	mov.l	@(oSS_SP,r4), r1	/* r1 <- ucb->stack_base */
+	mov.l	@(oSS_SIZE,r4), r2	/* r2 <- ucb->stack_size */
+	add	r1, r2			/* r2 <- stack_top */
+	cmp/gt	r3, r6			/* argc > 4? */
 	bf/s	1f
-	 shlr2	r2
+	 shlr2	r2			/* r2 <- stack_top / 4 */
 	sub	r6, r2
 	add	r3, r2
 1:
-	shll2	r2
+	shll2	r2		/* r2 <- stack_top - ((argc > 4) ? 4 * (argc - 4) : 0 */
 	mov	#oR15, r0
 	mov.l	@(oLINK,r4), r1
-	mov.l	r2, @(r0,r4)
-	mov.l	r1, @(oR8,r4)
+	mov.l	r2, @(r0,r4)	/* ucp->r15 <- r2 */
+	mov.l	r1, @(oR8,r4)	/* ucp->r8 <- ucp->uc_link */
 	mov	#oPC, r0
-	mov.l	r5, @(r0,r4)
+	mov.l	r5, @(r0,r4)	/* ucp->PC <- func */
 
-	cmp/pl	r6
+	cmp/pl	r6		/* argc > 0? */
 	bf/s	.L1
 	 dt	r6
-	mov.l	r7, @(oR4,r4)
-	cmp/pl	r6
+	mov.l	r7, @(oR4,r4)	/* ucp->r4 <- argv[0] */
+	cmp/pl	r6		/* argc > 1? */
 	bf/s	.L1
 	 dt	r6
 	mov.l	@(0,r15), r1
-	mov.l	r1, @(oR5,r4)
-	cmp/pl	r6
+	mov.l	r1, @(oR5,r4)	/* ucp->r5 <- argv[1] */
+	cmp/pl	r6		/* argc > 2? */
 	bf/s	.L1
 	 dt	r6
 	mov.l	@(4,r15), r1
-	mov.l	r1, @(oR6,r4)
-	cmp/pl	r6
+	mov.l	r1, @(oR6,r4)	/* ucp->r6 <- argv[2] */
+	cmp/pl	r6		/* argc > 3? */
 	bf/s	.L1
 	 dt	r6
 	mov.l	@(8,r15), r1
-	mov.l	r1, @(oR7,r4)
+	mov.l	r1, @(oR7,r4)	/* ucp->r7 <- argv[3] */
 	mov	#12,r0
-.L0:
+.L0:				/* Save remaining argv[] on the stack.  */
 	cmp/pl	r6
 	bf/s	.L1
 	 dt	r6
@@ -87,7 +88,7 @@
 #endif
 	add	#oPR, r4
 	rts
-	 mov.l	r0, @r4
+	 mov.l	r0, @r4		/* ucp->pr <- exitcode */
 #ifndef PIC
 	.align	2
 .L2:
@@ -96,49 +97,63 @@
 	cfi_endproc
 
 	.align	5
+	cfi_startproc
 .Lexitcode:
-	tst	r8, r8
-	bt/s	2f
-	 mov	r8, r4
 #ifdef PIC
+	mov.l	r12, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r12, 0)
 	mova	.Lgot, r0
 	mov.l	.Lgot, r12
 	add	r0, r12
-	mov.l	.L3, r1
+#endif
+	tst	r8, r8		/* ucb->uc_link == NULL? */
+	bt/s	2f
+	 mov	r8, r4		/* r4 <- ucb->uc_link */
+	mov.l	.Lsetcontext, r1
+	sts.l	pr, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (pr, 0)
+#ifdef PIC
 	bsrf	r1
 .LPCS0:
 	 nop
 #else
-	mov.l	.L3, r1
 	jsr	@r1
 	 nop
 #endif
+        /* Restore to keep CFI/CFA balanced.  */
+	lds.l	@r15+, pr
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (pr)
+	/* If this returns (which can happen if the syscall fails) we'll exit
+	   the program with the return error value (-1).  */
+
 2:
-	mov.l	.L4, r1
+	mov.l	.Lexit, r1
 #ifdef PIC
 	add	r12, r1
 #endif
 	jsr	@r1
 	 mov	r0, r4
-0:
-	bra	0b
-	 nop
+	/* The 'exit' call should never return.  In case it does cause the
+	   process to terminate.  */
+	ABORT_INSTRUCTION_ASM
 
 	.align	2
 #ifdef PIC
 .Lgot:
 	.long	_GLOBAL_OFFSET_TABLE_
-.L3:
+.Lsetcontext:
 	.long	__setcontext@PLT-(.LPCS0+2-(.))
-.L4:
+.Lexit:
 	.long	HIDDEN_JUMPTARGET(exit)@GOTOFF
 #else
-.L3:
+.Lsetcontext:
 	.long	__setcontext
-.L4:
+.Lexit:
 	.long	HIDDEN_JUMPTARGET(exit)
 #endif
-	cfi_startproc
 PSEUDO_END(__makecontext)
 
 weak_alias (__makecontext, makecontext)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist Sun Jun 24 00:01:32 2012
@@ -79,6 +79,7 @@
  aligned_alloc F
  c16rtomb F
  c32rtomb F
+ fanotify_mark F
  getauxval F
  mbrtoc16 F
  mbrtoc32 F

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym Sun Jun 24 00:01:32 2012
@@ -1,0 +1,13 @@
+#include <stddef.h>
+#include <signal.h>
+
+--
+
+#define sigaltstack(member)	offsetof (stack_t, member)
+
+sizeSS				sizeof (stack_t)
+oSS_SP				sigaltstack (ss_sp)
+oSS_FLAGS			sigaltstack (ss_flags)
+oSS_SIZE			sigaltstack (ss_size)
+
+SS_ONSTACK

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/syscalls.list Sun Jun 24 00:01:32 2012
@@ -3,3 +3,5 @@
 waitpid		-	waitpid		Ci:ipi	__waitpid	waitpid	__libc_waitpid
 
 prlimit64	EXTRA	prlimit64	i:iipp	prlimit64
+
+fanotify_mark	EXTRA	fanotify_mark	i:iiiiis	__fanotify_mark	fanotify_mark@@GLIBC_2.16

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/sysdep.h Sun Jun 24 00:01:32 2012
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
-	Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@xxxxxxxxxxxxxx>, August 1995.
    Changed by Kaz Kojima, <kkojima@xxxxxxxxxxxxxx>.
@@ -100,11 +99,15 @@
 # if RTLD_PRIVATE_ERRNO
 #  define SYSCALL_ERROR_HANDLER	\
 	neg r0,r1; \
+	mov r12,r2; \
+	cfi_register (r12, r2); \
 	mov.l 0f,r12; \
 	mova 0f,r0; \
 	add r0,r12; \
 	mov.l 1f,r0; \
 	mov.l r1,@(r0,r12); \
+	mov r2,r12; \
+	cfi_restore (r12); \
 	bra .Lpseudo_end; \
 	 mov _IMM1,r0; \
 	.align 2; \
@@ -121,6 +124,7 @@
 #  define SYSCALL_ERROR_HANDLER \
 	neg r0,r1; \
 	mov r12,r2; \
+	cfi_register (r12, r2); \
 	mov.l 0f,r12; \
 	mova 0f,r0; \
 	add r0,r12; \
@@ -128,6 +132,7 @@
 	stc gbr, r4; \
 	mov.l @(r0,r12),r0; \
 	mov r2,r12; \
+	cfi_restore (r12); \
 	add r4,r0; \
 	mov.l r1,@r0; \
 	bra .Lpseudo_end; \
@@ -140,12 +145,14 @@
 #  define SYSCALL_ERROR_HANDLER						      \
 	neg r0,r1; \
 	mov r12,r2; \
+	cfi_register (r12, r2); \
 	mov.l 0f,r12; \
 	mova 0f,r0; \
 	add r0,r12; \
 	mov.l 1f,r0; \
 	mov.l @(r0,r12),r0; \
 	mov r2,r12; \
+	cfi_restore (r12); \
 	mov.l r1,@r0; \
 	bra .Lpseudo_end; \
 	 mov _IMM1,r0; \

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits