aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2021-06-04 14:36:17 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2022-03-04 16:43:24 -0500
commit25af2eb5e39b5d54703d4489182a6b9d0af58b76 (patch)
treeaf7aa17ffc248061321975bbaac59fb3cd37e184
parent4b8fc118774a3dfce41cd21fea3e7cda6bbd0a47 (diff)
downloadsbsigntools-25af2eb5e39b5d54703d4489182a6b9d0af58b76.tar.gz
sbsigntool: add support for RISC-V 64-bit PE/COFF imagesnext
Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--configure.ac2
-rw-r--r--src/coff/pe.h1
-rw-r--r--src/image.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 4ffb68f..23dbc54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,7 +65,7 @@ PKG_CHECK_MODULES(uuid, uuid,
dnl gnu-efi headers require extra include dirs
EFI_ARCH=$(uname -m | sed 's/i.86/ia32/;s/arm.*/arm/')
-AM_CONDITIONAL(TEST_BINARY_FORMAT, [ test "$EFI_ARCH" = "arm" -o "$EFI_ARCH" = "aarch64" ])
+AM_CONDITIONAL(TEST_BINARY_FORMAT, [ test "$EFI_ARCH" = "arm" -o "$EFI_ARCH" = "aarch64" -o "$EFI_ARCH" = riscv64 ])
##
# no consistent view of where gnu-efi should dump the efi stuff, so find it
diff --git a/src/coff/pe.h b/src/coff/pe.h
index 0d1036e..198f23d 100644
--- a/src/coff/pe.h
+++ b/src/coff/pe.h
@@ -152,6 +152,7 @@
#define IMAGE_FILE_MACHINE_TRICORE 0x0520
#define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169
#define IMAGE_FILE_MACHINE_AARCH64 0xaa64
+#define IMAGE_FILE_MACHINE_RISCV64 0x5064
#define IMAGE_SUBSYSTEM_UNKNOWN 0
#define IMAGE_SUBSYSTEM_NATIVE 1
diff --git a/src/image.c b/src/image.c
index 3ada37b..a828b5a 100644
--- a/src/image.c
+++ b/src/image.c
@@ -239,6 +239,7 @@ static int image_pecoff_parse(struct image *image)
switch (magic) {
case IMAGE_FILE_MACHINE_AMD64:
case IMAGE_FILE_MACHINE_AARCH64:
+ case IMAGE_FILE_MACHINE_RISCV64:
rc = image_pecoff_parse_64(image);
break;
case IMAGE_FILE_MACHINE_I386: