This function stops too soon, as I found when the hash chain happened
to contain two .debug_macro sections and a .bss section:
.debug_macro -> .bss -> .debug_macro
* section.c (bfd_get_section_by_name_if): Iterate over entire hash
chain.
+2015-07-24 Alan Modra <amodra@gmail.com>
+
+ * section.c (bfd_get_section_by_name_if): Iterate over entire hash
+ chain.
+
2015-07-23 Joseph Myers <joseph@codesourcery.com>
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
return NULL;
hash = sh->root.hash;
- do
- {
- if ((*operation) (abfd, &sh->section, user_storage))
- return &sh->section;
- sh = (struct section_hash_entry *) sh->root.next;
- }
- while (sh != NULL && sh->root.hash == hash
- && strcmp (sh->root.string, name) == 0);
+ for (; sh != NULL; sh = (struct section_hash_entry *) sh->root.next)
+ if (sh->root.hash == hash
+ && strcmp (sh->root.string, name) == 0
+ && (*operation) (abfd, &sh->section, user_storage))
+ return &sh->section;
return NULL;
}