[COMMITTED] backends: Fix arm_machine_flag_name version string.
Commit Message
arm_machine_flag_name checks the version byte and if not zero returns
a version string. There are only 5 versions defined. So check the
version byte is not larger.
* backends/arm_machineflagname.c (arm_machine_flag_name):
Check version <= 0, otherwise return NULL.
https://sourceware.org/bugzilla/show_bug.cgi?id=31058
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
backends/arm_machineflagname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -48,7 +48,7 @@ arm_machine_flag_name (Elf64_Word orig, Elf64_Word *flagref)
"Version5 EABI",
};
*flagref &= ~((Elf64_Word) EF_ARM_EABIMASK);
- return vername[version - 1];
+ return version <= 5 ? vername[version - 1] : NULL;
}
switch (EF_ARM_EABI_VERSION (orig))
{