Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757318AbZDURnc (ORCPT ); Tue, 21 Apr 2009 13:43:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756752AbZDURm7 (ORCPT ); Tue, 21 Apr 2009 13:42:59 -0400 Received: from BISCAYNE-ONE-STATION.MIT.EDU ([18.7.7.80]:41837 "EHLO biscayne-one-station.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756272AbZDURm6 convert rfc822-to-8bit (ORCPT ); Tue, 21 Apr 2009 13:42:58 -0400 Date: Tue, 21 Apr 2009 13:40:50 -0400 (EDT) From: Anders Kaseorg To: =?UTF-8?Q?Am=C3=A9rico_Wang?= cc: Tim Abbott , Linus Torvalds , Linux kernel mailing list , Waseem Daher , Denys Vlasenko , Rusty Russell , Andi Kleen , "H. Peter Anvin" , Stephen Rothwell , Jeff Arnold Subject: Re: [PATCH v2 0/4] Add support for compiling with -ffunction-sections -fdata-sections In-Reply-To: <20090421140228.GC3303@hack> Message-ID: References: <1238973278-31735-1-git-send-email-tabbott@mit.edu> <20090421140228.GC3303@hack> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Flag: NO X-Spam-Score: 0.00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1817 Lines: 39 On Tue, 21 Apr 2009, Américo Wang wrote: > Nice work! But, don't -ffunction-sections and -fdata-sections have > collisions with '-g' and 'gprof'? Just like what gcc(1) describes. That description seems to be long obsolete. gcc used to warn that -ffunction-sections may affect debugging, but that warning was disabled for ELF targets in 1999, presumably because ELF has always supported arbitrary section names even though some other object formats have issues. I know that debugging under -ffunction-sections -g works fine on at least x86, which is the only platform on which we currently propose to provide this option, and based on that message it looks like other platforms are fine too. > IIRIC, another project of linux kernel is trying to 'gprof' the kernel > too. gprof requires compiling with -pg, and yes, there is a conflict with -ffunction-sections -pg, as documented in the config help text. That is why CONFIG_FUNCTION_DATA_SECTIONS already depends on !CONFIG_FUNCTION_TRACER. Any external project that tries to add -pg to an -ffunction-sections kernel will get this warning from gcc: warning: -ffunction-sections disabled; it makes profiling impossible which makes the situation clear. This conflict appears to be bogus, and we have had no trouble with -ffunction-sections -pg after patching the conflict out of the gcc source. So we may eventually be able to remove it. Anders -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/