bfd_section_* macros
[deliverable/binutils-gdb.git] / gas / config / tc-spu.c
index 474805bc26702aba094580e39987331dccaff3ab..bdb22e72ba79c23a7d52ae74cb47fd5f6d9ebf51 100644 (file)
@@ -1,6 +1,6 @@
 /* spu.c -- Assembler for the IBM Synergistic Processing Unit (SPU)
 
-   Copyright (C) 2006-2018 Free Software Foundation, Inc.
+   Copyright (C) 2006-2019 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -815,6 +815,11 @@ spu_cons (int nbytes)
 
   do
     {
+      char *save = input_line_pointer;
+
+      /* Use deferred_expression here so that an expression involving
+        a symbol that happens to be defined already as an spu symbol,
+        is not resolved.  */
       deferred_expression (&exp);
       if ((exp.X_op == O_symbol
           || exp.X_op == O_constant)
@@ -829,9 +834,12 @@ spu_cons (int nbytes)
            {
              expressionS new_exp;
 
+             save = input_line_pointer;
              expression (&new_exp);
              if (new_exp.X_op == O_constant)
                exp.X_add_number += new_exp.X_add_number;
+             else
+               input_line_pointer = save;
            }
 
          reloc = nbytes == 4 ? BFD_RELOC_SPU_PPU32 : BFD_RELOC_SPU_PPU64;
@@ -839,7 +847,14 @@ spu_cons (int nbytes)
                       &exp, 0, reloc);
        }
       else
-       emit_expr (&exp, nbytes);
+       {
+         /* Don't use deferred_expression for anything else.
+            deferred_expression won't evaulate dot at the point it is
+            used.  */
+         input_line_pointer = save;
+         expression (&exp);
+         emit_expr (&exp, nbytes);
+       }
     }
   while (*input_line_pointer++ == ',');
 
@@ -889,7 +904,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
 valueT
 md_section_align (segT seg, valueT size)
 {
-  int align = bfd_get_section_alignment (stdoutput, seg);
+  int align = bfd_section_alignment (seg);
   valueT mask = ((valueT) 1 << align) - 1;
 
   return (size + mask) & ~mask;
This page took 0.028522 seconds and 4 git commands to generate.