* read.c (emit_expr_fix): Handle size 3.
[deliverable/binutils-gdb.git] / gas / read.c
index db0cc8761516ded2cfcf6c93eeb9053017562f86..5a384a655d2eb48e04a2169333c21b80cd6b8b28 100644 (file)
@@ -1,6 +1,6 @@
 /* read.c - read a source file -
    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -42,7 +42,7 @@
 #include "dw2gencfi.h"
 
 #ifndef TC_START_LABEL
-#define TC_START_LABEL(x,y) (x == ':')
+#define TC_START_LABEL(x,y,z) (x == ':')
 #endif
 
 /* Set by the object-format or the target.  */
@@ -125,7 +125,8 @@ char lex_type[256] = {
 };
 
 /* In: a character.
-   Out: 1 if this character ends a line.  */
+   Out: 1 if this character ends a line.
+       2 if this character is a line separator.  */
 char is_end_of_line[256] = {
 #ifdef CR_EOL
   1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,      /* @abcdefghijklmno */
@@ -239,7 +240,7 @@ read_begin (void)
 
   /* Use machine dependent syntax.  */
   for (p = line_separator_chars; *p; p++)
-    is_end_of_line[(unsigned char) *p] = 1;
+    is_end_of_line[(unsigned char) *p] = 2;
   /* Use more.  FIXME-SOMEDAY.  */
 
   if (flag_mri)
@@ -759,7 +760,7 @@ read_a_source_file (char *name)
                 S points to the beginning of the symbol.
                   [In case of pseudo-op, s->'.'.]
                 Input_line_pointer->'\0' where c was.  */
-             if (TC_START_LABEL (c, input_line_pointer))
+             if (TC_START_LABEL (c, s, input_line_pointer))
                {
                  if (flag_m68k_mri)
                    {
@@ -1920,6 +1921,10 @@ s_fill (int ignore ATTRIBUTE_UNUSED)
   md_flush_pending_output ();
 #endif
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   get_known_segmented_expression (&rep_exp);
   if (*input_line_pointer == ',')
     {
@@ -2060,8 +2065,9 @@ skip_past_char (char ** str, char c)
 }
 #define skip_past_comma(str) skip_past_char (str, ',')
 
-/* Parse an attribute directive for VENDOR.  */
-void
+/* Parse an attribute directive for VENDOR.
+   Returns the attribute number read, or zero on error.  */
+int
 s_vendor_attribute (int vendor)
 {
   expressionS exp;
@@ -2104,7 +2110,7 @@ s_vendor_attribute (int vendor)
        {
          as_bad (_("Attribute name not recognised: %s"), name);
          ignore_rest_of_line ();
-         return;
+         return 0;
        }
     }
 
@@ -2119,7 +2125,7 @@ s_vendor_attribute (int vendor)
        {
          as_bad (_("expected numeric constant"));
          ignore_rest_of_line ();
-         return;
+         return 0;
        }
       i = exp.X_add_number;
     }
@@ -2128,7 +2134,7 @@ s_vendor_attribute (int vendor)
     {
       as_bad (_("expected comma"));
       ignore_rest_of_line ();
-      return;
+      return 0;
     }
   if (type & 2)
     {
@@ -2156,14 +2162,15 @@ s_vendor_attribute (int vendor)
     }
 
   demand_empty_rest_of_line ();
-  return;
+  return tag;
 bad_string:
   as_bad (_("bad string constant"));
   ignore_rest_of_line ();
-  return;
+  return 0;
 bad:
   as_bad (_("expected <tag> , <value>"));
   ignore_rest_of_line ();
+  return 0;
 }
 
 /* Parse a .gnu_attribute directive.  */
@@ -3117,6 +3124,10 @@ s_space (int mult)
   md_flush_pending_output ();
 #endif
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   if (flag_mri)
     stop = mri_comment_field (&stopc);
 
@@ -3288,6 +3299,10 @@ s_float_space (int float_type)
   char *stop = NULL;
   char stopc = 0;
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   if (flag_mri)
     stop = mri_comment_field (&stopc);
 
@@ -3474,7 +3489,7 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
        {
          expressionS *expP = symbol_get_value_expression (symp);
 
-         assert (expP->X_op == O_symbol
+         gas_assert (expP->X_op == O_symbol
                  && expP->X_add_number == 0);
          symp = expP->X_add_symbol;
        }
@@ -4250,6 +4265,9 @@ emit_expr_fix (expressionS *exp, unsigned int nbytes, fragS *frag, char *p)
       case 2:
        r = BFD_RELOC_16;
        break;
+      case 3:
+       r = BFD_RELOC_24;
+       break;
       case 4:
        r = BFD_RELOC_32;
        break;
@@ -4629,6 +4647,10 @@ float_cons (/* Clobbers input_line-pointer, checks end-of-line.  */
   md_flush_pending_output ();
 #endif
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   do
     {
       /* input_line_pointer->1st char of a flonum (we hope!).  */
@@ -5073,6 +5095,10 @@ stringer (int bits_appendzero)
   md_flush_pending_output ();
 #endif
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   /* The following awkward logic is to parse ZERO or more strings,
      comma separated. Recall a string expression includes spaces
      before the opening '\"' and spaces after the closing '\"'.
@@ -5451,6 +5477,10 @@ s_incbin (int x ATTRIBUTE_UNUSED)
   md_flush_pending_output ();
 #endif
 
+#ifdef md_cons_align
+  md_cons_align (1);
+#endif
+
   SKIP_WHITESPACE ();
   filename = demand_copy_string (& len);
   if (filename == NULL)
This page took 0.02609 seconds and 4 git commands to generate.