ppc modprost warnings in 2.6.22-rc1
Trying to compile 2.6.22-rc1 for ppc (prep) arch. While section mismatches are an old thing, what are these COMMON symbols?
MODPOST vmlinux
WARNING: "fee_restarts" [arch/ppc/kernel/built-in] is COMMON symbol
WARNING: "ee_restarts" [arch/ppc/kernel/built-in] is COMMON symbol
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x18) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x3c) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x114) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x138) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x15c) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x180) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x1a4) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x1c8) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x1ec) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x210) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x234) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x258) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x27c) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x2a0) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x2c4) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x2e8) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x30c) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x330) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x354) and 'Mesquite_pci_IRQ_map'
WARNING: arch/ppc/platforms/built-in.o - Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset 0x378) and 'Mesquite_pci_IRQ_map'
WARNING: "primary_pteg_full" [arch/ppc/mm/built-in] is COMMON symbol
WARNING: "next_slot" [arch/ppc/mm/built-in] is COMMON symbol
WARNING: "htab_hash_searches" [arch/ppc/mm/built-in] is COMMON symbol
WARNING: arch/ppc/mm/built-in.o - Section mismatch: reference to .init.text:early_get_page from .text between 'pte_alloc_one_kernel' (at offset 0x1168) and 'hash_page'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:set_up_list3s from .text between 'kmem_cache_create' (at offset 0x24208) and 'kmem_cache_shrink'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:set_up_list3s from .text between 'kmem_cache_create' (at offset 0x24350) and 'kmem_cache_shrink'
WARNING: lib/built-in: '__div64_32' exported twice. Previous export was in arch/ppc/kernel/built-in.ko
Signature · 1 line
Meelis Roos ([email protected])
Quoted 6 lines · Meelis Roos
Trying to compile 2.6.22-rc1 for ppc (prep) arch. While section mismatches are an old thing, what are these COMMON symbols?
MODPOST vmlinux
WARNING: "fee_restarts" [arch/ppc/kernel/built-in] is COMMON symbol
WARNING: "ee_restarts" [arch/ppc/kernel/built-in] is COMMON symbol
Symbols that modpst see belongs to SHN_COMMON.
Should we drop that warning?
Quoted 1 line
WARNING:
arch/ppc/platforms/built-in.o- Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset0x18) and 'Mesquite_pci_IRQ_map'
.....
mot_info is only used by functions marked __init.
So why not mark it __init so it get discarded and we get rid of all those warnings?
Sam
Quoted 5 lines
Quoted 1 line
WARNING:
arch/ppc/platforms/built-in.o- Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset0x18) and 'Mesquite_pci_IRQ_map'.....
mot_infois only used by functions marked__init.
So why not mark it__initso it get discarded and we get rid of all those warnings?
How do I mark a initialized struct __init? Adding __init or const __init in front of the declaration results in
CC arch/ppc/platforms/prep_pci.oarch/ppc/platforms/prep_pci.c:806: error: mot_info causes a section type conflict
Signature · 1 line
Meelis Roos ([email protected])
Hi Meelis,
Quoted 11 lines · Meelis Roos
Quoted 5 lines
Quoted 1 line
WARNING:
arch/ppc/platforms/built-in.o- Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset0x18) and 'Mesquite_pci_IRQ_map'.....
mot_infois only used by functions marked__init.
So why not mark it__initso it get discarded and we get rid of all those warnings?How do I mark a initialized struct
__init? Adding__initor const__initin front of the declaration results inCC
arch/ppc/platforms/prep_pci.oarch/ppc/platforms/prep_pci.c:806: error:mot_infocauses a section type conflict
Data that is not accessed after initcalls are done (and hence can be safely freed after kernel boot) must be marked __initdata.
Satyam
PATCH 1/1 fix mot_info section
The following patch makes mot_info __initdata since it is used only in __init functions. prep_pci.c change has been tested in real life on Motorola Powerstack II (compiles without modpost warnings and boots fine), pplus.c has not been tested but seems similar.
arch/ppc/platforms/pplus.c +1 -1
@@ -256,7 +256,7 @@ struct brd_info {const char *name;int (*map_irq) (struct pci_dev *,unsigned char ,unsigned char ); }; -struct brd_info mot_info[] = { +__initdata struct brd_info mot_info[] = { {0x300 ,0x00 ,0x00 ,"MVME 2400" , Genesis2_map_irq}, {0x1E0 ,0xE0 ,0x00 ,"Mesquite cPCI (MCP750)" , mesquite_map_irq}, {0x1E0 ,0xE1 ,0x00 ,"Sitka cPCI (MCPN750)" , sitka_map_irq},
arch/ppc/platforms/prep_pci.c +1 -1
@@ -792,7 +792,7 @@ raven_init(void)return 1 ; } -struct mot_info { +__initdata struct mot_info {int cpu_type;/* 0x100 mask assumes for Raven and Hawk boards that the level/edge are set */ /* 0x200 if this board has a Hawk chip. */ int base_type;
Signature · 1 line
Meelis Roos ([email protected])
Re: [PATCH] [ppc] fix mot_info section
Quoted 25 lines · Meelis Roos
The following patch makes
mot_info__initdatasince it is used only in__initfunctions.prep_pci.cchange has been tested in real life on Motorola Powerstack II (compiles without modpost warnings and boots fine),pplus.chas not been tested but seems similar.Signed-off-by Meelis Roos <[email protected]>arch/ppc/platforms/pplus.c +1
-1@@ -256,7 +256,7 @@ struct brd_info {const char *name;int (*map_irq) (struct pci_dev *,unsigned char ,unsigned char ); }; -struct brd_info mot_info[] = { +__initdata struct brd_info mot_info[] = { {0x300 ,0x00 ,0x00 ,"MVME 2400" , Genesis2_map_irq}, {0x1E0 ,0xE0 ,0x00 ,"Mesquite cPCI (MCP750)" , mesquite_map_irq}, {0x1E0 ,0xE1 ,0x00 ,"Sitka cPCI (MCPN750)" , sitka_map_irq},arch/ppc/platforms/prep_pci.c +0
-0
arch/ppc/platforms/prep_pci.c raven_init(void) · line 798
Quoted 8 lines
arch/ppc/platforms/prep_pci.c +1
-1@@ -792,7 +792,7 @@ raven_init(void)return 1 ; } -struct mot_info { +__initdata struct mot_info {int cpu_type;/* 0x100 mask assumes for Raven and Hawk boards that the level/edge are set */ /* 0x200 if this board has a Hawk chip. */ int base_type;
The way you place __initdata is bogus.
Please read following from init.h again:
* For initialized data:
* You should insert __initdata between the variable name and equal
* sign followed by value, e.g.:
*
* static int init_variable __initdata = 0;
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
If gcc happes to accept your placement does not make it correct. It is still bogus and unreadable.
Sam
Re: [PATCH] [ppc] fix mot_info section
Thanks for the suggestions, here is updated patch:
The following patch makes mot_info __initdata since it is used only in __init functions. prep_pci.c change has been tested in real life on Motorola Powerstack II (compiles without modpost warnings and boots fine), pplus.c has not been tested but seems similar.
arch/ppc/platforms/pplus.c +1 -1
@@ -256,7 +256,7 @@ struct brd_info {const char *name;int (*map_irq) (struct pci_dev *,unsigned char ,unsigned char ); }; -struct brd_info mot_info[] = { +struct brd_info mot_info[]__initdata = { {0x300 ,0x00 ,0x00 ,"MVME 2400" , Genesis2_map_irq}, {0x1E0 ,0xE0 ,0x00 ,"Mesquite cPCI (MCP750)" , mesquite_map_irq}, {0x1E0 ,0xE1 ,0x00 ,"Sitka cPCI (MCPN750)" , sitka_map_irq},
arch/ppc/platforms/prep_pci.c +1 -1
@@ -803,7 +803,7 @@ struct mot_info {void (*map_non0_bus)(struct pci_dev *);/* For boards with more than bus 0 devices. */ struct powerplus_irq_list *pci_irq_list;/* List of PCI MPIC inputs */ unsigned char secondary_bridge_devfn;/* devfn of secondary bus transparent bridge */ -} mot_info[] = { +} mot_info[] __initdata = { {0x300, 0x00, 0x00, "MVME 2400", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF}, {0x010, 0x00, 0x00, "Genesis", Genesis_pci_IRQ_map, Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00}, {0x020, 0x00, 0x00, "Powerstack (Series E)", Comet_pci_IRQ_map, Comet_pci_IRQ_routes, NULL, NULL, 0x00},
Signature · 1 line
Meelis Roos ([email protected])
Quoted 2 lines
Data that is not accessed after initcalls are done (and hence can be safely freed after kernel boot) must be marked
__initdata.
Thanks, yes, I have known it quite a long time, seems like todays heat (around +30) is confusing me :(
Patch sent separately to LKML.
Signature · 1 line
Meelis Roos ([email protected])
Quoted 6 lines · Meelis Roos
Quoted 5 lines
Quoted 1 line
WARNING:
arch/ppc/platforms/built-in.o- Section mismatch: reference to .init.text:Powerplus_Map_Non0 from .data between 'mot_info' (at offset0x18) and 'Mesquite_pci_IRQ_map'.....
mot_infois only used by functions marked__init.
So why not mark it__initso it get discarded and we get rid of all those warnings?
Quoted 7 lines
How do I mark a initialized struct
__init? Adding__initor const__initin front of the declaration results inCC
arch/ppc/platforms/prep_pci.oarch/ppc/platforms/prep_pci.c:806: error:mot_infocauses a section type conflictFrom
include/linux/init.h:
* For initialized data:
* You should insert __initdata between the variable name and equal
* sign followed by value, e.g.:
*
* static int init_variable __initdata = 0;
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
*
* Don't forget to initialize data not at file scope, i.e. within a function,
* as gcc otherwise puts the data into the bss section and not into the init
* section.
*
* Also note, that this data cannot be "const".
If you need more info we would need to update this comment.
Sam