2006-02-20 06:33:04

by Luke Yang

[permalink] [raw]
Subject: [PATCH] Fix undefined symbols for nommu architecture --improved version

Hi,

This is the improved version of my last email patch. Thanks for
Andrew's advice. The "randomize_va_space" is defined as a macro
instead of an variable. I saw the previous patch is accepted, is it OK
to resend a modified patch?

To add or export some undefined symbols in nommu
architectures (mm/nommu.c). Based on latest mm-tree.

Signed-off-by: Luke Yang <[email protected]>

Index: git/linux-2.6/mm/nommu.c
===================================================================
--- git.orig/linux-2.6/mm/nommu.c 2006-02-17 17:40:34.000000000 +0800
+++ git/linux-2.6/mm/nommu.c 2006-02-20 12:09:32.000000000 +0800
@@ -57,7 +57,10 @@
EXPORT_SYMBOL(vfree);
EXPORT_SYMBOL(vmalloc_to_page);
EXPORT_SYMBOL(vmalloc_32);
+EXPORT_SYMBOL(vmap);
+EXPORT_SYMBOL(vunmap);

+#define randomize_va_space 0
/*
* Handle all mappings that got truncated by a "truncate()"
* system call.
--
Best regards,
Luke Yang
[email protected]; [email protected]


2006-02-20 06:41:18

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Fix undefined symbols for nommu architecture --improved version

"Luke Yang" <[email protected]> wrote:
>
> Index: git/linux-2.6/mm/nommu.c
> ===================================================================
> --- git.orig/linux-2.6/mm/nommu.c 2006-02-17 17:40:34.000000000 +0800
> +++ git/linux-2.6/mm/nommu.c 2006-02-20 12:09:32.000000000 +0800
> @@ -57,7 +57,10 @@
> EXPORT_SYMBOL(vfree);
> EXPORT_SYMBOL(vmalloc_to_page);
> EXPORT_SYMBOL(vmalloc_32);
> +EXPORT_SYMBOL(vmap);
> +EXPORT_SYMBOL(vunmap);
>
> +#define randomize_va_space 0
> /*
> * Handle all mappings that got truncated by a "truncate()"
> * system call.

That can't be right - the #define should be in a header file - mm.h:

#ifdef CONFIG_NOMMU
#define randomize_va_space 0
#else
extern int randomize_va_space;
#endif

Are you sure you test-compiled this?

2006-02-20 07:40:11

by Luke Yang

[permalink] [raw]
Subject: Re: [PATCH] Fix undefined symbols for nommu architecture --improved version

Hi,

This is renewed patch. Tested on Blackfin platform.

Signed-off-by: Luke Yang <[email protected]>

Index: git/linux-2.6/mm/nommu.c
===================================================================
--- git.orig/linux-2.6/mm/nommu.c 2006-02-20 12:33:25.000000000 +0800
+++ git/linux-2.6/mm/nommu.c 2006-02-20 15:12:08.000000000 +0800
@@ -57,6 +57,8 @@
EXPORT_SYMBOL(vfree);
EXPORT_SYMBOL(vmalloc_to_page);
EXPORT_SYMBOL(vmalloc_32);
+EXPORT_SYMBOL(vmap);
+EXPORT_SYMBOL(vunmap);

/*
* Handle all mappings that got truncated by a "truncate()"
Index: git/linux-2.6/include/linux/mm.h
===================================================================
--- git.orig/linux-2.6/include/linux/mm.h 2006-02-20 15:25:21.000000000 +0800
+++ git/linux-2.6/include/linux/mm.h 2006-02-20 15:26:24.000000000 +0800
@@ -1051,7 +1051,11 @@
void drop_pagecache(void);
void drop_slab(void);

+#ifndef CONFIG_MMU
+#define randomize_va_space 0
+#else
extern int randomize_va_space;
+#endif

#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
Index: git/linux-2.6/kernel/sysctl.c
===================================================================
--- git.orig/linux-2.6/kernel/sysctl.c 2006-02-20 15:26:47.000000000 +0800
+++ git/linux-2.6/kernel/sysctl.c 2006-02-20 15:27:22.000000000 +0800
@@ -638,6 +638,7 @@
.proc_handler = &proc_dointvec,
},
#endif
+#if defined(CONFIG_MMU)
{
.ctl_name = KERN_RANDOMIZE,
.procname = "randomize_va_space",
@@ -646,6 +647,7 @@
.mode = 0644,
.proc_handler = &proc_dointvec,
},
+#endif
#if defined(CONFIG_S390) && defined(CONFIG_SMP)
{
.ctl_name = KERN_SPIN_RETRY,


On 2/20/06, Andrew Morton <[email protected]> wrote:
> "Luke Yang" <[email protected]> wrote:
> >
> > Index: git/linux-2.6/mm/nommu.c
> > ===================================================================
> > --- git.orig/linux-2.6/mm/nommu.c 2006-02-17 17:40:34.000000000 +0800
> > +++ git/linux-2.6/mm/nommu.c 2006-02-20 12:09:32.000000000 +0800
> > @@ -57,7 +57,10 @@
> > EXPORT_SYMBOL(vfree);
> > EXPORT_SYMBOL(vmalloc_to_page);
> > EXPORT_SYMBOL(vmalloc_32);
> > +EXPORT_SYMBOL(vmap);
> > +EXPORT_SYMBOL(vunmap);
> >
> > +#define randomize_va_space 0
> > /*
> > * Handle all mappings that got truncated by a "truncate()"
> > * system call.
>
> That can't be right - the #define should be in a header file - mm.h:
>
> #ifdef CONFIG_NOMMU
> #define randomize_va_space 0
> #else
> extern int randomize_va_space;
> #endif
>
> Are you sure you test-compiled this?
Sorry, nommu.c was compiled but the error still exists at the end of
compilation. This time it is right.

>


--
Best regards,
Luke Yang
[email protected]; [email protected]

2006-02-20 10:35:21

by David Howells

[permalink] [raw]
Subject: Re: [PATCH] Fix undefined symbols for nommu architecture --improved version

Luke Yang <[email protected]> wrote:

> +#ifndef CONFIG_MMU
> +#define randomize_va_space 0
> +#else
> extern int randomize_va_space;
> +#endif

Acked-By: David Howells <[email protected]>