*** empty log message ***
[deliverable/binutils-gdb.git] / gas / write.c
index 5397aa09949dc4d28d1b7b68cfaccb856b8e8a99..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;
@@ -873,6 +874,14 @@ adjust_reloc_syms (abfd, sec, xxx)
            symbol_mark_used_in_reloc (fixp->fx_addsy);
            goto done;
          }
+
+       /* 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;
+         }
 #endif
 
        /* Is there some other reason we can't adjust this one?  (E.g.,
@@ -1432,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
@@ -1499,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;
@@ -2919,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--)
     {
@@ -2934,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.02667 seconds and 4 git commands to generate.