lkml.org 
[lkml]   [2008]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [git pull] x86 updates

* Sam Ravnborg <sam@ravnborg.org> 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.

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)

Ingo

---
include/linux/init.h | 1 +
1 file changed, 1 insertion(+)

Index: linux-x86.q/include/linux/init.h
===================================================================
--- linux-x86.q.orig/include/linux/init.h
+++ linux-x86.q/include/linux/init.h
@@ -110,6 +110,7 @@
#define __FINIT .previous

#define __INITDATA .section ".init.data","aw"
+#define __FINITDATA .previous

#define __DEVINIT .section ".devinit.text", "ax"
#define __DEVINITDATA .section ".devinit.data", "aw"


\
 
 \ /
  Last update: 2008-02-05 22:07    [W:0.071 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site