From 1740ba0cec44bdfe9cba586892a5953a4c602228 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 19 Mar 2015 15:37:43 +0000 Subject: Add support for G13 and G14 flag bits in RL78 ELF binaries. inc * rl78.h (E_FLAG_RL78_G10): Redefine. (E_FLAG_RL78_CPU_MASK, E_FLAG_RL78_ANY_CPU, E_FLAG_RL78_G13 E_FLAG_RL78_G14): New flags. bin * readelf.c (get_machine_flags): Decode RL78's G13 and G14 flags. gas * config/tc-rl78.c (enum options): Add G13 and G14. (md_longopts): Add -mg13 and -mg14. (md_parse_option): Handle -mg13 and -mg14. (md_show_usage): List -mg13 and -mg14. * doc/c-rl78.texi: Add description of -mg13 and -mg14 options. bfd * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of the RL78 core based upon the flags. (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14 flags. (rl78_elf_print_private_bfd_data): Use rl78_cpu_name. (elf32_rl78_machine): Always return bfd_mach_rl78. --- binutils/readelf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'binutils/readelf.c') diff --git a/binutils/readelf.c b/binutils/readelf.c index 20cfc47..adf2a91 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -3256,8 +3256,13 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) break; case EM_RL78: - if (e_flags & E_FLAG_RL78_G10) - strcat (buf, ", G10"); + switch (e_flags & E_FLAG_RL78_CPU_MASK) + { + case E_FLAG_RL78_ANY_CPU: break; + case E_FLAG_RL78_G10: strcat (buf, ", G10"); break; + case E_FLAG_RL78_G13: strcat (buf, ", G13"); break; + case E_FLAG_RL78_G14: strcat (buf, ", G14"); break; + } if (e_flags & E_FLAG_RL78_64BIT_DOUBLES) strcat (buf, ", 64-bit doubles"); break; -- cgit v1.1