From owner-freebsd-amd64@FreeBSD.ORG Sat Apr 16 00:20:39 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0878216A4CE for ; Sat, 16 Apr 2005 00:20:39 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 642F543D49 for ; Sat, 16 Apr 2005 00:20:38 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])j3G0Kbml016318; Sat, 16 Apr 2005 10:20:37 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) j3G0KZIo015671; Sat, 16 Apr 2005 10:20:36 +1000 Date: Sat, 16 Apr 2005 10:20:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Roland Smith In-Reply-To: <20050415220455.GB1698@slackbox.xs4all.nl> Message-ID: <20050416093349.I5888@epsplex.bde.org> References: <86k6ntw6f8.fsf@xps.des.no> <20050415220455.GB1698@slackbox.xs4all.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: freebsd-amd64@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE broken? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2005 00:20:39 -0000 On Sat, 16 Apr 2005, Roland Smith wrote: > On Fri, Apr 15, 2005 at 12:27:44PM -0700, Peter Wemm wrote: >> gcc-3.4 does entire-file optimization, while 3.3 and earlier look at >> functions at a time. As a result, gcc is now very good at finding >> static unused things. This doesn't explain it. Variables declared as "static const char []" have been specially handled by gcc for 15 years ago. gcc doesn't warn about ones that are not used in the source file, unlike ones declared as "static char []". This behaviour hasn't changed. What has changed is the removal of all unused static variables at optimization -O2 and higher. Removing the "static const char []" ones is just a bug, especially since it is done without warning. >> We might need to do something different. I'd almost like to insert >> the config file into its own ELF section via objcopy... You could just use the existing mechanism __IDSTRING(), preferably after fixing it to actually work. (__IDSTRING() generates invalid asm if the string has a newline in it. Among other bugs, this breaks most uses of __COPYRIGHT().) > Why not use gcc's __attribute__ ((unused))? Because it is unportable and backwards. __attribute__((used)) works. Putting the string in a separate section is better for an id string, but the attribute would be better than bogusly exporting the symbol for things like functions that are only intended to be called from debuggers. Bruce