commit 1c9170065b107672a47e467abb6807bba8adf28e Author: Francois Gouget Date: Tue Dec 20 18:48:52 2011 +0100 ar: Fix handling of archive elements larger than 2GB. diff --git a/binutils/ar.c b/binutils/ar.c index 0310b6f..e47779f 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -927,10 +927,10 @@ open_inarch (const char *archive_filename, const char *file) static void print_contents (bfd *abfd) { - size_t ncopied = 0; + bfd_size_type ncopied = 0; char *cbuf = (char *) xmalloc (BUFSIZE); struct stat buf; - size_t size; + bfd_size_type size; if (bfd_stat_arch_elt (abfd, &buf) != 0) /* xgettext:c-format */ fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); @@ -944,12 +944,12 @@ print_contents (bfd *abfd) while (ncopied < size) { - size_t nread; - size_t tocopy = size - ncopied; + bfd_size_type nread; + bfd_size_type tocopy = size - ncopied; if (tocopy > BUFSIZE) tocopy = BUFSIZE; - nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd); + nread = bfd_bread (cbuf, tocopy, abfd); if (nread != tocopy) /* xgettext:c-format */ fatal (_("%s is not a valid archive"), @@ -980,9 +980,9 @@ extract_file (bfd *abfd) { FILE *ostream; char *cbuf = (char *) xmalloc (BUFSIZE); - size_t nread, tocopy; - size_t ncopied = 0; - size_t size; + bfd_size_type nread, tocopy; + bfd_size_type ncopied = 0; + bfd_size_type size; struct stat buf; if (bfd_stat_arch_elt (abfd, &buf) != 0) @@ -1017,7 +1017,7 @@ extract_file (bfd *abfd) if (tocopy > BUFSIZE) tocopy = BUFSIZE; - nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd); + nread = bfd_bread (cbuf, tocopy, abfd); if (nread != tocopy) /* xgettext:c-format */ fatal (_("%s is not a valid archive"),