section name cleanup for xtensa
cover section name cleanup for xtensa
This patch series cleans up the section names on the xtensa 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):
xtensa: Use macros for .bss.page_aligned section.
xtensa: use new macro for .data.cacheline_aligned section.
xtensa: use new macros for .data.init_task.
arch/xtensa/kernel/head.S | 2 +- arch/xtensa/kernel/init_task.c | 3 +-- arch/xtensa/kernel/vmlinux.lds.S | 10 +++------- 3 files changed, 5 insertions(+), 10 deletions(-)
PATCH 1/3 xtensa: Use macros for .bss.page_aligned section.
--- arch/xtensa/kernel/head.S | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/xtensa/kernel/head.S +1 -1
@@ -235,7 +235,7 @@ should_never_return: * BSS section */ -.section ".bss.page_aligned", "w" +__PAGE_ALIGNED_BSS #ifdef CONFIG_MMU ENTRY(swapper_pg_dir) .fill PAGE_SIZE, 1, 0
arch/xtensa/kernel/vmlinux.lds.S +1 -1
@@ -262,7 +262,7 @@ SECTIONS /* BSS section */ _bss_start = .; - .bss : { *(.bss.page_aligned) *(.bss) } + .bss : { PAGE_ALIGNED_BSS *(.bss) } _bss_end = .; _end = .;
Signature · 1 line
1.6.2.1
PATCH 2/3 xtensa: use new macro for .data.cacheline_aligned section.
--- arch/xtensa/kernel/vmlinux.lds.S | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/xtensa/kernel/vmlinux.lds.S +1 -2
@@ -123,8 +123,7 @@ SECTIONS { DATA_DATA CONSTRUCTORS - . = ALIGN(XCHAL_ICACHE_LINESIZE); - *(.data.cacheline_aligned) + CACHELINE_ALIGNED_DATA(XCHAL_ICACHE_LINESIZE) } _edata = .;
Signature · 1 line
1.6.2.1
PATCH 3/3 xtensa: use new macros for .data.init_task.
.data.init_task should not need a separate output section; this change moves it into the .data section. Also replace aligment of 8192 with THREAD_SIZE (=8192).
--- arch/xtensa/kernel/init_task.c | 3 +-- arch/xtensa/kernel/vmlinux.lds.S | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-)
arch/xtensa/kernel/init_task.c +1 -2
@@ -27,8 +27,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);EXPORT_SYMBOL (init_mm); -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) };struct task_struct init_task =INIT_TASK (init_task);
arch/xtensa/kernel/vmlinux.lds.S +1 -4
@@ -121,6 +121,7 @@ SECTIONS _fdata = .; .data : { + INIT_TASK_DATA(THREAD_SIZE) DATA_DATA CONSTRUCTORS CACHELINE_ALIGNED_DATA(XCHAL_ICACHE_LINESIZE)
@@ -128,10 +129,6 @@ SECTIONS _edata = .; - /* The initial task */ - . = ALIGN(8192); - .data.init_task : { *(.data.init_task) } - /* Initialization code and data: */ . = ALIGN(1 << 12);
Signature · 1 line
1.6.2.1