Merge ../linus
[linux-drm-fsl-dcu.git] / arch / arm / kernel / module.c
index 6055e1427ba35819132623b297583cb2484215c6..1b061583408ed7f44158a7dfcf7b996e56f7a53f 100644 (file)
@@ -2,6 +2,7 @@
  *  linux/arch/arm/kernel/module.c
  *
  *  Copyright (C) 2002 Russell King.
+ *  Modified for nommu by Hyok S. Choi
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -9,7 +10,6 @@
  *
  * Module allocation method suggested by Andi Kleen.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleloader.h>
 #include <linux/kernel.h>
@@ -33,6 +33,7 @@ extern void _etext;
 #define MODULE_START   (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
 #endif
 
+#ifdef CONFIG_MMU
 void *module_alloc(unsigned long size)
 {
        struct vm_struct *area;
@@ -47,6 +48,12 @@ void *module_alloc(unsigned long size)
 
        return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
 }
+#else /* CONFIG_MMU */
+void *module_alloc(unsigned long size)
+{
+       return size == 0 ? NULL : vmalloc(size);
+}
+#endif /* !CONFIG_MMU */
 
 void module_free(struct module *module, void *region)
 {
@@ -101,6 +108,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
                        break;
 
                case R_ARM_PC24:
+               case R_ARM_CALL:
+               case R_ARM_JUMP24:
                        offset = (*(u32 *)loc & 0x00ffffff) << 2;
                        if (offset & 0x02000000)
                                offset -= 0x04000000;