diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/bits/sigaction.h | 6 | ||||
-rw-r--r-- | sysdeps/generic/dl-sysdep.c | 77 | ||||
-rw-r--r-- | sysdeps/i386/fpu/bits/mathinline.h | 13 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 7 | ||||
-rw-r--r-- | sysdeps/sparc/Implies | 1 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/bits/mathdef.h | 64 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fclrexcpt.c | 32 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fegetenv.c | 26 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fegetround.c | 30 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/feholdexcpt.c | 35 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fesetenv.c (renamed from sysdeps/sparc64/bsd-setjmp.S) | 48 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fesetround.c | 37 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/feupdateenv.c (renamed from sysdeps/sparc64/bsd-_setjmp.S) | 37 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fgetexcptflg.c | 31 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fraiseexcpt.c | 66 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/fsetexcptflg.c | 34 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/ftestexcept.c | 30 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/Dist (renamed from sysdeps/sparc/Dist) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/Implies | 1 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/Makefile (renamed from sysdeps/sparc/Makefile) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/__longjmp.S (renamed from sysdeps/sparc/__longjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/add_n.S (renamed from sysdeps/sparc/add_n.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/addmul_1.S (renamed from sysdeps/sparc/addmul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/alloca.S (renamed from sysdeps/sparc/alloca.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/bits/endian.h (renamed from sysdeps/sparc/bits/endian.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/bits/setjmp.h (renamed from sysdeps/sparc/bits/setjmp.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/bsd-_setjmp.S (renamed from sysdeps/sparc/bsd-_setjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/bsd-setjmp.S (renamed from sysdeps/sparc/bsd-setjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/divrem.m4 (renamed from sysdeps/sparc/divrem.m4) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/dl-machine.h (renamed from sysdeps/sparc/dl-machine.h) | 18 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/dotmul.S (renamed from sysdeps/sparc/dotmul.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/e_sqrt.c (renamed from sysdeps/sparc/e_sqrt.c) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/elf/Makefile (renamed from sysdeps/sparc/elf/Makefile) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/elf/start.c (renamed from sysdeps/sparc/elf/start.c) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/fpu/bits/fenv.h | 76 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/fpu/fpu_control.h (renamed from sysdeps/sparc/fpu_control.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/lshift.S (renamed from sysdeps/sparc/lshift.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/memcopy.h (renamed from sysdeps/sparc/memcopy.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/mul_1.S (renamed from sysdeps/sparc/mul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/rem.S (renamed from sysdeps/sparc/rem.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/rshift.S (renamed from sysdeps/sparc/rshift.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sdiv.S (renamed from sysdeps/sparc/sdiv.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/setjmp.S (renamed from sysdeps/sparc/setjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sparcv8/addmul_1.S (renamed from sysdeps/sparc/sparc8/addmul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sparcv8/mul_1.S (renamed from sysdeps/sparc/sparc8/mul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sparcv8/submul_1.S (renamed from sysdeps/sparc/sparc8/submul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S (renamed from sysdeps/sparc/sparc8/udiv_qrnnd.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/sub_n.S (renamed from sysdeps/sparc/sub_n.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/submul_1.S (renamed from sysdeps/sparc/submul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/udiv.S (renamed from sysdeps/sparc/udiv.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/udiv_qrnnd.S (renamed from sysdeps/sparc/udiv_qrnnd.S) | 51 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/umul.S (renamed from sysdeps/sparc/umul.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/urem.S (renamed from sysdeps/sparc/urem.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/Implies | 1 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/Makefile (renamed from sysdeps/sparc64/Makefile) | 2 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/add_n.S (renamed from sysdeps/sparc64/add_n.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/addmul_1.S (renamed from sysdeps/sparc64/addmul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/bits/endian.h (renamed from sysdeps/sparc64/bits/endian.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/dl-machine.h (renamed from sysdeps/sparc64/dl-machine.h) | 119 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/Dist (renamed from sysdeps/sparc64/elf/Dist) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/Makefile (renamed from sysdeps/sparc64/elf/Makefile) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/crtbegin.S | 69 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/crtbeginS.S (renamed from sysdeps/sparc64/elf/crtbeginS.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/crtend.S | 70 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/crtendS.S (renamed from sysdeps/sparc64/elf/crtendS.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/elf/start.S (renamed from sysdeps/sparc64/elf/start.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/bits/fenv.h | 76 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/fpu/fpu_control.h (renamed from sysdeps/sparc64/fpu_control.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/gmp-mparam.h (renamed from sysdeps/sparc64/gmp-mparam.h) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/lshift.S (renamed from sysdeps/sparc64/lshift.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/mul_1.S (renamed from sysdeps/sparc64/mul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/rshift.S (renamed from sysdeps/sparc64/rshift.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/sub_n.S (renamed from sysdeps/sparc64/sub_n.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/submul_1.S (renamed from sysdeps/sparc64/submul_1.S) | 0 | ||||
-rw-r--r-- | sysdeps/sparc64/Implies | 3 | ||||
-rwxr-xr-x | sysdeps/sparc64/configure | 3 | ||||
-rw-r--r-- | sysdeps/sparc64/configure.in | 7 | ||||
-rw-r--r-- | sysdeps/sparc64/elf/crtbegin.S | 49 | ||||
-rw-r--r-- | sysdeps/sparc64/elf/crtend.S | 50 | ||||
-rw-r--r-- | sysdeps/stub/accept.c | 2 | ||||
-rw-r--r-- | sysdeps/stub/bind.c | 2 | ||||
-rw-r--r-- | sysdeps/stub/bits/string.h | 2 | ||||
-rw-r--r-- | sysdeps/stub/connect.c | 3 | ||||
-rw-r--r-- | sysdeps/stub/getsockname.c | 2 | ||||
-rw-r--r-- | sysdeps/stub/getsockopt.c | 3 | ||||
-rw-r--r-- | sysdeps/stub/recvfrom.c | 3 | ||||
-rw-r--r-- | sysdeps/stub/sendto.c | 3 | ||||
-rw-r--r-- | sysdeps/stub/setsockopt.c | 3 | ||||
-rw-r--r-- | sysdeps/unix/bsd/osf/bits/sigaction.h | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/bits/sigaction.h | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/sigaction.h | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/if_index.c | 17 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/bits/mman.h | 75 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/bits/sigaction.h | 28 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/bits/sigaction.h | 29 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/Dist (renamed from sysdeps/unix/sysv/linux/sparc/Dist) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/Makefile (renamed from sysdeps/unix/sysv/linux/sparc/Makefile) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S (renamed from sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h (renamed from sysdeps/unix/sysv/linux/sparc/bits/mman.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/brk.c (renamed from sysdeps/unix/sysv/linux/sparc/brk.c) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (renamed from sysdeps/unix/sysv/linux/sparc/clone.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/fork.S (renamed from sysdeps/unix/sysv/linux/sparc/fork.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h (renamed from sysdeps/unix/sysv/linux/sparc/init-first.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h (renamed from sysdeps/unix/sysv/linux/sparc/kernel_stat.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S (renamed from sysdeps/unix/sysv/linux/sparc/pipe.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h (renamed from sysdeps/unix/sysv/linux/sparc/profil-counter.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (renamed from sysdeps/unix/sysv/linux/sparc/sigaction.c) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/socket.S (renamed from sysdeps/unix/sysv/linux/sparc/socket.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S (renamed from sysdeps/unix/sysv/linux/sparc/syscall.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (renamed from sysdeps/unix/sysv/linux/sparc/syscalls.list) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S (renamed from sysdeps/unix/sysv/linux/sparc/sysdep.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (renamed from sysdeps/unix/sysv/linux/sparc/sysdep.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/Dist (renamed from sysdeps/unix/sysv/linux/sparc64/Dist) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/Makefile (renamed from sysdeps/unix/sysv/linux/sparc64/Makefile) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/__longjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/mman.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h (renamed from sysdeps/unix/sysv/linux/sparc64/bits/types.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/brk.S (renamed from sysdeps/unix/sysv/linux/sparc64/brk.S) | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (renamed from sysdeps/unix/sysv/linux/sparc64/clone.S) | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/fork.S (renamed from sysdeps/unix/sysv/linux/sparc64/fork.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S (renamed from sysdeps/unix/sysv/linux/sparc64/getcontext.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h (renamed from sysdeps/unix/sysv/linux/sparc64/init-first.h) | 50 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h (renamed from sysdeps/unix/sysv/linux/sparc64/kernel_stat.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/longjmp.S) | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S (renamed from sysdeps/unix/sysv/linux/sparc64/pipe.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h (renamed from sysdeps/unix/sysv/linux/sparc64/profil-counter.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S (renamed from sysdeps/unix/sysv/linux/sparc64/setcontext.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/setjmp.S) | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S (renamed from sysdeps/unix/sysv/linux/sparc64/sigjmp.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S | 39 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (renamed from sysdeps/unix/sysv/linux/sparc64/syscalls.list) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S (renamed from sysdeps/unix/sysv/linux/sparc64/sysdep.S) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (renamed from sysdeps/unix/sysv/linux/sparc64/sysdep.h) | 68 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h (renamed from sysdeps/unix/sysv/linux/sparc64/ucontext.h) | 0 | ||||
-rw-r--r-- | sysdeps/unix/sysv/minix/bits/sigaction.h | 16 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/bits/sigaction.h | 12 |
140 files changed, 1241 insertions, 384 deletions
diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h index e5f661d..e89479b 100644 --- a/sysdeps/generic/bits/sigaction.h +++ b/sysdeps/generic/bits/sigaction.h @@ -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. */ diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c index 4f97f85..fd79bc4 100644 --- a/sysdeps/generic/dl-sysdep.c +++ b/sysdeps/generic/dl-sysdep.c @@ -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; + } +} diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h index b3736f8..c6b9331 100644 --- a/sysdeps/i386/fpu/bits/mathinline.h +++ b/sysdeps/i386/fpu/bits/mathinline.h @@ -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))) diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 69dd55a..88918c5 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -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. */ +} diff --git a/sysdeps/sparc/Implies b/sysdeps/sparc/Implies index 8a2007c..da719e1 100644 --- a/sysdeps/sparc/Implies +++ b/sysdeps/sparc/Implies @@ -1,3 +1,2 @@ -wordsize-32 # SPARC uses IEEE 754 floating point. ieee754 diff --git a/sysdeps/sparc/fpu/bits/mathdef.h b/sysdeps/sparc/fpu/bits/mathdef.h new file mode 100644 index 0000000..0bc9c94 --- /dev/null +++ b/sysdeps/sparc/fpu/bits/mathdef.h @@ -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 diff --git a/sysdeps/sparc/fpu/fclrexcpt.c b/sysdeps/sparc/fpu/fclrexcpt.c new file mode 100644 index 0000000..8dc68e8 --- /dev/null +++ b/sysdeps/sparc/fpu/fclrexcpt.c @@ -0,0 +1,32 @@ +/* Clear given exceptions in current floating-point environment. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <fenv.h> + +void +feclearexcept (int excepts) +{ + fenv_t tmp; + + __fenv_stfsr (tmp); + + tmp &= ~(excepts & FE_ALL_EXCEPT); + + __fenv_ldfsr (tmp); +} diff --git a/sysdeps/sparc/fpu/fegetenv.c b/sysdeps/sparc/fpu/fegetenv.c new file mode 100644 index 0000000..a796ccb --- /dev/null +++ b/sysdeps/sparc/fpu/fegetenv.c @@ -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); +} diff --git a/sysdeps/sparc/fpu/fegetround.c b/sysdeps/sparc/fpu/fegetround.c new file mode 100644 index 0000000..ea1df2b --- /dev/null +++ b/sysdeps/sparc/fpu/fegetround.c @@ -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; +} diff --git a/sysdeps/sparc/fpu/feholdexcpt.c b/sysdeps/sparc/fpu/feholdexcpt.c new file mode 100644 index 0000000..9b4c213 --- /dev/null +++ b/sysdeps/sparc/fpu/feholdexcpt.c @@ -0,0 +1,35 @@ +/* Store current floating-point environment and clear exceptions. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <fenv.h> + +int +feholdexcept (fenv_t *envp) +{ + fenv_t tmp; + + __fenv_stfsr (*envp); + + /* Set all exceptions to non-stop. */ + tmp = *envp | (0x1f << 23); + + __fenv_ldfsr (tmp); + + return 1; +} diff --git a/sysdeps/sparc64/bsd-setjmp.S b/sysdeps/sparc/fpu/fesetenv.c index c42123f..44c5b26 100644 --- a/sysdeps/sparc64/bsd-setjmp.S +++ b/sysdeps/sparc/fpu/fesetenv.c @@ -1,4 +1,4 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Sparc64 version. +/* Install given floating-point environment. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,25 +17,27 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <sysdep.h> - -ENTRY(setjmp) - -#ifdef PIC -1: rd %pc,%g1 - sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2 - or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2 - add %g1,%g2,%g1 - sethi %hi(C_SYMBOL_NAME(__sigsetjmp)),%g2 - or %g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2 - ld [%g1+%g2], %g1 -#else - sethi %hi(C_SYMBOL_NAME(__sigsetjmp)), %g1 - or %lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1 - add %g1, %g4, %g1 -#endif - - jmp %g1 - mov 1, %o1 /* Pass second argument of one. */ - -END(setjmp) +#include <fenv.h> + +void +fesetenv (const fenv_t *envp) +{ + fenv_t dummy; + + /* Put these constants in memory explicitly, so as to cope with a + -fPIC bug as of gcc 970624. Making them automatic is quicker + than loading up the pic register in this instance. */ + + if (envp == FE_DFL_ENV) + { + dummy = 0; + envp = &dummy; + } + else if (envp == FE_NOMASK_ENV) + { + dummy = 0x1f << 23; + envp = &dummy; + } + + __fenv_ldfsr (*envp); +} diff --git a/sysdeps/sparc/fpu/fesetround.c b/sysdeps/sparc/fpu/fesetround.c new file mode 100644 index 0000000..74963d7 --- /dev/null +++ b/sysdeps/sparc/fpu/fesetround.c @@ -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; +} diff --git a/sysdeps/sparc64/bsd-_setjmp.S b/sysdeps/sparc/fpu/feupdateenv.c index 1388c4c..0fba997 100644 --- a/sysdeps/sparc64/bsd-_setjmp.S +++ b/sysdeps/sparc/fpu/feupdateenv.c @@ -1,4 +1,4 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Sparc64 version. +/* Install given floating-point environment and raise exceptions. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,27 +17,22 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <sysdep.h> +#include <fenv.h> -ENTRY(_setjmp) +void +feupdateenv (const fenv_t *envp) +{ + fexcept_t tmp; -#ifdef PIC -1: rd %pc,%g1 - sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2 - or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%g2 - add %g1,%g2,%g1 - sethi %hi(C_SYMBOL_NAME(__sigsetjmp)),%g2 - or %g2,%lo(C_SYMBOL_NAME(__sigsetjmp)),%g2 - ld [%g1+%g2], %g1 -#else - sethi %hi(C_SYMBOL_NAME(__sigsetjmp)), %g1 - or %lo(C_SYMBOL_NAME(__sigsetjmp)), %g1, %g1 - add %g1, %g4, %g1 -#endif + /* Save current exceptions. */ + __fenv_stfsr (tmp); + tmp &= FE_ALL_EXCEPT; - jmp %g1 - mov %g0, %o1 /* Pass second argument of zero. */ + /* Install new environment. */ + fesetenv (envp); -END(_setjmp) - -strong_alias(_setjmp, __setjmp) + /* Raise the safed exception. Incidently for us the implementation + defined format of the values in objects of type fexcept_t is the + same as the ones specified using the FE_* constants. */ + feraiseexcept ((int) tmp); +} diff --git a/sysdeps/sparc/fpu/fgetexcptflg.c b/sysdeps/sparc/fpu/fgetexcptflg.c new file mode 100644 index 0000000..977c93e --- /dev/null +++ b/sysdeps/sparc/fpu/fgetexcptflg.c @@ -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; +} diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c new file mode 100644 index 0000000..308c9b2 --- /dev/null +++ b/sysdeps/sparc/fpu/fraiseexcpt.c @@ -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); + } +} diff --git a/sysdeps/sparc/fpu/fsetexcptflg.c b/sysdeps/sparc/fpu/fsetexcptflg.c new file mode 100644 index 0000000..1029cde --- /dev/null +++ b/sysdeps/sparc/fpu/fsetexcptflg.c @@ -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); +} diff --git a/sysdeps/sparc/fpu/ftestexcept.c b/sysdeps/sparc/fpu/ftestexcept.c new file mode 100644 index 0000000..3efe9e8 --- /dev/null +++ b/sysdeps/sparc/fpu/ftestexcept.c @@ -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; +} diff --git a/sysdeps/sparc/Dist b/sysdeps/sparc/sparc32/Dist index 6c3b23b..6c3b23b 100644 --- a/sysdeps/sparc/Dist +++ b/sysdeps/sparc/sparc32/Dist diff --git a/sysdeps/sparc/sparc32/Implies b/sysdeps/sparc/sparc32/Implies new file mode 100644 index 0000000..39a34c5 --- /dev/null +++ b/sysdeps/sparc/sparc32/Implies @@ -0,0 +1 @@ +wordsize-32 diff --git a/sysdeps/sparc/Makefile b/sysdeps/sparc/sparc32/Makefile index deec2f8..deec2f8 100644 --- a/sysdeps/sparc/Makefile +++ b/sysdeps/sparc/sparc32/Makefile diff --git a/sysdeps/sparc/__longjmp.S b/sysdeps/sparc/sparc32/__longjmp.S index 36e1c17..36e1c17 100644 --- a/sysdeps/sparc/__longjmp.S +++ b/sysdeps/sparc/sparc32/__longjmp.S diff --git a/sysdeps/sparc/add_n.S b/sysdeps/sparc/sparc32/add_n.S index 9852c25..9852c25 100644 --- a/sysdeps/sparc/add_n.S +++ b/sysdeps/sparc/sparc32/add_n.S diff --git a/sysdeps/sparc/addmul_1.S b/sysdeps/sparc/sparc32/addmul_1.S index 375d25d..375d25d 100644 --- a/sysdeps/sparc/addmul_1.S +++ b/sysdeps/sparc/sparc32/addmul_1.S diff --git a/sysdeps/sparc/alloca.S b/sysdeps/sparc/sparc32/alloca.S index dcbd171..dcbd171 100644 --- a/sysdeps/sparc/alloca.S +++ b/sysdeps/sparc/sparc32/alloca.S diff --git a/sysdeps/sparc/bits/endian.h b/sysdeps/sparc/sparc32/bits/endian.h index f1a75c0..f1a75c0 100644 --- a/sysdeps/sparc/bits/endian.h +++ b/sysdeps/sparc/sparc32/bits/endian.h diff --git a/sysdeps/sparc/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h index 43bae1a..43bae1a 100644 --- a/sysdeps/sparc/bits/setjmp.h +++ b/sysdeps/sparc/sparc32/bits/setjmp.h diff --git a/sysdeps/sparc/bsd-_setjmp.S b/sysdeps/sparc/sparc32/bsd-_setjmp.S index bf49765..bf49765 100644 --- a/sysdeps/sparc/bsd-_setjmp.S +++ b/sysdeps/sparc/sparc32/bsd-_setjmp.S diff --git a/sysdeps/sparc/bsd-setjmp.S b/sysdeps/sparc/sparc32/bsd-setjmp.S index 16dc260..16dc260 100644 --- a/sysdeps/sparc/bsd-setjmp.S +++ b/sysdeps/sparc/sparc32/bsd-setjmp.S diff --git a/sysdeps/sparc/divrem.m4 b/sysdeps/sparc/sparc32/divrem.m4 index 665abf1..665abf1 100644 --- a/sysdeps/sparc/divrem.m4 +++ b/sysdeps/sparc/sparc32/divrem.m4 diff --git a/sysdeps/sparc/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index dc38e17..f7bcba0 100644 --- a/sysdeps/sparc/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -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. */ diff --git a/sysdeps/sparc/dotmul.S b/sysdeps/sparc/sparc32/dotmul.S index 7ce695c..7ce695c 100644 --- a/sysdeps/sparc/dotmul.S +++ b/sysdeps/sparc/sparc32/dotmul.S diff --git a/sysdeps/sparc/e_sqrt.c b/sysdeps/sparc/sparc32/e_sqrt.c index a98ae21..a98ae21 100644 --- a/sysdeps/sparc/e_sqrt.c +++ b/sysdeps/sparc/sparc32/e_sqrt.c diff --git a/sysdeps/sparc/elf/Makefile b/sysdeps/sparc/sparc32/elf/Makefile index 319fbde..319fbde 100644 --- a/sysdeps/sparc/elf/Makefile +++ b/sysdeps/sparc/sparc32/elf/Makefile diff --git a/sysdeps/sparc/elf/start.c b/sysdeps/sparc/sparc32/elf/start.c index f1e8019..f1e8019 100644 --- a/sysdeps/sparc/elf/start.c +++ b/sysdeps/sparc/sparc32/elf/start.c diff --git a/sysdeps/sparc/sparc32/fpu/bits/fenv.h b/sysdeps/sparc/sparc32/fpu/bits/fenv.h new file mode 100644 index 0000000..0560dd9 --- /dev/null +++ b/sysdeps/sparc/sparc32/fpu/bits/fenv.h @@ -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)) diff --git a/sysdeps/sparc/fpu_control.h b/sysdeps/sparc/sparc32/fpu/fpu_control.h index 5ef3824..5ef3824 100644 --- a/sysdeps/sparc/fpu_control.h +++ b/sysdeps/sparc/sparc32/fpu/fpu_control.h diff --git a/sysdeps/sparc/lshift.S b/sysdeps/sparc/sparc32/lshift.S index 4f0595f..4f0595f 100644 --- a/sysdeps/sparc/lshift.S +++ b/sysdeps/sparc/sparc32/lshift.S diff --git a/sysdeps/sparc/memcopy.h b/sysdeps/sparc/sparc32/memcopy.h index ff73f45..ff73f45 100644 --- a/sysdeps/sparc/memcopy.h +++ b/sysdeps/sparc/sparc32/memcopy.h diff --git a/sysdeps/sparc/mul_1.S b/sysdeps/sparc/sparc32/mul_1.S index 142fd8b..142fd8b 100644 --- a/sysdeps/sparc/mul_1.S +++ b/sysdeps/sparc/sparc32/mul_1.S diff --git a/sysdeps/sparc/rem.S b/sysdeps/sparc/sparc32/rem.S index d50f1af..d50f1af 100644 --- a/sysdeps/sparc/rem.S +++ b/sysdeps/sparc/sparc32/rem.S diff --git a/sysdeps/sparc/rshift.S b/sysdeps/sparc/sparc32/rshift.S index fea4f3b..fea4f3b 100644 --- a/sysdeps/sparc/rshift.S +++ b/sysdeps/sparc/sparc32/rshift.S diff --git a/sysdeps/sparc/sdiv.S b/sysdeps/sparc/sparc32/sdiv.S index 02ed2e9..02ed2e9 100644 --- a/sysdeps/sparc/sdiv.S +++ b/sysdeps/sparc/sparc32/sdiv.S diff --git a/sysdeps/sparc/setjmp.S b/sysdeps/sparc/sparc32/setjmp.S index 772ec72..772ec72 100644 --- a/sysdeps/sparc/setjmp.S +++ b/sysdeps/sparc/sparc32/setjmp.S diff --git a/sysdeps/sparc/sparc8/addmul_1.S b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S index fb9ea7c..fb9ea7c 100644 --- a/sysdeps/sparc/sparc8/addmul_1.S +++ b/sysdeps/sparc/sparc32/sparcv8/addmul_1.S diff --git a/sysdeps/sparc/sparc8/mul_1.S b/sysdeps/sparc/sparc32/sparcv8/mul_1.S index b641feb..b641feb 100644 --- a/sysdeps/sparc/sparc8/mul_1.S +++ b/sysdeps/sparc/sparc32/sparcv8/mul_1.S diff --git a/sysdeps/sparc/sparc8/submul_1.S b/sysdeps/sparc/sparc32/sparcv8/submul_1.S index e40119d..e40119d 100644 --- a/sysdeps/sparc/sparc8/submul_1.S +++ b/sysdeps/sparc/sparc32/sparcv8/submul_1.S diff --git a/sysdeps/sparc/sparc8/udiv_qrnnd.S b/sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S index 49c2398..49c2398 100644 --- a/sysdeps/sparc/sparc8/udiv_qrnnd.S +++ b/sysdeps/sparc/sparc32/sparcv8/udiv_qrnnd.S diff --git a/sysdeps/sparc/sub_n.S b/sysdeps/sparc/sparc32/sub_n.S index b7a1195..b7a1195 100644 --- a/sysdeps/sparc/sub_n.S +++ b/sysdeps/sparc/sparc32/sub_n.S diff --git a/sysdeps/sparc/submul_1.S b/sysdeps/sparc/sparc32/submul_1.S index a8ebd50..a8ebd50 100644 --- a/sysdeps/sparc/submul_1.S +++ b/sysdeps/sparc/sparc32/submul_1.S diff --git a/sysdeps/sparc/udiv.S b/sysdeps/sparc/sparc32/udiv.S index 4a7d152..4a7d152 100644 --- a/sysdeps/sparc/udiv.S +++ b/sysdeps/sparc/sparc32/udiv.S diff --git a/sysdeps/sparc/udiv_qrnnd.S b/sysdeps/sparc/sparc32/udiv_qrnnd.S index 437d66e..5b67f87 100644 --- a/sysdeps/sparc/udiv_qrnnd.S +++ b/sysdeps/sparc/sparc32/udiv_qrnnd.S @@ -18,7 +18,6 @@ ! along with the GNU MP Library; see the file COPYING.LIB. If not, write to ! the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -! ! Added PIC support - May/96, Miguel de Icaza ! INPUT PARAMETERS @@ -32,8 +31,16 @@ .text .align 8 -LC0: .double 0r4294967296 -LC1: .double 0r2147483648 + + .type two_to_32,@object +two_to_32: + .double 0r4294967296 + .size two_to_32,8 + + .type two_to_31,@object +two_to_31: + .double 0r2147483648 + .size two_to_31,8 .align 4 .global __udiv_qrnnd @@ -45,22 +52,19 @@ ENTRY(__udiv_qrnnd) st %i1,[%fp-8] ld [%fp-8],%f10 #ifdef PIC -._XL11: - call ._XL1 +.Lbase: call 1f fitod %f10,%f4 -._XL1: - sub %o7,(._XL11-LC0),%o7 - ldd [%o7],%f8 +1: ldd [%o7-(.Lbase-two_to_32)],%f8 #else - sethi %hi(LC0),%o7 + sethi %hi(two_to_32),%o7 fitod %f10,%f4 - ldd [%o7+%lo(LC0)],%f8 + ldd [%o7+%lo(two_to_32)],%f8 #endif cmp %i1,0 bge L248 mov %i0,%i5 faddd %f4,%f8,%f4 -L248: +.L248: st %i2,[%fp-8] ld [%fp-8],%f10 fmuld %f4,%f8,%f6 @@ -68,7 +72,7 @@ L248: bge L249 fitod %f10,%f2 faddd %f2,%f8,%f2 -L249: +.L249: st %i3,[%fp-8] faddd %f6,%f2,%f2 ld [%fp-8],%f10 @@ -76,18 +80,13 @@ L249: bge L250 fitod %f10,%f4 faddd %f4,%f8,%f4 -L250: +.L250: fdivd %f2,%f4,%f2 #ifdef PIC -._XL22: - call ._XL2 - nop -._XL2: - sub %o7,(._XL22-LC1),%o7 - ldd [%o7],%f4 + ldd [%o7-(.Lbase-two_to_31)],%f4 #else - sethi %hi(LC1),%o7 - ldd [%o7+%lo(LC1)],%f4 + sethi %hi(two_to_31),%o7 + ldd [%o7+%lo(two_to_31)],%f4 #endif fcmped %f2,%f4 nop @@ -97,13 +96,13 @@ L250: st %f2,[%fp-8] b L252 ld [%fp-8],%i4 -L251: +.L251: fdtoi %f2,%f2 st %f2,[%fp-8] ld [%fp-8],%i4 sethi %hi(-2147483648),%g2 xor %i4,%g2,%i4 -L252: +.L252: wr %g0,%i4,%y sra %i3,31,%g2 and %i4,%g2,%g2 @@ -153,12 +152,14 @@ L252: st %o7,[%i5] ret restore -L253: +.L253: blu L246 mov %i4,%i0 add %i4,1,%i0 sub %o7,%i3,%o7 -L246: +.L246: st %o7,[%i5] ret restore + + .size __udiv_qrnnd, .-__udiv_qrnnd diff --git a/sysdeps/sparc/umul.S b/sysdeps/sparc/sparc32/umul.S index 7a26c29..7a26c29 100644 --- a/sysdeps/sparc/umul.S +++ b/sysdeps/sparc/sparc32/umul.S diff --git a/sysdeps/sparc/urem.S b/sysdeps/sparc/sparc32/urem.S index e72c33d..e72c33d 100644 --- a/sysdeps/sparc/urem.S +++ b/sysdeps/sparc/sparc32/urem.S diff --git a/sysdeps/sparc/sparc64/Implies b/sysdeps/sparc/sparc64/Implies new file mode 100644 index 0000000..a8cae95 --- /dev/null +++ b/sysdeps/sparc/sparc64/Implies @@ -0,0 +1 @@ +wordsize-64 diff --git a/sysdeps/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile index 48a86c6..656274d 100644 --- a/sysdeps/sparc64/Makefile +++ b/sysdeps/sparc/sparc64/Makefile @@ -7,5 +7,5 @@ omit-long-double-fcts = yes # But we do need these few functions to even link stdio proggies ifeq ($(subdir),math) -sysdep_routines += s_isinfl s_isnanl +sysdep_routines += s_isinfl s_isnanl s_finitel s_signbitl endif diff --git a/sysdeps/sparc64/add_n.S b/sysdeps/sparc/sparc64/add_n.S index 68bb008..68bb008 100644 --- a/sysdeps/sparc64/add_n.S +++ b/sysdeps/sparc/sparc64/add_n.S diff --git a/sysdeps/sparc64/addmul_1.S b/sysdeps/sparc/sparc64/addmul_1.S index 2604812..2604812 100644 --- a/sysdeps/sparc64/addmul_1.S +++ b/sysdeps/sparc/sparc64/addmul_1.S diff --git a/sysdeps/sparc64/bits/endian.h b/sysdeps/sparc/sparc64/bits/endian.h index a2ab072..a2ab072 100644 --- a/sysdeps/sparc64/bits/endian.h +++ b/sysdeps/sparc/sparc64/bits/endian.h diff --git a/sysdeps/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index df09c8f..eb46ba9 100644 --- a/sysdeps/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -26,6 +26,9 @@ #include <sysdep.h> +/* Translate a processor-specific dynamic tag to the index into l_info. */ +#define DT_SPARC(x) (DT_SPARC_##x - DT_LOPROC + DT_NUM) + /* Return nonzero iff E_MACHINE is compatible with the running host. */ static inline int elf_machine_matches_host (Elf64_Half e_machine) @@ -33,15 +36,15 @@ elf_machine_matches_host (Elf64_Half e_machine) return e_machine == EM_SPARC64; } - /* Return the link-time address of _DYNAMIC. Conveniently, this is the first element of the GOT. This must be inlined in a function which uses global data. */ static inline Elf64_Addr elf_machine_dynamic (void) { - register Elf64_Addr *got asm ("%l7"); - return *got; + register Elf64_Addr elf_pic_register __asm__("%l7"); + + return *(Elf64_Addr *)elf_pic_register; } @@ -49,17 +52,19 @@ elf_machine_dynamic (void) static inline Elf64_Addr elf_machine_load_address (void) { - Elf64_Addr here; + register Elf64_Addr elf_pic_register __asm__("%l7"); + Elf64_Addr pc, la; + + /* Utilize the fact that a local .got entry will be partially + initialized at startup awaiting its RELATIVE fixup. */ - __asm("rd %pc,%0\n\t" - "ba 1f\n\t" - " add %0,12,%0\n\t" - ".weak __load_address_undefined\n\t" - "call __load_address_undefined\n" - "1:" - : "=r"(here)); + __asm("sethi %%hi(.Load_address), %1\n" + ".Load_address:\n\t" + "rd %%pc, %0\n\t" + "or %1, %%lo(.Load_address), %1\n\t" + : "=r"(pc), "=r"(la)); - return here + (*(int *)here << 2); + return pc - *(Elf64_Addr *)(elf_pic_register + la); } #ifdef RESOLVE @@ -71,8 +76,6 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, const struct r_found_version *version, Elf64_Addr *const reloc_addr) { - Elf64_Addr loadbase; - #ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make the reference weak so static programs can still link. This declaration @@ -87,7 +90,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, #ifndef RTLD_BOOTSTRAP if (map != &_dl_rtld_map) /* Already done in rtld itself. */ #endif - *reloc_addr += map->l_addr + reloc->r_addend; + *reloc_addr = map->l_addr + reloc->r_addend; } else { @@ -123,9 +126,9 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, memcpy (reloc_addr, (void *) value, MIN (sym->st_size, refsym->st_size)); break; + + case R_SPARC_64: case R_SPARC_GLOB_DAT: - /* case R_SPARC_64: */ - case R_SPARC_JMP_SLOT: *reloc_addr = value; break; case R_SPARC_8: @@ -155,6 +158,25 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, *(unsigned *)reloc_addr = (*(unsigned *)reloc_addr & 0xffc00000) | (value >> 10); break; + + case R_SPARC_JMP_SLOT: + { + Elf64_Dyn *pltfmt = map->l_info[DT_SPARC(PLTFMT)]; + switch (pltfmt ? pltfmt->d_un.d_val : 0) + { + case 1: /* .got.plt with absolute addresses */ + *reloc_addr = value; + break; + case 2: /* .got.plt with got-relative addresses */ + *reloc_addr = value - (map->l_info[DT_PLTGOT]->d_un.d_ptr + + map->l_addr); + break; + default: + assert (! "unexpected .plt format type"); + } + } + break; + case R_SPARC_NONE: /* Alright, Wilbur. */ break; default: @@ -195,6 +217,8 @@ elf_machine_lazy_rel (struct link_map *map, const Elf64_Rela *reloc) /* The SPARC never uses Elf64_Rel relocations. */ #define ELF_MACHINE_NO_REL 1 +/* The SPARC overlaps DT_RELA and DT_PLTREL. */ +#define ELF_MACHINE_PLTREL_OVERLAP 1 /* Set up the loaded object described by L so its unrelocated PLT entries will jump to the on-demand fixup code in dl-runtime.c. */ @@ -203,7 +227,7 @@ static inline int elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) { Elf64_Addr *got; - extern void _dl_runtime_resolve (Elf64_Word); + extern void _dl_runtime_resolve (void); if (l->l_info[DT_JMPREL] && lazy) { @@ -224,9 +248,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) .type _dl_runtime_resolve, @function _dl_runtime_resolve: save %sp, -160, %sp - mov %g1, %o1 + mov %g5, %o0 call fixup - mov %g2, %o0 + mov %g6, %o1 jmp %o0 restore .size _dl_runtime_resolve, .-_dl_runtime_resolve @@ -236,10 +260,6 @@ _dl_runtime_resolve: #define elf_machine_relplt elf_machine_rela -/* Mask identifying addresses reserved for the user program, - where the dynamic linker should not map anything. */ -#define ELF_MACHINE_USER_ADDRESS_MASK ??? - /* Initial entry point code for the dynamic linker. The C function `_dl_start' is the real entry point; its return value is the user program's entry point. */ @@ -257,33 +277,59 @@ _start: call _dl_start add %sp," __S(STACK_BIAS) "+22*8,%o0 /* FALLTHRU */ + .size _start, .-_start .global _dl_start_user .type _dl_start_user, @function _dl_start_user: /* Load the GOT register. */ -1: rd %pc,%g1 +1: call 11f sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7 - or %l2,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7 - add %l7,%g1,%l7 +11: or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7 + add %l7,%o7,%l7 /* Save the user entry point address in %l0. */ mov %o0,%l0 /* See if we were run as a command with the executable file name as an - extra leading argument. If so, adjust the stack pointer. */ + extra leading argument. If so, we must shift things around since we + must keep the stack doubleword aligned. */ sethi %hi(_dl_skip_args), %g2 or %g2, %lo(_dl_skip_args), %g2 - ld [%l7+%g2], %i0 + ldx [%l7+%g2], %i0 + ld [%i0], %i0 brz,pt %i0, 2f - ldx [%sp+" __S(STACK_BIAS) "+22*8], %i1 + nop + /* Find out how far to shift. */ + ldx [%sp+" __S(STACK_BIAS) "+22*8], %i1 sub %i1, %i0, %i1 sllx %i0, 3, %i2 - add %sp, %i2, %sp stx %i1, [%sp+" __S(STACK_BIAS) "+22*8] + add %sp, " __S(STACK_BIAS) "+23*8, %i1 + add %i1, %i2, %i2 + /* Copy down argv. */ +12: ldx [%i2], %i3 + add %i2, 8, %i2 + stx %i3, [%i1] + brnz,pt %i3, 12b + add %i1, 8, %i1 + /* Copy down envp. */ +13: ldx [%i2], %i3 + add %i2, 8, %i2 + stx %i3, [%i1] + brnz,pt %i3, 13b + add %i1, 8, %i1 + /* Copy down auxiliary table. */ +14: ldx [%i2], %i3 + ldx [%i2+8], %i4 + add %i2, 16, %i2 + stx %i3, [%i1] + stx %i4, [%i1+8] + brnz,pt %i3, 13b + add %i1, 16, %i1 /* Load _dl_default_scope[2] to pass to _dl_init_next. */ 2: sethi %hi(_dl_default_scope), %g2 - or %g2, %lo(_dl_defalt_scope), %g2 - add %g2, 2*8, %g2 - ldx [%l7+%g2], %l1 + or %g2, %lo(_dl_default_scope), %g2 + ldx [%l7+%g2], %g2 + ldx [%g2+2*8], %l1 /* Call _dl_init_next to return the address of an initializer to run. */ 3: call _dl_init_next mov %l1, %o0 @@ -295,8 +341,9 @@ _dl_start_user: /* Clear the startup flag. */ 4: sethi %hi(_dl_starting_up), %g2 or %g2, %lo(_dl_starting_up), %g2 - st %g0, [%l7+%g2] - /* Pass our finalizer function to the user in %g1 + ldx [%l7+%g2], %g2 + st %g0, [%g2] + /* Pass our finalizer function to the user in %g1. */ sethi %hi(_dl_fini), %g1 or %g1, %lo(_dl_fini), %g1 ldx [%l7+%g1], %g1 diff --git a/sysdeps/sparc64/elf/Dist b/sysdeps/sparc/sparc64/elf/Dist index d9338c8..d9338c8 100644 --- a/sysdeps/sparc64/elf/Dist +++ b/sysdeps/sparc/sparc64/elf/Dist diff --git a/sysdeps/sparc64/elf/Makefile b/sysdeps/sparc/sparc64/elf/Makefile index 1b38355..1b38355 100644 --- a/sysdeps/sparc64/elf/Makefile +++ b/sysdeps/sparc/sparc64/elf/Makefile diff --git a/sysdeps/sparc/sparc64/elf/crtbegin.S b/sysdeps/sparc/sparc64/elf/crtbegin.S new file mode 100644 index 0000000..318e7a6 --- /dev/null +++ b/sysdeps/sparc/sparc64/elf/crtbegin.S @@ -0,0 +1,69 @@ +/* Destructor cleanup code for elf64-sparc + Copyright (C) 1997 Free Software Foundation, Inc. + Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + +.section ".ctors",#alloc,#write + + .align 8 +__CTOR_LIST__: + .xword -1 + +.section ".dtors",#alloc,#write + + .align 8 +__DTOR_LIST__: + .xword -1 + +.section ".fini",#alloc,#execinstr + + call __do_global_dtors_aux + nop + +.text + + .align 4 + .type __do_global_dtors_aux,#function +__do_global_dtors_aux: + save %sp,-160,%sp + +#ifdef PIC +1: call 11f + sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 +11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 + add %l7, %o7, %l7 + sethi %hi(__DTOR_LIST__), %l0 + or %l0, %lo(__DTOR_LIST__), %l0 + ldx [%l7+%l0], %l0 +#else + sethi %hi(__DTOR_LIST__), %l0 + or %l0, %lo(__DTOR_LIST__), %l0 + add %l0, %g4, %l0 +#endif + + ba 3f + ldx [%l0+8], %l1 +2: jmpl %l1, %o7 + ldx [%l0+8], %l1 +3: brnz,pt %l1, 2b + add %l0, 8, %l0 + + ret + restore + + .size __do_global_dtors_aux,.-__do_global_dtors_aux diff --git a/sysdeps/sparc64/elf/crtbeginS.S b/sysdeps/sparc/sparc64/elf/crtbeginS.S index 7db4bc5..7db4bc5 100644 --- a/sysdeps/sparc64/elf/crtbeginS.S +++ b/sysdeps/sparc/sparc64/elf/crtbeginS.S diff --git a/sysdeps/sparc/sparc64/elf/crtend.S b/sysdeps/sparc/sparc64/elf/crtend.S new file mode 100644 index 0000000..7a5c067 --- /dev/null +++ b/sysdeps/sparc/sparc64/elf/crtend.S @@ -0,0 +1,70 @@ +/* Constructor startup code for elf64-sparc + Copyright (C) 1997 Free Software Foundation, Inc. + Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + +.section ".ctors",#alloc,#write + + .align 8 +__CTOR_END__: + .xword 0 + +.section ".dtors",#alloc,#write + + .align 8 +__DTOR_END__: + .xword 0 + +.section ".init",#alloc,#execinstr + + call __do_global_ctors_aux + nop + +.text + + .align 4 + .type __do_global_ctors_aux,#function +__do_global_ctors_aux: + save %sp,-160,%sp + +#ifdef PIC +1: call 11f + sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 +11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 + add %l7, %o7, %l7 + sethi %hi(__CTOR_END__), %l0 + or %l0, %lo(__CTOR_END__), %l0 + ldx [%l7+%l0], %l0 +#else + sethi %hi(__CTOR_END__), %l0 + or %l0, %lo(__CTOR_END__), %l0 + add %l0, %g4, %l0 +#endif + + ba 3f + ldx [%l0+8], %l1 +2: jmpl %l1, %o7 + ldx [%l0+8], %l1 +3: addcc %l1, 1, %g0 + bnz,pt %xcc, 2b + add %l0, 8, %l0 + + ret + restore + + .size __do_global_ctors_aux,.-__do_global_ctors_aux diff --git a/sysdeps/sparc64/elf/crtendS.S b/sysdeps/sparc/sparc64/elf/crtendS.S index 56532f5..56532f5 100644 --- a/sysdeps/sparc64/elf/crtendS.S +++ b/sysdeps/sparc/sparc64/elf/crtendS.S diff --git a/sysdeps/sparc64/elf/start.S b/sysdeps/sparc/sparc64/elf/start.S index 73f4236..73f4236 100644 --- a/sysdeps/sparc64/elf/start.S +++ b/sysdeps/sparc/sparc64/elf/start.S diff --git a/sysdeps/sparc/sparc64/fpu/bits/fenv.h b/sysdeps/sparc/sparc64/fpu/bits/fenv.h new file mode 100644 index 0000000..802c58b --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/bits/fenv.h @@ -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 long fexcept_t; + +/* Type representing floating-point environment. */ +typedef unsigned long fenv_t; + +/* If the default argument is used we use this value. */ +#define FE_DFL_ENV ((fenv_t *) -1) + +#ifdef __USE_GNU +/* Floating-point environment where none of the exception is masked. */ +# define FE_NOMASK_ENV ((fenv_t *) -2) +#endif + +/* For internal use only: access the fp state register. */ +#define __fenv_stfsr(X) __asm__("stx %%fsr,%0" : "=m"(X)) +#define __fenv_ldfsr(X) __asm__ __volatile__("ldx %0,%%fsr" : : "m"(X)) diff --git a/sysdeps/sparc64/fpu_control.h b/sysdeps/sparc/sparc64/fpu/fpu_control.h index fd8abb1..fd8abb1 100644 --- a/sysdeps/sparc64/fpu_control.h +++ b/sysdeps/sparc/sparc64/fpu/fpu_control.h diff --git a/sysdeps/sparc64/gmp-mparam.h b/sysdeps/sparc/sparc64/gmp-mparam.h index a3c6697..a3c6697 100644 --- a/sysdeps/sparc64/gmp-mparam.h +++ b/sysdeps/sparc/sparc64/gmp-mparam.h diff --git a/sysdeps/sparc64/lshift.S b/sysdeps/sparc/sparc64/lshift.S index 1678991..1678991 100644 --- a/sysdeps/sparc64/lshift.S +++ b/sysdeps/sparc/sparc64/lshift.S diff --git a/sysdeps/sparc64/mul_1.S b/sysdeps/sparc/sparc64/mul_1.S index 87e441d..87e441d 100644 --- a/sysdeps/sparc64/mul_1.S +++ b/sysdeps/sparc/sparc64/mul_1.S diff --git a/sysdeps/sparc64/rshift.S b/sysdeps/sparc/sparc64/rshift.S index e1b3aca..e1b3aca 100644 --- a/sysdeps/sparc64/rshift.S +++ b/sysdeps/sparc/sparc64/rshift.S diff --git a/sysdeps/sparc64/sub_n.S b/sysdeps/sparc/sparc64/sub_n.S index 93f8a82..93f8a82 100644 --- a/sysdeps/sparc64/sub_n.S +++ b/sysdeps/sparc/sparc64/sub_n.S diff --git a/sysdeps/sparc64/submul_1.S b/sysdeps/sparc/sparc64/submul_1.S index 3cc0e3b..3cc0e3b 100644 --- a/sysdeps/sparc64/submul_1.S +++ b/sysdeps/sparc/sparc64/submul_1.S diff --git a/sysdeps/sparc64/Implies b/sysdeps/sparc64/Implies deleted file mode 100644 index 1d793f9..0000000 --- a/sysdeps/sparc64/Implies +++ /dev/null @@ -1,3 +0,0 @@ -wordsize-64 -# SPARC uses IEEE 754 floating point. -ieee754 diff --git a/sysdeps/sparc64/configure b/sysdeps/sparc64/configure deleted file mode 100755 index 099f5b0..0000000 --- a/sysdeps/sparc64/configure +++ /dev/null @@ -1,3 +0,0 @@ - # Local configure fragment for sysdeps/sparc64 - -nopic_initfini=yes diff --git a/sysdeps/sparc64/configure.in b/sysdeps/sparc64/configure.in deleted file mode 100644 index 5f74b82..0000000 --- a/sysdeps/sparc64/configure.in +++ /dev/null @@ -1,7 +0,0 @@ -sinclude(./aclocal.m4)dnl Autoconf lossage -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/sparc64 - -dnl We need to have separate crt? files for static linking which does -dnl not use PIC. -nopic_initfini=yes diff --git a/sysdeps/sparc64/elf/crtbegin.S b/sysdeps/sparc64/elf/crtbegin.S deleted file mode 100644 index fbd731c..0000000 --- a/sysdeps/sparc64/elf/crtbegin.S +++ /dev/null @@ -1,49 +0,0 @@ -.section ".ctors",#alloc,#write - - .align 8 -__CTOR_LIST__: - .xword -1 - -.section ".dtors",#alloc,#write - - .align 8 -__DTOR_LIST__: - .xword -1 - -.section ".fini",#alloc,#execinstr - - call __do_global_dtors_aux - nop - -.text - - .align 4 - .type __do_global_dtors_aux,#function -__do_global_dtors_aux: - save %sp,-160,%sp - -#ifdef PIC -1: rd %pc, %g1 - sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - add %l7, %g1, %l7 - sethi %hi(__DTOR_LIST__), %l0 - or %l0, %lo(__DTOR_LIST__), %l0 - ldx [%l7+%l0], %l0 -#else - sethi %hi(__DTOR_LIST__), %l0 - or %l0, %lo(__DTOR_LIST__), %l0 - add %l0, %g4, %l0 -#endif - - ba 3f - ldx [%l0+8], %l1 -2: jmpl %l1, %o7 - ldx [%l0+8], %l1 -3: brnz,pt %l1, 2b - add %l0, 8, %l0 - - ret - restore - - .size __do_global_dtors_aux,.-__do_global_dtors_aux diff --git a/sysdeps/sparc64/elf/crtend.S b/sysdeps/sparc64/elf/crtend.S deleted file mode 100644 index ea69083..0000000 --- a/sysdeps/sparc64/elf/crtend.S +++ /dev/null @@ -1,50 +0,0 @@ -.section ".ctors",#alloc,#write - - .align 8 -__CTOR_END__: - .xword 0 - -.section ".dtors",#alloc,#write - - .align 8 -__DTOR_END__: - .xword 0 - -.section ".init",#alloc,#execinstr - - call __do_global_ctors_aux - nop - -.text - - .align 4 - .type __do_global_ctors_aux,#function -__do_global_ctors_aux: - save %sp,-160,%sp - -#ifdef PIC -1: rd %pc, %g1 - sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - add %l7, %g1, %l7 - sethi %hi(__CTOR_END__), %l0 - or %l0, %lo(__CTOR_END__), %l0 - ldx [%l7+%l0], %l0 -#else - sethi %hi(__CTOR_END__), %l0 - or %l0, %lo(__CTOR_END__), %l0 - add %l0, %g4, %l0 -#endif - - ba 3f - ldx [%l0+8], %l1 -2: jmpl %l1, %o7 - ldx [%l0+8], %l1 -3: addcc %l1, 1, %g0 - bnz,pt %xcc, 2b - add %l0, 8, %l0 - - ret - restore - - .size __do_global_ctors_aux,.-__do_global_ctors_aux diff --git a/sysdeps/stub/accept.c b/sysdeps/stub/accept.c index 8f65f5f..c27070c 100644 --- a/sysdeps/stub/accept.c +++ b/sysdeps/stub/accept.c @@ -28,7 +28,7 @@ int accept (fd, addr, addr_len) int fd; __SOCKADDR_ARG addr; - size_t *addr_len; + socklen_t *addr_len; { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/stub/bind.c b/sysdeps/stub/bind.c index bfd2888..7e7f0d7 100644 --- a/sysdeps/stub/bind.c +++ b/sysdeps/stub/bind.c @@ -24,7 +24,7 @@ int bind (fd, addr, len) int fd; __CONST_SOCKADDR_ARG addr; - size_t len; + socklen_t len; { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/stub/bits/string.h b/sysdeps/stub/bits/string.h index bd1b774..ad68b03 100644 --- a/sysdeps/stub/bits/string.h +++ b/sysdeps/stub/bits/string.h @@ -1,4 +1,4 @@ -/* This file should provide inline versions of math functions. +/* This file should provide inline versions of string functions. Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'. diff --git a/sysdeps/stub/connect.c b/sysdeps/stub/connect.c index 9152a94..fb8b503 100644 --- a/sysdeps/stub/connect.c +++ b/sysdeps/stub/connect.c @@ -27,12 +27,11 @@ int __connect (fd, addr, len) int fd; __CONST_SOCKADDR_ARG addr; - size_t len; + socklen_t len; { __set_errno (ENOSYS); return -1; } weak_alias (__connect, connect) - stub_warning (connect) diff --git a/sysdeps/stub/getsockname.c b/sysdeps/stub/getsockname.c index 0706e59..f0d46db 100644 --- a/sysdeps/stub/getsockname.c +++ b/sysdeps/stub/getsockname.c @@ -24,7 +24,7 @@ int getsockname (fd, addr, len) int fd; __SOCKADDR_ARG addr; - size_t *len; + socklen_t *len; { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/stub/getsockopt.c b/sysdeps/stub/getsockopt.c index d06b3e6..6f3c866 100644 --- a/sysdeps/stub/getsockopt.c +++ b/sysdeps/stub/getsockopt.c @@ -28,11 +28,10 @@ getsockopt (fd, level, optname, optval, optlen) int level; int optname; void *optval; - size_t *optlen; + socklen_t *optlen; { __set_errno (ENOSYS); return -1; } - stub_warning (getsockopt) diff --git a/sysdeps/stub/recvfrom.c b/sysdeps/stub/recvfrom.c index d759c3d..931bdbb 100644 --- a/sysdeps/stub/recvfrom.c +++ b/sysdeps/stub/recvfrom.c @@ -29,11 +29,10 @@ recvfrom (fd, buf, n, flags, addr, addr_len) size_t n; int flags; __SOCKADDR_ARG addr; - size_t *addr_len; + socklen_t *addr_len; { __set_errno (ENOSYS); return -1; } - stub_warning (recvfrom) diff --git a/sysdeps/stub/sendto.c b/sysdeps/stub/sendto.c index d09efba..47dad95 100644 --- a/sysdeps/stub/sendto.c +++ b/sysdeps/stub/sendto.c @@ -28,11 +28,10 @@ sendto (fd, buf, n, flags, addr, addr_len) size_t n; int flags; __CONST_SOCKADDR_ARG addr; - size_t addr_len; + socklen_t addr_len; { __set_errno (ENOSYS); return -1; } - stub_warning (sendto) diff --git a/sysdeps/stub/setsockopt.c b/sysdeps/stub/setsockopt.c index b1c02a1..5fad292 100644 --- a/sysdeps/stub/setsockopt.c +++ b/sysdeps/stub/setsockopt.c @@ -28,11 +28,10 @@ setsockopt (fd, level, optname, optval, optlen) int level; int optname; void *optval; - size_t optlen; + socklen_t optlen; { __set_errno (ENOSYS); return -1; } - stub_warning (setsockopt) diff --git a/sysdeps/unix/bsd/osf/bits/sigaction.h b/sysdeps/unix/bsd/osf/bits/sigaction.h index df400d4..56e28a0 100644 --- a/sysdeps/unix/bsd/osf/bits/sigaction.h +++ b/sysdeps/unix/bsd/osf/bits/sigaction.h @@ -1,5 +1,5 @@ /* Structure and constant definitions for sigaction et al. OSF/1 version. - Copyright (C) 1993, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). @@ -33,9 +33,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 0x4 /* Don't send SIGCHLD when children stop. */ diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index ed9ae87..ea1ab49 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -11,7 +11,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \ sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \ sys/user.h sys/sysmacros.h sys/procfs.h \ sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \ - sys/quota.h sys/fsuid.h + sys/quota.h sys/fsuid.h bits/mman.h install-others += $(inst_includedir)/bits/syscall.h diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h index e2e97bd..f28b6f2 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/sigaction.h @@ -31,21 +31,21 @@ struct sigaction }; /* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDSTOP 0x00000004 /* Don't send SIGCHLD when children stop. */ #ifdef __USE_MISC -#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ -#define SA_NOMASK 0x00000008 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */ +# define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */ +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ +# define SA_NOMASK 0x00000008 /* Don't automatically block the signal + when its handler is being executed. */ +# define SA_ONESHOT 0x00000010 /* Reset to SIG_DFL on entry to handler. */ /* Some aliases for the SA_ constants. */ -#define SA_NODEFER SA_NOMASK -#define SA_RESETHAND SA_ONESHOT +# define SA_NODEFER SA_NOMASK +# define SA_RESETHAND SA_ONESHOT #endif /* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/bits/sigaction.h b/sysdeps/unix/sysv/linux/bits/sigaction.h index 13a6a03..247b534 100644 --- a/sysdeps/unix/sysv/linux/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/bits/sigaction.h @@ -1,5 +1,5 @@ /* The proper definitions for Linux's sigaction. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -34,21 +34,21 @@ struct sigaction }; /* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #ifdef __USE_MISC -#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ -#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ +# define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ +# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when + its handler is being executed. */ +# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ /* Some aliases for the SA_ constants. */ -#define SA_NOMASK SA_NODEFER -#define SA_ONESHOT SA_RESETHAND +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND #endif /* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 0 /* Block signals. */ -#define SIG_UNBLOCK 1 /* Unblock signals. */ -#define SIG_SETMASK 2 /* Set the set of blocked signals. */ +#define SIG_BLOCK 0 /* Block signals. */ +#define SIG_UNBLOCK 1 /* Unblock signals. */ +#define SIG_SETMASK 2 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c index f64fe1e..615a81d 100644 --- a/sysdeps/unix/sysv/linux/if_index.c +++ b/sysdeps/unix/sysv/linux/if_index.c @@ -68,20 +68,21 @@ if_nametoindex (const char *ifname) { #ifndef SIOGIFINDEX __set_errno (ENOSYS); + return 0; #else struct ifreq ifr; - int rc; int fd = opensock (); if (fd < 0) return 0; strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - rc = ioctl (fd, SIOGIFINDEX, &ifr); - if (rc < 0) + if (ioctl (fd, SIOGIFINDEX, &ifr) < 0) { + int saved_errno = errno; close (fd); - __set_errno (rc == -EINVAL ? ENOSYS : -rc); + if (saved_errno == EINVAL) + __set_errno (ENOSYS); return 0; } close (fd); @@ -109,7 +110,6 @@ if_nameindex (void) __set_errno (ENOSYS); return NULL; #else - int rc; int fd = opensock (); struct ifconf ifc; unsigned int rq_ifs = 4, nifs, i; @@ -153,12 +153,13 @@ if_nameindex (void) goto jump; } strcpy (idx[i].if_name, ifr->ifr_name); - rc = ioctl (fd, SIOGIFINDEX, ifr); - if (rc < 0) + if (ioctl (fd, SIOGIFINDEX, ifr) < 0) { + int saved_errno = errno; free (idx); idx = NULL; - __set_errno (rc == -EINVAL ? ENOSYS : -rc); + if (saved_errno == EINVAL) + __set_errno (ENOSYS); goto jump; } idx[i].if_index = ifr->ifr_ifindex; diff --git a/sysdeps/unix/sysv/linux/m68k/bits/mman.h b/sysdeps/unix/sysv/linux/m68k/bits/mman.h new file mode 100644 index 0000000..d6c29d2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/bits/mman.h @@ -0,0 +1,75 @@ +/* Definitions for POSIX memory map inerface. Linux/m68k version. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_MMAN_H +# error "Never include this file directly. Use <sys/mman.h> instead" +#endif + +/* The following definitions basically come from the kernel headers. + But the kernel header is not namespace clean. */ + + +/* Protections are chosen from these bits, OR'd together. The + implementation does not necessarily support PROT_EXEC or PROT_WRITE + without PROT_READ. The only guarantees are that no writing will be + allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ + +#define PROT_READ 0x1 /* Page can be read. */ +#define PROT_WRITE 0x2 /* Page can be written. */ +#define PROT_EXEC 0x4 /* Page can be executed. */ +#define PROT_NONE 0x0 /* Page can not be accessed. */ + +/* Sharing types (must choose one and only one of these). */ +#define MAP_SHARED 0x01 /* Share changes. */ +#define MAP_PRIVATE 0x02 /* Changes are private. */ +#ifdef __USE_MISC +# define MAP_TYPE 0x0f /* Mask for type of mapping. */ +#endif + +/* Other flags. */ +#define MAP_FIXED 0x10 /* Interpret addr exactly. */ +#ifdef __USE_MISC +# define MAP_FILE 0 +# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ +# define MAP_ANON MAP_ANONYMOUS +#endif + +/* These are Linux-specific. */ +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x2000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +#endif + +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 4 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all currently mapped pages. */ +#define MCL_FUTURE 2 /* Lock all additions to address + space. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 +#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h index 66c58cc..d6f70f2 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h @@ -39,24 +39,24 @@ struct sigaction }; /* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #ifdef __USE_MISC -#define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x10000000 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x20000000 /* Historical no-op. */ -#define SA_NODEFER 0x40000000 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ +# define SA_STACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ +# define SA_INTERRUPT 0x20000000 /* Historical no-op. */ +# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when + its handler is being executed. */ +# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ /* Some aliases for the SA_ constants. */ -#define SA_NOMASK SA_NODEFER -#define SA_ONESHOT SA_RESETHAND +# define SA_NOMASK SA_NODEFER +# define SA_ONESHOT SA_RESETHAND #endif /* Values for the HOW argument to `sigprocmask'. */ -#define SIG_NOP 0 /* 0 is unused to catch errors */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 3 /* Set the set of blocked signals. */ -#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: +#define SIG_NOP 0 /* 0 is unused to catch errors */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 3 /* Set the set of blocked signals. */ +#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: set only the low 32 bit of the sigset. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h index 19aa7e3..1347199 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h @@ -27,26 +27,29 @@ struct sigaction __sigset_t sa_mask; /* Special flags. */ - unsigned int sa_flags; + unsigned long sa_flags; + + /* Not used by Linux/Sparc yet. */ + void (*sa_restorer)(void); }; /* Bits in `sa_flags'. */ -#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ +#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */ #ifdef __USE_MISC -#define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ -#define SA_RESTART 0x00000002 /* Don't restart syscall on signal return. */ -#define SA_INTERRUPT 0x00000010 /* Historical no-op. */ -#define SA_NOMASK 0x00000020 /* Don't automatically block the signal when - its handler is being executed. */ -#define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */ +# define SA_STACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ +# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */ +# define SA_INTERRUPT 0x00000010 /* Historical no-op. */ +# define SA_NOMASK 0x00000020 /* Don't automatically block the signal when + its handler is being executed. */ +# define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */ /* Some aliases for the SA_ constants. */ -#define SA_NODEFER SA_NOMASK -#define SA_RESETHAND SA_ONESHOT +# define SA_NODEFER SA_NOMASK +# define SA_RESETHAND SA_ONESHOT #endif /* Values for the HOW argument to `sigprocmask'. */ -#define SIG_BLOCK 1 /* Block signals. */ -#define SIG_UNBLOCK 2 /* Unblock signals. */ -#define SIG_SETMASK 4 /* Set the set of blocked signals. */ +#define SIG_BLOCK 1 /* Block signals. */ +#define SIG_UNBLOCK 2 /* Unblock signals. */ +#define SIG_SETMASK 4 /* Set the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sparc/Dist b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist index 9729f07..9729f07 100644 --- a/sysdeps/unix/sysv/linux/sparc/Dist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Dist diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile index 4cbd3bd..4cbd3bd 100644 --- a/sysdeps/unix/sysv/linux/sparc/Makefile +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Makefile diff --git a/sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S b/sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S index a639511..a639511 100644 --- a/sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/__sigtrampoline.S diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h index 3e7f290..3e7f290 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h diff --git a/sysdeps/unix/sysv/linux/sparc/brk.c b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c index 8f079bf..8f079bf 100644 --- a/sysdeps/unix/sysv/linux/sparc/brk.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c diff --git a/sysdeps/unix/sysv/linux/sparc/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S index 64735e9..64735e9 100644 --- a/sysdeps/unix/sysv/linux/sparc/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S diff --git a/sysdeps/unix/sysv/linux/sparc/fork.S b/sysdeps/unix/sysv/linux/sparc/sparc32/fork.S index 951ab49..951ab49 100644 --- a/sysdeps/unix/sysv/linux/sparc/fork.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/fork.S diff --git a/sysdeps/unix/sysv/linux/sparc/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h index 39822fc..39822fc 100644 --- a/sysdeps/unix/sysv/linux/sparc/init-first.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h index 91f02f4..91f02f4 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h diff --git a/sysdeps/unix/sysv/linux/sparc/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S index 4c50656..4c50656 100644 --- a/sysdeps/unix/sysv/linux/sparc/pipe.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S diff --git a/sysdeps/unix/sysv/linux/sparc/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h index 1bd0648..1bd0648 100644 --- a/sysdeps/unix/sysv/linux/sparc/profil-counter.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h diff --git a/sysdeps/unix/sysv/linux/sparc/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c index d39eb7c..d39eb7c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sigaction.c +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c diff --git a/sysdeps/unix/sysv/linux/sparc/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S index bdfc2fc..bdfc2fc 100644 --- a/sysdeps/unix/sysv/linux/sparc/socket.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S diff --git a/sysdeps/unix/sysv/linux/sparc/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S index 3921ca5..3921ca5 100644 --- a/sysdeps/unix/sysv/linux/sparc/syscall.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S diff --git a/sysdeps/unix/sysv/linux/sparc/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list index 7883d70..7883d70 100644 --- a/sysdeps/unix/sysv/linux/sparc/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.S b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S index 7e90239..7e90239 100644 --- a/sysdeps/unix/sysv/linux/sparc/sysdep.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.S diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index 0e5a8cd..0e5a8cd 100644 --- a/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h diff --git a/sysdeps/unix/sysv/linux/sparc64/Dist b/sysdeps/unix/sysv/linux/sparc/sparc64/Dist index e770e20..e770e20 100644 --- a/sysdeps/unix/sysv/linux/sparc64/Dist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Dist diff --git a/sysdeps/unix/sysv/linux/sparc64/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile index c4d8322..c4d8322 100644 --- a/sysdeps/unix/sysv/linux/sparc64/Makefile +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile diff --git a/sysdeps/unix/sysv/linux/sparc64/__longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S index 3107179..3107179 100644 --- a/sysdeps/unix/sysv/linux/sparc64/__longjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/__longjmp.S diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h index 3e7f290..3e7f290 100644 --- a/sysdeps/unix/sysv/linux/sparc64/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h index ab850e5..ab850e5 100644 --- a/sysdeps/unix/sysv/linux/sparc64/bits/setjmp.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h diff --git a/sysdeps/unix/sysv/linux/sparc64/bits/types.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h index 2229678..2229678 100644 --- a/sysdeps/unix/sysv/linux/sparc64/bits/types.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h diff --git a/sysdeps/unix/sysv/linux/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S index 87412e0..abdd7e6 100644 --- a/sysdeps/unix/sysv/linux/sparc64/brk.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S @@ -40,10 +40,10 @@ __curbrk: .skip 8 ENTRY(__brk) save %sp, -160, %sp #ifdef PIC -1: rd %pc, %g1 +1: call 2f sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - add %l7, %g1, %l7 +2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 + add %l7, %o7, %l7 #endif LOADSYSCALL(brk) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S new file mode 100644 index 0000000..4e6a2da --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S @@ -0,0 +1 @@ +/* _setjmp is in setjmp.S */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S new file mode 100644 index 0000000..1da848d --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S @@ -0,0 +1 @@ +/* setjmp is in setjmp.S */ diff --git a/sysdeps/unix/sysv/linux/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S index fe38bf4..a5cb1a4 100644 --- a/sysdeps/unix/sysv/linux/sparc64/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S @@ -54,10 +54,10 @@ __libc_clone: restore 99: #ifdef PIC - rd %pc, %g1 + call 1f sethi %hi(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7 - or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7 - add %l7, %g1, %l7 +1: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(99b-.)), %l7 + add %l7, %o7, %l7 set EINVAL, %i0 sethi %hi(errno), %g2 or %g2, %lo(errno), %g2 @@ -76,7 +76,7 @@ __libc_clone: mov -1,%i0 ret restore - .size __libc_clone,.-__libc_clone + .size __libc_clone, .-__libc_clone .type __thread_start,@function __thread_start: @@ -86,4 +86,4 @@ __thread_start: mov %l3,%o0 call _exit,0 nop - .size __thread_start,.-__thread_start + .size __thread_start, .-__thread_start diff --git a/sysdeps/unix/sysv/linux/sparc64/fork.S b/sysdeps/unix/sysv/linux/sparc/sparc64/fork.S index c735da5..c735da5 100644 --- a/sysdeps/unix/sysv/linux/sparc64/fork.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/fork.S diff --git a/sysdeps/unix/sysv/linux/sparc64/getcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S index 05b0626..05b0626 100644 --- a/sysdeps/unix/sysv/linux/sparc64/getcontext.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S diff --git a/sysdeps/unix/sysv/linux/sparc64/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h index f7fad7f..3e27c6d 100644 --- a/sysdeps/unix/sysv/linux/sparc64/init-first.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h @@ -33,33 +33,33 @@ .global " #NAME " .type " #NAME ",@function " #NAME ": - save %sp, -64, %sp -1: rd %pc, %g1 + save %sp, -128, %sp +1: call 11f sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 - or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 +11: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 add %l7, %o7, %l7 /* Are we a dynamic libc being loaded into a static program? */ - sethi %hi(_dl_starting_up), %g2 - or %g2, %lo(_dl_starting_up), %g2 - ld [%l7+%g2], %g2 - brz,pn %g2, 3f - sethi %hi(__libc_multiple_libcs), %g3 - ld [%g2], %g2 - subcc %g0, %g2, %g0 - subc %g0, -1, %g2 -3: or %g3, %lo(__libc_multiple_libcs), %g3 - ld [%l7+%g3], %g3 - st %g2, [%g3] + sethi %hi(_dl_starting_up), %l2 + or %l2, %lo(_dl_starting_up), %l2 + ldx [%l7+%l2], %l2 + brz,pn %l2, 3f + sethi %hi(__libc_multiple_libcs), %l3 + ld [%l2], %l4 + mov %g0, %l2 + movrz %l4, 1, %l2 +3: or %l3, %lo(__libc_multiple_libcs), %l3 + ldx [%l7+%l3], %l3 + st %l2, [%l3] /* If so, argc et al are in %o0-%o2 already. Otherwise, load them. */ - brnz,pn %g2, " #INIT " + brnz,pn %l2, " #INIT " restore - ld [%sp+" __S(STACK_BIAS) "+22*8], %o0 + ldx [%sp+" __S(STACK_BIAS) "+22*8], %o0 add %sp, " __S(STACK_BIAS) "+23*8, %o1 sll %o0, 3, %o2 add %o2, %o1, %o2 - add %o2, 8, %o2 - ba,a " #INIT " - .size "#NAME " .-" #NAME); + ba " #INIT " + add %o2, 8, %o2 + .size "#NAME ", .-" #NAME); #else @@ -73,15 +73,15 @@ or %g2, %lo(_dl_starting_up), %g2 brz,pt %g2, 3f sethi %hi(__libc_multiple_libcs), %g3 - ld [%g4+%g2], %g2 - subcc %g0, %g2, %g0 - subc %g0, -1, %g2 -3: add %g3, %g4, %g3 - st %g2, [%g3+%lo(__libc_multiple_libcs)] + ld [%g4+%g2], %g1 + mov %g0, %g2 + movrz %g1, 1, %g2 +3: or %g3, %lo(__libc_multiple_libcs), %g3 + st %g2, [%g3+%g4] /* If so, argc et al are in %o0-%o2 already. Otherwise, load them. */ brnz,pn %g2, " #INIT " nop - ld [%sp+" __S(STACK_BIAS) "+22*8], %o0 + ldx [%sp+" __S(STACK_BIAS) "+22*8], %o0 add %sp, " __S(STACK_BIAS) "+23*8, %o1 sll %o0, 3, %o2 add %o2, %o1, %o2 diff --git a/sysdeps/unix/sysv/linux/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h index fcb752e..fcb752e 100644 --- a/sysdeps/unix/sysv/linux/sparc64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h diff --git a/sysdeps/unix/sysv/linux/sparc64/longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S index c81b104..c456377 100644 --- a/sysdeps/unix/sysv/linux/sparc64/longjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S @@ -42,3 +42,5 @@ ENTRY(longjmp) ta 0x6f END(longjmp) + +strong_alias(longjmp, __longjmp) diff --git a/sysdeps/unix/sysv/linux/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S index 82ff4ea..82ff4ea 100644 --- a/sysdeps/unix/sysv/linux/sparc64/pipe.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S diff --git a/sysdeps/unix/sysv/linux/sparc64/profil-counter.h b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h index 6a3f0a2..6a3f0a2 100644 --- a/sysdeps/unix/sysv/linux/sparc64/profil-counter.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h diff --git a/sysdeps/unix/sysv/linux/sparc64/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S index 2968b65..2968b65 100644 --- a/sysdeps/unix/sysv/linux/sparc64/setcontext.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S diff --git a/sysdeps/unix/sysv/linux/sparc64/setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S index 8b88b49..fcc5cb5 100644 --- a/sysdeps/unix/sysv/linux/sparc64/setjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S @@ -27,10 +27,29 @@ #define O_gregs 32 #define O_g1 (O_gregs + 4*8) +/* int _setjmp(jmp_buf) */ + +.weak _setjmp +ENTRY(_setjmp) + + ba __sigsetjmp_local + set 0, %o1 + +END(setjmp) + +/* int setjmp(jmp_buf) */ + +.weak setjmp +ENTRY(setjmp) + + set 1, %o1 + +END(setjmp) /* int __sigsetjmp(jmp_buf, savemask) */ ENTRY(__sigsetjmp) +__sigsetjmp_local: /* Record whether the user is intending to save the sigmask. */ st %o1, [%o0 + O_mask_was_saved] diff --git a/sysdeps/unix/sysv/linux/sparc64/sigjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S index 940ccbc..940ccbc 100644 --- a/sysdeps/unix/sysv/linux/sparc64/sigjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigjmp.S diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S new file mode 100644 index 0000000..30dace5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S @@ -0,0 +1,39 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <sysdep.h> + .text + +ENTRY (syscall) + + mov %o0,%g1 + mov %o1,%o0 + mov %o2,%o1 + mov %o3,%o2 + mov %o4,%o3 + mov %o5,%o4 + + ta 0x11 + + bcc,pt %xcc,1f + nop + SYSCALL_ERROR_HANDLER + +1: retl + +PSEUDO_END (syscall) diff --git a/sysdeps/unix/sysv/linux/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 66ba470..66ba470 100644 --- a/sysdeps/unix/sysv/linux/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list diff --git a/sysdeps/unix/sysv/linux/sparc64/sysdep.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S index 7365780..7365780 100644 --- a/sysdeps/unix/sysv/linux/sparc64/sysdep.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.S diff --git a/sysdeps/unix/sysv/linux/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index f01c1f4..c880e4a 100644 --- a/sysdeps/unix/sysv/linux/sparc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -44,43 +44,65 @@ .type name,@function; #ifdef PIC -#define SYSCALL_ERROR_HANDLER1(R) \ +# ifdef _LIBC_REENTRANT +# define SYSCALL_ERROR_HANDLER \ .global C_SYMBOL_NAME(errno); \ .type C_SYMBOL_NAME(errno),@object; \ -0: rd %pc,%g1; \ - sethi %hi(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2; \ - add %g2,%lo(_GLOBAL_OFFSET_TABLE_-(0b-.)),%g2; \ - add %g2,%g1,%g1; \ - sethi %hi(errno),%g2; \ - add %g2,%lo(errno),%g2; \ - ldx [%g1+%g2],%g2; \ - st R,[%g2] + save %sp,-160,%sp; \ + 101: call 102f; \ + sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \ + 102: or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \ + sethi %hi(errno),%i1; \ + add %g2,%o7,%l7; \ + or %i1,%lo(errno),%i1; \ + ldx [%l7+%i1],%g2; \ + st %i0,[%g2]; \ + call __errno_location; \ + nop; \ + st %i0,[%o0]; \ + sub %g0,1,%i0; \ + jmpl %i7+8, %g0; \ + restore +# else +# define SYSCALL_ERROR_HANDLER \ + .global C_SYMBOL_NAME(errno); \ + .type C_SYMBOL_NAME(errno),@object; \ + mov %o7,%g3; \ + 101: call 102f; \ + sethi %hi(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \ + 102: or %g2,%lo(_GLOBAL_OFFSET_TABLE_-(101b-.)),%g2; \ + sethi %hi(errno),%o1; \ + add %g2,%o7,%l7; \ + or %o1,%lo(errno),%o1; \ + mov %g3,%o7; \ + ldx [%l7+%o1],%g2; \ + st %o0,[%g2] +# endif #else -#define SYSCALL_ERROR_HANDLER1(R) \ +# ifdef _LIBC_REENTRANT +# define SYSCALL_ERROR_HANDLER \ .global C_SYMBOL_NAME(errno); \ .type C_SYMBOL_NAME(errno),@object; \ + save %sp,-160,%sp; \ sethi %hi(errno),%g1; \ - add %g1,%g4,%g1; \ - st R,[%g1+%lo(errno)] -#endif - -#ifdef _LIBC_REENTRANT -#define SYSCALL_ERROR_HANDLER \ - .global C_SYMBOL_NAME(__errno_location); \ - .type C_SYMBOL_NAME(__errno_location),@function; \ - save %sp,-128,%sp; \ - SYSCALL_ERROR_HANDLER1(%i0); \ + or %g1,%lo(errno),%g1; \ + st %i0,[%g1+%g4]; \ call __errno_location; \ nop; \ st %i0,[%o0]; \ sub %g0,1,%i0; \ jmpl %i7+8, %g0; \ restore -#else -#define SYSCALL_ERROR_HANDLER \ - SYSCALL_ERROR_HANDLER1(%o0); \ +# else +# define SYSCALL_ERROR_HANDLER \ + .global C_SYMBOL_NAME(errno); \ + .type C_SYMBOL_NAME(errno),@object; \ + sethi %hi(errno),%g1; \ + or %g1,%lo(errno),%g1; \ + st %i0,[%g1+%g4]; \ retl; \ sub %g0,1,%i0 +# endif #endif #define PSEUDO(name, syscall_name, args) \ diff --git a/sysdeps/unix/sysv/linux/sparc64/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h index 160e2fc..160e2fc 100644 --- a/sysdeps/unix/sysv/linux/sparc64/ucontext.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ucontext.h diff --git a/sysdeps/unix/sysv/minix/bits/sigaction.h b/sysdeps/unix/sysv/minix/bits/sigaction.h index 5bf5985..732befc 100644 --- a/sysdeps/unix/sysv/minix/bits/sigaction.h +++ b/sysdeps/unix/sysv/minix/bits/sigaction.h @@ -31,14 +31,14 @@ struct sigaction /* Bits in `sa_flags'. */ #ifdef __USE_MISC -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */ -#define SA_NODEFER 0x4 /* Don't block signal while catching it. */ -#define SA_RESTART 0x8 /* Don't restart syscall on signal return. */ -#define SA_SIGINFO 0x10 /* Extended signal handling. */ -#define SA_NOCLDWAIT 0x20 /* Don't create zombies. */ -#define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */ -#define SA_DISABLE 0x100 /* Disable alternate signal stack. */ +# define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +# define SA_RESETHAND 0x2 /* Reset signal handler when signal caught. */ +# define SA_NODEFER 0x4 /* Don't block signal while catching it. */ +# define SA_RESTART 0x8 /* Restart syscall on signal return. */ +# define SA_SIGINFO 0x10 /* Extended signal handling. */ +# define SA_NOCLDWAIT 0x20 /* Don't create zombies. */ +# define SA_COMPAT 0x80 /* Internal flag for old signal catchers. */ +# define SA_DISABLE 0x100 /* Disable alternate signal stack. */ #endif #define SA_NOCLDSTOP 0x40 /* Don't send SIGCHLD when children stop. */ diff --git a/sysdeps/unix/sysv/sysv4/bits/sigaction.h b/sysdeps/unix/sysv/sysv4/bits/sigaction.h index 3a2ffb2..ce3ab5e 100644 --- a/sysdeps/unix/sysv/sysv4/bits/sigaction.h +++ b/sysdeps/unix/sysv/sysv4/bits/sigaction.h @@ -35,13 +35,13 @@ struct sigaction /* Bits in `sa_flags'. */ #ifdef __USE_MISC -#define SA_ONSTACK 0x1 /* Take signal on signal stack. */ -#define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */ -#define SA_RESTART 0x4 /* Don't restart syscall on signal return. */ -#define SA_SIGINFO 0x8 /* Provide additional info to the handler. */ -#define SA_NODEFER 0x10 /* Don't automatically block the signal when +# define SA_ONSTACK 0x1 /* Take signal on signal stack. */ +# define SA_RESETHAND 0x2 /* Reset to SIG_DFL on entry to handler. */ +# define SA_RESTART 0x4 /* Restart syscall on signal return. */ +# define SA_SIGINFO 0x8 /* Provide additional info to the handler. */ +# define SA_NODEFER 0x10 /* Don't automatically block the signal when its handler is being executed. */ -#define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */ +# define SA_NOCLDWAIT 0x10000 /* Don't save zombie processes. */ #endif #define SA_NOCLDSTOP 0x20000 /* Don't send SIGCHLD when children stop. */ |