From 67b74d3dc98a773c3d82b141af178b13e9bb6c06 Mon Sep 17 00:00:00 2001 From: Marcelo Povoa Date: Thu, 6 Feb 2014 15:17:33 -0800 Subject: [PATCH] aarch64: Add ELF support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG=None BRANCH=none TEST=Build coreboot Signed-off-by: Marcelo Povoa Change-Id: I38684794fdf5bd95a32f157128434a13f5e2a2d5 Reviewed-on: https://chromium-review.googlesource.com/185271 Reviewed-by: Stefan Reinauer Reviewed-by: David Hendricks Tested-by: Marcelo Póvoa Commit-Queue: Marcelo Póvoa --- util/cbfstool/elf.h | 2 ++ util/cbfstool/elfheaders.c | 1 + 2 files changed, 3 insertions(+) diff --git a/util/cbfstool/elf.h b/util/cbfstool/elf.h index 01af81988a..65898b4440 100644 --- a/util/cbfstool/elf.h +++ b/util/cbfstool/elf.h @@ -244,6 +244,8 @@ typedef struct #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ #define EM_NUM 95 +#define EM_AARCH64 183 /* ARM Aarch64 Architecture */ + /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision with official or non-GNU unofficial values. */ diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c index cb3611219c..dd047f24df 100644 --- a/util/cbfstool/elfheaders.c +++ b/util/cbfstool/elfheaders.c @@ -273,6 +273,7 @@ elf_headers(const struct buffer *pinput, // The tool may work in architecture-independent way. if (arch != CBFS_ARCHITECTURE_UNKNOWN && + !((ehdr->e_machine == EM_AARCH64) && (arch == CBFS_ARCHITECTURE_AARCH64)) && !((ehdr->e_machine == EM_ARM) && (arch == CBFS_ARCHITECTURE_ARM)) && !((ehdr->e_machine == EM_386) && (arch == CBFS_ARCHITECTURE_X86))) { ERROR("The stage file has the wrong architecture\n");