Add --size-check=[error|warning].
[deliverable/binutils-gdb.git] / gas / config / obj-elf.c
index d43409a2f86fc8b58bb0af57d53d2b2caa1e44d0..37a8020c736c902a1deedf473557786df3cf02fb 100644 (file)
@@ -1898,6 +1898,12 @@ elf_frob_symbol (symbolS *symp, int *puntp)
        {
          const char *op_name = NULL;
          const char *add_name = NULL;
+         PRINTF_LIKE ((*as_error));
+
+         if (flag_size_check == size_check_error)
+           as_error = as_bad;
+         else
+           as_error = as_warn;
 
          if (size->X_op == O_subtract)
            {
@@ -1909,9 +1915,9 @@ elf_frob_symbol (symbolS *symp, int *puntp)
                add_name = NULL;
 
              if (op_name && add_name)
-               as_bad (_(".size expression with symbols `%s' and `%s' "
-                         "does not evaluate to a constant"),
-                       op_name, add_name);
+               as_error (_(".size expression with symbols `%s' and "
+                           "`%s' does not evaluate to a constant"),
+                         op_name, add_name);
              else
                {
                  const char *name;
@@ -1924,13 +1930,15 @@ elf_frob_symbol (symbolS *symp, int *puntp)
                    name = NULL;
 
                  if (name)
-                   as_bad (_(".size expression with symbol `%s' "
-                             "does not evaluate to a constant"), name);
+                   as_error (_(".size expression with symbol `%s' "
+                               "does not evaluate to a constant"),
+                             name);
                }
            }
          
          if (!op_name && !add_name)
-           as_bad (_(".size expression does not evaluate to a constant"));
+           as_error (_(".size expression does not evaluate to a "
+                       "constant"));
        }
       free (sy_obj->size);
       sy_obj->size = NULL;
This page took 0.023838 seconds and 4 git commands to generate.