2009-04-30 23:55:39

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 0/4] section name cleanup for mips

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(-)


2009-04-30 23:56:02

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 1/4] mips: use NOSAVE_DATA macro for .data.nosave section.

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 <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
---
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

2009-04-30 23:58:41

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 4/4] mips: use .text, not .text.start, for lasat boot loader.

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 <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
---
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

2009-05-01 00:01:34

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 3/4] mips: use new macros for .data.init_task.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
---
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

2009-05-01 00:05:47

by Tim Abbott

[permalink] [raw]
Subject: [PATCH 2/4] mips: 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.

Signed-off-by: Tim Abbott <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
---
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