This patch series cleans up the section names on the mn10300
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 (6):
mn10300: Use macros for .bss.page_aligned section.
mn10300: Drop unused .data.idt section.
mn10300: use NOSAVE_DATA macro for .data.nosave section.
mn10300: use new macro for .data.cacheline_aligned section.
mn10300: use new macros for .data.init_task.
mn10300: use new macro for .data.read_mostly section.
arch/mn10300/kernel/init_task.c | 3 +--
arch/mn10300/kernel/vmlinux.lds.S | 29 ++++++-----------------------
2 files changed, 7 insertions(+), 25 deletions(-)
.data.nosave should not need a separate output section; this change
moves it into the .data output section.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David Howells <[email protected]>
---
arch/mn10300/kernel/vmlinux.lds.S | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 364250f..5e825e8 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -49,16 +49,11 @@ SECTIONS
/* writeable */
.data : { /* Data */
+ NOSAVE_DATA
DATA_DATA
CONSTRUCTORS
}
- . = ALIGN(PAGE_SIZE);
- __nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
- . = ALIGN(PAGE_SIZE);
- __nosave_end = .;
-
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
--
1.6.2.1
Signed-off-by: Tim Abbott <[email protected]>
Acked-by: David Howells <[email protected]>
---
arch/mn10300/kernel/vmlinux.lds.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 24de6b9..6ad0fa8 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -131,7 +131,7 @@ SECTIONS
__bss_start = .; /* BSS */
.bss : {
- *(.bss.page_aligned)
+ PAGE_ALIGNED_BSS
*(.bss)
}
. = ALIGN(4);
--
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: David Howells <[email protected]>
---
arch/mn10300/kernel/vmlinux.lds.S | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 5e825e8..cb43406 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -50,13 +50,11 @@ SECTIONS
/* writeable */
.data : { /* Data */
NOSAVE_DATA
+ CACHELINE_ALIGNED_DATA(32)
DATA_DATA
CONSTRUCTORS
}
- . = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
/* rarely changed data like cpu maps */
. = ALIGN(32);
.data.read_mostly : AT(ADDR(.data.read_mostly)) {
--
1.6.2.1
.data.read_mostly should not need a separate output section; this
change moves it into the .data section.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David Howells <[email protected]>
---
arch/mn10300/kernel/vmlinux.lds.S | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 4dc63e6..3da48d5 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -52,16 +52,11 @@ SECTIONS
INIT_TASK_DATA(THREAD_SIZE)
NOSAVE_DATA
CACHELINE_ALIGNED_DATA(32)
+ READ_MOSTLY_DATA(32)
DATA_DATA
CONSTRUCTORS
- }
-
- /* rarely changed data like cpu maps */
- . = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly)) {
- *(.data.read_mostly)
_edata = .; /* End of data section */
- }
+ }
/* might get freed after init */
. = ALIGN(PAGE_SIZE);
--
1.6.2.1
Since nothing gets put into .data.idt on this architecture, eliminate
it from the linker script.
This change was apparently proposed previously:
<http://lkml.indiana.edu/hypermail/linux/kernel/0802.2/2538.html>
CCing the author and people who acked that patch in case there was a
reason it wasn't applied.
Signed-off-by: Tim Abbott <[email protected]>
Acked-by: David Howells <[email protected]>
Acked-by: Cyrill Gorcunov <[email protected]>
Cc: Sam Ravnborg <[email protected]>
---
arch/mn10300/kernel/vmlinux.lds.S | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index 6ad0fa8..364250f 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -59,9 +59,6 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
- . = ALIGN(PAGE_SIZE);
- .data.page_aligned : { *(.data.idt) }
-
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
--
1.6.2.1
.data.init_task should not need a separate output section; this change
moves it into the .data section.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David Howells <[email protected]>
---
arch/mn10300/kernel/init_task.c | 3 +--
arch/mn10300/kernel/vmlinux.lds.S | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index 5ac3566..7a89fc3 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -30,8 +30,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/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index cb43406..4dc63e6 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -49,6 +49,7 @@ SECTIONS
/* writeable */
.data : { /* Data */
+ INIT_TASK_DATA(THREAD_SIZE)
NOSAVE_DATA
CACHELINE_ALIGNED_DATA(32)
DATA_DATA
@@ -62,9 +63,6 @@ SECTIONS
_edata = .; /* End of data section */
}
- . = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : { *(.data.init_task) }
-
/* might get freed after init */
. = ALIGN(PAGE_SIZE);
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
--
1.6.2.1