X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-spu.c;h=bdb22e72ba79c23a7d52ae74cb47fd5f6d9ebf51;hb=51c8edf68bf1e16c6d05fbb31a36e0cc436a9750;hp=474805bc26702aba094580e39987331dccaff3ab;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c index 474805bc26..bdb22e72ba 100644 --- a/gas/config/tc-spu.c +++ b/gas/config/tc-spu.c @@ -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;