Skip to contentSkip to conversation

section name cleanup for m32r

PATCH New Tim Abbott 1 participant 4 messages Apr 30, 2009

lore
Share & tools
lore

Tim Abbott

author
#0 lore raw

cover section name cleanup for m32r

This patch series cleans up the section names on the m32r architecture. It requires the architecture-independent macro definitions from this patch series:

<http://www.spinics.net/lists/mips/msg33499.html>

The long-term goal here is to add support for building the kernel with -ffunction-sections -fdata-sections. This requires renaming all the magic section names in the kernel of the form .text.foo, .data.foo, .bss.foo, and .rodata.foo to not have collisions with sections generated for code like:

static int nosave = 0; /* -fdata-sections places in .data.nosave */ static void head(); /* -ffunction-sections places in .text.head */

Note that these patches have not been boot-tested (aside from testing the analogous changes on x86), since I don't have access to the appropriate hardware.

-Tim Abbott

Tim Abbott (3):
m32r: use NOSAVE_DATA macro for .data.nosave section.
m32r: use new macro for .data.cacheline_aligned section.
m32r: use new macros for .data.init_task.

 arch/m32r/kernel/init_task.c   |    3 +--
 arch/m32r/kernel/vmlinux.lds.S |   16 +++-------------
 2 files changed, 4 insertions(+), 15 deletions(-)
author
#1 lore raw

PATCH 1/3 m32r: use NOSAVE_DATA macro for .data.nosave section.

This has the nice consequence of replacing the alignment of 4096 with an alignment of PAGE_SIZE (=4096).

.data.nosave should not need a separate output section; this change moves it into the .data section.

Cc Hirokazu Takata <[email protected]>
---
 arch/m32r/kernel/vmlinux.lds.S |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/m32r/kernel/vmlinux.lds.S +1 -6
index 4179adf..1cfaff3 100644
@@ -51,16 +51,11 @@ SECTIONS
   .data : {			/* Data */
 	*(.spu)
 	*(.spi)
+	NOSAVE_DATA
 	DATA_DATA
 	CONSTRUCTORS
 	}
 
-  . = ALIGN(4096);
-  __nosave_begin = .;
-  .data_nosave : { *(.data.nosave) }
-  . = ALIGN(4096);
-  __nosave_end = .;
-
   . = ALIGN(32);
   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
Signature · 1 line
1.6.2.1
author
#2 lore raw

PATCH 2/3 m32r: use new macro for .data.cacheline_aligned section.

.data.cacheline_aligned should not need a separate output section; this change moves it into the .data section.

Cc Hirokazu Takata <[email protected]>
---
 arch/m32r/kernel/vmlinux.lds.S |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
arch/m32r/kernel/vmlinux.lds.S +1 -4
index 1cfaff3..3e2de1f 100644
@@ -52,13 +52,10 @@ SECTIONS
 	*(.spu)
 	*(.spi)
 	NOSAVE_DATA
+	CACHELINE_ALIGNED_DATA(32)
 	DATA_DATA
 	CONSTRUCTORS
 	}
-
-  . = ALIGN(32);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
   _edata = .;			/* End of data section */
 
   . = ALIGN(8192);		/* init_task */
Signature · 1 line
1.6.2.1
author
#3 lore raw

PATCH 3/3 m32r: use new macros for .data.init_task.

Cc Hirokazu Takata <[email protected]>
---
 arch/m32r/kernel/init_task.c   |    3 +--
 arch/m32r/kernel/vmlinux.lds.S |    4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)
arch/m32r/kernel/init_task.c +1 -2
index 016885c..a57c1e3 100644
@@ -24,8 +24,7 @@ EXPORT_SYMBOL(init_mm);
  * way process stacks are handled. This is done by having a special
  * "init_task" linker map entry..
  */
-union thread_union init_thread_union
-	__attribute__((__section__(".data.init_task"))) =
+union thread_union init_thread_union __init_task_data =
 		{ INIT_THREAD_INFO(init_task) };
 
 /*
arch/m32r/kernel/vmlinux.lds.S +1 -3
index 3e2de1f..655eaf1 100644
@@ -51,6 +51,7 @@ SECTIONS
   .data : {			/* Data */
 	*(.spu)
 	*(.spi)
+	INIT_TASK_DATA(8192)
 	NOSAVE_DATA
 	CACHELINE_ALIGNED_DATA(32)
 	DATA_DATA
@@ -58,9 +59,6 @@ SECTIONS
 	}
   _edata = .;			/* End of data section */
 
-  . = ALIGN(8192);		/* init_task */
-  .data.init_task : { *(.data.init_task) }
-
   /* will be freed after init */
   . = ALIGN(4096);		/* Init code and data */
   __init_begin = .;
Signature · 1 line
1.6.2.1