Skip to content

Commit 912a0f7

Browse files
author
Petr Machata
committed
Implement aarch64 support
- IFUNC support is not implemented, the rest works well. The only other failure is in wide char functions, and that occurs on x86_64 as well.
1 parent 0b5457a commit 912a0f7

File tree

11 files changed

+1857
-2
lines changed

11 files changed

+1857
-2
lines changed

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- Autoconf -*-
22
# This file is part of ltrace.
3-
# Copyright (C) 2010,2012,2013 Petr Machata, Red Hat Inc.
3+
# Copyright (C) 2010,2012,2013,2014 Petr Machata, Red Hat Inc.
44
# Copyright (C) 2010,2011 Joe Damato
55
# Copyright (C) 2010 Marc Kleine-Budde
66
# Copyright (C) 2010 Zachary T Welch
@@ -399,6 +399,7 @@ AC_CONFIG_FILES([
399399
Makefile
400400
sysdeps/Makefile
401401
sysdeps/linux-gnu/Makefile
402+
sysdeps/linux-gnu/aarch64/Makefile
402403
sysdeps/linux-gnu/alpha/Makefile
403404
sysdeps/linux-gnu/arm/Makefile
404405
sysdeps/linux-gnu/cris/Makefile

sysdeps/linux-gnu/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This file is part of ltrace.
2+
# Copyright (C) 2014 Petr Machata, Red Hat, Inc.
23
# Copyright (C) 2010,2012 Marc Kleine-Budde, Pengutronix
34
#
45
# This program is free software; you can redistribute it and/or
@@ -16,7 +17,8 @@
1617
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
1718
# 02110-1301 USA
1819

19-
DIST_SUBDIRS = alpha arm cris ia64 m68k metag mips ppc s390 sparc x86
20+
DIST_SUBDIRS = aarch64 alpha arm cris ia64 m68k metag mips ppc s390 \
21+
sparc x86
2022

2123
SUBDIRS = \
2224
$(HOST_CPU)

sysdeps/linux-gnu/aarch64/Makefile.am

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is part of ltrace.
2+
# Copyright (C) 2014 Petr Machata, Red Hat, Inc.
3+
#
4+
# This program is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU General Public License as
6+
# published by the Free Software Foundation; either version 2 of the
7+
# License, or (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17+
# 02110-1301 USA
18+
19+
noinst_LTLIBRARIES = ../libcpu.la
20+
21+
___libcpu_la_SOURCES = fetch.c plt.c regs.c trace.c
22+
23+
noinst_HEADERS = arch.h ptrace.h signalent.h syscallent.h
24+
25+
MAINTAINERCLEANFILES = Makefile.in

sysdeps/linux-gnu/aarch64/arch.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of ltrace.
3+
* Copyright (C) 2014 Petr Machata, Red Hat, Inc.
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License as
7+
* published by the Free Software Foundation; either version 2 of the
8+
* License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but
11+
* WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18+
* 02110-1301 USA
19+
*/
20+
#ifndef LTRACE_AARCH64_ARCH_H
21+
#define LTRACE_AARCH64_ARCH_H
22+
23+
/* | 31 21 | 20 5 | 4 0 | *
24+
* | 1 1 0 1 0 1 0 0 0 0 1 | imm16 | 0 0 0 0 0 | */
25+
#define BREAKPOINT_VALUE { 0xd4, 0x20, 0, 0 }
26+
#define BREAKPOINT_LENGTH 4
27+
#define DECR_PC_AFTER_BREAK 0
28+
29+
#define LT_ELFCLASS ELFCLASS64
30+
#define LT_ELF_MACHINE EM_AARCH64
31+
32+
#define ARCH_HAVE_FETCH_ARG
33+
#define ARCH_ENDIAN_BIG
34+
#define ARCH_HAVE_SIZEOF
35+
#define ARCH_HAVE_ALIGNOF
36+
37+
#endif /* LTRACE_AARCH64_ARCH_H */

0 commit comments

Comments
 (0)