]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/kernel/module.c
[ARM] Improve non-executable support
[linux-2.6-omap-h63xx.git] / arch / arm / kernel / module.c
index 1b061583408ed7f44158a7dfcf7b996e56f7a53f..9203ba7d58eeaf7ce2ce05d8975c5bc9d3bd0793 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/moduleloader.h>
 #include <linux/kernel.h>
+#include <linux/mm.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
@@ -46,7 +47,7 @@ void *module_alloc(unsigned long size)
        if (!area)
                return NULL;
 
-       return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
+       return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
 }
 #else /* CONFIG_MMU */
 void *module_alloc(unsigned long size)
@@ -116,8 +117,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
 
                        offset += sym->st_value - loc;
                        if (offset & 3 ||
-                           offset <= (s32)0xfc000000 ||
-                           offset >= (s32)0x04000000) {
+                           offset <= (s32)0xfe000000 ||
+                           offset >= (s32)0x02000000) {
                                printk(KERN_ERR
                                       "%s: relocation out of range, section "
                                       "%d reloc %d sym '%s'\n", module->name,