From 4fc874242f8f1bf17cf6e65b159dd804e793e6cd Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 7 Mar 2016 17:29:25 +0000 Subject: Allow zero length archive elements. bfd PR binutils/19775 * archive.c (bfd_generic_openr_next_archived_file): Allow zero length elements in the archive. binutils PR binutils/19775 * testsuite/binutils-all/ar.exp (proc empty_archive): New proc. Run the new proc. * testsuite/binutils-all/empty: New, empty, file. --- bfd/ChangeLog | 6 ++++++ bfd/archive.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d9d9e77..8c2da68 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2016-03-07 Nick Clifton + + PR binutils/19775 + * archive.c (bfd_generic_openr_next_archived_file): Allow zero + length elements in the archive. + 2016-03-07 Jiong Wang * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got diff --git a/bfd/archive.c b/bfd/archive.c index 68c18bf..53e295e 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -802,7 +802,7 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file) Note that last_file->origin can be odd in the case of BSD-4.4-style element with a long odd size. */ filestart += filestart % 2; - if (filestart <= last_file->proxy_origin) + if (filestart < last_file->proxy_origin) { /* Prevent looping. See PR19256. */ bfd_set_error (bfd_error_malformed_archive); -- cgit v1.1