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.

	* elf/dl-profile.c: Add descriptions and implement reading of
This commit is contained in:
Ulrich Drepper 1997-08-14 01:54:13 +00:00
parent 0413b54c02
commit ca34d7a7c7
192 changed files with 2024 additions and 701 deletions

249
ChangeLog
View file

@ -1,3 +1,250 @@
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)
@ -49,7 +296,7 @@
* 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.

View file

@ -37,9 +37,9 @@ struct sigaction
/* 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. */

117
configure vendored
View file

@ -826,9 +826,12 @@ m88???) base_machine=m88k machine=m88k/$machine ;;
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
@ -836,7 +839,7 @@ 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'`"
@ -1037,7 +1040,7 @@ echo "$ac_t""sysdeps/generic sysdeps/stub" 1>&6
# 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
@ -1091,7 +1094,7 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
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
@ -1116,7 +1119,7 @@ do
# 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
@ -1149,7 +1152,7 @@ test -n "$MSGFMT" || MSGFMT=":"
# 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
@ -1178,7 +1181,7 @@ if test -z "$CC"; then
# 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
@ -1226,7 +1229,7 @@ fi
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.
@ -1236,11 +1239,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
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
@ -1263,13 +1266,13 @@ else
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
@ -1278,7 +1281,7 @@ 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
@ -1295,7 +1298,7 @@ if test $ac_cv_prog_gcc = yes; then
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
@ -1307,7 +1310,7 @@ else
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
@ -1330,7 +1333,7 @@ do
# 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
@ -1361,7 +1364,7 @@ done
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=
@ -1376,13 +1379,13 @@ else
# 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
:
@ -1393,13 +1396,13 @@ else
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
:
@ -1430,7 +1433,7 @@ fi
# 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
@ -1461,7 +1464,7 @@ fi
# 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
@ -1492,7 +1495,7 @@ if test -n "$ac_tool_prefix"; then
# 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
@ -1527,7 +1530,7 @@ fi
# 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
@ -1568,7 +1571,7 @@ if test "$BASH" = no; then
# 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
@ -1610,7 +1613,7 @@ fi
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
@ -1634,12 +1637,12 @@ EOF
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
@ -1654,7 +1657,7 @@ size_t size; wchar_t wchar;
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
@ -1673,7 +1676,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
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
@ -1696,7 +1699,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
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
@ -1726,7 +1729,7 @@ EOF
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
@ -1760,7 +1763,7 @@ EOF
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
@ -1779,7 +1782,7 @@ fi
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
@ -1798,7 +1801,7 @@ EOF
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
@ -1828,7 +1831,7 @@ fi
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
@ -1836,7 +1839,7 @@ 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
@ -1852,7 +1855,7 @@ EOF
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
@ -1860,7 +1863,7 @@ 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
@ -1880,12 +1883,12 @@ fi
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() {
@ -1894,7 +1897,7 @@ asm (".section .init");
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
@ -1919,19 +1922,19 @@ if test $elf = yes; then
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
@ -1958,7 +1961,7 @@ if test $elf = yes; then
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
@ -1981,7 +1984,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
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
@ -2018,7 +2021,7 @@ EOF
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
@ -2029,7 +2032,7 @@ __throw () {}
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
@ -2040,7 +2043,7 @@ fi
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
@ -2051,7 +2054,7 @@ __throw () {}
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
@ -2103,7 +2106,7 @@ if test "$uname" = "sysdeps/generic"; then
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
@ -2125,7 +2128,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
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
@ -2147,7 +2150,7 @@ 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

View file

@ -159,9 +159,12 @@ m88???) base_machine=m88k machine=m88k/$machine ;;
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)

View file

@ -52,42 +52,21 @@ CPPFLAGS += -DHAVE_INITFINI
# "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' \
@ -98,17 +77,6 @@ $(objpfx)crtn.S: $(objpfx)initfini.s
-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 > $@

View file

@ -22,13 +22,13 @@ subdir := elf
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

View file

@ -21,7 +21,7 @@
#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

View file

@ -23,7 +23,7 @@
#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. */
@ -43,9 +43,6 @@ malloc (size_t n)
#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. */
@ -115,10 +112,16 @@ realloc (void *ptr, size_t n)
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);
}
/* Define our own stub for the localization function used by strerror.
English-only in the dynamic linker keeps it smaller. */

View file

@ -37,12 +37,11 @@
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. */

View file

@ -75,14 +75,75 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
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
@ -90,12 +151,8 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
#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

View file

@ -505,6 +505,7 @@ typedef struct
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
@ -518,6 +519,11 @@ 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 */
@ -537,6 +543,7 @@ typedef struct
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
@ -545,6 +552,10 @@ 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. */
@ -559,6 +570,7 @@ typedef struct
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
@ -571,6 +583,10 @@ 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 */
@ -589,6 +605,7 @@ typedef struct
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
@ -600,6 +617,10 @@ 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 */
@ -732,6 +753,36 @@ typedef struct
#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. */

View file

@ -444,6 +444,10 @@ extern void _dl_start_profile (struct link_map *map, const char *output_dir);
/* 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 */

View file

@ -261,6 +261,11 @@ dl_main (const ElfW(Phdr) *phdr,
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;

View file

@ -105,10 +105,10 @@ object_compare (const void *p1, const void *p2)
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);
}

View file

@ -11,7 +11,8 @@ GLIBC_2.0 {
_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;
@ -84,6 +85,7 @@ GLIBC_2.0 {
_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;

View file

@ -128,4 +128,6 @@ _IO_fdopen (fd, mode)
return (_IO_FILE *) &new_f->fp;
}
#ifdef weak_alias
weak_alias (_IO_fdopen, fdopen)
#endif

View file

@ -43,4 +43,6 @@ _IO_fflush (fp)
}
}
#ifdef weak_alias
weak_alias (_IO_fflush, fflush)
#endif

View file

@ -49,4 +49,6 @@ _IO_fgetpos (fp, posp)
return 0;
}
#ifdef weak_alias
weak_alias (_IO_fgetpos, fgetpos)
#endif

View file

@ -50,4 +50,6 @@ _IO_fgets (buf, n, fp)
return result;
}
#ifdef weak_alias
weak_alias (_IO_fgets, fgets)
#endif

View file

@ -58,4 +58,6 @@ _IO_fopen (filename, mode)
return NULL;
}
#ifdef weak_alias
weak_alias (_IO_fopen, fopen)
#endif

View file

@ -43,4 +43,6 @@ _IO_fputs (str, fp)
return result;
}
#ifdef weak_alias
weak_alias (_IO_fputs, fputs)
#endif

View file

@ -42,4 +42,7 @@ _IO_fread (buf, size, count, fp)
_IO_cleanup_region_end (1);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
#ifdef weak_alias
weak_alias (_IO_fread, fread)
#endif

View file

@ -50,4 +50,6 @@ _IO_fsetpos (fp, posp)
return result;
}
#ifdef weak_alias
weak_alias (_IO_fsetpos, fsetpos)
#endif

View file

@ -47,4 +47,6 @@ _IO_ftell (fp)
return _IO_pos_as_off (pos);
}
#ifdef weak_alias
weak_alias (_IO_ftell, ftell)
#endif

View file

@ -48,4 +48,6 @@ _IO_fwrite (buf, size, count, fp)
return written/size;
}
#ifdef weak_alias
weak_alias (_IO_fwrite, fwrite)
#endif

View file

@ -118,5 +118,7 @@ unlock_return:
return result;
}
#ifdef weak_alias
weak_alias (_IO_getdelim, __getdelim)
weak_alias (_IO_getdelim, getdelim)
#endif

View file

@ -61,7 +61,9 @@ unlock_return:
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.")

View file

@ -177,7 +177,9 @@ DEFUN(_IO_popen, (command, mode),
return NULL;
}
#ifdef strong_alias
strong_alias (_IO_popen, popen);
#endif
int
DEFUN(_IO_proc_close, (fp),

View file

@ -41,4 +41,7 @@ _IO_puts (str)
_IO_cleanup_region_end (1);
return result;
}
#ifdef weak_alias
weak_alias (_IO_puts, puts)
#endif

View file

@ -40,4 +40,6 @@ _IO_setbuffer (fp, buf, size)
_IO_cleanup_region_end (1);
}
#ifdef weak_alias
weak_alias (_IO_setbuffer, setbuffer)
#endif

View file

@ -94,4 +94,6 @@ unlock_return:
return result;
}
#ifdef weak_alias
weak_alias (_IO_setvbuf, setvbuf)
#endif

View file

@ -40,4 +40,6 @@ _IO_ungetc (c, fp)
return result;
}
#ifdef weak_alias
weak_alias (_IO_ungetc, ungetc)
#endif

View file

@ -51,4 +51,6 @@ _IO_vsprintf (string, format, args)
return ret;
}
#ifdef weak_alias
weak_alias (_IO_vsprintf, vsprintf)
#endif

View file

@ -44,5 +44,8 @@ DEFUN(_IO_vsscanf, (string, format, args),
_IO_cleanup_region_end (1);
return ret;
}
#ifdef weak_alias
weak_alias (_IO_vsscanf, __vsscanf)
weak_alias (_IO_vsscanf, vsscanf)
#endif

View file

@ -1,4 +1,4 @@
/* 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.
@ -25,7 +25,7 @@ static struct utmp buffer;
struct utmp *
getutid (const struct utmp *id)
__getutid (const struct utmp *id)
{
struct utmp *result;
@ -34,3 +34,5 @@ getutid (const struct utmp *id)
return result;
}
weak_alias (__getutid, getutid)
weak_alias (__getutid, getutxid)

View file

@ -115,7 +115,7 @@ login (const struct utmp *ut)
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;

View file

@ -85,30 +85,37 @@ utmp_to_xtmp (const struct utmp *utmp, struct xtmp *xtmp)
/* 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);
}

View file

@ -20,7 +20,6 @@
#ifndef _XTMP_H
#define _XTMP_H 1
#include <features.h>
#include <sys/time.h>
#include <sys/types.h>
@ -50,7 +49,7 @@ struct xtmp
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 */

View file

@ -1185,6 +1185,8 @@ static Void_t* realloc_check(Void_t* oldmem, size_t bytes);
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
@ -1204,6 +1206,8 @@ static Void_t* realloc_check();
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
@ -1510,6 +1514,58 @@ static unsigned long max_mmapped_mem = 0;
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
@ -1524,8 +1580,6 @@ ptmalloc_init __MALLOC_P((void))
#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
@ -1550,6 +1604,7 @@ ptmalloc_init __MALLOC_P((void))
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_")))
@ -1572,6 +1627,12 @@ ptmalloc_init __MALLOC_P((void))
#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
@ -4240,6 +4301,65 @@ free_starter(mem) Void_t* mem;
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) */

View file

@ -26,6 +26,8 @@
#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>
@ -65,6 +67,9 @@ static Void_t *malloc_key_data;
#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 */
@ -95,6 +100,12 @@ static int tsd_keys_alloced = 0;
#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)
@ -126,6 +137,10 @@ typedef pthread_key_t tsd_key_t;
#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>
@ -147,6 +162,8 @@ typedef void *tsd_key_t[256];
#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>
@ -170,6 +187,8 @@ int tsd_key_next;
#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
@ -193,6 +212,8 @@ typedef void *tsd_key_t;
#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) */

View file

@ -73,6 +73,7 @@ included as well as the @w{ISO C}, POSIX.1, POSIX.2, and X/Open material.
@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

View file

@ -1,10 +1,25 @@
@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
@ -53,7 +68,7 @@ in case of double using @code{double} is a good compromise.
@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
@ -73,7 +88,7 @@ be representable as a floating point number. If magnitude of the
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
@ -191,46 +206,19 @@ operation to be performed. Examples are
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
@ -249,24 +237,7 @@ of the operation is taken as a quiet NaN.
@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
@ -276,61 +247,20 @@ occurs the result depends on the sign of the intermediate result and the
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
@ -565,9 +495,10 @@ unwanted exception and raise the remaining exceptions.
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
@ -575,35 +506,22 @@ nearest guarantees numeric stability of the computations.
@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:
@ -682,10 +600,10 @@ The value is the square root of the value of the number pi.
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}.
@ -697,7 +615,7 @@ book about his C++ programming language where this value is used in
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}.
@ -727,15 +645,15 @@ double} type.
@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
@ -743,7 +661,7 @@ exception is raised if @var{x} or @var{y} are unordered.
@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
@ -751,17 +669,18 @@ This is equivalent @math{(x) < (y)} but no exception is raised if
@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
@ -774,7 +693,7 @@ All the macros are defined in a way to ensure that both arguments are
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.
@ -855,6 +774,10 @@ These functions return the sine of @var{x} in @code{*@var{sinx}} and the
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
@ -1533,7 +1456,7 @@ may be as low as @code{32767}.
@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
@ -1562,9 +1485,14 @@ The prototypes for these functions are in @file{stdlib.h}.
@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

View file

@ -999,7 +999,8 @@ cbrt_test (void)
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));
@ -1120,10 +1121,12 @@ static void
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));
@ -4652,6 +4655,7 @@ identities1_test (MATHTYPE x, MATHTYPE epsilon)
static void
identities2_test (MATHTYPE x, MATHTYPE epsilon)
{
#ifndef TEST_INLINE
MATHTYPE res1, res2, res3, res4, diff;
int result;
@ -4668,6 +4672,7 @@ identities2_test (MATHTYPE x, MATHTYPE epsilon)
result = check_equal (res4, res3, epsilon, &diff);
output_result_ext ("sin/cos == tan", result,
res4, res3, diff, x, PRINT, PRINT);
#endif
}

View file

@ -1,4 +1,4 @@
/* 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
@ -24,7 +24,7 @@ extern "C" {
#endif
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WIN32))
|| defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */

View file

@ -76,7 +76,7 @@
#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()

View file

@ -37,6 +37,8 @@
/* #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
@ -69,7 +71,7 @@
#endif
#endif
#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32)
#if !defined (_AMIGA) && !defined (VMS) && !defined(WINDOWS32)
#include <pwd.h>
#endif
@ -113,7 +115,7 @@ extern int errno;
#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
@ -173,7 +175,7 @@ extern void bcopy ();
__inline
#endif
#ifndef __SASC
#ifdef WIN32
#ifdef WINDOWS32
static void *
#else
static char *
@ -203,11 +205,11 @@ my_realloc (p, n)
#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. */
@ -265,7 +267,8 @@ static
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;
@ -504,17 +507,15 @@ glob (pattern, flags, errfunc, pglob)
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;
@ -522,11 +523,13 @@ glob (pattern, flags, errfunc, pglob)
/* `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)
@ -536,7 +539,7 @@ glob (pattern, flags, errfunc, pglob)
char *pwtmpbuf;
struct passwd pwbuf, *p;
pwtmpbuf = __alloca (pwbuflen);
pwtmpbuf = (char *) __alloca (pwbuflen);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
pwbuflen, &p) >= 0);
@ -550,7 +553,7 @@ glob (pattern, flags, errfunc, pglob)
}
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')
@ -559,13 +562,13 @@ glob (pattern, flags, errfunc, pglob)
{
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, '/');
@ -576,7 +579,7 @@ glob (pattern, flags, errfunc, pglob)
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';
}
@ -585,7 +588,7 @@ glob (pattern, flags, errfunc, pglob)
{
#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;
@ -605,14 +608,14 @@ glob (pattern, flags, errfunc, pglob)
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. */

View file

@ -28,7 +28,7 @@ extern "C"
#undef __ptr_t
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WIN32))
|| defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#define __ptr_t void *
@ -54,7 +54,7 @@ extern "C"
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". */

View file

@ -34,7 +34,7 @@ alpha-.*-linux.* libc=6.1
# 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

View file

@ -20,9 +20,9 @@
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"

View file

@ -99,7 +99,7 @@ int
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;

View file

@ -63,10 +63,10 @@
/* 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

View file

@ -37,9 +37,9 @@ struct sigaction
/* 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. */

View file

@ -25,6 +25,7 @@
#include <fcntl.h>
#include <link.h>
#include <unistd.h>
#include <stdio-common/_itoa.h>
#include <dl-machine.h>
@ -40,6 +41,7 @@ extern void ENTRY_POINT (void);
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,
@ -68,7 +70,7 @@ _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)
@ -148,3 +150,76 @@ void
_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;
}
}

View file

@ -70,15 +70,6 @@
#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__
@ -301,7 +292,7 @@ __inline_mathop (sin, "fsin")
/* 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")
@ -390,7 +381,7 @@ __inline_mathcode (log1p, __x, \
__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)))

View file

@ -713,3 +713,10 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
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. */
}

View file

@ -1,3 +1,2 @@
wordsize-32
# SPARC uses IEEE 754 floating point.
ieee754

View file

@ -0,0 +1,64 @@
/* 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

View file

@ -1,4 +1,4 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Sparc64 version.
/* Clear given exceptions in current floating-point environment.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -17,25 +17,16 @@
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
feclearexcept (int excepts)
{
fenv_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
__fenv_stfsr (tmp);
jmp %g1
mov 1, %o1 /* Pass second argument of one. */
tmp &= ~(excepts & FE_ALL_EXCEPT);
END(setjmp)
__fenv_ldfsr (tmp);
}

View file

@ -0,0 +1,26 @@
/* 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);
}

View file

@ -0,0 +1,30 @@
/* 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;
}

View file

@ -1,4 +1,4 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Sparc64 version.
/* Store current floating-point environment and clear exceptions.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -17,27 +17,19 @@
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)
int
feholdexcept (fenv_t *envp)
{
fenv_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
__fenv_stfsr (*envp);
jmp %g1
mov %g0, %o1 /* Pass second argument of zero. */
/* Set all exceptions to non-stop. */
tmp = *envp | (0x1f << 23);
END(_setjmp)
__fenv_ldfsr (tmp);
strong_alias(_setjmp, __setjmp)
return 1;
}

View file

@ -0,0 +1,43 @@
/* Install given 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
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);
}

View file

@ -0,0 +1,37 @@
/* 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;
}

View file

@ -0,0 +1,38 @@
/* Install given floating-point environment and raise 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
feupdateenv (const fenv_t *envp)
{
fexcept_t tmp;
/* Save current exceptions. */
__fenv_stfsr (tmp);
tmp &= FE_ALL_EXCEPT;
/* Install new environment. */
fesetenv (envp);
/* 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);
}

View file

@ -0,0 +1,31 @@
/* 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;
}

View file

@ -0,0 +1,66 @@
/* 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);
}
}

View file

@ -0,0 +1,34 @@
/* 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);
}

View file

@ -0,0 +1,30 @@
/* 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;
}

View file

@ -0,0 +1 @@
wordsize-32

View file

@ -51,11 +51,25 @@ elf_machine_dynamic (void)
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 (
@ -219,6 +233,8 @@ elf_machine_lazy_rel (struct link_map *map, const Elf32_Rela *reloc)
/* 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. */

View file

@ -0,0 +1,76 @@
/* 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))

Some files were not shown because too many files have changed in this diff Show more