* expr.c (expr): Correct returned segment value.
authorAlan Modra <amodra@gmail.com>
Wed, 29 Sep 2010 06:48:30 +0000 (06:48 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 29 Sep 2010 06:48:30 +0000 (06:48 +0000)
gas/ChangeLog
gas/expr.c

index 4511ea33a4d9d736d3d5e2d239fd996ad476a6f6..62a974b570562a316836c37b3bd2d183cd1b9df5 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-29  Alan Modra  <amodra@gmail.com>
+
+       * expr.c (expr): Correct returned segment value.
+
 2010-09-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure: Regenerate.
@@ -57,7 +61,7 @@
        (arm_ext_m): Add support for OS extension.
        (arm_ext_os): New variable.
        (do_t_swi): In v6-M ensure we have the OS extension.
-       (arm_cpus): The cortex-m1 and cortex-m0 options have the OS 
+       (arm_cpus): The cortex-m1 and cortex-m0 options have the OS
        extension by default.
        (arm_archs): Add armv6s-m.
        (arm_extensions): Add 'os' extension.
        (arm_option_cpu_table): Rename...
        (arm_option_fpu_table): ...to this.
        (arm_fpus): Change type.
-       (arm_parse_extension): Enforce alphabetical order.  Allow 
+       (arm_parse_extension): Enforce alphabetical order.  Allow
        extensions to be removed.
        (arm_parse_arch): Allow extensions to be specified with -march.
        (s_arm_arch_extension): Add.
index 53952b56fa100020ad979bc17f21500d0f7cb7eb..f050b17ccb2123e68c305570a1ea0575a2363820 100644 (file)
@@ -1969,16 +1969,27 @@ expr (int rankarg,              /* Larger # is higher rank.  */
 
       if (retval != rightseg)
        {
-         if (! SEG_NORMAL (retval))
-           {
-             if (retval != undefined_section || SEG_NORMAL (rightseg))
-               retval = rightseg;
-           }
-         else if (SEG_NORMAL (rightseg)
+         if (retval == undefined_section)
+           ;
+         else if (rightseg == undefined_section)
+           retval = rightseg;
+         else if (retval == expr_section)
+           ;
+         else if (rightseg == expr_section)
+           retval = rightseg;
+         else if (retval == reg_section)
+           ;
+         else if (rightseg == reg_section)
+           retval = rightseg;
+         else if (rightseg == absolute_section)
+           ;
+         else if (retval == absolute_section)
+           retval = rightseg;
 #ifdef DIFF_EXPR_OK
-                  && op_left != O_subtract
+         else if (op_left == O_subtract)
+           ;
 #endif
-                  )
+         else
            as_bad (_("operation combines symbols in different segments"));
        }