From: Yinghai Lu <yinghai@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: Section mismatches in memblock
Date: Tue, 05 Oct 2010 16:30:05 -0700 [thread overview]
Message-ID: <4CABB4FD.2090304@kernel.org> (raw)
In-Reply-To: <4CABAAB4.3090707@zytor.com>
On 10/05/2010 03:46 PM, H. Peter Anvin wrote:
> o.i386-allconfig/make.log:WARNING: mm/built-in.o(.text+0x48b6f): Section
> mismatch in reference from the function memblock_is_memory() to the
> variable .init.data:memblock
> o.i386-allconfig/make.log:The function memblock_is_memory() references
> o.i386-allconfig/make.log:This is often because memblock_is_memory lacks
> a __initdata
> o.i386-allconfig/make.log:WARNING: mm/built-in.o(.text+0x48bb0): Section
> mismatch in reference from the function memblock_is_region_memory() to
> the variable .init.data:memblock
> o.i386-allconfig/make.log:The function memblock_is_region_memory()
> references
> o.i386-allconfig/make.log:This is often because
> memblock_is_region_memory lacks a __initdata
> o.i386-allconfig/make.log:WARNING: mm/built-in.o(.text+0x48bd5): Section
> mismatch in reference from the function memblock_is_region_memory() to
> the variable .init.data:memblock
> o.i386-allconfig/make.log:The function memblock_is_region_memory()
> references
> o.i386-allconfig/make.log:This is often because
> memblock_is_region_memory lacks a __initdata
>
> Happens with both i386 and x86-64.
[PATCH] memblock: Fix section mismatch warnings with memblock_search()
HPA found
o.i386-allconfig/make.log:WARNING: mm/built-in.o(.text+0x48b6f): Section
mismatch in reference from the function memblock_is_memory() to the
variable .init.data:memblock
o.i386-allconfig/make.log:The function memblock_is_memory() references
o.i386-allconfig/make.log:This is often because memblock_is_memory lacks
a __initdata
o.i386-allconfig/make.log:WARNING: mm/built-in.o(.text+0x48bb0): Section
mismatch in reference from the function memblock_is_region_memory() to
the variable .init.data:memblock
o.i386-allconfig/make.log:The function memblock_is_region_memory()
references
o.i386-allconfig/make.log:This is often because
memblock_is_region_memory lacks a __initdata
looks like gcc problem.
| static int memblock_search(struct memblock_type *type, phys_addr_t addr)
| {
| .....
| }
|
|int __init memblock_is_reserved(phys_addr_t addr)
|{
| return memblock_search(&memblock.reserved, addr) != -1;
|}
|
|int __init_memblock memblock_is_memory(phys_addr_t addr)
|{
| return memblock_search(&memblock.memory, addr) != -1;
|}
Because We already have __init for those two functions.
Just make memblock_search to have __init_memblock atribute.
Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Yinghai Lu <Yinghai@kernel.org>
---
mm/memblock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -653,7 +653,7 @@ void __init memblock_enforce_memory_limi
}
}
-static int memblock_search(struct memblock_type *type, phys_addr_t addr)
+static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr)
{
unsigned int left = 0, right = type->cnt;
next prev parent reply other threads:[~2010-10-05 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 22:46 Section mismatches in memblock H. Peter Anvin
2010-10-05 23:30 ` Yinghai Lu [this message]
2010-10-06 2:30 ` H. Peter Anvin
2010-10-06 3:04 ` H. Peter Anvin
2010-10-08 8:16 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CABB4FD.2090304@kernel.org \
--to=yinghai@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox