Messages in this thread | | | Date | Sun, 5 Mar 2006 20:06:59 +0000 | From | Al Viro <> | Subject | Re: kbuild - status on section mismatch warnings |
| |
On Sun, Mar 05, 2006 at 08:30:12PM +0100, Sam Ravnborg wrote: > During the last weeks I have worked on improved support for section > mismatch checks. > > When a function is marked __init then the implementation will be placed > in a section named .init.text - that section will be discarded by > vmlinux when the module is initialised. > So therefore any references to function marked __init are subject to > references to functions that may suddenly disappear.
Now try x86 with sd.o non-modular. And see
__init foo() { .... switch(n) { .... .... } }
compiling essentially into
if (n < lower || n > upper) goto Ldefault; addr = const_array_of_labels[n - lower]; goto addr;
with const_array_of_labels sitting in .rodata and its contents pointing inside foo(), i.e. into .init.text. And yes, .init.text is discarded, while .rodata is left intact. Since the only reference to that array disappears along with .init.text *and* section where array goes into is hardwired into gcc, we a) are actually OK and b) can't do anything about that false positive, AFAICS. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |