From 5043a6ad2450235873e1a14c1b0a10ba779304d1 Mon Sep 17 00:00:00 2001 From: joseph Date: Mon, 25 Jun 2012 21:30:45 +0000 Subject: Merge changes between r19234 and r19292 from /fsf/trunk. git-svn-id: svn://svn.eglibc.org/trunk@19293 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/sysdeps/gnu/configure | 8 +- libc/sysdeps/gnu/configure.in | 8 +- libc/sysdeps/i386/init-first.c | 2 +- libc/sysdeps/mach/hurd/i386/static-start.S | 4 +- libc/sysdeps/mach/start.c | 103 ------ libc/sysdeps/s390/fpu/libm-test-ulps | 358 ++++++++++++++++++++- libc/sysdeps/sh/____longjmp_chk.S | 23 +- libc/sysdeps/sh/abort-instr.h | 3 + libc/sysdeps/sh/init-first.c | 2 +- libc/sysdeps/unix/sysv/linux/sh/Makefile | 4 + libc/sysdeps/unix/sysv/linux/sh/Versions | 3 + libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S | 122 +++++++ libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h | 187 +++++------ libc/sysdeps/unix/sysv/linux/sh/makecontext.S | 83 +++-- libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist | 1 + .../unix/sysv/linux/sh/sigaltstack-offsets.sym | 13 + libc/sysdeps/unix/sysv/linux/sh/syscalls.list | 2 + libc/sysdeps/unix/sysv/linux/sh/sysdep.h | 11 +- 18 files changed, 688 insertions(+), 249 deletions(-) delete mode 100644 libc/sysdeps/mach/start.c create mode 100644 libc/sysdeps/sh/abort-instr.h create mode 100644 libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S create mode 100644 libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/gnu/configure b/libc/sysdeps/gnu/configure index 634e1d0cc..26327ca3b 100644 --- a/libc/sysdeps/gnu/configure +++ b/libc/sysdeps/gnu/configure @@ -25,12 +25,18 @@ case "$prefix" in libc_cv_slibdir=/lib ;; esac - # Allow the user to override the path with --sysconfdir + # Allow the user to override the path with --sysconfdir. if test "$sysconfdir" = '${prefix}/etc'; then libc_cv_sysconfdir=/etc else libc_cv_sysconfdir=$sysconfdir fi + # Allow the user to override the path with --localstatedir. + if test "$localstatedir" = '${prefix}/var'; then + libc_cv_localstatedir=/var + else + libc_cv_localstatedir=$localstatedir + fi libc_cv_rootsbindir=/sbin ;; esac diff --git a/libc/sysdeps/gnu/configure.in b/libc/sysdeps/gnu/configure.in index 3422007ff..b8fd74cff 100644 --- a/libc/sysdeps/gnu/configure.in +++ b/libc/sysdeps/gnu/configure.in @@ -25,12 +25,18 @@ case "$prefix" in libc_cv_slibdir=/lib ;; esac - # Allow the user to override the path with --sysconfdir + # Allow the user to override the path with --sysconfdir. if test "$sysconfdir" = '${prefix}/etc'; then libc_cv_sysconfdir=/etc else libc_cv_sysconfdir=$sysconfdir fi + # Allow the user to override the path with --localstatedir. + if test "$localstatedir" = '${prefix}/var'; then + libc_cv_localstatedir=/var + else + libc_cv_localstatedir=$localstatedir + fi libc_cv_rootsbindir=/sbin ;; esac diff --git a/libc/sysdeps/i386/init-first.c b/libc/sysdeps/i386/init-first.c index c2eaccd01..edea7f269 100644 --- a/libc/sysdeps/i386/init-first.c +++ b/libc/sysdeps/i386/init-first.c @@ -48,7 +48,7 @@ init (int *data) #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 diff --git a/libc/sysdeps/mach/hurd/i386/static-start.S b/libc/sysdeps/mach/hurd/i386/static-start.S index e30d226b2..9c9c7b0fb 100644 --- a/libc/sysdeps/mach/hurd/i386/static-start.S +++ b/libc/sysdeps/mach/hurd/i386/static-start.S @@ -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 @@ _start: jmp _start1 #define _start _start1 -#include +#include diff --git a/libc/sysdeps/mach/start.c b/libc/sysdeps/mach/start.c deleted file mode 100644 index 59e1ab6ba..000000000 --- a/libc/sysdeps/mach/start.c +++ /dev/null @@ -1,103 +0,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 - . */ - -#include -#include -#include -#include -#include - -#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; -} diff --git a/libc/sysdeps/s390/fpu/libm-test-ulps b/libc/sysdeps/s390/fpu/libm-test-ulps index 5667d1b57..ee804a7c6 100644 --- a/libc/sysdeps/s390/fpu/libm-test-ulps +++ b/libc/sysdeps/s390/fpu/libm-test-ulps @@ -1,9 +1,18 @@ # Begin of automatic generation # acos_downward +Test "acos_downward (-0) == pi/2": +float: 1 +ifloat: 1 Test "acos_downward (-0.5) == M_PI_6l*4.0": double: 1 idouble: 1 +Test "acos_downward (-1) == pi": +float: 1 +ifloat: 1 +Test "acos_downward (0) == pi/2": +float: 1 +ifloat: 1 Test "acos_downward (0.5) == M_PI_6l*2.0": double: 1 float: 1 @@ -13,9 +22,18 @@ ildouble: 1 ldouble: 1 # acos_towardzero +Test "acos_towardzero (-0) == pi/2": +float: 1 +ifloat: 1 Test "acos_towardzero (-0.5) == M_PI_6l*4.0": double: 1 idouble: 1 +Test "acos_towardzero (-1) == pi": +float: 1 +ifloat: 1 +Test "acos_towardzero (0) == pi/2": +float: 1 +ifloat: 1 Test "acos_towardzero (0.5) == M_PI_6l*2.0": double: 1 float: 1 @@ -24,6 +42,17 @@ ifloat: 1 ildouble: 1 ldouble: 1 +# acos_upward +Test "acos_upward (-0) == pi/2": +ildouble: 1 +ldouble: 1 +Test "acos_upward (-1) == pi": +ildouble: 1 +ldouble: 1 +Test "acos_upward (0) == pi/2": +ildouble: 1 +ldouble: 1 + # asin_downward Test "asin_downward (-0.5) == -pi/6": double: 1 @@ -551,6 +580,38 @@ double: 1 idouble: 1 # ccos +Test "Imaginary part of: ccos (-0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (-0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (-0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (-0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (-0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (-0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i": ildouble: 1 ldouble: 1 @@ -567,8 +628,52 @@ ifloat: 1 Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i": float: 1 ifloat: 1 +Test "Imaginary part of: ccos (0.75 + 11357.25 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0.75 + 710.5 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0.75 + 89.5 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0.75 - 11357.25 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0.75 - 710.5 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0.75 - 89.5 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccos (0x1p-1074 + 1440 i) == inf - 5.981479269486130556466515778180916082415e301 i": +double: 1 +idouble: 1 +Test "Imaginary part of: ccos (0x1p-16434 + 22730 i) == inf - 1.217853148905605987081057582351152052687e4924 i": +ildouble: 1 +ldouble: 1 # ccosh +Test "Imaginary part of: ccosh (-11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (-11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i": float: 1 ifloat: 1 @@ -579,6 +684,32 @@ float: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "Imaginary part of: ccosh (-710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (-710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (-89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (-89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": double: 1 float: 1 @@ -587,6 +718,44 @@ ifloat: 1 Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i": float: 1 ifloat: 1 +Test "Imaginary part of: ccosh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i": +double: 1 +idouble: 1 +Test "Imaginary part of: ccosh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: ccosh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 # cexp Test "Imaginary part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i": @@ -656,6 +825,9 @@ float: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "Imaginary part of: clog (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 709.8942846690411016323109979483151967689 + 0.4636476090008061606231772164674799632783 i": +double: 1 +idouble: 1 Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i": ildouble: 1 ldouble: 1 @@ -745,6 +917,9 @@ ifloat: 1 Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i": double: 1 idouble: 1 +Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 308.3031705664207720674749211936626341569 + 0.2013595981366865903254995612594728746470 i": +double: 1 +idouble: 1 Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i": ildouble: 1 ldouble: 1 @@ -981,9 +1156,9 @@ ildouble: 2 ldouble: 2 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": double: 1 -float: 4 +float: 5 idouble: 1 -ifloat: 4 +ifloat: 5 ildouble: 2 ldouble: 2 Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i": @@ -998,26 +1173,166 @@ ildouble: 1 ldouble: 1 # csin +Test "Real part of: csin (-0.75 + 11357.25 i) == -8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (-0.75 + 710.5 i) == -1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csin (-0.75 + 89.5 i) == -2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (-0.75 - 11357.25 i) == -8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (-0.75 - 710.5 i) == -1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csin (-0.75 - 89.5 i) == -2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i": +ildouble: 1 +ldouble: 1 Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i": ildouble: 1 ldouble: 1 Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i": ildouble: 1 ldouble: 1 +Test "Real part of: csin (0.75 + 11357.25 i) == 8.385498349388321535962327491346664141020e4931 + 9.001213196851067077465606717616495588201e4931 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0.75 + 710.5 i) == 1.255317763348154410745082950806112487736e308 + 1.347490911916428129246890157395342279438e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csin (0.75 + 89.5 i) == 2.522786001038096774676288412995370563339e38 + 2.708024460708609732016532185663087200560e38 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0.75 - 11357.25 i) == 8.385498349388321535962327491346664141020e4931 - 9.001213196851067077465606717616495588201e4931 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0.75 - 710.5 i) == 1.255317763348154410745082950806112487736e308 - 1.347490911916428129246890157395342279438e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csin (0.75 - 89.5 i) == 2.522786001038096774676288412995370563339e38 - 2.708024460708609732016532185663087200560e38 i": +ildouble: 1 +ldouble: 1 +Test "Real part of: csin (0x1p-1074 + 1440 i) == 5.981479269486130556466515778180916082415e301 + inf i": +double: 1 +idouble: 1 +Test "Real part of: csin (0x1p-16434 + 22730 i) == 1.217853148905605987081057582351152052687e4924 + inf i": +ildouble: 1 +ldouble: 1 # csinh +Test "Imaginary part of: csinh (-11357.25 + 0.75 i) == -9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (-11357.25 - 0.75 i) == -9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": ildouble: 1 ldouble: 1 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i": double: 1 idouble: 1 +Test "Imaginary part of: csinh (-710.5 + 0.75 i) == -1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (-710.5 - 0.75 i) == -1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (-89.5 + 0.75 i) == -2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (-89.5 - 0.75 i) == -2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i": float: 1 ifloat: 1 +Test "Imaginary part of: csinh (11357.25 + 0.75 i) == 9.001213196851067077465606717616495588201e4931 + 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (11357.25 - 0.75 i) == 9.001213196851067077465606717616495588201e4931 - 8.385498349388321535962327491346664141020e4931 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (1440 + 0x1p-1074 i) == inf + 5.981479269486130556466515778180916082415e301 i": +double: 1 +idouble: 1 +Test "Imaginary part of: csinh (22730 + 0x1p-16434 i) == inf + 1.217853148905605987081057582351152052687e4924 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (710.5 + 0.75 i) == 1.347490911916428129246890157395342279438e308 + 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (710.5 - 0.75 i) == 1.347490911916428129246890157395342279438e308 - 1.255317763348154410745082950806112487736e308 i": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (89.5 + 0.75 i) == 2.708024460708609732016532185663087200560e38 + 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "Real part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +ildouble: 1 +ldouble: 1 +Test "Imaginary part of: csinh (89.5 - 0.75 i) == 2.708024460708609732016532185663087200560e38 - 2.522786001038096774676288412995370563339e38 i": +float: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 # csqrt Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i": @@ -1223,6 +1538,14 @@ idouble: 1 Test "exp10 (-1) == 0.1": double: 2 idouble: 2 +Test "exp10 (-305) == 1.0e-305": +double: 1 +idouble: 1 +Test "exp10 (-36) == 1.0e-36": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 Test "exp10 (0.75) == 5.62341325190349080394951039776481231": double: 1 idouble: 1 @@ -1231,6 +1554,12 @@ double: 6 idouble: 6 ildouble: 1 ldouble: 1 +Test "exp10 (36) == 1.0e36": +double: 1 +idouble: 1 +Test "exp10 (4932) == 1.0e4932": +ildouble: 1 +ldouble: 1 # exp2 Test "exp2 (100.5) == 1.792728671193156477399422023278661496394e+30": @@ -1279,6 +1608,9 @@ idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 +Test "expm1 (500.0) == 1.4035922178528374107397703328409120821806e+217": +double: 1 +idouble: 1 # gamma Test "gamma (-0.5) == log(2*sqrt(pi))": @@ -2094,6 +2426,10 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: "acos_upward": +ildouble: 1 +ldouble: 1 + Function: "asin_downward": double: 1 float: 1 @@ -2217,7 +2553,9 @@ ildouble: 1 ldouble: 1 Function: Imaginary part of "ccos": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -2231,7 +2569,9 @@ ildouble: 1 ldouble: 1 Function: Imaginary part of "ccosh": +double: 1 float: 1 +idouble: 1 ifloat: 1 ildouble: 1 ldouble: 1 @@ -2260,6 +2600,10 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: Imaginary part of "clog": +double: 1 +idouble: 1 + Function: Real part of "clog10": double: 1 float: 1 @@ -2328,9 +2672,9 @@ ldouble: 1 Function: Real part of "cpow": double: 2 -float: 4 +float: 5 idouble: 2 -ifloat: 4 +ifloat: 5 ildouble: 11 ldouble: 11 @@ -2343,6 +2687,10 @@ ildouble: 1 ldouble: 1 Function: Real part of "csin": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -2361,6 +2709,8 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: Real part of "csqrt": double: 1 diff --git a/libc/sysdeps/sh/____longjmp_chk.S b/libc/sysdeps/sh/____longjmp_chk.S index 5d17f3ae7..b37a94861 100644 --- a/libc/sysdeps/sh/____longjmp_chk.S +++ b/libc/sysdeps/sh/____longjmp_chk.S @@ -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 @@ longjmp_msg: # 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 @@ longjmp_msg: .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) \ diff --git a/libc/sysdeps/sh/abort-instr.h b/libc/sysdeps/sh/abort-instr.h new file mode 100644 index 000000000..69381aec8 --- /dev/null +++ b/libc/sysdeps/sh/abort-instr.h @@ -0,0 +1,3 @@ +/* An instruction which should crash any program is `sleep'. */ +#define ABORT_INSTRUCTION_ASM sleep +#define ABORT_INSTRUCTION asm ("sleep") diff --git a/libc/sysdeps/sh/init-first.c b/libc/sysdeps/sh/init-first.c index c2e45e428..f298724c1 100644 --- a/libc/sysdeps/sh/init-first.c +++ b/libc/sysdeps/sh/init-first.c @@ -48,7 +48,7 @@ init (int *data) #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 diff --git a/libc/sysdeps/unix/sysv/linux/sh/Makefile b/libc/sysdeps/unix/sysv/linux/sh/Makefile index 1ead8f2ae..dd3b382ac 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/Makefile +++ b/libc/sysdeps/unix/sysv/linux/sh/Makefile @@ -6,6 +6,10 @@ ifeq ($(subdir),stdlib) 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 diff --git a/libc/sysdeps/unix/sysv/linux/sh/Versions b/libc/sysdeps/unix/sysv/linux/sh/Versions index 9fb83456f..ca1d7da33 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/Versions +++ b/libc/sysdeps/unix/sysv/linux/sh/Versions @@ -28,4 +28,7 @@ libc { GLIBC_2.11 { fallocate64; } + GLIBC_2.16 { + fanotify_mark; + } } diff --git a/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S new file mode 100644 index 000000000..d74caa21b --- /dev/null +++ b/libc/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S @@ -0,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 + . */ + +#include + +#include + + .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> diff --git a/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h b/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h index c8f07e55a..05e492202 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h +++ b/libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h @@ -1,5 +1,5 @@ /* Atomic operations used inside libc. Linux/SH version. - Copyright (C) 2003, 2011 Free Software Foundation, Inc. + Copyright (C) 2003-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 @@ -73,11 +73,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ ({ __typeof (*(mem)) __result; \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ + .align 2\n\ mov r15,r1\n\ - mov #-8,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%1,%0\n\ cmp/eq %0,%3\n\ bf 1f\n\ @@ -90,10 +89,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ ({ __typeof (*(mem)) __result; \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ mov r15,r1\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ mov #-8,r15\n\ 0: mov.w @%1,%0\n\ cmp/eq %0,%3\n\ @@ -107,11 +106,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ __typeof (*(mem)) __result; \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ + .align 2\n\ mov r15,r1\n\ - mov #-8,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%1,%0\n\ cmp/eq %0,%3\n\ bf 1f\n\ @@ -133,40 +131,43 @@ typedef uintmax_t uatomic_max_t; ({ __typeof (*(mem)) __result, __tmp, __value = (value); \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ + .align 2\n\ mov r15,r1\n\ - mov #-6,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%2,%0\n\ - add %0,%1\n\ - mov.b %1,@%2\n\ + mov %1,r2\n\ + add %0,r2\n\ + mov.b r2,@%2\n\ 1: mov r1,r15"\ : "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ - : "r0", "r1", "memory"); \ + : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ + .align 2\n\ mov r15,r1\n\ - mov #-6,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%2,%0\n\ - add %0,%1\n\ - mov.w %1,@%2\n\ + mov %1,r2\n\ + add %0,r2\n\ + mov.w r2,@%2\n\ 1: mov r1,r15"\ : "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ - : "r0", "r1", "memory"); \ + : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ + .align 2\n\ mov r15,r1\n\ - mov #-6,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%2,%0\n\ - add %0,%1\n\ - mov.l %1,@%2\n\ + mov %1,r2\n\ + add %0,r2\n\ + mov.l r2,@%2\n\ 1: mov r1,r15"\ : "=&r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ - : "r0", "r1", "memory"); \ + : "r0", "r1", "r2", "memory"); \ else \ { \ __typeof (mem) memp = (mem); \ @@ -182,37 +183,37 @@ typedef uintmax_t uatomic_max_t; (void) ({ __typeof (*(mem)) __tmp, __value = (value); \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%1,r2\n\ - add r2,%0\n\ - mov.b %0,@%1\n\ + add %0,r2\n\ + mov.b r2,@%1\n\ 1: mov r1,r15"\ : "=&r" (__tmp) : rNOSP (mem), "0" (__value) \ : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%1,r2\n\ - add r2,%0\n\ - mov.w %0,@%1\n\ + add %0,r2\n\ + mov.w r2,@%1\n\ 1: mov r1,r15"\ : "=&r" (__tmp) : rNOSP (mem), "0" (__value) \ : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%1,r2\n\ - add r2,%0\n\ - mov.l %0,@%1\n\ + add %0,r2\n\ + mov.l r2,@%1\n\ 1: mov r1,r15"\ : "=&r" (__tmp) : rNOSP (mem), "0" (__value) \ : "r0", "r1", "r2", "memory"); \ @@ -233,43 +234,43 @@ typedef uintmax_t uatomic_max_t; __typeof (*(mem)) __tmp, __value = (value); \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%2,r2\n\ - add r2,%1\n\ - mov.b %1,@%2\n\ + add %1,r2\n\ + mov.b r2,@%2\n\ 1: mov r1,r15\n\ - shal %1\n\ + shal r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%2,r2\n\ - add r2,%1\n\ - mov.w %1,@%2\n\ + add %1,r2\n\ + mov.w r2,@%2\n\ 1: mov r1,r15\n\ - shal %1\n\ + shal r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%2,r2\n\ - add r2,%1\n\ - mov.l %1,@%2\n\ + add %1,r2\n\ + mov.l r2,@%2\n\ 1: mov r1,r15\n\ - shal %1\n\ + shal r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ @@ -282,43 +283,43 @@ typedef uintmax_t uatomic_max_t; __typeof (*(mem)) __tmp, __value = (value); \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%2,r2\n\ - add r2,%1\n\ - mov.b %1,@%2\n\ + add %1,r2\n\ + mov.b r2,@%2\n\ 1: mov r1,r15\n\ - tst %1,%1\n\ + tst r2,r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%2,r2\n\ - add r2,%1\n\ - mov.w %1,@%2\n\ + add %1,r2\n\ + mov.w r2,@%2\n\ 1: mov r1,r15\n\ - tst %1,%1\n\ + tst r2,r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%2,r2\n\ - add r2,%1\n\ - mov.l %1,@%2\n\ + add %1,r2\n\ + mov.l r2,@%2\n\ 1: mov r1,r15\n\ - tst %1,%1\n\ + tst r2,r2\n\ movt %0"\ : "=r" (__result), "=&r" (__tmp) : rNOSP (mem), "1" (__value) \ : "r0", "r1", "r2", "t", "memory"); \ @@ -333,10 +334,10 @@ typedef uintmax_t uatomic_max_t; (void) ({ unsigned int __mask = 1 << (bit); \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%0,r2\n\ or %1,r2\n\ mov.b r2,@%0\n\ @@ -345,10 +346,10 @@ typedef uintmax_t uatomic_max_t; : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%0,r2\n\ or %1,r2\n\ mov.w r2,@%0\n\ @@ -357,10 +358,10 @@ typedef uintmax_t uatomic_max_t; : "r0", "r1", "r2", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ mov r15,r1\n\ - mov #-6,r15\n\ + .align 2\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%0,r2\n\ or %1,r2\n\ mov.l r2,@%0\n\ @@ -376,49 +377,49 @@ typedef uintmax_t uatomic_max_t; unsigned int __result = __mask; \ if (sizeof (*(mem)) == 1) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ + .align 2\n\ mov r15,r1\n\ - mov #-8,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.b @%2,r2\n\ - or r2,%1\n\ - and r2,%0\n\ - mov.b %1,@%2\n\ - 1: mov r1,r15"\ + mov r2,r3\n\ + or %1,r2\n\ + mov.b r2,@%2\n\ + 1: mov r1,r15\n\ + and r3,%0"\ : "=&r" (__result), "=&r" (__mask) \ : rNOSP (mem), "0" (__result), "1" (__mask) \ - : "r0", "r1", "r2", "memory"); \ + : "r0", "r1", "r2", "r3", "memory"); \ else if (sizeof (*(mem)) == 2) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ + .align 2\n\ mov r15,r1\n\ - mov #-8,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.w @%2,r2\n\ - or r2,%1\n\ - and r2,%0\n\ + mov r2,r3\n\ + or %1,r2\n\ mov.w %1,@%2\n\ - 1: mov r1,r15"\ + 1: mov r1,r15\n\ + and r3,%0"\ : "=&r" (__result), "=&r" (__mask) \ : rNOSP (mem), "0" (__result), "1" (__mask) \ - : "r0", "r1", "r2", "memory"); \ + : "r0", "r1", "r2", "r3", "memory"); \ else if (sizeof (*(mem)) == 4) \ __asm __volatile ("\ - .align 2\n\ mova 1f,r0\n\ - nop\n\ + .align 2\n\ mov r15,r1\n\ - mov #-8,r15\n\ + mov #(0f-1f),r15\n\ 0: mov.l @%2,r2\n\ + mov r2,r3\n\ or r2,%1\n\ - and r2,%0\n\ mov.l %1,@%2\n\ - 1: mov r1,r15"\ + 1: mov r1,r15\n\ + and r3,%0"\ : "=&r" (__result), "=&r" (__mask) \ : rNOSP (mem), "0" (__result), "1" (__mask) \ - : "r0", "r1", "r2", "memory"); \ + : "r0", "r1", "r2", "r3", "memory"); \ else \ abort (); \ __result; }) diff --git a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S index 0a9e07954..a04bc9f63 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/makecontext.S +++ b/libc/sysdeps/unix/sysv/linux/sh/makecontext.S @@ -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 @@ . */ #include +#include #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 @@ ENTRY(__makecontext) #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 @@ ENTRY(__makecontext) 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) diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist index 7c1425f89..c474f415c 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist +++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist @@ -79,6 +79,7 @@ GLIBC_2.16 aligned_alloc F c16rtomb F c32rtomb F + fanotify_mark F getauxval F mbrtoc16 F mbrtoc32 F diff --git a/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym b/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym new file mode 100644 index 000000000..f73446941 --- /dev/null +++ b/libc/sysdeps/unix/sysv/linux/sh/sigaltstack-offsets.sym @@ -0,0 +1,13 @@ +#include +#include + +-- + +#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 diff --git a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list index be9ffed22..faffe377e 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/syscalls.list +++ b/libc/sysdeps/unix/sysv/linux/sh/syscalls.list @@ -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 diff --git a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h index 5215a845d..ce72c66a7 100644 --- a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h +++ b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -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, , August 1995. Changed by Kaz Kojima, . @@ -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; \ -- cgit v1.2.3