Blame SOURCES/ltrace-0.7.91-aarch64.patch

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