+1997-08-14 03:14 Ulrich Drepper <drepper@cygnus.com>
+
+ * elf/dl-minimal.c: Don't use relative #include paths.
+ (malloc): Don't try to initialize _dl_pagesize, it already is.
+ (__sigjmp_save, longjmp): Reformat.
+
+ * sysdeps/generic/dl-sysdep.c: Implement _dl_show_auxv function to
+ show content of auxiliary array.
+ (_dl_sysdep_start): Remember start of auxiliary vector.
+ * sysdeps/mach/hurd/dl-sysdep.c: (_dl_show_auxv): New dummy function.
+ * elf/link.h: Add prototype for _dl_show_auxv.
+ * elf/rtld.c (dl_main): Call _dl_show_auxv if LD_SHOW_AUXV envvar
+ is present.
+
+ * libio/iofdopen.c: Better prepare for use in libstdc++.
+ * libio/iofflush.c: Likewise.
+ * libio/iofgetpos.c: Likewise.
+ * libio/iofgets.c: Likewise.
+ * libio/iofopen.c: Likewise.
+ * libio/iofputs.c: Likewise.
+ * libio/iofread.c: Likewise.
+ * libio/iofsetpos.c: Likewise.
+ * libio/ioftell.c: Likewise.
+ * libio/iofwrite.c: Likewise.
+ * libio/iogetdelim.c: Likewise.
+ * libio/iogets.c: Likewise.
+ * libio/iopopen.c: Likewise.
+ * libio/ioputs.c: Likewise.
+ * libio/iosetbuffer.c: Likewise.
+ * libio/iosetvbuf.c: Likewise.
+ * libio/ioungetc.c: Likewise.
+ * libio/iovsprintf.c: Likewise.
+ * libio/iovsscanf.c: Likewise.
+
+ * manual/creature.texi: Mention _XOPEN_SOURCE_EXTENDED in correct
+ place.
+
+ * manual/math.texi: Add comment to sincos decsription to say it's a
+ GNU extension.
+ Fix description of random function.
+
+ * posix/fnmatch.h: Recognize Windog by _WINDOWS32 not WIN32.
+ * posix/glob.c: Likewise. Handle stupid system headers on SunOS.
+ Add casts for all __alloca calls.
+ * posix/glob.h: Recognize Windog by _WINDOWS32 not WIN32.
+ Declare additional GLOB_* constants also if _GNU_SOURCE is defined.
+ Patches by Paul D. Smith <psmith@BayNetworks.COM>.
+
+ * stdio-common/_itoa.c: Don't use relateive #include paths.
+
+ * sysdeps/i386/fpu/bits/mathinline.h: Enable optimizations even for
+ gcc 2.7.
+ (atan): Loading 1.0 from memory does not pay off.
+ (asinh): Fix typo.
+
+1997-08-13 09:44 Philip Blundell <Philip.Blundell@pobox.com>
+
+ * sysdeps/stub/accept.c: Use socklen_t where necessary.
+ * sysdeps/stub/bind.c: Likewise.
+ * sysdeps/stub/connect.c: Likewise.
+ * sysdeps/stub/getsockname.c: Likewise.
+ * sysdeps/stub/getsockopt.c: Likewise.
+ * sysdeps/stub/recvfrom.c: Likewise.
+ * sysdeps/stub/sendto.c: Likewise.
+ * sysdeps/stub/setsockopt.c: Likewise.
+
+1997-08-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * io/ftw.c (object_compare): Avoid memcmp when comparing scalar
+ types.
+
+1997-08-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * math/libm-test.c (cbrt_test): Add epsilon for long double to
+ `cbrt (-0.001)'.
+
+1997-08-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/stub/bits/string.h: Fix comment.
+
+1997-08-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf/Makefile (routines): Remove dl-version.
+ (dl-routines): Add it here instead. This removes dead code from
+ libc.so.
+
+1997-08-12 17:17 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
+
+ * malloc/thread-m.h (thread_atfork, thread_atfork_static): New
+ macros to encapsulate pthread_atfork's functionality.
+ * malloc/malloc.c (ptmalloc_lock_all, ptmalloc_unlock_all): New
+ functions, registered via thread_atfork in the initialization
+ routine or via thread_atfork_static in global scope. This
+ ensures a consistent state of all locks across fork().
+
+1997-08-11 23:00:32 1997 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * login/programs/xtmp.c (compare_entry):
+ Partially undo patch made by Klaus Espenlaub. There
+ was no xtmp/utmp typo. Added comment to cclarify this.
+ * login/programs/xtmp.h: Likewise.
+
+ * posix/getopt.c: Recognize Windog by _WINDOWS32 not WIN32.
+ Patch by Paul D. Smith <psmith@BayNetworks.COM>.
+
+1997-08-12 13:51 Ulrich Drepper <drepper@cygnus.com>
+
+ * login/getutid.c: Rename to __getutid and make getutid and getutxid
+ weak aliases.
+ Patch by ir. Mark M._Kettenis <kettenis@phys.uva.nl>.
+
+1997-08-11 23:55 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/unix/sysv/linux/Makefile [subdir=misc] (sysdep_headers):
+ Add bits/mman.h.
+
+1997-08-11 08:51:21 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * stdlib/fmtmsg.c (fmtmsg): Add static to
+ __libc_once_define macro.
+
+ * libc.map (__progname_full, __progname): Added.
+
+1997-08-04 08:31 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0
+ if SIOGIFINDEX is not defined.
+ (if_indextoname): Initialize "result" to NULL.
+ (if_nametoindex, if_nameindex): Fix ENOSYS setting.
+
+1997-08-11 11:58 Richard Henderson <rth@cygnus.com>
+
+ Sparc ISO C 9x exception handling:
+ * sysdeps/sparc/fpu/bits/mathdef.h: New file.
+ * sysdeps/sparc/fpu/fclrexcpt.c: New file.
+ * sysdeps/sparc/fpu/fegetenv.c: New file.
+ * sysdeps/sparc/fpu/fegetround.c: New file.
+ * sysdeps/sparc/fpu/feholdexcpt.c: New file.
+ * sysdeps/sparc/fpu/fesetenv.c: New file.
+ * sysdeps/sparc/fpu/fesetround.c: New file.
+ * sysdeps/sparc/fpu/feupdateenv.c: New file.
+ * sysdeps/sparc/fpu/fgetexcptflg.c: New file.
+ * sysdeps/sparc/fpu/fraiseexcpt.c: New file.
+ * sysdeps/sparc/fpu/fsetexcptflg.c: New file.
+ * sysdeps/sparc/fpu/ftestexcept.c: New file.
+ * sysdeps/sparc/sparc32/fpu/bits/fenv.h: New file.
+ * sysdeps/sparc/sparc64/fpu/bits/fenv.h: New file.
+
+1997-08-11 11:58 Richard Henderson <rth@cygnus.com>
+
+ Sparc64 merge:
+ * configure.in: Change up subdirectories, rename sparc8->sparcv8.
+
+ * csu/Makefile: Nuke need-nopic-initfini bits. The problem was
+ that sparc64 ld did not recognize pic relocs at all.
+
+ * elf/dl-deps.c: Include <string.h>.
+ * elf/do-rel.h (elf_dynamic_do_rel): Take reloc address and size
+ directly instead of the DT names to get them from.
+ * elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): New macro distilled
+ from ELF_DYNAMIC_DO_REL{,A}. Define a second version that accounts
+ for the possibility that DT_RELA and DT_JMPPLT overlap, as such is
+ the case on the Sparc.
+
+ * elf/elf.h: Stub out Elf64_Ver*, and make them the same as the
+ Elf32_Ver* bits. The linker does not even know to differentiate
+ between the word sizes. Someone should examine this and figure
+ out what the proper sizes of things should be for 64-bit hosts
+ before the sparc64 libraries are distributed.
+
+ * shlib-versions: Rename sparc64 ld.so to not conflict with sparc32
+ on the same machine.
+
+ Move old sysdeps/sparc contents to sysdeps/sparc/sparc32,
+ rename sparc8 subdir to sparcv8, move sysdeps/sparc64 content to
+ sysdeps/sparc/sparc64. Same for sysdeps/unix/sysv/linux/sparc.
+
+ * sysdeps/sparc/Implies: Do ieee754 here.
+ * sysdeps/sparc/configure.in: Move from sparc32/.
+ * sysdeps/sparc/sparc32/Implies: Do wordsize here.
+ * sysdeps/sparc/sparc64/Implies: Likewise.
+
+ * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address):
+ Use uninitialized .got to find load address instead of AT_BASE, as
+ the later does not exist when running ld.so directly.
+
+ * sysdeps/sparc/sparc32/fpu/fpu_control.h: Move from ../.
+ * sysdeps/sparc/sparc64/fpu/fpu_control.h: Likewise.
+
+ * sysdeps/sparc/sparc32/udiv_qrnnd.S: Clean up PIC support.
+
+ * sysdeps/sparc/sparc64/Makefile (sysdep_routines): Add s_finitel
+ and s_signbitl for stdio.
+ * sysdeps/sparc/sparc64/configure.in: Remove, we no longer need
+ nopic_initfini.
+
+ * sysdeps/sparc/sparc64/bsd-_setjmp.S: Remove.
+ * sysdeps/sparc/sparc64/bsd-setjmp.S: Remove.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S: New empty file.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S: New empty file.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add __longjmp alias.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Add weak _setjmp
+ and setjmp entry points.
+
+ * sysdeps/sparc/sparc64/dl-machine.h: Finish real implementation.
+
+ * sysdeps/sparc/sparc64/elf/crtbegin.S: Add copyright, fix PIC.
+ * sysdeps/sparc/sparc64/elf/crtend.S: Likewise.
+
+ * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (struct sigaction):
+ Fix sa_flags size for sparc64; add sa_restorer for kernel.
+
+ * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Fix PIC.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+
+ * sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: New file.
+
+1997-08-10 18:29:08 1997 Mark Kettenis <kettenis@phys.uva.nl>
+
+ * login/login.c (login): Check for correct return value of
+ utmpname.
+
+1997-08-11 16:49 Ulrich Drepper <drepper@cygnus.com>
+
+ * time/tzset.c (__tzset_internal): Correctly handle TZ strings
+ following incorrect old POSIX specs.
+ Patch by Paul Eggert <eggert@twinsun.com>.
+
+ * sysdeps/generic/bits/sigaction.h: Correct comment for SA_RESTART.
+ * sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise.
+ * sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise.
+ Reported by NIIBE Yutaka <gniibe@mri.co.jp>.
+
+1997-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * manual/math.texi: Define the macros @mul and @infinity and use
+ them to format the multiplication and infinity signs.
+ (FP Comparison Functions): Use @code, not @math, for C code
+ examples.
+
1997-08-10 18:48 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig: Define build-programs to no if not set and $(config-os)
* gmon/sys/gmon.h: Add prototype for write_profiling.
- * elf/dl-profile.c: Add decsriptions and implement reading of
+ * elf/dl-profile.c: Add descriptions and implement reading of
existing data in profiling file.
* gmon/sys/gmon_out.h (GMON_SHOBJ_VERSION): New macro for shared
lib profiling data.
/* Bits in `sa_flags'. */
#ifdef __USE_BSD
-#define SA_ONSTACK 0x1 /* Take signal on signal stack. */
-#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */
-#define SA_DISABLE 0x4 /* Disable alternate signal stack. */
+# define SA_ONSTACK 0x1 /* Take signal on signal stack. */
+# define SA_RESTART 0x2 /* Restart syscall on signal return. */
+# define SA_DISABLE 0x4 /* Disable alternate signal stack. */
#endif
#define SA_NOCLDSTOP 0x8 /* Don't send SIGCHLD when children stop. */
m88k) base_machine=m88k machine=m88k/m88100 ;;
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;;
mips*) base_machine=mips machine=mips/$machine ;;
-sparc[6789]) base_machine=sparc machine=sparc/$machine ;;
-supersparc) base_machine=sparc machine=sparc/sparc8 ;;
-sparc64) base_machine=sparc64 machine=sparc64/$machine ;;
+sparc | sparcv[67])
+ base_machine=sparc machine=sparc/sparc32 ;;
+sparcv8 | supersparc | hypersparc)
+ base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
+sparc64 | ultrasparc)
+ base_machine=sparc machine=sparc/sparc64 ;;
esac
# This can take a while to compute.
sysdep_dir=$srcdir/sysdeps
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
-echo "configure:840: checking sysdep dirs" >&5
+echo "configure:843: checking sysdep dirs" >&5
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1041: checking for a BSD compatible install" >&5
+echo "configure:1044: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
INSTALL='$(..)./install-sh -c'
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1095: checking whether ln -s works" >&5
+echo "configure:1098: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1123: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1153: checking for $ac_word" >&5
+echo "configure:1156: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1182: checking for $ac_word" >&5
+echo "configure:1185: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1230: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1233: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1240 "configure"
+#line 1243 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
cross_linkable=yes
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1267: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1270: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1273: checking whether we are using GNU C" >&5
+echo "configure:1276: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
yes;
#endif
EOF
- if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if test -z "$CFLAGS"; then
CFLAGS="-g -O2"
fi
fi
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1311: checking build system type" >&5
+echo "configure:1314: checking build system type" >&5
build_alias=$build
case "$build_alias" in
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1334: checking for $ac_word" >&5
+echo "configure:1337: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1365: checking how to run the C preprocessor" >&5
+echo "configure:1368: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1380 "configure"
+#line 1383 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1397 "configure"
+#line 1400 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1434: checking for $ac_word" >&5
+echo "configure:1437: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1465: checking for $ac_word" >&5
+echo "configure:1468: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1496: checking for $ac_word" >&5
+echo "configure:1499: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1531: checking for $ac_word" >&5
+echo "configure:1534: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ksh", so it can be a program name with args.
set dummy ksh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1572: checking for $ac_word" >&5
+echo "configure:1575: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
-echo "configure:1614: checking for signed size_t type" >&5
+echo "configure:1617: checking for signed size_t type" >&5
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
-echo "configure:1638: checking for libc-friendly stddef.h" >&5
+echo "configure:1641: checking for libc-friendly stddef.h" >&5
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1643 "configure"
+#line 1646 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
-if { (eval echo configure:1658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
fi
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
-echo "configure:1677: checking whether we need to use -P to assemble .S files" >&5
+echo "configure:1680: checking whether we need to use -P to assemble .S files" >&5
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
-echo "configure:1700: checking for assembler global-symbol directive" >&5
+echo "configure:1703: checking for assembler global-symbol directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
-echo "configure:1730: checking for .set assembler directive" >&5
+echo "configure:1733: checking for .set assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
-echo "configure:1764: checking for .symver assembler directive" >&5
+echo "configure:1767: checking for .symver assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
-echo "configure:1783: checking for ld --version-script" >&5
+echo "configure:1786: checking for ld --version-script" >&5
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
-nostartfiles -nostdlib
-Wl,--version-script,conftest.map
- 1>&5'; { (eval echo configure:1802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+ 1>&5'; { (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_ld_version_script_option=yes
else
if test $elf = yes; then
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:1832: checking for .previous assembler directive" >&5
+echo "configure:1835: checking for .previous assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
.section foo_section
.previous
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_previous_directive=yes
else
libc_cv_asm_previous_directive=no
else
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:1856: checking for .popsection assembler directive" >&5
+echo "configure:1859: checking for .popsection assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
.pushsection foo_section
.popsection
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_popsection_directive=yes
else
libc_cv_asm_popsection_directive=no
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:1884: checking for .init and .fini sections" >&5
+echo "configure:1887: checking for .init and .fini sections" >&5
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 1892 "configure"
#include "confdefs.h"
int main() {
asm (".text");
; return 0; }
EOF
-if { (eval echo configure:1898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
libc_cv_asm_underscores=no
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:1923: checking for _ prefix on C symbol names" >&5
+echo "configure:1926: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1928 "configure"
+#line 1931 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
libc_cv_asm_weakext_directive=no
else
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:1962: checking for assembler .weak directive" >&5
+echo "configure:1965: checking for assembler .weak directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:1985: checking for assembler .weakext directive" >&5
+echo "configure:1988: checking for assembler .weakext directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2022: checking for ld --no-whole-archive" >&5
+echo "configure:2025: checking for ld --no-whole-archive" >&5
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&5'; { (eval echo configure:2033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:2044: checking for gcc -fno-exceptions" >&5
+echo "configure:2047: checking for gcc -fno-exceptions" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fno-exceptions
- -o conftest conftest.c 1>&5'; { (eval echo configure:2055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_no_exceptions=yes
else
libc_cv_gcc_no_exceptions=no
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:2107: checking OS release for uname" >&5
+echo "configure:2110: checking OS release for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:2129: checking OS version for uname" >&5
+echo "configure:2132: checking OS version for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:2151: checking stdio selection" >&5
+echo "configure:2154: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
m88k) base_machine=m88k machine=m88k/m88100 ;;
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;;
mips*) base_machine=mips machine=mips/$machine ;;
-sparc[6789]) base_machine=sparc machine=sparc/$machine ;;
-supersparc) base_machine=sparc machine=sparc/sparc8 ;;
-sparc64) base_machine=sparc64 machine=sparc64/$machine ;;
+sparc | sparcv[67])
+ base_machine=sparc machine=sparc/sparc32 ;;
+sparcv8 | supersparc | hypersparc)
+ base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
+sparc64 | ultrasparc)
+ base_machine=sparc machine=sparc/sparc64 ;;
esac
changequote([,])dnl
AC_SUBST(base_machine)
# "functions" _init and _fini to run the .init and .fini sections.
crtstuff = crti crtn
-# If we need separate startup code, require separate code.
-ifeq ($(need-nopic-initfini),yes)
-crtstuff += crtiS crtnS
-endif
-
install-lib += $(crtstuff:=.o)
extra-objs += $(crtstuff:=.o)
-generated += $(crtstuff:=.S) initfini.s initfiniS.s align.h end.h
+generated += $(crtstuff:=.S) initfini.s align.h end.h
omit-deps += $(crtstuff)
# Special rules for the building of crti.o and crtn.o
$(objpfx)crt%.o: $(objpfx)crt%.S $(objpfx)defs.h
- $(compile.S) -g0 -o $@
+ $(compile.S) -g0 $(ASFLAGS-.so) -o $@
$(objpfx)initfini.s: initfini.c
- $(compile.c) -g0 -S -finhibit-size-directive \
- $(no-exceptions) -o $@
-
-$(objpfx)initfiniS.s: initfini.c
$(compile.c) -g0 -S -fPIC -finhibit-size-directive \
$(no-exceptions) -o $@
-ifneq ($(need-nopic-initfini),yes)
# We only have one kind of startup code files. Static binaries and
# shared libraries are build using the PIC version.
-$(objpfx)crti.S: $(objpfx)initfiniS.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-
-$(objpfx)crtn.S: $(objpfx)initfiniS.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-else
-# We have to build two versions, one with one without PIC code.
$(objpfx)crti.S: $(objpfx)initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@
-$(objpfx)crtiS.S: $(objpfx)initfiniS.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-
-$(objpfx)crtnS.S: $(objpfx)initfiniS.s
- sed -n -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@
-endif
-
$(objpfx)defs.h: $(objpfx)initfini.s
sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
awk -f defs.awk > $@
headers = elf.h bits/elfclass.h bits/dlfcn.h link.h dlfcn.h
routines = $(dl-routines) dl-open dl-close dl-symbol dl-support \
- dl-version enbl-secure
+ enbl-secure
# The core dynamic linking functions are in libc for the static and
# profiled libraries.
dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
runtime error init fini debug misc \
- profile)
+ version profile)
# But they are absent from the shared libc, because that code is in ld.so.
elide-routines.so = $(dl-routines) dl-support enbl-secure
#include <errno.h>
#include <dlfcn.h>
#include <stdlib.h>
-
+#include <string.h>
#include <assert.h>
/* Whether an shared object references one or more auxiliary objects
#include <assert.h>
#include <string.h>
#include <link.h>
-#include "../stdio-common/_itoa.h"
+#include <stdio-common/_itoa.h>
/* Minimal `malloc' allocator for use while loading shared libraries.
Only small blocks are allocated, and none are ever freed. */
#define MAP_ANON 0
#endif
- if (_dl_pagesize == 0)
- _dl_pagesize = __getpagesize ();
-
if (alloc_end == 0)
{
/* Consume any unused space in the last page of our data segment. */
int weak_function
__sigjmp_save (sigjmp_buf env, int savemask)
-{ env[0].__mask_was_saved = savemask; return 0; }
+{
+ env[0].__mask_was_saved = savemask;
+ return 0;
+}
void weak_function
-longjmp (jmp_buf env, int val) { __longjmp (env[0].__jmpbuf, val); }
+longjmp (jmp_buf env, int val)
+{
+ __longjmp (env[0].__jmpbuf, val);
+}
\f
/* Define our own stub for the localization function used by strerror.
English-only in the dynamic linker keeps it smaller. */
static inline void
elf_dynamic_do_rel (struct link_map *map,
- int reltag, int sztag,
+ ElfW(Addr) reladdr, ElfW(Addr) relsize,
int lazy)
{
- const ElfW(Rel) *r
- = (const ElfW(Rel) *) (map->l_addr + map->l_info[reltag]->d_un.d_ptr);
- const ElfW(Rel) *end = &r[map->l_info[sztag]->d_un.d_val / sizeof *r];
+ const ElfW(Rel) *r = (const ElfW(Rel) *)(map->l_addr + reladdr);
+ const ElfW(Rel) *end = (const ElfW(Rel) *)(map->l_addr + reladdr + relsize);
if (lazy)
/* Doing lazy PLT relocations; they need very little info. */
duplicating their code. It cannot be done in a more general function
because we must be able to completely inline. */
+/* On some machines, notably Sparc, DT_REL* includes DT_JMPREL in its
+ range. Note that according to the ELF spec, this is completely legal!
+ But conditionally define things so that on machines we know this will
+ not happen we do something more optimal. */
+
+#ifdef ELF_MACHINE_PLTREL_OVERLAP
+#define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, lazy) \
+ do { \
+ ElfW(Addr) r_addr, r_size, p_addr, p_size; \
+ if ((map)->l_info[DT_##RELOC]) \
+ { \
+ r_addr = (map)->l_info[DT_##RELOC]->d_un.d_ptr; \
+ r_size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
+ if ((map)->l_info[DT_PLTREL] && \
+ (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC) \
+ { \
+ p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr; \
+ p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \
+ if (r_addr <= p_addr && r_addr+r_size > p_addr) \
+ { \
+ ElfW(Addr) r2_addr, r2_size; \
+ r2_addr = p_addr+p_size; \
+ if (r2_addr < r_addr+r_size) \
+ { \
+ r2_size = r_addr+r_size - r2_addr; \
+ elf_dynamic_do_##reloc ((map), r2_addr, r2_size, 0); \
+ } \
+ r_size = p_addr - r_addr; \
+ } \
+ } \
+ \
+ elf_dynamic_do_##reloc ((map), r_addr, r_size, 0); \
+ if (p_addr) \
+ elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy)); \
+ } \
+ else if ((map)->l_info[DT_PLTREL] && \
+ (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC) \
+ { \
+ p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr; \
+ p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \
+ \
+ elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy)); \
+ } \
+ } while (0)
+#else
+#define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, lazy) \
+ do { \
+ if ((map)->l_info[DT_##RELOC]) \
+ { \
+ ElfW(Addr) r_addr, r_size; \
+ r_addr = (map)->l_info[DT_##RELOC]->d_un.d_ptr; \
+ r_size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
+ elf_dynamic_do_##reloc ((map), r_addr, r_size, 0); \
+ } \
+ if ((map)->l_info[DT_PLTREL] && \
+ (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC) \
+ { \
+ ElfW(Addr) p_addr, p_size; \
+ p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr; \
+ p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \
+ elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy)); \
+ } \
+ } while (0)
+#endif
+
#if ! ELF_MACHINE_NO_REL
#include "do-rel.h"
-#define ELF_DYNAMIC_DO_REL(map, lazy) \
- if ((map)->l_info[DT_REL]) \
- elf_dynamic_do_rel ((map), DT_REL, DT_RELSZ, 0); \
- if ((map)->l_info[DT_PLTREL] && \
- (map)->l_info[DT_PLTREL]->d_un.d_val == DT_REL) \
- elf_dynamic_do_rel ((map), DT_JMPREL, DT_PLTRELSZ, (lazy));
+#define ELF_DYNAMIC_DO_REL(map, lazy) \
+ _ELF_DYNAMIC_DO_RELOC (REL, rel, map, lazy)
#else
#define ELF_DYNAMIC_DO_REL(map, lazy) /* Nothing to do. */
#endif
#if ! ELF_MACHINE_NO_RELA
#define DO_RELA
#include "do-rel.h"
-#define ELF_DYNAMIC_DO_RELA(map, lazy) \
- if ((map)->l_info[DT_RELA]) \
- elf_dynamic_do_rela ((map), DT_RELA, DT_RELASZ, 0); \
- if ((map)->l_info[DT_PLTREL] && \
- (map)->l_info[DT_PLTREL]->d_un.d_val == DT_RELA) \
- elf_dynamic_do_rela ((map), DT_JMPREL, DT_PLTRELSZ, (lazy));
+#define ELF_DYNAMIC_DO_RELA(map, lazy) \
+ _ELF_DYNAMIC_DO_RELOC (RELA, rela, map, lazy)
#else
#define ELF_DYNAMIC_DO_RELA(map, lazy) /* Nothing to do. */
#endif
entry */
} Elf32_Verdef;
+#if 0
/* XXX We have no information what types should be used for 64 bit
architectures. What is following is only an intelligent guess. */
typedef struct
Elf64_Word vd_next; /* Offset in bytes to next verdef
entry */
} Elf64_Verdef;
+#else
+/* The linker doesn't even parameterize the version info swapping
+ routines. I wonder if it should or is this good enough. */
+typedef Elf32_Verdef Elf64_Verdef;
+#endif
/* Legal values for vd_version (version revision). */
#define VER_DEF_NONE 0 /* No version */
entry */
} Elf32_Verdaux;
+#if 0
/* XXX We have no information what types should be used for 64 bit
architectures. What is following is only an intelligent guess. */
typedef struct
Elf64_Word vda_next; /* Offset in bytes to next verdaux
entry */
} Elf64_Verdaux;
+#else
+/* The linker doesn't even parameterize this -- should it? */
+typedef Elf32_Verdaux Elf64_Verdaux;
+#endif
/* Version dependency section. */
entry */
} Elf32_Verneed;
+#if 0
/* XXX We have no information what types should be used for 64 bit
architectures. What is following is only an intelligent guess. */
typedef struct
Elf64_Word vn_next; /* Offset in bytes to next verneed
entry */
} Elf64_Verneed;
+#else
+/* The linker doesn't even parameterize this -- should it? */
+typedef Elf32_Verneed Elf64_Verneed;
+#endif
/* Legal values for vn_version (version revision). */
#define VER_NEED_NONE 0 /* No version */
entry */
} Elf32_Vernaux;
+#if 0
/* XXX We have no information what types should be used for 64 bit
architectures. What is following is only an intelligent guess. */
typedef struct
Elf64_Word vna_next; /* Offset in bytes to next vernaux
entry */
} Elf64_Vernaux;
+#else
+/* The linker doesn't even parameterize these -- should it? */
+typedef Elf32_Vernaux Elf64_Vernaux;
+#endif
/* Legal values for vna_flags. */
#define VER_FLG_WEAK 0x2 /* Weak verison identifier */
#define R_SPARC_RELATIVE 22 /* Adjust by program base */
#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */
+/* Additional Sparc64 relocs. */
+
+#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */
+#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */
+#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */
+#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */
+#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */
+#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */
+#define R_SPARC_10 30 /* Direct 10 bit */
+#define R_SPARC_11 31 /* Direct 11 bit */
+#define R_SPARC_64 32 /* Direct 64 bit */
+#define R_SPARC_OLO10 33 /* ?? */
+#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */
+#define R_SPARC_HM10 35 /* High middle 10 bits of ... */
+#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */
+#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */
+#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */
+#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */
+#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */
+#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */
+#define R_SPARC_GLOB_JMP 42 /* ?? */
+#define R_SPARC_7 43 /* Direct 7 bit */
+#define R_SPARC_5 44 /* Direct 5 bit */
+#define R_SPARC_6 45 /* Direct 6 bit */
+
+/* For Sparc64, legal values for d_tag of Elf64_Dyn. */
+
+#define DT_SPARC_PLTFMT 0x70000001 /* .plt format version/type */
+#define DT_SPARC_NUM 2
+
/* MIPS R3000 specific definitions. */
/* Legal values for e_flags field of Elf32_Ehdr. */
/* The actual functions used to keep book on the calls. */
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
+
+/* Show the member of the auxiliry aray passed up from the kernel. */
+extern void _dl_show_auxv (void);
+
__END_DECLS
#endif /* link.h */
char *file;
int has_interp = 0;
+ /* Test whether we want to see the content of the auxiliary array passed
+ up from the kernel. */
+ if (getenv ("LD_SHOW_AUXV") != NULL)
+ _dl_show_auxv ();
+
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
_dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
accidentally compare `holes' in the structure. */
const struct known_object *kp1 = p1, *kp2 = p2;
int cmp1;
- cmp1 = memcmp(&kp1->dev, &kp2->dev, sizeof(kp1->dev));
+ cmp1 = (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev);
if (cmp1 != 0)
return cmp1;
- return memcmp (&kp1->ino, &kp2->ino, sizeof (kp1->ino));
+ return (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino);
}
_nl_current_LC_COLLATE; __collate_element_hash;
__collate_element_strings; __collate_symbol_classes;
__collate_symbol_hash; __collate_symbol_strings;
- _obstack;
+ _obstack; _libio_using_thunks;
+ __progname_full; __progname;
# helper functions
__errno_location; __libc_init_first; __h_errno_location;
_IO_str_underflow; _IO_str_init_static; _IO_str_init_readonly;
_IO_str_seekoff; _IO_str_pbackfail; _IO_list_all; _IO_file_jumps;
_IO_peekc_locked;
+ __vsscanf; __vfscanf; __vsnprintf;
_rpc_dtablesize; _null_auth; _seterr_reply;
__res_randomid;
return (_IO_FILE *) &new_f->fp;
}
+#ifdef weak_alias
weak_alias (_IO_fdopen, fdopen)
+#endif
}
}
+#ifdef weak_alias
weak_alias (_IO_fflush, fflush)
+#endif
return 0;
}
+#ifdef weak_alias
weak_alias (_IO_fgetpos, fgetpos)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_fgets, fgets)
+#endif
return NULL;
}
+#ifdef weak_alias
weak_alias (_IO_fopen, fopen)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_fputs, fputs)
+#endif
_IO_cleanup_region_end (1);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
+
+#ifdef weak_alias
weak_alias (_IO_fread, fread)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_fsetpos, fsetpos)
+#endif
return _IO_pos_as_off (pos);
}
+#ifdef weak_alias
weak_alias (_IO_ftell, ftell)
+#endif
return written/size;
}
+#ifdef weak_alias
weak_alias (_IO_fwrite, fwrite)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_getdelim, __getdelim)
weak_alias (_IO_getdelim, getdelim)
+#endif
return retval;
}
+#ifdef weak_alias
weak_alias (_IO_gets, gets)
+#endif
#ifdef _LIBC
link_warning (gets, "the `gets' function is dangerous and should not be used.")
return NULL;
}
+#ifdef strong_alias
strong_alias (_IO_popen, popen);
+#endif
int
DEFUN(_IO_proc_close, (fp),
_IO_cleanup_region_end (1);
return result;
}
+
+#ifdef weak_alias
weak_alias (_IO_puts, puts)
+#endif
_IO_cleanup_region_end (1);
}
+#ifdef weak_alias
weak_alias (_IO_setbuffer, setbuffer)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_setvbuf, setvbuf)
+#endif
return result;
}
+#ifdef weak_alias
weak_alias (_IO_ungetc, ungetc)
+#endif
return ret;
}
+#ifdef weak_alias
weak_alias (_IO_vsprintf, vsprintf)
+#endif
_IO_cleanup_region_end (1);
return ret;
}
+
+#ifdef weak_alias
weak_alias (_IO_vsscanf, __vsscanf)
weak_alias (_IO_vsscanf, vsscanf)
+#endif
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
struct utmp *
-getutid (const struct utmp *id)
+__getutid (const struct utmp *id)
{
struct utmp *result;
return result;
}
+weak_alias (__getutid, getutid)
+weak_alias (__getutid, getutxid)
strncpy (copy.ut_line, ttyp, UT_LINESIZE);
/* Tell that we want to use the UTMP file. */
- if (utmpname (_PATH_UTMP) != 0)
+ if (utmpname (_PATH_UTMP) == 0)
{
struct utmp *old;
/* Compare an old style entry XTMP with a new style entry UTMP. The
function returns 1 if the information that is in both old and new
- style entries is identical. Otherwise this function returns 0. */
+ style entries is identical. Otherwise this function returns 0.
+
+ The type of the argument `xtmp' is `struct utmp *', not `struct
+ utmp *'. This is intentional! We convert from and to `struct
+ xtmp' directly when we read and write an old style entry. But
+ since XTMP is converted from an old style entry, we compare only
+ those elements of the structure that are common to both the new and
+ the old style entry. */
int
-compare_entry (const struct xtmp *xtmp, const struct utmp *utmp)
+compare_entry (const struct utmp *xtmp, const struct utmp *utmp)
{
return
(
#if _HAVE_XT_TYPE - 0
- xtmp->xt_type == utmp->ut_type
+ xtmp->ut_type == utmp->ut_type
#endif
#if _HAVE_XT_PID - 0
- && xtmp->xt_pid == utmp->ut_pid
+ && xtmp->ut_pid == utmp->ut_pid
#endif
- && !strncmp (xtmp->xt_line, utmp->ut_line, XT_LINESIZE - 1)
+ && !strncmp (xtmp->ut_line, utmp->ut_line, XT_LINESIZE - 1)
#if _HAVE_XT_ID - 0
- && !strncmp (xtmp->xt_id, utmp->ut_id, sizeof utmp->ut_id)
+ && !strncmp (xtmp->ut_id, utmp->ut_id, sizeof utmp->ut_id)
#endif
#if _HAVE_UT_TV - 0
- && xtmp->xt_time == utmp->ut_tv.tv_sec
+ && xtmp->ut_tv.tv_sec == utmp->ut_tv.tv_sec
#else
- && xtmp->xt_time == utmp->ut_time
+ && xtmp->ut_time == utmp->ut_time
#endif
- && !strncmp (xtmp->xt_user, utmp->ut_user, XT_NAMESIZE)
+ && !strncmp (xtmp->ut_user, utmp->ut_user, XT_NAMESIZE)
#if _HAVE_XT_HOST - 0
- && !strncmp (xtmp->xt_host, utmp->ut_host, XT_HOSTSIZE - 1)
+ && !strncmp (xtmp->ut_host, utmp->ut_host, XT_HOSTSIZE - 1)
#endif
- && xtmp->xt_addr == utmp->ut_addr);
+ && xtmp->ut_addr == utmp->ut_addr);
}
#ifndef _XTMP_H
#define _XTMP_H 1
-#include <features.h>
#include <sys/time.h>
#include <sys/types.h>
extern void xtmp_to_utmp (const struct xtmp *xtmp, struct utmp *utmp);
extern void utmp_to_xtmp (const struct utmp *utmp, struct xtmp *xtmp);
-extern int compare_entry (const struct xtmp *xtmp,
+extern int compare_entry (const struct utmp *xtmp,
const struct utmp *utmp);
#endif /* xtmp.h */
static Void_t* memalign_check(size_t alignment, size_t bytes);
static Void_t* malloc_starter(size_t sz);
static void free_starter(Void_t* mem);
+static Void_t* malloc_atfork(size_t sz);
+static void free_atfork(Void_t* mem);
#endif
#else
static Void_t* memalign_check();
static Void_t* malloc_starter();
static void free_starter();
+static Void_t* malloc_atfork();
+static void free_atfork();
#endif
#endif
int __malloc_initialized = 0;
+/* The following two functions are registered via thread_atfork() to
+ make sure that the mutexes remain in a consistent state in the
+ fork()ed version of a thread. Also adapt the malloc and free hooks
+ temporarily, because the `atfork' handler mechanism may use
+ malloc/free internally (e.g. in LinuxThreads). */
+
+#if defined(_LIBC) || defined(MALLOC_HOOKS)
+static __malloc_ptr_t (*save_malloc_hook) __MALLOC_P ((size_t __size));
+static void (*save_free_hook) __MALLOC_P ((__malloc_ptr_t __ptr));
+static Void_t* save_arena;
+#endif
+
+static void
+ptmalloc_lock_all __MALLOC_P((void))
+{
+ arena *ar_ptr;
+
+ (void)mutex_lock(&list_lock);
+ for(ar_ptr = &main_arena;;) {
+ (void)mutex_lock(&ar_ptr->mutex);
+ ar_ptr = ar_ptr->next;
+ if(ar_ptr == &main_arena) break;
+ }
+#if defined(_LIBC) || defined(MALLOC_HOOKS)
+ save_malloc_hook = __malloc_hook;
+ save_free_hook = __free_hook;
+ __malloc_hook = malloc_atfork;
+ __free_hook = free_atfork;
+ /* Only the current thread may perform malloc/free calls now. */
+ tsd_getspecific(arena_key, save_arena);
+ tsd_setspecific(arena_key, (Void_t*)0);
+#endif
+}
+
+static void
+ptmalloc_unlock_all __MALLOC_P((void))
+{
+ arena *ar_ptr;
+
+#if defined(_LIBC) || defined(MALLOC_HOOKS)
+ tsd_setspecific(arena_key, save_arena);
+ __malloc_hook = save_malloc_hook;
+ __free_hook = save_free_hook;
+#endif
+ for(ar_ptr = &main_arena;;) {
+ (void)mutex_unlock(&ar_ptr->mutex);
+ ar_ptr = ar_ptr->next;
+ if(ar_ptr == &main_arena) break;
+ }
+ (void)mutex_unlock(&list_lock);
+}
+
/* Initialization routine. */
#if defined(_LIBC)
#if 0
#endif
{
#if defined(_LIBC) || defined(MALLOC_HOOKS)
- __malloc_ptr_t (*save_malloc_hook) __MALLOC_P ((size_t __size));
- void (*save_free_hook) __MALLOC_P ((__malloc_ptr_t __ptr));
const char* s;
#endif
mutex_init(&list_lock);
tsd_key_create(&arena_key, NULL);
tsd_setspecific(arena_key, (Void_t *)&main_arena);
+ thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all);
#endif
#if defined(_LIBC) || defined(MALLOC_HOOKS)
if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
#endif
}
+/* There are platforms (e.g. Hurd) with a link-time hook mechanism. */
+#ifdef thread_atfork_static
+thread_atfork_static(ptmalloc_lock_all, ptmalloc_unlock_all, \
+ ptmalloc_unlock_all)
+#endif
+
#if defined(_LIBC) || defined(MALLOC_HOOKS)
/* Hooks for debugging versions. The initial hooks just call the
chunk_free(&main_arena, p);
}
+/* The following hooks are used while the `atfork' handling mechanism
+ is active. */
+
+static Void_t*
+#if __STD_C
+malloc_atfork(size_t sz)
+#else
+malloc_atfork(sz) size_t sz;
+#endif
+{
+ Void_t *vptr = NULL;
+
+ tsd_getspecific(arena_key, vptr);
+ if(!vptr) {
+ mchunkptr victim = chunk_alloc(&main_arena, request2size(sz));
+ return victim ? chunk2mem(victim) : 0;
+ } else {
+ /* Suspend the thread until the `atfork' handlers have completed.
+ By that time, the hooks will have been reset as well, so that
+ mALLOc() can be used again. */
+ (void)mutex_lock(&list_lock);
+ (void)mutex_unlock(&list_lock);
+ return mALLOc(sz);
+ }
+}
+
+static void
+#if __STD_C
+free_atfork(Void_t* mem)
+#else
+free_atfork(mem) Void_t* mem;
+#endif
+{
+ Void_t *vptr = NULL;
+ arena *ar_ptr;
+ mchunkptr p; /* chunk corresponding to mem */
+
+ if (mem == 0) /* free(0) has no effect */
+ return;
+
+ p = mem2chunk(mem);
+
+#if HAVE_MMAP
+ if (chunk_is_mmapped(p)) /* release mmapped memory. */
+ {
+ munmap_chunk(p);
+ return;
+ }
+#endif
+
+ ar_ptr = arena_for_ptr(p);
+ tsd_getspecific(arena_key, vptr);
+ if(vptr)
+ (void)mutex_lock(&ar_ptr->mutex);
+ chunk_free(ar_ptr, p);
+ if(vptr)
+ (void)mutex_unlock(&ar_ptr->mutex);
+}
+
#endif /* defined(_LIBC) || defined(MALLOC_HOOKS) */
\f
#ifndef _THREAD_M_H
#define _THREAD_M_H
+#undef thread_atfork_static
+
#if defined(_LIBC) /* The GNU C library, a special case of Posix threads */
#include <bits/libc-lock.h>
#define mutex_unlock(m) \
(__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (m) : 0)
+#define thread_atfork(prepare, parent, child) \
+ (__pthread_atfork != NULL ? __pthread_atfork(prepare, parent, child) : 0)
+
#elif defined(MUTEX_INITIALIZER)
/* Assume hurd, with cthreads */
#define tsd_getspecific(key, vptr) \
((vptr) = (void *)*__hurd_threadvar_location (_HURD_THREADVAR_MALLOC))
+#define thread_atfork(prepare, parent, child) do {} while(0)
+#define thread_atfork_static(prepare, parent, child) \
+ text_set_element(_hurd_fork_prepare_hook, prepare); \
+ text_set_element(_hurd_fork_parent_hook, parent); \
+ text_set_element(_hurd_fork_child_hook, child);
+
/* No we're *not* using pthreads. */
#define __pthread_initialize ((void (*)(void))0)
#define tsd_setspecific(key, data) pthread_setspecific(key, data)
#define tsd_getspecific(key, vptr) (vptr = pthread_getspecific(key))
+/* at fork */
+#define thread_atfork(prepare, parent, child) \
+ pthread_atfork(prepare, parent, child)
+
#elif USE_THR /* Solaris threads */
#include <thread.h>
#define tsd_setspecific(key, data) (key[(unsigned)thr_self() % 256] = (data))
#define tsd_getspecific(key, vptr) (vptr = key[(unsigned)thr_self() % 256])
+#define thread_atfork(prepare, parent, child) do {} while(0)
+
#elif USE_SPROC /* SGI sproc() threads */
#include <sys/wait.h>
#define tsd_setspecific(key, data) (((void **)(&PRDA->usr_prda))[key] = data)
#define tsd_getspecific(key, vptr) (vptr = ((void **)(&PRDA->usr_prda))[key])
+#define thread_atfork(prepare, parent, child) do {} while(0)
+
#else /* no _LIBC or USE_... are defined */
#define NO_THREADS
#define tsd_setspecific(key, data) do {} while(0)
#define tsd_getspecific(key, vptr) (vptr = NULL)
+#define thread_atfork(prepare, parent, child) do {} while(0)
+
#endif /* defined(NO_THREADS) */
#endif /* !defined(_THREAD_M_H) */
@comment (none)
@comment XOPEN
@defvr Macro _XOPEN_SOURCE
+@defvrx Macro _XOPEN_SOURCE_EXTENDED
If you define this macro, functionality described in the X/Open
Portability Guide is included. This is a superset of the POSIX.1 and
POSIX.2 functionality and in fact @code{_POSIX_SOURCE} and
@c We need some definitions here.
-@iftex
-@set TEXFORMULAS
-@end iftex
@ifhtml
@set cdot ·
@end ifhtml
+@iftex
+@set cdot @cdot
+@end iftex
+@ifclear cdot
+@set cdot x
+@end ifclear
+@iftex
+@set infty @infty
+@end iftex
+@ifclear infty
+@set infty oo
+@end ifclear
+@macro mul
+@value{cdot}
+@end macro
+@macro infinity
+@value{infty}
+@end macro
@node Mathematics, Arithmetic, Low-Level Terminal Interface, Top
@chapter Mathematics
@cindex domain error
Many of the functions listed in this chapter are defined mathematically
over a domain that is only a subset of real numbers. For example, the
-@code{acos} function is defined over the domain between @code{-1} and
+@code{acos} function is defined over the domain between @code{@minus{}1} and
@code{1}. If you pass an argument to one of these functions that is
outside the domain over which it is defined, the function sets
@code{errno} to @code{EDOM} to indicate a @dfn{domain error}. On
correct result is too large to be represented, the function sets
@code{errno} to @code{ERANGE} to indicate a @dfn{range error}, and
returns a particular very large value (named by the macro
-@code{HUGE_VAL}) or its negation (@w{@code{- HUGE_VAL}}).
+@code{HUGE_VAL}) or its negation (@code{@minus{}HUGE_VAL}).
If the magnitude of the result is too small, a value of zero is returned
instead. In this case, @code{errno} might or might not be
Any operation on a signalling NaN.
@item
Addition or subtraction; magnitude subtraction of infinities such as
-@iftex
-@tex
-$(+\infty) + (-\infty)$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{(+oo) + (-oo)}.
-@end ifclear
+@math{(+@infinity{}) + (-@infinity{})}.
@item
Multiplication:
-@iftex
-@tex
-$0 \cdot \infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@ifset cdot
-@math{0 @value{cdot} oo}.
-@end ifset
-@ifclear cdot
-@math{0 x oo}.
-@end ifclear
-@end ifclear
+@math{0 @mul{} @infinity{}}.
@item
-Division: @math{0/0} or
-@iftex
-@tex
-$\infty/\infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{oo/oo}.
-@end ifclear
+Division: @math{0/0} or @math{@infinity{}/@infinity{}}.
@item
Remainder: @math{x} REM @math{y}, where @math{y} is zero or @math{x} is
infinite.
@item
-Squre root if the operand is less then zero.
+Square root if the operand is less then zero.
@item
Conversion of an internal floating-point number to an integer or to a
decimal string when overflow, infinity, or NaN precludes a faithful
@item Division by Zero
This exception is raised if the devisor is zero and the dividend is a
finite nonzero number. If no trap occurs the result is either
-@iftex
-@tex
-$\infty$
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{+oo}
-@end ifclear
-or
-@iftex
-@tex
-$-\infty$
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{-oo}
-@end ifclear
-, depending on the
+@math{+@infinity{}} or @math{-@infinity{}}, depending on the
signs of the operands.
@item Overflow
current rounding mode (@w{IEEE 754}, @w{section 7.3}):
@enumerate
@item
-Round to nearest carries all overflows to
-@iftex
-@tex
-$\infty$
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{oo}
-@end ifclear
+Round to nearest carries all overflows to @math{@infinity{}}
with the sign of the intermediate result.
@item
-Round towards @math{0} carries all overflows to the precision's largest
+Round toward @math{0} carries all overflows to the precision's largest
finite number with the sign of the intermediate result.
@item
-Round towards
-@iftex
-@tex
-$-\infty$
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{-oo}
-@end ifclear
-carries positive overflows to the
+Round toward @math{-@infinity{}} carries positive overflows to the
precision's largest finite number and carries negative overflows to
-@iftex
-@tex
-$-\infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{-oo}.
-@end ifclear
+@math{-@infinity{}}.
@item
-Round towards
-@iftex
-@tex
-$\infty$
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{oo}
-@end ifclear
-carries negative overflows to the
+Round toward @math{@infinity{}} carries negative overflows to the
precision's most negative finite number and carries positive overflows
-to
-@iftex
-@tex
-$\infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{oo}.
-@end ifclear
+to @math{@infinity{}}.
@end enumerate
@item Underflow
mode is supported by the floating-point implementation the corresponding
of the following macros is defined:
-@vtable @code
+@table @code
@comment fenv.h
@comment ISO
+@vindex FE_TONEAREST
@item FE_TONEAREST
Round to nearest. This is the default mode and should always be used
except when a different mode is explicitely required. Only rounding to
@comment fenv.h
@comment ISO
+@vindex FE_UPWARD
@item FE_UPWARD
-Round toward
-@iftex
-@tex
-$+\infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{+oo}.
-@end ifclear
+Round toward @math{+@infinity{}}.
@comment fenv.h
@comment ISO
+@vindex FE_DOWNWARD
@item FE_DOWNWARD
-Round toward
-@iftex
-@tex
-$-\infty$.
-@end tex
-@end iftex
-@ifclear TEXFORMULAS
-@math{-oo}.
-@end ifclear
+Round toward @math{-@infinity{}}.
@comment fenv.h
@comment ISO
+@vindex FE_TOWARDZERO
@item FE_TOWARDZERO
Round toward zero.
-@end vtable
+@end table
At any time one of the above four rounding modes is selected. To get
information about the currently selected mode one can use this function:
The value is the reziprocal of the square root of the value of the number pi.
@end vtable
-ALl values are defined as @code{long double} values unless the compiler
+All values are defined as @code{long double} values unless the compiler
does not support this type or @code{__STDC__} is not defined (both is
unlikely). Historically the numbers were @code{double} values and some
-old code still relies on this so you might want to add explizit casts if
+old code still relies on this so you might want to add explicit casts if
the extra precision of the @code{long double} value is not needed. One
critical case are functions with a variable number of arguments, such as
@code{printf}.
examples (and perhaps some AT&T headers contain this value). But due to
possible name space problems (@code{PI} is a quite frequently used name)
this value is not added to @file{math.h}. Every program should use
-@code{M_PI} instead or add on the the compiler command line
+@code{M_PI} instead or add on the compiler command line
@code{-DPI=M_PI}.
@comment ISO
@deftypefn {Macro} int isgreater (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
This macro determines whether the argument @var{x} is greater than
-@var{y}. This is equivalent to @math{(x) > (y)} but no exception is
-raised if @var{x} or @var{y} are unordered.
+@var{y}. This is equivalent to @code{(@var{x}) > (@var{y})} but no
+exception is raised if @var{x} or @var{y} are unordered.
@end deftypefn
@comment math.h
@comment ISO
@deftypefn {Macro} int isgreaterequal (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
This macro determines whether the argument @var{x} is greater than or
-equal to @var{y}. This is equivalent to @math{(x) >= (y)} but no
+equal to @var{y}. This is equivalent to @code{(@var{x}) >= (@var{y})} but no
exception is raised if @var{x} or @var{y} are unordered.
@end deftypefn
@comment ISO
@deftypefn {Macro} int isless (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
This macro determines whether the argument @var{x} is less than @var{y}.
-This is equivalent @math{(x) < (y)} but no exception is raised if
+This is equivalent @code{(@var{x}) < (@var{y})} but no exception is raised if
@var{x} or @var{y} are unordered.
@end deftypefn
@comment ISO
@deftypefn {Macro} int islessequal (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
This macro determines whether the argument @var{x} is less than or equal
-to @var{y}. This is equivalent to @math{(x) <= (y)} but no exception
-is raised if @var{x} or @var{y} are unordered.
+to @var{y}. This is equivalent to @code{(@var{x}) <= (@var{y})} but no
+exception is raised if @var{x} or @var{y} are unordered.
@end deftypefn
@comment math.h
@comment ISO
@deftypefn {Macro} int islessgreater (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
This macro determines whether the argument @var{x} is less or greater
-than @var{y}. This is equivalent to @math{(x) < (y) || (x) > (y)}
-(except that @var{x} and @var{y} are only evaluated once) but no
-exception is raised if @var{x} or @var{y} are unordered.
+than @var{y}. This is equivalent to @code{(@var{x}) < (@var{y}) ||
+(@var{x}) > (@var{y})} (except that @var{x} and @var{y} are only
+evaluated once) but no exception is raised if @var{x} or @var{y} are
+unordered.
@end deftypefn
@comment math.h
evaluated exactly once and so they can be used exactly like the builtin
operators.
-On several platform these macros are mapped to very efficient functions
+On several platform these macros are mapped to efficient instructions
the processor understands. But on machines missing these functions, the
macros above might be rather slow. So it is best to use the builtin
operators unless it is necessary to use unordered comparisons.
cosine of @var{x} in @code{*@var{cos}}, where @var{x} is given in
radians. Both values, @code{*@var{sinx}} and @code{*@var{cosx}}, are in
the range of @code{-1} to @code{1}.
+
+This function is a GNU extension. It should be used whenever both sine
+and cosine are needed but in protable applications there should be a
+fallback method for systems without this function.
@end deftypefun
@cindex complex trigonometric functions
@comment stdlib.h
@comment ISO
-@deftypefun int rand ()
+@deftypefun int rand (void)
The @code{rand} function returns the next pseudo-random number in the
series. The value is in the range from @code{0} to @code{RAND_MAX}.
@end deftypefun
@comment stdlib.h
@comment BSD
-@deftypefun {long int} random ()
+@deftypefun {int32_t} random (void)
This function returns the next pseudo-random number in the sequence.
The range of values returned is from @code{0} to @code{RAND_MAX}.
+
+@strong{Please note:} Historically this function returned a @code{long
+int} value. But with the appearence of 64bit machines this could lead
+to severe compatibility problems and therefore the type now explicitly
+limits the return value to 32bit.
@end deftypefun
@comment stdlib.h
check_isinfn ("cbrt (-inf) == -inf", FUNC(cbrt) (minus_infty));
check_isnan ("cbrt (NaN) == NaN", FUNC(cbrt) (nan_value));
#endif
- check ("cbrt (-0.001) == -0.1", FUNC(cbrt) (-0.001), -0.1);
+ check_eps ("cbrt (-0.001) == -0.1", FUNC(cbrt) (-0.001), -0.1,
+ CHOOSE (5e-18L, 0, 0));
check_eps ("cbrt (8) == 2", FUNC(cbrt) (8), 2, CHOOSE (5e-17L, 0, 0));
check_eps ("cbrt (-27) == -3", FUNC(cbrt) (-27.0), -3.0,
CHOOSE (3e-16L, 0, 0));
expm1_test (void)
{
check ("expm1 (+0) == 0", FUNC(expm1) (0), 0);
+#ifndef TEST_INLINE
check ("expm1 (-0) == -0", FUNC(expm1) (minus_zero), minus_zero);
check_isinfp ("expm1 (+inf) == +inf", FUNC(expm1) (plus_infty));
check ("expm1 (-inf) == -1", FUNC(expm1) (minus_infty), -1);
+#endif
check_eps ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0,
CHOOSE (4e-18L, 0, 0));
static void
identities2_test (MATHTYPE x, MATHTYPE epsilon)
{
+#ifndef TEST_INLINE
MATHTYPE res1, res2, res3, res4, diff;
int result;
result = check_equal (res4, res3, epsilon, &diff);
output_result_ext ("sin/cos == tan", result,
res4, res3, diff, x, PRINT, PRINT);
+#endif
}
-/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1996, 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
#endif
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
- || defined (WIN32))
+ || defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#endif
#endif
-#if defined (WIN32) && !defined (__CYGWIN32__)
+#if defined (_WINDOWS32) && !defined (__CYGWIN32__)
/* It's not Unix, really. See? Capital letters. */
#include <windows.h>
#define getpid() GetCurrentProcessId()
/* #define NDEBUG 1 */
#include <assert.h>
+#include <stdio.h> /* Needed on stupid SunOS for assert. */
+
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
#endif
#endif
-#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32)
+#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32)
#include <pwd.h>
#endif
#endif
-#if (defined (POSIX) || defined (WIN32)) && !defined (__GNU_LIBRARY__)
+#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
#define REAL_DIR_ENTRY(dp) 1
__inline
#endif
#ifndef __SASC
-#ifdef WIN32
+#ifdef WINDOWS32
static void *
#else
static char *
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
-#ifdef WIN32
+#ifdef WINDOWS32
#include <malloc.h>
#else
extern char *alloca ();
-#endif /* WIN32 */
+#endif /* WINDOWS32 */
#endif /* Not _AIX. */
#endif /* sparc or HAVE_ALLOCA_H. */
#endif /* GCC. */
inline
#endif
const char *
-next_brace_sub (const char *begin)
+next_brace_sub (begin)
+ const char *begin;
{
unsigned int depth = 0;
const char *cp = begin;
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:";
#else
-#ifdef WIN32
+#ifdef WINDOWS32
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "c:/users/default"; /* poor default */
#else
if (home_dir == NULL || home_dir[0] == '\0')
{
- extern char *getlogin __P ((void));
- extern int getlogin_r __P ((char *, size_t));
int success;
-
#if defined HAVE_GETLOGIN_R || defined _LIBC
+ extern int getlogin_r __P ((char *, size_t));
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
char *name;
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
a moderate value. */
buflen = 16;
- name = __alloca (buflen);
+ name = (char *) __alloca (buflen);
success = getlogin_r (name, buflen) >= 0;
#else
+ extern char *getlogin __P ((void));
char *name;
+
success = (name = getlogin ()) != NULL;
#endif
if (success)
char *pwtmpbuf;
struct passwd pwbuf, *p;
- pwtmpbuf = __alloca (pwbuflen);
+ pwtmpbuf = (char *) __alloca (pwbuflen);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
pwbuflen, &p) >= 0);
}
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = (char *) "~"; /* No luck. */
-#endif /* WIN32 */
+#endif /* WINDOWS32 */
#endif
/* Now construct the full directory. */
if (dirname[1] == '\0')
{
char *newp;
size_t home_len = strlen (home_dir);
- newp = __alloca (home_len + dirlen);
+ newp = (char *) __alloca (home_len + dirlen);
memcpy (newp, home_dir, home_len);
memcpy (&newp[home_len], &dirname[1], dirlen);
dirname = newp;
}
}
-#if !defined _AMIGA && !defined WIN32
+#if !defined _AMIGA && !defined WINDOWS32
else
{
char *end_name = strchr (dirname, '/');
user_name = dirname + 1;
else
{
- user_name = __alloca (end_name - dirname);
+ user_name = (char *) __alloca (end_name - dirname);
memcpy (user_name, dirname + 1, end_name - dirname);
user_name[end_name - dirname - 1] = '\0';
}
{
#if defined HAVE_GETPWNAM_R || defined _LIBC
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
- char *pwtmpbuf = __alloca (buflen);
+ char *pwtmpbuf = (char *) __alloca (buflen);
struct passwd pwbuf, *p;
if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
home_dir = p->pw_dir;
char *newp;
size_t home_len = strlen (home_dir);
size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
- newp = __alloca (home_len + rest_len + 1);
+ newp = (char *) __alloca (home_len + rest_len + 1);
memcpy (newp, home_dir, home_len);
memcpy (&newp[home_len], end_name, rest_len);
newp[home_len + rest_len] = '\0';
dirname = newp;
}
}
-#endif /* Not Amiga && not Win32. */
+#endif /* Not Amiga && not WINDOWS32. */
}
#endif /* Not VMS. */
#undef __ptr_t
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
- || defined (WIN32))
+ || defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#define __ptr_t void *
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE)
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE) || defined (_GNU_SOURCE)
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
# The dynamic loader also requires different names.
i.86-.*-linux.* ld=ld-linux.so.2
sparc-.*-linux.* ld=ld-linux.so.2
-sparc64-.*-linux.* ld=ld-linux.so.2
+sparc64-.*-linux.* ld=ld-linux64.so.2
alpha-.*-linux.* ld=ld-linux.so.2
# We use the ELF ABI standard name for the default.
.*-.*-.* ld=ld.so.1
Boston, MA 02111-1307, USA. */
#include <gmp-mparam.h>
-#include "../stdlib/gmp.h"
-#include "../stdlib/gmp-impl.h"
-#include "../stdlib/longlong.h"
+#include <stdlib/gmp.h>
+#include <stdlib/gmp-impl.h>
+#include <stdlib/longlong.h>
#include "_itoa.h"
fmtmsg (long int classification, const char *label, int severity,
const char *text, const char *action, const char *tag)
{
- __libc_once_define (once);
+ __libc_once_define (static, once);
int result = MM_OK;
struct severity_info *severity_rec;
/* The gmp headers need some configuration frobs. */
#define HAVE_ALLOCA 1
-#include "gmp.h"
-#include "gmp-impl.h"
+#include <gmp.h>
+#include <gmp-impl.h>
#include <gmp-mparam.h>
-#include "longlong.h"
+#include <longlong.h>
#include "fpioconst.h"
#define NDEBUG 1
/* Bits in `sa_flags'. */
#ifdef __USE_BSD
-#define SA_ONSTACK 0x1 /* Take signal on signal stack. */
-#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */
-#define SA_DISABLE 0x4 /* Disable alternate signal stack. */
+# define SA_ONSTACK 0x1 /* Take signal on signal stack. */
+# define SA_RESTART 0x2 /* Restart syscall on signal return. */
+# define SA_DISABLE 0x4 /* Disable alternate signal stack. */
#endif
#define SA_NOCLDSTOP 0x8 /* Don't send SIGCHLD when children stop. */
#include <fcntl.h>
#include <link.h>
#include <unistd.h>
+#include <stdio-common/_itoa.h>
#include <dl-machine.h>
int __libc_enable_secure;
int __libc_multiple_libcs; /* Defining this here avoids the inclusion
of init-first. */
+static ElfW(auxv_t) *_dl_auxv;
ElfW(Addr)
_dl_sysdep_start (void **start_argptr,
seen = 0;
#define M(type) (1 << (type))
- for (av = (void *) ++start_argptr;
+ for (av = _dl_auxv = (void *) ++start_argptr;
av->a_type != AT_NULL;
seen |= M ((++av)->a_type))
switch (av->a_type)
_dl_sysdep_start_cleanup (void)
{
}
+
+void
+_dl_show_auxv (void)
+{
+ char buf[64];
+ ElfW(auxv_t) *av;
+
+ /* Terminate string. */
+ buf[63] = '\0';
+
+ for (av = _dl_auxv; av->a_type != AT_NULL; ++av)
+ switch (av->a_type)
+ {
+ case AT_PHDR:
+ _dl_sysdep_message ("AT_PHDR: 0x",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 16, 0),
+ "\n", NULL);
+ break;
+ case AT_PHNUM:
+ _dl_sysdep_message ("AT_PHNUM: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_PAGESZ:
+ _dl_sysdep_message ("AT_PAGESZ: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_ENTRY:
+ _dl_sysdep_message ("AT_ENTRY: 0x",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 16, 0),
+ "\n", NULL);
+ break;
+ case AT_UID:
+ _dl_sysdep_message ("AT_UID: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_GID:
+ _dl_sysdep_message ("AT_GID: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_EUID:
+ _dl_sysdep_message ("AT_EUID: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_EGID:
+ _dl_sysdep_message ("AT_EGID: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ case AT_PLATFORM:
+ _dl_sysdep_message ("AT_PLATFORM: ", av->a_un.a_ptr, NULL);
+ break;
+ case AT_HWCAP:
+ /* Well, what shall we use? A string or an integer with bits? */
+ _dl_sysdep_message ("AT_HWCAP: ",
+ _itoa_word (av->a_un.a_val, buf + sizeof buf - 1,
+ 10, 0),
+ "\n", NULL);
+ break;
+ }
+}
#endif
-#if defined __GNUC__ && \
- (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7))
-/* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double'
- functions so we disable this now. */
-# undef __NO_MATH_INLINES
-# define __NO_MATH_INLINES
-#endif
-
-
#ifdef __GNUC__
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* The argument range of this inline version is reduced. */
__inline_mathop (cos, "fcos")
-__inline_mathop_decl (atan, "fpatan", "u" (__x), "0" (1.0) : "st(1)")
+__inline_mathop (atan, "fld1; fpatan")
__inline_mathop (log, "fldln2; fxch; fyl2x")
__inline_mathop (log10, "fldlg2; fxch; fyl2x")
__inline_mathcode (asinh, __x, \
register long double __y = __fabsl (__x); \
return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y) \
- * __sgn1l (__x))
+ * __sgn1l (__x)))
__inline_mathcode (acosh, __x, \
return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)))
return __mach_msg (msg, option, send_size, rcv_size, rcv_name,
timeout, notify);
}
+
+
+void
+_dl_show_auxv (void)
+{
+ /* There is nothing to print. Hurd has no auxiliary vector. */
+}
-wordsize-32
# SPARC uses IEEE 754 floating point.
ieee754
--- /dev/null
+/* Copyright (C) 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 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. */
+
+#ifndef _MATH_H
+#error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+/* FIXME! This file describes properties of the compiler, not the machine;
+ it should not be part of libc! */
+
+#ifdef __GNUC__
+#if __STDC__ == 1
+
+/* In GNU or ANSI mode, gcc leaves `float' expressions as-is. */
+typedef float float_t;
+typedef double double_t;
+
+/* Signal that types stay as they were declared. */
+#define FLT_EVAL_METHOD 0
+
+/* Define `INFINITY' as value of type `float_t'. */
+#define INFINITY HUGE_VALF
+
+#else
+
+/* For `gcc -traditional', `float' expressions are evaluated as `double'. */
+typedef double float_t;
+typedef double double_t;
+
+/* Signal that both types are `double'. */
+#define FLT_EVAL_METHOD 1
+
+/* Define `INFINITY' as value of type `float_t'. */
+#define INFINITY HUGE_VAL
+
+#endif
+#else
+
+/* Wild guess at types for float_t and double_t. */
+typedef double float_t;
+typedef double double_t;
+
+/* Strange compiler, we don't know how it works. */
+#define FLT_EVAL_METHOD -1
+
+/* Define `INFINITY' as value of type `float_t'. */
+#define INFINITY HUGE_VAL
+
+#endif
--- /dev/null
+/* Clear given exceptions in current floating-point environment.
+ Copyright (C) 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 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 <fenv.h>
+
+void
+feclearexcept (int excepts)
+{
+ fenv_t tmp;
+
+ __fenv_stfsr (tmp);
+
+ tmp &= ~(excepts & FE_ALL_EXCEPT);
+
+ __fenv_ldfsr (tmp);
+}
--- /dev/null
+/* Store current floating-point environment.
+ Copyright (C) 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 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 <fenv.h>
+
+void
+fegetenv (fenv_t *envp)
+{
+ __fenv_stfsr (*envp);
+}
--- /dev/null
+/* Return current rounding direction.
+ Copyright (C) 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 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 <fenv.h>
+
+int
+fegetround (void)
+{
+ fenv_t tmp;
+
+ __fenv_stfsr (tmp);
+
+ return tmp & __FE_ROUND_MASK;
+}
--- /dev/null
+/* Store current floating-point environment and clear exceptions.
+ Copyright (C) 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 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 <fenv.h>
+
+int
+feholdexcept (fenv_t *envp)
+{
+ fenv_t tmp;
+
+ __fenv_stfsr (*envp);
+
+ /* Set all exceptions to non-stop. */
+ tmp = *envp | (0x1f << 23);
+
+ __fenv_ldfsr (tmp);
+
+ return 1;
+}
-/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Sparc64 version.
+/* Install given floating-point environment.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <sysdep.h>
-
-ENTRY(setjmp)
-
-#ifdef PIC
-1: rd %pc,%g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
- or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
- add %g1,%g2,%g1
- sethi %hi(C_SYMBOL_NAME(__sigsetjmp)),%g2
- or %g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2
- ld [%g1+%g2], %g1
-#else
- sethi %hi(C_SYMBOL_NAME(__sigsetjmp)), %g1
- or %lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1
- add %g1, %g4, %g1
-#endif
-
- jmp %g1
- mov 1, %o1 /* Pass second argument of one. */
-
-END(setjmp)
+#include <fenv.h>
+
+void
+fesetenv (const fenv_t *envp)
+{
+ fenv_t dummy;
+
+ /* Put these constants in memory explicitly, so as to cope with a
+ -fPIC bug as of gcc 970624. Making them automatic is quicker
+ than loading up the pic register in this instance. */
+
+ if (envp == FE_DFL_ENV)
+ {
+ dummy = 0;
+ envp = &dummy;
+ }
+ else if (envp == FE_NOMASK_ENV)
+ {
+ dummy = 0x1f << 23;
+ envp = &dummy;
+ }
+
+ __fenv_ldfsr (*envp);
+}
--- /dev/null
+/* Set current rounding direction.
+ Copyright (C) 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 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 <fenv.h>
+
+int
+fesetround (int round)
+{
+ fenv_t tmp;
+
+ if ((round & ~__FE_ROUND_MASK) != 0)
+ /* ROUND is no valid rounding mode. */
+ return 0;
+
+ __fenv_stfsr (tmp);
+ tmp &= ~__FE_ROUND_MASK;
+ tmp |= round;
+ __fenv_ldfsr (tmp);
+
+ return 1;
+}
-/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Sparc64 version.
+/* Install given floating-point environment and raise exceptions.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <sysdep.h>
+#include <fenv.h>
-ENTRY(_setjmp)
+void
+feupdateenv (const fenv_t *envp)
+{
+ fexcept_t tmp;
-#ifdef PIC
-1: rd %pc,%g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
- or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2
- add %g1,%g2,%g1
- sethi %hi(C_SYMBOL_NAME(__sigsetjmp)),%g2
- or %g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2
- ld [%g1+%g2], %g1
-#else
- sethi %hi(C_SYMBOL_NAME(__sigsetjmp)), %g1
- or %lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1
- add %g1, %g4, %g1
-#endif
+ /* Save current exceptions. */
+ __fenv_stfsr (tmp);
+ tmp &= FE_ALL_EXCEPT;
- jmp %g1
- mov %g0, %o1 /* Pass second argument of zero. */
+ /* Install new environment. */
+ fesetenv (envp);
-END(_setjmp)
-
-strong_alias(_setjmp, __setjmp)
+ /* Raise the safed exception. Incidently for us the implementation
+ defined format of the values in objects of type fexcept_t is the
+ same as the ones specified using the FE_* constants. */
+ feraiseexcept ((int) tmp);
+}
--- /dev/null
+/* Store current representation for exceptions.
+ Copyright (C) 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 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 <fenv.h>
+
+void
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+ fexcept_t tmp;
+
+ /* Get the current exceptions. */
+ __fenv_stfsr (tmp);
+
+ *flagp = tmp & excepts & FE_ALL_EXCEPT;
+}
--- /dev/null
+/* Raise given exceptions.
+ Copyright (C) 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 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 <fenv.h>
+#include <math.h>
+
+static void
+ignore_me(double foo)
+{
+}
+
+void
+feraiseexcept (int excepts)
+{
+ /* Raise exceptions represented by EXPECTS. But we must raise only
+ one signal at a time. It is important the if the overflow/underflow
+ exception and the inexact exception are given at the same time,
+ the overflow/underflow exception follows the inexact exception. */
+
+ /* First: invalid exception. */
+ if ((FE_INVALID & excepts) != 0)
+ {
+ /* One example of a invalid operation is 0/0. */
+ ignore_me (0.0 / 0.0);
+ }
+
+ /* Next: division by zero. */
+ if ((FE_DIVBYZERO & excepts) != 0)
+ {
+ ignore_me (1.0 / 0.0);
+ }
+
+ /* Next: overflow. */
+ if ((FE_OVERFLOW & excepts) != 0)
+ {
+ ignore_me (LDBL_MAX * LDBL_MAX);
+ }
+
+ /* Next: underflow. */
+ if ((FE_UNDERFLOW & excepts) != 0)
+ {
+ ignore_me (LDBL_MIN / 16.0);
+ }
+
+ /* Last: inexact. */
+ if ((FE_INEXACT & excepts) != 0)
+ {
+ ignore_me (1.0 / M_PI);
+ }
+}
--- /dev/null
+/* Set floating-point environment exception handling.
+ Copyright (C) 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 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 <fenv.h>
+#include <math.h>
+
+void
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+ fenv_t tmp;
+
+ __fenv_stfsr (tmp);
+
+ tmp &= ~(excepts & FE_ALL_EXCEPT);
+ tmp |= *flagp & excepts & FE_ALL_EXCEPT;
+
+ __fenv_ldfsr (tmp);
+}
--- /dev/null
+/* Test exception in current environment.
+ Copyright (C) 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 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 <fenv.h>
+
+int
+fetestexcept (int excepts)
+{
+ int tmp;
+
+ __fenv_stfsr (tmp);
+
+ return tmp & excepts & FE_ALL_EXCEPT;
+}
--- /dev/null
+wordsize-32
return *got;
}
-
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr
elf_machine_load_address (void)
{
+ register Elf32_Addr pc __asm("%o7"), got;
+
+ /* Utilize the fact that a local .got entry will be partially
+ initialized at startup awaiting its RELATIVE fixup. */
+
+ __asm("sethi %%hi(.Load_address),%1\n"
+ ".Load_address:\n\t"
+ "call 1f\n\t"
+ "or %1,%%lo(.Load_address),%1\n"
+ "1:\tld [%%l7+%1],%1"
+ : "=r"(pc), "=r"(got));
+
+ return pc - got;
+}
+
Elf32_Addr addr;
asm (
/* The SPARC never uses Elf32_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
+/* The SPARC overlaps DT_RELA and DT_PLTREL. */
+#define ELF_MACHINE_PLTREL_OVERLAP 1
/* Set up the loaded object described by L so its unrelocated PLT
entries will jump to the on-demand fixup code in dl-runtime.c. */
--- /dev/null
+/* Copyright (C) 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 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. */
+
+#ifndef _FENV_H
+#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception. We use the bit positions
+ of the appropriate accrued exception bits from the FSR. */
+enum
+ {
+ FE_INVALID = (1 << 9),
+#define FE_INVALID FE_INVALID
+ FE_OVERFLOW = (1 << 8),
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_UNDERFLOW = (1 << 7),
+#define FE_UNDERFLOW FE_UNDERFLOW
+ FE_DIVBYZERO = (1 << 6),
+#define FE_DIVBYZERO FE_DIVBYZERO
+ FE_INEXACT = (1 << 5)
+#define FE_INEXACT FE_INEXACT
+ };
+
+#define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The Sparc FPU supports all of the four defined rounding modes. We
+ use again the bit positions in the FPU control word as the values
+ for the appropriate macros. */
+enum
+ {
+ FE_TONEAREST = (0U << 30),
+#define FE_TONEAREST FE_TONEAREST
+ FE_TOWARDSZERO = (1U << 30),
+#define FE_TOWARDSZERO FE_TOWARDSZERO
+ FE_UPWARD = (2U << 30),
+#define FE_UPWARD FE_UPWARD
+ FE_DOWNWARD = (3U << 30)
+#define FE_DOWNWARD FE_DOWNWARD
+ };
+
+#define __FE_ROUND_MASK (3U << 30)
+
+/* Type representing exception flags. */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment. */
+typedef unsigned int fenv_t;
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked. */
+# define FE_NOMASK_ENV ((fenv_t *) -2)
+#endif
+
+/* For internal use only: access the fp state register. */
+#define __fenv_stfsr(X) __asm__("stfsr %0" : "=m"(X))
+#define __fenv_ldfsr(X) __asm__ __volatile__("ldfsr %0" : : "m"(X))
! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-!
! Added PIC support - May/96, Miguel de Icaza
! INPUT PARAMETERS
.text
.align 8
-LC0: .double 0r4294967296
-LC1: .double 0r2147483648
+
+ .type two_to_32,@object
+two_to_32:
+ .double 0r4294967296
+ .size two_to_32,8
+
+ .type two_to_31,@object
+two_to_31:
+ .double 0r2147483648
+ .size two_to_31,8
.align 4
.global __udiv_qrnnd
st %i1,[%fp-8]
ld [%fp-8],%f10
#ifdef PIC
-._XL11:
- call ._XL1
+.Lbase: call 1f
fitod %f10,%f4
-._XL1:
- sub %o7,(._XL11-LC0),%o7
- ldd [%o7],%f8
+1: ldd [%o7-(.Lbase-two_to_32)],%f8
#else
- sethi %hi(LC0),%o7
+ sethi %hi(two_to_32),%o7
fitod %f10,%f4
- ldd [%o7+%lo(LC0)],%f8
+ ldd [%o7+%lo(two_to_32)],%f8
#endif
cmp %i1,0
bge L248
mov %i0,%i5
faddd %f4,%f8,%f4
-L248:
+.L248:
st %i2,[%fp-8]
ld [%fp-8],%f10
fmuld %f4,%f8,%f6
bge L249
fitod %f10,%f2
faddd %f2,%f8,%f2
-L249:
+.L249:
st %i3,[%fp-8]
faddd %f6,%f2,%f2
ld [%fp-8],%f10
bge L250
fitod %f10,%f4
faddd %f4,%f8,%f4
-L250:
+.L250:
fdivd %f2,%f4,%f2
#ifdef PIC
-._XL22:
- call ._XL2
- nop
-._XL2:
- sub %o7,(._XL22-LC1),%o7
- ldd [%o7],%f4
+ ldd [%o7-(.Lbase-two_to_31)],%f4
#else
- sethi %hi(LC1),%o7
- ldd [%o7+%lo(LC1)],%f4
+ sethi %hi(two_to_31),%o7
+ ldd [%o7+%lo(two_to_31)],%f4
#endif
fcmped %f2,%f4
nop
st %f2,[%fp-8]
b L252
ld [%fp-8],%i4
-L251:
+.L251:
fdtoi %f2,%f2
st %f2,[%fp-8]
ld [%fp-8],%i4
sethi %hi(-2147483648),%g2
xor %i4,%g2,%i4
-L252:
+.L252:
wr %g0,%i4,%y
sra %i3,31,%g2
and %i4,%g2,%g2
st %o7,[%i5]
ret
restore
-L253:
+.L253:
blu L246
mov %i4,%i0
add %i4,1,%i0
sub %o7,%i3,%o7
-L246:
+.L246:
st %o7,[%i5]
ret
restore
+
+ .size __udiv_qrnnd, .-__udiv_qrnnd
--- /dev/null
+wordsize-64
# But we do need these few functions to even link stdio proggies
ifeq ($(subdir),math)
-sysdep_routines += s_isinfl s_isnanl
+sysdep_routines += s_isinfl s_isnanl s_finitel s_signbitl
endif
#include <sysdep.h>
+/* Translate a processor-specific dynamic tag to the index into l_info. */
+#define DT_SPARC(x) (DT_SPARC_##x - DT_LOPROC + DT_NUM)
+
/* Return nonzero iff E_MACHINE is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf64_Half e_machine)
return e_machine == EM_SPARC64;
}
-
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
first element of the GOT. This must be inlined in a function which
uses global data. */
static inline Elf64_Addr
elf_machine_dynamic (void)
{
- register Elf64_Addr *got asm ("%l7");
- return *got;
+ register Elf64_Addr elf_pic_register __asm__("%l7");
+
+ return *(Elf64_Addr *)elf_pic_register;
}
static inline Elf64_Addr
elf_machine_load_address (void)
{
- Elf64_Addr here;
+ register Elf64_Addr elf_pic_register __asm__("%l7");
+ Elf64_Addr pc, la;
+
+ /* Utilize the fact that a local .got entry will be partially
+ initialized at startup awaiting its RELATIVE fixup. */
- __asm("rd %pc,%0\n\t"
- "ba 1f\n\t"
- " add %0,12,%0\n\t"
- ".weak __load_address_undefined\n\t"
- "call __load_address_undefined\n"
- "1:"
- : "=r"(here));
+ __asm("sethi %%hi(.Load_address), %1\n"
+ ".Load_address:\n\t"
+ "rd %%pc, %0\n\t"
+ "or %1, %%lo(.Load_address), %1\n\t"
+ : "=r"(pc), "=r"(la));
- return here + (*(int *)here << 2);
+ return pc - *(Elf64_Addr *)(elf_pic_register + la);
}
#ifdef RESOLVE
const Elf64_Sym *sym, const struct r_found_version *version,
Elf64_Addr *const reloc_addr)
{
- Elf64_Addr loadbase;
-
#ifndef RTLD_BOOTSTRAP
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
reference weak so static programs can still link. This declaration
#ifndef RTLD_BOOTSTRAP
if (map != &_dl_rtld_map) /* Already done in rtld itself. */
#endif
- *reloc_addr += map->l_addr + reloc->r_addend;
+ *reloc_addr = map->l_addr + reloc->r_addend;
}
else
{
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;
+
+ case R_SPARC_64:
case R_SPARC_GLOB_DAT:
- /* case R_SPARC_64: */
- case R_SPARC_JMP_SLOT:
*reloc_addr = value;
break;
case R_SPARC_8:
*(unsigned *)reloc_addr = (*(unsigned *)reloc_addr & 0xffc00000)
| (value >> 10);
break;
+
+ case R_SPARC_JMP_SLOT:
+ {
+ Elf64_Dyn *pltfmt = map->l_info[DT_SPARC(PLTFMT)];
+ switch (pltfmt ? pltfmt->d_un.d_val : 0)
+ {
+ case 1: /* .got.plt with absolute addresses */
+ *reloc_addr = value;
+ break;
+ case 2: /* .got.plt with got-relative addresses */
+ *reloc_addr = value - (map->l_info[DT_PLTGOT]->d_un.d_ptr
+ + map->l_addr);
+ break;
+ default:
+ assert (! "unexpected .plt format type");
+ }
+ }
+ break;
+
case R_SPARC_NONE: /* Alright, Wilbur. */
break;
default:
/* The SPARC never uses Elf64_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
+/* The SPARC overlaps DT_RELA and DT_PLTREL. */
+#define ELF_MACHINE_PLTREL_OVERLAP 1
/* Set up the loaded object described by L so its unrelocated PLT
entries will jump to the on-demand fixup code in dl-runtime.c. */
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
{
Elf64_Addr *got;
- extern void _dl_runtime_resolve (Elf64_Word);
+ extern void _dl_runtime_resolve (void);
if (l->l_info[DT_JMPREL] && lazy)
{
.type _dl_runtime_resolve, @function
_dl_runtime_resolve:
save %sp, -160, %sp
- mov %g1, %o1
+ mov %g5, %o0
call fixup
- mov %g2, %o0
+ mov %g6, %o1
jmp %o0
restore
.size _dl_runtime_resolve, .-_dl_runtime_resolve
#define elf_machine_relplt elf_machine_rela
-/* Mask identifying addresses reserved for the user program,
- where the dynamic linker should not map anything. */
-#define ELF_MACHINE_USER_ADDRESS_MASK ???
-
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
call _dl_start
add %sp," __S(STACK_BIAS) "+22*8,%o0
/* FALLTHRU */
+ .size _start, .-_start
.global _dl_start_user
.type _dl_start_user, @function
_dl_start_user:
/* Load the GOT register. */
-1: rd %pc,%g1
+1: call 11f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
- or %l2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
- add %l7,%g1,%l7
+11: or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+ add %l7,%o7,%l7
/* Save the user entry point address in %l0. */
mov %o0,%l0
/* See if we were run as a command with the executable file name as an
- extra leading argument. If so, adjust the stack pointer. */
+ extra leading argument. If so, we must shift things around since we
+ must keep the stack doubleword aligned. */
sethi %hi(_dl_skip_args), %g2
or %g2, %lo(_dl_skip_args), %g2
- ld [%l7+%g2], %i0
+ ldx [%l7+%g2], %i0
+ ld [%i0], %i0
brz,pt %i0, 2f
- ldx [%sp+" __S(STACK_BIAS) "+22*8], %i1
+ nop
+ /* Find out how far to shift. */
+ ldx [%sp+" __S(STACK_BIAS) "+22*8], %i1
sub %i1, %i0, %i1
sllx %i0, 3, %i2
- add %sp, %i2, %sp
stx %i1, [%sp+" __S(STACK_BIAS) "+22*8]
+ add %sp, " __S(STACK_BIAS) "+23*8, %i1
+ add %i1, %i2, %i2
+ /* Copy down argv. */
+12: ldx [%i2], %i3
+ add %i2, 8, %i2
+ stx %i3, [%i1]
+ brnz,pt %i3, 12b
+ add %i1, 8, %i1
+ /* Copy down envp. */
+13: ldx [%i2], %i3
+ add %i2, 8, %i2
+ stx %i3, [%i1]
+ brnz,pt %i3, 13b
+ add %i1, 8, %i1
+ /* Copy down auxiliary table. */
+14: ldx [%i2], %i3
+ ldx [%i2+8], %i4
+ add %i2, 16, %i2
+ stx %i3, [%i1]
+ stx %i4, [%i1+8]
+ brnz,pt %i3, 13b
+ add %i1, 16, %i1
/* Load _dl_default_scope[2] to pass to _dl_init_next. */
2: sethi %hi(_dl_default_scope), %g2
- or %g2, %lo(_dl_defalt_scope), %g2
- add %g2, 2*8, %g2
- ldx [%l7+%g2], %l1
+ or %g2, %lo(_dl_default_scope), %g2
+ ldx [%l7+%g2], %g2
+ ldx [%g2+2*8], %l1
/* Call _dl_init_next to return the address of an initializer to run. */
3: call _dl_init_next
mov %l1, %o0
/* Clear the startup flag. */
4: sethi %hi(_dl_starting_up), %g2
or %g2, %lo(_dl_starting_up), %g2
- st %g0, [%l7+%g2]
- /* Pass our finalizer function to the user in %g1
+ ldx [%l7+%g2], %g2
+ st %g0, [%g2]
+ /* Pass our finalizer function to the user in %g1. */
sethi %hi(_dl_fini), %g1
or %g1, %lo(_dl_fini), %g1
ldx [%l7+%g1], %g1
--- /dev/null
+/* Destructor cleanup code for elf64-sparc
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
+
+ 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. */
+
+
+.section ".ctors",#alloc,#write
+
+ .align 8
+__CTOR_LIST__:
+ .xword -1
+
+.section ".dtors",#alloc,#write
+
+ .align 8
+__DTOR_LIST__:
+ .xword -1
+
+.section ".fini",#alloc,#execinstr
+
+ call __do_global_dtors_aux
+ nop
+
+.text
+
+ .align 4
+ .type __do_global_dtors_aux,#function
+__do_global_dtors_aux:
+ save %sp,-160,%sp
+
+#ifdef PIC
+1: call 11f
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+ add %l7, %o7, %l7
+ sethi %hi(__DTOR_LIST__), %l0
+ or %l0, %lo(__DTOR_LIST__), %l0
+ ldx [%l7+%l0], %l0
+#else
+ sethi %hi(__DTOR_LIST__), %l0
+ or %l0, %lo(__DTOR_LIST__), %l0
+ add %l0, %g4, %l0
+#endif
+
+ ba 3f
+ ldx [%l0+8], %l1
+2: jmpl %l1, %o7
+ ldx [%l0+8], %l1
+3: brnz,pt %l1, 2b
+ add %l0, 8, %l0
+
+ ret
+ restore
+
+ .size __do_global_dtors_aux,.-__do_global_dtors_aux
--- /dev/null
+/* Constructor startup code for elf64-sparc
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
+
+ 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. */
+
+
+.section ".ctors",#alloc,#write
+
+ .align 8
+__CTOR_END__:
+ .xword 0
+
+.section ".dtors",#alloc,#write
+
+ .align 8
+__DTOR_END__:
+ .xword 0
+
+.section ".init",#alloc,#execinstr
+
+ call __do_global_ctors_aux
+ nop
+
+.text
+
+ .align 4
+ .type __do_global_ctors_aux,#function
+__do_global_ctors_aux:
+ save %sp,-160,%sp
+
+#ifdef PIC
+1: call 11f
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+ add %l7, %o7, %l7
+ sethi %hi(__CTOR_END__), %l0
+ or %l0, %lo(__CTOR_END__), %l0
+ ldx [%l7+%l0], %l0
+#else
+ sethi %hi(__CTOR_END__), %l0
+ or %l0, %lo(__CTOR_END__), %l0
+ add %l0, %g4, %l0
+#endif
+
+ ba 3f
+ ldx [%l0+8], %l1
+2: jmpl %l1, %o7
+ ldx [%l0+8], %l1
+3: addcc %l1, 1, %g0
+ bnz,pt %xcc, 2b
+ add %l0, 8, %l0
+
+ ret
+ restore
+
+ .size __do_global_ctors_aux,.-__do_global_ctors_aux
--- /dev/null
+/* Copyright (C) 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 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. */
+
+#ifndef _FENV_H
+#error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Define bits representing the exception. We use the bit positions
+ of the appropriate accrued exception bits from the FSR. */
+enum
+ {
+ FE_INVALID = (1 << 9),
+#define FE_INVALID FE_INVALID
+ FE_OVERFLOW = (1 << 8),
+#define FE_OVERFLOW FE_OVERFLOW
+ FE_UNDERFLOW = (1 << 7),
+#define FE_UNDERFLOW FE_UNDERFLOW
+ FE_DIVBYZERO = (1 << 6),
+#define FE_DIVBYZERO FE_DIVBYZERO
+ FE_INEXACT = (1 << 5)
+#define FE_INEXACT FE_INEXACT
+ };
+
+#define FE_ALL_EXCEPT \
+ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* The Sparc FPU supports all of the four defined rounding modes. We
+ use again the bit positions in the FPU control word as the values
+ for the appropriate macros. */
+enum
+ {
+ FE_TONEAREST = (0U << 30),
+#define FE_TONEAREST FE_TONEAREST
+ FE_TOWARDSZERO = (1U << 30),
+#define FE_TOWARDSZERO FE_TOWARDSZERO
+ FE_UPWARD = (2U << 30),
+#define FE_UPWARD FE_UPWARD
+ FE_DOWNWARD = (3U << 30)
+#define FE_DOWNWARD FE_DOWNWARD
+ };
+
+#define __FE_ROUND_MASK (3U << 30)
+
+/* Type representing exception flags. */
+typedef unsigned long fexcept_t;
+
+/* Type representing floating-point environment. */
+typedef unsigned long fenv_t;
+
+/* If the default argument is used we use this value. */
+#define FE_DFL_ENV ((fenv_t *) -1)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exception is masked. */
+# define FE_NOMASK_ENV ((fenv_t *) -2)
+#endif
+
+/* For internal use only: access the fp state register. */
+#define __fenv_stfsr(X) __asm__("stx %%fsr,%0" : "=m"(X))
+#define __fenv_ldfsr(X) __asm__ __volatile__("ldx %0,%%fsr" : : "m"(X))
+++ /dev/null
-wordsize-64
-# SPARC uses IEEE 754 floating point.
-ieee754
+++ /dev/null
- # Local configure fragment for sysdeps/sparc64
-
-nopic_initfini=yes
+++ /dev/null
-sinclude(./aclocal.m4)dnl Autoconf lossage
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/sparc64
-
-dnl We need to have separate crt? files for static linking which does
-dnl not use PIC.
-nopic_initfini=yes
+++ /dev/null
-.section ".ctors",#alloc,#write
-
- .align 8
-__CTOR_LIST__:
- .xword -1
-
-.section ".dtors",#alloc,#write
-
- .align 8
-__DTOR_LIST__:
- .xword -1
-
-.section ".fini",#alloc,#execinstr
-
- call __do_global_dtors_aux
- nop
-
-.text
-
- .align 4
- .type __do_global_dtors_aux,#function
-__do_global_dtors_aux:
- save %sp,-160,%sp
-
-#ifdef PIC
-1: rd %pc, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- add %l7, %g1, %l7
- sethi %hi(__DTOR_LIST__), %l0
- or %l0, %lo(__DTOR_LIST__), %l0
- ldx [%l7+%l0], %l0
-#else
- sethi %hi(__DTOR_LIST__), %l0
- or %l0, %lo(__DTOR_LIST__), %l0
- add %l0, %g4, %l0
-#endif
-
- ba 3f
- ldx [%l0+8], %l1
-2: jmpl %l1, %o7
- ldx [%l0+8], %l1
-3: brnz,pt %l1, 2b
- add %l0, 8, %l0
-
- ret
- restore
-
- .size __do_global_dtors_aux,.-__do_global_dtors_aux
+++ /dev/null
-.section ".ctors",#alloc,#write
-
- .align 8
-__CTOR_END__:
- .xword 0
-
-.section ".dtors",#alloc,#write
-
- .align 8
-__DTOR_END__:
- .xword 0
-
-.section ".init",#alloc,#execinstr
-
- call __do_global_ctors_aux
- nop
-
-.text
-
- .align 4
- .type __do_global_ctors_aux,#function
-__do_global_ctors_aux:
- save %sp,-160,%sp
-
-#ifdef PIC
-1: rd %pc, %g1
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- add %l7, %g1, %l7
- sethi %hi(__CTOR_END__), %l0
- or %l0, %lo(__CTOR_END__), %l0
- ldx [%l7+%l0], %l0
-#else
- sethi %hi(__CTOR_END__), %l0
- or %l0, %lo(__CTOR_END__), %l0
- add %l0, %g4, %l0
-#endif
-
- ba 3f
- ldx [%l0+8], %l1
-2: jmpl %l1, %o7
- ldx [%l0+8], %l1
-3: addcc %l1, 1, %g0
- bnz,pt %xcc, 2b
- add %l0, 8, %l0
-
- ret
- restore
-
- .size __do_global_ctors_aux,.-__do_global_ctors_aux
accept (fd, addr, addr_len)
int fd;
__SOCKADDR_ARG addr;
- size_t *addr_len;
+ socklen_t *addr_len;
{
__set_errno (ENOSYS);
return -1;
bind (fd, addr, len)
int fd;
__CONST_SOCKADDR_ARG addr;
- size_t len;
+ socklen_t len;
{
__set_errno (ENOSYS);
return -1;
-/* This file should provide inline versions of math functions.
+/* This file should provide inline versions of string functions.
Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
__connect (fd, addr, len)
int fd;
__CONST_SOCKADDR_ARG addr;
- size_t len;
+ socklen_t len;
{
__set_errno (ENOSYS);
return -1;
}
weak_alias (__connect, connect)
-
stub_warning (connect)
getsockname (fd, addr, len)
int fd;
__SOCKADDR_ARG addr;
- size_t *len;
+ socklen_t *len;
{
__set_errno (ENOSYS);
return -1;
int level;
int optname;
void *optval;
- size_t *optlen;
+ socklen_t *optlen;
{
__set_errno (ENOSYS);
return -1;
}
-
stub_warning (getsockopt)
size_t n;
int flags;
__SOCKADDR_ARG addr;
- size_t *addr_len;
+ socklen_t *addr_len;
{
__set_errno (ENOSYS);
return -1;
}
-
stub_warning (recvfrom)
size_t n;
int flags;
__CONST_SOCKADDR_ARG addr;
- size_t addr_len;
+ socklen_t addr_len;
{
__set_errno (ENOSYS);
return -1;
}
-
stub_warning (sendto)
int level;
int optname;
void *optval;
- size_t optlen;
+ socklen_t optlen;
{
__set_errno (ENOSYS);
return -1;
}
-
stub_warning (setsockopt)
/* Structure and constant definitions for sigaction et al. OSF/1 version.
- Copyright (C) 1993, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
/* Bits in `sa_flags'. */
#ifdef __USE_BSD
-#define SA_ONSTACK 0x1 /* Take signal on signal stack. */
-#define SA_RESTART 0x2 /* Don't restart syscall on signal return. */
-#define SA_DISABLE 0x4 /* Disable alternate signal stack. */
+# define SA_ONSTACK 0x1 /* Take signal on signal stack. */
+# define SA_RESTART 0x2 /* Restart syscall on signal return. */
+# define SA_DISABLE 0x4 /* Disable alternate signal stack. */
#endif
#define SA_NOCLDSTOP 0x4 /* Don't send SIGCHLD when children stop. */
sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
sys/user.h sys/sysmacros.h sys/procfs.h \
sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
- sys/quota.h sys/fsuid.h
+ sys/quota.h sys/fsuid.h bits/mman.h
install-others += $(inst_includedir)/bits/syscall.h
};
/* Bits in `sa_flags'. */
-#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */
#ifdef __USE_MISC
-#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
-#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */
-#define SA_INTERRUPT 0x20000000 /* Historical no-op. */
-#define SA_NOMASK 0x00000008 /* Don't automatically block the signal when
- its handler is being executed. */
-#define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */
+# define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+# define SA_NOMASK 0x00000008 /* Don't automatically block the signal
+ when its handler is being executed. */
+# define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */
/* Some aliases for the SA_ constants. */
-#define SA_NODEFER SA_NOMASK
-#define SA_RESETHAND SA_ONESHOT
+# define SA_NODEFER SA_NOMASK
+# define SA_RESETHAND SA_ONESHOT
#endif
/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_BLOCK 1 /* Block signals. */
-#define SIG_UNBLOCK 2 /* Unblock signals. */
-#define SIG_SETMASK 3 /* Set the set of blocked signals. */
+#define SIG_BLOCK 1 /* Block signals. */
+#define SIG_UNBLOCK 2 /* Unblock signals. */
+#define SIG_SETMASK 3 /* Set the set of blocked signals. */
/* The proper definitions for Linux's sigaction.
- Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 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
};
/* Bits in `sa_flags'. */
-#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
#ifdef __USE_MISC
-#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
-#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */
-#define SA_INTERRUPT 0x20000000 /* Historical no-op. */
-#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
- its handler is being executed. */
-#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
+# define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
+ its handler is being executed. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
/* Some aliases for the SA_ constants. */
-#define SA_NOMASK SA_NODEFER
-#define SA_ONESHOT SA_RESETHAND
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
#endif
/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_BLOCK 0 /* Block signals. */
-#define SIG_UNBLOCK 1 /* Unblock signals. */
-#define SIG_SETMASK 2 /* Set the set of blocked signals. */
+#define SIG_BLOCK 0 /* Block signals. */
+#define SIG_UNBLOCK 1 /* Unblock signals. */
+#define SIG_SETMASK 2 /* Set the set of blocked signals. */
{
#ifndef SIOGIFINDEX
__set_errno (ENOSYS);
+ return 0;
#else
struct ifreq ifr;
- int rc;
int fd = opensock ();
if (fd < 0)
return 0;
strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
- rc = ioctl (fd, SIOGIFINDEX, &ifr);
- if (rc < 0)
+ if (ioctl (fd, SIOGIFINDEX, &ifr) < 0)
{
+ int saved_errno = errno;
close (fd);
- __set_errno (rc == -EINVAL ? ENOSYS : -rc);
+ if (saved_errno == EINVAL)
+ __set_errno (ENOSYS);
return 0;
}
close (fd);
__set_errno (ENOSYS);
return NULL;
#else
- int rc;
int fd = opensock ();
struct ifconf ifc;
unsigned int rq_ifs = 4, nifs, i;
goto jump;
}
strcpy (idx[i].if_name, ifr->ifr_name);
- rc = ioctl (fd, SIOGIFINDEX, ifr);
- if (rc < 0)
+ if (ioctl (fd, SIOGIFINDEX, ifr) < 0)
{
+ int saved_errno = errno;
free (idx);
idx = NULL;
- __set_errno (rc == -EINVAL ? ENOSYS : -rc);
+ if (saved_errno == EINVAL)
+ __set_errno (ENOSYS);
goto jump;
}
idx[i].if_index = ifr->ifr_ifindex;
--- /dev/null
+/* Definitions for POSIX memory map inerface. Linux/m68k version.
+ Copyright (C) 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 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. */
+
+#ifndef _SYS_MMAN_H
+# error "Never include this file directly. Use <sys/mman.h> instead"
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific. */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x2000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mlockall'. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+#endif
};
/* Bits in `sa_flags'. */
-#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
#ifdef __USE_MISC
-#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
-#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */
-#define SA_INTERRUPT 0x20000000 /* Historical no-op. */
-#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
- its handler is being executed. */
-#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
+# define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
+ its handler is being executed. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
/* Some aliases for the SA_ constants. */
-#define SA_NOMASK SA_NODEFER
-#define SA_ONESHOT SA_RESETHAND
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
#endif
/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_NOP 0 /* 0 is unused to catch errors */
-#define SIG_BLOCK 1 /* Block signals. */
-#define SIG_UNBLOCK 2 /* Unblock signals. */
-#define SIG_SETMASK 3 /* Set the set of blocked signals. */
-#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
+#define SIG_NOP 0 /* 0 is unused to catch errors */
+#define SIG_BLOCK 1 /* Block signals. */
+#define SIG_UNBLOCK 2 /* Unblock signals. */
+#define SIG_SETMASK 3 /* Set the set of blocked signals. */
+#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
set only the low 32 bit of the sigset. */
__sigset_t sa_mask;
/* Special flags. */
- unsigned int sa_flags;
+ unsigned long sa_flags;
+
+ /* Not used by Linux/Sparc yet. */
+ void (*sa_restorer)(void);
};
/* Bits in `sa_flags'. */
-#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */
#ifdef __USE_MISC
-#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
-#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */
-#define SA_INTERRUPT 0x00000010 /* Historical no-op. */
-#define SA_NOMASK 0x00000020 /* Don't automatically block the signal when
- its handler is being executed. */
-#define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */
+# define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
+# define SA_INTERRUPT 0x00000010 /* Historical no-op. */
+# define SA_NOMASK 0x00000020 /* Don't automatically block the signal when
+ its handler is being executed. */
+# define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */
/* Some aliases for the SA_ constants. */
-#define SA_NODEFER SA_NOMASK
-#define SA_RESETHAND SA_ONESHOT
+# define SA_NODEFER SA_NOMASK
+# define SA_RESETHAND SA_ONESHOT
#endif
/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_BLOCK 1 /* Block signals. */
-#define SIG_UNBLOCK 2 /* Unblock signals. */
-#define SIG_SETMASK 4 /* Set the set of blocked signals. */
+#define SIG_BLOCK 1 /* Block signals. */
+#define SIG_UNBLOCK 2 /* Unblock signals. */
+#define SIG_SETMASK 4 /* Set the set of blocked signals. */
ENTRY(__brk)
save %sp, -160, %sp
#ifdef PIC
-1: rd %pc, %g1
+1: call 2f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- add %l7, %g1, %l7
+2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+ add %l7, %o7, %l7
#endif
LOADSYSCALL(brk)
--- /dev/null
+/* _setjmp is in setjmp.S */
--- /dev/null
+/* setjmp is in setjmp.S */
restore
99:
#ifdef PIC
- rd %pc, %g1
+ call 1f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
- add %l7, %g1, %l7
+1: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7
+ add %l7, %o7, %l7
set EINVAL, %i0
sethi %hi(errno), %g2
or %g2, %lo(errno), %g2
mov -1,%i0
ret
restore
- .size __libc_clone,.-__libc_clone
+ .size __libc_clone, .-__libc_clone
.type __thread_start,@function
__thread_start:
mov %l3,%o0
call _exit,0
nop
- .size __thread_start,.-__thread_start
+ .size __thread_start, .-__thread_start
.global " #NAME "
.type " #NAME ",@function
" #NAME ":
- save %sp, -64, %sp
-1: rd %pc, %g1
+ save %sp, -128, %sp
+1: call 11f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
+11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
add %l7, %o7, %l7
/* Are we a dynamic libc being loaded into a static program? */
- sethi %hi(_dl_starting_up), %g2
- or %g2, %lo(_dl_starting_up), %g2
- ld [%l7+%g2], %g2
- brz,pn %g2, 3f
- sethi %hi(__libc_multiple_libcs), %g3
- ld [%g2], %g2
- subcc %g0, %g2, %g0
- subc %g0, -1, %g2
-3: or %g3, %lo(__libc_multiple_libcs), %g3
- ld [%l7+%g3], %g3
- st %g2, [%g3]
+ sethi %hi(_dl_starting_up), %l2
+ or %l2, %lo(_dl_starting_up), %l2
+ ldx [%l7+%l2], %l2
+ brz,pn %l2, 3f
+ sethi %hi(__libc_multiple_libcs), %l3
+ ld [%l2], %l4
+ mov %g0, %l2
+ movrz %l4, 1, %l2
+3: or %l3, %lo(__libc_multiple_libcs), %l3
+ ldx [%l7+%l3], %l3
+ st %l2, [%l3]
/* If so, argc et al are in %o0-%o2 already. Otherwise, load them. */
- brnz,pn %g2, " #INIT "
+ brnz,pn %l2, " #INIT "
restore
- ld [%sp+" __S(STACK_BIAS) "+22*8], %o0
+ ldx [%sp+" __S(STACK_BIAS) "+22*8], %o0
add %sp, " __S(STACK_BIAS) "+23*8, %o1
sll %o0, 3, %o2
add %o2, %o1, %o2
- add %o2, 8, %o2
- ba,a " #INIT "
- .size "#NAME " .-" #NAME);
+ ba " #INIT "
+ add %o2, 8, %o2
+ .size "#NAME ", .-" #NAME);
#else
or %g2, %lo(_dl_starting_up), %g2
brz,pt %g2, 3f
sethi %hi(__libc_multiple_libcs), %g3
- ld [%g4+%g2], %g2
- subcc %g0, %g2, %g0
- subc %g0, -1, %g2
-3: add %g3, %g4, %g3
- st %g2, [%g3+%lo(__libc_multiple_libcs)]
+ ld [%g4+%g2], %g1
+ mov %g0, %g2
+ movrz %g1, 1, %g2
+3: or %g3, %lo(__libc_multiple_libcs), %g3
+ st %g2, [%g3+%g4]
/* If so, argc et al are in %o0-%o2 already. Otherwise, load them. */
brnz,pn %g2, " #INIT "
nop
- ld [%sp+" __S(STACK_BIAS) "+22*8], %o0
+ ldx [%sp+" __S(STACK_BIAS) "+22*8], %o0
add %sp, " __S(STACK_BIAS) "+23*8, %o1
sll %o0, 3, %o2
add %o2, %o1, %o2
ta 0x6f
END(longjmp)
+
+strong_alias(longjmp, __longjmp)
#define O_gregs 32
#define O_g1 (O_gregs + 4*8)
+/* int _setjmp(jmp_buf) */
+
+.weak _setjmp
+ENTRY(_setjmp)
+
+ ba __sigsetjmp_local
+ set 0, %o1
+
+END(setjmp)
+
+/* int setjmp(jmp_buf) */
+
+.weak setjmp
+ENTRY(setjmp)
+
+ set 1, %o1
+
+END(setjmp)
/* int __sigsetjmp(jmp_buf, savemask) */
ENTRY(__sigsetjmp)
+__sigsetjmp_local:
/* Record whether the user is intending to save the sigmask. */
st %o1, [%o0 + O_mask_was_saved]
--- /dev/null
+/* Copyright (C) 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 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 <sysdep.h>
+ .text
+
+ENTRY (syscall)
+
+ mov %o0,%g1
+ mov %o1,%o0
+ mov %o2,%o1
+ mov %o3,%o2
+ mov %o4,%o3
+ mov %o5,%o4
+
+ ta 0x11
+
+ bcc,pt %xcc,1f
+ nop
+ SYSCALL_ERROR_HANDLER
+
+1: retl
+
+PSEUDO_END (syscall)
.type name,@function;
#ifdef PIC
-#define SYSCALL_ERROR_HANDLER1(R) \
+# ifdef _LIBC_REENTRANT
+# define SYSCALL_ERROR_HANDLER \
.global C_SYMBOL_NAME(errno); \
.type C_SYMBOL_NAME(errno),@object; \
-0: rd %pc,%g1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2; \
- add %g2,%lo(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2; \
- add %g2,%g1,%g1; \
- sethi %hi(errno),%g2; \
- add %g2,%lo(errno),%g2; \
- ldx [%g1+%g2],%g2; \
- st R,[%g2]
+ save %sp,-160,%sp; \
+ 101: call 102f; \
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \
+ 102: or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \
+ sethi %hi(errno),%i1; \
+ add %g2,%o7,%l7; \
+ or %i1,%lo(errno),%i1; \
+ ldx [%l7+%i1],%g2; \
+ st %i0,[%g2]; \
+ call __errno_location; \
+ nop; \
+ st %i0,[%o0]; \
+ sub %g0,1,%i0; \
+ jmpl %i7+8, %g0; \
+ restore
+# else
+# define SYSCALL_ERROR_HANDLER \
+ .global C_SYMBOL_NAME(errno); \
+ .type C_SYMBOL_NAME(errno),@object; \
+ mov %o7,%g3; \
+ 101: call 102f; \
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \
+ 102: or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \
+ sethi %hi(errno),%o1; \
+ add %g2,%o7,%l7; \
+ or %o1,%lo(errno),%o1; \
+ mov %g3,%o7; \
+ ldx [%l7+%o1],%g2; \
+ st %o0,[%g2]
+# endif
#else
-#define SYSCALL_ERROR_HANDLER1(R) \
+# ifdef _LIBC_REENTRANT
+# define SYSCALL_ERROR_HANDLER \
.global C_SYMBOL_NAME(errno); \
.type C_SYMBOL_NAME(errno),@object; \
+ save %sp,-160,%sp; \
sethi %hi(errno),%g1; \
- add %g1,%g4,%g1; \
- st R,[%g1+%lo(errno)]
-#endif
-
-#ifdef _LIBC_REENTRANT
-#define SYSCALL_ERROR_HANDLER \
- .global C_SYMBOL_NAME(__errno_location); \
- .type C_SYMBOL_NAME(__errno_location),@function; \
- save %sp,-128,%sp; \
- SYSCALL_ERROR_HANDLER1(%i0); \
+ or %g1,%lo(errno),%g1; \
+ st %i0,[%g1+%g4]; \
call __errno_location; \
nop; \
st %i0,[%o0]; \
sub %g0,1,%i0; \
jmpl %i7+8, %g0; \
restore
-#else
-#define SYSCALL_ERROR_HANDLER \
- SYSCALL_ERROR_HANDLER1(%o0); \
+# else
+# define SYSCALL_ERROR_HANDLER \
+ .global C_SYMBOL_NAME(errno); \
+ .type C_SYMBOL_NAME(errno),@object; \
+ sethi %hi(errno),%g1; \
+ or %g1,%lo(errno),%g1; \
+ st %i0,[%g1+%g4]; \
retl; \
sub %g0,1,%i0
+# endif
#endif
#define PSEUDO(name, syscall_name, args) \
/* Bits in `sa_flags'. */
#ifdef __USE_MISC
-#define SA_ONSTACK 0x1 /* Take signal on signal stack. */
-#define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */
-#define SA_NODEFER 0x4 /* Don't block signal while catching it. */
-#define SA_RESTART 0x8 /* Don't restart syscall on signal return. */
-#define SA_SIGINFO 0x10 /* Extended signal handling. */
-#define SA_NOCLDWAIT 0x20 /* Don't create zombies. */
-#define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */
-#define SA_DISABLE 0x100 /* Disable alternate signal stack. */
+# define SA_ONSTACK 0x1 /* Take signal on signal stack. */
+# define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */
+# define SA_NODEFER 0x4 /* Don't block signal while catching it. */
+# define SA_RESTART 0x8 /* Restart syscall on signal return. */
+# define SA_SIGINFO 0x10 /* Extended signal handling. */
+# define SA_NOCLDWAIT 0x20 /* Don't create zombies. */
+# define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */
+# define SA_DISABLE 0x100 /* Disable alternate signal stack. */
#endif
#define SA_NOCLDSTOP 0x40 /* Don't send SIGCHLD when children stop. */
/* Bits in `sa_flags'. */
#ifdef __USE_MISC
-#define SA_ONSTACK 0x1 /* Take signal on signal stack. */
-#define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */
-#define SA_RESTART 0x4 /* Don't restart syscall on signal return. */
-#define SA_SIGINFO 0x8 /* Provide additional info to the handler. */
-#define SA_NODEFER 0x10 /* Don't automatically block the signal when
+# define SA_ONSTACK 0x1 /* Take signal on signal stack. */
+# define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */
+# define SA_RESTART 0x4 /* Restart syscall on signal return. */
+# define SA_SIGINFO 0x8 /* Provide additional info to the handler. */
+# define SA_NODEFER 0x10 /* Don't automatically block the signal when
its handler is being executed. */
-#define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */
+# define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */
#endif
#define SA_NOCLDSTOP 0x20000 /* Don't send SIGCHLD when children stop. */
{
register tz_rule *tzr = &tz_rules[whichrule];
- if (*tz == ',')
- {
- ++tz;
- if (*tz == '\0')
- return;
- }
+ /* Ignore comma to support string following the incorrect
+ specification in early POSIX.1 printings. */
+ tz += *tz == ',';
/* Get the date of the change. */
if (*tz == 'J' || isdigit (*tz))