diff options
author | 2022-07-14 18:09:41 -0700 | |
---|---|---|
committer | 2022-10-31 15:20:41 +0000 | |
commit | ebc548c64cb78d9878cb0bff00608aedf016c38f (patch) | |
tree | 7da7014a1bae8a5f7061440b8366e68d72ddab83 /libartbase/arch/instruction_set.cc | |
parent | 99835538abb76c96087a4fa4ab76a0bb9f54bb94 (diff) |
Add minimal riscv64 elf support to allow create_minidebuginfo on riscv64 binaries
This adds support for riscv64 elf files so that create_minidebuginfo
can be used strip riscv64 binaries.
Test: m create_minidebuginfo
Change-Id: I0cb0348d46ffb216af2f5c61701406504fae3b22
Diffstat (limited to 'libartbase/arch/instruction_set.cc')
-rw-r--r-- | libartbase/arch/instruction_set.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libartbase/arch/instruction_set.cc b/libartbase/arch/instruction_set.cc index 7f1e4c7dd7..811e723e0e 100644 --- a/libartbase/arch/instruction_set.cc +++ b/libartbase/arch/instruction_set.cc @@ -29,6 +29,7 @@ void InstructionSetAbort(InstructionSet isa) { case InstructionSet::kArm: case InstructionSet::kThumb2: case InstructionSet::kArm64: + case InstructionSet::kRiscv64: case InstructionSet::kX86: case InstructionSet::kX86_64: case InstructionSet::kNone: @@ -46,6 +47,8 @@ const char* GetInstructionSetString(InstructionSet isa) { return "arm"; case InstructionSet::kArm64: return "arm64"; + case InstructionSet::kRiscv64: + return "riscv64"; case InstructionSet::kX86: return "x86"; case InstructionSet::kX86_64: @@ -64,6 +67,8 @@ InstructionSet GetInstructionSetFromString(const char* isa_str) { return InstructionSet::kArm; } else if (strcmp("arm64", isa_str) == 0) { return InstructionSet::kArm64; + } else if (strcmp("riscv64", isa_str) == 0) { + return InstructionSet::kRiscv64; } else if (strcmp("x86", isa_str) == 0) { return InstructionSet::kX86; } else if (strcmp("x86_64", isa_str) == 0) { @@ -93,6 +98,8 @@ std::vector<InstructionSet> GetSupportedInstructionSets(std::string* error_msg) *error_msg = android::base::StringPrintf("Unknown Zygote kinds '%s'", zygote_kinds.c_str()); return {}; } + case InstructionSet::kRiscv64: + return {InstructionSet::kRiscv64}; case InstructionSet::kX86: case InstructionSet::kX86_64: if (zygote_kinds == "zygote64_32" || zygote_kinds == "zygote32_64") { |