[PW_SID:1128538] modpost: fix RISC-V randconfig section mismatch false positives#2292
[PW_SID:1128538] modpost: fix RISC-V randconfig section mismatch false positives#2292linux-riscv-bot wants to merge 3 commits into
Conversation
GCOV_PROFILE_ALL can make GCC emit constructor and metadata symbols that reference init or exit sections. modpost may then report section mismatches through generated symbols such as _sub_I_* and __gcov_.*, even though those references do not describe a normal section lifetime dependency in kernel code. RISC-V also uses local branch and PC-relative relocation pairs that can resolve through compiler local or mapping symbols near init or exit code. Treating those local relocations as ordinary lifetime references creates a large number of bogus section mismatch warnings. Teach modpost to keep the raw target symbol for generated-symbol checks and pass the relocation type into the mismatch filter. Ignore GCOV constructor and metadata symbols, compiler mapping symbols, and RISC-V local branch or PC-relative relocations when they target init or exit sections. This was seen with an rv32 randconfig using KCONFIG_SEED=277518 with CONFIG_GCOV_PROFILE_ALL=y, CONFIG_KCOV_INSTRUMENT_ALL=y and CONFIG_DEBUG_INFO_BTF=y, where modpost emitted a large number of bogus .text to .init.text section mismatch warnings through generated GCOV and local RISC-V symbols. This keeps named symbol section mismatch diagnostics while avoiding the warning flood from compiler-generated references. Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
RISC-V relative exception tables emit an R_RISCV_ADD32 and R_RISCV_SUB32 relocation pair for each field. modpost already ignores the SUB32 half, but still checks the ADD32 symbol section directly. After a relocatable link, that ADD32 symbol can name an unrelated local debug symbol. This makes modpost report that __ex_table references non-executable .debug* sections even though the original exception table entry points at text. Recognize the RISC-V ADD32/SUB32 pair for __ex_table. Ignore ADD32 entries that have been resolved to debug symbols, and otherwise validate the resolved relative target address against executable sections. This was seen with an rv32 randconfig using KCONFIG_SEED=4721 with CONFIG_MMU=y and CONFIG_DEBUG_INFO=y. The resulting vmlinux.o contains R_RISCV_ADD32/R_RISCV_SUB32 relocation pairs in __ex_table, and the fixed modpost run completes without the false .debug* section mismatch diagnostics. Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 1: "[1/2] modpost: ignore generated GCOV and RISC-V local relocs" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
|
Patch 2: "[2/2] modpost: handle RISC-V relative extable relocations" |
8ca72ef to
60e0882
Compare
PR for series 1128538 applied to workflow__riscv__fixes
Name: modpost: fix RISC-V randconfig section mismatch false positives
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1128538
Version: 1