From d38cd08ca397c59fc98dba8c4d0b4bd96c899c9e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 30 Dec 1996 01:47:46 +0000 Subject: update from main archive 961229 Mon Dec 30 01:32:59 1996 Ulrich Drepper * tme/localtime.c: Rewrite so that localtime_r does not call tzset, but localtime does. * features.h: Rename ANSI C to ISO C. Mention __GLIBC__ and __GLIBC_MINOR__ macros. * gnu-versions.h: Add _GNU_GETOPT_INTERFACE_VERSION. * posix/getopt.c: Use _GNU_GETOPT_INTERFACE_VERSION to check whether we can elide the code. * posix/getopt1.c: Likewise. * posix/Makefile: Correct copyright. * elf/dl-error.c (_dl_catch_error): Clear `catch' also when error occurred. * elf/dl-support.c (_dl_sysdep_open_zero_fill): Don't define if MAP_ANON is defined. * elf/eval.c: Use __getline instead of getline. * elf/rtld.c (dl_main): Check return value of _dl_new_object function for NULL. * sysdeps/generic/dl-cache.c: Update copyright. * signal/Makefile: Correct copyright. (routines): Remove gsignal and ssignal. Add bsd_signal. * signal/gsignal.c: Removed. Now is made an alias. * signal/ssignal.c: Likewise. * sysdeps/posix/raise.c: Add alias gsignal. * sysdeps/stub/raise.c: Likewise. * sysdeps/posix/signal.c: Add alias ssignal. * sysdeps/stub/signal.c: Likewise. * signal/signal.h: Declare bsd_signal. Define signal as bsd_signal if __FAVOR_BSD. * sysdeps/posix/bsd_signal.c: New file. Implementation of XPG function. * sysdeps/unix/sysv/linux/signal.c: Add explanation. * socket/sys/un.h: Define SUN_LEN according to POSIX.1g. * stdio-common/Makefile (tests): Add scanf10. * stdio-common/scanf10.c: New file. * stdio-common/vfscanf.c: Decrement counter if EOF is read while reading string. * sysdeps/libm-i387/e_acos.S: Use END, not PSEUDO_END. * sysdeps/libm-i387/e_acosl.S: Likewise. * sysdeps/libm-i387/e_asin.S: Likewise. * sysdeps/libm-i387/e_asinl.S: Likewise. * sysdeps/libm-i387/e_atan2.S: Likewise. * sysdeps/libm-i387/e_atan2f.S: Likewise. * sysdeps/libm-i387/e_atan2l.S: Likewise. * sysdeps/libm-i387/e_exp.S: Likewise. * sysdeps/libm-i387/e_expl.S: Likewise. * sysdeps/libm-i387/e_fmod.S: Likewise. * sysdeps/libm-i387/e_fmodl.S: Likewise. * sysdeps/libm-i387/e_log.S: Likewise. * sysdeps/libm-i387/e_log10.S: Likewise. * sysdeps/libm-i387/e_log10l.S: Likewise. * sysdeps/libm-i387/e_logl.S: Likewise. * sysdeps/libm-i387/e_remainder.S: Likewise. * sysdeps/libm-i387/e_remainderf.S: Likewise. * sysdeps/libm-i387/e_remainderl.S: Likewise. * sysdeps/libm-i387/e_scalb.S: Likewise. * sysdeps/libm-i387/e_scalbl.S: Likewise. * sysdeps/libm-i387/e_sqrt.S: Likewise. * sysdeps/libm-i387/e_sqrtf.S: Likewise. * sysdeps/libm-i387/e_sqrtl.S: Likewise. * sysdeps/libm-i387/s_atan.S: Likewise. * sysdeps/libm-i387/s_atanf.S: Likewise. * sysdeps/libm-i387/s_atanl.S: Likewise. * sysdeps/libm-i387/s_ceil.S: Likewise. * sysdeps/libm-i387/s_ceilf.S: Likewise. * sysdeps/libm-i387/s_ceill.S: Likewise. * sysdeps/libm-i387/s_copysign.S: Likewise. * sysdeps/libm-i387/s_copysignf.S: Likewise. * sysdeps/libm-i387/s_copysignl.S: Likewise. * sysdeps/libm-i387/s_cos.S: Likewise. * sysdeps/libm-i387/s_cosf.S: Likewise. * sysdeps/libm-i387/s_cosl.S: Likewise. * sysdeps/libm-i387/s_finite.S: Likewise. * sysdeps/libm-i387/s_finitef.S: Likewise. * sysdeps/libm-i387/s_finitel.S: Likewise. * sysdeps/libm-i387/s_floor.S: Likewise. * sysdeps/libm-i387/s_floorf.S: Likewise. * sysdeps/libm-i387/s_floorl.S: Likewise. * sysdeps/libm-i387/s_ilogb.S: Likewise. * sysdeps/libm-i387/s_ilogbf.S: Likewise. * sysdeps/libm-i387/s_ilogbl.S: Likewise. * sysdeps/libm-i387/s_log1p.S: Likewise. * sysdeps/libm-i387/s_log1pf.S: Likewise. * sysdeps/libm-i387/s_log1pl.S: Likewise. * sysdeps/libm-i387/s_logb.S: Likewise. * sysdeps/libm-i387/s_logbf.S: Likewise. * sysdeps/libm-i387/s_logbl.S: Likewise. * sysdeps/libm-i387/s_rint.S: Likewise. * sysdeps/libm-i387/s_rintf.S: Likewise. * sysdeps/libm-i387/s_rintl.S: Likewise. * sysdeps/libm-i387/s_scalbn.S: Likewise. * sysdeps/libm-i387/s_scalbnf.S: Likewise. * sysdeps/libm-i387/s_scalbnl.S: Likewise. * sysdeps/libm-i387/s_significand.S: Likewise. * sysdeps/libm-i387/s_significandf.S: Likewise. * sysdeps/libm-i387/s_significandl.S: Likewise. * sysdeps/libm-i387/s_sin.S: Likewise. * sysdeps/libm-i387/s_sinf.S: Likewise. * sysdeps/libm-i387/s_sinl.S: Likewise. * sysdeps/libm-i387/e_log.S: Use fyl2xp1 instruction for values near 1 to increase precision. * sysdeps/libm-i387/e_log10.S: Likewise. * sysdeps/libm-i387/e_log10l.S: Likewise. * sysdeps/libm-i387/e_logl.S: Likewise. * sysdeps/libm-i387/s_cos.S: Use testl instead of andw. * sysdeps/libm-i387/s_cosl.S: Likewise. * sysdeps/libm-i387/s_sin.S: Likewise. * sysdeps/libm-i387/s_sinl.S: Likewise. * sysdeps/libm-i387/s_tan.S: Likewise. * sysdeps/libm-i387/s_tanl.S: Likewise. * sysdeps/libm-i387/e_acosf.S: New file. Add float versions. * sysdeps/libm-i387/e_asinf.S: Likewise. * sysdeps/libm-i387/e_expf.S: Likewise. * sysdeps/libm-i387/e_fmodf.S: Likewise. * sysdeps/libm-i387/e_log10f.S: Likewise. * sysdeps/libm-i387/e_logf.S: Likewise. * sysdeps/libm-i387/e_scalbf.S: Likewise. * sysdeps/libm-i387/e_acosh.S: New file. Highly optimized versions. * sysdeps/libm-i387/e_acoshf.S: Likewise. * sysdeps/libm-i387/e_acoshl.S: Likewise. * sysdeps/libm-i387/e_atanh.S: Likewise. * sysdeps/libm-i387/e_atanhf.S: Likewise. * sysdeps/libm-i387/e_atanhl.S: Likewise. * sysdeps/libm-i387/e_asinh.S: Likewise. * sysdeps/libm-i387/e_asinhf.S: Likewise. * sysdeps/libm-i387/e_asinhl.S: Likewise. * sysdeps/libm-ieee754/s_asinhf.c: Tweak a bit. Use lower levels for simplified handling. * sysdeps/unix/sysv/linux/syscalls.list: Add query_module. Sun Dec 22 01:39:29 1996 Andreas Schwab * inet/rcmd.c (rcmd): Set h_errno before calling herror. * inet/rexec.c (rexec): Likewise. Sat Dec 21 21:47:08 1996 Andreas Schwab * sysdeps/unix/sysv/linux/m68k/setjmp.c (__setjmp): Make it really compatible. Sun Dec 22 03:23:33 1996 Ulrich Drepper * sysdeps/libm-i387/s_log1p.S: Use fyl2xp1 for numbers in range -0.29 <= x <= 0.29, otherwise the old method. * sysdeps/libm-i387/s_log1pf.S: Likewise. * sysdeps/libm-i387/s_log1pl.S: Likewise. --- ChangeLog | 161 ++++++++++++++++++++++++++++++++++ elf/dl-error.c | 1 + elf/dl-support.c | 2 + elf/eval.c | 2 +- elf/rtld.c | 2 + features.h | 51 +++++------ gnu-versions.h | 2 + inet/rcmd.c | 3 +- inet/rexec.c | 1 + libio/iovsprintf.c | 1 - posix/Makefile | 6 +- posix/getopt.c | 37 ++++++-- posix/getopt1.c | 44 ++++++---- signal/Makefile | 8 +- signal/gsignal.c | 28 ------ signal/signal.h | 54 +++++++----- signal/ssignal.c | 29 ------ socket/sys/un.h | 7 ++ stdio-common/Makefile | 2 +- stdio-common/scanf10.c | 15 ++++ stdio-common/vfscanf.c | 8 +- sysdeps/generic/dl-cache.c | 28 +++--- sysdeps/libm-i387/e_acos.S | 2 +- sysdeps/libm-i387/e_acosf.S | 22 +++++ sysdeps/libm-i387/e_acosh.S | 105 ++++++++++++++++++++++ sysdeps/libm-i387/e_acoshf.S | 105 ++++++++++++++++++++++ sysdeps/libm-i387/e_acoshl.S | 111 +++++++++++++++++++++++ sysdeps/libm-i387/e_acosl.S | 2 +- sysdeps/libm-i387/e_asin.S | 2 +- sysdeps/libm-i387/e_asinf.S | 21 +++++ sysdeps/libm-i387/e_asinl.S | 2 +- sysdeps/libm-i387/e_atan2.S | 2 +- sysdeps/libm-i387/e_atan2f.S | 2 +- sysdeps/libm-i387/e_atan2l.S | 2 +- sysdeps/libm-i387/e_atanh.S | 101 +++++++++++++++++++++ sysdeps/libm-i387/e_atanhf.S | 102 +++++++++++++++++++++ sysdeps/libm-i387/e_atanhl.S | 108 +++++++++++++++++++++++ sysdeps/libm-i387/e_exp.S | 2 +- sysdeps/libm-i387/e_expf.S | 42 +++++++++ sysdeps/libm-i387/e_expl.S | 2 +- sysdeps/libm-i387/e_fmod.S | 2 +- sysdeps/libm-i387/e_fmodf.S | 20 +++++ sysdeps/libm-i387/e_fmodl.S | 2 +- sysdeps/libm-i387/e_log.S | 52 ++++++++++- sysdeps/libm-i387/e_log10.S | 52 ++++++++++- sysdeps/libm-i387/e_log10f.S | 60 +++++++++++++ sysdeps/libm-i387/e_log10l.S | 52 ++++++++++- sysdeps/libm-i387/e_logf.S | 60 +++++++++++++ sysdeps/libm-i387/e_logl.S | 51 ++++++++++- sysdeps/libm-i387/e_remainder.S | 2 +- sysdeps/libm-i387/e_remainderf.S | 2 +- sysdeps/libm-i387/e_remainderl.S | 2 +- sysdeps/libm-i387/e_scalb.S | 2 +- sysdeps/libm-i387/e_scalbf.S | 16 ++++ sysdeps/libm-i387/e_scalbl.S | 2 +- sysdeps/libm-i387/e_sqrt.S | 2 +- sysdeps/libm-i387/e_sqrtf.S | 2 +- sysdeps/libm-i387/e_sqrtl.S | 2 +- sysdeps/libm-i387/s_asinh.S | 132 ++++++++++++++++++++++++++++ sysdeps/libm-i387/s_asinhf.S | 132 ++++++++++++++++++++++++++++ sysdeps/libm-i387/s_asinhl.S | 140 +++++++++++++++++++++++++++++ sysdeps/libm-i387/s_atan.S | 2 +- sysdeps/libm-i387/s_atanf.S | 2 +- sysdeps/libm-i387/s_atanl.S | 2 +- sysdeps/libm-i387/s_ceil.S | 2 +- sysdeps/libm-i387/s_ceilf.S | 2 +- sysdeps/libm-i387/s_ceill.S | 2 +- sysdeps/libm-i387/s_copysign.S | 2 +- sysdeps/libm-i387/s_copysignf.S | 2 +- sysdeps/libm-i387/s_copysignl.S | 2 +- sysdeps/libm-i387/s_cos.S | 6 +- sysdeps/libm-i387/s_cosf.S | 2 +- sysdeps/libm-i387/s_cosl.S | 6 +- sysdeps/libm-i387/s_finite.S | 2 +- sysdeps/libm-i387/s_finitef.S | 2 +- sysdeps/libm-i387/s_finitel.S | 2 +- sysdeps/libm-i387/s_floor.S | 2 +- sysdeps/libm-i387/s_floorf.S | 2 +- sysdeps/libm-i387/s_floorl.S | 2 +- sysdeps/libm-i387/s_ilogb.S | 2 +- sysdeps/libm-i387/s_ilogbf.S | 2 +- sysdeps/libm-i387/s_ilogbl.S | 2 +- sysdeps/libm-i387/s_log1p.S | 54 ++++++++++-- sysdeps/libm-i387/s_log1pf.S | 54 ++++++++++-- sysdeps/libm-i387/s_log1pl.S | 60 +++++++++++-- sysdeps/libm-i387/s_logb.S | 2 +- sysdeps/libm-i387/s_logbf.S | 2 +- sysdeps/libm-i387/s_logbl.S | 2 +- sysdeps/libm-i387/s_rint.S | 2 +- sysdeps/libm-i387/s_rintf.S | 2 +- sysdeps/libm-i387/s_rintl.S | 2 +- sysdeps/libm-i387/s_scalbn.S | 2 +- sysdeps/libm-i387/s_scalbnf.S | 2 +- sysdeps/libm-i387/s_scalbnl.S | 2 +- sysdeps/libm-i387/s_significand.S | 2 +- sysdeps/libm-i387/s_significandf.S | 2 +- sysdeps/libm-i387/s_significandl.S | 2 +- sysdeps/libm-i387/s_sin.S | 6 +- sysdeps/libm-i387/s_sinf.S | 2 +- sysdeps/libm-i387/s_sinl.S | 6 +- sysdeps/libm-i387/s_tan.S | 6 +- sysdeps/libm-i387/s_tanf.S | 2 +- sysdeps/libm-i387/s_tanl.S | 6 +- sysdeps/libm-ieee754/s_asinhf.c | 20 ++--- sysdeps/posix/bsd_signal.c | 50 +++++++++++ sysdeps/posix/raise.c | 35 ++++---- sysdeps/posix/signal.c | 7 +- sysdeps/stub/raise.c | 29 +++--- sysdeps/stub/signal.c | 28 +++--- sysdeps/unix/sysv/linux/m68k/setjmp.c | 4 +- sysdeps/unix/sysv/linux/signal.c | 2 + sysdeps/unix/sysv/linux/syscalls.list | 1 + time/localtime.c | 78 ++++++++++------ 113 files changed, 2188 insertions(+), 350 deletions(-) delete mode 100644 signal/gsignal.c delete mode 100644 signal/ssignal.c create mode 100644 stdio-common/scanf10.c create mode 100644 sysdeps/libm-i387/e_acosf.S create mode 100644 sysdeps/libm-i387/e_acosh.S create mode 100644 sysdeps/libm-i387/e_acoshf.S create mode 100644 sysdeps/libm-i387/e_acoshl.S create mode 100644 sysdeps/libm-i387/e_asinf.S create mode 100644 sysdeps/libm-i387/e_atanh.S create mode 100644 sysdeps/libm-i387/e_atanhf.S create mode 100644 sysdeps/libm-i387/e_atanhl.S create mode 100644 sysdeps/libm-i387/e_expf.S create mode 100644 sysdeps/libm-i387/e_fmodf.S create mode 100644 sysdeps/libm-i387/e_log10f.S create mode 100644 sysdeps/libm-i387/e_logf.S create mode 100644 sysdeps/libm-i387/e_scalbf.S create mode 100644 sysdeps/libm-i387/s_asinh.S create mode 100644 sysdeps/libm-i387/s_asinhf.S create mode 100644 sysdeps/libm-i387/s_asinhl.S create mode 100644 sysdeps/posix/bsd_signal.c diff --git a/ChangeLog b/ChangeLog index 06aa40388f..03f06b09a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,164 @@ +Mon Dec 30 01:32:59 1996 Ulrich Drepper + + * tme/localtime.c: Rewrite so that localtime_r does not call tzset, + but localtime does. + + * features.h: Rename ANSI C to ISO C. + Mention __GLIBC__ and __GLIBC_MINOR__ macros. + + * gnu-versions.h: Add _GNU_GETOPT_INTERFACE_VERSION. + * posix/getopt.c: Use _GNU_GETOPT_INTERFACE_VERSION to check + whether we can elide the code. + * posix/getopt1.c: Likewise. + * posix/Makefile: Correct copyright. + + * elf/dl-error.c (_dl_catch_error): Clear `catch' also when error + occurred. + * elf/dl-support.c (_dl_sysdep_open_zero_fill): Don't define if + MAP_ANON is defined. + * elf/eval.c: Use __getline instead of getline. + * elf/rtld.c (dl_main): Check return value of _dl_new_object + function for NULL. + * sysdeps/generic/dl-cache.c: Update copyright. + + * signal/Makefile: Correct copyright. + (routines): Remove gsignal and ssignal. Add bsd_signal. + * signal/gsignal.c: Removed. Now is made an alias. + * signal/ssignal.c: Likewise. + * sysdeps/posix/raise.c: Add alias gsignal. + * sysdeps/stub/raise.c: Likewise. + * sysdeps/posix/signal.c: Add alias ssignal. + * sysdeps/stub/signal.c: Likewise. + * signal/signal.h: Declare bsd_signal. Define signal as bsd_signal + if __FAVOR_BSD. + * sysdeps/posix/bsd_signal.c: New file. Implementation of XPG + function. + + * sysdeps/unix/sysv/linux/signal.c: Add explanation. + + * socket/sys/un.h: Define SUN_LEN according to POSIX.1g. + + * stdio-common/Makefile (tests): Add scanf10. + * stdio-common/scanf10.c: New file. + * stdio-common/vfscanf.c: Decrement counter if EOF is read while + reading string. + + * sysdeps/libm-i387/e_acos.S: Use END, not PSEUDO_END. + * sysdeps/libm-i387/e_acosl.S: Likewise. + * sysdeps/libm-i387/e_asin.S: Likewise. + * sysdeps/libm-i387/e_asinl.S: Likewise. + * sysdeps/libm-i387/e_atan2.S: Likewise. + * sysdeps/libm-i387/e_atan2f.S: Likewise. + * sysdeps/libm-i387/e_atan2l.S: Likewise. + * sysdeps/libm-i387/e_exp.S: Likewise. + * sysdeps/libm-i387/e_expl.S: Likewise. + * sysdeps/libm-i387/e_fmod.S: Likewise. + * sysdeps/libm-i387/e_fmodl.S: Likewise. + * sysdeps/libm-i387/e_log.S: Likewise. + * sysdeps/libm-i387/e_log10.S: Likewise. + * sysdeps/libm-i387/e_log10l.S: Likewise. + * sysdeps/libm-i387/e_logl.S: Likewise. + * sysdeps/libm-i387/e_remainder.S: Likewise. + * sysdeps/libm-i387/e_remainderf.S: Likewise. + * sysdeps/libm-i387/e_remainderl.S: Likewise. + * sysdeps/libm-i387/e_scalb.S: Likewise. + * sysdeps/libm-i387/e_scalbl.S: Likewise. + * sysdeps/libm-i387/e_sqrt.S: Likewise. + * sysdeps/libm-i387/e_sqrtf.S: Likewise. + * sysdeps/libm-i387/e_sqrtl.S: Likewise. + * sysdeps/libm-i387/s_atan.S: Likewise. + * sysdeps/libm-i387/s_atanf.S: Likewise. + * sysdeps/libm-i387/s_atanl.S: Likewise. + * sysdeps/libm-i387/s_ceil.S: Likewise. + * sysdeps/libm-i387/s_ceilf.S: Likewise. + * sysdeps/libm-i387/s_ceill.S: Likewise. + * sysdeps/libm-i387/s_copysign.S: Likewise. + * sysdeps/libm-i387/s_copysignf.S: Likewise. + * sysdeps/libm-i387/s_copysignl.S: Likewise. + * sysdeps/libm-i387/s_cos.S: Likewise. + * sysdeps/libm-i387/s_cosf.S: Likewise. + * sysdeps/libm-i387/s_cosl.S: Likewise. + * sysdeps/libm-i387/s_finite.S: Likewise. + * sysdeps/libm-i387/s_finitef.S: Likewise. + * sysdeps/libm-i387/s_finitel.S: Likewise. + * sysdeps/libm-i387/s_floor.S: Likewise. + * sysdeps/libm-i387/s_floorf.S: Likewise. + * sysdeps/libm-i387/s_floorl.S: Likewise. + * sysdeps/libm-i387/s_ilogb.S: Likewise. + * sysdeps/libm-i387/s_ilogbf.S: Likewise. + * sysdeps/libm-i387/s_ilogbl.S: Likewise. + * sysdeps/libm-i387/s_log1p.S: Likewise. + * sysdeps/libm-i387/s_log1pf.S: Likewise. + * sysdeps/libm-i387/s_log1pl.S: Likewise. + * sysdeps/libm-i387/s_logb.S: Likewise. + * sysdeps/libm-i387/s_logbf.S: Likewise. + * sysdeps/libm-i387/s_logbl.S: Likewise. + * sysdeps/libm-i387/s_rint.S: Likewise. + * sysdeps/libm-i387/s_rintf.S: Likewise. + * sysdeps/libm-i387/s_rintl.S: Likewise. + * sysdeps/libm-i387/s_scalbn.S: Likewise. + * sysdeps/libm-i387/s_scalbnf.S: Likewise. + * sysdeps/libm-i387/s_scalbnl.S: Likewise. + * sysdeps/libm-i387/s_significand.S: Likewise. + * sysdeps/libm-i387/s_significandf.S: Likewise. + * sysdeps/libm-i387/s_significandl.S: Likewise. + * sysdeps/libm-i387/s_sin.S: Likewise. + * sysdeps/libm-i387/s_sinf.S: Likewise. + * sysdeps/libm-i387/s_sinl.S: Likewise. + + * sysdeps/libm-i387/e_log.S: Use fyl2xp1 instruction for values + near 1 to increase precision. + * sysdeps/libm-i387/e_log10.S: Likewise. + * sysdeps/libm-i387/e_log10l.S: Likewise. + * sysdeps/libm-i387/e_logl.S: Likewise. + + * sysdeps/libm-i387/s_cos.S: Use testl instead of andw. + * sysdeps/libm-i387/s_cosl.S: Likewise. + * sysdeps/libm-i387/s_sin.S: Likewise. + * sysdeps/libm-i387/s_sinl.S: Likewise. + * sysdeps/libm-i387/s_tan.S: Likewise. + * sysdeps/libm-i387/s_tanl.S: Likewise. + + * sysdeps/libm-i387/e_acosf.S: New file. Add float versions. + * sysdeps/libm-i387/e_asinf.S: Likewise. + * sysdeps/libm-i387/e_expf.S: Likewise. + * sysdeps/libm-i387/e_fmodf.S: Likewise. + * sysdeps/libm-i387/e_log10f.S: Likewise. + * sysdeps/libm-i387/e_logf.S: Likewise. + * sysdeps/libm-i387/e_scalbf.S: Likewise. + + * sysdeps/libm-i387/e_acosh.S: New file. Highly optimized versions. + * sysdeps/libm-i387/e_acoshf.S: Likewise. + * sysdeps/libm-i387/e_acoshl.S: Likewise. + * sysdeps/libm-i387/e_atanh.S: Likewise. + * sysdeps/libm-i387/e_atanhf.S: Likewise. + * sysdeps/libm-i387/e_atanhl.S: Likewise. + * sysdeps/libm-i387/e_asinh.S: Likewise. + * sysdeps/libm-i387/e_asinhf.S: Likewise. + * sysdeps/libm-i387/e_asinhl.S: Likewise. + + * sysdeps/libm-ieee754/s_asinhf.c: Tweak a bit. Use lower levels + for simplified handling. + + * sysdeps/unix/sysv/linux/syscalls.list: Add query_module. + +Sun Dec 22 01:39:29 1996 Andreas Schwab + + * inet/rcmd.c (rcmd): Set h_errno before calling herror. + * inet/rexec.c (rexec): Likewise. + +Sat Dec 21 21:47:08 1996 Andreas Schwab + + * sysdeps/unix/sysv/linux/m68k/setjmp.c (__setjmp): Make it really + compatible. + +Sun Dec 22 03:23:33 1996 Ulrich Drepper + + * sysdeps/libm-i387/s_log1p.S: Use fyl2xp1 for numbers in range + -0.29 <= x <= 0.29, otherwise the old method. + * sysdeps/libm-i387/s_log1pf.S: Likewise. + * sysdeps/libm-i387/s_log1pl.S: Likewise. + Sun Dec 22 00:01:27 1996 Ulrich Drepper * inet/getnetgrent.c: Reformat copyright. diff --git a/elf/dl-error.c b/elf/dl-error.c index e0a73471a4..55d9c2fc93 100644 --- a/elf/dl-error.c +++ b/elf/dl-error.c @@ -90,6 +90,7 @@ _dl_catch_error (char **errstring, } /* We get here only if we longjmp'd out of OPERATE. */ + catch = NULL; *errstring = c.errstring; *objname = c.objname; return errcode == -1 ? 0 : errcode; diff --git a/elf/dl-support.c b/elf/dl-support.c index 35710a0a74..593f96749b 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -33,6 +33,7 @@ char **_dl_argv = &__progname; /* This is checked for some error messages. */ For the dynamic linker it is set by -rpath when linking. */ const char *_dl_rpath = DEFAULT_RPATH; +#ifndef MAP_ANON /* This is the only dl-sysdep.c function that is actually needed at run-time by _dl_map_object. */ @@ -41,6 +42,7 @@ _dl_sysdep_open_zero_fill (void) { return __open ("/dev/zero", O_RDONLY); } +#endif /* This should never be called. */ void diff --git a/elf/eval.c b/elf/eval.c index 0fb6751a95..7d53671f6c 100644 --- a/elf/eval.c +++ b/elf/eval.c @@ -128,7 +128,7 @@ _start (void) char *buf = NULL; size_t bufsz = 0; - while (getline (&buf, &bufsz, stdin) > 0) + while (__getline (&buf, &bufsz, stdin) > 0) { char *p = buf; eval (&p); diff --git a/elf/rtld.c b/elf/rtld.c index f65bd80954..28c9fd796e 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -236,6 +236,8 @@ of this helper program; chances are you did not intend to run this program.\n", /* Create a link_map for the executable itself. This will be what dlopen on "" returns. */ l = _dl_new_object ((char *) "", "", lt_executable); + if (l == NULL) + _dl_sysdep_fatal ("cannot allocate memory for link map", NULL); l->l_phdr = phdr; l->l_phnum = phent; l->l_entry = *user_entry; diff --git a/features.h b/features.h index 4bcff2a190..f1f248cc68 100644 --- a/features.h +++ b/features.h @@ -23,14 +23,14 @@ /* These are defined by the user (or the compiler) to specify the desired environment: - __STRICT_ANSI__ ANSI Standard C. + __STRICT_ANSI__ ISO Standard C. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993 _XOPEN_SOURCE Includes POSIX and XPG things. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. - _BSD_SOURCE ANSI, POSIX, and 4.3BSD things. - _SVID_SOURCE ANSI, POSIX, and SVID things. + _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. + _SVID_SOURCE ISO C, POSIX, and SVID things. _GNU_SOURCE All of the above, plus GNU extensions. _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. @@ -39,7 +39,7 @@ If none of these are defined, the default is all but _GNU_SOURCE. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE - together give you ANSI C, 1003.1, and 1003.2, but nothing else. + together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: @@ -56,7 +56,10 @@ __USE_REENTRANT Define reentrant/thread-safe *_r functions. __FAVOR_BSD Favor 4.3BSD things in cases of conflict. - The macro `__GNU_LIBRARY__' is defined by this file unconditionally. + The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are + defined by this file unconditionally. `__GNU_LIBRARY__' is provided + only for compatibility. All new code should use the other symbols + to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. @@ -85,15 +88,15 @@ # define __KERNEL_STRICT_NAMES #endif -/* Always use ANSI things. */ +/* Always use ISO C things. */ #define __USE_ANSI 1 /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ -#if defined (_BSD_SOURCE) && \ - !(defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) || \ - defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_DEFINED) || \ - defined (_GNU_SOURCE) || defined (_SVID_SOURCE)) +#if defined _BSD_SOURCE && \ + !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \ + defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_DEFINED || \ + defined _GNU_SOURCE || defined _SVID_SOURCE) # define __FAVOR_BSD 1 #endif @@ -115,37 +118,35 @@ /* If nothing (other than _GNU_SOURCE) is defined, define _BSD_SOURCE and _SVID_SOURCE. */ -#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \ - !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE) && \ - !defined (_XOPEN_SOURCE_EXTENDED) && !defined (_BSD_SOURCE) && \ - !defined (_SVID_SOURCE)) +#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \ + !defined _POSIX_C_SOURCE && !defined _XOPEN_SOURCE && \ + !defined _XOPEN_SOURCE_EXTENDED && !defined _BSD_SOURCE && \ + !defined _SVID_SOURCE) #define _BSD_SOURCE 1 #define _SVID_SOURCE 1 #endif /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ -#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \ - !defined (_POSIX_C_SOURCE)) +#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \ + !defined _POSIX_C_SOURCE) #define _POSIX_SOURCE 1 -#if defined(_XOPEN_SOURCE) +#ifdef _XOPEN_SOURCE #define _POSIX_C_SOURCE 2 #else #define _POSIX_C_SOURCE 199309L #endif #endif -#if (defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 || \ - defined (_XOPEN_SOURCE)) +#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE #define __USE_POSIX 1 #endif -#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2 || \ - defined (_XOPEN_SOURCE)) +#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE #define __USE_POSIX2 1 #endif -#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L) +#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L #define __USE_POSIX199309 1 #endif @@ -156,7 +157,7 @@ #endif #endif -#if defined (_BSD_SOURCE) || defined (_SVID_SOURCE) +#if defined _BSD_SOURCE || defined _SVID_SOURCE #define __USE_MISC 1 #endif @@ -172,7 +173,7 @@ #define __USE_GNU 1 #endif -#if defined (_REENTRANT) || defined (_THREAD_SAFE) +#if defined _REENTRANT || defined _THREAD_SAFE #define __USE_REENTRANT 1 #endif @@ -192,7 +193,7 @@ #define __GLIBC_MINOR__ 0 -#if !defined (__GNUC__) || __GNUC__ < 2 +#if !defined __GNUC__ || __GNUC__ < 2 /* In GCC version 2, (__extension__ EXPR) will not complain about GCC extensions used in EXPR under -ansi or -pedantic. */ #define __extension__ diff --git a/gnu-versions.h b/gnu-versions.h index 15b07999dd..68545bd9b6 100644 --- a/gnu-versions.h +++ b/gnu-versions.h @@ -47,5 +47,7 @@ #define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */ #define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */ #define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */ +#define _GNU_GETOPT_INTERFACE_VERSION 1 /* vs posix/getopt.c and + posix/getopt1.c */ #endif /* gnu-versions.h */ diff --git a/inet/rcmd.c b/inet/rcmd.c index c9c3a2fabd..f13a2e6bad 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -83,6 +83,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) &hp, &herr) < 0) if (herr != NETDB_INTERNAL || errno != ERANGE) { + __set_h_errno (herr); herror(*ahost); return -1; } @@ -322,7 +323,7 @@ again: char *pbuf; size_t dirlen; size_t buflen = __sysconf (_SC_GETPW_R_SIZE_MAX); - char buffer = __alloca (buflen); + char *buffer = __alloca (buflen); first = 0; if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0) diff --git a/inet/rexec.c b/inet/rexec.c index d91949de3c..611ff57287 100644 --- a/inet/rexec.c +++ b/inet/rexec.c @@ -71,6 +71,7 @@ rexec(ahost, rport, name, pass, cmd, fd2p) &hp, &herr) < 0) if (herr != NETDB_INTERNAL || errno != ERANGE) { + __set_h_errno (herr); herror(*ahost); return -1; } diff --git a/libio/iovsprintf.c b/libio/iovsprintf.c index 11904e36b3..099863c2f1 100644 --- a/libio/iovsprintf.c +++ b/libio/iovsprintf.c @@ -43,7 +43,6 @@ _IO_vsprintf (string, format, args) _IO_init (&sf._sbf._f, 0); _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps; _IO_str_init_static (&sf._sbf._f, string, -1, string); - _IO_str_init_static ((_IO_FILE *) &sf, string, -1, string); _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf); _IO_flockfile (&sf._sbf._f); ret = _IO_vfprintf (&sf._sbf._f, format, args); diff --git a/posix/Makefile b/posix/Makefile index fcf7cbae9e..1a2f6ae798 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -12,9 +12,9 @@ # Library General Public License for more details. # You should have received a copy of the GNU Library General Public -# License along with the GNU C Library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. # # Sub-makefile for POSIX portion of the library. diff --git a/posix/getopt.c b/posix/getopt.c index 01adee0fe5..a5fb9921a7 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -52,7 +52,15 @@ program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) +#define GETOPT_INTERFACE_VERSION 1 +#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE /* This needs to come after some library #include @@ -124,8 +132,14 @@ char *optarg = NULL; Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. @@ -431,10 +445,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) { optarg = NULL; - if (optind == 0) + if (!__getopt_initialized) { optstring = _getopt_initialize (optstring); optind = 1; /* Don't scan ARGV[0], the program name. */ + __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. @@ -500,6 +515,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; + + /* Before we can be provide the next result we must be + reinitialized. */ + __getopt_initialized = 0; + return EOF; } @@ -509,7 +529,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) - return EOF; + { + /* Before we can be provide the next result we must be + reinitialized. */ + __getopt_initialized = 0; + return EOF; + } optarg = argv[optind++]; return 1; } @@ -880,7 +905,7 @@ getopt (argc, argv, optstring) 0); } -#endif /* _LIBC or not __GNU_LIBRARY__. */ +#endif /* Not ELIDE_CODE. */ #ifdef TEST diff --git a/posix/getopt1.c b/posix/getopt1.c index de8e2ad567..358935db69 100644 --- a/posix/getopt1.c +++ b/posix/getopt1.c @@ -1,24 +1,24 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. Its master source is NOT part of -the C library, however. The master source lives in /gd/gnu/lib. + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include @@ -44,15 +44,21 @@ Cambridge, MA 02139, USA. */ program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) +#define GETOPT_INTERFACE_VERSION 1 +#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include -#else -char *getenv (); #endif #ifndef NULL @@ -87,7 +93,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) } -#endif /* _LIBC or not __GNU_LIBRARY__. */ +#endif /* Not ELIDE_CODE. */ #ifdef TEST diff --git a/signal/Makefile b/signal/Makefile index d3337385c9..eac9576895 100644 --- a/signal/Makefile +++ b/signal/Makefile @@ -12,9 +12,9 @@ # Library General Public License for more details. # You should have received a copy of the GNU Library General Public -# License along with the GNU C Library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. # # Makefile for signal routines. @@ -30,7 +30,7 @@ routines := signal raise killpg \ sigstack sigaltstack sigintr \ sigsetops sigempty sigfillset sigaddset sigdelset sigismem \ sigreturn \ - gsignal ssignal siggetmask + siggetmask bsd_signal tests := tst-signal diff --git a/signal/gsignal.c b/signal/gsignal.c deleted file mode 100644 index f5b79a991d..0000000000 --- a/signal/gsignal.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1991, 1995 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include - -#undef gsignal - -int -gsignal (sig) - int sig; -{ - return raise (sig); -} diff --git a/signal/signal.h b/signal/signal.h index 7b3c26094c..66ab3dd09a 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -22,7 +22,7 @@ #ifndef _SIGNAL_H -#if !defined(__need_sig_atomic_t) && !defined(__need_sigset_t) +#if !defined __need_sig_atomic_t && !defined __need_sigset_t #define _SIGNAL_H 1 #include #endif @@ -32,15 +32,15 @@ __BEGIN_DECLS #include #include /* __sigset_t, __sig_atomic_t. */ -#if !defined(__sig_atomic_t_defined) && \ - (defined(_SIGNAL_H) || defined(__need_sig_atomic_t)) +#if !defined __sig_atomic_t_defined \ + && (defined _SIGNAL_H || defined __need_sig_atomic_t) /* An integral type that can be modified atomically, without the possibility of a signal arriving in the middle of the operation. */ typedef __sig_atomic_t sig_atomic_t; #endif /* `sig_atomic_t' undefined and or need `sig_atomic_t'. */ -#undef __need_sig_atomic_t +#undef __need_sig_atomic_t -#ifdef _SIGNAL_H +#ifdef _SIGNAL_H #include @@ -51,15 +51,27 @@ typedef void (*__sighandler_t) __P ((int)); returning the old handler, or SIG_ERR on error. */ extern __sighandler_t signal __P ((int __sig, __sighandler_t __handler)); +#if defined __FAVOR_BSD || defined __USE_XOPEN +/* The X/Open definition of `signal' conflicts with the BSD version. + So they defined another function `bsd_signal'. We will use this + implementation as the official `signal' function if the BSD + interface is preferred. */ +extern __sighandler_t bsd_signal __P ((int __sig, __sighandler_t __handler)); + +#ifdef __FAVOR_BSD +#define signal(sig, handler) bsd_signal ((sig), (handler)) +#endif +#endif + /* Send signal SIG to process number PID. If PID is zero, send SIG to all processes in the current process's process group. If PID is < -1, send SIG to all processes in process group - PID. */ extern int __kill __P ((__pid_t __pid, int __sig)); -#ifdef __USE_POSIX +#ifdef __USE_POSIX extern int kill __P ((__pid_t __pid, int __sig)); #endif /* Use POSIX. */ -#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED) +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in the current process's process group. */ @@ -69,13 +81,13 @@ extern int killpg __P ((__pid_t __pgrp, int __sig)); /* Raise signal SIG, i.e., send SIG to yourself. */ extern int raise __P ((int __sig)); -#ifdef __USE_SVID +#ifdef __USE_SVID /* SVID names for the same things. */ extern __sighandler_t ssignal __P ((int __sig, __sighandler_t __handler)); extern int gsignal __P ((int __sig)); #endif /* Use SVID. */ -#ifdef __USE_MISC +#ifdef __USE_MISC /* Print a message describing the meaning of the given signal number. */ extern void psignal __P ((int __sig, __const char *__s)); #endif /* Use misc. */ @@ -95,7 +107,7 @@ extern int __sigsetmask __P ((int __mask)); explitcly selects the BSD version. */ extern int __sigpause __P ((int __sig_or_mask, int __is_sig)); -#if defined(__USE_BSD) && !defined(__USE_XOPEN) +#if defined __USE_BSD && !defined __USE_XOPEN /* Set the mask of blocked signals to MASK, wait for a signal to arrive, and then restore the mask. */ #define sigpause(mask) __sigpause ((mask), 0) @@ -107,7 +119,7 @@ extern int __sigpause __P ((int __sig_or_mask, int __is_sig)); #endif -#ifdef __USE_BSD +#ifdef __USE_BSD #define sigmask(sig) __sigmask(sig) extern int sigblock __P ((int __mask)); @@ -119,32 +131,32 @@ extern int siggetmask __P ((void)); #endif /* Use BSD. */ -#ifdef __USE_MISC +#ifdef __USE_MISC #define NSIG _NSIG #endif -#ifdef __USE_GNU +#ifdef __USE_GNU typedef __sighandler_t sighandler_t; #endif /* 4.4 BSD uses the name `sig_t' for this. */ -#ifdef __USE_BSD +#ifdef __USE_BSD typedef __sighandler_t sig_t; #endif #endif /* included. */ -#ifdef __USE_POSIX +#ifdef __USE_POSIX -#if !defined(__sigset_t_defined) && \ - (defined(_SIGNAL_H) || defined(__need_sigset_t)) +#if !defined __sigset_t_defined \ + && (defined _SIGNAL_H || defined __need_sigset_t) typedef __sigset_t sigset_t; #define __sigset_t_defined 1 #endif /* `sigset_t' not defined and or need `sigset_t'. */ -#undef __need_sigset_t +#undef __need_sigset_t -#ifdef _SIGNAL_H +#ifdef _SIGNAL_H /* Clear all signals from SET. */ extern int sigemptyset __P ((sigset_t *__set)); @@ -194,7 +206,7 @@ extern int sigwait __P ((__const sigset_t *__set, int *__sig)); #endif /* Use POSIX. */ -#if defined(_SIGNAL_H) && defined(__USE_BSD) +#if defined _SIGNAL_H && defined __USE_BSD /* Names of the signals. This variable exists only for compatibility. Use `strsignal' instead (see ). */ @@ -238,7 +250,7 @@ extern int sigreturn __P ((struct sigcontext *__scp)); #endif /* signal.h included and use BSD. */ -#if defined(_SIGNAL_H) && (defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)) +#if defined _SIGNAL_H && (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) #define __need_size_t #include diff --git a/signal/ssignal.c b/signal/ssignal.c deleted file mode 100644 index 54ab7f0f45..0000000000 --- a/signal/ssignal.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995 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 Library General Public License as -published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include - -#undef ssignal - -__sighandler_t -ssignal (sig, func) - int sig; - __sighandler_t func; -{ - return signal (sig, func); -} diff --git a/socket/sys/un.h b/socket/sys/un.h index d88fa47069..02fc775acb 100644 --- a/socket/sys/un.h +++ b/socket/sys/un.h @@ -21,6 +21,8 @@ #define _SYS_UN_H 1 #include +#include /* For prototype of `strlen'. */ + /* Get the definition of the macro to define the common sockaddr members. */ #include @@ -33,6 +35,11 @@ struct sockaddr_un char sun_path[108]; /* Path name. */ }; + +/* Evaluate to actual length of the `sockaddr_un' structure. */ +#define SUN_LEN(ptr) (((struct sockaddr_un *) 0)->sun_path \ + + strlen ((ptr)->sun_path)) + __END_DECLS #endif /* sys/un.h */ diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 5189dd7eef..f4e49e6b9d 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -43,7 +43,7 @@ tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \ xbug errnobug \ bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 \ tfformat tiformat tstdiomisc \ - scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 + scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 include ../Rules diff --git a/stdio-common/scanf10.c b/stdio-common/scanf10.c new file mode 100644 index 0000000000..f8961378ef --- /dev/null +++ b/stdio-common/scanf10.c @@ -0,0 +1,15 @@ +#include +#include + +int +main (int argc, char *argv[]) +{ + const char teststring[] = ""; + int retc, a, b; + + retc = sscanf (teststring, "<%*s `%n%*s%n'>", &a, &b); + + printf ("retc=%d a=%d b=%d\n", retc, a, b); + + return retc == -1 && a == 6 && b == 12 ? 0 : 1; +} diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index 7a3440c99a..cb6d39629e 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -524,7 +524,10 @@ __vfscanf (FILE *s, const char *format, va_list argptr) if (First) \ input_error (); \ else \ - break; \ + { \ + --read_in; \ + break; \ + } \ val = c; \ if (val >= 0x80) \ { \ @@ -667,6 +670,9 @@ __vfscanf (FILE *s, const char *format, va_list argptr) STRING_ADD_CHAR (str, c, char); } while ((width <= 0 || --width > 0) && inchar () != EOF); + if (c == EOF) + --read_in; + if (!(flags & SUPPRESS)) { *str = '\0'; diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c index 6cd454c7ac..ac4ee5e6c9 100644 --- a/sysdeps/generic/dl-cache.c +++ b/sysdeps/generic/dl-cache.c @@ -1,21 +1,21 @@ /* Support for reading /etc/ld.so.cache files written by Linux ldconfig. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1996 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 Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/sysdeps/libm-i387/e_acos.S b/sysdeps/libm-i387/e_acos.S index c9fa81006c..becae36d5e 100644 --- a/sysdeps/libm-i387/e_acos.S +++ b/sysdeps/libm-i387/e_acos.S @@ -18,4 +18,4 @@ ENTRY(__ieee754_acos) fxch %st(1) fpatan ret -PSEUDO_END (__ieee754_acos) +END (__ieee754_acos) diff --git a/sysdeps/libm-i387/e_acosf.S b/sysdeps/libm-i387/e_acosf.S new file mode 100644 index 0000000000..87ee2fb5bc --- /dev/null +++ b/sysdeps/libm-i387/e_acosf.S @@ -0,0 +1,22 @@ +/* + * Written by J.T. Conklin . + * Public domain. + * Adapted for float type by Ulrich Drepper . + */ + +#include + +RCSID("$NetBSD: $") + +/* acos = atan (sqrt(1 - x^2) / x) */ +ENTRY(__ieee754_acosf) + flds 4(%esp) /* x */ + fst %st(1) + fmul %st(0) /* x^2 */ + fld1 + fsubp /* 1 - x^2 */ + fsqrt /* sqrt (1 - x^2) */ + fxch %st(1) + fpatan + ret +END (__ieee754_acosf) diff --git a/sysdeps/libm-i387/e_acosh.S b/sysdeps/libm-i387/e_acosh.S new file mode 100644 index 0000000000..a3397b365c --- /dev/null +++ b/sysdeps/libm-i387/e_acosh.S @@ -0,0 +1,105 @@ +/* ix87 specific implementation of arcsinh. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + ASM_TYPE_DIRECTIVE(limit,@object) +limit: .double 0.29 + ASM_SIZE_DIRECTIVE(limit) + +#ifdef PIC +#define MO(op) op##@GOTOFF(%edx) +#else +#define MO(op) op +#endif + + .text +ENTRY(__ieee754_acosh) + movl 8(%esp), %ecx + cmpl $0x3ff00000, %ecx + jl 5f // < 1 => invalid + fldln2 // log(2) + fldl 4(%esp) // x : log(2) + cmpl $0x41b00000, %ecx + ja 3f // x > 2^28 +#ifdef PIC + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx +#endif + cmpl $0x40000000, %ecx + ja 4f // x > 2 + + // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + fsubl MO(one) // x-1 : log(2) + fld %st // x-1 : x-1 : log(2) + fmul %st(1) // (x-1)^2 : x-1 : log(2) + fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2) + fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2) + fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2) + faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2) + fcoml MO(limit) + fnstsw + sahf + ja 2f + fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + ret + +2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2) + fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2)) + ret + + // x > 2^28 => y = log(x) + log(2) + .align ALIGNARG(4) +3: fyl2x // log(x) + fldln2 // log(2) : log(x) + faddp // log(x)+log(2) + ret + + // 2^28 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1))) + .align ALIGNARG(4) +4: fld %st // x : x : log(2) + fadd %st, %st(1) // x : 2*x : log(2) + fld %st // x : x : 2*x : log(2) + fmul %st(1) // x^2 : x : 2*x : log(2) + fsubl MO(one) // x^2-1 : x : 2*x : log(2) + fsqrt // sqrt(x^2-1) : x : 2*x : log(2) + faddp // x+sqrt(x^2-1) : 2*x : log(2) + fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2) + fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2) + fyl2x // log(2*x+1/(x+sqrt(x^2-1))) + ret + + // x < 1 => NaN + .align ALIGNARG(4) +5: fldz + fdiv %st, %st(0) + ret +END(__ieee754_acosh) diff --git a/sysdeps/libm-i387/e_acoshf.S b/sysdeps/libm-i387/e_acoshf.S new file mode 100644 index 0000000000..a4f50ba7ac --- /dev/null +++ b/sysdeps/libm-i387/e_acoshf.S @@ -0,0 +1,105 @@ +/* ix87 specific implementation of arcsinh. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + ASM_TYPE_DIRECTIVE(limit,@object) +limit: .double 0.29 + ASM_SIZE_DIRECTIVE(limit) + +#ifdef PIC +#define MO(op) op##@GOTOFF(%edx) +#else +#define MO(op) op +#endif + + .text +ENTRY(__ieee754_acoshf) + movl 8(%esp), %ecx + cmpl $0x3f800000, %ecx + jl 5f // < 1 => invalid + fldln2 // log(2) + flds 4(%esp) // x : log(2) + cmpl $0x47000000, %ecx + ja 3f // x > 2^14 +#ifdef PIC + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx +#endif + cmpl $0x40000000, %ecx + ja 4f // x > 2 + + // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + fsubl MO(one) // x-1 : log(2) + fld %st // x-1 : x-1 : log(2) + fmul %st(1) // (x-1)^2 : x-1 : log(2) + fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2) + fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2) + fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2) + faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2) + fcoml MO(limit) + fnstsw + sahf + ja 2f + fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + ret + +2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2) + fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2)) + ret + + // x > 2^14 => y = log(x) + log(2) + .align ALIGNARG(4) +3: fyl2x // log(x) + fldln2 // log(2) : log(x) + faddp // log(x)+log(2) + ret + + // 2^28 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1))) + .align ALIGNARG(4) +4: fld %st // x : x : log(2) + fadd %st, %st(1) // x : 2*x : log(2) + fld %st // x : x : 2*x : log(2) + fmul %st(1) // x^2 : x : 2*x : log(2) + fsubl MO(one) // x^2-1 : x : 2*x : log(2) + fsqrt // sqrt(x^2-1) : x : 2*x : log(2) + faddp // x+sqrt(x^2-1) : 2*x : log(2) + fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2) + fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2) + fyl2x // log(2*x+1/(x+sqrt(x^2-1))) + ret + + // x < 1 => NaN + .align ALIGNARG(4) +5: fldz + fdiv %st, %st(0) + ret +END(__ieee754_acoshf) diff --git a/sysdeps/libm-i387/e_acoshl.S b/sysdeps/libm-i387/e_acoshl.S new file mode 100644 index 0000000000..b0fa45c44e --- /dev/null +++ b/sysdeps/libm-i387/e_acoshl.S @@ -0,0 +1,111 @@ +/* ix87 specific implementation of arcsinh. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + + .align ALIGNARG(4) + /* Please note that we use double value for 1.0. This number + has an exact representation and so we don't get accuracy + problems. The advantage is that the code is simpler. */ + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + /* It is not important that this constant is precise. It is only + a value which is known to be on the safe side for using the + fyl2xp1 instruction. */ + ASM_TYPE_DIRECTIVE(limit,@object) +limit: .double 0.29 + ASM_SIZE_DIRECTIVE(limit) + +#ifdef PIC +#define MO(op) op##@GOTOFF(%edx) +#else +#define MO(op) op +#endif + + .text +ENTRY(__ieee754_acoshl) + movl 12(%esp), %ecx + cmpl $0x3fff, %ecx + jl 5f // < 1 => invalid + fldln2 // log(2) + fldt 4(%esp) // x : log(2) + cmpl $0x4020, %ecx + ja 3f // x > 2^34 +#ifdef PIC + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx +#endif + cmpl $0x4000, %ecx + ja 4f // x > 2 + + // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + fsubl MO(one) // x-1 : log(2) + fld %st // x-1 : x-1 : log(2) + fmul %st(1) // (x-1)^2 : x-1 : log(2) + fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2) + fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2) + fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2) + faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2) + fcoml MO(limit) + fnstsw + sahf + ja 2f + fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2)) + ret + +2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2) + fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2)) + ret + + // x > 2^34 => y = log(x) + log(2) + .align ALIGNARG(4) +3: fyl2x // log(x) + fldln2 // log(2) : log(x) + faddp // log(x)+log(2) + ret + + // 2^34 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1))) + .align ALIGNARG(4) +4: fld %st // x : x : log(2) + fadd %st, %st(1) // x : 2*x : log(2) + fld %st // x : x : 2*x : log(2) + fmul %st(1) // x^2 : x : 2*x : log(2) + fsubl MO(one) // x^2-1 : x : 2*x : log(2) + fsqrt // sqrt(x^2-1) : x : 2*x : log(2) + faddp // x+sqrt(x^2-1) : 2*x : log(2) + fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2) + fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2) + fyl2x // log(2*x+1/(x+sqrt(x^2-1))) + ret + + // x < 1 => NaN + .align ALIGNARG(4) +5: fldz + fdiv %st, %st(0) + ret +END(__ieee754_acoshl) diff --git a/sysdeps/libm-i387/e_acosl.S b/sysdeps/libm-i387/e_acosl.S index 4cc56c0bb8..e8f97485de 100644 --- a/sysdeps/libm-i387/e_acosl.S +++ b/sysdeps/libm-i387/e_acosl.S @@ -19,4 +19,4 @@ ENTRY(__ieee754_acosl) fxch %st(1) fpatan ret -PSEUDO_END (__ieee754_acosl) +END (__ieee754_acosl) diff --git a/sysdeps/libm-i387/e_asin.S b/sysdeps/libm-i387/e_asin.S index cba41935d5..1202753d9b 100644 --- a/sysdeps/libm-i387/e_asin.S +++ b/sysdeps/libm-i387/e_asin.S @@ -17,4 +17,4 @@ ENTRY(__ieee754_asin) fsqrt /* sqrt (1 - x^2) */ fpatan ret -PSEUDO_END (__ieee754_asin) +END (__ieee754_asin) diff --git a/sysdeps/libm-i387/e_asinf.S b/sysdeps/libm-i387/e_asinf.S new file mode 100644 index 0000000000..d2159bac37 --- /dev/null +++ b/sysdeps/libm-i387/e_asinf.S @@ -0,0 +1,21 @@ +/* + * Written by J.T. Conklin . + * Public domain. + * Adapted for float type by Ulrich Drepper . + */ + +#include + +RCSID("$NetBSD: $") + +/* asin = atan (x / sqrt(1 - x^2)) */ +ENTRY(__ieee754_asinf) + flds 4(%esp) /* x */ + fst %st(1) + fmul %st(0) /* x^2 */ + fld1 + fsubp /* 1 - x^2 */ + fsqrt /* sqrt (1 - x^2) */ + fpatan + ret +END (__ieee754_asinf) diff --git a/sysdeps/libm-i387/e_asinl.S b/sysdeps/libm-i387/e_asinl.S index d4e254874e..ab421f3189 100644 --- a/sysdeps/libm-i387/e_asinl.S +++ b/sysdeps/libm-i387/e_asinl.S @@ -19,4 +19,4 @@ ENTRY(__ieee754_asinl) fsqrt /* sqrt (1 - x^2) */ fpatan ret -PSEUDO_END (__ieee754_asinl) +END (__ieee754_asinl) diff --git a/sysdeps/libm-i387/e_atan2.S b/sysdeps/libm-i387/e_atan2.S index 6f7fc74b65..8df04e485e 100644 --- a/sysdeps/libm-i387/e_atan2.S +++ b/sysdeps/libm-i387/e_atan2.S @@ -12,4 +12,4 @@ ENTRY(__ieee754_atan2) fldl 12(%esp) fpatan ret -PSEUDO_END (__ieee754_atan2) +END (__ieee754_atan2) diff --git a/sysdeps/libm-i387/e_atan2f.S b/sysdeps/libm-i387/e_atan2f.S index bb6d902172..fc6621f183 100644 --- a/sysdeps/libm-i387/e_atan2f.S +++ b/sysdeps/libm-i387/e_atan2f.S @@ -12,4 +12,4 @@ ENTRY(__ieee754_atan2f) flds 8(%esp) fpatan ret -PSEUDO_END (__ieee754_atan2f) +END (__ieee754_atan2f) diff --git a/sysdeps/libm-i387/e_atan2l.S b/sysdeps/libm-i387/e_atan2l.S index 860885ced1..f58eaa94a9 100644 --- a/sysdeps/libm-i387/e_atan2l.S +++ b/sysdeps/libm-i387/e_atan2l.S @@ -14,4 +14,4 @@ ENTRY(__ieee754_atan2l) fldt 16(%esp) fpatan ret -PSEUDO_END (__ieee754_atan2l) +END (__ieee754_atan2l) diff --git a/sysdeps/libm-i387/e_atanh.S b/sysdeps/libm-i387/e_atanh.S new file mode 100644 index 0000000000..231e96f57f --- /dev/null +++ b/sysdeps/libm-i387/e_atanh.S @@ -0,0 +1,101 @@ +/* ix87 specific implementation of arctanh function. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#ifdef __ELF__ + .section .rodata +#else + .text +#endif + + .align ALIGNARG(4) + ASM_TYPE_DIRECTIVE(half,@object) +half: .double 0.5 + ASM_SIZE_DIRECTIVE(half) + ASM_TYPE_DIRECTIVE(one,@object) +one: .double 1.0 + ASM_SIZE_DIRECTIVE(one) + ASM_TYPE_DIRECTIVE(limit,@object) +limit: .double 0.29 + ASM_SIZE_DIRECTIVE(limit) + ASM_TYPE_DIRECTIVE(ln2_2,@object) +ln2_2: .tfloat 0.3465735902799726547086160 + ASM_SIZE_DIRECTIVE(ln2_2) + +#ifdef PIC +#define MO(op) op##@GOTOFF(%edx) +#else +#define MO(op) op +#endif + + .text +ENTRY(__ieee754_atanh) + movl 8(%esp), %ecx + +#ifdef PIC + call 1f +1: popl %edx + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx +#endif + + andl $0x80000000, %ecx // ECX == 0 iff X >= 0 + + fldt MO(ln2_2) // 0.5*ln2 + xorl %ecx, 8(%esp) + fldl 4(%esp) // |x| : 0.5*ln2 + fcoml MO(half) // |x| : 0.5*ln2 + fld %st // |x| : |x| : 0.5*ln2 + fnstsw // |x| : |x| : 0.5*ln2 + sahf + jae 2f + fadd %st, %st(1) // |x| : 2*|x| : 0.5*ln2 + fld %st // |x| : |x| : 2*|x| : 0.5*ln2 + fsubrl MO(one) // 1-|x| : |x| : 2*|x| : 0.5*ln2 + fxch // |x| : 1-|x| : 2*|x| : 0.5*ln2 + fmul %st(2) // 2*|x|^2 : 1-|x| : 2*|x| : 0.5*ln2 + fdivp // (2*|x|^2)/(1-|x|) : 2*|x| : 0.5*ln2 + faddp // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2 + fcoml MO(limit) // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2 + fnstsw // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2 + sahf + jae 4f + fyl2xp1 // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|)) + jecxz 3f + fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x)) +3: ret + + .align ALIGNARG(4) +4: faddl MO(one) // 1+2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2 + fyl2x // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|)) + jecxz 3f + fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x)) +3: ret + + .align ALIGNARG(4) +2: faddl MO(one) // 1+|x| : |x| : 0.5*ln2 + fxch // |x| : 1+|x| : 0.5*ln2 + fsubrl MO(one) // 1-|x| : 1+|x| : 0.5*ln2 + fdivrp // (1+|x|)/(1-|x|) : 0.5*ln2 + fyl2x // 0.5*ln2*ld((1+|x|)/(1-|x|)) + jecxz 3f + fchs // 0.5*ln2*ld((1+x)/(1-x)) +3: ret +END(__ieee754_atanh) diff --git a/sysdeps/libm-i387/e_atanhf.S b/sysdeps/libm-i387/e_atanhf.S new file mode 100644 index 0000000000..687d4c97fb --- /dev/null +++ b/sysdeps/libm-i387/e_atanhf.S @@ -0,0 +1,102 @@ +/* ix87 specific implementation of arctanh function. + Copyright (C) 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + MERCHAN