From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 12 18:26:46 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 E83FD37B401 for ; Sat, 12 Apr 2003 18:26:46 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id D49E343F3F for ; Sat, 12 Apr 2003 18:26:45 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.9/8.12.7) with ESMTP id h3D1QbD0076977; Sat, 12 Apr 2003 18:26:37 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.9/8.12.9/Submit) id h3D1Qas4076976; Sat, 12 Apr 2003 18:26:36 -0700 (PDT) Date: Sat, 12 Apr 2003 18:26:36 -0700 From: "David O'Brien" To: Loren James Rittle Message-ID: <20030413012636.GA76030@dragon.nuxi.com> Mail-Followup-To: David O'Brien , Loren James Rittle , hackers@freebsd.org, gmarco@giovannelli.it References: <5.2.0.9.2.20030411082040.02604e90@194.184.65.4> <200304120241.h3C2fQCc061882@latour.rsch.comm.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200304120241.h3C2fQCc061882@latour.rsch.comm.mot.com> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: hackers@freebsd.org cc: gmarco@giovannelli.it Subject: Re: gcc iussue or ... ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: hackers@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2003 01:26:47 -0000 On Fri, Apr 11, 2003 at 09:41:26PM -0500, Loren James Rittle wrote: > In article <5.2.0.9.2.20030411082040.02604e90@194.184.65.4> you write: > > The problem is very simple. I mantain a unix/linux port of a UO > > emulator which works really fine natively under FreeBSD. > > Thank you for this report. Please consider this question: What > versions of g++/binutils were used on the various platforms? Please > know this: There is a per-platform and per-binutils version influence > on mapping of program data/BSS to ELF section. g++ 3.3 with recent > binutils on FreeBSD *will* allocate data as you saw on debian 3.0 > (with a compiler version you didn't report). > > Created with g++ 3.3 (prerelease) with binutils 2.13.2.1: > > ; size lonewolf > text data bss dec hex filename > 1792215 49768 21850592 23692575 169851f lonewolf > ; ls -l lonewolf > -rwxr-xr-x 1 rittle wheel 1992568 Apr 11 20:18 lonewolf* Hi Loren, Are you setup to easily try this with your g++ 3.3 binary + stock system binutils? It looks like this is due to the fact BSD's don't define either ASM_OUTPUT_BSS or ASM_OUTPUT_ALIGNED_BSS. From cp/decl.c: #if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS) /* Tell the back-end to use or not use .common as appropriate. If we say -fconserve-space, we want this to save .data space, at the expense of wrong semantics. If we say -fno-conserve-space, we want this to produce errors about redefs; to do this we force variables into the data segment. */ DECL_COMMON (tem) = flag_conserve_space || ! TREE_PUBLIC (tem); #endif I'm not sure we should change FreeBSD to do something that purposfully produces wrong semantics. From your test it sounds like either GCC 3.3 or Binutils 2.13.2.1 changes things for us. I haven't updated FreeBSD to 2.13.2.1 as the changes from 2.13.2 don't really change any of the FreeBSD architectures. The behavior change is probably due to improved g++ utilization of ELF features, or your FreeBSD-related bug fixes in 3.3. -- -- David (obrien@FreeBSD.org)