From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 11 22:42:12 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 EA0B737B401 for ; Fri, 11 Apr 2003 22:42:11 -0700 (PDT) Received: from cecov.masternet.it (cecov.masternet.it [194.184.65.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FB7A43FBD for ; Fri, 11 Apr 2003 22:42:10 -0700 (PDT) (envelope-from gmarco@scotty.masternet.it) Received: from usul.scotty.masternet.it (freebsd.giovannelli.com [194.184.65.139]) by cecov.masternet.it (8.12.9/8.12.9) with ESMTP id h3C5g70Y063852; Sat, 12 Apr 2003 07:42:19 +0200 (CEST) (envelope-from gmarco@scotty.masternet.it) Message-Id: <5.2.0.9.2.20030412071716.0257aeb8@194.184.65.7> X-Sender: gmarco@194.184.65.7 (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 12 Apr 2003 07:41:43 +0200 To: Leo Bicknell From: Gianmarco Giovannelli In-Reply-To: <20030411232651.GC55653@ussenterprise.ufp.org> References: <3E972F3E.8E86140E@mindspring.com> <5.2.0.9.2.20030411082040.02604e90@194.184.65.4> <5.2.0.9.2.20030411221904.011c5ec8@194.184.65.4> <3E972F3E.8E86140E@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed cc: hackers@freebsd.org 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: Sat, 12 Apr 2003 05:42:12 -0000 At 11/04/2003, you wrote: >In a message written on Fri, Apr 11, 2003 at 02:10:22PM -0700, Terry >Lambert wrote: > > Someone has already pointed out that one of the .o files is, in > > fact, handling uninitialized data differently on FreeBSD and Linux, > > so this is the source of your problem. I thought it was the lowest > > priority possibility, but I guess I was wrong. > >As the one who pointed it out, I'll remind you there are still two >possibilities. > >1) The programmer is using a system constant (eg, FILENAME_MAX from > stdio.h) to size some data structure, and the size of that constant > is wildly different on FreeBSD than Linux. It could be, but I think it is less probable than your second point... >2) The FreeBSD version is storing the (presumably zero filled) data > in the executable rather than allowing them to be initialized in > zero filled pages (.data vrs .bss, I believe). > >In my first post you'll notice there are, humm, 4 or 5 symbols that >make up all the space (2M and several 5M, I believe). I wasn't >going to study the code for them enough to see if they rely on >system constants are or declared global. The author should look at >those 4-5 symbols very closely and see about runtime allocation, >or if they depend on system constants. I think all the problem is this and it is located in globals.o which is about 17M. source_of_lonejoy/src> ll globals.o -rw-r--r-- 1 root wheel 17270956 Apr 11 17:57 globals.o or source_of_lonejoy/src> ll -h globals.o -rw-r--r-- 1 root wheel 16M Apr 11 17:57 globals.o In FreeBSD 4.8, gcc version 2.95.4 20020320 [FreeBSD] : nm -r --size-sort globals.o 01061860 D wp_version 01061800 D w_anim 01061788 D cwrap 01061720 D PacketSender 002190a0 D PacketFetcher 002180a0 D buffer 00111020 D region 000138a0 D location 00009b80 D spawnsp 00009b80 D ownsp 00009b80 D itemsp 00009b80 D glowsp 00009b80 D cspawnsp 00009b80 D cownsp 00009b80 D contsp 00009b80 D charsp 00008520 D menupriv_ 00006114 T strlwr 00006114 t gcc2_compiled. [...] In linux Debian 3.0, gcc 2.95.4 20011002 (Debian prerelease) nm -r --size-sort globals.o 0105c520 B wp_version 0105c4f0 B clConsole 0105c4c0 B w_anim 0105c4a0 B iwrap 0105c468 B cmultisp 0105c420 B PacketSender 002190a0 B PacketFetcher 002180a0 B buffer 00111020 B region 000138a0 B location 00009b80 B spawnsp 00009b80 B ownsp 00009b80 B itemsp 00009b80 B glowsp 00009b80 B cspawnsp 00009b80 B cownsp 00009b80 B contsp 00009b80 B charsp 00008520 B menupriv_ So the point is why Linux/mingw have a lot of things in bss while 4.8 (with the same gcc of linux debian 3.0 and 5.0 with the same gcc 3.2.1 of mingw) put them in Data ? Other thing: If you look the code (globals.cpp, the src is here: http://games.gimbo.org/uo/files/bin/lonewolf/cvs_src.tgz ) there is nothing that can let me to imagine such big size of datas. Thanks for your reply. Best Regards, Gianmarco Giovannelli , "Unix expert since yesterday" http://www.gufi.org/~gmarco