This patch series cleans up the section names on the alpha
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):
alpha: Use macros for .data.page_aligned.
alpha: use new macro for .data.cacheline_aligned section.
alpha: make THREAD_SIZE available to assembly files.
alpha: use .data.init_task instead of .data.init_thread
arch/alpha/include/asm/thread_info.h | 4 ++--
arch/alpha/kernel/init_task.c | 5 ++---
arch/alpha/kernel/vmlinux.lds.S | 19 ++++---------------
3 files changed, 8 insertions(+), 20 deletions(-)
.data.page_aligned should not need a separate output section, so as
part of this cleanup I moved into the .data output section in the
linker scripts in order to eliminate unnecessary references to the
section name.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: [email protected]
---
arch/alpha/kernel/vmlinux.lds.S | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index b9d6568..2f33cf9 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -97,11 +97,6 @@ SECTIONS
*(.data.init_thread)
}
- . = ALIGN(PAGE_SIZE);
- .data.page_aligned : {
- *(.data.page_aligned)
- }
-
. = ALIGN(64);
.data.cacheline_aligned : {
*(.data.cacheline_aligned)
@@ -110,6 +105,7 @@ SECTIONS
_data = .;
/* Data */
.data : {
+ PAGE_ALIGNED_DATA
DATA_DATA
CONSTRUCTORS
}
--
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: Richard Henderson <[email protected]>
Cc: [email protected]
---
arch/alpha/kernel/vmlinux.lds.S | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 2f33cf9..7acd1eb 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -97,15 +97,11 @@ SECTIONS
*(.data.init_thread)
}
- . = ALIGN(64);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
- }
-
_data = .;
/* Data */
.data : {
PAGE_ALIGNED_DATA
+ CACHELINE_ALIGNED_DATA(64)
DATA_DATA
CONSTRUCTORS
}
--
1.6.2.1
This allows THREAD_SIZE to be used in the linker script.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: [email protected]
---
arch/alpha/include/asm/thread_info.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d069526..a64d74d 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -49,12 +49,12 @@ struct thread_info {
register struct thread_info *__current_thread_info __asm__("$8");
#define current_thread_info() __current_thread_info
+#endif /* __ASSEMBLY__ */
+
/* Thread information allocation. */
#define THREAD_SIZE_ORDER 1
#define THREAD_SIZE (2*PAGE_SIZE)
-#endif /* __ASSEMBLY__ */
-
#define PREEMPT_ACTIVE 0x40000000
/*
--
1.6.2.1
alpha is the only architecture that uses the section name
.data.init_thread instead of .data.init_task. So convert alpha to use
.data.init_task like everything else.
.data.init_task should not need a separate output section; this change
also moves it into the .data output section.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: [email protected]
---
arch/alpha/kernel/init_task.c | 5 ++---
arch/alpha/kernel/vmlinux.lds.S | 7 ++-----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index c2938e5..475d46a 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -16,6 +16,5 @@ struct task_struct init_task = INIT_TASK(init_task);
EXPORT_SYMBOL(init_mm);
EXPORT_SYMBOL(init_task);
-union thread_union init_thread_union
- __attribute__((section(".data.init_thread")))
- = { INIT_THREAD_INFO(init_task) };
+union thread_union init_thread_union __init_task_data =
+ { INIT_THREAD_INFO(init_task) };
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 7acd1eb..caca724 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -1,5 +1,6 @@
#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
+#include <asm/thread_info.h>
OUTPUT_FORMAT("elf64-alpha")
OUTPUT_ARCH(alpha)
@@ -92,14 +93,10 @@ SECTIONS
__init_end = .;
/* Freed after init ends here */
- /* Note 2 page alignment above. */
- .data.init_thread : {
- *(.data.init_thread)
- }
-
_data = .;
/* Data */
.data : {
+ INIT_TASK_DATA(THREAD_SIZE)
PAGE_ALIGNED_DATA
CACHELINE_ALIGNED_DATA(64)
DATA_DATA
--
1.6.2.1