]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* config/tc-m32c.h (H_TICK_HEX): Define.
authorDJ Delorie <dj@redhat.com>
Fri, 18 Jul 2008 22:25:07 +0000 (22:25 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 18 Jul 2008 22:25:07 +0000 (22:25 +0000)
* config/tc-m32c.c (OPTION_H_TICK_HEX): Define.
(md_longopts): Add support for it.
(md_parse_option): Likewise.
* doc/as.texinfo (Overview): Add new m32c options.
* doc/c-m32c.texi (M32C-Modifiers): Likewise

* as.h: (enable_h_tick_hex): New.
* app.c (enable_h_tick_hex): New.
(LEX_IS_H): New.
(do_scrub_begin): Mark 'H' and 'h' as special if enable_h_tick_hex.
(do_scrub_chars): If enable_h_tick_hex and 'h', check for H'00
style hex constants and convert the input stream to 0x00 style.
(do_scrub_chars): If a 'X style character constant is found after
a symbol character (like you're or X'00), warn the user.

gas/ChangeLog
gas/app.c
gas/as.h
gas/config/tc-m32c.c
gas/config/tc-m32c.h
gas/doc/as.texinfo
gas/doc/c-m32c.texi

index 447c152923d42b80cfbe9998125deafcda5f3089..85e5037215bf2f7b3f2050d5715d52dfcc63706f 100644 (file)
@@ -1,3 +1,21 @@
+2008-07-18  DJ Delorie  <dj@redhat.com>
+
+       * config/tc-m32c.h (H_TICK_HEX): Define.
+       * config/tc-m32c.c (OPTION_H_TICK_HEX): Define.
+       (md_longopts): Add support for it.
+       (md_parse_option): Likewise.
+       * doc/as.texinfo (Overview): Add new m32c options.
+       * doc/c-m32c.texi (M32C-Modifiers): Likewise
+
+       * as.h: (enable_h_tick_hex): New.
+       * app.c (enable_h_tick_hex): New.
+       (LEX_IS_H): New.
+       (do_scrub_begin): Mark 'H' and 'h' as special if enable_h_tick_hex.
+       (do_scrub_chars): If enable_h_tick_hex and 'h', check for H'00
+       style hex constants and convert the input stream to 0x00 style.
+       (do_scrub_chars): If a 'X style character constant is found after
+       a symbol character (like you're or X'00), warn the user.
+
 2008-07-10  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * config/tc-mips.c (mips16_mark_labels): Use ELF_ST_SET_MIPS16.
index 8884d9be821d4aab551e43dd932e0f30b0240c9c..6fa604fa831e63403765c1ae2a13f21019779c06 100644 (file)
--- a/gas/app.c
+++ b/gas/app.c
 #endif
 #endif
 
+#ifdef H_TICK_HEX
+int enable_h_tick_hex = 0;
+#endif
+
 #ifdef TC_M68K
 /* Whether we are scrubbing in m68k MRI mode.  This is different from
    flag_m68k_mri, because the two flags will be affected by the .mri
@@ -78,6 +82,9 @@ static const char symbol_chars[] =
 #define LEX_IS_DOUBLEBAR_1ST           13
 #endif
 #define LEX_IS_PARALLEL_SEPARATOR      14
+#ifdef H_TICK_HEX
+#define LEX_IS_H                       15
+#endif
 #define IS_SYMBOL_COMPONENT(c)         (lex[c] == LEX_IS_SYMBOL_COMPONENT)
 #define IS_WHITESPACE(c)               (lex[c] == LEX_IS_WHITESPACE)
 #define IS_LINE_SEPARATOR(c)           (lex[c] == LEX_IS_LINE_SEPARATOR)
@@ -190,6 +197,14 @@ do_scrub_begin (int m68k_mri ATTRIBUTE_UNUSED)
   /* Must do this is we want VLIW instruction with "->" or "<-".  */
   lex['-'] = LEX_IS_SYMBOL_COMPONENT;
 #endif
+
+#ifdef H_TICK_HEX
+  if (enable_h_tick_hex)
+    {
+      lex['h'] = LEX_IS_H;
+      lex['H'] = LEX_IS_H;
+    }
+#endif
 }
 
 /* Saved state of the scrubber.  */
@@ -1009,6 +1024,14 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
 
 #ifndef IEEE_STYLE
        case LEX_IS_ONECHAR_QUOTE:
+         if (state == 9)
+           {
+             char c;
+
+             c = GET ();
+             as_warn ("'%c found after symbol", c);
+             UNGET (c);
+           }
          if (state == 10)
            {
              /* Preserve the whitespace in foo 'b'.  */
@@ -1254,6 +1277,26 @@ do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
          PUT ('\n');
          break;
 
+#ifdef H_TICK_HEX
+       case LEX_IS_H:
+         /* Look for strings like H'[0-9A-Fa-f] and if found, replace
+            the H' with 0x to make them gas-style hex characters.  */
+         if (enable_h_tick_hex)
+           {
+             char quot;
+
+             quot = GET ();
+             if (quot == '\'')
+               {
+                 UNGET ('x');
+                 ch = '0';
+               }
+             else
+               UNGET (quot);
+           }
+         /* FALL THROUGH */
+#endif
+
        case LEX_IS_SYMBOL_COMPONENT:
          if (state == 10)
            {
index 56c7d2ef86b134939ad77bcd53d4a14fb4e80d9b..35162fe810eea537a6276a77d0488c26c2b92069 100644 (file)
--- a/gas/as.h
+++ b/gas/as.h
@@ -615,6 +615,10 @@ int generic_force_reloc (struct fix *);
 #endif
 #include "listing.h"
 
+#ifdef H_TICK_HEX
+extern int enable_h_tick_hex;
+#endif
+
 #ifdef TC_M68K
 /* True if we are assembling in m68k MRI mode.  */
 COMMON int flag_m68k_mri;
index 2d13a6661c2f8b43c085fa3aed46b2a2a7cdcf72..615bcc58c07880761af0dd29dd2e5d3242d08bb7 100644 (file)
@@ -68,12 +68,14 @@ const char * md_shortopts = M32C_SHORTOPTS;
 #define OPTION_CPU_M16C               (OPTION_MD_BASE)
 #define OPTION_CPU_M32C        (OPTION_MD_BASE + 1)
 #define OPTION_LINKRELAX       (OPTION_MD_BASE + 2)
+#define OPTION_H_TICK_HEX      (OPTION_MD_BASE + 3)
 
 struct option md_longopts[] =
 {
   { "m16c",       no_argument,       NULL, OPTION_CPU_M16C   },
   { "m32c",       no_argument,       NULL, OPTION_CPU_M32C   },
   { "relax",      no_argument,       NULL, OPTION_LINKRELAX   },
+  { "h-tick-hex", no_argument,       NULL, OPTION_H_TICK_HEX  },
   {NULL, no_argument, NULL, 0}
 };
 size_t md_longopts_size = sizeof (md_longopts);
@@ -125,6 +127,10 @@ md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
       m32c_relax = 1;
       break;
 
+    case OPTION_H_TICK_HEX:
+      enable_h_tick_hex = 1;
+      break;
+
     default:
       return 0;
     }
index 42e0a2768bb0f08b22fbc2d6835148fad8164873..8fb0355d34bd55f87be1f8a4f706fb28cd32f10a 100644 (file)
@@ -86,3 +86,5 @@ extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
 #define TC_START_LABEL(character, i_l_p)                       \
   ((character) != ':' ? 0 : (character = m32c_is_colon_insn (s)) ? 0 : ((character = ':'), 1))
 extern char m32c_is_colon_insn PARAMS ((char *));
+
+#define H_TICK_HEX 1
index fbbfa21f113852ab86c19c2d013063dab7b2effb..165eca7cc05aac10960c4b21fa835098905b96a6 100644 (file)
@@ -331,7 +331,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
 @ifset M32C
 
 @emph{Target M32C options:}
-   [@b{-m32c}|@b{-m16c}]
+   [@b{-m32c}|@b{-m16c}] [-relax] [-h-tick-hex]
 @end ifset
 @ifset M32R
 
@@ -765,6 +765,12 @@ Assemble M32C instructions.
 @item -m16c
 Assemble M16C instructions (the default).
 
+@item -relax
+Enable support for link-time relaxations.
+
+@item -h-tick-hex
+Support H'00 style hex constants in addition to 0x00 style.
+
 @end table
 @end ifset
 
index a49fe20b9d4ebede5df65adac8e5b2df00443b3c..026f6a2fba618caf0e90c8b9b02a85fc1b12f44b 100644 (file)
@@ -45,6 +45,13 @@ Assemble M32C instructions.
 @cindex architecture options, M16C
 @cindex M16C architecture option
 Assemble M16C instructions (default).
+
+@item -relax
+Enable support for link-time relaxations.
+
+@item -h-tick-hex
+Support H'00 style hex constants in addition to 0x00 style.
+
  
 @end table