aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2021-01-01 15:05:34 +0100
committerFabian Groffen <grobian@gentoo.org>2021-01-01 15:05:34 +0100
commit48ab29bc4227b69c55eb50190ecf73d569c114e9 (patch)
tree5d37d6cae8a9091a9e00cbdd705c7706f5c653a9
parentBUGS: update email addresses (diff)
downloadpax-utils-48ab29bc.tar.gz
pax-utils-48ab29bc.tar.bz2
pax-utils-48ab29bc.zip
{,pax}macho: add support for arm64 arch
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--macho.h3
-rw-r--r--paxmacho.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/macho.h b/macho.h
index 09caba1..7457473 100644
--- a/macho.h
+++ b/macho.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2012 Gentoo Foundation
+ * Copyright 2008-2021 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*/
@@ -128,6 +128,7 @@ struct mach_header_64
/* cputype */
#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
#define CPU_TYPE_X86_64 (CPU_TYPE_I386 | CPU_ARCH_ABI64)
+#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
struct load_command
{
diff --git a/paxmacho.c b/paxmacho.c
index 638453a..74f02da 100644
--- a/paxmacho.c
+++ b/paxmacho.c
@@ -1,10 +1,10 @@
/*
- * Copyright 2003-2012 Gentoo Foundation
+ * Copyright 2003-2021 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2005-2012 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2012 Mike Frysinger - <vapier@gentoo.org>
- * 2008-2012 Fabian Groffen - <grobian@gentoo.org>
+ * 2008-2021 Fabian Groffen - <grobian@gentoo.org>
*/
#include "paxinc.h"
@@ -17,6 +17,7 @@ static const char STR_PPC64[] = "ppc64";
static const char STR_I386[] = "i386";
static const char STR_X86_64[] = "x86_64";
static const char STR_ARM[] = "arm"; /* iPhone */
+static const char STR_ARM64[] = "arm64"; /* Apple M1 */
static const char STR_UNKNOWN[] = "unknown";
#define QUERY(n) { #n, n }
@@ -95,6 +96,7 @@ static pairtype macho_cputype[] = {
QUERY(CPU_TYPE_ARM),
QUERY(CPU_TYPE_POWERPC64),
QUERY(CPU_TYPE_X86_64),
+ QUERY(CPU_TYPE_ARM64),
{ 0, 0 }
};
const char *get_machocputype(fatobj *fobj)
@@ -383,6 +385,7 @@ const char *get_machomtype(fatobj *fobj)
case CPU_TYPE_ARM: return STR_ARM;
case CPU_TYPE_POWERPC64: return STR_PPC64;
case CPU_TYPE_X86_64: return STR_X86_64;
+ case CPU_TYPE_ARM64: return STR_ARM64;
default: return STR_UNKNOWN;
}
}