Skip to contentSkip to conversation

section name cleanup for sparc

PATCH New Tim Abbott 1 participant 5 messages Apr 30, 2009 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Tim Abbott

author
#0 lore raw

cover section name cleanup for sparc

This patch series cleans up the section names on the sparc 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 (4):
sparc: use new macro for .data.cacheline_aligned section.
sparc: use new macros for .data.init_task.
sparc: use new macro for .data.read_mostly section.
sparc: convert to new generic read_mostly support.

 arch/sparc/Kconfig              |    3 +++
 arch/sparc/include/asm/cache.h  |    2 --
 arch/sparc/kernel/init_task.c   |    5 ++---
 arch/sparc/kernel/vmlinux.lds.S |   16 +++-------------
 4 files changed, 8 insertions(+), 18 deletions(-)
author
#1 lore raw

PATCH 1/4 sparc: 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.

---
 arch/sparc/kernel/vmlinux.lds.S |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
arch/sparc/kernel/vmlinux.lds.S +1 -4
index fcbbd00..6587e03 100644
@@ -52,6 +52,7 @@ SECTIONS
 
 	RO_DATA(PAGE_SIZE)
 	.data :	{
+		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
 	}
@@ -59,10 +60,6 @@ SECTIONS
 		*(.data1)
 	}
 	. = ALIGN(SMP_CACHE_BYTES);
-	.data.cacheline_aligned : {
-		*(.data.cacheline_aligned)
-	}
-	. = ALIGN(SMP_CACHE_BYTES);
 	.data.read_mostly : {
 		*(.data.read_mostly)
 	}
Signature · 1 line
1.6.2.1
author
#2 lore raw

PATCH 2/4 sparc: use new macros for .data.init_task.

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

---
 arch/sparc/kernel/init_task.c   |    5 ++---
 arch/sparc/kernel/vmlinux.lds.S |    6 +-----
 2 files changed, 3 insertions(+), 8 deletions(-)
arch/sparc/kernel/init_task.c +1 -3
index f28cb82..7367984 100644
@@ -21,6 +21,5 @@ EXPORT_SYMBOL(init_task);
  * If this is not aligned on a 8k boundry, then you should change code
  * in etrap.S which assumes it.
  */
-union thread_union init_thread_union
-	__attribute__((section (".data.init_task")))
-	= { INIT_THREAD_INFO(init_task) };
+union thread_union init_thread_union __init_task_data +	{ INIT_THREAD_INFO(init_task) };
arch/sparc/kernel/vmlinux.lds.S +1 -5
index 6587e03..3fbf650 100644
@@ -52,6 +52,7 @@ SECTIONS
 
 	RO_DATA(PAGE_SIZE)
 	.data :	{
+		INIT_TASK_DATA(THREAD_SIZE)
 		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
@@ -66,11 +67,6 @@ SECTIONS
 	/* End of data section */
 	_edata = .;
 
-	/* init_task */
-	. = ALIGN(THREAD_SIZE);
-	.data.init_task : {
-		*(.data.init_task)
-	}
 	.fixup : {
 		__start___fixup = .;
 		*(.fixup)
Signature · 1 line
1.6.2.1
author
#3 lore raw

PATCH 3/4 sparc: use new macro for .data.read_mostly section.

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

---
 arch/sparc/kernel/vmlinux.lds.S |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
arch/sparc/kernel/vmlinux.lds.S +1 -4
index 3fbf650..4760796 100644
@@ -54,16 +54,13 @@ SECTIONS
 	.data :	{
 		INIT_TASK_DATA(THREAD_SIZE)
 		CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
+		READ_MOSTLY_DATA(SMP_CACHE_BYTES)
 		DATA_DATA
 		CONSTRUCTORS
 	}
 	.data1 : {
 		*(.data1)
 	}
-	. = ALIGN(SMP_CACHE_BYTES);
-	.data.read_mostly : {
-		*(.data.read_mostly)
-	}
 	/* End of data section */
 	_edata = .;
 
Signature · 1 line
1.6.2.1
author
#4 lore raw

PATCH 4/4 sparc: convert to new generic read_mostly support.

---
 arch/sparc/Kconfig             |    3 +++
 arch/sparc/include/asm/cache.h |    2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/sparc/Kconfig +3 -0
index cc12cd4..fbdeded 100644
@@ -127,6 +127,9 @@ config OF
 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
 	def_bool y if SPARC64
 
+config HAVE_READ_MOSTLY_DATA
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
arch/sparc/include/asm/cache.h +0 -2
index 41f85ae..e614736 100644
@@ -19,8 +19,6 @@
 
 #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
 
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
 #ifdef CONFIG_SPARC32
 #include <asm/asi.h>
 
Signature · 1 line
1.6.2.1