From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759360AbYBEVRS (ORCPT ); Tue, 5 Feb 2008 16:17:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758829AbYBEVRH (ORCPT ); Tue, 5 Feb 2008 16:17:07 -0500 Received: from pasmtpb.tele.dk ([80.160.77.98]:37026 "EHLO pasmtpB.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758438AbYBEVRG (ORCPT ); Tue, 5 Feb 2008 16:17:06 -0500 Date: Tue, 5 Feb 2008 22:17:10 +0100 From: Sam Ravnborg To: Ingo Molnar Cc: Linus Torvalds , Thomas Gleixner , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [git pull] x86 updates Message-ID: <20080205211710.GA27589@uranus.ravnborg.org> References: <20080204161219.GA8092@elte.hu> <20080205192236.GA26426@uranus.ravnborg.org> <20080205210508.GA14708@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080205210508.GA14708@elte.hu> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 05, 2008 at 10:05:08PM +0100, Ingo Molnar wrote: > > * Sam Ravnborg wrote: > > > On Tue, Feb 05, 2008 at 10:47:07AM -0800, Linus Torvalds wrote: > > > > > > > > > Ingo, Thomas, > > > should we not do this? > > > > > > Otherwise, it seems we generate a section that isn't allocated? > > > > > > I think toolchain should add the right flags automatically for > > > sections that start with ".[ro]data" and ".text", but not for the > > > kernel-specific ".init.*" sections. > > > > With a bit of help from the bin-utils people (Alan Modra) I recently > > discovered that the linker generate sections with different names when > > the flags differs, so fogetting "aw" casues the linekr to generate a > > section named .init.data.1 (or some other number). But I nevet got to > > investigate if ld does something magically with these autogenerated > > section names. But I added a check in modpost and it should warn about > > the code below. > > > > I would prefer the use of > > __CPUINITDATA > > __FINITDATA > > > > as defined in linux/init.h but otherwise - yes it should be fixed. > > With the use of __CPUINITDATA we can kill the ifdef too. > > ok, i've queued up your patch. > > btw., __CPUINITDATA/__FINITDATA is nice, except that the small patch > below is needed to make the fun complete ;-) > > or, we could use __FINIT all the time. I have no strong preference - I do not like the naming of __FINIT but maybe thats just me and I have no better name right now. > > btw., what's the practical consequence of getting these section flags > wrong - for example writable data can end up in executable section > accidentally and be marked readonly by RODATA? Or can anything more > serious happen? (they cannot get into any of the discarded sections, we > filter for them explicitly in the linker scripts) I have not investigated this. My attention were due to section mismatch warnings pointing to section names I could not find in the code. When I did an objdump of vmlinux the funny section names were gone so I expected ld had recognized them and merged them somehow - but I did not look closer as my focus was to get rid of them anyway. I also did a quick skimming of info ld - but no luck. Sam