Blame SOURCES/ltrace-0.7.91-aarch64.patch

920d6f
diff --git a/README b/README
920d6f
index 414bdfb..a04b767 100644
920d6f
--- a/README
920d6f
+++ b/README
920d6f
@@ -24,6 +24,7 @@ The following targets are currently (at least somewhat) supported.
920d6f
 Some of them may be more or less broken in reality, it is not feasible
920d6f
 to test each release comprehensively on each target.
920d6f
 
920d6f
+	aarch64-*-linux-gnu
920d6f
 	armv6l-*-linux-gnueabi
920d6f
 	armv7l-*-linux-gnueabihf
920d6f
 	i[4567]86-*-linux-gnu
920d6f
@@ -81,7 +82,7 @@ quick one-liner), it is advisable to send an e-mail beforehand.
920d6f
 
920d6f
 
920d6f
 -------------------------------------------------------------------------------
920d6f
-Copyright (C) 2012,2013 Petr Machata <pmachata@redhat.com>
920d6f
+Copyright (C) 2012-2014 Petr Machata <pmachata@redhat.com>
920d6f
 Copyright (C) 1997-2009 Juan Cespedes <cespedes@debian.org>
920d6f
 This file is part of ltrace.
920d6f
 
920d6f
diff --git a/configure.ac b/configure.ac
920d6f
index c6e6bf0..0e9a124 100644
920d6f
--- a/configure.ac
920d6f
+++ b/configure.ac
920d6f
@@ -1,6 +1,6 @@
920d6f
 # -*- Autoconf -*-
920d6f
 # This file is part of ltrace.
920d6f
-# Copyright (C) 2010,2012,2013 Petr Machata, Red Hat Inc.
920d6f
+# Copyright (C) 2010,2012,2013,2014 Petr Machata, Red Hat Inc.
920d6f
 # Copyright (C) 2010,2011 Joe Damato
920d6f
 # Copyright (C) 2010 Marc Kleine-Budde
920d6f
 # Copyright (C) 2010 Zachary T Welch
920d6f
@@ -399,6 +399,7 @@ AC_CONFIG_FILES([
920d6f
 	Makefile
920d6f
 	sysdeps/Makefile
920d6f
 	sysdeps/linux-gnu/Makefile
920d6f
+	sysdeps/linux-gnu/aarch64/Makefile
920d6f
 	sysdeps/linux-gnu/alpha/Makefile
920d6f
 	sysdeps/linux-gnu/arm/Makefile
920d6f
 	sysdeps/linux-gnu/cris/Makefile
920d6f
diff --git a/etc/libc.so.conf b/etc/libc.so.conf
920d6f
index 669c50a..48b3b01 100644
920d6f
--- a/etc/libc.so.conf
920d6f
+++ b/etc/libc.so.conf
920d6f
@@ -1,5 +1,12 @@
920d6f
 # See ltrace.conf(5) for description of syntax of this file.
920d6f
 
920d6f
+# XXX ltrace misses long double and long long support
920d6f
+typedef ldouble = double;
920d6f
+typedef llong = long;
920d6f
+typedef ullong = ulong;
920d6f
+
920d6f
+void __libc_start_main(hide(void*), hide(int), array(string, arg2));
920d6f
+
920d6f
 # arpa/inet.h
920d6f
 typedef in_addr = struct(hex(uint));
920d6f
 int inet_aton(string, +in_addr*);
920d6f
@@ -233,9 +240,22 @@ void setbuffer(file,addr,ulong);
920d6f
 void setlinebuf(file);
920d6f
 int rename(string,string);
920d6f
 
920d6f
+# xlocale.h
920d6f
+typedef locale_t = void*;
920d6f
+locale_t newlocale(hex(int), string, locale_t);
920d6f
+
920d6f
 # stdlib.h
920d6f
-long __strtol_internal(string,addr,int);
920d6f
-ulong __strtoul_internal(string,addr,int);
920d6f
+long __strtol_internal(string, +string*, int);
920d6f
+ulong __strtoul_internal(string, +string*, int);
920d6f
+
920d6f
+double strtod(string, +string*);
920d6f
+float strtof(string, +string*);
920d6f
+ldouble strtold(string, +string*);
920d6f
+
920d6f
+double strtod_l(string, +string*, locale_t);
920d6f
+float strtof_l(string, +string*, locale_t);
920d6f
+ldouble strtold_l(string, +string*, locale_t);
920d6f
+
920d6f
 int atexit(addr);
920d6f
 addr bsearch(string, addr, ulong, ulong, addr);
920d6f
 addr calloc(ulong, ulong);
920d6f
@@ -343,6 +363,10 @@ addr gmtime(addr);
920d6f
 addr localtime(addr);
920d6f
 ulong strftime(+string2,ulong,string,addr);
920d6f
 long time(addr);
920d6f
+# XXX in fact (time_t, long), which may be (llong, long) on 32-bit
920d6f
+# arches.  We don't have llong as of this writing.
920d6f
+typedef timespec = struct(long, long);
920d6f
+int nanosleep(timespec*, timespec*);
920d6f
 
920d6f
 # unistd.h
920d6f
 void _exit(int);
920d6f
diff --git a/etc/syscalls.conf b/etc/syscalls.conf
920d6f
index 562f4e7..09d347d 100644
920d6f
--- a/etc/syscalls.conf
920d6f
+++ b/etc/syscalls.conf
920d6f
@@ -1,6 +1,10 @@
920d6f
 # syscall.conf -- system call prototypes
920d6f
 # See ltrace.conf(5) for description of syntax of this file.
920d6f
 
920d6f
+# Special value used to indicate the *at functions should use the
920d6f
+# current working directory.
920d6f
+typedef at_dirfd_t = enum[int](AT_FDCWD=-100);
920d6f
+
920d6f
 addr brk(addr);
920d6f
 int close(int);
920d6f
 int execve(string,addr,addr);
920d6f
@@ -14,7 +18,7 @@ int getpid();
920d6f
 addr mmap(addr,ulong,int,int,int,long);
920d6f
 
920d6f
 int munmap(addr,ulong);
920d6f
-int open(string,int,octal);
920d6f
+int open(string, hex(uint), oct(uint));
920d6f
 int personality(uint);
920d6f
 long read(int,+string0,ulong);
920d6f
 int stat(string,addr);
920d6f
@@ -113,3 +117,30 @@ ulong writev(int,addr,int);
920d6f
 int mprotect(addr,int,int);
920d6f
 int access(string,octal);
920d6f
 int getdents(uint, void *, uint);
920d6f
+
920d6f
+int openat(at_dirfd_t, string, hex(uint), oct(uint));
920d6f
+int mknodat(at_dirfd_t, string, oct(uint), ushort)
920d6f
+int mkdirat(at_dirfd_t, string, oct(uint));
920d6f
+int unlinkat(at_dirfd_t, string, hex(uint));
920d6f
+int symlinkat(string, at_dirfd_t, string);
920d6f
+int linkat(at_dirfd_t, string, at_dirfd_t, string, hex(uint));
920d6f
+int renameat(at_dirfd_t, string, at_dirfd_t, string);
920d6f
+int faccessat(at_dirfd_t, string, oct(uint), hex(uint));
920d6f
+int fchmodat(at_dirfd_t, string, oct(uint), hex(uint));
920d6f
+int fchownat(at_dirfd_t, string, int, int, hex(uint));
920d6f
+int readlinkat(at_dirfd_t, string, +string[arg4], ulong);
920d6f
+int fstatat(at_dirfd_t, string, addr, hex(uint));
920d6f
+int utimensat(at_dirfd_t, string, addr, hex(uint));
920d6f
+int futimens(int, addr);
920d6f
+int futimesat(at_dirfd_t, string, addr);
920d6f
+addr shmat(int, addr, hex(uint));
920d6f
+int shmdt(addr);
920d6f
+
920d6f
+typedef fid_type = enum(FILEID_ROOT=0, FILEID_INO32_GEN=1, FILEID_INO32_GEN_PARENT=2, FILEID_BTRFS_WITHOUT_PARENT=0x4d, FILEID_BTRFS_WITH_PARENT=0x4e, FILEID_BTRFS_WITH_PARENT_ROOT=0x4f, FILEID_UDF_WITHOUT_PARENT=0x51, FILEID_UDF_WITH_PARENT=0x52, FILEID_NILFS_WITHOUT_PARENT=0x61, FILEID_NILFS_WITH_PARENT=0x62);
920d6f
+typedef file_handle = struct(uint, fid_type, array(hex(char), elt1)*);
920d6f
+int name_to_handle_at(at_dirfd_t, string, file_handle, int*, hex(uint));
920d6f
+int open_by_handle_at(at_dirfd_t, file_handle, hex(uint));
920d6f
+
920d6f
+int newfstatat(at_dirfd_t, string, addr, hex(uint));
920d6f
+int creat(string, oct(int));
920d6f
+int ustat(ushort, addr);
920d6f
diff --git a/sysdeps/linux-gnu/Makefile.am b/sysdeps/linux-gnu/Makefile.am
920d6f
index ecee577..ec26162 100644
920d6f
--- a/sysdeps/linux-gnu/Makefile.am
920d6f
+++ b/sysdeps/linux-gnu/Makefile.am
920d6f
@@ -1,4 +1,5 @@
920d6f
 # This file is part of ltrace.
920d6f
+# Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
 # Copyright (C) 2010,2012 Marc Kleine-Budde, Pengutronix
920d6f
 #
920d6f
 # This program is free software; you can redistribute it and/or
920d6f
@@ -16,7 +17,8 @@
920d6f
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
 # 02110-1301 USA
920d6f
 
920d6f
-DIST_SUBDIRS = alpha arm cris ia64 m68k metag mips ppc s390 sparc x86
920d6f
+DIST_SUBDIRS = aarch64 alpha arm cris ia64 m68k metag mips ppc s390	\
920d6f
+	       sparc x86
920d6f
 
920d6f
 SUBDIRS = \
920d6f
 	$(HOST_CPU)
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/Makefile.am b/sysdeps/linux-gnu/aarch64/Makefile.am
920d6f
new file mode 100644
920d6f
index 0000000..0af4e6e
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/Makefile.am
920d6f
@@ -0,0 +1,25 @@
920d6f
+# This file is part of ltrace.
920d6f
+# Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+#
920d6f
+# This program is free software; you can redistribute it and/or
920d6f
+# modify it under the terms of the GNU General Public License as
920d6f
+# published by the Free Software Foundation; either version 2 of the
920d6f
+# License, or (at your option) any later version.
920d6f
+#
920d6f
+# This program is distributed in the hope that it will be useful, but
920d6f
+# WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+# General Public License for more details.
920d6f
+#
920d6f
+# You should have received a copy of the GNU General Public License
920d6f
+# along with this program; if not, write to the Free Software
920d6f
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+# 02110-1301 USA
920d6f
+
920d6f
+noinst_LTLIBRARIES = ../libcpu.la
920d6f
+
920d6f
+___libcpu_la_SOURCES = fetch.c plt.c regs.c trace.c
920d6f
+
920d6f
+noinst_HEADERS = arch.h ptrace.h signalent.h syscallent.h
920d6f
+
920d6f
+MAINTAINERCLEANFILES = Makefile.in
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/arch.h b/sysdeps/linux-gnu/aarch64/arch.h
920d6f
new file mode 100644
920d6f
index 0000000..4137613
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/arch.h
920d6f
@@ -0,0 +1,37 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+#ifndef LTRACE_AARCH64_ARCH_H
920d6f
+#define LTRACE_AARCH64_ARCH_H
920d6f
+
920d6f
+/* | 31                 21 | 20       5 | 4       0 | *
920d6f
+ * | 1 1 0 1 0 1 0 0 0 0 1 |    imm16   | 0 0 0 0 0 | */
920d6f
+#define BREAKPOINT_VALUE { 0xd4, 0x20, 0, 0 }
920d6f
+#define BREAKPOINT_LENGTH 4
920d6f
+#define DECR_PC_AFTER_BREAK 0
920d6f
+
920d6f
+#define LT_ELFCLASS	ELFCLASS64
920d6f
+#define LT_ELF_MACHINE	EM_AARCH64
920d6f
+
920d6f
+#define ARCH_HAVE_FETCH_ARG
920d6f
+#define ARCH_ENDIAN_BIG
920d6f
+#define ARCH_HAVE_SIZEOF
920d6f
+#define ARCH_HAVE_ALIGNOF
920d6f
+
920d6f
+#endif /* LTRACE_AARCH64_ARCH_H */
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/fetch.c b/sysdeps/linux-gnu/aarch64/fetch.c
920d6f
new file mode 100644
920d6f
index 0000000..8779f03
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/fetch.c
920d6f
@@ -0,0 +1,365 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+#include <sys/ptrace.h>
920d6f
+#include <asm/ptrace.h>
920d6f
+#include <stdlib.h>
920d6f
+#include <string.h>
920d6f
+
920d6f
+#include "fetch.h"
920d6f
+#include "proc.h"
920d6f
+#include "type.h"
920d6f
+#include "value.h"
920d6f
+
920d6f
+int aarch64_read_gregs(struct process *proc, struct user_pt_regs *regs);
920d6f
+int aarch64_read_fregs(struct process *proc, struct user_fpsimd_state *regs);
920d6f
+
920d6f
+
920d6f
+struct fetch_context
920d6f
+{
920d6f
+	struct user_pt_regs gregs;
920d6f
+	struct user_fpsimd_state fpregs;
920d6f
+	arch_addr_t nsaa;
920d6f
+	unsigned ngrn;
920d6f
+	unsigned nsrn;
920d6f
+	arch_addr_t x8;
920d6f
+};
920d6f
+
920d6f
+static int
920d6f
+context_init(struct fetch_context *context, struct process *proc)
920d6f
+{
920d6f
+	if (aarch64_read_gregs(proc, &context->gregs) < 0
920d6f
+	    || aarch64_read_fregs(proc, &context->fpregs) < 0)
920d6f
+		return -1;
920d6f
+
920d6f
+	context->ngrn = 0;
920d6f
+	context->nsrn = 0;
920d6f
+	/* XXX double cast */
920d6f
+	context->nsaa = (arch_addr_t) (uintptr_t) context->gregs.sp;
920d6f
+	context->x8 = 0;
920d6f
+
920d6f
+	return 0;
920d6f
+}
920d6f
+
920d6f
+struct fetch_context *
920d6f
+arch_fetch_arg_clone(struct process *proc, struct fetch_context *context)
920d6f
+{
920d6f
+	struct fetch_context *ret = malloc(sizeof(*ret));
920d6f
+	if (ret == NULL)
920d6f
+		return NULL;
920d6f
+	return memcpy(ret, context, sizeof(*ret));
920d6f
+}
920d6f
+
920d6f
+static void
920d6f
+fetch_next_gpr(struct fetch_context *context, unsigned char *buf)
920d6f
+{
920d6f
+	uint64_t u = context->gregs.regs[context->ngrn++];
920d6f
+	memcpy(buf, &u, 8);
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+fetch_gpr(struct fetch_context *context, struct value *value, size_t sz)
920d6f
+{
920d6f
+	if (sz < 8)
920d6f
+		sz = 8;
920d6f
+
920d6f
+	unsigned char *buf = value_reserve(value, sz);
920d6f
+	if (buf == NULL)
920d6f
+		return -1;
920d6f
+
920d6f
+	size_t i;
920d6f
+	for (i = 0; i < sz; i += 8)
920d6f
+		fetch_next_gpr(context, buf + i);
920d6f
+
920d6f
+	return 0;
920d6f
+}
920d6f
+
920d6f
+static void
920d6f
+fetch_next_sse(struct fetch_context *context, unsigned char *buf, size_t sz)
920d6f
+{
920d6f
+	__int128 u = context->fpregs.vregs[context->nsrn++];
920d6f
+	memcpy(buf, &u, sz);
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+fetch_sse(struct fetch_context *context, struct value *value, size_t sz)
920d6f
+{
920d6f
+	unsigned char *buf = value_reserve(value, sz);
920d6f
+	if (buf == NULL)
920d6f
+		return -1;
920d6f
+
920d6f
+	fetch_next_sse(context, buf, sz);
920d6f
+	return 0;
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+fetch_hfa(struct fetch_context *context,
920d6f
+	  struct value *value, struct arg_type_info *hfa_t, size_t count)
920d6f
+{
920d6f
+	size_t sz = type_sizeof(value->inferior, hfa_t);
920d6f
+	unsigned char *buf = value_reserve(value, sz * count);
920d6f
+	if (buf == NULL)
920d6f
+		return -1;
920d6f
+
920d6f
+	size_t i;
920d6f
+	for (i = 0; i < count; ++i) {
920d6f
+		fetch_next_sse(context, buf, sz);
920d6f
+		buf += sz;
920d6f
+	}
920d6f
+	return 0;
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+fetch_stack(struct fetch_context *context, struct value *value,
920d6f
+	    size_t align, size_t sz)
920d6f
+{
920d6f
+	if (align < 8)
920d6f
+		align = 8;
920d6f
+	size_t amount = ((sz + align - 1) / align) * align;
920d6f
+
920d6f
+	/* XXX double casts */
920d6f
+	uintptr_t sp = (uintptr_t) context->nsaa;
920d6f
+	sp = ((sp + align - 1) / align) * align;
920d6f
+
920d6f
+	value_in_inferior(value, (arch_addr_t) sp);
920d6f
+
920d6f
+	sp += amount;
920d6f
+	context->nsaa = (arch_addr_t) sp;
920d6f
+
920d6f
+	return 0;
920d6f
+}
920d6f
+
920d6f
+enum convert_method {
920d6f
+	CVT_ERR = -1,
920d6f
+	CVT_NOP = 0,
920d6f
+	CVT_BYREF,
920d6f
+};
920d6f
+
920d6f
+enum fetch_method {
920d6f
+	FETCH_NOP,
920d6f
+	FETCH_STACK,
920d6f
+	FETCH_GPR,
920d6f
+	FETCH_SSE,
920d6f
+	FETCH_HFA,
920d6f
+};
920d6f
+
920d6f
+struct fetch_script {
920d6f
+	enum convert_method c;
920d6f
+	enum fetch_method f;
920d6f
+	size_t sz;
920d6f
+	struct arg_type_info *hfa_t;
920d6f
+	size_t count;
920d6f
+};
920d6f
+
920d6f
+static struct fetch_script
920d6f
+pass_arg(struct fetch_context const *context,
920d6f
+	 struct process *proc, struct arg_type_info *info)
920d6f
+{
920d6f
+	enum fetch_method cvt = CVT_NOP;
920d6f
+
920d6f
+	size_t sz = type_sizeof(proc, info);
920d6f
+	if (sz == (size_t) -1)
920d6f
+		return (struct fetch_script) { CVT_ERR, FETCH_NOP, sz };
920d6f
+
920d6f
+	switch (info->type) {
920d6f
+	case ARGTYPE_VOID:
920d6f
+		return (struct fetch_script) { cvt, FETCH_NOP, sz };
920d6f
+
920d6f
+	case ARGTYPE_STRUCT:
920d6f
+	case ARGTYPE_ARRAY:;
920d6f
+		size_t count;
920d6f
+		struct arg_type_info *hfa_t = type_get_hfa_type(info, &count);
920d6f
+		if (hfa_t != NULL && count <= 4) {
920d6f
+			if (context->nsrn + count <= 8)
920d6f
+				return (struct fetch_script)
920d6f
+					{ cvt, FETCH_HFA, sz, hfa_t, count };
920d6f
+			return (struct fetch_script)
920d6f
+				{ cvt, FETCH_STACK, sz, hfa_t, count };
920d6f
+		}
920d6f
+
920d6f
+		if (sz <= 16) {
920d6f
+			size_t count = sz / 8;
920d6f
+			if (context->ngrn + count <= 8)
920d6f
+				return (struct fetch_script)
920d6f
+					{ cvt, FETCH_GPR, sz };
920d6f
+		}
920d6f
+
920d6f
+		cvt = CVT_BYREF;
920d6f
+		sz = 8;
920d6f
+		/* Fall through.  */
920d6f
+
920d6f
+	case ARGTYPE_POINTER:
920d6f
+	case ARGTYPE_INT:
920d6f
+	case ARGTYPE_UINT:
920d6f
+	case ARGTYPE_LONG:
920d6f
+	case ARGTYPE_ULONG:
920d6f
+	case ARGTYPE_CHAR:
920d6f
+	case ARGTYPE_SHORT:
920d6f
+	case ARGTYPE_USHORT:
920d6f
+		if (context->ngrn < 8 && sz <= 8)
920d6f
+			return (struct fetch_script) { cvt, FETCH_GPR, sz };
920d6f
+		/* We don't support types wider than 8 bytes as of
920d6f
+		 * now.  */
920d6f
+		assert(sz <= 8);
920d6f
+
920d6f
+		return (struct fetch_script) { cvt, FETCH_STACK, sz };
920d6f
+
920d6f
+	case ARGTYPE_FLOAT:
920d6f
+	case ARGTYPE_DOUBLE:
920d6f
+		if (context->nsrn < 8) {
920d6f
+			/* ltrace doesn't support float128.  */
920d6f
+			assert(sz <= 8);
920d6f
+			return (struct fetch_script) { cvt, FETCH_SSE, sz };
920d6f
+		}
920d6f
+
920d6f
+		return (struct fetch_script) { cvt, FETCH_STACK, sz };
920d6f
+	}
920d6f
+
920d6f
+	assert(! "Failed to allocate argument.");
920d6f
+	abort();
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+convert_arg(struct value *value, struct fetch_script how)
920d6f
+{
920d6f
+	switch (how.c) {
920d6f
+	case CVT_NOP:
920d6f
+		return 0;
920d6f
+	case CVT_BYREF:
920d6f
+		return value_pass_by_reference(value);
920d6f
+	case CVT_ERR:
920d6f
+		return -1;
920d6f
+	}
920d6f
+
920d6f
+	assert(! "Don't know how to convert argument.");
920d6f
+	abort();
920d6f
+}
920d6f
+
920d6f
+static int
920d6f
+fetch_arg(struct fetch_context *context,
920d6f
+	  struct process *proc, struct arg_type_info *info,
920d6f
+	  struct value *value, struct fetch_script how)
920d6f
+{
920d6f
+	if (convert_arg(value, how) < 0)
920d6f
+		return -1;
920d6f
+
920d6f
+	switch (how.f) {
920d6f
+	case FETCH_NOP:
920d6f
+		return 0;
920d6f
+
920d6f
+	case FETCH_STACK:
920d6f
+		if (how.hfa_t != NULL && how.count != 0 && how.count <= 8)
920d6f
+			context->nsrn = 8;
920d6f
+		return fetch_stack(context, value,
920d6f
+				   type_alignof(proc, info), how.sz);
920d6f
+
920d6f
+	case FETCH_GPR:
920d6f
+		return fetch_gpr(context, value, how.sz);
920d6f
+
920d6f
+	case FETCH_SSE:
920d6f
+		return fetch_sse(context, value, how.sz);
920d6f
+
920d6f
+	case FETCH_HFA:
920d6f
+		return fetch_hfa(context, value, how.hfa_t, how.count);
920d6f
+	}
920d6f
+
920d6f
+	assert(! "Don't know how to fetch argument.");
920d6f
+	abort();
920d6f
+}
920d6f
+
920d6f
+struct fetch_context *
920d6f
+arch_fetch_arg_init(enum tof type, struct process *proc,
920d6f
+		    struct arg_type_info *ret_info)
920d6f
+{
920d6f
+	struct fetch_context *context = malloc(sizeof *context);
920d6f
+	if (context == NULL || context_init(context, proc) < 0) {
920d6f
+	fail:
920d6f
+		free(context);
920d6f
+		return NULL;
920d6f
+	}
920d6f
+
920d6f
+	/* There's a provision in ARMv8 parameter passing convention
920d6f
+	 * for returning types that, if passed as first argument to a
920d6f
+	 * function, would be passed on stack.  For those types, x8
920d6f
+	 * contains an address where the return argument should be
920d6f
+	 * placed.  The callee doesn't need to preserve the value of
920d6f
+	 * x8, so we need to fetch it now.
920d6f
+	 *
920d6f
+	 * To my knowledge, there are currently no types where this
920d6f
+	 * holds, but the code is here, utterly untested.  */
920d6f
+
920d6f
+	struct fetch_script how = pass_arg(context, proc, ret_info);
920d6f
+	if (how.c == CVT_ERR)
920d6f
+		goto fail;
920d6f
+	if (how.c == CVT_NOP && how.f == FETCH_STACK) {
920d6f
+		/* XXX double cast.  */
920d6f
+		context->x8 = (arch_addr_t) (uintptr_t) context->gregs.regs[8];
920d6f
+		/* See the comment above about the assert.  */
920d6f
+		assert(! "Unexpected: first argument passed on stack.");
920d6f
+		abort();
920d6f
+	}
920d6f
+
920d6f
+	return context;
920d6f
+}
920d6f
+
920d6f
+int
920d6f
+arch_fetch_arg_next(struct fetch_context *context, enum tof type,
920d6f
+		    struct process *proc, struct arg_type_info *info,
920d6f
+		    struct value *value)
920d6f
+{
920d6f
+	return fetch_arg(context, proc, info, value,
920d6f
+			 pass_arg(context, proc, info));
920d6f
+}
920d6f
+
920d6f
+int
920d6f
+arch_fetch_retval(struct fetch_context *context, enum tof type,
920d6f
+		  struct process *proc, struct arg_type_info *info,
920d6f
+		  struct value *value)
920d6f
+{
920d6f
+	if (context->x8 != 0) {
920d6f
+		value_in_inferior(value, context->x8);
920d6f
+		return 0;
920d6f
+	}
920d6f
+
920d6f
+	if (context_init(context, proc) < 0)
920d6f
+		return -1;
920d6f
+
920d6f
+	return fetch_arg(context, proc, info, value,
920d6f
+			 pass_arg(context, proc, info));
920d6f
+}
920d6f
+
920d6f
+void
920d6f
+arch_fetch_arg_done(struct fetch_context *context)
920d6f
+{
920d6f
+	if (context != NULL)
920d6f
+		free(context);
920d6f
+}
920d6f
+
920d6f
+size_t
920d6f
+arch_type_sizeof(struct process *proc, struct arg_type_info *arg)
920d6f
+{
920d6f
+	return (size_t) -2;
920d6f
+}
920d6f
+
920d6f
+size_t
920d6f
+arch_type_alignof(struct process *proc, struct arg_type_info *arg)
920d6f
+{
920d6f
+	return (size_t) -2;
920d6f
+}
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/plt.c b/sysdeps/linux-gnu/aarch64/plt.c
920d6f
new file mode 100644
920d6f
index 0000000..29dc4c9
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/plt.c
920d6f
@@ -0,0 +1,38 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+#include <gelf.h>
920d6f
+
920d6f
+#include "backend.h"
920d6f
+#include "proc.h"
920d6f
+#include "library.h"
920d6f
+#include "ltrace-elf.h"
920d6f
+
920d6f
+arch_addr_t
920d6f
+sym2addr(struct process *proc, struct library_symbol *sym)
920d6f
+{
920d6f
+	return sym->enter_addr;
920d6f
+}
920d6f
+
920d6f
+GElf_Addr
920d6f
+arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela)
920d6f
+{
920d6f
+	return lte->plt_addr + 32 + ndx * 16;
920d6f
+}
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/ptrace.h b/sysdeps/linux-gnu/aarch64/ptrace.h
920d6f
new file mode 100644
920d6f
index 0000000..283c314
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/ptrace.h
920d6f
@@ -0,0 +1,22 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+#include <sys/ptrace.h>
920d6f
+#include <asm/ptrace.h>
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/regs.c b/sysdeps/linux-gnu/aarch64/regs.c
920d6f
new file mode 100644
920d6f
index 0000000..06eb72b
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/regs.c
920d6f
@@ -0,0 +1,130 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+#include <sys/ptrace.h>
920d6f
+#include <asm/ptrace.h>
920d6f
+#include <linux/uio.h>
920d6f
+#include <assert.h>
920d6f
+#include <stdlib.h>
920d6f
+
920d6f
+#include "backend.h"
920d6f
+#include "proc.h"
920d6f
+
920d6f
+#define PC_OFF (32 * 4)
920d6f
+
920d6f
+int
920d6f
+aarch64_read_gregs(struct process *proc, struct user_pt_regs *regs)
920d6f
+{
920d6f
+	*regs = (struct user_pt_regs) {};
920d6f
+	struct iovec iovec;
920d6f
+	iovec.iov_base = regs;
920d6f
+	iovec.iov_len = sizeof *regs;
920d6f
+	return ptrace(PTRACE_GETREGSET, proc->pid, NT_PRSTATUS, &iovec) < 0
920d6f
+		? -1 : 0;
920d6f
+}
920d6f
+
920d6f
+int
920d6f
+aarch64_write_gregs(struct process *proc, struct user_pt_regs *regs)
920d6f
+{
920d6f
+	struct iovec iovec;
920d6f
+	iovec.iov_base = regs;
920d6f
+	iovec.iov_len = sizeof *regs;
920d6f
+	return ptrace(PTRACE_SETREGSET, proc->pid, NT_PRSTATUS, &iovec) < 0
920d6f
+		? -1 : 0;
920d6f
+}
920d6f
+
920d6f
+int
920d6f
+aarch64_read_fregs(struct process *proc, struct user_fpsimd_state *regs)
920d6f
+{
920d6f
+	*regs = (struct user_fpsimd_state) {};
920d6f
+	struct iovec iovec;
920d6f
+	iovec.iov_base = regs;
920d6f
+	iovec.iov_len = sizeof *regs;
920d6f
+	return ptrace(PTRACE_GETREGSET, proc->pid, NT_FPREGSET, &iovec) < 0
920d6f
+		? -1 : 0;
920d6f
+}
920d6f
+
920d6f
+arch_addr_t
920d6f
+get_instruction_pointer(struct process *proc)
920d6f
+{
920d6f
+	struct user_pt_regs regs;
920d6f
+	if (aarch64_read_gregs(proc, &regs) < 0) {
920d6f
+		fprintf(stderr, "get_instruction_pointer: "
920d6f
+			"Couldn't read registers of %d.\n", proc->pid);
920d6f
+		return 0;
920d6f
+	}
920d6f
+
920d6f
+	/* 
920d6f
+	char buf[128];
920d6f
+	sprintf(buf, "cat /proc/%d/maps", proc->pid);
920d6f
+	system(buf);
920d6f
+	*/
920d6f
+
920d6f
+	/* XXX double cast */
920d6f
+	return (arch_addr_t) (uintptr_t) regs.pc;
920d6f
+}
920d6f
+
920d6f
+void
920d6f
+set_instruction_pointer(struct process *proc, arch_addr_t addr)
920d6f
+{
920d6f
+	struct user_pt_regs regs;
920d6f
+	if (aarch64_read_gregs(proc, &regs) < 0) {
920d6f
+		fprintf(stderr, "get_instruction_pointer: "
920d6f
+			"Couldn't read registers of %d.\n", proc->pid);
920d6f
+		return;
920d6f
+	}
920d6f
+
920d6f
+	/* XXX double cast */
920d6f
+	regs.pc = (uint64_t) (uintptr_t) addr;
920d6f
+
920d6f
+	if (aarch64_write_gregs(proc, &regs) < 0) {
920d6f
+		fprintf(stderr, "get_instruction_pointer: "
920d6f
+			"Couldn't write registers of %d.\n", proc->pid);
920d6f
+		return;
920d6f
+	}
920d6f
+}
920d6f
+
920d6f
+arch_addr_t
920d6f
+get_stack_pointer(struct process *proc)
920d6f
+{
920d6f
+	struct user_pt_regs regs;
920d6f
+	if (aarch64_read_gregs(proc, &regs) < 0) {
920d6f
+		fprintf(stderr, "get_stack_pointer: "
920d6f
+			"Couldn't read registers of %d.\n", proc->pid);
920d6f
+		return 0;
920d6f
+	}
920d6f
+
920d6f
+	/* XXX double cast */
920d6f
+	return (arch_addr_t) (uintptr_t) regs.sp;
920d6f
+}
920d6f
+
920d6f
+arch_addr_t
920d6f
+get_return_addr(struct process *proc, arch_addr_t stack_pointer)
920d6f
+{
920d6f
+	struct user_pt_regs regs;
920d6f
+	if (aarch64_read_gregs(proc, &regs) < 0) {
920d6f
+		fprintf(stderr, "get_return_addr: "
920d6f
+			"Couldn't read registers of %d.\n", proc->pid);
920d6f
+		return 0;
920d6f
+	}
920d6f
+
920d6f
+	/* XXX double cast */
920d6f
+	return (arch_addr_t) (uintptr_t) regs.regs[30];
920d6f
+}
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/signalent.h b/sysdeps/linux-gnu/aarch64/signalent.h
920d6f
new file mode 100644
920d6f
index 0000000..bf56ebc
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/signalent.h
920d6f
@@ -0,0 +1,52 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2006 Ian Wienand
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+	"SIG_0",			/* 0 */
920d6f
+	"SIGHUP",			/* 1 */
920d6f
+	"SIGINT",			/* 2 */
920d6f
+	"SIGQUIT",			/* 3 */
920d6f
+	"SIGILL",			/* 4 */
920d6f
+	"SIGTRAP",			/* 5 */
920d6f
+	"SIGABRT",			/* 6 */
920d6f
+	"SIGBUS",			/* 7 */
920d6f
+	"SIGFPE",			/* 8 */
920d6f
+	"SIGKILL",			/* 9 */
920d6f
+	"SIGUSR1",			/* 10 */
920d6f
+	"SIGSEGV",			/* 11 */
920d6f
+	"SIGUSR2",			/* 12 */
920d6f
+	"SIGPIPE",			/* 13 */
920d6f
+	"SIGALRM",			/* 14 */
920d6f
+	"SIGTERM",			/* 15 */
920d6f
+	"SIGSTKFLT",			/* 16 */
920d6f
+	"SIGCHLD",			/* 17 */
920d6f
+	"SIGCONT",			/* 18 */
920d6f
+	"SIGSTOP",			/* 19 */
920d6f
+	"SIGTSTP",			/* 20 */
920d6f
+	"SIGTTIN",			/* 21 */
920d6f
+	"SIGTTOU",			/* 22 */
920d6f
+	"SIGURG",			/* 23 */
920d6f
+	"SIGXCPU",			/* 24 */
920d6f
+	"SIGXFSZ",			/* 25 */
920d6f
+	"SIGVTALRM",			/* 26 */
920d6f
+	"SIGPROF",			/* 27 */
920d6f
+	"SIGWINCH",			/* 28 */
920d6f
+	"SIGIO",			/* 29 */
920d6f
+	"SIGPWR",			/* 30 */
920d6f
+	"SIGSYS",			/* 31 */
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/syscallent.h b/sysdeps/linux-gnu/aarch64/syscallent.h
920d6f
new file mode 100644
920d6f
index 0000000..aca8191
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/syscallent.h
920d6f
@@ -0,0 +1,1100 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+	"io_setup",                        /* 0 */
920d6f
+	"io_destroy",                      /* 1 */
920d6f
+	"io_submit",                       /* 2 */
920d6f
+	"io_cancel",                       /* 3 */
920d6f
+	"io_getevents",                    /* 4 */
920d6f
+	"setxattr",                        /* 5 */
920d6f
+	"lsetxattr",                       /* 6 */
920d6f
+	"fsetxattr",                       /* 7 */
920d6f
+	"getxattr",                        /* 8 */
920d6f
+	"lgetxattr",                       /* 9 */
920d6f
+	"fgetxattr",                       /* 10 */
920d6f
+	"listxattr",                       /* 11 */
920d6f
+	"llistxattr",                      /* 12 */
920d6f
+	"flistxattr",                      /* 13 */
920d6f
+	"removexattr",                     /* 14 */
920d6f
+	"lremovexattr",                    /* 15 */
920d6f
+	"fremovexattr",                    /* 16 */
920d6f
+	"getcwd",                          /* 17 */
920d6f
+	"lookup_dcookie",                  /* 18 */
920d6f
+	"eventfd2",                        /* 19 */
920d6f
+	"epoll_create1",                   /* 20 */
920d6f
+	"epoll_ctl",                       /* 21 */
920d6f
+	"epoll_pwait",                     /* 22 */
920d6f
+	"dup",                             /* 23 */
920d6f
+	"dup3",                            /* 24 */
920d6f
+	"fcntl",                           /* 25 */
920d6f
+	"inotify_init1",                   /* 26 */
920d6f
+	"inotify_add_watch",               /* 27 */
920d6f
+	"inotify_rm_watch",                /* 28 */
920d6f
+	"ioctl",                           /* 29 */
920d6f
+	"ioprio_set",                      /* 30 */
920d6f
+	"ioprio_get",                      /* 31 */
920d6f
+	"flock",                           /* 32 */
920d6f
+	"mknodat",                         /* 33 */
920d6f
+	"mkdirat",                         /* 34 */
920d6f
+	"unlinkat",                        /* 35 */
920d6f
+	"symlinkat",                       /* 36 */
920d6f
+	"linkat",                          /* 37 */
920d6f
+	"renameat",                        /* 38 */
920d6f
+	"umount2",                         /* 39 */
920d6f
+	"mount",                           /* 40 */
920d6f
+	"pivot_root",                      /* 41 */
920d6f
+	"nfsservctl",                      /* 42 */
920d6f
+	"statfs",                          /* 43 */
920d6f
+	"fstatfs",                         /* 44 */
920d6f
+	"truncate",                        /* 45 */
920d6f
+	"ftruncate",                       /* 46 */
920d6f
+	"fallocate",                       /* 47 */
920d6f
+	"faccessat",                       /* 48 */
920d6f
+	"chdir",                           /* 49 */
920d6f
+	"fchdir",                          /* 50 */
920d6f
+	"chroot",                          /* 51 */
920d6f
+	"fchmod",                          /* 52 */
920d6f
+	"fchmodat",                        /* 53 */
920d6f
+	"fchownat",                        /* 54 */
920d6f
+	"fchown",                          /* 55 */
920d6f
+	"openat",                          /* 56 */
920d6f
+	"close",                           /* 57 */
920d6f
+	"vhangup",                         /* 58 */
920d6f
+	"pipe2",                           /* 59 */
920d6f
+	"quotactl",                        /* 60 */
920d6f
+	"getdents64",                      /* 61 */
920d6f
+	"lseek",                           /* 62 */
920d6f
+	"read",                            /* 63 */
920d6f
+	"write",                           /* 64 */
920d6f
+	"readv",                           /* 65 */
920d6f
+	"writev",                          /* 66 */
920d6f
+	"pread64",                         /* 67 */
920d6f
+	"pwrite64",                        /* 68 */
920d6f
+	"preadv",                          /* 69 */
920d6f
+	"pwritev",                         /* 70 */
920d6f
+	"sendfile",                        /* 71 */
920d6f
+	"pselect6",                        /* 72 */
920d6f
+	"ppoll",                           /* 73 */
920d6f
+	"signalfd4",                       /* 74 */
920d6f
+	"vmsplice",                        /* 75 */
920d6f
+	"splice",                          /* 76 */
920d6f
+	"tee",                             /* 77 */
920d6f
+	"readlinkat",                      /* 78 */
920d6f
+	"fstatat",                         /* 79 */
920d6f
+	"fstat",                           /* 80 */
920d6f
+	"sync",                            /* 81 */
920d6f
+	"fsync",                           /* 82 */
920d6f
+	"fdatasync",                       /* 83 */
920d6f
+	"sync_file_range",                 /* 84 */
920d6f
+	"timerfd_create",                  /* 85 */
920d6f
+	"timerfd_settime",                 /* 86 */
920d6f
+	"timerfd_gettime",                 /* 87 */
920d6f
+	"utimensat",                       /* 88 */
920d6f
+	"acct",                            /* 89 */
920d6f
+	"capget",                          /* 90 */
920d6f
+	"capset",                          /* 91 */
920d6f
+	"personality",                     /* 92 */
920d6f
+	"exit",                            /* 93 */
920d6f
+	"exit_group",                      /* 94 */
920d6f
+	"waitid",                          /* 95 */
920d6f
+	"set_tid_address",                 /* 96 */
920d6f
+	"unshare",                         /* 97 */
920d6f
+	"futex",                           /* 98 */
920d6f
+	"set_robust_list",                 /* 99 */
920d6f
+	"get_robust_list",                 /* 100 */
920d6f
+	"nanosleep",                       /* 101 */
920d6f
+	"getitimer",                       /* 102 */
920d6f
+	"setitimer",                       /* 103 */
920d6f
+	"kexec_load",                      /* 104 */
920d6f
+	"init_module",                     /* 105 */
920d6f
+	"delete_module",                   /* 106 */
920d6f
+	"timer_create",                    /* 107 */
920d6f
+	"timer_gettime",                   /* 108 */
920d6f
+	"timer_getoverrun",                /* 109 */
920d6f
+	"timer_settime",                   /* 110 */
920d6f
+	"timer_delete",                    /* 111 */
920d6f
+	"clock_settime",                   /* 112 */
920d6f
+	"clock_gettime",                   /* 113 */
920d6f
+	"clock_getres",                    /* 114 */
920d6f
+	"clock_nanosleep",                 /* 115 */
920d6f
+	"syslog",                          /* 116 */
920d6f
+	"ptrace",                          /* 117 */
920d6f
+	"sched_setparam",                  /* 118 */
920d6f
+	"sched_setscheduler",              /* 119 */
920d6f
+	"sched_getscheduler",              /* 120 */
920d6f
+	"sched_getparam",                  /* 121 */
920d6f
+	"sched_setaffinity",               /* 122 */
920d6f
+	"sched_getaffinity",               /* 123 */
920d6f
+	"sched_yield",                     /* 124 */
920d6f
+	"sched_get_priority_max",          /* 125 */
920d6f
+	"sched_get_priority_min",          /* 126 */
920d6f
+	"sched_rr_get_interval",           /* 127 */
920d6f
+	"restart_syscall",                 /* 128 */
920d6f
+	"kill",                            /* 129 */
920d6f
+	"tkill",                           /* 130 */
920d6f
+	"tgkill",                          /* 131 */
920d6f
+	"sigaltstack",                     /* 132 */
920d6f
+	"rt_sigsuspend",                   /* 133 */
920d6f
+	"rt_sigaction",                    /* 134 */
920d6f
+	"rt_sigprocmask",                  /* 135 */
920d6f
+	"rt_sigpending",                   /* 136 */
920d6f
+	"rt_sigtimedwait",                 /* 137 */
920d6f
+	"rt_sigqueueinfo",                 /* 138 */
920d6f
+	"rt_sigreturn",                    /* 139 */
920d6f
+	"setpriority",                     /* 140 */
920d6f
+	"getpriority",                     /* 141 */
920d6f
+	"reboot",                          /* 142 */
920d6f
+	"setregid",                        /* 143 */
920d6f
+	"setgid",                          /* 144 */
920d6f
+	"setreuid",                        /* 145 */
920d6f
+	"setuid",                          /* 146 */
920d6f
+	"setresuid",                       /* 147 */
920d6f
+	"getresuid",                       /* 148 */
920d6f
+	"setresgid",                       /* 149 */
920d6f
+	"getresgid",                       /* 150 */
920d6f
+	"setfsuid",                        /* 151 */
920d6f
+	"setfsgid",                        /* 152 */
920d6f
+	"times",                           /* 153 */
920d6f
+	"setpgid",                         /* 154 */
920d6f
+	"getpgid",                         /* 155 */
920d6f
+	"getsid",                          /* 156 */
920d6f
+	"setsid",                          /* 157 */
920d6f
+	"getgroups",                       /* 158 */
920d6f
+	"setgroups",                       /* 159 */
920d6f
+	"uname",                           /* 160 */
920d6f
+	"sethostname",                     /* 161 */
920d6f
+	"setdomainname",                   /* 162 */
920d6f
+	"getrlimit",                       /* 163 */
920d6f
+	"setrlimit",                       /* 164 */
920d6f
+	"getrusage",                       /* 165 */
920d6f
+	"umask",                           /* 166 */
920d6f
+	"prctl",                           /* 167 */
920d6f
+	"getcpu",                          /* 168 */
920d6f
+	"gettimeofday",                    /* 169 */
920d6f
+	"settimeofday",                    /* 170 */
920d6f
+	"adjtimex",                        /* 171 */
920d6f
+	"getpid",                          /* 172 */
920d6f
+	"getppid",                         /* 173 */
920d6f
+	"getuid",                          /* 174 */
920d6f
+	"geteuid",                         /* 175 */
920d6f
+	"getgid",                          /* 176 */
920d6f
+	"getegid",                         /* 177 */
920d6f
+	"gettid",                          /* 178 */
920d6f
+	"sysinfo",                         /* 179 */
920d6f
+	"mq_open",                         /* 180 */
920d6f
+	"mq_unlink",                       /* 181 */
920d6f
+	"mq_timedsend",                    /* 182 */
920d6f
+	"mq_timedreceive",                 /* 183 */
920d6f
+	"mq_notify",                       /* 184 */
920d6f
+	"mq_getsetattr",                   /* 185 */
920d6f
+	"msgget",                          /* 186 */
920d6f
+	"msgctl",                          /* 187 */
920d6f
+	"msgrcv",                          /* 188 */
920d6f
+	"msgsnd",                          /* 189 */
920d6f
+	"semget",                          /* 190 */
920d6f
+	"semctl",                          /* 191 */
920d6f
+	"semtimedop",                      /* 192 */
920d6f
+	"semop",                           /* 193 */
920d6f
+	"shmget",                          /* 194 */
920d6f
+	"shmctl",                          /* 195 */
920d6f
+	"shmat",                           /* 196 */
920d6f
+	"shmdt",                           /* 197 */
920d6f
+	"socket",                          /* 198 */
920d6f
+	"socketpair",                      /* 199 */
920d6f
+	"bind",                            /* 200 */
920d6f
+	"listen",                          /* 201 */
920d6f
+	"accept",                          /* 202 */
920d6f
+	"connect",                         /* 203 */
920d6f
+	"getsockname",                     /* 204 */
920d6f
+	"getpeername",                     /* 205 */
920d6f
+	"sendto",                          /* 206 */
920d6f
+	"recvfrom",                        /* 207 */
920d6f
+	"setsockopt",                      /* 208 */
920d6f
+	"getsockopt",                      /* 209 */
920d6f
+	"shutdown",                        /* 210 */
920d6f
+	"sendmsg",                         /* 211 */
920d6f
+	"recvmsg",                         /* 212 */
920d6f
+	"readahead",                       /* 213 */
920d6f
+	"brk",                             /* 214 */
920d6f
+	"munmap",                          /* 215 */
920d6f
+	"mremap",                          /* 216 */
920d6f
+	"add_key",                         /* 217 */
920d6f
+	"request_key",                     /* 218 */
920d6f
+	"keyctl",                          /* 219 */
920d6f
+	"clone",                           /* 220 */
920d6f
+	"execve",                          /* 221 */
920d6f
+	"mmap",                            /* 222 */
920d6f
+	"fadvise64",                       /* 223 */
920d6f
+	"swapon",                          /* 224 */
920d6f
+	"swapoff",                         /* 225 */
920d6f
+	"mprotect",                        /* 226 */
920d6f
+	"msync",                           /* 227 */
920d6f
+	"mlock",                           /* 228 */
920d6f
+	"munlock",                         /* 229 */
920d6f
+	"mlockall",                        /* 230 */
920d6f
+	"munlockall",                      /* 231 */
920d6f
+	"mincore",                         /* 232 */
920d6f
+	"madvise",                         /* 233 */
920d6f
+	"remap_file_pages",                /* 234 */
920d6f
+	"mbind",                           /* 235 */
920d6f
+	"get_mempolicy",                   /* 236 */
920d6f
+	"set_mempolicy",                   /* 237 */
920d6f
+	"migrate_pages",                   /* 238 */
920d6f
+	"move_pages",                      /* 239 */
920d6f
+	"rt_tgsigqueueinfo",               /* 240 */
920d6f
+	"perf_event_open",                 /* 241 */
920d6f
+	"accept4",                         /* 242 */
920d6f
+	"recvmmsg",                        /* 243 */
920d6f
+	"arch_specific_syscall",           /* 244 */
920d6f
+	"245",                             /* 245 */
920d6f
+	"246",                             /* 246 */
920d6f
+	"247",                             /* 247 */
920d6f
+	"248",                             /* 248 */
920d6f
+	"249",                             /* 249 */
920d6f
+	"250",                             /* 250 */
920d6f
+	"251",                             /* 251 */
920d6f
+	"252",                             /* 252 */
920d6f
+	"253",                             /* 253 */
920d6f
+	"254",                             /* 254 */
920d6f
+	"255",                             /* 255 */
920d6f
+	"256",                             /* 256 */
920d6f
+	"257",                             /* 257 */
920d6f
+	"258",                             /* 258 */
920d6f
+	"259",                             /* 259 */
920d6f
+	"wait4",                           /* 260 */
920d6f
+	"prlimit64",                       /* 261 */
920d6f
+	"fanotify_init",                   /* 262 */
920d6f
+	"fanotify_mark",                   /* 263 */
920d6f
+	"name_to_handle_at",               /* 264 */
920d6f
+	"open_by_handle_at",               /* 265 */
920d6f
+	"clock_adjtime",                   /* 266 */
920d6f
+	"syncfs",                          /* 267 */
920d6f
+	"setns",                           /* 268 */
920d6f
+	"sendmmsg",                        /* 269 */
920d6f
+	"process_vm_readv",                /* 270 */
920d6f
+	"process_vm_writev",               /* 271 */
920d6f
+	"kcmp",                            /* 272 */
920d6f
+	"finit_module",                    /* 273 */
920d6f
+	"syscalls",                        /* 274 */
920d6f
+	"275",                             /* 275 */
920d6f
+	"276",                             /* 276 */
920d6f
+	"277",                             /* 277 */
920d6f
+	"278",                             /* 278 */
920d6f
+	"279",                             /* 279 */
920d6f
+	"280",                             /* 280 */
920d6f
+	"281",                             /* 281 */
920d6f
+	"282",                             /* 282 */
920d6f
+	"283",                             /* 283 */
920d6f
+	"284",                             /* 284 */
920d6f
+	"285",                             /* 285 */
920d6f
+	"286",                             /* 286 */
920d6f
+	"287",                             /* 287 */
920d6f
+	"288",                             /* 288 */
920d6f
+	"289",                             /* 289 */
920d6f
+	"290",                             /* 290 */
920d6f
+	"291",                             /* 291 */
920d6f
+	"292",                             /* 292 */
920d6f
+	"293",                             /* 293 */
920d6f
+	"294",                             /* 294 */
920d6f
+	"295",                             /* 295 */
920d6f
+	"296",                             /* 296 */
920d6f
+	"297",                             /* 297 */
920d6f
+	"298",                             /* 298 */
920d6f
+	"299",                             /* 299 */
920d6f
+	"300",                             /* 300 */
920d6f
+	"301",                             /* 301 */
920d6f
+	"302",                             /* 302 */
920d6f
+	"303",                             /* 303 */
920d6f
+	"304",                             /* 304 */
920d6f
+	"305",                             /* 305 */
920d6f
+	"306",                             /* 306 */
920d6f
+	"307",                             /* 307 */
920d6f
+	"308",                             /* 308 */
920d6f
+	"309",                             /* 309 */
920d6f
+	"310",                             /* 310 */
920d6f
+	"311",                             /* 311 */
920d6f
+	"312",                             /* 312 */
920d6f
+	"313",                             /* 313 */
920d6f
+	"314",                             /* 314 */
920d6f
+	"315",                             /* 315 */
920d6f
+	"316",                             /* 316 */
920d6f
+	"317",                             /* 317 */
920d6f
+	"318",                             /* 318 */
920d6f
+	"319",                             /* 319 */
920d6f
+	"320",                             /* 320 */
920d6f
+	"321",                             /* 321 */
920d6f
+	"322",                             /* 322 */
920d6f
+	"323",                             /* 323 */
920d6f
+	"324",                             /* 324 */
920d6f
+	"325",                             /* 325 */
920d6f
+	"326",                             /* 326 */
920d6f
+	"327",                             /* 327 */
920d6f
+	"328",                             /* 328 */
920d6f
+	"329",                             /* 329 */
920d6f
+	"330",                             /* 330 */
920d6f
+	"331",                             /* 331 */
920d6f
+	"332",                             /* 332 */
920d6f
+	"333",                             /* 333 */
920d6f
+	"334",                             /* 334 */
920d6f
+	"335",                             /* 335 */
920d6f
+	"336",                             /* 336 */
920d6f
+	"337",                             /* 337 */
920d6f
+	"338",                             /* 338 */
920d6f
+	"339",                             /* 339 */
920d6f
+	"340",                             /* 340 */
920d6f
+	"341",                             /* 341 */
920d6f
+	"342",                             /* 342 */
920d6f
+	"343",                             /* 343 */
920d6f
+	"344",                             /* 344 */
920d6f
+	"345",                             /* 345 */
920d6f
+	"346",                             /* 346 */
920d6f
+	"347",                             /* 347 */
920d6f
+	"348",                             /* 348 */
920d6f
+	"349",                             /* 349 */
920d6f
+	"350",                             /* 350 */
920d6f
+	"351",                             /* 351 */
920d6f
+	"352",                             /* 352 */
920d6f
+	"353",                             /* 353 */
920d6f
+	"354",                             /* 354 */
920d6f
+	"355",                             /* 355 */
920d6f
+	"356",                             /* 356 */
920d6f
+	"357",                             /* 357 */
920d6f
+	"358",                             /* 358 */
920d6f
+	"359",                             /* 359 */
920d6f
+	"360",                             /* 360 */
920d6f
+	"361",                             /* 361 */
920d6f
+	"362",                             /* 362 */
920d6f
+	"363",                             /* 363 */
920d6f
+	"364",                             /* 364 */
920d6f
+	"365",                             /* 365 */
920d6f
+	"366",                             /* 366 */
920d6f
+	"367",                             /* 367 */
920d6f
+	"368",                             /* 368 */
920d6f
+	"369",                             /* 369 */
920d6f
+	"370",                             /* 370 */
920d6f
+	"371",                             /* 371 */
920d6f
+	"372",                             /* 372 */
920d6f
+	"373",                             /* 373 */
920d6f
+	"374",                             /* 374 */
920d6f
+	"375",                             /* 375 */
920d6f
+	"376",                             /* 376 */
920d6f
+	"377",                             /* 377 */
920d6f
+	"378",                             /* 378 */
920d6f
+	"379",                             /* 379 */
920d6f
+	"380",                             /* 380 */
920d6f
+	"381",                             /* 381 */
920d6f
+	"382",                             /* 382 */
920d6f
+	"383",                             /* 383 */
920d6f
+	"384",                             /* 384 */
920d6f
+	"385",                             /* 385 */
920d6f
+	"386",                             /* 386 */
920d6f
+	"387",                             /* 387 */
920d6f
+	"388",                             /* 388 */
920d6f
+	"389",                             /* 389 */
920d6f
+	"390",                             /* 390 */
920d6f
+	"391",                             /* 391 */
920d6f
+	"392",                             /* 392 */
920d6f
+	"393",                             /* 393 */
920d6f
+	"394",                             /* 394 */
920d6f
+	"395",                             /* 395 */
920d6f
+	"396",                             /* 396 */
920d6f
+	"397",                             /* 397 */
920d6f
+	"398",                             /* 398 */
920d6f
+	"399",                             /* 399 */
920d6f
+	"400",                             /* 400 */
920d6f
+	"401",                             /* 401 */
920d6f
+	"402",                             /* 402 */
920d6f
+	"403",                             /* 403 */
920d6f
+	"404",                             /* 404 */
920d6f
+	"405",                             /* 405 */
920d6f
+	"406",                             /* 406 */
920d6f
+	"407",                             /* 407 */
920d6f
+	"408",                             /* 408 */
920d6f
+	"409",                             /* 409 */
920d6f
+	"410",                             /* 410 */
920d6f
+	"411",                             /* 411 */
920d6f
+	"412",                             /* 412 */
920d6f
+	"413",                             /* 413 */
920d6f
+	"414",                             /* 414 */
920d6f
+	"415",                             /* 415 */
920d6f
+	"416",                             /* 416 */
920d6f
+	"417",                             /* 417 */
920d6f
+	"418",                             /* 418 */
920d6f
+	"419",                             /* 419 */
920d6f
+	"420",                             /* 420 */
920d6f
+	"421",                             /* 421 */
920d6f
+	"422",                             /* 422 */
920d6f
+	"423",                             /* 423 */
920d6f
+	"424",                             /* 424 */
920d6f
+	"425",                             /* 425 */
920d6f
+	"426",                             /* 426 */
920d6f
+	"427",                             /* 427 */
920d6f
+	"428",                             /* 428 */
920d6f
+	"429",                             /* 429 */
920d6f
+	"430",                             /* 430 */
920d6f
+	"431",                             /* 431 */
920d6f
+	"432",                             /* 432 */
920d6f
+	"433",                             /* 433 */
920d6f
+	"434",                             /* 434 */
920d6f
+	"435",                             /* 435 */
920d6f
+	"436",                             /* 436 */
920d6f
+	"437",                             /* 437 */
920d6f
+	"438",                             /* 438 */
920d6f
+	"439",                             /* 439 */
920d6f
+	"440",                             /* 440 */
920d6f
+	"441",                             /* 441 */
920d6f
+	"442",                             /* 442 */
920d6f
+	"443",                             /* 443 */
920d6f
+	"444",                             /* 444 */
920d6f
+	"445",                             /* 445 */
920d6f
+	"446",                             /* 446 */
920d6f
+	"447",                             /* 447 */
920d6f
+	"448",                             /* 448 */
920d6f
+	"449",                             /* 449 */
920d6f
+	"450",                             /* 450 */
920d6f
+	"451",                             /* 451 */
920d6f
+	"452",                             /* 452 */
920d6f
+	"453",                             /* 453 */
920d6f
+	"454",                             /* 454 */
920d6f
+	"455",                             /* 455 */
920d6f
+	"456",                             /* 456 */
920d6f
+	"457",                             /* 457 */
920d6f
+	"458",                             /* 458 */
920d6f
+	"459",                             /* 459 */
920d6f
+	"460",                             /* 460 */
920d6f
+	"461",                             /* 461 */
920d6f
+	"462",                             /* 462 */
920d6f
+	"463",                             /* 463 */
920d6f
+	"464",                             /* 464 */
920d6f
+	"465",                             /* 465 */
920d6f
+	"466",                             /* 466 */
920d6f
+	"467",                             /* 467 */
920d6f
+	"468",                             /* 468 */
920d6f
+	"469",                             /* 469 */
920d6f
+	"470",                             /* 470 */
920d6f
+	"471",                             /* 471 */
920d6f
+	"472",                             /* 472 */
920d6f
+	"473",                             /* 473 */
920d6f
+	"474",                             /* 474 */
920d6f
+	"475",                             /* 475 */
920d6f
+	"476",                             /* 476 */
920d6f
+	"477",                             /* 477 */
920d6f
+	"478",                             /* 478 */
920d6f
+	"479",                             /* 479 */
920d6f
+	"480",                             /* 480 */
920d6f
+	"481",                             /* 481 */
920d6f
+	"482",                             /* 482 */
920d6f
+	"483",                             /* 483 */
920d6f
+	"484",                             /* 484 */
920d6f
+	"485",                             /* 485 */
920d6f
+	"486",                             /* 486 */
920d6f
+	"487",                             /* 487 */
920d6f
+	"488",                             /* 488 */
920d6f
+	"489",                             /* 489 */
920d6f
+	"490",                             /* 490 */
920d6f
+	"491",                             /* 491 */
920d6f
+	"492",                             /* 492 */
920d6f
+	"493",                             /* 493 */
920d6f
+	"494",                             /* 494 */
920d6f
+	"495",                             /* 495 */
920d6f
+	"496",                             /* 496 */
920d6f
+	"497",                             /* 497 */
920d6f
+	"498",                             /* 498 */
920d6f
+	"499",                             /* 499 */
920d6f
+	"500",                             /* 500 */
920d6f
+	"501",                             /* 501 */
920d6f
+	"502",                             /* 502 */
920d6f
+	"503",                             /* 503 */
920d6f
+	"504",                             /* 504 */
920d6f
+	"505",                             /* 505 */
920d6f
+	"506",                             /* 506 */
920d6f
+	"507",                             /* 507 */
920d6f
+	"508",                             /* 508 */
920d6f
+	"509",                             /* 509 */
920d6f
+	"510",                             /* 510 */
920d6f
+	"511",                             /* 511 */
920d6f
+	"512",                             /* 512 */
920d6f
+	"513",                             /* 513 */
920d6f
+	"514",                             /* 514 */
920d6f
+	"515",                             /* 515 */
920d6f
+	"516",                             /* 516 */
920d6f
+	"517",                             /* 517 */
920d6f
+	"518",                             /* 518 */
920d6f
+	"519",                             /* 519 */
920d6f
+	"520",                             /* 520 */
920d6f
+	"521",                             /* 521 */
920d6f
+	"522",                             /* 522 */
920d6f
+	"523",                             /* 523 */
920d6f
+	"524",                             /* 524 */
920d6f
+	"525",                             /* 525 */
920d6f
+	"526",                             /* 526 */
920d6f
+	"527",                             /* 527 */
920d6f
+	"528",                             /* 528 */
920d6f
+	"529",                             /* 529 */
920d6f
+	"530",                             /* 530 */
920d6f
+	"531",                             /* 531 */
920d6f
+	"532",                             /* 532 */
920d6f
+	"533",                             /* 533 */
920d6f
+	"534",                             /* 534 */
920d6f
+	"535",                             /* 535 */
920d6f
+	"536",                             /* 536 */
920d6f
+	"537",                             /* 537 */
920d6f
+	"538",                             /* 538 */
920d6f
+	"539",                             /* 539 */
920d6f
+	"540",                             /* 540 */
920d6f
+	"541",                             /* 541 */
920d6f
+	"542",                             /* 542 */
920d6f
+	"543",                             /* 543 */
920d6f
+	"544",                             /* 544 */
920d6f
+	"545",                             /* 545 */
920d6f
+	"546",                             /* 546 */
920d6f
+	"547",                             /* 547 */
920d6f
+	"548",                             /* 548 */
920d6f
+	"549",                             /* 549 */
920d6f
+	"550",                             /* 550 */
920d6f
+	"551",                             /* 551 */
920d6f
+	"552",                             /* 552 */
920d6f
+	"553",                             /* 553 */
920d6f
+	"554",                             /* 554 */
920d6f
+	"555",                             /* 555 */
920d6f
+	"556",                             /* 556 */
920d6f
+	"557",                             /* 557 */
920d6f
+	"558",                             /* 558 */
920d6f
+	"559",                             /* 559 */
920d6f
+	"560",                             /* 560 */
920d6f
+	"561",                             /* 561 */
920d6f
+	"562",                             /* 562 */
920d6f
+	"563",                             /* 563 */
920d6f
+	"564",                             /* 564 */
920d6f
+	"565",                             /* 565 */
920d6f
+	"566",                             /* 566 */
920d6f
+	"567",                             /* 567 */
920d6f
+	"568",                             /* 568 */
920d6f
+	"569",                             /* 569 */
920d6f
+	"570",                             /* 570 */
920d6f
+	"571",                             /* 571 */
920d6f
+	"572",                             /* 572 */
920d6f
+	"573",                             /* 573 */
920d6f
+	"574",                             /* 574 */
920d6f
+	"575",                             /* 575 */
920d6f
+	"576",                             /* 576 */
920d6f
+	"577",                             /* 577 */
920d6f
+	"578",                             /* 578 */
920d6f
+	"579",                             /* 579 */
920d6f
+	"580",                             /* 580 */
920d6f
+	"581",                             /* 581 */
920d6f
+	"582",                             /* 582 */
920d6f
+	"583",                             /* 583 */
920d6f
+	"584",                             /* 584 */
920d6f
+	"585",                             /* 585 */
920d6f
+	"586",                             /* 586 */
920d6f
+	"587",                             /* 587 */
920d6f
+	"588",                             /* 588 */
920d6f
+	"589",                             /* 589 */
920d6f
+	"590",                             /* 590 */
920d6f
+	"591",                             /* 591 */
920d6f
+	"592",                             /* 592 */
920d6f
+	"593",                             /* 593 */
920d6f
+	"594",                             /* 594 */
920d6f
+	"595",                             /* 595 */
920d6f
+	"596",                             /* 596 */
920d6f
+	"597",                             /* 597 */
920d6f
+	"598",                             /* 598 */
920d6f
+	"599",                             /* 599 */
920d6f
+	"600",                             /* 600 */
920d6f
+	"601",                             /* 601 */
920d6f
+	"602",                             /* 602 */
920d6f
+	"603",                             /* 603 */
920d6f
+	"604",                             /* 604 */
920d6f
+	"605",                             /* 605 */
920d6f
+	"606",                             /* 606 */
920d6f
+	"607",                             /* 607 */
920d6f
+	"608",                             /* 608 */
920d6f
+	"609",                             /* 609 */
920d6f
+	"610",                             /* 610 */
920d6f
+	"611",                             /* 611 */
920d6f
+	"612",                             /* 612 */
920d6f
+	"613",                             /* 613 */
920d6f
+	"614",                             /* 614 */
920d6f
+	"615",                             /* 615 */
920d6f
+	"616",                             /* 616 */
920d6f
+	"617",                             /* 617 */
920d6f
+	"618",                             /* 618 */
920d6f
+	"619",                             /* 619 */
920d6f
+	"620",                             /* 620 */
920d6f
+	"621",                             /* 621 */
920d6f
+	"622",                             /* 622 */
920d6f
+	"623",                             /* 623 */
920d6f
+	"624",                             /* 624 */
920d6f
+	"625",                             /* 625 */
920d6f
+	"626",                             /* 626 */
920d6f
+	"627",                             /* 627 */
920d6f
+	"628",                             /* 628 */
920d6f
+	"629",                             /* 629 */
920d6f
+	"630",                             /* 630 */
920d6f
+	"631",                             /* 631 */
920d6f
+	"632",                             /* 632 */
920d6f
+	"633",                             /* 633 */
920d6f
+	"634",                             /* 634 */
920d6f
+	"635",                             /* 635 */
920d6f
+	"636",                             /* 636 */
920d6f
+	"637",                             /* 637 */
920d6f
+	"638",                             /* 638 */
920d6f
+	"639",                             /* 639 */
920d6f
+	"640",                             /* 640 */
920d6f
+	"641",                             /* 641 */
920d6f
+	"642",                             /* 642 */
920d6f
+	"643",                             /* 643 */
920d6f
+	"644",                             /* 644 */
920d6f
+	"645",                             /* 645 */
920d6f
+	"646",                             /* 646 */
920d6f
+	"647",                             /* 647 */
920d6f
+	"648",                             /* 648 */
920d6f
+	"649",                             /* 649 */
920d6f
+	"650",                             /* 650 */
920d6f
+	"651",                             /* 651 */
920d6f
+	"652",                             /* 652 */
920d6f
+	"653",                             /* 653 */
920d6f
+	"654",                             /* 654 */
920d6f
+	"655",                             /* 655 */
920d6f
+	"656",                             /* 656 */
920d6f
+	"657",                             /* 657 */
920d6f
+	"658",                             /* 658 */
920d6f
+	"659",                             /* 659 */
920d6f
+	"660",                             /* 660 */
920d6f
+	"661",                             /* 661 */
920d6f
+	"662",                             /* 662 */
920d6f
+	"663",                             /* 663 */
920d6f
+	"664",                             /* 664 */
920d6f
+	"665",                             /* 665 */
920d6f
+	"666",                             /* 666 */
920d6f
+	"667",                             /* 667 */
920d6f
+	"668",                             /* 668 */
920d6f
+	"669",                             /* 669 */
920d6f
+	"670",                             /* 670 */
920d6f
+	"671",                             /* 671 */
920d6f
+	"672",                             /* 672 */
920d6f
+	"673",                             /* 673 */
920d6f
+	"674",                             /* 674 */
920d6f
+	"675",                             /* 675 */
920d6f
+	"676",                             /* 676 */
920d6f
+	"677",                             /* 677 */
920d6f
+	"678",                             /* 678 */
920d6f
+	"679",                             /* 679 */
920d6f
+	"680",                             /* 680 */
920d6f
+	"681",                             /* 681 */
920d6f
+	"682",                             /* 682 */
920d6f
+	"683",                             /* 683 */
920d6f
+	"684",                             /* 684 */
920d6f
+	"685",                             /* 685 */
920d6f
+	"686",                             /* 686 */
920d6f
+	"687",                             /* 687 */
920d6f
+	"688",                             /* 688 */
920d6f
+	"689",                             /* 689 */
920d6f
+	"690",                             /* 690 */
920d6f
+	"691",                             /* 691 */
920d6f
+	"692",                             /* 692 */
920d6f
+	"693",                             /* 693 */
920d6f
+	"694",                             /* 694 */
920d6f
+	"695",                             /* 695 */
920d6f
+	"696",                             /* 696 */
920d6f
+	"697",                             /* 697 */
920d6f
+	"698",                             /* 698 */
920d6f
+	"699",                             /* 699 */
920d6f
+	"700",                             /* 700 */
920d6f
+	"701",                             /* 701 */
920d6f
+	"702",                             /* 702 */
920d6f
+	"703",                             /* 703 */
920d6f
+	"704",                             /* 704 */
920d6f
+	"705",                             /* 705 */
920d6f
+	"706",                             /* 706 */
920d6f
+	"707",                             /* 707 */
920d6f
+	"708",                             /* 708 */
920d6f
+	"709",                             /* 709 */
920d6f
+	"710",                             /* 710 */
920d6f
+	"711",                             /* 711 */
920d6f
+	"712",                             /* 712 */
920d6f
+	"713",                             /* 713 */
920d6f
+	"714",                             /* 714 */
920d6f
+	"715",                             /* 715 */
920d6f
+	"716",                             /* 716 */
920d6f
+	"717",                             /* 717 */
920d6f
+	"718",                             /* 718 */
920d6f
+	"719",                             /* 719 */
920d6f
+	"720",                             /* 720 */
920d6f
+	"721",                             /* 721 */
920d6f
+	"722",                             /* 722 */
920d6f
+	"723",                             /* 723 */
920d6f
+	"724",                             /* 724 */
920d6f
+	"725",                             /* 725 */
920d6f
+	"726",                             /* 726 */
920d6f
+	"727",                             /* 727 */
920d6f
+	"728",                             /* 728 */
920d6f
+	"729",                             /* 729 */
920d6f
+	"730",                             /* 730 */
920d6f
+	"731",                             /* 731 */
920d6f
+	"732",                             /* 732 */
920d6f
+	"733",                             /* 733 */
920d6f
+	"734",                             /* 734 */
920d6f
+	"735",                             /* 735 */
920d6f
+	"736",                             /* 736 */
920d6f
+	"737",                             /* 737 */
920d6f
+	"738",                             /* 738 */
920d6f
+	"739",                             /* 739 */
920d6f
+	"740",                             /* 740 */
920d6f
+	"741",                             /* 741 */
920d6f
+	"742",                             /* 742 */
920d6f
+	"743",                             /* 743 */
920d6f
+	"744",                             /* 744 */
920d6f
+	"745",                             /* 745 */
920d6f
+	"746",                             /* 746 */
920d6f
+	"747",                             /* 747 */
920d6f
+	"748",                             /* 748 */
920d6f
+	"749",                             /* 749 */
920d6f
+	"750",                             /* 750 */
920d6f
+	"751",                             /* 751 */
920d6f
+	"752",                             /* 752 */
920d6f
+	"753",                             /* 753 */
920d6f
+	"754",                             /* 754 */
920d6f
+	"755",                             /* 755 */
920d6f
+	"756",                             /* 756 */
920d6f
+	"757",                             /* 757 */
920d6f
+	"758",                             /* 758 */
920d6f
+	"759",                             /* 759 */
920d6f
+	"760",                             /* 760 */
920d6f
+	"761",                             /* 761 */
920d6f
+	"762",                             /* 762 */
920d6f
+	"763",                             /* 763 */
920d6f
+	"764",                             /* 764 */
920d6f
+	"765",                             /* 765 */
920d6f
+	"766",                             /* 766 */
920d6f
+	"767",                             /* 767 */
920d6f
+	"768",                             /* 768 */
920d6f
+	"769",                             /* 769 */
920d6f
+	"770",                             /* 770 */
920d6f
+	"771",                             /* 771 */
920d6f
+	"772",                             /* 772 */
920d6f
+	"773",                             /* 773 */
920d6f
+	"774",                             /* 774 */
920d6f
+	"775",                             /* 775 */
920d6f
+	"776",                             /* 776 */
920d6f
+	"777",                             /* 777 */
920d6f
+	"778",                             /* 778 */
920d6f
+	"779",                             /* 779 */
920d6f
+	"780",                             /* 780 */
920d6f
+	"781",                             /* 781 */
920d6f
+	"782",                             /* 782 */
920d6f
+	"783",                             /* 783 */
920d6f
+	"784",                             /* 784 */
920d6f
+	"785",                             /* 785 */
920d6f
+	"786",                             /* 786 */
920d6f
+	"787",                             /* 787 */
920d6f
+	"788",                             /* 788 */
920d6f
+	"789",                             /* 789 */
920d6f
+	"790",                             /* 790 */
920d6f
+	"791",                             /* 791 */
920d6f
+	"792",                             /* 792 */
920d6f
+	"793",                             /* 793 */
920d6f
+	"794",                             /* 794 */
920d6f
+	"795",                             /* 795 */
920d6f
+	"796",                             /* 796 */
920d6f
+	"797",                             /* 797 */
920d6f
+	"798",                             /* 798 */
920d6f
+	"799",                             /* 799 */
920d6f
+	"800",                             /* 800 */
920d6f
+	"801",                             /* 801 */
920d6f
+	"802",                             /* 802 */
920d6f
+	"803",                             /* 803 */
920d6f
+	"804",                             /* 804 */
920d6f
+	"805",                             /* 805 */
920d6f
+	"806",                             /* 806 */
920d6f
+	"807",                             /* 807 */
920d6f
+	"808",                             /* 808 */
920d6f
+	"809",                             /* 809 */
920d6f
+	"810",                             /* 810 */
920d6f
+	"811",                             /* 811 */
920d6f
+	"812",                             /* 812 */
920d6f
+	"813",                             /* 813 */
920d6f
+	"814",                             /* 814 */
920d6f
+	"815",                             /* 815 */
920d6f
+	"816",                             /* 816 */
920d6f
+	"817",                             /* 817 */
920d6f
+	"818",                             /* 818 */
920d6f
+	"819",                             /* 819 */
920d6f
+	"820",                             /* 820 */
920d6f
+	"821",                             /* 821 */
920d6f
+	"822",                             /* 822 */
920d6f
+	"823",                             /* 823 */
920d6f
+	"824",                             /* 824 */
920d6f
+	"825",                             /* 825 */
920d6f
+	"826",                             /* 826 */
920d6f
+	"827",                             /* 827 */
920d6f
+	"828",                             /* 828 */
920d6f
+	"829",                             /* 829 */
920d6f
+	"830",                             /* 830 */
920d6f
+	"831",                             /* 831 */
920d6f
+	"832",                             /* 832 */
920d6f
+	"833",                             /* 833 */
920d6f
+	"834",                             /* 834 */
920d6f
+	"835",                             /* 835 */
920d6f
+	"836",                             /* 836 */
920d6f
+	"837",                             /* 837 */
920d6f
+	"838",                             /* 838 */
920d6f
+	"839",                             /* 839 */
920d6f
+	"840",                             /* 840 */
920d6f
+	"841",                             /* 841 */
920d6f
+	"842",                             /* 842 */
920d6f
+	"843",                             /* 843 */
920d6f
+	"844",                             /* 844 */
920d6f
+	"845",                             /* 845 */
920d6f
+	"846",                             /* 846 */
920d6f
+	"847",                             /* 847 */
920d6f
+	"848",                             /* 848 */
920d6f
+	"849",                             /* 849 */
920d6f
+	"850",                             /* 850 */
920d6f
+	"851",                             /* 851 */
920d6f
+	"852",                             /* 852 */
920d6f
+	"853",                             /* 853 */
920d6f
+	"854",                             /* 854 */
920d6f
+	"855",                             /* 855 */
920d6f
+	"856",                             /* 856 */
920d6f
+	"857",                             /* 857 */
920d6f
+	"858",                             /* 858 */
920d6f
+	"859",                             /* 859 */
920d6f
+	"860",                             /* 860 */
920d6f
+	"861",                             /* 861 */
920d6f
+	"862",                             /* 862 */
920d6f
+	"863",                             /* 863 */
920d6f
+	"864",                             /* 864 */
920d6f
+	"865",                             /* 865 */
920d6f
+	"866",                             /* 866 */
920d6f
+	"867",                             /* 867 */
920d6f
+	"868",                             /* 868 */
920d6f
+	"869",                             /* 869 */
920d6f
+	"870",                             /* 870 */
920d6f
+	"871",                             /* 871 */
920d6f
+	"872",                             /* 872 */
920d6f
+	"873",                             /* 873 */
920d6f
+	"874",                             /* 874 */
920d6f
+	"875",                             /* 875 */
920d6f
+	"876",                             /* 876 */
920d6f
+	"877",                             /* 877 */
920d6f
+	"878",                             /* 878 */
920d6f
+	"879",                             /* 879 */
920d6f
+	"880",                             /* 880 */
920d6f
+	"881",                             /* 881 */
920d6f
+	"882",                             /* 882 */
920d6f
+	"883",                             /* 883 */
920d6f
+	"884",                             /* 884 */
920d6f
+	"885",                             /* 885 */
920d6f
+	"886",                             /* 886 */
920d6f
+	"887",                             /* 887 */
920d6f
+	"888",                             /* 888 */
920d6f
+	"889",                             /* 889 */
920d6f
+	"890",                             /* 890 */
920d6f
+	"891",                             /* 891 */
920d6f
+	"892",                             /* 892 */
920d6f
+	"893",                             /* 893 */
920d6f
+	"894",                             /* 894 */
920d6f
+	"895",                             /* 895 */
920d6f
+	"896",                             /* 896 */
920d6f
+	"897",                             /* 897 */
920d6f
+	"898",                             /* 898 */
920d6f
+	"899",                             /* 899 */
920d6f
+	"900",                             /* 900 */
920d6f
+	"901",                             /* 901 */
920d6f
+	"902",                             /* 902 */
920d6f
+	"903",                             /* 903 */
920d6f
+	"904",                             /* 904 */
920d6f
+	"905",                             /* 905 */
920d6f
+	"906",                             /* 906 */
920d6f
+	"907",                             /* 907 */
920d6f
+	"908",                             /* 908 */
920d6f
+	"909",                             /* 909 */
920d6f
+	"910",                             /* 910 */
920d6f
+	"911",                             /* 911 */
920d6f
+	"912",                             /* 912 */
920d6f
+	"913",                             /* 913 */
920d6f
+	"914",                             /* 914 */
920d6f
+	"915",                             /* 915 */
920d6f
+	"916",                             /* 916 */
920d6f
+	"917",                             /* 917 */
920d6f
+	"918",                             /* 918 */
920d6f
+	"919",                             /* 919 */
920d6f
+	"920",                             /* 920 */
920d6f
+	"921",                             /* 921 */
920d6f
+	"922",                             /* 922 */
920d6f
+	"923",                             /* 923 */
920d6f
+	"924",                             /* 924 */
920d6f
+	"925",                             /* 925 */
920d6f
+	"926",                             /* 926 */
920d6f
+	"927",                             /* 927 */
920d6f
+	"928",                             /* 928 */
920d6f
+	"929",                             /* 929 */
920d6f
+	"930",                             /* 930 */
920d6f
+	"931",                             /* 931 */
920d6f
+	"932",                             /* 932 */
920d6f
+	"933",                             /* 933 */
920d6f
+	"934",                             /* 934 */
920d6f
+	"935",                             /* 935 */
920d6f
+	"936",                             /* 936 */
920d6f
+	"937",                             /* 937 */
920d6f
+	"938",                             /* 938 */
920d6f
+	"939",                             /* 939 */
920d6f
+	"940",                             /* 940 */
920d6f
+	"941",                             /* 941 */
920d6f
+	"942",                             /* 942 */
920d6f
+	"943",                             /* 943 */
920d6f
+	"944",                             /* 944 */
920d6f
+	"945",                             /* 945 */
920d6f
+	"946",                             /* 946 */
920d6f
+	"947",                             /* 947 */
920d6f
+	"948",                             /* 948 */
920d6f
+	"949",                             /* 949 */
920d6f
+	"950",                             /* 950 */
920d6f
+	"951",                             /* 951 */
920d6f
+	"952",                             /* 952 */
920d6f
+	"953",                             /* 953 */
920d6f
+	"954",                             /* 954 */
920d6f
+	"955",                             /* 955 */
920d6f
+	"956",                             /* 956 */
920d6f
+	"957",                             /* 957 */
920d6f
+	"958",                             /* 958 */
920d6f
+	"959",                             /* 959 */
920d6f
+	"960",                             /* 960 */
920d6f
+	"961",                             /* 961 */
920d6f
+	"962",                             /* 962 */
920d6f
+	"963",                             /* 963 */
920d6f
+	"964",                             /* 964 */
920d6f
+	"965",                             /* 965 */
920d6f
+	"966",                             /* 966 */
920d6f
+	"967",                             /* 967 */
920d6f
+	"968",                             /* 968 */
920d6f
+	"969",                             /* 969 */
920d6f
+	"970",                             /* 970 */
920d6f
+	"971",                             /* 971 */
920d6f
+	"972",                             /* 972 */
920d6f
+	"973",                             /* 973 */
920d6f
+	"974",                             /* 974 */
920d6f
+	"975",                             /* 975 */
920d6f
+	"976",                             /* 976 */
920d6f
+	"977",                             /* 977 */
920d6f
+	"978",                             /* 978 */
920d6f
+	"979",                             /* 979 */
920d6f
+	"980",                             /* 980 */
920d6f
+	"981",                             /* 981 */
920d6f
+	"982",                             /* 982 */
920d6f
+	"983",                             /* 983 */
920d6f
+	"984",                             /* 984 */
920d6f
+	"985",                             /* 985 */
920d6f
+	"986",                             /* 986 */
920d6f
+	"987",                             /* 987 */
920d6f
+	"988",                             /* 988 */
920d6f
+	"989",                             /* 989 */
920d6f
+	"990",                             /* 990 */
920d6f
+	"991",                             /* 991 */
920d6f
+	"992",                             /* 992 */
920d6f
+	"993",                             /* 993 */
920d6f
+	"994",                             /* 994 */
920d6f
+	"995",                             /* 995 */
920d6f
+	"996",                             /* 996 */
920d6f
+	"997",                             /* 997 */
920d6f
+	"998",                             /* 998 */
920d6f
+	"999",                             /* 999 */
920d6f
+	"1000",                            /* 1000 */
920d6f
+	"1001",                            /* 1001 */
920d6f
+	"1002",                            /* 1002 */
920d6f
+	"1003",                            /* 1003 */
920d6f
+	"1004",                            /* 1004 */
920d6f
+	"1005",                            /* 1005 */
920d6f
+	"1006",                            /* 1006 */
920d6f
+	"1007",                            /* 1007 */
920d6f
+	"1008",                            /* 1008 */
920d6f
+	"1009",                            /* 1009 */
920d6f
+	"1010",                            /* 1010 */
920d6f
+	"1011",                            /* 1011 */
920d6f
+	"1012",                            /* 1012 */
920d6f
+	"1013",                            /* 1013 */
920d6f
+	"1014",                            /* 1014 */
920d6f
+	"1015",                            /* 1015 */
920d6f
+	"1016",                            /* 1016 */
920d6f
+	"1017",                            /* 1017 */
920d6f
+	"1018",                            /* 1018 */
920d6f
+	"1019",                            /* 1019 */
920d6f
+	"1020",                            /* 1020 */
920d6f
+	"1021",                            /* 1021 */
920d6f
+	"1022",                            /* 1022 */
920d6f
+	"1023",                            /* 1023 */
920d6f
+	"open",                            /* 1024 */
920d6f
+	"link",                            /* 1025 */
920d6f
+	"unlink",                          /* 1026 */
920d6f
+	"mknod",                           /* 1027 */
920d6f
+	"chmod",                           /* 1028 */
920d6f
+	"chown",                           /* 1029 */
920d6f
+	"mkdir",                           /* 1030 */
920d6f
+	"rmdir",                           /* 1031 */
920d6f
+	"lchown",                          /* 1032 */
920d6f
+	"access",                          /* 1033 */
920d6f
+	"rename",                          /* 1034 */
920d6f
+	"readlink",                        /* 1035 */
920d6f
+	"symlink",                         /* 1036 */
920d6f
+	"utimes",                          /* 1037 */
920d6f
+	"stat",                            /* 1038 */
920d6f
+	"lstat",                           /* 1039 */
920d6f
+	"pipe",                            /* 1040 */
920d6f
+	"dup2",                            /* 1041 */
920d6f
+	"epoll_create",                    /* 1042 */
920d6f
+	"inotify_init",                    /* 1043 */
920d6f
+	"eventfd",                         /* 1044 */
920d6f
+	"signalfd",                        /* 1045 */
920d6f
+	"sendfile",                        /* 1046 */
920d6f
+	"ftruncate",                       /* 1047 */
920d6f
+	"truncate",                        /* 1048 */
920d6f
+	"stat",                            /* 1049 */
920d6f
+	"lstat",                           /* 1050 */
920d6f
+	"fstat",                           /* 1051 */
920d6f
+	"fcntl",                           /* 1052 */
920d6f
+	"fadvise64",                       /* 1053 */
920d6f
+	"newfstatat",                      /* 1054 */
920d6f
+	"fstatfs",                         /* 1055 */
920d6f
+	"statfs",                          /* 1056 */
920d6f
+	"lseek",                           /* 1057 */
920d6f
+	"mmap",                            /* 1058 */
920d6f
+	"alarm",                           /* 1059 */
920d6f
+	"getpgrp",                         /* 1060 */
920d6f
+	"pause",                           /* 1061 */
920d6f
+	"time",                            /* 1062 */
920d6f
+	"utime",                           /* 1063 */
920d6f
+	"creat",                           /* 1064 */
920d6f
+	"getdents",                        /* 1065 */
920d6f
+	"futimesat",                       /* 1066 */
920d6f
+	"select",                          /* 1067 */
920d6f
+	"poll",                            /* 1068 */
920d6f
+	"epoll_wait",                      /* 1069 */
920d6f
+	"ustat",                           /* 1070 */
920d6f
+	"vfork",                           /* 1071 */
920d6f
+	"oldwait4",                        /* 1072 */
920d6f
+	"recv",                            /* 1073 */
920d6f
+	"send",                            /* 1074 */
920d6f
+	"bdflush",                         /* 1075 */
920d6f
+	"umount",                          /* 1076 */
920d6f
+	"uselib",                          /* 1077 */
920d6f
+	"_sysctl",                         /* 1078 */
920d6f
+	"fork",                            /* 1079 */
920d6f
diff --git a/sysdeps/linux-gnu/aarch64/trace.c b/sysdeps/linux-gnu/aarch64/trace.c
920d6f
new file mode 100644
920d6f
index 0000000..5544b51
920d6f
--- /dev/null
920d6f
+++ b/sysdeps/linux-gnu/aarch64/trace.c
920d6f
@@ -0,0 +1,83 @@
920d6f
+/*
920d6f
+ * This file is part of ltrace.
920d6f
+ * Copyright (C) 2014 Petr Machata, Red Hat, Inc.
920d6f
+ *
920d6f
+ * This program is free software; you can redistribute it and/or
920d6f
+ * modify it under the terms of the GNU General Public License as
920d6f
+ * published by the Free Software Foundation; either version 2 of the
920d6f
+ * License, or (at your option) any later version.
920d6f
+ *
920d6f
+ * This program is distributed in the hope that it will be useful, but
920d6f
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+ * General Public License for more details.
920d6f
+ *
920d6f
+ * You should have received a copy of the GNU General Public License
920d6f
+ * along with this program; if not, write to the Free Software
920d6f
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+ * 02110-1301 USA
920d6f
+ */
920d6f
+
920d6f
+#include <sys/ptrace.h>
920d6f
+#include <sys/types.h>
920d6f
+#include <sys/wait.h>
920d6f
+#include <asm/ptrace.h>
920d6f
+#include <string.h>
920d6f
+#include <errno.h>
920d6f
+
920d6f
+#include "backend.h"
920d6f
+#include "proc.h"
920d6f
+
920d6f
+void
920d6f
+get_arch_dep(struct process *proc)
920d6f
+{
920d6f
+}
920d6f
+
920d6f
+int aarch64_read_gregs(struct process *proc, struct user_pt_regs *regs);
920d6f
+
920d6f
+/* The syscall instruction is:
920d6f
+ * | 31                   21 | 20    5 | 4       0 |
920d6f
+ * | 1 1 0 1 0 1 0 0 | 0 0 0 |  imm16  | 0 0 0 0 1 | */
920d6f
+#define SVC_MASK  0xffe0001f
920d6f
+#define SVC_VALUE 0xd4000001
920d6f
+
920d6f
+int
920d6f
+syscall_p(struct process *proc, int status, int *sysnum)
920d6f
+{
920d6f
+	if (WIFSTOPPED(status)
920d6f
+	    && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
920d6f
+
920d6f
+		struct user_pt_regs regs;
920d6f
+		if (aarch64_read_gregs(proc, &regs) < 0) {
920d6f
+			fprintf(stderr, "syscall_p: "
920d6f
+				"Couldn't read registers of %d.\n", proc->pid);
920d6f
+			return -1;
920d6f
+		}
920d6f
+
920d6f
+		errno = 0;
920d6f
+		unsigned long insn = (unsigned long) ptrace(PTRACE_PEEKTEXT,
920d6f
+							    proc->pid,
920d6f
+							    regs.pc - 4, 0);
920d6f
+		if (insn == -1UL && errno != 0) {
920d6f
+			fprintf(stderr, "syscall_p: "
920d6f
+				"Couldn't peek into %d: %s\n", proc->pid,
920d6f
+				strerror(errno));
920d6f
+			return -1;
920d6f
+		}
920d6f
+
920d6f
+		insn &= 0xffffffffUL;
920d6f
+		if ((insn & SVC_MASK) == SVC_VALUE) {
920d6f
+			*sysnum = regs.regs[8];
920d6f
+
920d6f
+			size_t d1 = proc->callstack_depth - 1;
920d6f
+			if (proc->callstack_depth > 0
920d6f
+			    && proc->callstack[d1].is_syscall
920d6f
+			    && proc->callstack[d1].c_un.syscall == *sysnum)
920d6f
+				return 2;
920d6f
+
920d6f
+			return 1;
920d6f
+		}
920d6f
+	}
920d6f
+
920d6f
+	return 0;
920d6f
+}
920d6f
diff --git a/testsuite/ltrace.main/system_call_params.exp b/testsuite/ltrace.main/system_call_params.exp
920d6f
index 787e342..2ccf840 100644
920d6f
--- a/testsuite/ltrace.main/system_call_params.exp
920d6f
+++ b/testsuite/ltrace.main/system_call_params.exp
920d6f
@@ -1,5 +1,5 @@
920d6f
 # This file is part of ltrace.
920d6f
-# Copyright (C) 2013 Petr Machata, Red Hat Inc.
920d6f
+# Copyright (C) 2013, 2014 Petr Machata, Red Hat Inc.
920d6f
 #
920d6f
 # This program is free software; you can redistribute it and/or
920d6f
 # modify it under the terms of the GNU General Public License as
920d6f
@@ -17,11 +17,25 @@
920d6f
 # 02110-1301 USA
920d6f
 
920d6f
 set bin [ltraceCompile {} [ltraceSource c {
920d6f
+    #define _GNU_SOURCE
920d6f
     #include <sys/types.h>
920d6f
     #include <sys/stat.h>
920d6f
     #include <fcntl.h>
920d6f
+    #include <unistd.h>
920d6f
+    #include <sys/syscall.h>   /* For SYS_xxx definitions */
920d6f
+
920d6f
+    #ifndef SYS_open
920d6f
+    # if defined(__aarch64__)
920d6f
+    #  /* Linux doesn't actually implement SYS_open on AArch64, but for merely
920d6f
+    #   * recording the syscall, it's fine.  */
920d6f
+    #  define SYS_open 1024
920d6f
+    # else
920d6f
+    #  error SYS_open not available.
920d6f
+    # endif
920d6f
+    #endif
920d6f
+
920d6f
     int main(void) {
920d6f
-	open("/some/path", O_RDONLY);
920d6f
+	syscall(SYS_open, "/some/path", O_RDONLY);
920d6f
 	write(1, "something", 10);
920d6f
 	mount("source", "target", "filesystemtype", 0, 0);
920d6f
     }
920d6f
diff --git a/testsuite/ltrace.main/system_calls.c b/testsuite/ltrace.main/system_calls.c
920d6f
deleted file mode 100644
920d6f
index 7be3d04..0000000
920d6f
--- a/testsuite/ltrace.main/system_calls.c
920d6f
+++ /dev/null
920d6f
@@ -1,68 +0,0 @@
920d6f
-/* Ltrace Test : system_calls.c.
920d6f
-   Objectives  : Verify that Ltrace can trace all the system calls in
920d6f
-   execution.
920d6f
-
920d6f
-   You can add new system calls in it and add its verification in 
920d6f
-   system_calls correspondingly.
920d6f
-
920d6f
-   This file was written by Yao Qi <qiyao@cn.ibm.com>. */
920d6f
-
920d6f
-#include <stdio.h>
920d6f
-#include <unistd.h>
920d6f
-#include <sys/syscall.h>
920d6f
-#include <sys/stat.h>
920d6f
-#include <errno.h>
920d6f
-
920d6f
-void exit (int);
920d6f
-
920d6f
-#define	BUF_SIZE	100
920d6f
-
920d6f
-int 
920d6f
-main ()
920d6f
-{
920d6f
-  FILE* fp;
920d6f
-  char s[]="system_calls";
920d6f
-  char buffer[BUF_SIZE];
920d6f
-  struct stat state;
920d6f
-  
920d6f
-  /*  SYS_open.  */
920d6f
-  fp = fopen ("system_calls.tmp", "w");
920d6f
-  if (fp == NULL)
920d6f
-    {
920d6f
-      printf("Can not create system_calls.tmp\n");
920d6f
-      exit (0);
920d6f
-    }
920d6f
-  /*  SYS_write.  */
920d6f
-  fwrite(s, sizeof(s), 1, fp);
920d6f
-  /*  SYS_lseek.  */
920d6f
-  fseek (fp, 0, SEEK_CUR);
920d6f
-  /*  SYS_read.  */
920d6f
-  fread(buffer, sizeof(s), 1, fp);
920d6f
-  /*  SYS_close.  */
920d6f
-  fclose(fp);
920d6f
-
920d6f
-  /*  SYS_getcwd.  */
920d6f
-  getcwd (buffer, BUF_SIZE);
920d6f
-  /*  SYS_chdir.  */
920d6f
-  chdir (".");
920d6f
-  /*  SYS_symlink.  */
920d6f
-  symlink ("system_calls.tmp", "system_calls.link");
920d6f
-  /*  SYS_unlink.  */
920d6f
-  remove("system_calls.link");
920d6f
-  /*  SYS_rename.  */
920d6f
-  rename ("system_calls.tmp", "system_calls.tmp1");
920d6f
-  /*  SYS_stat.  */
920d6f
-  stat ("system_calls.tmp", &state);
920d6f
-  /*  SYS_access.  */
920d6f
-  access ("system_calls.tmp", R_OK);
920d6f
-  remove("system_calls.tmp1");
920d6f
-  
920d6f
-  /*  SYS_mkdir.  */
920d6f
-  mkdir ("system_call_mkdir", 0777);
920d6f
-  /*  SYS_rmdir.  */
920d6f
-  rmdir ("system_call_mkdir");
920d6f
-  
920d6f
-  return 0;
920d6f
-}
920d6f
-
920d6f
-
920d6f
diff --git a/testsuite/ltrace.main/system_calls.exp b/testsuite/ltrace.main/system_calls.exp
920d6f
index a74fa04..f60e319 100644
920d6f
--- a/testsuite/ltrace.main/system_calls.exp
920d6f
+++ b/testsuite/ltrace.main/system_calls.exp
920d6f
@@ -1,67 +1,146 @@
920d6f
-# This file was written by Yao Qi <qiyao@cn.ibm.com>.
920d6f
+# This file is part of ltrace.
920d6f
+# Copyright (C) 2014 Petr Machata, Red Hat Inc.
920d6f
+# Copyright (C) 2006 Yao Qi <qiyao@cn.ibm.com>, IBM Corporation
920d6f
+#
920d6f
+# This program is free software; you can redistribute it and/or
920d6f
+# modify it under the terms of the GNU General Public License as
920d6f
+# published by the Free Software Foundation; either version 2 of the
920d6f
+# License, or (at your option) any later version.
920d6f
+#
920d6f
+# This program is distributed in the hope that it will be useful, but
920d6f
+# WITHOUT ANY WARRANTY; without even the implied warranty of
920d6f
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
920d6f
+# General Public License for more details.
920d6f
+#
920d6f
+# You should have received a copy of the GNU General Public License
920d6f
+# along with this program; if not, write to the Free Software
920d6f
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
920d6f
+# 02110-1301 USA
920d6f
 
920d6f
-set testfile "system_calls"
920d6f
-set srcfile ${testfile}.c
920d6f
-set binfile ${testfile}
920d6f
+# Objectives: Verify that Ltrace can trace all the system calls in
920d6f
+# execution.  Note that this test is necessarily noisy.  Dynamic
920d6f
+# linker adds a bunch of system calls of its own.
920d6f
 
920d6f
+set empty [ltraceCompile {} [ltraceSource c {
920d6f
+    int main (void) { return 0; }
920d6f
+}]]
920d6f
 
920d6f
-verbose "compiling source file now....."
920d6f
-# Build the shared libraries this test case needs.
920d6f
-if  { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${objdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
920d6f
-     send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
920d6f
+set bin [ltraceCompile {} [ltraceSource c {
920d6f
+    #include <stdio.h>
920d6f
+    #include <unistd.h>
920d6f
+    #include <sys/syscall.h>
920d6f
+    #include <sys/stat.h>
920d6f
+    #include <errno.h>
920d6f
+    #include <stdlib.h>
920d6f
+
920d6f
+    int
920d6f
+    main ()
920d6f
+    {
920d6f
+      FILE* fp;
920d6f
+      char s[]="system_calls";
920d6f
+      char buffer[1024];
920d6f
+      struct stat state;
920d6f
+
920d6f
+      fp = fopen ("system_calls.tmp", "w");
920d6f
+      if (fp == NULL)
920d6f
+	{
920d6f
+	  printf("Can not create system_calls.tmp\n");
920d6f
+	  exit (0);
920d6f
+	}
920d6f
+      fwrite(s, sizeof(s), 1, fp);
920d6f
+      fseek (fp, 0, SEEK_CUR);
920d6f
+      fread(buffer, sizeof(s), 1, fp);
920d6f
+      fclose(fp);
920d6f
+
920d6f
+      getcwd (buffer, sizeof buffer);
920d6f
+      chdir (".");
920d6f
+      symlink ("system_calls.tmp", "system_calls.link");
920d6f
+      remove("system_calls.link");
920d6f
+      rename ("system_calls.tmp", "system_calls.tmp1");
920d6f
+      stat ("system_calls.tmp", &state);
920d6f
+      access ("system_calls.tmp", R_OK);
920d6f
+      remove("system_calls.tmp1");
920d6f
+
920d6f
+      mkdir ("system_call_mkdir", 0777);
920d6f
+      rmdir ("system_call_mkdir");
920d6f
+
920d6f
+      return 0;
920d6f
+    }
920d6f
+}]]
920d6f
+
920d6f
+proc Calls {logfile} {
920d6f
+    set fp [open $logfile]
920d6f
+    set ret {}
920d6f
+
920d6f
+    while {[gets $fp line] >= 0} {
920d6f
+	if [regexp -- {^[a-zA-Z0-9]*@SYS} $line] {
920d6f
+	    set call [lindex [split $line @] 0]
920d6f
+	    dict incr ret $call
920d6f
+	}
920d6f
+    }
920d6f
+
920d6f
+    close $fp
920d6f
+    return $ret
920d6f
+}
920d6f
+
920d6f
+proc GetDefault {d key def} {
920d6f
+    if {[dict exists $d $key]} {
920d6f
+	return [dict get $d $key]
920d6f
+    } else {
920d6f
+	return $def
920d6f
+    }
920d6f
 }
920d6f
 
920d6f
-# set options for ltrace.
920d6f
-ltrace_options "-S"
920d6f
+proc Diff {d1 d2} {
920d6f
+    set keys [lsort -unique [concat [dict keys $d1] [dict keys $d2]]]
920d6f
+    set ret {}
920d6f
+    foreach key $keys {
920d6f
+	set n1 [GetDefault $d1 $key 0]
920d6f
+	set n2 [GetDefault $d2 $key 0]
920d6f
+	set sum [expr $n1 - $n2]
920d6f
+	if {[expr $sum != 0]} {
920d6f
+		dict set ret $key $sum
920d6f
+	}
920d6f
+    }
920d6f
+    return $ret
920d6f
+}
920d6f
+
920d6f
+proc Match {d patterns} {
920d6f
+    foreach line $patterns {
920d6f
+	set pattern [lindex $line 0]
920d6f
+	set op [lindex $line 1]
920d6f
+	set expect [lindex $line 2]
920d6f
 
920d6f
-#Run PUT for ltarce.
920d6f
-set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
920d6f
+	set count 0
920d6f
+	foreach key [dict keys $d] {
920d6f
+	    if [regexp -- $pattern $key] {
920d6f
+		incr count [dict get $d $key]
920d6f
+	    }
920d6f
+	}
920d6f
 
920d6f
-#check the output of this program.
920d6f
-verbose "ltrace runtest output: $exec_output\n"
920d6f
+	set msgMain "$pattern was recorded $count times"
920d6f
 
920d6f
-if [regexp {ELF from incompatible architecture} $exec_output] {
920d6f
-	fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
920d6f
-        return
920d6f
-} elseif [ regexp {Couldn't get .hash data} $exec_output ] {
920d6f
-	fail "Couldn't get .hash data!"
920d6f
-	return
920d6f
+	if {[eval expr $count $op $expect]} {
920d6f
+	    pass $msgMain
920d6f
+	} else {
920d6f
+	    fail "$msgMain, expected $op $expect"
920d6f
+	}
920d6f
+    }
920d6f
 }
920d6f
 
920d6f
+Match [Diff [Calls [ltraceRun -L -S -- $bin]] \
920d6f
+	   [Calls [ltraceRun -L -S -- $empty]]] {
920d6f
+    { {^write$} == 1 }
920d6f
+    { {^unlink(at)?$} >= 2 }
920d6f
+    { {^open(at)?$} == 1 }
920d6f
+    { {^(new|f)?stat(64)?$} == 1 }
920d6f
+    { {^close$} == 1 }
920d6f
+    { {^getcwd$} == 1 }
920d6f
+    { {^chdir$} == 1 }
920d6f
+    { {^symlink(at)?$} == 1 }
920d6f
+    { {^f?access(at)?$} == 1 }
920d6f
+    { {^rename(at)?$} == 1 }
920d6f
+    { {^mkdir(at)?$} == 1 }
920d6f
+}
920d6f
 
920d6f
-set pattern "^munmap@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 2
920d6f
-set pattern "^write@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^unlink@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-
920d6f
-set pattern "^brk@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^open@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^(new)?fstat(64)?@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
920d6f
-set pattern "^(old_)?mmap2?@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
920d6f
-set pattern "^close@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-
920d6f
-set pattern "^getcwd@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^chdir@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^symlink@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^unlink@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^(new)?stat(64)?@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
920d6f
-set pattern "^access@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^rename@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^mkdir@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
-set pattern "^rmdir@SYS"
920d6f
-ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
920d6f
+ltraceDone
920d6f
diff --git a/testsuite/ltrace.minor/trace-clone.c b/testsuite/ltrace.minor/trace-clone.c
920d6f
index db1936d..ded930c 100644
920d6f
--- a/testsuite/ltrace.minor/trace-clone.c
920d6f
+++ b/testsuite/ltrace.minor/trace-clone.c
920d6f
@@ -8,6 +8,7 @@
920d6f
 #include <sys/types.h>
920d6f
 #include <stdlib.h>
920d6f
 #include <sched.h>
920d6f
+#include <unistd.h>
920d6f
 
920d6f
 int child ()
920d6f
 {
920d6f
@@ -22,7 +23,8 @@ typedef int (* myfunc)();
920d6f
 int main ()
920d6f
 {
920d6f
   pid_t pid;
920d6f
-  static char stack[STACK_SIZE];
920d6f
+  static __attribute__ ((aligned (16))) char stack[STACK_SIZE];
920d6f
+
920d6f
 #ifdef __ia64__
920d6f
   pid = __clone2((myfunc)&child, stack, STACK_SIZE, CLONE_FS, NULL);
920d6f
 #else