]> git.baikalelectronics.ru Git - kernel.git/commit
modpost: don't emit section mismatch warnings for compiler optimizations
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 20 Apr 2015 00:50:40 +0000 (10:20 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 22 Apr 2015 08:01:34 +0000 (17:31 +0930)
commit481dfad4e16443231ec9a71b22a40f0fda13d82f
treef2b4c93e1239befe1acc257b683bbba6c1ef8ff1
parent5582b0279e896cc2041e97ee1ed863fda84e3cdb
modpost: don't emit section mismatch warnings for compiler optimizations

Currently an allyesconfig build [gcc-4.9.1] can generate the following:

   WARNING: vmlinux.o(.text.unlikely+0x3864): Section mismatch in
   reference from the function cpumask_empty.constprop.3() to the
   variable .init.data:nmi_ipi_mask

which comes from the cpumask_empty usage in arch/x86/kernel/nmi_selftest.c.

Normally we would not see a symbol entry for cpumask_empty since it is:

static inline bool cpumask_empty(const struct cpumask *srcp)

however in this case, the variant of the symbol gets emitted when GCC does
constant propagation optimization.

Fix things up so that any locally optimized constprop variants don't warn
when accessing variables that live in the __init sections.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
scripts/mod/modpost.c