From 0f68bf0a91880b7dab3441f09bc5814f5780e198 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 27 Feb 1997 18:30:47 +0000 Subject: [PATCH] * gasp.c (hash_add_to_string_table): Correct misspelling in error message, and add newline. (process_file): Don't process assignments in the label if this is a equ or assign pseudo-op. (process_pseudo_op): Swap first argument to do_assign for K_ASSIGN and K_EQU, to match documentation. --- gas/ChangeLog | 9 +++++++++ gas/gasp.c | 46 +++++++++++++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 546ec5e756f..ecd6ef7f392 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +Thu Feb 27 13:29:04 1997 Ian Lance Taylor + + * gasp.c (hash_add_to_string_table): Correct misspelling in error + message, and add newline. + (process_file): Don't process assignments in the label if this is + a equ or assign pseudo-op. + (process_pseudo_op): Swap first argument to do_assign for K_ASSIGN + and K_EQU, to match documentation. + Thu Feb 27 12:00:03 1997 Michael Meissner * config/obj-coff.c (obj_coff_section): Add 'r' section attribute diff --git a/gas/gasp.c b/gas/gasp.c index db624f52c28..27efb0560cc 100644 --- a/gas/gasp.c +++ b/gas/gasp.c @@ -1,5 +1,5 @@ /* gasp.c - Gnu assembler preprocessor main program. - Copyright (C) 1994, 95, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 1997 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, sac@cygnus.com @@ -470,7 +470,7 @@ hash_add_to_string_table (tab, key, name, again) if (ptr->value.s.len) { if (!again) - ERROR ((stderr, "redefintion not allowed")); + ERROR ((stderr, "redefinition not allowed\n")); } ptr->type = hash_string; @@ -1917,19 +1917,43 @@ process_file () { l = grab_label (&line, &label_in); sb_reset (&label); - if (label_in.len) - { - /* Munge any label */ - - - process_assigns (0, &label_in, &label); - } if (line.ptr[l] == ':') l++; while (ISWHITE (line.ptr[l]) && l < line.len) l++; + if (label_in.len) + { + int do_assigns; + + /* Munge the label, unless this is EQU or ASSIGN. */ + do_assigns = 1; + if (l < line.len + && (line.ptr[l] == '.' || alternate || mri)) + { + int lx = l; + + if (line.ptr[lx] == '.') + ++lx; + if (lx + 3 <= line.len + && strncasecmp ("EQU", line.ptr + lx, 3) == 0 + && (lx + 3 == line.len + || ! ISFIRSTCHAR (line.ptr[lx + 3]))) + do_assigns = 0; + else if (lx + 6 <= line.len + && strncasecmp ("ASSIGN", line.ptr + lx, 6) == 0 + && (lx + 6 == line.len + || ! ISFIRSTCHAR (line.ptr[lx + 6]))) + do_assigns = 0; + } + + if (do_assigns) + process_assigns (0, &label_in, &label); + else + sb_add_sb (&label, &label_in); + } + if (l < line.len) { if (process_pseudo_op (l, &line, &acc)) @@ -3308,7 +3332,7 @@ process_pseudo_op (idx, line, acc) do_sdata (idx, line, 'z'); return 1; case K_ASSIGN: - do_assign (1, 0, line); + do_assign (0, 0, line); return 1; case K_AIF: do_aif (idx, line); @@ -3326,7 +3350,7 @@ process_pseudo_op (idx, line, acc) do_aendr (); return 1; case K_EQU: - do_assign (0, idx, line); + do_assign (1, idx, line); return 1; case K_ALIGN: do_align (idx, line); -- 2.30.2