diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
| -rw-r--r-- | scripts/mod/file2alias.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 5758aab0d8bb..88f3f07205f8 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -884,16 +884,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 884 | char *zeros = NULL; | 884 | char *zeros = NULL; |
| 885 | 885 | ||
| 886 | /* We're looking for a section relative symbol */ | 886 | /* We're looking for a section relative symbol */ |
| 887 | if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum) | 887 | if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) |
| 888 | return; | 888 | return; |
| 889 | 889 | ||
| 890 | /* Handle all-NULL symbols allocated into .bss */ | 890 | /* Handle all-NULL symbols allocated into .bss */ |
| 891 | if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) { | 891 | if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { |
| 892 | zeros = calloc(1, sym->st_size); | 892 | zeros = calloc(1, sym->st_size); |
| 893 | symval = zeros; | 893 | symval = zeros; |
| 894 | } else { | 894 | } else { |
| 895 | symval = (void *)info->hdr | 895 | symval = (void *)info->hdr |
| 896 | + info->sechdrs[sym->st_shndx].sh_offset | 896 | + info->sechdrs[get_secindex(info, sym)].sh_offset |
| 897 | + sym->st_value; | 897 | + sym->st_value; |
| 898 | } | 898 | } |
| 899 | 899 | ||
