summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs-mkstage.c
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2018-11-26 15:37:51 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-12-19 06:06:49 +0000
commit21046a33ef7d46e13f7ea3e4b7fae7aead499d14 (patch)
treebc6b9893304c97882ccbd9c062008acdb8d4ccaf /util/cbfstool/cbfs-mkstage.c
parent565bebe0b3c506b978ad5c9a66cb67ebe0ac6329 (diff)
downloadcoreboot-21046a33ef7d46e13f7ea3e4b7fae7aead499d14.tar.xz
util/cbfstool/cbfs-mkstage: Support x86_64
Add support for relocations on x86_64. Required for 64bit romstage. Change-Id: I1ff223d3476776297b501813a953356dd6fa9d67 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/c/30115 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'util/cbfstool/cbfs-mkstage.c')
-rw-r--r--util/cbfstool/cbfs-mkstage.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/util/cbfstool/cbfs-mkstage.c b/util/cbfstool/cbfs-mkstage.c
index 85c3e4f8b9..6071437d05 100644
--- a/util/cbfstool/cbfs-mkstage.c
+++ b/util/cbfstool/cbfs-mkstage.c
@@ -362,7 +362,9 @@ static int rmod_filter(struct reloc_filter *f, const Elf64_Rela *r)
/* If there is any relocation to the ignored section that isn't
* absolute fail as current assumptions are that all relocations
* are absolute. */
- if (reloc_type != R_386_32) {
+ if ((reloc_type != R_386_32) &&
+ (reloc_type != R_AMD64_64) &&
+ (reloc_type != R_AMD64_32)) {
ERROR("Invalid reloc to ignored section: %x\n", reloc_type);
return -1;
}
@@ -392,9 +394,10 @@ int parse_elf_to_xip_stage(const struct buffer *input, struct buffer *output,
if (rmodule_init(rmodctx, input))
return -1;
- /* Only support x86 XIP currently. */
- if (rmodctx->pelf.ehdr.e_machine != EM_386) {
- ERROR("Only support XIP stages for x86\n");
+ /* Only support x86 / x86_64 XIP currently. */
+ if ((rmodctx->pelf.ehdr.e_machine != EM_386) &&
+ (rmodctx->pelf.ehdr.e_machine != EM_X86_64)) {
+ ERROR("Only support XIP stages for x86/x86_64\n");
goto out;
}