[2/2] Hexagon: implement machine flag check
Commit Message
This fixes the "invalid machine flag" error from eu-elflint when passing
hexagon binaries.
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
---
backends/hexagon_init.c | 1 +
backends/hexagon_symbol.c | 8 ++++++++
2 files changed, 9 insertions(+)
@@ -45,6 +45,7 @@ hexagon_init (Elf *elf __attribute__ ((unused)),
{
hexagon_init_reloc (eh);
HOOK (eh, reloc_simple_type);
+ HOOK (eh, machine_flag_check);
return eh;
}
@@ -56,3 +56,11 @@ hexagon_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
return ELF_T_NUM;
}
}
+
+bool
+hexagon_machine_flag_check (GElf_Word flags)
+{
+ GElf_Word arch_variant = flags &~ EF_HEXAGON_MACH;
+ /* 0x8000 covers the "tiny core" arch variants. */
+ return arch_variant == 0 || arch_variant == 0x8000;
+}