From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 11 11:19:47 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6D7737B401 for ; Fri, 11 Apr 2003 11:19:47 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 385F343FCB for ; Fri, 11 Apr 2003 11:19:47 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.8p1/8.12.3) with ESMTP id h3BIJlBp094308; Fri, 11 Apr 2003 11:19:47 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.8p1/8.12.3/Submit) id h3BIJllK094307; Fri, 11 Apr 2003 11:19:47 -0700 (PDT) (envelope-from rizzo) Date: Fri, 11 Apr 2003 11:19:46 -0700 From: Luigi Rizzo To: hackers@freebsd.org Message-ID: <20030411111946.A94272@xorpc.icir.org> References: <5.2.0.9.2.20030411082040.02604e90@194.184.65.4> <20030411140738.GA40724@ussenterprise.ufp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030411140738.GA40724@ussenterprise.ufp.org>; from bicknell@ufp.org on Fri, Apr 11, 2003 at 10:07:38AM -0400 Subject: Re: gcc iussue or ... ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 18:19:47 -0000 On Fri, Apr 11, 2003 at 10:07:38AM -0400, Leo Bicknell wrote: > In a message written on Fri, Apr 11, 2003 at 08:41:37AM +0200, Gianmarco Giovannelli wrote: > > The problem is that if I compile it under FreeBSD it is a binary of 19M, > > while on linux (debian 3.0), same Makefile, is only 2MB. FreeBSD 5.0 and > > OpenBSD 3.1 produce the (about) 19M file. > > Well, the problem location is fairly obvious: > > % ls -lags | sort -nr | more > 19416 -rwxr-xr-x 1 bicknell wheel 19854956 Apr 11 09:49 lonewolf* > 16912 -rw-r--r-- 1 bicknell wheel 17286792 Apr 11 09:42 globals.o ... > may be making them bigger than you expected. It could also be that > FreeBSD puts some types of globals in the executable to load, where as which was exactly the question -- the same exact source code, compiled with the same compiler flags (and i think even the same compiler), produces the two different results. My suspect was that somehow some of the compiler's header files on FreeBSD explicitly initializes (to 0) some member of some class thus resulting in having them in the .data section instead of .bss cheers luigi