Patchwork powerpc: warning: allocated section `.data_nosave' not in segment

login
register
mail settings
Submitter Sean MacLennan
Date Sept. 29, 2009, 4 p.m.
Message ID <20090929120006.78affe3f@lappy.seanm.ca>
Download mbox | patch
Permalink /patch/34440/
State Accepted, archived
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Sean MacLennan - Sept. 29, 2009, 4 p.m.
We need to align before the output section. Having the align inside
the output section causes the linker to put some filler in there,
which makes it a non-empty section, but this section isn't assigned to
a segment so you get a warning from the linker.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
Segher Boessenkool - Sept. 29, 2009, 8:40 p.m.
> We need to align before the output section. Having the align inside
> the output section causes the linker to put some filler in there,
> which makes it a non-empty section, but this section isn't assigned to
> a segment so you get a warning from the linker.
>
> Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
> ---
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S
> b/arch/powerpc/kernel/vmlinux.lds.S index f564293..e853763 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -236,6 +236,7 @@ SECTIONS
>  		READ_MOSTLY_DATA(L1_CACHE_BYTES)
>  	}
>
> +  	. = ALIGN(PAGE_SIZE);
>  	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
>  		NOSAVE_DATA
>  	}

Acked-by: Segher Boessenkool <segher@kernel.crashing.org>

The patch is good and fixes a real problem.  But, I still don't see how
it caused the "warning: allocated section `.data_nosave' not in  
segment",
it would be good if we can find out.


Segher

Patch

diff --git a/arch/powerpc/kernel/vmlinux.lds.S
b/arch/powerpc/kernel/vmlinux.lds.S index f564293..e853763 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -236,6 +236,7 @@  SECTIONS
 		READ_MOSTLY_DATA(L1_CACHE_BYTES)
 	}
 
+  	. = ALIGN(PAGE_SIZE);
 	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
 		NOSAVE_DATA
 	}