mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] section name cleanup for mips
@ 2009-04-30 23:53 Tim Abbott
  2009-04-30 23:53 ` [PATCH 1/4] mips: use NOSAVE_DATA macro for .data.nosave section Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Ralf Baechle, linux-mips,
	Tim Abbott

This patch series cleans up the section names on the mips
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):
  mips: use NOSAVE_DATA macro for .data.nosave section.
  mips: use new macro for .data.cacheline_aligned section.
  mips: use new macros for .data.init_task.
  mips: use .text, not .text.start, for lasat boot loader.

 arch/mips/kernel/init_task.c           |    5 ++---
 arch/mips/kernel/vmlinux.lds.S         |   19 +++----------------
 arch/mips/lasat/image/head.S           |    2 +-
 arch/mips/lasat/image/romscript.normal |    2 +-
 4 files changed, 7 insertions(+), 21 deletions(-)


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

* [PATCH 1/4] mips: use NOSAVE_DATA macro for .data.nosave section.
  2009-04-30 23:53 [PATCH 0/4] section name cleanup for mips Tim Abbott
@ 2009-04-30 23:53 ` Tim Abbott
  2009-04-30 23:53   ` [PATCH 2/4] mips: use new macro for .data.cacheline_aligned section Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Ralf Baechle, linux-mips,
	Tim Abbott

This has the consequence of replacing the alignment of _PAGE_SIZE with
an alignment of PAGE_SIZE.  I believe these have the same value.

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

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/kernel/vmlinux.lds.S |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 58738c8..2a6a995 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -78,7 +78,7 @@ SECTIONS
 		 */
 		. = ALIGN(_PAGE_SIZE);
 		*(.data.init_task)
-
+		NOSAVE_DATA
 		DATA_DATA
 		CONSTRUCTORS
 	}
@@ -96,14 +96,6 @@ SECTIONS
 		*(.sdata)
 	}
 
-	. = ALIGN(_PAGE_SIZE);
-	.data_nosave : {
-		__nosave_begin = .;
-		*(.data.nosave)
-	}
-	. = ALIGN(_PAGE_SIZE);
-	__nosave_end = .;
-
 	. = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
 	.data.cacheline_aligned : {
 		*(.data.cacheline_aligned)
-- 
1.6.2.1


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

* [PATCH 2/4] mips: use new macro for .data.cacheline_aligned section.
  2009-04-30 23:53 ` [PATCH 1/4] mips: use NOSAVE_DATA macro for .data.nosave section Tim Abbott
@ 2009-04-30 23:53   ` Tim Abbott
  2009-04-30 23:53     ` [PATCH 3/4] mips: use new macros for .data.init_task Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Ralf Baechle, linux-mips,
	Tim Abbott

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

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/kernel/vmlinux.lds.S |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 2a6a995..ba459cb 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -79,6 +79,7 @@ SECTIONS
 		. = ALIGN(_PAGE_SIZE);
 		*(.data.init_task)
 		NOSAVE_DATA
+		CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 		DATA_DATA
 		CONSTRUCTORS
 	}
@@ -95,11 +96,6 @@ SECTIONS
 	.sdata : {
 		*(.sdata)
 	}
-
-	. = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
-	.data.cacheline_aligned : {
-		*(.data.cacheline_aligned)
-	}
 	_edata =  .;			/* End of data section */
 
 	/* will be freed after init */
-- 
1.6.2.1


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

* [PATCH 3/4] mips: use new macros for .data.init_task.
  2009-04-30 23:53   ` [PATCH 2/4] mips: use new macro for .data.cacheline_aligned section Tim Abbott
@ 2009-04-30 23:53     ` Tim Abbott
  2009-04-30 23:53       ` [PATCH 4/4] mips: use .text, not .text.start, for lasat boot loader Tim Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Ralf Baechle, linux-mips,
	Tim Abbott

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/kernel/init_task.c   |    5 ++---
 arch/mips/kernel/vmlinux.lds.S |    3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index 149cd91..30051b4 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -25,9 +25,8 @@ EXPORT_SYMBOL(init_mm);
  *
  * The things we do for performance..
  */
-union thread_union init_thread_union
-	__attribute__((__section__(".data.init_task"),
-	               __aligned__(THREAD_SIZE))) =
+union thread_union init_thread_union __init_task_data
+	__attribute__((__aligned__(THREAD_SIZE))) =
 		{ INIT_THREAD_INFO(init_task) };
 
 /*
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index ba459cb..85085e3 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -76,8 +76,7 @@ SECTIONS
 		 * of ‘init_thread_union’ is greater than maximum
 		 * object file alignment.  Using 32768
 		 */
-		. = ALIGN(_PAGE_SIZE);
-		*(.data.init_task)
+		INIT_TASK_DATA(_PAGE_SIZE)
 		NOSAVE_DATA
 		CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 		DATA_DATA
-- 
1.6.2.1


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

* [PATCH 4/4] mips: use .text, not .text.start, for lasat boot loader.
  2009-04-30 23:53     ` [PATCH 3/4] mips: use new macros for .data.init_task Tim Abbott
@ 2009-04-30 23:53       ` Tim Abbott
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Abbott @ 2009-04-30 23:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Linux kernel mailing list, Anders Kaseorg, Waseem Daher,
	Denys Vlasenko, Jeff Arnold, Ralf Baechle, linux-mips,
	Tim Abbott

There doesn't seem to be a reason to use a special section here, so
just use the normal .text.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/lasat/image/head.S           |    2 +-
 arch/mips/lasat/image/romscript.normal |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S
index efb95f2..c699363 100644
--- a/arch/mips/lasat/image/head.S
+++ b/arch/mips/lasat/image/head.S
@@ -1,7 +1,7 @@
 #include <asm/lasat/head.h>
 
 	.text
-	.section .text.start, "ax"
+	.section .text, "ax"
 	.set noreorder
 	.set mips3
 
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal
index 988f8ad..f470353 100644
--- a/arch/mips/lasat/image/romscript.normal
+++ b/arch/mips/lasat/image/romscript.normal
@@ -4,7 +4,7 @@ SECTIONS
 {
   .text :
   {
-    *(.text.start)
+    *(.text)
   }
 
   /* Data in ROM */
-- 
1.6.2.1


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

end of thread, other threads:[~2009-05-01  0:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 23:53 [PATCH 0/4] section name cleanup for mips Tim Abbott
2009-04-30 23:53 ` [PATCH 1/4] mips: use NOSAVE_DATA macro for .data.nosave section Tim Abbott
2009-04-30 23:53   ` [PATCH 2/4] mips: use new macro for .data.cacheline_aligned section Tim Abbott
2009-04-30 23:53     ` [PATCH 3/4] mips: use new macros for .data.init_task Tim Abbott
2009-04-30 23:53       ` [PATCH 4/4] mips: use .text, not .text.start, for lasat boot loader Tim Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome