tizen 2.3 release
[external/binutils.git] / packaging / fixbug13534_5.patch
1 commit 1c9170065b107672a47e467abb6807bba8adf28e
2 Author: Francois Gouget <fgouget@codeweavers.com>
3 Date:   Tue Dec 20 18:48:52 2011 +0100
4
5     ar: Fix handling of archive elements larger than 2GB.
6
7 diff --git a/binutils/ar.c b/binutils/ar.c
8 index 0310b6f..e47779f 100644
9 --- a/binutils/ar.c
10 +++ b/binutils/ar.c
11 @@ -927,10 +927,10 @@ open_inarch (const char *archive_filename, const char *file)
12  static void
13  print_contents (bfd *abfd)
14  {
15 -  size_t ncopied = 0;
16 +  bfd_size_type ncopied = 0;
17    char *cbuf = (char *) xmalloc (BUFSIZE);
18    struct stat buf;
19 -  size_t size;
20 +  bfd_size_type size;
21    if (bfd_stat_arch_elt (abfd, &buf) != 0)
22      /* xgettext:c-format */
23      fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
24 @@ -944,12 +944,12 @@ print_contents (bfd *abfd)
25    while (ncopied < size)
26      {
27  
28 -      size_t nread;
29 -      size_t tocopy = size - ncopied;
30 +      bfd_size_type nread;
31 +      bfd_size_type tocopy = size - ncopied;
32        if (tocopy > BUFSIZE)
33         tocopy = BUFSIZE;
34  
35 -      nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
36 +      nread = bfd_bread (cbuf, tocopy, abfd);
37        if (nread != tocopy)
38         /* xgettext:c-format */
39         fatal (_("%s is not a valid archive"),
40 @@ -980,9 +980,9 @@ extract_file (bfd *abfd)
41  {
42    FILE *ostream;
43    char *cbuf = (char *) xmalloc (BUFSIZE);
44 -  size_t nread, tocopy;
45 -  size_t ncopied = 0;
46 -  size_t size;
47 +  bfd_size_type nread, tocopy;
48 +  bfd_size_type ncopied = 0;
49 +  bfd_size_type size;
50    struct stat buf;
51  
52    if (bfd_stat_arch_elt (abfd, &buf) != 0)
53 @@ -1017,7 +1017,7 @@ extract_file (bfd *abfd)
54         if (tocopy > BUFSIZE)
55           tocopy = BUFSIZE;
56  
57 -       nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
58 +       nread = bfd_bread (cbuf, tocopy, abfd);
59         if (nread != tocopy)
60           /* xgettext:c-format */
61           fatal (_("%s is not a valid archive"),
62