2007-05-08 11:18:09

by Russell King

[permalink] [raw]
Subject: Bogus section mismatch errors?


WARNING: arch/arm/mach-realview/built-in.o - Section mismatch:
reference to .init.text: from .data between 'realview_timer' (at offset 0x54)
and 'clcd_plat_data'

Weird, these two data structures don't interact with each other. Probably
bogus.

WARNING: init/built-in.o - Section mismatch:
reference to .init.text: from .text between 'rest_init' (at offset 0x2c)
and 'run_init_process'
WARNING: mm/built-in.o - Section mismatch:
reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bd94)
and 'cache_reap'
WARNING: mm/built-in.o - Section mismatch:
reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bdcc)
and 'cache_reap'

Are these more bogus?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:


2007-05-08 12:24:16

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Bogus section mismatch errors?

On Tue, May 08, 2007 at 12:17:59PM +0100, Russell King wrote:
>
> WARNING: arch/arm/mach-realview/built-in.o - Section mismatch:
> reference to .init.text: from .data between 'realview_timer' (at offset 0x54)
> and 'clcd_plat_data'
>
> Weird, these two data structures don't interact with each other. Probably
> bogus.
modpsot does it best to guess what symbol are represented by an address.
In this case I would assume that realview_timer has a function pointer to a function
that is marked __init.

>
> WARNING: init/built-in.o - Section mismatch:
> reference to .init.text: from .text between 'rest_init' (at offset 0x2c)
> and 'run_init_process'
This is due to the reference to kernel_init - but binutils hardcode the offset
so modpost does not recognize the symbol.
A workaround (that I do not like) it to remove static declaration of kernel_init,
then modpost will recognize the symbol and see this is OK.


> WARNING: mm/built-in.o - Section mismatch:
> reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bd94)
> and 'cache_reap'
> WARNING: mm/built-in.o - Section mismatch:
> reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bdcc)
> and 'cache_reap'
There are in slab a function that is not marked __init that refer to a function marked
__init. But the logic surrounding makes it OK.

I have no fix/workaround for this.
Andres has suggested that we should mark functions/data that may refer to __init{data}
with something like: __nowarn and __nowarndata

I am planning to implement something so we can mark functions/data with:
__init_ref_ok and _init_data_ref_ok
Which is indeed more ugly but expalins what is actually OK.

I hope to take a look during the weekend.

Sam

2007-05-08 20:41:10

by David Miller

[permalink] [raw]
Subject: Re: Bogus section mismatch errors?

From: Sam Ravnborg <[email protected]>
Date: Tue, 8 May 2007 13:52:20 +0200

> There are in slab a function that is not marked __init that refer to a function marked
> __init. But the logic surrounding makes it OK.
>
> I have no fix/workaround for this.
> Andres has suggested that we should mark functions/data that may refer to __init{data}
> with something like: __nowarn and __nowarndata
>
> I am planning to implement something so we can mark functions/data with:
> __init_ref_ok and _init_data_ref_ok
> Which is indeed more ugly but expalins what is actually OK.
>
> I hope to take a look during the weekend.

Thanks for working on this, it's the only mismatch I still see
on sparc64 in current GIT :-)

2007-05-09 10:00:38

by Paul Mundt

[permalink] [raw]
Subject: Re: Bogus section mismatch errors?

On Tue, May 08, 2007 at 01:52:20PM +0200, Sam Ravnborg wrote:
> On Tue, May 08, 2007 at 12:17:59PM +0100, Russell King wrote:
> > WARNING: mm/built-in.o - Section mismatch:
> > reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bd94)
> > and 'cache_reap'
> > WARNING: mm/built-in.o - Section mismatch:
> > reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1bdcc)
> > and 'cache_reap'
> There are in slab a function that is not marked __init that refer to a function marked
> __init. But the logic surrounding makes it OK.
>
> I have no fix/workaround for this.
> Andres has suggested that we should mark functions/data that may refer to __init{data}
> with something like: __nowarn and __nowarndata
>
Here's one I've started getting with the quicklist changes:

WARNING: mm/built-in.o - Section mismatch: reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x1ba5c) and 'quicklist_total_size'

quicklist_total_size() is not marked __init, nor is show_mem() in
arch/sh/mm/init.c, where I've added the reference. Ideas?