All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cris: Cleanup linker script using new linker script macros.
@ 2009-09-07  3:06 Tim Abbott
  2009-09-14  8:59 ` Jesper Nilsson
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Abbott @ 2009-09-07  3:06 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Sam Ravnborg, Tim Abbott, Mikael Starvik, Jesper Nilsson, dev-etrax

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: dev-etrax@axis.com
---
 arch/cris/kernel/vmlinux.lds.S |   41 +++++++--------------------------------
 1 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index 0d2adfc..bb44ae5 100644
--- a/arch/cris/kernel/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -51,61 +51,40 @@ SECTIONS
 	_etext = . ;			/* End of text section. */
 	__etext = .;
 
-	. = ALIGN(4);			/* Exception table. */
-	__start___ex_table = .;
-	__ex_table : { *(__ex_table) }
-	__stop___ex_table = .;
+	EXCEPTION_TABLE(4)
 
 	RODATA
 
 	. = ALIGN (4);
 	___data_start = . ;
 	__Sdata = . ;
-	.data : {			/* Data */
-		DATA_DATA
-	}
+	RW_DATA_SECTION(0, PAGE_SIZE, PAGE_SIZE)
 	__edata = . ;			/* End of data section. */
 	_edata = . ;
 
-	. = ALIGN(PAGE_SIZE);	/* init_task and stack, must be aligned. */
-	.data.init_task : { *(.data.init_task) }
-
 	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
 	__init_begin = .;
-	.init.text : {
-		   _sinittext = .;
-		   INIT_TEXT
-		   _einittext = .;
-	}
+	INIT_TEXT_SECTION(PAGE_SIZE)
 	.init.data : { INIT_DATA }
-	. = ALIGN(16);
-	__setup_start = .;
-	.init.setup : { *(.init.setup) }
-	__setup_end = .;
+	.init.setup : { INIT_SETUP(16) }
 #ifdef CONFIG_ETRAX_ARCH_V32
 	__start___param = .;
 	__param : { *(__param) }
 	__stop___param = .;
 #endif
 	.initcall.init : {
-		__initcall_start = .;
-		INITCALLS
-		__initcall_end = .;
+		INIT_CALLS
 	}
 
 	.con_initcall.init : {
-		__con_initcall_start = .;
-		*(.con_initcall.init)
-		__con_initcall_end = .;
+		CON_INITCALL
 	}
 	SECURITY_INIT
 
 #ifdef CONFIG_ETRAX_ARCH_V10
 #ifdef CONFIG_BLK_DEV_INITRD
 	.init.ramfs : {
-		__initramfs_start = .;
-		*(.init.ramfs)
-		__initramfs_end = .;
+		INIT_RAM_FS
 	}
 #endif
 #endif
@@ -130,11 +109,7 @@ SECTIONS
 	__init_end = .;
 
 	__data_end = . ;		/* Move to _edata ? */
-	__bss_start = .;		/* BSS. */
-	.bss : {
-		*(COMMON)
-		*(.bss)
-	}
+	BSS_SECTION(0, 0, 0)
 
 	. =  ALIGN (0x20);
 	_end = .;
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cris: Cleanup linker script using new linker script macros.
  2009-09-07  3:06 [PATCH] cris: Cleanup linker script using new linker script macros Tim Abbott
@ 2009-09-14  8:59 ` Jesper Nilsson
  2009-09-14 20:27   ` Tim Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Jesper Nilsson @ 2009-09-14  8:59 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux Kernel Mailing List, Sam Ravnborg, Mikael Starvik, dev-etrax

On Mon, Sep 07, 2009 at 05:06:33AM +0200, Tim Abbott wrote:
> Signed-off-by: Tim Abbott <tabbott@ksplice.com>
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: dev-etrax@axis.com
> ---
>  arch/cris/kernel/vmlinux.lds.S |   41 +++++++--------------------------------
>  1 files changed, 8 insertions(+), 33 deletions(-)
> 
> diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
> index 0d2adfc..bb44ae5 100644
> --- a/arch/cris/kernel/vmlinux.lds.S
> +++ b/arch/cris/kernel/vmlinux.lds.S
> @@ -51,61 +51,40 @@ SECTIONS
>  	_etext = . ;			/* End of text section. */
>  	__etext = .;
>  
> -	. = ALIGN(4);			/* Exception table. */
> -	__start___ex_table = .;
> -	__ex_table : { *(__ex_table) }
> -	__stop___ex_table = .;
> +	EXCEPTION_TABLE(4)
>  
>  	RODATA
>  
>  	. = ALIGN (4);
>  	___data_start = . ;
>  	__Sdata = . ;
> -	.data : {			/* Data */
> -		DATA_DATA
> -	}
> +	RW_DATA_SECTION(0, PAGE_SIZE, PAGE_SIZE)

This causes some problems, and I'm not ldscript guru enough to immediately
grasp the problem. What I get is this:

...
  LD      vmlinux
arch/cris/kernel/vmlinux.lds:326 cannot move location counter backwards (from c017e000 to 00000000)
make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

I've dropped that part of the patch, and I'll try to
boot test the rest of the patch this week.

>  	__edata = . ;			/* End of data section. */
>  	_edata = . ;
>  
> -	. = ALIGN(PAGE_SIZE);	/* init_task and stack, must be aligned. */
> -	.data.init_task : { *(.data.init_task) }
> -
>  	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
>  	__init_begin = .;
> -	.init.text : {
> -		   _sinittext = .;
> -		   INIT_TEXT
> -		   _einittext = .;
> -	}
> +	INIT_TEXT_SECTION(PAGE_SIZE)
>  	.init.data : { INIT_DATA }
> -	. = ALIGN(16);
> -	__setup_start = .;
> -	.init.setup : { *(.init.setup) }
> -	__setup_end = .;
> +	.init.setup : { INIT_SETUP(16) }
>  #ifdef CONFIG_ETRAX_ARCH_V32
>  	__start___param = .;
>  	__param : { *(__param) }
>  	__stop___param = .;
>  #endif
>  	.initcall.init : {
> -		__initcall_start = .;
> -		INITCALLS
> -		__initcall_end = .;
> +		INIT_CALLS
>  	}
>  
>  	.con_initcall.init : {
> -		__con_initcall_start = .;
> -		*(.con_initcall.init)
> -		__con_initcall_end = .;
> +		CON_INITCALL
>  	}
>  	SECURITY_INIT
>  
>  #ifdef CONFIG_ETRAX_ARCH_V10
>  #ifdef CONFIG_BLK_DEV_INITRD
>  	.init.ramfs : {
> -		__initramfs_start = .;
> -		*(.init.ramfs)
> -		__initramfs_end = .;
> +		INIT_RAM_FS
>  	}
>  #endif
>  #endif
> @@ -130,11 +109,7 @@ SECTIONS
>  	__init_end = .;
>  
>  	__data_end = . ;		/* Move to _edata ? */
> -	__bss_start = .;		/* BSS. */
> -	.bss : {
> -		*(COMMON)
> -		*(.bss)
> -	}
> +	BSS_SECTION(0, 0, 0)
>  
>  	. =  ALIGN (0x20);
>  	_end = .;
> -- 
> 1.6.3.3

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cris: Cleanup linker script using new linker script macros.
  2009-09-14  8:59 ` Jesper Nilsson
@ 2009-09-14 20:27   ` Tim Abbott
  2009-09-15  7:33     ` Jesper Nilsson
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Abbott @ 2009-09-14 20:27 UTC (permalink / raw)
  To: Jesper Nilsson
  Cc: Linux Kernel Mailing List, Sam Ravnborg, Mikael Starvik, dev-etrax

On Mon, 14 Sep 2009, Jesper Nilsson wrote:

> On Mon, Sep 07, 2009 at 05:06:33AM +0200, Tim Abbott wrote:
> >  	. = ALIGN (4);
> >  	___data_start = . ;
> >  	__Sdata = . ;
> > -	.data : {			/* Data */
> > -		DATA_DATA
> > -	}
> > +	RW_DATA_SECTION(0, PAGE_SIZE, PAGE_SIZE)
> 
> This causes some problems, and I'm not ldscript guru enough to immediately
> grasp the problem. What I get is this:
> 
> ...
>   LD      vmlinux
> arch/cris/kernel/vmlinux.lds:326 cannot move location counter backwards (from c017e000 to 00000000)
> make[1]: *** [vmlinux] Error 1
> make: *** [sub-make] Error 2

Hmm.  I spent a bit looking at it, and I don't have a guess for what the 
problem is there.

> I've dropped that part of the patch, and I'll try to
> boot test the rest of the patch this week.

Yeah, it's probably fine to just drop it for now, since it has fairly 
small cleanup impact on cris.

However, just dropping that hunk is not going to work -- you'll need to 
re-add the .data.init_task hunk below (which had been part of 
RW_DATA_SECTION).

	-Tim Abbott

> >  	__edata = . ;			/* End of data section. */
> >  	_edata = . ;
> >  
> > -	. = ALIGN(PAGE_SIZE);	/* init_task and stack, must be aligned. */
> > -	.data.init_task : { *(.data.init_task) }
> > -
> >  	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
> >  	__init_begin = .;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cris: Cleanup linker script using new linker script macros.
  2009-09-14 20:27   ` Tim Abbott
@ 2009-09-15  7:33     ` Jesper Nilsson
  0 siblings, 0 replies; 4+ messages in thread
From: Jesper Nilsson @ 2009-09-15  7:33 UTC (permalink / raw)
  To: Tim Abbott
  Cc: Linux Kernel Mailing List, Sam Ravnborg, Mikael Starvik, dev-etrax

On Mon, Sep 14, 2009 at 10:27:18PM +0200, Tim Abbott wrote:
> On Mon, 14 Sep 2009, Jesper Nilsson wrote:
> > On Mon, Sep 07, 2009 at 05:06:33AM +0200, Tim Abbott wrote:
> > >  	. = ALIGN (4);
> > >  	___data_start = . ;
> > >  	__Sdata = . ;
> > > -	.data : {			/* Data */
> > > -		DATA_DATA
> > > -	}
> > > +	RW_DATA_SECTION(0, PAGE_SIZE, PAGE_SIZE)
> > 
> > This causes some problems, and I'm not ldscript guru enough to immediately
> > grasp the problem. What I get is this:
> > 
> > ...
> >   LD      vmlinux
> > arch/cris/kernel/vmlinux.lds:326 cannot move location counter backwards (from c017e000 to 00000000)
> > make[1]: *** [vmlinux] Error 1
> > make: *** [sub-make] Error 2
> 
> Hmm.  I spent a bit looking at it, and I don't have a guess for what the 
> problem is there.
> 
> > I've dropped that part of the patch, and I'll try to
> > boot test the rest of the patch this week.
> 
> Yeah, it's probably fine to just drop it for now, since it has fairly 
> small cleanup impact on cris.
> 
> However, just dropping that hunk is not going to work -- you'll need to 
> re-add the .data.init_task hunk below (which had been part of 
> RW_DATA_SECTION).

Yes, sorry, I did that, but didn't mention it.
Or rather, I added: INIT_TASK_DATA_SECTION(PAGE_SIZE) instead.

> 	-Tim Abbott
> 
> > >  	__edata = . ;			/* End of data section. */
> > >  	_edata = . ;
> > >  
> > > -	. = ALIGN(PAGE_SIZE);	/* init_task and stack, must be aligned. */
> > > -	.data.init_task : { *(.data.init_task) }
> > > -
> > >  	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
> > >  	__init_begin = .;

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-15  7:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-07  3:06 [PATCH] cris: Cleanup linker script using new linker script macros Tim Abbott
2009-09-14  8:59 ` Jesper Nilsson
2009-09-14 20:27   ` Tim Abbott
2009-09-15  7:33     ` Jesper Nilsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.