[Bug binutils/14302] New: ar mishandles 4GB files

2012-06-27 Thread fgouget at codeweavers dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14302

 Bug #: 14302
   Summary: ar mishandles 4GB files
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: fgou...@codeweavers.com
Classification: Unclassified


Created attachment 6488
  -- http://sourceware.org/bugzilla/attachment.cgi?id=6488
A fix for 'ar tv' and 'ar x'

This is similar to bug 13534 but with 4+GB files and only impacts 32bit
platforms.

$ dd if=/dev/zero of=file4G bs=1M count=4196
4196+0 records in
4196+0 records out
4399824896 bytes (4.4 GB) copied, 38.398 s, 115 MB/s
$ ~/binutils-cvs/binutils/ar q ar4G.ar file4G
/home/fgouget/binutils-cvs/binutils/ar: creating ar4G.ar
$ od -a ar4G.ar
000   !  a   r   c   h nl   f   i   l   e   4   G   /  sp
020  sp  sp  sp  sp  sp  sp  sp  sp   1   3   4   0   7   8   6   0
040   3   0  sp  sp   1   0   0   0  sp  sp   1   0   0   0  sp  sp
060   1   0   0   6   4   4  sp  sp   4   3   9   9   8   2   4   8
100   9   6   `  nl nul nul nul nul nul nul nul nul nul nul nul nul
120 nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul
^C
$ ~/binutils-cvs/binutils/ar tv ar4G.ar
rw-r--r-- 1000/1000 104857600 Jun 27 10:38 2012 file4G
$ ~/binutils-cvs/binutils/ar x ar4G.ar
$ ls -l file4G
-rw-r--r-- 1 fgouget fgouget 104857600 Jun 27 11:11 file41G

The od command shows that the ar archive was created correctly. However 'ar tv'
and 'ar x' think it is a 100MB file which is incorrect.

This happens because print_arelt_descr(), print_contents() and extract_file()
use 32bit size_t variables instead of bfd_size_type ones.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/14302] ar mishandles 4GB files

2012-06-27 Thread fgouget at codeweavers dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14302

Francois Gouget fgouget at codeweavers dot com changed:

   What|Removed |Added

   Attachment #6488|0   |1
is obsolete||

--- Comment #1 from Francois Gouget fgouget at codeweavers dot com 2012-06-27 
09:26:26 UTC ---
Created attachment 6489
  -- http://sourceware.org/bugzilla/attachment.cgi?id=6489
A fix for 'ar tv' and 'ar x'

Updated the commit changelog to reference this bug and be more explicit about
the ar commands being fixed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/14302] ar mishandles 4GB files

2012-06-27 Thread fgouget at codeweavers dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14302

--- Comment #2 from Francois Gouget fgouget at codeweavers dot com 2012-06-27 
09:30:08 UTC ---
Note that 'ar p' is also impacted:

$ ~/binutils-cvs/binutils/ar p ar4G.ar file4G
$ ls -l file4G
-rw-r--r-- 1 fgouget fgouget 104857600 Jun 27 11:29 file4G

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/14302] ar mishandles 4GB files

2012-06-27 Thread fgouget at codeweavers dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14302

Francois Gouget fgouget at codeweavers dot com changed:

   What|Removed |Added

   Attachment #6489|0   |1
is obsolete||

--- Comment #3 from Francois Gouget fgouget at codeweavers dot com 2012-06-27 
09:33:48 UTC ---
Created attachment 6490
  -- http://sourceware.org/bugzilla/attachment.cgi?id=6490
A fix for 'ar tv', 'ar p' and 'ar x'

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/14156] --sort-section=alignment trashes init/fini sections, and anything similar

2012-06-27 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14156

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|WAITING |NEW
URL||http://sourceware.org/ml/bi
   ||nutils/2012-06/msg00225.htm
   ||l

--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-06-27 17:33:05 
UTC ---
A patch is posted at

http://sourceware.org/ml/binutils/2012-06/msg00225.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/14156] --sort-section=alignment trashes init/fini sections, and anything similar

2012-06-27 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=14156

--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-06-27 17:35:31 
UTC ---
(In reply to comment #0)

 I'm not sure what the right fix for this is, but I think the linker scripts
 should do something to ensure that sections which are pieced-together in a
 particular link order (init/fini and probably also ctors/dtors, and perhaps
 others) never get reordered. If that's not possible, then this option should 
 be
 documented as dangerous/broken so that projects don't put it in their
 makefiles.

ctors/dtors sections contain pointers.  The behavor of their order is
undefined.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils