Skip to contentSkip to conversation

section name cleanup for frv

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 frv

This patch series cleans up the section names on the frv 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):
frv: use new macro for .data.cacheline_aligned section.
frv: use new macros for .data.init_task
frv: rename .text.foo sections to .text..foo.

 arch/frv/kernel/break.S       |    2 +-
 arch/frv/kernel/entry.S       |    2 +-
 arch/frv/kernel/head.S        |    2 +-
 arch/frv/kernel/init_task.c   |    3 +--
 arch/frv/kernel/vmlinux.lds.S |   20 ++++++--------------
 arch/frv/mm/tlb-miss.S        |    2 +-
 6 files changed, 11 insertions(+), 20 deletions(-)
author
#1 lore raw

PATCH 1/3 frv: 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 David Howells <[email protected]>
---
 arch/frv/kernel/vmlinux.lds.S |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/frv/kernel/vmlinux.lds.S +1 -3
index 22d9787..dc61f3e 100644
@@ -76,9 +76,6 @@ SECTIONS
 	  *(.data.init_task)
   }
 
-  . = ALIGN(L1_CACHE_BYTES);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
   .trap : {
 	/* trap table management - read entry-table.S before modifying */
 	. = ALIGN(8192);
@@ -131,6 +128,7 @@ SECTIONS
 
   _sdata = .;
   .data : {			/* Data */
+	CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
 	DATA_DATA
 	*(.data.*)
 	EXIT_DATA
Signature · 1 line
1.6.2.1
author
#2 lore raw

PATCH 2/3 frv: 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.

Cc David Howells <[email protected]>
---
 arch/frv/kernel/init_task.c   |    3 +--
 arch/frv/kernel/vmlinux.lds.S |    8 +-------
 2 files changed, 2 insertions(+), 9 deletions(-)
arch/frv/kernel/init_task.c +1 -2
index 29429a8..9f182b3 100644
@@ -23,8 +23,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/frv/kernel/vmlinux.lds.S +1 -7
index dc61f3e..d19d3c0 100644
@@ -69,13 +69,6 @@ SECTIONS
   . = ALIGN(THREAD_SIZE);
   __init_end = .;
 
-  /* put sections together that have massive alignment issues */
-  . = ALIGN(THREAD_SIZE);
-  .data.init_task : {
-	  /* init task record & stack */
-	  *(.data.init_task)
-  }
-
   .trap : {
 	/* trap table management - read entry-table.S before modifying */
 	. = ALIGN(8192);
@@ -128,6 +121,7 @@ SECTIONS
 
   _sdata = .;
   .data : {			/* Data */
+	INIT_TASK_DATA(THREAD_SIZE)
 	CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
 	DATA_DATA
 	*(.data.*)
Signature · 1 line
1.6.2.1
author
#3 lore raw

PATCH 3/3 frv: rename .text.foo sections to .text..foo.

Using special sections with names of the form .text.foo causes collisions with section names generated by -ffunction-sections.

Cc David Howells <[email protected]>
---
 arch/frv/kernel/break.S       |    2 +-
 arch/frv/kernel/entry.S       |    2 +-
 arch/frv/kernel/head.S        |    2 +-
 arch/frv/kernel/vmlinux.lds.S |    8 ++++----
 arch/frv/mm/tlb-miss.S        |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
arch/frv/kernel/break.S +1 -1
index bd0bdf9..8988468 100644
@@ -63,7 +63,7 @@ __break_trace_through_exceptions:
 # entry point for Break Exceptions/Interrupts
 #
 ###############################################################################
-	.section	.text.break
+	.section	.text..break
 	.balign		4
 	.globl		__entry_break
 __entry_break:
arch/frv/kernel/entry.S +1 -1
index 1da523b..8958151 100644
@@ -38,7 +38,7 @@
 
 #define nr_syscalls ((syscall_table_size)/4)
 
-	.section	.text.entry
+	.section	.text..entry
 	.balign		4
 
 .macro LEDS val
arch/frv/kernel/head.S +1 -1
index b825ef3..e9a8cc6 100644
@@ -542,7 +542,7 @@ __head_end:
 	.size		_boot, .-_boot
 
 	# provide a point for GDB to place a break
-	.section	.text.start,"ax"
+	.section	.text..start,"ax"
 	.globl		_start
 	.balign		4
 _start:
arch/frv/kernel/vmlinux.lds.S +4 -4
index d19d3c0..bb1258f 100644
@@ -84,10 +84,10 @@ SECTIONS
   _text = .;
   _stext = .;
   .text : {
-	*(.text.start)
-	*(.text.entry)
-	*(.text.break)
-	*(.text.tlbmiss)
+	*(.text..start)
+	*(.text..entry)
+	*(.text..break)
+	*(.text..tlbmiss)
 	TEXT_TEXT
 	SCHED_TEXT
 	LOCK_TEXT
arch/frv/mm/tlb-miss.S +1 -1
index 7f392bc..f3ac019 100644
@@ -15,7 +15,7 @@
 #include <asm/pgtable.h>
 #include <asm/spr-regs.h>
 
-	.section	.text.tlbmiss
+	.section	.text..tlbmiss
 	.balign		4
 
 	.globl		__entry_insn_mmu_miss
Signature · 1 line
1.6.2.1