Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913AbZDZV5B (ORCPT ); Sun, 26 Apr 2009 17:57:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752074AbZDZV4u (ORCPT ); Sun, 26 Apr 2009 17:56:50 -0400 Received: from BISCAYNE-ONE-STATION.MIT.EDU ([18.7.7.80]:45149 "EHLO biscayne-one-station.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212AbZDZV4t (ORCPT ); Sun, 26 Apr 2009 17:56:49 -0400 Date: Sun, 26 Apr 2009 17:53:42 -0400 (EDT) From: Tim Abbott To: Sam Ravnborg cc: Linus Torvalds , Linux kernel mailing list , Anders Kaseorg , Waseem Daher , Denys Vlasenko , Rusty Russell , Andi Kleen , "H. Peter Anvin" , Stephen Rothwell , Jeff Arnold , Andrew Morton , Jon Masters , Masami Hiramatsu , "Theodore Ts'o" , Nikanth Karthikesan , Arjan van de Ven , Paul Mundt , =?ISO-8859-15?Q?Am=E9rico_Wang?= Subject: Re: [PATCH v3 1/3] Make section names compatible with -ffunction-sections -fdata-sections In-Reply-To: <20090426090906.GA27809@uranus.ravnborg.org> Message-ID: References: <1240519774-20307-1-git-send-email-tabbott@mit.edu> <20090424172358.GA21946@uranus.ravnborg.org> <20090426090906.GA27809@uranus.ravnborg.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: 2058 Lines: 50 On Sun, 26 Apr 2009, Sam Ravnborg wrote: > I was not specific in my last mail about this - but I assume you have > understood that the naming ".head.text" was selected so it is compatible > wiht -ffunction-sections. In other words no need for any ugly ".." here. Yes, I did notice this. However, I think that the ".text..foo" naming scheme is a better choice than the ".head.text" naming scheme. One advantage is that it works better if people add new assembly code in that section without using the proper macros. With ".head.text", if someone were to naively write ".section .head.text", the section would not have the SEC_ALLOC flag set. With ".text..head", gcc will assume the "ax" section flags, and everything will work fine. More importantly, the .head.text naming scheme fails for BSS sections. If you replace __attribute__((__section__(".bss.page_aligned"))); with __attribute__((__section__(".page_aligned.bss"))); then you get section flags of @progbits rather than @nobits, which is inappropriate for bss. The ".bss..page_aligned" naming scheme supports this just fine. Since it is desirable to have the Linux magic section names all use a single naming scheme, this is why we settled on the .text..foo section naming style. > We should try to be as consistent as possible across architectures here > so it is better to toach a few additiona files rather than adding macros > and the like to accept there sub-optimal section naming. I'm OK with doing this. But I prefer to avoid having ".head.text" appear in all these places as it encourages people to write new code using ".head.text". Also, as discussed above, we may want to change the name to ".text..head" for consistency in the future, and having everything use the macros makes this really easy. -Tim Abbott -- 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/