* elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
authorAlan Modra <amodra@gmail.com>
Wed, 16 Jan 2002 05:37:10 +0000 (05:37 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Jan 2002 05:37:10 +0000 (05:37 +0000)
sections, use bfd_section_list_remove.
* elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
* elflink.h (elf_link_add_object_symbols): When removing all
sections, use bfd_section_list_clear.

bfd/ChangeLog
bfd/elf32-arm.h
bfd/elf32-i370.c
bfd/elflink.h

index 5716c8232bd82da13e1f9f83318a6b570e9263da..0da0df23c6fb93778c8e3ca2a3e01f71cc0dcc76 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
+       sections, use bfd_section_list_remove.
+       * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
+       * elflink.h (elf_link_add_object_symbols): When removing all
+       sections, use bfd_section_list_clear.
+
 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
 
        * po/sv.po: New file: Swedish translation.
index 3a5939dca3281a4ec300174d994bc52b2891b2c7..9d0a405a8296524690f65ab2fef08e47243c5997 100644 (file)
@@ -3170,12 +3170,16 @@ elf32_arm_size_dynamic_sections (output_bfd, info)
          asection ** spp;
 
          for (spp = &s->output_section->owner->sections;
-              *spp != s->output_section;
+              *spp != NULL;
               spp = &(*spp)->next)
-           ;
-         *spp = s->output_section->next;
-         --s->output_section->owner->section_count;
-
+           {
+             if (*spp == s->output_section)
+               {
+                 bfd_section_list_remove (s->output_section->owner, spp);
+                 --s->output_section->owner->section_count;
+                 break;
+               }
+           }
          continue;
        }
 
index 5c5740f2d54c2ff0c718d09305fcc1497d09c2a3..5ac43dda75639d85781b83f5c98226c0c6a65113 100644 (file)
@@ -881,12 +881,16 @@ i370_elf_size_dynamic_sections (output_bfd, info)
          asection **spp;
 
          for (spp = &s->output_section->owner->sections;
-              *spp != s->output_section;
+              *spp != NULL;
               spp = &(*spp)->next)
-           ;
-         *spp = s->output_section->next;
-         --s->output_section->owner->section_count;
-
+           {
+             if (*spp == s->output_section)
+               {
+                 bfd_section_list_remove (s->output_section->owner, spp);
+                 --s->output_section->owner->section_count;
+                 break;
+               }
+           }
          continue;
        }
       /* Allocate memory for the section contents.  */
index 9a3bfd3885b88c1151d2f9c10f6bf3c8d0bb70cf..bf631929b04b48fbedd4bbf8a53806c2a3b7eb1c 100644 (file)
@@ -1568,8 +1568,7 @@ elf_link_add_object_symbols (abfd, info)
         SEC_NEVER_LOAD flag is not the one we want, because that one
         still implies that the section takes up space in the output
         file.  */
-      abfd->sections = NULL;
-      abfd->section_count = 0;
+      bfd_section_list_clear (abfd);
 
       /* If this is the first dynamic object found in the link, create
         the special sections required for dynamic linking.  */