This patch series cleans up the section names on the m32r
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):
m32r: use NOSAVE_DATA macro for .data.nosave section.
m32r: use new macro for .data.cacheline_aligned section.
m32r: use new macros for .data.init_task.
arch/m32r/kernel/init_task.c | 3 +--
arch/m32r/kernel/vmlinux.lds.S | 16 +++-------------
2 files changed, 4 insertions(+), 15 deletions(-)
This has the nice consequence of replacing the alignment of 4096 with
an alignment of PAGE_SIZE (=4096).
.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: Hirokazu Takata <[email protected]>
---
arch/m32r/kernel/vmlinux.lds.S | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 4179adf..1cfaff3 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -51,16 +51,11 @@ SECTIONS
.data : { /* Data */
*(.spu)
*(.spi)
+ NOSAVE_DATA
DATA_DATA
CONSTRUCTORS
}
- . = ALIGN(4096);
- __nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
- . = ALIGN(4096);
- __nosave_end = .;
-
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
--
1.6.2.1
.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: Hirokazu Takata <[email protected]>
---
arch/m32r/kernel/vmlinux.lds.S | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 1cfaff3..3e2de1f 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -52,13 +52,10 @@ SECTIONS
*(.spu)
*(.spi)
NOSAVE_DATA
+ CACHELINE_ALIGNED_DATA(32)
DATA_DATA
CONSTRUCTORS
}
-
- . = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
--
1.6.2.1
Signed-off-by: Tim Abbott <[email protected]>
Cc: Hirokazu Takata <[email protected]>
---
arch/m32r/kernel/init_task.c | 3 +--
arch/m32r/kernel/vmlinux.lds.S | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 016885c..a57c1e3 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -24,8 +24,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) };
/*
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 3e2de1f..655eaf1 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -51,6 +51,7 @@ SECTIONS
.data : { /* Data */
*(.spu)
*(.spi)
+ INIT_TASK_DATA(8192)
NOSAVE_DATA
CACHELINE_ALIGNED_DATA(32)
DATA_DATA
@@ -58,9 +59,6 @@ SECTIONS
}
_edata = .; /* End of data section */
- . = ALIGN(8192); /* init_task */
- .data.init_task : { *(.data.init_task) }
-
/* will be freed after init */
. = ALIGN(4096); /* Init code and data */
__init_begin = .;
--
1.6.2.1