From a398daa0b0f558492a298e6b1c79a29bae3c9de3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 8 Jul 2003 08:08:00 +0000 Subject: * 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. --- bfd/elfcore.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bfd/elfcore.h') diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 724d607d3a..cd218066dc 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -122,15 +122,13 @@ elf_core_file_p (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); -- cgit v1.2.1