- for (o = abfd->sections; o != NULL; o = o->next)
- if ((o->flags & SEC_RELOC) != 0)
- {
- Elf_Internal_Ehdr *ehdrp;
-
- ehdrp = elf_elfheader (abfd);
- if (abfd->my_archive)
- (*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"),
- bfd_get_filename (abfd->my_archive),
- bfd_get_filename (abfd),
- ehdrp->e_machine);
- else
- (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"),
- bfd_get_filename (abfd),
- ehdrp->e_machine);
-
- bfd_set_error (bfd_error_wrong_format);
- return false;
- }
-
- return bfd_elf32_bfd_link_add_symbols (abfd, info);
+ bfd_map_over_sections (abfd, check_for_relocs, & failed);
+
+ if (failed)
+ return FALSE;
+ return bfd_elf_link_add_symbols (abfd, info);