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. --- gas/ChangeLog | 8 ++++++++ gas/config/tc-rl78.c | 19 +++++++++++++++++++ gas/doc/c-rl78.texi | 9 +++++++++ 3 files changed, 36 insertions(+) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 7bf7794f5db..fbf84896b46 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2015-03-19 Nick Clifton + + * 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. + 2015-03-18 Jon Turney Nick Clifton diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c index abc05a01b18..337b819b576 100644 --- a/gas/config/tc-rl78.c +++ b/gas/config/tc-rl78.c @@ -281,6 +281,8 @@ enum options { OPTION_RELAX = OPTION_MD_BASE, OPTION_G10, + OPTION_G13, + OPTION_G14, OPTION_32BIT_DOUBLES, OPTION_64BIT_DOUBLES, }; @@ -293,6 +295,9 @@ struct option md_longopts[] = { {"relax", no_argument, NULL, OPTION_RELAX}, {"mg10", no_argument, NULL, OPTION_G10}, + {"mg13", no_argument, NULL, OPTION_G13}, + {"mg14", no_argument, NULL, OPTION_G14}, + {"mrl78", no_argument, NULL, OPTION_G14}, {"m32bit-doubles", no_argument, NULL, OPTION_32BIT_DOUBLES}, {"m64bit-doubles", no_argument, NULL, OPTION_64BIT_DOUBLES}, {NULL, no_argument, NULL, 0} @@ -309,9 +314,20 @@ md_parse_option (int c, char * arg ATTRIBUTE_UNUSED) return 1; case OPTION_G10: + elf_flags &= ~ E_FLAG_RL78_CPU_MASK; elf_flags |= E_FLAG_RL78_G10; return 1; + case OPTION_G13: + elf_flags &= ~ E_FLAG_RL78_CPU_MASK; + elf_flags |= E_FLAG_RL78_G13; + return 1; + + case OPTION_G14: + elf_flags &= ~ E_FLAG_RL78_CPU_MASK; + elf_flags |= E_FLAG_RL78_G14; + return 1; + case OPTION_32BIT_DOUBLES: elf_flags &= ~ E_FLAG_RL78_64BIT_DOUBLES; return 1; @@ -328,6 +344,9 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED) { fprintf (stream, _(" RL78 specific command line options:\n")); fprintf (stream, _(" --mg10 Enable support for G10 variant\n")); + fprintf (stream, _(" --mg13 Selects the G13 core.\n")); + fprintf (stream, _(" --mg14 Selects the G14 core [default]\n")); + fprintf (stream, _(" --mrl78 Alias for --mg14\n")); fprintf (stream, _(" --m32bit-doubles [default]\n")); fprintf (stream, _(" --m64bit-doubles\n")); } diff --git a/gas/doc/c-rl78.texi b/gas/doc/c-rl78.texi index fee16f105b4..5cb568f3ec2 100644 --- a/gas/doc/c-rl78.texi +++ b/gas/doc/c-rl78.texi @@ -32,6 +32,15 @@ Enable support for link-time relaxation. Mark the generated binary as targeting the G10 variant of the RL78 architecture. +@item mg13 +Mark the generated binary as targeting the G13 variant of the RL78 +architecture. + +@item mg14 +@itemx mrl78 +Mark the generated binary as targeting the G14 variant of the RL78 +architecture. This is the default. + @item m32bit-doubles Mark the generated binary as one that uses 32-bits to hold the @code{double} floating point type. This is the default. -- cgit v1.2.1