aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-07-08 08:08:00 +0000
committerAlan Modra <amodra@gmail.com>2003-07-08 08:08:00 +0000
commit0c83546ac6ce48331e66584c9119fe258d0d1bfc (patch)
tree2b88e08ef1afc51fff06710d524c2dafa247653c /bfd/elfcore.h
parentdaily update (diff)
downloadbinutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.tar.gz
binutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.tar.bz2
binutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.zip
* 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.
Diffstat (limited to 'bfd/elfcore.h')
-rw-r--r--bfd/elfcore.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 724d607d3a6..cd218066dc4 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);