Hexagon (linux-user/hexagon) Identify Hexagon version in ELF file

Return proper Hexagon CPU version from get_elf_cpu_model

Co-authored-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Co-authored-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
This commit is contained in:
Taylor Simpson
2026-02-17 14:22:39 -07:00
committed by Brian Cain
parent 031d8f4bc1
commit 910ce4de83

View File

@@ -10,23 +10,32 @@ const char *get_elf_cpu_model(uint32_t eflags)
static char buf[32];
int err;
/* For now, treat anything newer than v5 as a v73 */
/* FIXME - Disable instructions that are newer than the specified arch */
if (eflags == 0x04 || /* v5 */
eflags == 0x05 || /* v55 */
eflags == 0x60 || /* v60 */
eflags == 0x61 || /* v61 */
eflags == 0x62 || /* v62 */
eflags == 0x65 || /* v65 */
eflags == 0x66 || /* v66 */
eflags == 0x67 || /* v67 */
eflags == 0x8067 || /* v67t */
eflags == 0x68 || /* v68 */
eflags == 0x69 || /* v69 */
eflags == 0x71 || /* v71 */
eflags == 0x8071 || /* v71t */
eflags == 0x73 /* v73 */
) {
switch (eflags) {
case 0x04:
return "v5";
case 0x05:
return "v55";
case 0x60:
return "v60";
case 0x61:
return "v61";
case 0x62:
return "v62";
case 0x65:
return "v65";
case 0x66:
return "v66";
case 0x67:
case 0x8067: /* v67t */
return "v67";
case 0x68:
return "v68";
case 0x69:
return "v69";
case 0x71:
case 0x8071: /* v71t */
return "v71";
case 0x73:
return "v73";
}