From c601ffdbb07858c9120efe4c7086665d7324b069 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 16 Jan 2002 05:37:10 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 8 ++++++++ bfd/elf32-arm.h | 14 +++++++++----- bfd/elf32-i370.c | 14 +++++++++----- bfd/elflink.h | 3 +-- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5716c8232b..0da0df23c6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2002-01-16 Alan Modra + + * 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 * po/sv.po: New file: Swedish translation. diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 3a5939dca3..9d0a405a82 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -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; } diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 5c5740f2d5..5ac43dda75 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -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. */ diff --git a/bfd/elflink.h b/bfd/elflink.h index 9a3bfd3885..bf631929b0 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -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. */