diff options
Diffstat (limited to 'libc/sysdeps/linux/i386')
-rw-r--r-- | libc/sysdeps/linux/i386/__syscall_error.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/bits/fcntl.h | 7 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/bits/fenv.h | 10 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/bits/kernel_stat.h | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/bits/wchar.h | 25 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/crt1.S | 20 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/sigaction.c | 7 |
7 files changed, 38 insertions, 39 deletions
diff --git a/libc/sysdeps/linux/i386/__syscall_error.c b/libc/sysdeps/linux/i386/__syscall_error.c index 36946bc6d..102ebbedb 100644 --- a/libc/sysdeps/linux/i386/__syscall_error.c +++ b/libc/sysdeps/linux/i386/__syscall_error.c @@ -25,8 +25,8 @@ #include <errno.h> #include <features.h> -int __syscall_error(void) attribute_hidden; -int __syscall_error(void) +long __syscall_error(void) attribute_hidden; +long __syscall_error(void) { register int eax __asm__ ("%eax"); int _errno = -eax; diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h index d03489ebf..f3c08bbe5 100644 --- a/libc/sysdeps/linux/i386/bits/fcntl.h +++ b/libc/sysdeps/linux/i386/bits/fcntl.h @@ -54,6 +54,7 @@ # define O_DIRECT 040000 /* Direct disk access. */ # define O_NOATIME 01000000 /* Do not set atime. */ # define O_PATH 010000000 /* Resolve pathname but do not open file. */ +# define O_TMPFILE 020200000 /* Atomically create nameless file. */ #endif /* For now Linux has synchronisity options for data and read operations. @@ -101,11 +102,13 @@ # define F_SETLEASE 1024 /* Set a lease. */ # define F_GETLEASE 1025 /* Enquire what lease is active. */ # define F_NOTIFY 1026 /* Request notfications on a directory. */ -# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with - close-on-exit set on new fd. */ # define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ # define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ #endif +#if defined __USE_XOPEN2K8 || defined __USE_GNU +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with + close-on-exit set on new fd. */ +#endif /* For F_[GET|SET]FD. */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ diff --git a/libc/sysdeps/linux/i386/bits/fenv.h b/libc/sysdeps/linux/i386/bits/fenv.h index 9bd976fc1..2462b7477 100644 --- a/libc/sysdeps/linux/i386/bits/fenv.h +++ b/libc/sysdeps/linux/i386/bits/fenv.h @@ -65,18 +65,18 @@ typedef unsigned short int fexcept_t; typedef struct { unsigned short int __control_word; - unsigned short int __unused1; + unsigned short int __uclibc_unused1; unsigned short int __status_word; - unsigned short int __unused2; + unsigned short int __uclibc_unused2; unsigned short int __tags; - unsigned short int __unused3; + unsigned short int __uclibc_unused3; unsigned int __eip; unsigned short int __cs_selector; unsigned int __opcode:11; - unsigned int __unused4:5; + unsigned int __uclibc_unused4:5; unsigned int __data_offset; unsigned short int __data_selector; - unsigned short int __unused5; + unsigned short int __uclibc_unused5; } fenv_t; diff --git a/libc/sysdeps/linux/i386/bits/kernel_stat.h b/libc/sysdeps/linux/i386/bits/kernel_stat.h index 231a984b4..ffe70cbf7 100644 --- a/libc/sysdeps/linux/i386/bits/kernel_stat.h +++ b/libc/sysdeps/linux/i386/bits/kernel_stat.h @@ -20,8 +20,8 @@ struct kernel_stat { struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; - unsigned long __unused4; - unsigned long __unused5; + unsigned long __uclibc_unused4; + unsigned long __uclibc_unused5; }; struct kernel_stat64 { diff --git a/libc/sysdeps/linux/i386/bits/wchar.h b/libc/sysdeps/linux/i386/bits/wchar.h deleted file mode 100644 index b94fc7a3f..000000000 --- a/libc/sysdeps/linux/i386/bits/wchar.h +++ /dev/null @@ -1,25 +0,0 @@ -/* wchar_t type related definitions. - Copyright (C) 2000 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _BITS_WCHAR_H -#define _BITS_WCHAR_H 1 - -#define __WCHAR_MIN (-2147483647l - 1l) -#define __WCHAR_MAX (2147483647l) - -#endif /* bits/wchar.h */ diff --git a/libc/sysdeps/linux/i386/crt1.S b/libc/sysdeps/linux/i386/crt1.S index 35a6552e8..decc68967 100644 --- a/libc/sysdeps/linux/i386/crt1.S +++ b/libc/sysdeps/linux/i386/crt1.S @@ -67,6 +67,9 @@ #endif .type main,%function .type __uClibc_main,%function +#ifdef L_rcrt1 +.type reloc_static_pie,%function +#endif _start: /* Clear the frame pointer. The ABI suggests this be done, to mark the outermost frame obviously. */ @@ -100,6 +103,23 @@ _start: pop %ebx addl $_GLOBAL_OFFSET_TABLE_+[.-.L0],%ebx +#ifdef L_rcrt1 + /* We cannot rely on _DYNAMIC being usable here due to RELRO. + Instead we calculate the load address based off a symbol + that we know will exist, _start. */ + pushl %ecx /* Save ecx so it won't get clobbered */ + pushl %ebx /* Save ebx so it won't get clobbered */ + xorl %ecx, %ecx /* Clear ecx */ + addl _start@GOT(%ebx), %ecx /* Get the offset of _start */ + movl _start@GOT(%ebx), %eax /* Get the run time address of _start */ + subl %ecx, %eax /* Subtract to find the load address */ + pushl %eax /* Pass the load address */ + call reloc_static_pie@PLT + popl %eax /* Clean up from function call */ + popl %ebx /* Restore the GOT address */ + popl %ecx /* restore ecx */ +#endif + /* Push address of our own entry points to .fini and .init. */ pushl _fini@GOT(%ebx) pushl _init@GOT(%ebx) diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c index cf6daa787..515ef99f2 100644 --- a/libc/sysdeps/linux/i386/sigaction.c +++ b/libc/sysdeps/linux/i386/sigaction.c @@ -31,15 +31,16 @@ extern void restore_rt(void) __asm__ ("__restore_rt") attribute_hidden; extern void restore(void) __asm__ ("__restore") attribute_hidden; -/* If ACT is not NULL, change the action for SIG to *ACT. +/* If ACT is not NULL, change mask, handler and flags for SIG to ACT's If OACT is not NULL, put the old action for SIG in *OACT. */ int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { struct sigaction kact; if (act) { - memcpy(&kact, act, sizeof(kact)); - kact.sa_flags |= SA_RESTORER; + memcpy(&kact.sa_mask, &act->sa_mask, sizeof(sigset_t)); + kact.sa_handler = act->sa_handler; + kact.sa_flags = act->sa_flags; kact.sa_restorer = (act->sa_flags & SA_SIGINFO) ? &restore_rt : &restore; act = &kact; } |