* opncls.c (bfd_make_readable): Call bfd_section_list_clear.
authorAlan Modra <amodra@gmail.com>
Fri, 26 Apr 2002 13:43:10 +0000 (13:43 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 26 Apr 2002 13:43:10 +0000 (13:43 +0000)
* xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.

bfd/ChangeLog
bfd/opncls.c
bfd/xcofflink.c

index 5bbce0e8dcd78626c53750a38e0bb81576a2cf5d..49a9d291ab90c69479a58267b56c766727dbce21 100644 (file)
@@ -1,5 +1,8 @@
 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
 
+       * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
+       * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
+
        * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
        same as the output before calling elf_link_input_bfd.
 
index 49482f01cd2daed274e2a3f8068a082a94dfb530..65a2a4252f12e2b54eb4ae71af0bd792be629a09 100644 (file)
@@ -614,7 +614,6 @@ bfd_make_readable(abfd)
   abfd->arch_info = &bfd_default_arch_struct;
 
   abfd->where = 0;
-  abfd->sections = (asection *) NULL;
   abfd->format = bfd_unknown;
   abfd->my_archive = (bfd *) NULL;
   abfd->origin = 0;
@@ -633,7 +632,8 @@ bfd_make_readable(abfd)
   abfd->outsymbols = 0;
   abfd->tdata.any = 0;
 
-  bfd_check_format(abfd, bfd_object);
+  bfd_section_list_clear (abfd);
+  bfd_check_format (abfd, bfd_object);
 
   return true;
 }
index 79952d2280a015157ec3f0cdcecbed9b5faa880a..076982675209727985c20a60454e181063fe626b 100644 (file)
@@ -2121,7 +2121,7 @@ xcoff_link_add_dynamic_symbols (abfd, info)
 
   /* Remove the sections from this object, so that they do not get
      included in the link.  */
-  abfd->sections = NULL;
+  bfd_section_list_clear (abfd);
 
   bfd_xcoff_swap_ldhdr_in (abfd, contents, &ldhdr);