section name cleanup for ia64
cover section name cleanup for ia64
This patch series cleans up the section names on the ia64 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 (5):
ia64: Use .ref.text, not .text.init for start_ap.
ia64: use new macro for .data.cacheline_aligned section.
ia64: use new macros for .data.init_task
ia64: use new macro for .data.read_mostly section.
ia64: convert to new generic read_mostly support.
arch/ia64/Kconfig | 3 +++ arch/ia64/include/asm/cache.h | 2 -- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/init_task.c | 2 +- arch/ia64/kernel/vmlinux.lds.S | 15 +++------------ arch/ia64/xen/xensetup.S | 3 ++- 6 files changed, 10 insertions(+), 17 deletions(-)
PATCH 1/5 ia64: Use .ref.text, not .text.init for start_ap.
It seems that start_ap doesn't need to be in a special location in the kernel, but it references some init code so it should be in .ref.text.
Since this is the only thing in the .text.head section, eliminate .text.head from the linker script.
--- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/vmlinux.lds.S | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-)
arch/ia64/kernel/head.S +1 -1
@@ -181,7 +181,7 @@ swapper_pg_dir: halt_msg: stringz "Halting kernel\n" - .section .text.head,"ax" + __REF .global start_ap
arch/ia64/kernel/vmlinux.lds.S +0 -2
@@ -51,8 +51,6 @@ SECTIONS KPROBES_TEXT *(.gnu.linkonce.t*) } - .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) - { *(.text.head) } .text2 : AT(ADDR(.text2) - LOAD_OFFSET) { *(.text2) } #ifdef CONFIG_SMP
Signature · 1 line
1.6.2.1
PATCH 2/5 ia64: 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/ia64/kernel/vmlinux.lds.S | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/ia64/kernel/vmlinux.lds.S +1 -3
@@ -237,9 +237,6 @@ SECTIONS .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) } - .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) - { *(.data.cacheline_aligned) } - /* Per-cpu data: */ . = ALIGN(PERCPU_PAGE_SIZE); PERCPU_VADDR(PERCPU_ADDR, :percpu)
@@ -256,6 +253,7 @@ SECTIONS __cpu0_per_cpu = .; . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */ #endif + CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES) DATA_DATA *(.data1) *(.gnu.linkonce.d*)
Signature · 1 line
1.6.2.1
PATCH 3/5 ia64: 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/ia64/kernel/init_task.c | 2 +- arch/ia64/kernel/vmlinux.lds.S | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-)
arch/ia64/kernel/init_task.c +1 -1
@@ -37,7 +37,7 @@ union {struct thread_info thread_info; } s;unsigned long stack[KERNEL_STACK_SIZE /sizeof (unsigned long )]; -} init_task_mem asm ("init_task") __attribute__((section(".data.init_task"))) = {{ +} init_task_mem asm ("init_task") __init_task_data = {{ .task = INIT_TASK(init_task_mem.s.task), .thread_info = INIT_THREAD_INFO(init_task_mem.s.task) }};
arch/ia64/kernel/vmlinux.lds.S +1 -4
@@ -214,10 +214,6 @@ SECTIONS . = ALIGN(PAGE_SIZE); __init_end = .; - /* The initial task and kernel stack */ - .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) - { *(.data.init_task) } - .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { *(__special_page_section) __start_gate_section = .;
@@ -253,6 +249,7 @@ SECTIONS __cpu0_per_cpu = .; . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */ #endif + INIT_TASK_DATA(PAGE_SIZE) CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES) DATA_DATA *(.data1)
Signature · 1 line
1.6.2.1
PATCH 4/5 ia64: use new macro for .data.read_mostly section.
As with .data.cacheline_aligned, I eliminated the separate output section and set the alignment to SMP_CACHE_BYTES. An ack from Tony would be appreciated.
--- arch/ia64/kernel/vmlinux.lds.S | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
arch/ia64/kernel/vmlinux.lds.S +1 -3
@@ -230,9 +230,6 @@ SECTIONS * kernel data */ - .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) - { *(.data.read_mostly) } - /* Per-cpu data: */ . = ALIGN(PERCPU_PAGE_SIZE); PERCPU_VADDR(PERCPU_ADDR, :percpu)
@@ -251,6 +248,7 @@ SECTIONS #endif INIT_TASK_DATA(PAGE_SIZE) CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES) + READ_MOSTLY_DATA(SMP_CACHE_BYTES) DATA_DATA *(.data1) *(.gnu.linkonce.d*)
Signature · 1 line
1.6.2.1
PATCH 5/5 ia64: convert to new generic read_mostly support.
--- arch/ia64/Kconfig | 3 +++ arch/ia64/include/asm/cache.h | 2 -- arch/ia64/xen/xensetup.S | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-)
arch/ia64/Kconfig +3 -0
@@ -91,6 +91,9 @@ config GENERIC_TIME_VSYSCALL config HAVE_SETUP_PER_CPU_AREA def_bool y +config HAVE_READ_MOSTLY_DATA + def_bool y + config DMI bool default y
arch/ia64/include/asm/cache.h +0 -2
@@ -24,6 +24,4 @@# define SMP_CACHE_BYTES (1 << 3)#endif -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) -#endif /* _ASM_IA64_CACHE_H */
arch/ia64/xen/xensetup.S +2 -1
@@ -10,11 +10,12 @@ #include <asm/system.h> #include <asm/paravirt.h> #include <asm/xen/privop.h> +#include <linux/cache.h> #include <linux/elfnote.h> #include <linux/init.h> #include <xen/interface/elfnote.h> - .section .data.read_mostly + __READ_MOSTLY .align 8 .global xen_domain_type xen_domain_type:
Signature · 1 line
1.6.2.1