diff options
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/clone.S | 7 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 15 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/getcontext.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/init-first.c | 12 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 |
10 files changed, 49 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h b/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h index 658f696ef9..1717c356cc 100644 --- a/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/aarch64/bits/fcntl.h @@ -25,11 +25,17 @@ #define __O_NOFOLLOW 0100000 #define __O_DIRECT 0200000 -#define __O_LARGEFILE 0 +#ifdef __ILP32__ +# define __O_LARGEFILE 0400000 +#else +# define __O_LARGEFILE 0 +#endif +#ifdef __LP64__ # define F_GETLK64 5 # define F_SETLK64 6 # define F_SETLKW64 7 +#endif struct flock { diff --git a/sysdeps/unix/sysv/linux/aarch64/clone.S b/sysdeps/unix/sysv/linux/aarch64/clone.S index 96482e53c0..657d28db4b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/clone.S +++ b/sysdeps/unix/sysv/linux/aarch64/clone.S @@ -39,6 +39,13 @@ */ .text ENTRY(__clone) + DELOUSE (0) + DELOUSE (1) + DELOUSE (2) + DELOUSE (3) + DELOUSE (4) + DELOUSE (5) + DELOUSE (6) /* Save args for the child. */ mov x10, x0 mov x11, x2 diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h index 9c7b271e85..86905edcc2 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h +++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h @@ -18,7 +18,11 @@ #include <ldconfig.h> -#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6) +#ifdef __LP64__ +# define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6) +#else +# define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6) +#endif #define _dl_cache_check_flags(flags) \ ((flags) == _DL_CACHE_DEFAULT_ID) @@ -27,18 +31,25 @@ do \ { \ size_t len = strlen (dir); \ - char path[len + 3]; \ + char path[len + 6]; \ memcpy (path, dir, len + 1); \ if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \ { \ len -= 2; \ path[len] = '\0'; \ } \ + if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\ + { \ + len -= 5; \ + path[len] = '\0'; \ + } \ add_dir (path); \ if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ { \ memcpy (path + len, "64", 3); \ add_dir (path); \ + memcpy (path + len, "ilp32", 6); \ + add_dir (path); \ } \ } while (0) diff --git a/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/sysdeps/unix/sysv/linux/aarch64/getcontext.S index c2dd5b8f93..f6bf24fbd7 100644 --- a/sysdeps/unix/sysv/linux/aarch64/getcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/getcontext.S @@ -30,6 +30,7 @@ .text ENTRY(__getcontext) + DELOUSE (0) /* The saved context will return to the getcontext() call point with a return value of 0 */ str xzr, [x0, oX0 + 0 * SZREG] @@ -90,7 +91,7 @@ ENTRY(__getcontext) /* Grab the signal mask */ /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */ - add x2, x0, #UCONTEXT_SIGMASK + add PTR_REG (2), PTR_REG (0), #UCONTEXT_SIGMASK mov x0, SIG_BLOCK mov x1, 0 mov x3, _NSIG8 diff --git a/sysdeps/unix/sysv/linux/aarch64/init-first.c b/sysdeps/unix/sysv/linux/aarch64/init-first.c index f7224a25a2..f7bfc4d81c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/init-first.c +++ b/sysdeps/unix/sysv/linux/aarch64/init-first.c @@ -27,17 +27,21 @@ int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *); static inline void _libc_vdso_platform_setup (void) { - PREPARE_VERSION (linux2639, "LINUX_2.6.39", 123718537); +#ifdef __LP64__ + PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); +#else + PREPARE_VERSION (linux_version, "LINUX_4.9", 61765625); +#endif - void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2639); + void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(gettimeofday) = p; - p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2639); + p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(clock_gettime) = p; - p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2639); + p = _dl_vdso_vsym ("__kernel_clock_getres", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(clock_getres) = p; } diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h index ee91ef82af..ac84194d6c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h +++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h @@ -21,6 +21,8 @@ #define SYSDEP_KNOWN_INTERPRETER_NAMES \ { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \ { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \ + { "/lib/ld-linux-aarch64_be_ilp32.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 \ diff --git a/sysdeps/unix/sysv/linux/aarch64/setcontext.S b/sysdeps/unix/sysv/linux/aarch64/setcontext.S index d17f8c8b7a..c2bca2696c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/setcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/setcontext.S @@ -34,6 +34,7 @@ .text ENTRY (__setcontext) + DELOUSE (0) /* Save a copy of UCP. */ mov x9, x0 diff --git a/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h index a579501186..d1185fa1cb 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h +++ b/sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h @@ -16,10 +16,11 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <stdint.h> #include <sys/ucontext.h> #define SIGCONTEXT siginfo_t *_si, struct ucontext * -#define GET_PC(ctx) ((void *) (ctx)->uc_mcontext.pc) +#define GET_PC(ctx) ((void *) (uintptr_t) (ctx)->uc_mcontext.pc) /* There is no reliable way to get the sigcontext unless we use a three-argument signal handler. */ diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S index c1a16f3899..8e2cadd182 100644 --- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S @@ -27,6 +27,7 @@ .text ENTRY(__swapcontext) + DELOUSE (0) /* Set the value returned when swapcontext() returns in this context. */ str xzr, [x0, oX0 + 0 * SZREG] diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index a397e50ef6..1ffabc2cd7 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -250,12 +250,14 @@ (!defined SHARED && (IS_IN (libc) \ || IS_IN (libpthread)))) # ifdef __ASSEMBLER__ +/* Note, dst, src, guard, and tmp are all register numbers rather than + register names so they will work with both ILP32 and LP64. */ # define PTR_MANGLE(dst, src, guard, tmp) \ LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \ PTR_MANGLE2 (dst, src, guard) /* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ # define PTR_MANGLE2(dst, src, guard)\ - eor dst, src, guard + eor x##dst, x##src, x##guard # define PTR_DEMANGLE(dst, src, guard, tmp)\ PTR_MANGLE (dst, src, guard, tmp) # define PTR_DEMANGLE2(dst, src, guard)\ @@ -268,12 +270,14 @@ extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden; # endif #else # ifdef __ASSEMBLER__ +/* Note, dst, src, guard, and tmp are all register numbers rather than + register names so they will work with both ILP32 and LP64. */ # define PTR_MANGLE(dst, src, guard, tmp) \ LDST_GLOBAL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard)); \ PTR_MANGLE2 (dst, src, guard) /* Use PTR_MANGLE2 for efficiency if guard is already loaded. */ # define PTR_MANGLE2(dst, src, guard)\ - eor dst, src, guard + eor x##dst, x##src, x##guard # define PTR_DEMANGLE(dst, src, guard, tmp)\ PTR_MANGLE (dst, src, guard, tmp) # define PTR_DEMANGLE2(dst, src, guard)\ |