From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9709 invoked by alias); 18 Dec 2007 00:54:27 -0000 Received: (qmail 9701 invoked by uid 22791); 18 Dec 2007 00:54:26 -0000 X-Spam-Check-By: sourceware.org Received: from secure.latencyzero.com (HELO mail.latencyzero.com) (64.71.153.217) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Dec 2007 00:54:20 +0000 Received: (qmail 2196 invoked from network); 18 Dec 2007 00:54:18 -0000 Received: from unknown (HELO rmann1.internal.xbow.com) (rmann@63.64.55.212) by 0 with ESMTPA; 18 Dec 2007 00:54:18 -0000 Message-Id: From: Rick Mann To: gcc-help@gcc.gnu.org In-Reply-To: <5A2671EC-48B9-4492-A1E1-F346CE6811CC@latencyzero.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: More info: Binary built on different platforms with exact same tools different? Date: Tue, 18 Dec 2007 00:54:00 -0000 References: <5A2671EC-48B9-4492-A1E1-F346CE6811CC@latencyzero.com> X-Mailer: Apple Mail (2.915) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00323.txt.bz2 On Dec 17, 2007, at 4:43 PM, Rick Mann wrote: > Hi. I've built an xscale-elf toolchain from gcc-4.2.2, > binutils-2.17, newlib-1.15.0. I've used the exact same build > procedure on both Mac OS X 10.5 (gcc-4.0.1-based) and Cygwin (gcc > 3.4-based). > > Then I built our code and stripped the resulting binary with objcopy > on each platform. > > Both binaries seem to run the same. > > However, cmp shows many differences between the two resulting > binaries. Here are a few: > > $ cmp -l ~/h h | head -10 > 77 21 63 > 81 32 74 > 85 27 71 > 97 370 220 > 98 162 163 > 101 134 364 > 105 134 364 > 141 4 15 > 143 55 240 > 144 345 341 > > > Are these differences something to worry about? I've disassembled the .elf files, and here are some of the differences: Mac OS X: 8000804c : 8000804c: eb00a933 bl 80032520 <_init> 80008050: eb000c3c bl 8000b148
80008054: eb00a939 bl 80032540 <_fini> 80008058: eaffffe8 b 80008000 8000805c: e89da800 ldmia sp, {fp, sp, pc} ... 80008060 : 80008060: 80047390 mulhi r4, r0, r3 80008064 : 80008064: 803a51f4 ldrhisht r5, [sl], -r4 Cygwin: 8000804c : 8000804c: eb00a911 bl 80032498 <_init> 80008050: eb000c1a bl 8000b0c0
80008054: eb00a917 bl 800324b8 <_fini> 80008058: eaffffe8 b 80008000 8000805c: e89da800 ldmia sp, {fp, sp, pc} ... 80008060 : 80008060: 800472f8 strhid r7, [r4], -r8 80008064 : 80008064: 803a515c eorhis r5, sl, ip, asr r1 Some functions are placed in different order, too. I'm trying to ensure that all our developers build identical binaries. TIA, -- Rick