lkml.org 
[lkml]   [2007]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: (hacky) [PATCH] silence MODPOST section mismatch warnings
On Thu, May 10, 2007 at 09:40:38PM +0100, Russell King wrote:
> On Thu, May 10, 2007 at 01:34:18PM -0700, Chris Wedgwood wrote:
> > MODPOST seems to be spewing bogus warnings. It's not clear how best
> > to fix it so perhaps we should silence it for now?
>
> I agree. Example bogus warning:
>
> WARNING: arch/arm/mach-iop32x/built-in.o - Section mismatch:
> reference to .init.text: from .data between 'iq80321_timer'
> (at offset 0x428) and 'iq80321_serial_device'
>
> c04088fc d iq80321_timer
> c0408950 d iq80321_serial_device
>
> It's completely unclear what is referencing what, what the two named
> symbols mean, and even what "at offset" relates to.

The error message tells you that somewhere _between_ the symbol
iq80312_timer and iq80321_serial_device there is a recerence to an address
in the .init.text section.
The referenced address could not be resolved to an actual symbol.

Lets take a look:
git grep iq80321_timer reveals:
arch/arm/mach-iop32x/iq80321.c:static void __init iq80321_timer_init(void)
arch/arm/mach-iop32x/iq80321.c:static struct sys_timer iq80321_timer = {
arch/arm/mach-iop32x/iq80321.c: .init = iq80321_timer_init,
arch/arm/mach-iop32x/iq80321.c: .timer = &iq80321_timer,

So the one to look at is this structure:

static struct sys_timer iq80321_timer = {
.init = iq80321_timer_init,
.offset = iop_gettimeoffset,
};


iq80321_timer_init is a function marked __init
So we have a reference from .data to .init.text

If you remove the static definition of iq80321_timer then you will see
that modpost can resolve the symbol for you.

The usage of iq80321_timer is obscufated inside a MACHINCE_START/MACHINE_END
macor so I did not look further.
But based on the naming of the member in the struct ".init" I will assume
this is legitime reference to .init.text from .data.

Today modpost whitelist (avoid warnings) if a variable are named on of the
following:

*driver, *_template, *_sht, *_ops, *_probe, *probe_one

We could add *timer to silence this particular warning indeed.
Or we could rename the varibale.
Or we could find a way to annotate the data to say "references to .init.*
is OK and should not be warned.


The latter seems to be most appropriate so this is the direction I'm heading.

Sam
-
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/

\
 
 \ /
  Last update: 2007-05-10 23:17    [W:0.351 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site