diff options
author | Furquan Shaikh <furquan@google.com> | 2014-08-26 15:21:15 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-21 08:41:10 +0100 |
commit | d2338bad95b9ea304136c4491e31dd5fa6f5aa07 (patch) | |
tree | fb37670b780345140f28924bde2342d169fe6996 | |
parent | 91e9f676b779f3fc85efd0a5cac01a17cc66e01f (diff) | |
download | coreboot-d2338bad95b9ea304136c4491e31dd5fa6f5aa07.tar.xz |
rmodtool: Add support for aarch64
BUG=chrome-os-partner:31615
BRANCH=None
TEST=Compiles succesfully, rmodule created and loaded for ryu
Change-Id: Icc80b845fe43a012665d77c3ef55bd30784fd3fc
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 24ad4383a9ea75ba6beb084451b74e8a8735085b
Original-Change-Id: I4f3a5dbb8fc8150aa670d2e6fed56a6774feb4a6
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/214329
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Queue: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8806
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r-- | util/cbfstool/rmodule.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/util/cbfstool/rmodule.c b/util/cbfstool/rmodule.c index 1c8aea7052..c3b0f9b7ee 100644 --- a/util/cbfstool/rmodule.c +++ b/util/cbfstool/rmodule.c @@ -104,6 +104,31 @@ static int should_emit_arm(struct rmod_context *ctx, Elf64_Rela *rel) return (type == R_ARM_ABS32); } +static int valid_reloc_aarch64(struct rmod_context *ctx, Elf64_Rela *rel) +{ + int type; + + type = ELF64_R_TYPE(rel->r_info); + + return (type == R_AARCH64_ADR_PREL_PG_HI21 || + type == R_AARCH64_ADD_ABS_LO12_NC || + type == R_AARCH64_JUMP26 || + type == R_AARCH64_LDST32_ABS_LO12_NC || + type == R_AARCH64_CALL26 || + type == R_AARCH64_ABS64 || + type == R_AARCH64_LD_PREL_LO19 || + type == R_AARCH64_ADR_PREL_LO21); +} + +static int should_emit_aarch64(struct rmod_context *ctx, Elf64_Rela *rel) +{ + int type; + + type = ELF64_R_TYPE(rel->r_info); + + return (type == R_AARCH64_ABS64); +} + static struct arch_ops reloc_ops[] = { { .arch = EM_386, @@ -115,6 +140,11 @@ static struct arch_ops reloc_ops[] = { .valid_type = valid_reloc_arm, .should_emit = should_emit_arm, }, + { + .arch = EM_AARCH64, + .valid_type = valid_reloc_aarch64, + .should_emit = should_emit_aarch64, + }, }; /* |