Summary: | ar & ranlib generate truncated files on 32bit filesystem | ||
---|---|---|---|
Product: | binutils | Reporter: | Alan Hourihane <alanh> |
Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hjl.tools |
Priority: | P2 | ||
Version: | 2.23 | ||
Target Milestone: | --- | ||
URL: | http://sourceware.org/ml/binutils/2012-12/msg00112.html | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | test case |
Description
Alan Hourihane
2012-12-08 00:20:17 UTC
Actually, I think I found the patch by Nick Clifton back in June which seems to suggest this is to catch overflows for 4Gb archives. In light of that, I think it really should be ufile_ptr's and that max_first_real should be..... max_first_real = -1; (or 0xffffffff) Scratch that last comment. Duh. What is your host machine? What is the size of your file_ptr? Hi,it's an Atari m68k. file_ptr as mentioned in comment #1 is 4 bytes. (In reply to comment #4) > Hi,it's an Atari m68k. file_ptr as mentioned in comment #1 is 4 bytes. Does Atari m68k have 64-bit integer? Yes, 64bits is "unsigned long long" Do you have a testcase which only requires binutils to reproduce? Created attachment 6776 [details]
test case
With the binary file you can do... ar rcv libxxx.a main.o a - main.o ar: libxxx.a: File truncated A patch is posted at http://sourceware.org/ml/binutils/2012-12/msg00112.html CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2012-12-09 18:01:39 Modified files: bfd : ChangeLog archive.c Log message: Properly check indicies bigger than 4Gb PR binutils/14933 * archive.c (bsd_write_armap): Properly check indicies bigger than 4Gb. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5877&r2=1.5878 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/archive.c.diff?cvsroot=src&r1=1.92&r2=1.93 CVSROOT: /cvs/src Module name: src Branch: binutils-2_23-branch Changes by: hjl@sourceware.org 2012-12-09 18:06:44 Modified files: bfd : ChangeLog archive.c Log message: Properly check indicies bigger than 4Gb PR binutils/14933 * archive.c (bsd_write_armap): Properly check indicies bigger than 4Gb. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5758.2.31&r2=1.5758.2.32 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/archive.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.87&r2=1.87.4.1 Fixed. |