summaryrefslogtreecommitdiff
path: root/bfd/elfcore.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-07-08 08:08:00 +0000
committerAlan Modra <amodra@bigpond.net.au>2003-07-08 08:08:00 +0000
commit823b3cad750d0555a65a9efbb4e218d5781770f5 (patch)
treedc47b5a13e49aab977f42797b9b878d6ecaf3ad0 /bfd/elfcore.h
parent05e78e66cd547958f0ebb2157a8c7e3dd3263112 (diff)
downloadgdb-823b3cad750d0555a65a9efbb4e218d5781770f5.tar.gz
* 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);