summaryrefslogtreecommitdiff
path: root/bfd/ecoff.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-05 09:45:54 +0000
committerJakub Jelinek <jakub@redhat.com>2005-07-05 09:45:54 +0000
commit9e492e0549e478e80696ee1e1c5f3ca82b36c666 (patch)
tree3769301dba88582d774f86d3bc6d79322b6650d1 /bfd/ecoff.c
parentd0fb9a8d03cc6b0e81f50d601ab361704e3dedb7 (diff)
downloadbinutils-gdb-9e492e0549e478e80696ee1e1c5f3ca82b36c666.tar.gz
* libbfd-in.h (struct artdata): Add extended_names_size field.
* libbfd.h: Rebuilt. * coff-rs600.c (_bfd_xcoff_archive_p): Don't clear fields in freshly allocated object by bfd_zalloc. * coff64-rs6000.c (xcoff64_archive_p): Likewise. * ecoff.c (_bfd_ecoff_archive_p): Likewise. * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p): Likewise. (get_extended_arelt_filename): Fail if index is bigger or equal to extended_names_size. (_bfd_generic_read_ar_hdr_mag): Don't set bfd_error_malformed_archive, get_extended_arelt_filename already did that. (_bfd_slurp_extended_name_table): Initialize extended_names_size field. Allocate one extra byte and clear it, in case extended names table is not terminated.
Diffstat (limited to 'bfd/ecoff.c')
-rw-r--r--bfd/ecoff.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 832b22fdce1..89385518d13 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3182,11 +3182,13 @@ _bfd_ecoff_archive_p (bfd *abfd)
}
bfd_ardata (abfd)->first_file_filepos = SARMAG;
- bfd_ardata (abfd)->cache = NULL;
- bfd_ardata (abfd)->archive_head = NULL;
- bfd_ardata (abfd)->symdefs = NULL;
- bfd_ardata (abfd)->extended_names = NULL;
- bfd_ardata (abfd)->tdata = NULL;
+ /* Already cleared by bfd_zalloc above.
+ bfd_ardata (abfd)->cache = NULL;
+ bfd_ardata (abfd)->archive_head = NULL;
+ bfd_ardata (abfd)->symdefs = NULL;
+ bfd_ardata (abfd)->extended_names = NULL;
+ bfd_ardata (abfd)->extended_names_size = 0;
+ bfd_ardata (abfd)->tdata = NULL; */
if (! _bfd_ecoff_slurp_armap (abfd)
|| ! _bfd_ecoff_slurp_extended_name_table (abfd))