summaryrefslogtreecommitdiff
path: root/libc/ports/sysdeps/unix
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-12-25 10:39:27 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-12-25 10:39:27 +0000
commit105320fa7b3665877cb3c50c821d10cf7ce154d0 (patch)
tree1b9b6f46b453cf110c6df3493e977b4468af25f6 /libc/ports/sysdeps/unix
parent94c459cc7a611211d10773eef526826a8da80456 (diff)
Merge changes between r21911 and r22029 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22061 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/ports/sysdeps/unix')
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/mmap.c2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/readelflib.c18
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h3
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h29
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/ldconfig.h25
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c73
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S3
8 files changed, 151 insertions, 6 deletions
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 4c1af066f..d0517d8f8 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -19,7 +19,9 @@
#include <sysdeps/generic/ldconfig.h>
#define SYSDEP_KNOWN_INTERPRETER_NAMES \
- { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 },
+ { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
+ { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
+ { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
#define SYSDEP_KNOWN_LIBRARY_NAMES \
{ "libc.so.6", FLAG_ELF_LIBC6 }, \
{ "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/mmap.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/mmap.c
index 14f3f6c6a..05df25cd3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/mmap.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/mmap.c
@@ -26,7 +26,7 @@
__ptr_t
__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
{
- return INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
+ return (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
}
weak_alias (__mmap, mmap)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/readelflib.c b/libc/ports/sysdeps/unix/sysv/linux/aarch64/readelflib.c
new file mode 100644
index 000000000..87994a4ea
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/readelflib.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2012 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/>. */
+
+#include "../arm/readelflib.c"
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 62871d4fe..2263d3d79 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -208,12 +208,10 @@ __local_syscall_error: \
__label__ out; \
__label__ iserr; \
long sc_ret; \
- long sc_err; \
INTERNAL_SYSCALL_DECL (sc_err); \
\
if (__vdso_##name != NULL) \
{ \
- register long _x0 asm ("x0"); \
sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args); \
if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
goto out; \
@@ -244,7 +242,6 @@ __local_syscall_error: \
\
if (__vdso_##name != NULL) \
{ \
- register long _x0 asm ("x0"); \
v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args); \
if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \
|| INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
new file mode 100644
index 000000000..525caa2cb
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
@@ -0,0 +1,29 @@
+/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
+ Copyright (C) 2003-2012 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/>. */
+
+#include <ldconfig.h>
+
+#ifdef __ARM_PCS_VFP
+# define _dl_cache_check_flags(flags) \
+ ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6))
+#else
+# define _dl_cache_check_flags(flags) \
+ ((flags) == FLAG_ELF_LIBC6)
+#endif
+
+#include_next <dl-cache.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/ldconfig.h b/libc/ports/sysdeps/unix/sysv/linux/arm/ldconfig.h
new file mode 100644
index 000000000..bb20b79db
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/ldconfig.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2001-2012 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/>. */
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES \
+ { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
+ { "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
+#define SYSDEP_KNOWN_LIBRARY_NAMES \
+ { "libc.so.6", FLAG_ELF_LIBC6 }, \
+ { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
new file mode 100644
index 000000000..e767f9e78
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
+ Jakub Jelinek <jakub@redhat.com>, 1999.
+
+ 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/>. */
+
+
+int process_elf32_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname,
+ void *file_contents, size_t file_length);
+int process_elf64_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname,
+ void *file_contents, size_t file_length);
+
+/* Returns 0 if everything is ok, != 0 in case of error. */
+int
+process_elf_file (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname, void *file_contents,
+ size_t file_length)
+{
+ ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
+ int ret;
+
+ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+ {
+ Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
+
+ ret = process_elf32_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
+
+ if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5)
+ {
+ if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
+ *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
+ else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
+ *flag = FLAG_ELF_LIBC6;
+ }
+ }
+ else
+ {
+ ret = process_elf64_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
+ /* AArch64 libraries are always libc.so.6+. */
+ if (!ret)
+ *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+ }
+ return ret;
+}
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf32_file
+#define __ELF_NATIVE_CLASS 32
+#include "elf/readelflib.c"
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf64_file
+#define __ELF_NATIVE_CLASS 64
+#include "elf/readelflib.c"
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S
index de4fa136d..27592cc82 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/clone.S
@@ -160,6 +160,8 @@ ENTRY (__clone)
r32: the user function pointer */
.Lthread_start:
+ cfi_def_cfa_offset (FRAME_SIZE)
+ cfi_undefined (lr)
/* Check and see if we need to reset the PID, which we do if
CLONE_THREAD isn't set, i.e. we're not staying in the thread group.
If CLONE_VM is set, we're doing some kind of thread-like clone,
@@ -167,7 +169,6 @@ ENTRY (__clone)
in getpid(). Otherwise (if CLONE_VM isn't set), it's a
fork-like clone, and we go ahead and write the cached values
from the true system pid (retrieved via __NR_getpid syscall). */
- cfi_def_cfa_offset (FRAME_SIZE)
#ifdef __tilegx__
{
moveli r0, hw1_last(CLONE_VM)