]> git.baikalelectronics.ru Git - kernel.git/commit
modpost: Get proper section index by get_secindex() instead of st_shndx
authorXiao Yang <yangx.jy@cn.fujitsu.com>
Wed, 18 Mar 2020 10:34:16 +0000 (18:34 +0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 18 Mar 2020 16:44:25 +0000 (01:44 +0900)
commit3b0c8f00a759f5d49fd7525a09ac1f9e2870d100
tree3c66d858c05e55a24bc624db84767aa6f7aa09dd
parentc591f581746b1497b159cd28514801d330705d90
modpost: Get proper section index by get_secindex() instead of st_shndx

(uint16_t) st_shndx is limited to 65535(i.e. SHN_XINDEX) so sym_get_data() gets
wrong section index by st_shndx if requested symbol contains extended section
index that is more than 65535.  In this case, we need to get proper section index
by .symtab_shndx section.

Module.symvers generated by building kernel with "-ffunction-sections -fdata-sections"
shows the issue.

Fixes: 9682c4d1eeb7 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
Fixes: 8b31164762c6 ("modpost: refactor namespace_from_kstrtabns() to not hard-code section name")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c