From 5daa8fe797a3f310f9e53282e097b52583ab5109 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 3 May 2005 01:05:03 +0000 Subject: bfd/ 2005-05-02 H.J. Lu * bfd.c (bfd): Remove section_tail and add section_last. (bfd_preserve): Likewise. (bfd_preserve_save): Likewise. (bfd_preserve_restore): Likewise. * opncls.c (_bfd_new_bfd): Likewise. * coffcode.h (coff_compute_section_file_positions): Updated. (coff_compute_section_file_positions): Likewise. * elf.c (assign_section_numbers): Likewise. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. * elf64-mmix.c (mmix_elf_final_link): Likewise. * elfxx-ia64.c (elfNN_ia64_object_p): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * sunos.c (sunos_add_dynamic_symbols): Likewise. * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. * ecoff.c (bfd_debug_section): Initialize prev. * section.c (bfd_section): Add prev. (bfd_section_list_remove): Updated. (bfd_section_list_append): New. (bfd_section_list_insert_after): New. (bfd_section_list_insert_before): New. (bfd_section_list_insert): Removed. (bfd_section_removed_from_list): Updated. (STD_SECTION): Initialize prev. (bfd_section_init): Updated. (bfd_section_list_clear): Updated. * bfd-in2.h: Regenerated. gas/ 2005-05-02 H.J. Lu * write.c (write_object_file): Use bfd_section_double_list_remove to remove sections. ld/ 2005-05-02 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_strip_empty_section): Updated for bfd_section_list_remove change. * ldlang.c (lang_insert_orphan): Likewise. (strip_excluded_output_sections): Likewise. (sort_sections_by_lma): New. (lang_check_section_addresses): Sort the sections before checking addresses. --- bfd/elf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index 2af5a89..fac05e0 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2762,22 +2762,21 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) /* SHT_GROUP sections are in relocatable files only. */ if (link_info == NULL || link_info->relocatable) { - asection **secp; + asection *n; /* Put SHT_GROUP sections first. */ - secp = &abfd->sections; - while (*secp) + for (sec = abfd->sections; sec; sec = n) { - d = elf_section_data (*secp); + d = elf_section_data (sec); + n = sec->next; if (d->this_hdr.sh_type == SHT_GROUP) { - if ((*secp)->flags & SEC_LINKER_CREATED) + if (sec->flags & SEC_LINKER_CREATED) { /* Remove the linker created SHT_GROUP sections. */ - bfd_section_list_remove (abfd, secp); + bfd_section_list_remove (abfd, sec); abfd->section_count--; - continue; } else { @@ -2786,8 +2785,6 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) d->this_idx = section_number++; } } - - secp = &(*secp)->next; } } -- cgit v1.1