aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-03-07 17:29:25 +0000
committerNick Clifton <nickc@redhat.com>2016-03-07 17:29:25 +0000
commit4fc874242f8f1bf17cf6e65b159dd804e793e6cd (patch)
tree270a038005096bd4ee9f8522926be270cfece2be /bfd
parent23a4bd22c75862fdbaa5faef59b9094ec738f675 (diff)
downloadgdb-4fc874242f8f1bf17cf6e65b159dd804e793e6cd.zip
gdb-4fc874242f8f1bf17cf6e65b159dd804e793e6cd.tar.gz
gdb-4fc874242f8f1bf17cf6e65b159dd804e793e6cd.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/archive.c2
2 files changed, 7 insertions, 1 deletions
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 <nickc@redhat.com>
+
+ PR binutils/19775
+ * archive.c (bfd_generic_openr_next_archived_file): Allow zero
+ length elements in the archive.
+
2016-03-07 Jiong Wang <jiong.wang@arm.com>
* 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);