section name cleanup for frv
cover section name cleanup for frv
This patch series cleans up the section names on the frv 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):
frv: use new macro for .data.cacheline_aligned section.
frv: use new macros for .data.init_task
frv: rename .text.foo sections to .text..foo.
arch/frv/kernel/break.S | 2 +- arch/frv/kernel/entry.S | 2 +- arch/frv/kernel/head.S | 2 +- arch/frv/kernel/init_task.c | 3 +-- arch/frv/kernel/vmlinux.lds.S | 20 ++++++-------------- arch/frv/mm/tlb-miss.S | 2 +- 6 files changed, 11 insertions(+), 20 deletions(-)
PATCH 1/3 frv: 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.
--- arch/frv/kernel/vmlinux.lds.S | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/frv/kernel/vmlinux.lds.S +1 -3
@@ -76,9 +76,6 @@ SECTIONS *(.data.init_task) } - . = ALIGN(L1_CACHE_BYTES); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } - .trap : { /* trap table management - read entry-table.S before modifying */ . = ALIGN(8192);
@@ -131,6 +128,7 @@ SECTIONS _sdata = .; .data : { /* Data */ + CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) DATA_DATA *(.data.*) EXIT_DATA
Signature · 1 line
1.6.2.1
PATCH 2/3 frv: 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.
--- arch/frv/kernel/init_task.c | 3 +-- arch/frv/kernel/vmlinux.lds.S | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-)
arch/frv/kernel/init_task.c +1 -2
@@ -23,8 +23,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) };/*
arch/frv/kernel/vmlinux.lds.S +1 -7
@@ -69,13 +69,6 @@ SECTIONS . = ALIGN(THREAD_SIZE); __init_end = .; - /* put sections together that have massive alignment issues */ - . = ALIGN(THREAD_SIZE); - .data.init_task : { - /* init task record & stack */ - *(.data.init_task) - } - .trap : { /* trap table management - read entry-table.S before modifying */ . = ALIGN(8192);
@@ -128,6 +121,7 @@ SECTIONS _sdata = .; .data : { /* Data */ + INIT_TASK_DATA(THREAD_SIZE) CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) DATA_DATA *(.data.*)
Signature · 1 line
1.6.2.1
PATCH 3/3 frv: rename .text.foo sections to .text..foo.
Using special sections with names of the form .text.foo causes collisions with section names generated by -ffunction-sections.
--- arch/frv/kernel/break.S | 2 +- arch/frv/kernel/entry.S | 2 +- arch/frv/kernel/head.S | 2 +- arch/frv/kernel/vmlinux.lds.S | 8 ++++---- arch/frv/mm/tlb-miss.S | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)
arch/frv/kernel/break.S +1 -1
@@ -63,7 +63,7 @@ __break_trace_through_exceptions: # entry point for Break Exceptions/Interrupts # ############################################################################### - .section .text.break + .section .text..break .balign 4 .globl __entry_break __entry_break:
arch/frv/kernel/entry.S +1 -1
@@ -38,7 +38,7 @@ #define nr_syscalls ((syscall_table_size)/4) - .section .text.entry + .section .text..entry .balign 4 .macro LEDS val
arch/frv/kernel/head.S +1 -1
@@ -542,7 +542,7 @@ __head_end: .size _boot, .-_boot # provide a point for GDB to place a break - .section .text.start,"ax" + .section .text..start,"ax" .globl _start .balign 4 _start:
arch/frv/kernel/vmlinux.lds.S +4 -4
@@ -84,10 +84,10 @@ SECTIONS _text = .; _stext = .; .text : { - *(.text.start) - *(.text.entry) - *(.text.break) - *(.text.tlbmiss) + *(.text..start) + *(.text..entry) + *(.text..break) + *(.text..tlbmiss) TEXT_TEXT SCHED_TEXT LOCK_TEXT
arch/frv/mm/tlb-miss.S +1 -1
@@ -15,7 +15,7 @@ #include <asm/pgtable.h> #include <asm/spr-regs.h> - .section .text.tlbmiss + .section .text..tlbmiss .balign 4 .globl __entry_insn_mmu_miss
Signature · 1 line
1.6.2.1