* elfcore.h (elf_core_file_p): Likewise.
* section.c (bfd_section_init): Remove prototype.
+2003-07-08 Alan Modra <amodra@bigpond.net.au>
+
+ * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
+ * elfcore.h (elf_core_file_p): Likewise.
+ * section.c (bfd_section_init): Remove prototype.
+
2003-07-08 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
goto got_wrong_format_error;
}
+ if (!bfd_preserve_save (abfd, &preserve))
+ goto got_no_match;
+
/* Allocate an instance of the elf_obj_tdata structure and hook it up to
the tdata pointer in the bfd. */
- amt = sizeof (struct elf_obj_tdata);
- preserve.marker = bfd_zalloc (abfd, amt);
- if (preserve.marker == NULL)
+ if (! (*abfd->xvec->_bfd_set_format[bfd_object]) (abfd))
goto got_no_match;
- if (!bfd_preserve_save (abfd, &preserve))
- goto got_no_match;
-
- elf_tdata (abfd) = preserve.marker;
+ preserve.marker = elf_tdata (abfd);
/* Now that we know the byte order, swap in the rest of the header */
i_ehdrp = elf_elfheader (abfd);
goto wrong;
}
- /* Give abfd an elf_obj_tdata. */
- amt = sizeof (struct elf_obj_tdata);
- preserve.marker = bfd_zalloc (abfd, amt);
- if (preserve.marker == NULL)
- goto fail;
if (!bfd_preserve_save (abfd, &preserve))
goto fail;
- elf_tdata (abfd) = preserve.marker;
+ /* Give abfd an elf_obj_tdata. */
+ if (! (*abfd->xvec->_bfd_set_format[bfd_core]) (abfd))
+ goto fail;
+ preserve.marker = elf_tdata (abfd);
/* Swap in the rest of the header, now that we have the byte order. */
i_ehdrp = elf_elfheader (abfd);
/* Initializes a new section. NEWSECT->NAME is already set. */
-static asection *bfd_section_init PARAMS ((bfd *, asection *));
-
static asection *
bfd_section_init (bfd *abfd, asection *newsect)
{