lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 05 Oct 2010 16:30:05 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	"H. Peter Anvin" <hpa@...or.com>
CC:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Section mismatches in memblock

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@...or.com>
Signed-off-by: Yinghai Lu <Yinghai@...nel.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;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ