aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
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/elfcode.h
parent234d84da5b7c0f324137e93cedf78b623309b829 (diff)
downloadfsf-binutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.zip
fsf-binutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.tar.gz
fsf-binutils-gdb-0c83546ac6ce48331e66584c9119fe258d0d1bfc.tar.bz2
* 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/elfcode.h')
-rw-r--r--bfd/elfcode.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 6afaefa..abd7e04 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -570,17 +570,15 @@ elf_object_p (abfd)
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);