summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/i386')
-rw-r--r--libc/sysdeps/linux/i386/bits/uClibc_arch_features.h3
-rw-r--r--libc/sysdeps/linux/i386/bits/wchar.h25
-rw-r--r--libc/sysdeps/linux/i386/crt1.S20
-rw-r--r--libc/sysdeps/linux/i386/sigaction.c7
4 files changed, 24 insertions, 31 deletions
diff --git a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
index cd80c87bf..5b6c2fc78 100644
--- a/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
@@ -11,9 +11,6 @@
/* can your target use syscall6() for mmap ? */
#undef __UCLIBC_MMAP_HAS_6_ARGS__
-/* does your target use statx */
-#undef __UCLIBC_HAVE_STATX__
-
/* does your target align 64bit values in register pairs ? (32bit arches only) */
#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
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;
}