summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2017-02-20 20:24:00 +0300
committerJ. Bruce Fields <bfields@redhat.com>2017-02-21 01:20:05 +0300
commit60709c093ed39aadb0f09972ebbc96dc34eb372e (patch)
tree983681311986070971d3756d9f8e75868aa7bb9a /scripts/mod
parent7323f0d2881bbd426ce6bc0a956ef9e739ffe767 (diff)
parent0839ffb83e44e5ff1843e932592525fc2bff23ff (diff)
downloadlinux-60709c093ed39aadb0f09972ebbc96dc34eb372e.tar.xz
nfsd: merge stable fix into main nfsd branch
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 29c89a6bad3d..4dedd0d3d3a7 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -621,6 +621,16 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
is_crc = true;
crc = (unsigned int) sym->st_value;
+ if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) {
+ unsigned int *crcp;
+
+ /* symbol points to the CRC in the ELF object */
+ crcp = (void *)info->hdr + sym->st_value +
+ info->sechdrs[sym->st_shndx].sh_offset -
+ (info->hdr->e_type != ET_REL ?
+ info->sechdrs[sym->st_shndx].sh_addr : 0);
+ crc = *crcp;
+ }
sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
export);
}