[Bug ipa/64963] IPA Cloning/Splitting does not copy function section attributes resulting in kernel miscompilation

jgreenhalgh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 10 11:50:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64963

--- Comment #4 from James Greenhalgh <jgreenhalgh at gcc dot gnu.org> ---
The warning message given by the kernel build is:

WARNING: net/ipv4/built-in.o(.text.unlikely+0x10c): Section mismatch in
reference from the function ip_auto_config.part.6() to the function
.init.text:ic_is_init_dev()
The function ip_auto_config.part.6() references
the function __init ic_is_init_dev().
This is often because ip_auto_config.part.6 lacks a __init 
annotation or the annotation of ic_is_init_dev is wrong.

So we've ended up keeping around code for longer than was intended by cloning
it out of the init section.

If the implication is that code destined for user-defined sections might be
unsafe to clone, then surely we should turn off cloning for functions annotated
with __attribute__ ((section ("foo"))) ?



More information about the Gcc-bugs mailing list