Blame SOURCES/ltrace-0.7.91-aarch64.patch

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