diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/inet/resolv.c | 4 | ||||
-rw-r--r-- | libc/misc/elf/Makefile.in | 3 | ||||
-rw-r--r-- | libc/misc/elf/dl-support.c | 13 | ||||
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 8 | ||||
-rw-r--r-- | libc/misc/internals/errno.c | 16 | ||||
-rw-r--r-- | libc/misc/utmp/utent.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/__syscall_rt_sigaction.c | 6 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/creat.c | 16 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/open64.c | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/bits/kernel_types.h | 8 |
10 files changed, 37 insertions, 43 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 86f189a5f..e5b2622d0 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1254,7 +1254,7 @@ void res_close(void) which can have an alias. */ struct __res_state _res __attribute__((section (".bss"))); #else -struct __res_state _res __attribute__((section (".bss"))) attribute_hidden; +struct __res_state _res __attribute__((section (".bss"))) ;//attribute_hidden; # if defined __UCLIBC_HAS_THREADS_NATIVE__ # undef __resp @@ -1275,7 +1275,7 @@ struct __res_state *__resp = &_res; #endif #ifdef L_res_state -# if defined __UCLIBC_HAS_THREADS__ +# if defined __UCLIBC_HAS_THREADS_NATIVE__ struct __res_state * __res_state (void) { diff --git a/libc/misc/elf/Makefile.in b/libc/misc/elf/Makefile.in index c97d29929..4c5d9c8b7 100644 --- a/libc/misc/elf/Makefile.in +++ b/libc/misc/elf/Makefile.in @@ -5,7 +5,8 @@ # libc_a_CSRC = dl-support.c dl-core.c dl-iterate-phdr.c -CFLAGS-dl-iterate-phdr.c=-D_GNU_SOURCE +CFLAGS-dl-iterate-phdr.c=-D_GNU_SOURCE -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include +CFLAGS-dl-core.c=-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include MISC_ELF_OUT:=$(top_builddir)libc/misc/elf MISC_ELF_OBJ:=$(patsubst %.c,$(MISC_ELF_OUT)/%.o,$(libc_a_CSRC)) diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c index 2f6682706..ce05f348a 100644 --- a/libc/misc/elf/dl-support.c +++ b/libc/misc/elf/dl-support.c @@ -11,14 +11,21 @@ * */ +#if USE_TLS #include <assert.h> #include <tls.h> -#include <link.h> #include <ldsodefs.h> #include <string.h> +#endif +#include <link.h> +#include <elf.h> + +#if USE_TLS void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls; +#endif + ElfW(Phdr) *_dl_phdr; size_t _dl_phnum; @@ -33,6 +40,7 @@ _dl_aux_init (ElfW(auxv_t) *av) _dl_phnum = (size_t) av[AT_PHNUM].a_un.a_val; } +#if USE_TLS /* Initialize static TLS area and DTV for current (only) thread. libpthread implementations should provide their own hook to handle all threads. */ @@ -57,3 +65,6 @@ _dl_nothread_init_static_tls (struct link_map *map) memset (mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), '\0', map->l_tls_blocksize - map->l_tls_initimage_size); } + +#endif + diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index a1e02c4e4..ab6adb130 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -51,10 +51,6 @@ libc_hidden_proto(geteuid) libc_hidden_proto(fstat) /* libc_hidden_proto(abort) */ -extern __typeof(open) __libc_open; -libc_hidden_proto(__libc_open) -extern __typeof(fcntl) __libc_fcntl; -libc_hidden_proto(__libc_fcntl) #endif #ifndef SHARED @@ -150,10 +146,10 @@ size_t __pagesize = 0; static void __check_one_fd(int fd, int mode) { /* Check if the specified fd is already open */ - if (__libc_fcntl(fd, F_GETFD) == -1) + if (fcntl(fd, F_GETFD) == -1) { /* The descriptor is probably not open, so try to use /dev/null */ - int nullfd = __libc_open(_PATH_DEVNULL, mode); + int nullfd = open(_PATH_DEVNULL, mode); /* /dev/null is major=1 minor=3. Make absolutely certain * that is in fact the device that we have opened and not * some other wierd file... */ diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c index 23b2bb375..a89b5addf 100644 --- a/libc/misc/internals/errno.c +++ b/libc/misc/internals/errno.c @@ -19,18 +19,20 @@ extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno"))); #define h_errno __libc_h_errno #else -extern int errno; -extern int h_errno; - +#include "internal_errno.h" #if 0 /* Unfortunately, this doesn't work... */ int h_errno __attribute__ ((section (".bss"))) = 0; int errno __attribute__ ((section (".bss"))) = 0; #else -int _errno = 0; -int _h_errno = 0; +int errno = 0; +int h_errno = 0; #endif -weak_alias(_errno, errno) -weak_alias(_h_errno, h_errno) +#ifdef __UCLIBC_HAS_THREADS__ +libc_hidden_def(errno) +weak_alias(errno, _errno) +libc_hidden_def(h_errno) +weak_alias(h_errno, _h_errno) +#endif #endif diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index 3752a68d4..11908b667 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -210,11 +210,7 @@ struct utmp *pututline (const struct utmp *utmp_entry) lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); else lseek(static_fd, (off_t) 0, SEEK_END); -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp)) -#else - if (write_not_cancel(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp)) -#endif utmp_entry = NULL; __UCLIBC_MUTEX_UNLOCK(utmplock); diff --git a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c index 6fb416039..c3246b1bf 100644 --- a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c +++ b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c @@ -13,8 +13,8 @@ #include <signal.h> #include <bits/kernel_sigaction.h> -#define __NR___rt_sigaction __NR_rt_sigaction -_syscall4(int, __rt_sigaction, int, signum, - const struct kernel_sigaction *, act, struct kernel_sigaction *, oldact, +#define __NR___syscall_rt_sigaction __NR_rt_sigaction +_syscall4(int, __syscall_rt_sigaction, int, signum, + const struct sigaction *, act, struct sigaction *, oldact, size_t, size) #endif diff --git a/libc/sysdeps/linux/common/creat.c b/libc/sysdeps/linux/common/creat.c deleted file mode 100644 index 429b4824c..000000000 --- a/libc/sysdeps/linux/common/creat.c +++ /dev/null @@ -1,16 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * open() for uClibc - * - * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ -#include <fcntl.h> - -extern int __libc_open(const char *file, int flags, ...); - -int creat(const char *file, mode_t mode) -{ - return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); -} diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index 7a68b4cd9..403e91a46 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -44,7 +44,7 @@ int open64 (const char *file, int oflag, ...) return result; #else - return __libc_open(file, oflag | O_LARGEFILE, mode); + return open(file, oflag | O_LARGEFILE, mode); #endif } libc_hidden_def(open64) diff --git a/libc/sysdeps/linux/i386/bits/kernel_types.h b/libc/sysdeps/linux/i386/bits/kernel_types.h index 6609dd312..8641a48c0 100644 --- a/libc/sysdeps/linux/i386/bits/kernel_types.h +++ b/libc/sysdeps/linux/i386/bits/kernel_types.h @@ -7,10 +7,14 @@ /* a hack for compiling a 32 bit user space with 64 bit * kernel on x86_64 */ -#if !defined(__ARCH_I386_POSIX_TYPES_H) && !defined(_ASM_X86_64_POSIX_TYPES_H) +#if !defined(__ARCH_I386_POSIX_TYPES_H) && \ + !defined(_ASM_X86_64_POSIX_TYPES_H) && \ + !defined(_ASM_X86_POSIX_TYPES_32_H) && \ + !defined(_ASM_X86_POSIX_TYPES_64_H) #define _ASM_X86_64_POSIX_TYPES_H #define __ARCH_I386_POSIX_TYPES_H - +#define _ASM_X86_POSIX_TYPES_32_H +#define _ASM_X86_POSIX_TYPES_64_H typedef unsigned short __kernel_dev_t; typedef unsigned long __kernel_ino_t; typedef unsigned short __kernel_mode_t; |