*** empty log message ***
[deliverable/binutils-gdb.git] / gas / write.c
index 70220155d3d67869dff7d89ff72ed366a75c2c5b..8d08674caaf1cdedad81da04f5b0fb43e569b2c8 100644 (file)
@@ -527,6 +527,7 @@ cvt_frag_to_fill (headersP, sec, fragP)
          as_bad_where (fragP->fr_file, fragP->fr_line,
                        _("attempt to .org/.space backwards? (%ld)"),
                        (long) fragP->fr_offset);
+         fragP->fr_offset = 0;
        }
       fragP->fr_type = rs_fill;
       break;
@@ -874,8 +875,9 @@ adjust_reloc_syms (abfd, sec, xxx)
            goto done;
          }
 
-       /* Never adjust a reloc against local symbol in a merge section.  */
-       if (symsec->flags & SEC_MERGE)
+       /* Never adjust a reloc against local symbol in a merge section
+          with non-zero addend.  */
+       if ((symsec->flags & SEC_MERGE) && fixp->fx_offset)
          {
            symbol_mark_used_in_reloc (fixp->fx_addsy);
            goto done;
@@ -1439,12 +1441,6 @@ subsegs_finish ()
          if we are generating a listing.  */
       alignment = had_errors () ? 0 : SUB_SEGMENT_ALIGN (now_seg);
 
-      /* The last subsegment gets an aligment corresponding to the
-        alignment of the section.  This allows proper nop-filling
-        at the end of code-bearing sections.  */
-      if (!frchainP->frch_next || frchainP->frch_next->frch_seg != now_seg)
-       alignment = get_recorded_alignment (now_seg);
-
       if (subseg_text_p (now_seg))
        frag_align_code (alignment, 0);
       else
@@ -1506,22 +1502,18 @@ write_object_file ()
 #ifdef BFD_ASSEMBLER
   /* Remove the sections created by gas for its own purposes.  */
   {
-    asection **seclist, *sec;
+    asection **seclist;
     int i;
 
     seclist = &stdoutput->sections;
-    while (seclist && *seclist)
+    while (*seclist)
       {
-       sec = *seclist;
-       while (sec == reg_section || sec == expr_section)
+       if (*seclist == reg_section || *seclist == expr_section)
          {
-           sec = sec->next;
-           *seclist = sec;
+           bfd_section_list_remove (stdoutput, seclist);
            stdoutput->section_count--;
-           if (!sec)
-             break;
          }
-       if (*seclist)
+       else
          seclist = &(*seclist)->next;
       }
     i = 0;
@@ -2558,7 +2550,7 @@ relax_segment (segment_frag_root, segment)
    Go through all the fixS's in a segment and see which ones can be
    handled now.  (These consist of fixS where we have since discovered
    the value of a symbol, or the address of the frag involved.)
-   For each one, call md_apply_fix to put the fix into the frag data.
+   For each one, call md_apply_fix3 to put the fix into the frag data.
 
    Result is a count of how many relocation structs will be needed to
    handle the remaining fixS's that we couldn't completely handle here.
@@ -2815,9 +2807,6 @@ fixup_segment (fixP, this_segment_type)
              else if (add_symbol_segment == undefined_section
 #ifdef BFD_ASSEMBLER
                       || bfd_is_com_section (add_symbol_segment)
-                      || (bfd_get_section_flags (stdoutput,
-                                                 add_symbol_segment)
-                          & SEC_MERGE) != 0
 #endif
                       )
                {
@@ -2869,25 +2858,7 @@ fixup_segment (fixP, this_segment_type)
        }
 
       if (!fixP->fx_done)
-       {
-#ifdef MD_APPLY_FIX3
-         md_apply_fix3 (fixP, &add_number, this_segment_type);
-#else
-#ifdef BFD_ASSEMBLER
-         md_apply_fix (fixP, &add_number);
-#else
-         md_apply_fix (fixP, add_number);
-#endif
-#endif
-
-#ifndef TC_HANDLES_FX_DONE
-         /* If the tc-* files haven't been converted, assume it's handling
-            it the old way, where a null fx_addsy means that the fix has
-            been applied completely, and no further work is needed.  */
-         if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
-           fixP->fx_done = 1;
-#endif
-       }
+       md_apply_fix3 (fixP, & add_number, this_segment_type);
 
       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
        {
@@ -2947,7 +2918,7 @@ number_to_chars_bigendian (buf, val, n)
      valueT val;
      int n;
 {
-  if ((size_t) n > sizeof (val) || n <= 0)
+  if (n <= 0)
     abort ();
   while (n--)
     {
@@ -2962,7 +2933,7 @@ number_to_chars_littleendian (buf, val, n)
      valueT val;
      int n;
 {
-  if ((size_t) n > sizeof (val) || n <= 0)
+  if (n <= 0)
     abort ();
   while (n--)
     {
This page took 0.02547 seconds and 4 git commands to generate.