Merge branch 'p2v' into devel
[firefly-linux-kernel-4.4.55.git] / arch / arm / kernel / module.c
index 6fcf22cf385ca3b4fd5656f18d1ee4d415b8e66e..fee7c36349eb6c137e7c578946968e20caf35910 100644 (file)
@@ -283,12 +283,13 @@ static const Elf_Shdr *find_mod_section(const Elf32_Ehdr *hdr,
        return NULL;
 }
 
+extern void fixup_pv_table(const void *, unsigned long);
 extern void fixup_smp(const void *, unsigned long);
 
 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
                    struct module *mod)
 {
-       const Elf_Shdr * __maybe_unused s = NULL;
+       const Elf_Shdr *s = NULL;
 #ifdef CONFIG_ARM_UNWIND
        const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
        const Elf_Shdr *sechdrs_end = sechdrs + hdr->e_shnum;
@@ -332,6 +333,11 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
                                                 maps[i].unw_sec->sh_size,
                                                 maps[i].txt_sec->sh_addr,
                                                 maps[i].txt_sec->sh_size);
+#endif
+#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
+       s = find_mod_section(hdr, sechdrs, ".pv_table");
+       if (s)
+               fixup_pv_table((void *)s->sh_addr, s->sh_size);
 #endif
        s = find_mod_section(hdr, sechdrs, ".alt.smp.init");
        if (s && !is_smp())