Blame SOURCES/ltrace-0.7.91-aarch64.patch

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