gdb/
[deliverable/binutils-gdb.git] / gas / write.c
index 7fb2e8bb3b97683152c9a70903a1aed1fd907271..56ebb6c565bea35df43565b53206156270a41b66 100644 (file)
@@ -406,8 +406,8 @@ chain_frchains_together_1 (segT section, struct frchain *frchp)
          prev_fix = frchp->fix_tail;
        }
     }
-  gas_assert (prev_frag->fr_type != 0);
-  gas_assert (prev_frag != &dummy);
+  gas_assert (prev_frag != &dummy
+             && prev_frag->fr_type != 0);
   prev_frag->fr_next = 0;
   return prev_frag;
 }
@@ -1004,12 +1004,7 @@ fixup_segment (fixS *fixP, segT this_segment)
              fixP->fx_subsy = NULL;
              fixP->fx_pcrel = 1;
            }
-         else if (TC_VALIDATE_FIX_SUB (fixP, add_symbol_segment))
-           /* If the fix is valid, subtract fx_subsy here.  The addition of
-              fx_addsy will be performed below.  Doing this prevents bogus
-              warnings from the range check below.  */
-             add_number -= S_GET_VALUE (fixP->fx_subsy);
-         else
+         else if (!TC_VALIDATE_FIX_SUB (fixP, add_symbol_segment))
            {
              if (!md_register_arithmetic
                  && (add_symbol_segment == reg_section
@@ -1024,6 +1019,10 @@ fixup_segment (fixS *fixP, segT this_segment)
                              S_GET_NAME (fixP->fx_subsy),
                              segment_name (sub_symbol_segment));
            }
+         else if (sub_symbol_segment != undefined_section
+                  && ! bfd_is_com_section (sub_symbol_segment)
+                  && MD_APPLY_SYM_VALUE (fixP))
+           add_number -= S_GET_VALUE (fixP->fx_subsy);
        }
 
       if (fixP->fx_addsy)
This page took 0.023199 seconds and 4 git commands to generate.