Blame SOURCES/ltrace-0.7.91-aarch64.patch

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