* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use
authorAlan Modra <amodra@gmail.com>
Sat, 5 Jan 2002 13:14:00 +0000 (13:14 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 5 Jan 2002 13:14:00 +0000 (13:14 +0000)
of bfd_section_list_remove and bfd_section_list_insert macros.
* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* emultempl/mmo.em (mmo_place_orphan): Likewise.

ld/ChangeLog
ld/emultempl/elf32.em
ld/emultempl/mmo.em
ld/emultempl/pe.em

index d8e21b9893972951bb3815ee9a91c59cc8b90eac..431e19e5032241df26ecef8356b1efefe59a556d 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-05  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use
+       of bfd_section_list_remove and bfd_section_list_insert macros.
+       * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+       * emultempl/mmo.em (mmo_place_orphan): Likewise.
+
 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * configure.tgt (x86_64-*-netbsd*): New target.
index d65923ad383d0881929ce6c1138eb732e6bc3ef1..b2fd9694836880b59d9c204e7c859cf904b78ec8 100644 (file)
@@ -1270,18 +1270,13 @@ gld${EMULATION_NAME}_place_orphan (file, s)
 
       if (place->section != NULL)
        {
-         /*  Unlink the section.  */
+         /* Unlink the section.  */
          for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
            ;
-         *pps = snew->next;
-         if (snew->next == NULL)
-           snew->owner->section_tail = pps;
+         bfd_section_list_remove (output_bfd, pps);
 
          /* Now tack it on to the "place->os" section list.  */
-         snew->next = *place->section;
-         *place->section = snew;
-         if (snew->next == NULL)
-           snew->owner->section_tail = &snew->next;
+         bfd_section_list_insert (output_bfd, place->section, snew);
        }
 
       /* Save the end of this list.  Further ophans of this type will
index f871dec8592680f7a26936ba1daf08023a40482d..8fed0f6c940d484f7b1968555214f3f46c12cae5 100644 (file)
@@ -159,18 +159,13 @@ mmo_place_orphan (file, s)
        /* Put orphans after the first section on the list.  */
        place->section = &bfd_section->next;
 
-      /*  Unlink the section.  */
+      /* Unlink the section.  */
       for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
        ;
-      *pps = snew->next;
-      if (snew->next == NULL)
-       snew->owner->section_tail = pps;
+      bfd_section_list_remove (output_bfd, pps);
 
       /* Now tack it on to the "place->os" section list.  */
-      snew->next = *place->section;
-      *place->section = snew;
-      if (snew->next == NULL)
-       snew->owner->section_tail = &snew->next;
+      bfd_section_list_insert (output_bfd, place->section, snew);
     }
   place->section = &snew->next;        /* Save the end of this list.  */
 
index 0af1d76e9fa70f94130ff7995d14aa82d7df5140..2f0026959fca2617745c7e6f95823150c23f52ad 100644 (file)
@@ -1685,20 +1685,15 @@ gld_${EMULATION_NAME}_place_orphan (file, s)
 
          if (place->section != NULL)
            {
-             /*  Unlink the section.  */
+             /* Unlink the section.  */
              for (pps = &output_bfd->sections;
                   *pps != snew;
                   pps = &(*pps)->next)
                ;
-             *pps = snew->next;
-             if (snew->next == NULL)
-               snew->owner->section_tail = pps;
+             bfd_section_list_remove (output_bfd, pps);
 
              /* Now tack it on to the "place->os" section list.  */
-             snew->next = *place->section;
-             *place->section = snew;
-             if (snew->next == NULL)
-               snew->owner->section_tail = &snew->next;
+             bfd_section_list_insert (output_bfd, place->section, snew);
            }
 
          /* Save the end of this list.  Further ophans of this type will