Skip to contentSkip to conversation

section name cleanup for microblaze

PATCH New Tim Abbott 1 participant 3 messages Apr 30, 2009 Microblaze architecture

lore
Share & tools
lore

Tim Abbott

author
#0 lore raw

cover section name cleanup for microblaze

This patch series cleans up the section names on the microblaze 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 (2):
microblaze: use new macro for .data.cacheline_aligned section.
microblaze: use new macros for .data.init_task

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

PATCH 1/2 microblaze: use new macro for .data.cacheline_aligned section.

---
 arch/microblaze/kernel/vmlinux.lds.S |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/microblaze/kernel/vmlinux.lds.S +1 -2
index 840385e..de25a68 100644
@@ -64,9 +64,8 @@ SECTIONS {
 	_sdata = . ;
 	.data ALIGN (4096) : { /* page aligned when MMU used - origin 0x4 */
 		*(.data)
+		CACHELINE_ALIGNED_DATA(32)
 	}
-	. = ALIGN(32);
-	.data.cacheline_aligned : { *(.data.cacheline_aligned) }
 	_edata = . ;
 
 	/* Reserve some low RAM for r0 based memory references */
Signature · 1 line
1.6.2.1
author
#2 lore raw

PATCH 2/2 microblaze: 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/microblaze/kernel/init_task.c   |    3 +--
 arch/microblaze/kernel/vmlinux.lds.S |    5 +----
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/microblaze/kernel/init_task.c +1 -2
index 48eb9fb..d765fc1 100644
@@ -21,8 +21,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
 EXPORT_SYMBOL(init_mm);
 
-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) };
 
 struct task_struct init_task = INIT_TASK(init_task);
arch/microblaze/kernel/vmlinux.lds.S +1 -4
index de25a68..dcb2bc1 100644
@@ -63,6 +63,7 @@ SECTIONS {
 
 	_sdata = . ;
 	.data ALIGN (4096) : { /* page aligned when MMU used - origin 0x4 */
+		INIT_TASK_DATA(THREAD_SIZE)
 		*(.data)
 		CACHELINE_ALIGNED_DATA(32)
 	}
@@ -73,10 +74,6 @@ SECTIONS {
 	r0_ram = . ;
 	. = . +  4096;	/* a page should be enough */
 
-	/* The initial task */
-	. = ALIGN(8192);
-	.data.init_task : { *(.data.init_task) }
-
 	/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
 	. = ALIGN(8);
 	.sdata : {
Signature · 1 line
1.6.2.1