# Kernel Compile - Mismatch errors and Warnings

## rahulthewall

```

WARNING: arch/x86/kernel/built-in.o(.text+0x113e4): Section mismatch in reference from the function cpu_exit_clear() to the function .cpuinit.text:cpu_uninit()

The function cpu_exit_clear() references

the function __cpuinit cpu_uninit().

This is often because cpu_exit_clear lacks a __cpuinit 

annotation or the annotation of cpu_uninit is wrong.

WARNING: kernel/built-in.o(.text+0x323f6): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain

The function take_cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because take_cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.text+0x32496): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.text+0x32503): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.text+0x32578): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.text+0x32635): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.text+0x327a0): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain

The function unregister_cpu_notifier() references

the variable __cpuinitdata cpu_chain.

This is often because unregister_cpu_notifier lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: kernel/built-in.o(.data+0x290): Section mismatch in reference from the variable profile_cpu_callback_nb.18659 to the function .devinit.text:profile_cpu_callback()

The variable profile_cpu_callback_nb.18659 references

the function __devinit profile_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: kernel/built-in.o(.data+0x1c88): Section mismatch in reference from the variable workqueue_cpu_callback_nb.13047 to the function .devinit.text:workqueue_cpu_callback()

The variable workqueue_cpu_callback_nb.13047 references

the function __devinit workqueue_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

mm/mmap.c: In function 'insert_vm_struct':

mm/mmap.c:2075: warning: 'rb_parent' may be used uninitialized in this function

mm/mmap.c:2075: warning: 'rb_link' may be used uninitialized in this function

mm/mmap.c:2074: warning: 'prev' may be used uninitialized in this function

mm/mmap.c: In function 'copy_vma':

mm/mmap.c:2114: warning: 'rb_parent' may be used uninitialized in this function

mm/mmap.c:2114: warning: 'rb_link' may be used uninitialized in this function

mm/mmap.c:2113: warning: 'prev' may be used uninitialized in this function

mm/mmap.c: In function 'do_brk':

mm/mmap.c:1941: warning: 'rb_parent' may be used uninitialized in this function

mm/mmap.c:1941: warning: 'rb_link' may be used uninitialized in this function

mm/mmap.c:1939: warning: 'prev' may be used uninitialized in this function

mm/mmap.c: In function 'mmap_region':

mm/mmap.c:1087: warning: 'rb_parent' may be used uninitialized in this function

mm/mmap.c:1087: warning: 'rb_link' may be used uninitialized in this function

mm/mmap.c:1084: warning: 'prev' may be used uninitialized in this function

WARNING: mm/built-in.o(.data+0x10a4): Section mismatch in reference from the variable cpu_callback_nb.23231 to the function .devinit.text:cpu_callback()

The variable cpu_callback_nb.23231 references

the function __devinit cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

fs/cifs/dir.c: In function 'cifs_ci_compare':

fs/cifs/dir.c:583: warning: passing argument 1 of '__constant_memcpy' discards qualifiers from pointer target type

fs/cifs/dir.c:583: warning: passing argument 1 of '__memcpy' discards qualifiers from pointer target type

fs/partitions/check.c: In function 'add_partition':

fs/partitions/check.c:381: warning: ignoring return value of 'device_add', declared with attribute warn_unused_result

drivers/acpi/tables/tbfadt.c: In function 'acpi_tb_create_local_fadt':

include/asm/string_32.h:65: warning: array subscript is above array bounds

WARNING: drivers/base/built-in.o(.data+0x580): Section mismatch in reference from the variable topology_cpu_callback_nb.10688 to the function .cpuinit.text:topology_cpu_callback()

The variable topology_cpu_callback_nb.10688 references

the function __cpuinit topology_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

drivers/pci/search.c: In function 'pci_find_slot':

drivers/pci/search.c:135: warning: 'pci_find_device' is deprecated (declared at include/linux/pci.h:504)

drivers/pci/search.c: At top level:

drivers/pci/search.c:478: warning: 'pci_find_device' is deprecated (declared at drivers/pci/search.c:283)

drivers/pci/search.c:478: warning: 'pci_find_device' is deprecated (declared at drivers/pci/search.c:283)

drivers/pci/search.c:479: warning: 'pci_find_slot' is deprecated (declared at drivers/pci/search.c:132)

drivers/pci/search.c:479: warning: 'pci_find_slot' is deprecated (declared at drivers/pci/search.c:132)

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x174): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devinit.text:pccard_sysfs_add_socket()

The variable pccard_sysfs_interface references

the function __devinit pccard_sysfs_add_socket()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x178): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devexit.text:pccard_sysfs_remove_socket()

The variable pccard_sysfs_interface references

the function __devexit pccard_sysfs_remove_socket()

If the reference is valid then annotate the

variable with __exit* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pcmcia.o(.data+0x4c): Section mismatch in reference from the variable pcmcia_bus_interface to the function .devinit.text:pcmcia_bus_add_socket()

The variable pcmcia_bus_interface references

the function __devinit pcmcia_bus_add_socket()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

drivers/usb/core/hcd.c: In function 'usb_hcd_poll_rh_status':

include/asm/string_32.h:65: warning: array subscript is above array bounds

drivers/video/intelfb/intelfbhw.c: In function 'calc_pll_params':

drivers/video/intelfb/intelfbhw.c:887: warning: 'm2' may be used uninitialized in this function

drivers/video/intelfb/intelfbhw.c:887: warning: 'm1' may be used uninitialized in this function

WARNING: drivers/built-in.o(.data+0x6760): Section mismatch in reference from the variable topology_cpu_callback_nb.10688 to the function .cpuinit.text:topology_cpu_callback()

The variable topology_cpu_callback_nb.10688 references

the function __cpuinit topology_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

net/bluetooth/af_bluetooth.c:59: warning: 'bt_key_strings' defined but not used

net/bluetooth/af_bluetooth.c:70: warning: 'bt_slock_key_strings' defined but not used

WARNING: lib/built-in.o(.data+0x1c): Section mismatch in reference from the variable percpu_counter_hotcpu_callback_nb.9158 to the function .cpuinit.text:percpu_counter_hotcpu_callback()

The variable percpu_counter_hotcpu_callback_nb.9158 references

the function __cpuinit percpu_counter_hotcpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: vmlinux.o(.text+0x116b4): Section mismatch in reference from the function cpu_exit_clear() to the function .cpuinit.text:cpu_uninit()

The function cpu_exit_clear() references

the function __cpuinit cpu_uninit().

This is often because cpu_exit_clear lacks a __cpuinit 

annotation or the annotation of cpu_uninit is wrong.

WARNING: vmlinux.o(.text+0x4ac66): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain

The function take_cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because take_cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x4ad06): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x4ad73): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x4ade8): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x4aea5): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

The function _cpu_down() references

the variable __cpuinitdata cpu_chain.

This is often because _cpu_down lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x4b010): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain

The function unregister_cpu_notifier() references

the variable __cpuinitdata cpu_chain.

This is often because unregister_cpu_notifier lacks a __cpuinitdata 

annotation or the annotation of cpu_chain is wrong.

WARNING: vmlinux.o(.text+0x1de114): Section mismatch in reference from the function store_online() to the function .cpuinit.text:cpu_up()

The function store_online() references

the function __cpuinit cpu_up().

This is often because store_online lacks a __cpuinit 

annotation or the annotation of cpu_up is wrong.

WARNING: vmlinux.o(.text+0x255ed0): Section mismatch in reference from the function cpufreq_register_driver() to the function .cpuinit.text:register_cpu_notifier()

The function cpufreq_register_driver() references

the function __cpuinit register_cpu_notifier().

This is often because cpufreq_register_driver lacks a __cpuinit 

annotation or the annotation of register_cpu_notifier is wrong.

WARNING: vmlinux.o(.data+0x2e50): Section mismatch in reference from the variable profile_cpu_callback_nb.18659 to the function .devinit.text:profile_cpu_callback()

The variable profile_cpu_callback_nb.18659 references

the function __devinit profile_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: vmlinux.o(.data+0x4848): Section mismatch in reference from the variable workqueue_cpu_callback_nb.13047 to the function .devinit.text:workqueue_cpu_callback()

The variable workqueue_cpu_callback_nb.13047 references

the function __devinit workqueue_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: vmlinux.o(.data+0x7924): Section mismatch in reference from the variable cpu_callback_nb.23231 to the function .devinit.text:cpu_callback()

The variable cpu_callback_nb.23231 references

the function __devinit cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: vmlinux.o(.data+0x10cb0): Section mismatch in reference from the variable percpu_counter_hotcpu_callback_nb.9158 to the function .cpuinit.text:percpu_counter_hotcpu_callback()

The variable percpu_counter_hotcpu_callback_nb.9158 references

the function __cpuinit percpu_counter_hotcpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: vmlinux.o(.data+0x17460): Section mismatch in reference from the variable topology_cpu_callback_nb.10688 to the function .cpuinit.text:topology_cpu_callback()

The variable topology_cpu_callback_nb.10688 references

the function __cpuinit topology_cpu_callback()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

Root device is (8, 5)

Setup is 11356 bytes (padded to 11776 bytes).

System is 2127 kB

WARNING: drivers/pcmcia/i82092.o(.data+0x10): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devinit.text:i82092aa_pci_probe()

The variable i82092aa_pci_drv references

the function __devinit i82092aa_pci_probe()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/i82092.o(.data+0x14): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devexit.text:i82092aa_pci_remove()

The variable i82092aa_pci_drv references

the function __devexit i82092aa_pci_remove()

If the reference is valid then annotate the

variable with __exit* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pcmcia.o(.data+0x4c): Section mismatch in reference from the variable pcmcia_bus_interface to the function .devinit.text:pcmcia_bus_add_socket()

The variable pcmcia_bus_interface references

the function __devinit pcmcia_bus_add_socket()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x174): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devinit.text:pccard_sysfs_add_socket()

The variable pccard_sysfs_interface references

the function __devinit pccard_sysfs_add_socket()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pcmcia_core.o(.data+0x178): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devexit.text:pccard_sysfs_remove_socket()

The variable pccard_sysfs_interface references

the function __devexit pccard_sysfs_remove_socket()

If the reference is valid then annotate the

variable with __exit* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pd6729.o(.data+0x30): Section mismatch in reference from the variable pd6729_pci_drv to the function .devinit.text:pd6729_pci_probe()

The variable pd6729_pci_drv references

the function __devinit pd6729_pci_probe()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/pd6729.o(.data+0x34): Section mismatch in reference from the variable pd6729_pci_drv to the function .devexit.text:pd6729_pci_remove()

The variable pd6729_pci_drv references

the function __devexit pd6729_pci_remove()

If the reference is valid then annotate the

variable with __exit* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/rsrc_nonstatic.o(.data+0x44): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devinit.text:pccard_sysfs_add_rsrc()

The variable pccard_rsrc_interface references

the function __devinit pccard_sysfs_add_rsrc()

If the reference is valid then annotate the

variable with __init* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

WARNING: drivers/pcmcia/rsrc_nonstatic.o(.data+0x48): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devexit.text:pccard_sysfs_remove_rsrc()

The variable pccard_rsrc_interface references

the function __devexit pccard_sysfs_remove_rsrc()

If the reference is valid then annotate the

variable with __exit* (see linux/init.h) or name the variable:

*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, 

```

----------

## smerf

What kernel version/branch? Is this a recompilation or fresh build (after mrproper)?

----------

## rahulthewall

Kernel : 2.6.25-tuxonice-r5. I was told that there are 14 modules mismatch in my kernel, and that I should recompile it with some option to view them (forgot what option I had to pass to make there). Anyways, when I recompiled it, these are the warnings that I got. 

Another point, I am on ~x86. So I am using gcc-4.3.1 and   glibc-2.8_p20080602. The warnings could be due to this.

----------

## smerf

I think that something compiled earlier collides with freshly build stuff.

Try to recompile from scratch (I mean from cleaned source tree).

----------

## rahulthewall

That does not help, I did a make clean && make. It still gives the same errors.

----------

## muhsinzubeir

those are source errors...if i were you i will try looking for patches or try another kernel source   :Rolling Eyes: 

----------

## rahulthewall

Will look for patches - do not want to change the kernel, it is the only one with which suspend works properly (recognizes my laptops shortcut keys and everything)

----------

## rahulthewall

OK, with 2.6.26 it seems that the warnings have reduced. Have only one Mismatch warning now. Could anyone explain which module is causing this?

```

WARNING: arch/x86/kernel/built-in.o(.text+0x1087e): Section mismatch in reference from the function cpu_exit_clear() to the function .cpuinit.text:cpu_uninit()

The function cpu_exit_clear() references

the function __cpuinit cpu_uninit().

This is often because cpu_exit_clear lacks a __cpuinit

annotation or the annotation of cpu_uninit is wrong.

WARNING: vmlinux.o(.text+0x10c0e): Section mismatch in reference from the function cpu_exit_clear() to the function .cpuinit.text:cpu_uninit()

The function cpu_exit_clear() references

the function __cpuinit cpu_uninit().

This is often because cpu_exit_clear lacks a __cpuinit

annotation or the annotation of cpu_uninit is wrong.

```

----------

## rahulthewall

https://bugs.gentoo.org/show_bug.cgi?id=232335

----------

