* config/tc-z8k.c (md_parse_option): Set z8k_target_from_cmdline
authorChristian Groessler <chris@groessler.org>
Fri, 26 Apr 2013 19:21:25 +0000 (19:21 +0000)
committerChristian Groessler <chris@groessler.org>
Fri, 26 Apr 2013 19:21:25 +0000 (19:21 +0000)
according to the target parameter.  Don't call s_segm since s_segm
calls bfd_set_arch_mach using stdoutput, but stdoutput isn't
initialized yet.
(md_begin): Call s_segm according to target parameter from command
line.

gas/ChangeLog
gas/config/tc-z8k.c

index 0fd3002cdcab150543eaa81c9a33d6d127cf6bb4..4f86c74621e2d6d4504b4a401d3a3505fa45ccdd 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-26  Christian Groessler  <chris@groessler.org>
+
+       * config/tc-z8k.c (md_parse_option): Set z8k_target_from_cmdline
+       according to the target parameter.  Don't call s_segm since s_segm
+       calls bfd_set_arch_mach using stdoutput, but stdoutput isn't
+       initialized yet.
+       (md_begin): Call s_segm according to target parameter from command
+       line.
+
 2013-04-25  Alan Modra  <amodra@gmail.com>
 
        * configure.in: Allow little-endian linux.
index 7cc061ab4c3e03e2502f87c97e00cdc3662ba4a4..2442032e0a01dfe7c8088dcbab69499057ba60cf 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-z8k.c -- Assemble code for the Zilog Z800n
    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
-   2005, 2006, 2007, 2009  Free Software Foundation, Inc.
+   2005, 2006, 2007, 2009, 2013  Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -34,7 +34,8 @@ extern int machine;
 extern int coff_flags;
 int segmented_mode;
 
-/* This is non-zero if target was set from the command line.  */
+/* This is non-zero if target was set from the command line.
+   If non-zero, 1 means Z8002 (non-segmented), 2 means Z8001 (segmented).  */
 static int z8k_target_from_cmdline;
 
 static void
@@ -156,8 +157,7 @@ md_begin (void)
     }
 
   /* Default to z8002.  */
-  if (! z8k_target_from_cmdline)
-    s_segm (0);
+  s_segm (z8k_target_from_cmdline ? z8k_target_from_cmdline - 1 : 0);
 
   /* Insert the pseudo ops, too.  */
   for (idx = 0; md_pseudo_table[idx].poc_name; idx++)
@@ -1310,15 +1310,14 @@ md_parse_option (int c, char *arg)
     {
     case 'z':
       if (!strcmp (arg, "8001"))
-       s_segm (1);
+       z8k_target_from_cmdline = 2;
       else if (!strcmp (arg, "8002"))
-       s_segm (0);
+       z8k_target_from_cmdline = 1;
       else
        {
          as_bad (_("invalid architecture -z%s"), arg);
          return 0;
        }
-      z8k_target_from_cmdline = 1;
       break;
 
     case OPTION_RELAX:
This page took 0.050292 seconds and 4 git commands to generate.