Merge commit 'v2.6.35' into kbuild/kbuild
[sfrench/cifs-2.6.git] / scripts / mod / file2alias.c
index 5758aab0d8bb6c8f401b8e2e8374432007ba172b..88f3f07205f88647e5665858f40fde875deec763 100644 (file)
@@ -884,16 +884,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
        char *zeros = NULL;
 
        /* We're looking for a section relative symbol */
        char *zeros = NULL;
 
        /* We're looking for a section relative symbol */
-       if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum)
+       if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
                return;
 
        /* Handle all-NULL symbols allocated into .bss */
                return;
 
        /* Handle all-NULL symbols allocated into .bss */
-       if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) {
+       if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
                zeros = calloc(1, sym->st_size);
                symval = zeros;
        } else {
                symval = (void *)info->hdr
                zeros = calloc(1, sym->st_size);
                symval = zeros;
        } else {
                symval = (void *)info->hdr
-                       + info->sechdrs[sym->st_shndx].sh_offset
+                       + info->sechdrs[get_secindex(info, sym)].sh_offset
                        + sym->st_value;
        }
 
                        + sym->st_value;
        }