From e54fdaa5c98411e1874ba00e0b2d08815148ac06 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 26 Apr 2002 13:43:10 +0000 Subject: [PATCH] * opncls.c (bfd_make_readable): Call bfd_section_list_clear. * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise. --- bfd/ChangeLog | 3 +++ bfd/opncls.c | 4 ++-- bfd/xcofflink.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5bbce0e8dc..49a9d291ab 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2002-04-26 Alan Modra + * 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. diff --git a/bfd/opncls.c b/bfd/opncls.c index 49482f01cd..65a2a4252f 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -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; } diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 79952d2280..0769826752 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -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); -- 2.34.1