Fix Opcode generation of ld a,(bc) and ld a,(de) on target z80
[binutils-gdb.git] / gas / read.c
index ed3be3743b0381271933ffc34832d799ff967661..ec69c4e7a90f84a6f01025f133e5e6dd432c2175 100644 (file)
@@ -2554,8 +2554,13 @@ s_macro (int ignore ATTRIBUTE_UNUSED)
 void
 s_mexit (int ignore ATTRIBUTE_UNUSED)
 {
-  cond_exit_macro (macro_nest);
-  buffer_limit = input_scrub_next_buffer (&input_line_pointer);
+  if (macro_nest)
+    {
+      cond_exit_macro (macro_nest);
+      buffer_limit = input_scrub_next_buffer (&input_line_pointer);
+    }
+  else
+    as_warn (_("ignoring macro exit outside a macro definition."));
 }
 
 /* Switch in and out of MRI mode.  */
@@ -3604,6 +3609,12 @@ pseudo_set (symbolS *symbolP)
       break;
 
     case O_register:
+      if (S_IS_EXTERNAL (symbolP))
+       {
+         as_bad ("can't equate global symbol `%s' with register name",
+                 S_GET_NAME (symbolP));
+         return;
+       }
       S_SET_SEGMENT (symbolP, reg_section);
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
       set_zero_frag (symbolP);