summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-02-19 09:56:18 +0100
committerSam Ravnborg <sam@mars.ravnborg.org>2006-02-19 09:56:18 +0100
commit8ea80ca4f583e377c902811d42626ccfce16913f (patch)
tree2208839aa866cebc990271fbaa86eabc432a8658 /scripts/mod/modpost.c
parent41370d3b5ec6401c5cf0df82297ed989c03a64bd (diff)
downloadlinux-3.10-8ea80ca4f583e377c902811d42626ccfce16913f.tar.gz
linux-3.10-8ea80ca4f583e377c902811d42626ccfce16913f.tar.bz2
linux-3.10-8ea80ca4f583e377c902811d42626ccfce16913f.zip
kbuild: fix segfault in modpost
Do not try to look up section name until we know it is not a special section. Otherwise we will address outside legal space and segfault. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a7360c379cb..eeaf5747682 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -576,11 +576,11 @@ static void check_sec_ref(struct module *mod, const char *modname,
r.r_offset = TO_NATIVE(rela->r_offset);
r.r_info = TO_NATIVE(rela->r_info);
sym = elf->symtab_start + ELF_R_SYM(r.r_info);
- secname = secstrings + sechdrs[sym->st_shndx].sh_name;
/* Skip special sections */
if (sym->st_shndx >= SHN_LORESERVE)
continue;
+ secname = secstrings + sechdrs[sym->st_shndx].sh_name;
if (section(secname))
warn_sec_mismatch(modname, name, elf, sym, r);
}