KVM: VMX: Remove vmx->msr_offset_efer
[safe/jmp/linux-2.6] / kernel / module.c
index c54f10d..5842a71 100644 (file)
@@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
 
        /* Count loaded sections and allocate structures */
        for (i = 0; i < nsect; i++)
-               if (sechdrs[i].sh_flags & SHF_ALLOC)
+               if (sechdrs[i].sh_flags & SHF_ALLOC
+                   && sechdrs[i].sh_size)
                        nloaded++;
        size[0] = ALIGN(sizeof(*sect_attrs)
                        + nloaded * sizeof(sect_attrs->attrs[0]),
@@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
        for (i = 0; i < nsect; i++) {
                if (! (sechdrs[i].sh_flags & SHF_ALLOC))
                        continue;
+               if (!sechdrs[i].sh_size)
+                       continue;
                sattr->address = sechdrs[i].sh_addr;
                sattr->name = kstrdup(secstrings + sechdrs[i].sh_name,
                                        GFP_KERNEL);
@@ -1992,12 +1995,14 @@ static inline unsigned long layout_symtab(struct module *mod,
                                          Elf_Shdr *sechdrs,
                                          unsigned int symindex,
                                          unsigned int strindex,
-                                         const Elf_Hdr *hdr,
+                                         const Elf_Ehdr *hdr,
                                          const char *secstrings,
                                          unsigned long *pstroffs,
                                          unsigned long *strmap)
 {
+       return 0;
 }
+
 static inline void add_kallsyms(struct module *mod,
                                Elf_Shdr *sechdrs,
                                unsigned int shnum,
@@ -2081,9 +2086,8 @@ static noinline struct module *load_module(void __user *umod,
        struct module *mod;
        long err = 0;
        void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
-#ifdef CONFIG_KALLSYMS
        unsigned long symoffs, stroffs, *strmap;
-#endif
+
        mm_segment_t old_fs;
 
        DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n",
@@ -2523,8 +2527,8 @@ static noinline struct module *load_module(void __user *umod,
  free_unload:
        module_unload_free(mod);
 #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
- free_init:
        percpu_modfree(mod->refptr);
+ free_init:
 #endif
        module_free(mod, mod->module_init);
  free_core:
@@ -3091,7 +3095,6 @@ void module_layout(struct module *mod,
                   struct modversion_info *ver,
                   struct kernel_param *kp,
                   struct kernel_symbol *ks,
-                  struct marker *marker,
                   struct tracepoint *tp)
 {
 }