From 9c343fd4030dcd7a52616f365893177dded50346 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 12 Jan 2010 17:51:32 -0800 Subject: mips/nptl: Pass correct parameters to dl_find_hash when resolving TLS relocations. Make use of macros from sys/asm.h in crt1.S These two changes are needed for mips nptl to boot once again. Signed-off-by: Khem Raj --- libc/sysdeps/linux/mips/crt1.S | 46 ++++++++++++------------------------------ 1 file changed, 13 insertions(+), 33 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S index e851d52d2..6a804125e 100644 --- a/libc/sysdeps/linux/mips/crt1.S +++ b/libc/sysdeps/linux/mips/crt1.S @@ -85,29 +85,10 @@ __start: #ifdef __PIC__ -#if _MIPS_SIM == _MIPS_SIM_ABI32 - .frame sp, 24, sp - .set noreorder - move $0, $31 /* Save old ra. */ - bal 10f /* Find addr of cpload. */ - nop -10: - .cpload $31 - move $31, $0 - .set reorder - .cprestore 16 -#else - move $0, $31; /* Save old ra. */ - .set noreorder - bal 10f /* Find addr of .cpsetup. */ - nop -10: - .set reorder - .cpsetup $31, $25, 10b - move $31, $0 -#endif + SETUP_GPX($0) + SETUP_GPX64($25,$0) #else - la $28, _gp /* Setup GP correctly if we're non-PIC. */ + PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */ move $31, $0 #endif @@ -118,18 +99,18 @@ __start: /* Allocate space on the stack for seven arguments and * make sure the stack is aligned to double words (8 bytes) */ + and $29, -2 * SZREG + #if _MIPS_SIM == _MIPS_SIM_ABI32 - and $29, -2 * 4 - subu $29, 32 - la $7, _init /* init */ - la $8, _fini - sw $8, 16($29) /* fini */ - sw $2, 20($29) /* rtld_fini */ - sw $29, 24($29) /* stack_end */ -#else - and $29, -2 * PTRSIZE + PTR_SUBIU $29, 32 +#endif PTR_LA $7, _init /* init */ - PTR_LA $8, _fini /* fini */ + PTR_LA $8, _fini +#if _MIPS_SIM == _MIPS_SIM_ABI32 + PTR_S $8, 16($29) /* fini */ + PTR_S $2, 20($29) /* rtld_fini */ + PTR_S $29, 24($29) /* stack_end */ +#else move $9, $2 /* rtld_fini */ move $10, $29 /* stack_end */ #endif @@ -148,4 +129,3 @@ __data_start: .weak data_start data_start = __data_start - -- cgit v1.2.3 From d0a8b14169c6f01dadd07f6b4e14cc335a62f234 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 16 Jan 2010 19:18:38 +0100 Subject: futimens: add missing local prototype Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/futimens.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/futimens.c b/libc/sysdeps/linux/common/futimens.c index 32b21395b..0eaf26a4c 100644 --- a/libc/sysdeps/linux/common/futimens.c +++ b/libc/sysdeps/linux/common/futimens.c @@ -21,6 +21,7 @@ extern int utimensat (int __fd, __const char *__path, int __flags) __THROW; libc_hidden_proto(utimensat) +int futimens (int __fd, __const struct timespec __times[2]) __THROW; int futimens (int fd, __const struct timespec ts[2]) { return utimensat(fd, 0, ts, 0); -- cgit v1.2.3 From 2b69e9906e5087a796b3a15e9aabcd102c705b19 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Wed, 16 Dec 2009 13:16:08 +0100 Subject: avr32: add varargs handling of prctl syscall prctl is defined to use varargs in the header file, hence it needs varargs specific handling in the source. This patch properly handles the variodic argument before the syscall is passed to the kernel for the AVR32 architecture. Signed-off-by: Hans-Christian Egtvedt --- libc/sysdeps/linux/avr32/Makefile.arch | 2 +- libc/sysdeps/linux/avr32/prctl.c | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 libc/sysdeps/linux/avr32/prctl.c (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/avr32/Makefile.arch b/libc/sysdeps/linux/avr32/Makefile.arch index bc5f62550..98b85a7ce 100644 --- a/libc/sysdeps/linux/avr32/Makefile.arch +++ b/libc/sysdeps/linux/avr32/Makefile.arch @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC := brk.c clone.c mmap.c sigaction.c +CSRC := brk.c clone.c mmap.c prctl.c sigaction.c SSRC := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ sigrestorer.S syscall.S vfork.S diff --git a/libc/sysdeps/linux/avr32/prctl.c b/libc/sysdeps/linux/avr32/prctl.c new file mode 100644 index 000000000..4e146e35e --- /dev/null +++ b/libc/sysdeps/linux/avr32/prctl.c @@ -0,0 +1,36 @@ +/* + * prctl syscall for AVR32 Linux. + * + * Copyright (C) 2010 Atmel Corporation + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License. See the file "COPYING.LIB" in the main directory of this + * archive for more details. + */ +#include +#include +#include + +#ifdef __NR_prctl +#define __NR___syscall_prctl __NR_prctl +static inline _syscall5(int, __syscall_prctl, int, option, long, arg2, + long, arg3, long, arg4, long, arg5); + +int prctl(int __option, ...) +{ + long arg2; + long arg3; + long arg4; + long arg5; + va_list ap; + + va_start(ap, __option); + arg2 = va_arg(ap, long); + arg3 = va_arg(ap, long); + arg4 = va_arg(ap, long); + arg5 = va_arg(ap, long); + va_end(ap); + + return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5); +} +#endif -- cgit v1.2.3 From 8a2d6677c3d485e5cbc19a6a550ead83990f2b5d Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 22 Jan 2010 13:57:32 +0100 Subject: silence warning about implicit decl of sysctl ... and reinstate comment explaining the gory details Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/sysctl.c b/libc/sysdeps/linux/common/sysctl.c index f65a3eaa2..dde00be46 100644 --- a/libc/sysdeps/linux/common/sysctl.c +++ b/libc/sysdeps/linux/common/sysctl.c @@ -10,6 +10,7 @@ #include #if defined __NR__sysctl && (defined __USE_GNU || defined __USE_BSD) +/* psm: including sys/sysctl.h would depend on kernel headers */ struct __sysctl_args { int *name; int nlen; @@ -19,7 +20,8 @@ struct __sysctl_args { size_t newlen; unsigned long __unused[4]; }; - +extern int sysctl (int *__name, int __nlen, void *__oldval, + size_t *__oldlenp, void *__newval, size_t __newlen) __THROW; int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen) { -- cgit v1.2.3