From 9dbf2073189dec38c666f538d33bde15a5251a01 Mon Sep 17 00:00:00 2001 From: Sahil Siddiq Date: Wed, 6 Mar 2024 01:42:13 +0530 Subject: [PATCH] ARM: Get arch name --- librz/bin/format/elf/elf_info.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/librz/bin/format/elf/elf_info.c b/librz/bin/format/elf/elf_info.c index 5ef0682c52e..aa4095c861b 100644 --- a/librz/bin/format/elf/elf_info.c +++ b/librz/bin/format/elf/elf_info.c @@ -892,14 +892,12 @@ static char *read_arm_build_attributes(char *ptr, ut32 bytes_to_read, bool isbig rz_uleb128_decode((ut8 *)ptr, &len, &cpu_arch); ptr += len; bytes_to_read -= len; - switch (cpu_arch) { - case ARM_VER_V8_A: - case ARM_VER_V8_1_A: - case ARM_VER_V8_2_A: - case ARM_VER_V8_3_A: - case ARM_VER_V9_A: - break; + for (size_t i = 0; i < RZ_ARRAY_SIZE(cpu_arm_translation_table); i++) { + if (cpu_arch == cpu_arm_translation_table[i].arch) { + return strdup(cpu_arm_translation_table[i].name); + } } + break; } case TAG_CPU_ARCH_PROFILE: return strdup("Tag_CPU_ARCH_PROFILE");