]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/moduleloader.h
Merge branch 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux
[karo-tx-linux.git] / include / linux / moduleloader.h
index b2be02ebf453df40cb07ab7fdfa261903fa44c11..560ca53a75fa629b1be138b07f865f95c07b2bb3 100644 (file)
@@ -28,21 +28,49 @@ void *module_alloc(unsigned long size);
 /* Free memory returned from module_alloc. */
 void module_free(struct module *mod, void *module_region);
 
-/* Apply the given relocation to the (simplified) ELF.  Return -error
-   or 0. */
+/*
+ * Apply the given relocation to the (simplified) ELF.  Return -error
+ * or 0.
+ */
+#ifdef CONFIG_MODULES_USE_ELF_REL
 int apply_relocate(Elf_Shdr *sechdrs,
                   const char *strtab,
                   unsigned int symindex,
                   unsigned int relsec,
                   struct module *mod);
+#else
+static inline int apply_relocate(Elf_Shdr *sechdrs,
+                                const char *strtab,
+                                unsigned int symindex,
+                                unsigned int relsec,
+                                struct module *me)
+{
+       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+       return -ENOEXEC;
+}
+#endif
 
-/* Apply the given add relocation to the (simplified) ELF.  Return
-   -error or 0 */
+/*
+ * Apply the given add relocation to the (simplified) ELF.  Return
+ * -error or 0
+ */
+#ifdef CONFIG_MODULES_USE_ELF_RELA
 int apply_relocate_add(Elf_Shdr *sechdrs,
                       const char *strtab,
                       unsigned int symindex,
                       unsigned int relsec,
                       struct module *mod);
+#else
+static inline int apply_relocate_add(Elf_Shdr *sechdrs,
+                                    const char *strtab,
+                                    unsigned int symindex,
+                                    unsigned int relsec,
+                                    struct module *me)
+{
+       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+       return -ENOEXEC;
+}
+#endif
 
 /* Any final processing of module before access.  Return -error or 0. */
 int module_finalize(const Elf_Ehdr *hdr,