Previously it had compiled and built cleanly, but when I added in the
sound driver I got this:
MODPOST vmlinux
WARNING: arch/sh/boards/dreamcast/built-in.o(.data+0x0): Section
mismatch: reference to .init.text: (between 'mv_dreamcast' and
'systemasic_int')
WARNING: drivers/built-in.o(.text+0x168e0): Section mismatch: reference
to .init.data: (between 'pvr2fb_check_var' and 'pvr2fb_interrupt')
WARNING: drivers/built-in.o(.text+0x1701c): Section mismatch: reference
to .init.data: (between 'pvr2fb_pci_probe' and 'read_mem')
WARNING: drivers/built-in.o(.text+0x17024): Section mismatch: reference
to .init.text: (between 'pvr2fb_pci_probe' and 'read_mem')
WARNING: drivers/built-in.o(.data+0x738): Section mismatch: reference
to .init.text: (between 'board_list' and 'pvr2fb_pci_driver')
WARNING: drivers/built-in.o(.data+0x750): Section mismatch: reference
to .init.text: (between 'board_list' and 'pvr2fb_pci_driver')
Hi Adrian,
On 6/23/07, Adrian McMenamin <[email protected]> wrote:
> Previously it had compiled and built cleanly, but when I added in the
> sound driver I got this:
>
> MODPOST vmlinux
> WARNING: arch/sh/boards/dreamcast/built-in.o(.data+0x0): Section
> mismatch: reference to .init.text: (between 'mv_dreamcast' and
> 'systemasic_int')
Ok, this one looks to have come from
2c7834a6f15fe6c50ed4766f1bb6f9183b9e2740
Basically, when !SH_GENERIC && !SH_UNKNOWN,
__initmv == (nothing), so the machine vectors will go to .data section.
But all the corresponding .mv_setup members of the sh_machine_vector
are setup to point to functions that are marked __init unconditionally,
which causes these reference warnings. Marking the corresponding
.mv_setup functions as __initmv too would silence these (bogus)
warnings, but Paul must confirm if this is desirable and correct
(basically can it make sense to put *functions* into the .machvec.init
section too)?
Similar cases in:
-> arch/sh/boards/dreamcast/setup.c:dreamcast_setup()
-> arch/sh/boards/hp6xx/setup.c:hp6xx_setup()
-> arch/sh/boards/landisk/setup.c:landisk_setup()
-> arch/sh/boards/mpc1211/setup.c:mpc1211_setup()
-> arch/sh/boards/renesas/hs7751rvoip/setup.c:hs7751rvoip_setup()
-> arch/sh/boards/renesas/r7780rp/setup.c:highlander_setup()
-> arch/sh/boards/renesas/rts7751r2d/setup.c:rts7751r2d_setup()
-> arch/sh/boards/se/7343/setup.c:sh7343se_setup()
-> arch/sh/boards/se/770x/setup.c:smsc_setup()
-> arch/sh/boards/se/7722/setup.c:se7722_setup()
-> arch/sh/boards/se/7780/setup.c:se7780_setup()
-> arch/sh/boards/sh03/setup.c:sh03_setup()
-> arch/sh/boards/snapgear/setup.c:snapgear_setup()
-> arch/sh/boards/superh/microdev/setup.c:microdev_setup()
[ I didn't find these changes in Paul's latest sh-2.6(.22) tree,
but looks like the 2.6.23 dev tree is getting rid of ALIAS_MV.
But I suspect the (__initmv when !GENERIC && !UNKNOWN) .data ->
.init.text (__init) references being warned about here would still exist
there. ]
Janitorial patch attached resolves these bogus warnings by marking
the functions as __initmv too, but if this is wrong, feel free to NAK
it (and also suggest the correct solution :-)
---
sh_machine_vector structs in arch/sh/boards/ are marked __initmv
so that they go to the .machvec.init section (during setup_arch, all
but one would be discarded away) when SH_GENERIC || SH_UNKNOWN.
However, when !SH_GENERIC && !SH_UNKNOWN, __initmv is not
defined so these machine vector structures go to the .data section.
The .mv_setup member points to the setup function that is only ever
called during boot time, and hence the corresponding functions are
marked __init. But this causes modpost to (bogusly) warn about the
.data -> .init.text references during kernel build, thusly:
MODPOST vmlinux
WARNING: arch/sh/boards/dreamcast/built-in.o(.data+0x0): Section
mismatch: reference to .init.text: (between 'mv_dreamcast' and
'systemasic_int')
So, mark the setup functions as __initmv too, to get rid of these
bogus warnings.
Signed-off-by: Satyam Sharma <[email protected]>
---
arch/sh/boards/dreamcast/setup.c | 2 +-
arch/sh/boards/hp6xx/setup.c | 2 +-
arch/sh/boards/landisk/setup.c | 2 +-
arch/sh/boards/mpc1211/setup.c | 2 +-
arch/sh/boards/renesas/hs7751rvoip/setup.c | 2 +-
arch/sh/boards/renesas/r7780rp/setup.c | 2 +-
arch/sh/boards/renesas/rts7751r2d/setup.c | 2 +-
arch/sh/boards/se/7343/setup.c | 2 +-
arch/sh/boards/se/770x/setup.c | 4 ++--
arch/sh/boards/se/7722/setup.c | 2 +-
arch/sh/boards/se/7780/setup.c | 2 +-
arch/sh/boards/sh03/setup.c | 2 +-
arch/sh/boards/snapgear/setup.c | 2 +-
arch/sh/boards/superh/microdev/setup.c | 2 +-
14 files changed, 15 insertions(+), 15 deletions(-)