Section mismatches in drivers/video/console/promcon
Subsystems (2)
Building a kernel for sparc64 defconfig gave me following warnings:
WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile
The function promcon_init_unimap() are referenced in two places:
1) In prom_con_init() which is marked __init => no problem.
2) In promcon_init() which is not marked __init => warning. The actual code is here:
if (!promcon_uni_pagedir[0] && p) {
promcon_init_unimap(conp);
}I could not from the code judge if promcon_init_unimap is really only used during early init or this is a bug.
If promcon_init_unimap() is only used during early init it should be marked __init_refok (with a proper comment) to silence the warning.
A few people in to: that I hope can help out (thanks to git blame)...
Sam
Quoted 2 lines · Sam Ravnborg
A few people in to: that I hope can help out (thanks to git blame)...
git needs a "praise" command, like svn. :>
Jan
Quoted 14 lines · Sam Ravnborg
Building a kernel for sparc64 defconfig gave me following warnings:
WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')The warnings happens because the function:
promcon_init_unimap()referencespromfont_unitableandpromfont_unicountwhich are marked__initdataby the conmakehash command in thedrivers/video/console/MakefileThe function
promcon_init_unimap()are referenced in two places:
1) Inprom_con_init()which is marked__init=> no problem.
2) Inpromcon_init()which is not marked__init=> warning. The actual code is here:
Quoted 7 lines
if (!promcon_uni_pagedir[0] && p) { promcon_init_unimap(conp); }could not from the code judge if
promcon_init_unimapis really
only used during early init or this is a bug.
promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.
Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.
Tony
Quoted 8 lines
promcon_init()can be called again fromvisual_init()duringvc_allocate(). So anything referenced bypromcon_init()should not be marked__init.Although, if you want to keep
promfont_unitableandpromfont_unicount__init, you can probably usecon_copy_unimap()using the default vc as the source instead of doing apromcon_init_unimap()again.
Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.
Sam
Subject: video: fix section mismatch warning in promcon
Fix the following warnings in promcon:
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x480): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x488): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x48c): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x490): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile
Fix the warning by removing the __initdata marker on the two variables.
---
drivers/video/console/Makefile +1 -1
@@ -47,7 +47,7 @@ targets := promcon_tbl.c quiet_cmd_conmakehash = CNMKHSH $@ cmd_conmakehash = scripts/conmakehash $< | \ sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \ - -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@ + -e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@ $(obj)/promcon_tbl.c: $(src)/prom.uni $(call cmd,conmakehash)
From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200
Quoted 9 lines
Quoted 8 lines
promcon_init()can be called again fromvisual_init()duringvc_allocate(). So anything referenced bypromcon_init()should not be marked__init.Although, if you want to keep
promfont_unitableandpromfont_unicount__init, you can probably usecon_copy_unimap()using the default vc as the source instead of doing apromcon_init_unimap()again.
Quoted 7 lines
Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.Sam
Subject: video: fix section mismatch warning in promcon
I'll merge this fix in via the Sparc tree since this is a sparc console driver.
Thanks Sam.
Quoted 16 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200Quoted 13 lines
Quoted 8 lines
promcon_init()can be called again fromvisual_init()duringvc_allocate(). So anything referenced bypromcon_init()should not be marked__init.Although, if you want to keep
promfont_unitableandpromfont_unicount__init, you can probably usecon_copy_unimap()using the default vc as the source instead of doing apromcon_init_unimap()again.Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.
Quoted 6 lines
Quoted 3 lines
Sam
Subject: video: fix section mismatch warning in promcon
I'll merge this fix in via the Sparc tree since this is a sparc console driver.
Thanks. I didn't notice it was sparc only otherwise I would have cc'ed you and sparclinux.
Sam
Quoted 16 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200Quoted 13 lines
Quoted 8 lines
promcon_init()can be called again fromvisual_init()duringvc_allocate(). So anything referenced bypromcon_init()should not be marked__init.Although, if you want to keep
promfont_unitableandpromfont_unicount__init, you can probably usecon_copy_unimap()using the default vc as the source instead of doing apromcon_init_unimap()again.Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.
Quoted 7 lines
Quoted 3 lines
Sam
Subject: video: fix section mismatch warning in promcon
I'll merge this fix in via the Sparc tree since this is a sparc console driver.
I was about to send this patch to akpm, I'll leave this to you then.
Tony