Bug: MODPOST mismatch ignored due to LTO

From: Vincent Donnefort
Date: Thu Nov 24 2022 - 07:31:40 EST


Hi all,

It seems that enabling LTO breaks the check for section mismatch in modpost.

If I create on purpose a mismatch here's the output without LTO

check_section_mismatch()
fromsec=.text
tosec=.init.text
sym=kvm_arch_vcpu_create

=> section mismatch in reference: kvm_vm_ioctl_create_vcpu (section: .text) -> kvm_arch_vcpu_create (section: .init.text)

While with LTO:

check_section_mismatch()
fromsec=.text.kvm_vm_ioctl_create_vcpu
tosec=.init.text
sym=kvm_arch_vcpu_create

=> mismatch ignored, the section ".text.kvm_vm_ioctl_create_vcpu" is
unsurprisingly unknown

LTO seems to append the symbol name to the section which is a problem for
modpost.

Is that a known issue?

Thanks,
Vincent