aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 220213e603db..33f436328f9a 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -839,16 +839,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
839 char *zeros = NULL; 839 char *zeros = NULL;
840 840
841 /* We're looking for a section relative symbol */ 841 /* We're looking for a section relative symbol */
842 if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum) 842 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
843 return; 843 return;
844 844
845 /* Handle all-NULL symbols allocated into .bss */ 845 /* Handle all-NULL symbols allocated into .bss */
846 if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) { 846 if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
847 zeros = calloc(1, sym->st_size); 847 zeros = calloc(1, sym->st_size);
848 symval = zeros; 848 symval = zeros;
849 } else { 849 } else {
850 symval = (void *)info->hdr 850 symval = (void *)info->hdr
851 + info->sechdrs[sym->st_shndx].sh_offset 851 + info->sechdrs[get_secindex(info, sym)].sh_offset
852 + sym->st_value; 852 + sym->st_value;
853 } 853 }
854 854