Here is a new version of the -ffunction-sections -fdata-sections patch
series based on current Linus tree.
The last time a patch series for -ffunction-sections -fdata-sections
support was proposed for merge, Linus was concerned that the patch series
touched too much rapidly-changing code. So it was decided that we should
first clean up the kernel's linker scripts to use macros when referring to
these sections, and then have a set of relatively small patches actually
renaming the sections in the macros. The linker script cleanup work is
now done (the last bits were merged in the v2.6.33 merge window) and so
this is the patch series to actually rename the sections. After this
patch series is merged, there will be a small set of patches needed to
actually enable -ffunction-sections -fdata-sections.
Support for building the kernel with -ffunction-sections -fdata-sections
has two applications:
(1) It is the prerequisite needed for section garbage collection
(ld --gc-sections), which can shrink the kernel image by up to 10% on
embedded kernels.
(2) It is the primary prerequisite change needed for the Ksplice
rebootless update system.
The bulk of these patches replace section names like
.data.page_aligned to .data..page_aligned.
The problem is that with -ffunction-sections -fdata-sections gcc
creates sections like .text.head and .data.nosave
whenever someone has innocuous code like this:
static void head(...) {...}
or this:
static int nosave = 1;
somewhere in the kernel. Currently, kernel linker scripts
are confused by such names and put these sections in wrong places.
With these patches, and without adding -ffunction-sections
-fdata-section resulting kernel and modules do not materially
change. I checked it by examining ld -Map.
I run-tested these patches on x86-64, alone and with -ffunction-sections
-fdata-sections added to KBUILD_CFLAGS. In both cases kernel was booting
and working.
When these patches are applied, further plan is to modify linker scripts
so that they work correctly with gcc-generated .text.foo sections,
and they don't mix up gcc-generated .text.foo sections with special
.text..foo sections. Same applies for .data, .rodata, .bss.
avr32 specific question: Haavard, please take a look at patch #16.
It renames .text.reset to .text..reset in linker script.
However, I don't see where .text.reset section is generated.
Is the patch correct?
Please review, and if patches look okay, apply them.
Denys Vlasenko (19):
Rename .bss.stack to .bss..stack.
Rename .data.gate to .data..gate.
Rename .data.init_irqstack to .data..init_irqstack.
Rename .data..patch.XXX to .data..patch.XXX.
Rename .data[.percpu][.XXX] to .data[..percpu][..XXX].
Rename .data.read_mostly to .data..read_mostly.
Rename .data.vmpages and .data.vm0.XXX to .data..vmpages and
.data..vm0.XXX.
Rename .rodata.compressed to .rodata..compressed.
Rename .text.ivt to .text..ivt.
Rename .text.lock to .text..lock.
Rename .text.page_aligned to .text..page_aligned.
Rename .text.reset to .text..reset.
Rename .text.startup to .text..startup.
Rename .data.nosave to .data..nosave.
Rename .data.init to .data..init.
Rename .data.initvect to .data..initvect.
Rename .data.lock_aligned to .data..lock_aligned.
Rename special text sections in arch/frv from .text.XXX to
.text..XXX.
Rename .text.start to .text..start.
Tim Abbott (5):
Rename .data.cacheline_aligned to .data..cacheline_aligned.
Rename .data.init_task to .data..init_task.
powerpc: remove unused __page_aligned definition.
Rename .data.page_aligned to .data..page_aligned.
Rename .bss.page_aligned to .bss..page_aligned.
Documentation/mutex-design.txt | 4 +-
arch/avr32/kernel/vmlinux.lds.S | 2 +-
arch/frv/kernel/break.S | 4 +-
arch/frv/kernel/entry.S | 2 +-
arch/frv/kernel/head.S | 2 +-
arch/frv/kernel/vmlinux.lds.S | 10 ++++----
arch/frv/mm/tlb-miss.S | 2 +-
arch/h8300/boot/compressed/head.S | 2 +-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
arch/ia64/include/asm/asmmacro.h | 12 ++++----
arch/ia64/include/asm/cache.h | 2 +-
arch/ia64/include/asm/percpu.h | 2 +-
arch/ia64/kernel/Makefile.gate | 2 +-
arch/ia64/kernel/gate-data.S | 2 +-
arch/ia64/kernel/gate.S | 8 +++---
arch/ia64/kernel/gate.lds.S | 10 ++++----
arch/ia64/kernel/init_task.c | 2 +-
arch/ia64/kernel/ivt.S | 2 +-
arch/ia64/kernel/minstate.h | 4 +-
arch/ia64/kernel/paravirtentry.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 28 +++++++++++-----------
arch/ia64/kvm/vmm_ivt.S | 2 +-
arch/ia64/xen/gate-data.S | 2 +-
arch/ia64/xen/xensetup.S | 2 +-
arch/m68knommu/kernel/vmlinux.lds.S | 4 +-
arch/m68knommu/platform/68360/head-ram.S | 2 +-
arch/m68knommu/platform/68360/head-rom.S | 2 +-
arch/mips/lasat/image/head.S | 2 +-
arch/mips/lasat/image/romscript.normal | 2 +-
arch/parisc/include/asm/cache.h | 2 +-
arch/parisc/include/asm/system.h | 2 +-
arch/parisc/kernel/head.S | 2 +-
arch/parisc/kernel/init_task.c | 6 ++--
arch/parisc/kernel/vmlinux.lds.S | 12 ++++----
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/include/asm/page_64.h | 8 ------
arch/powerpc/kernel/vmlinux.lds.S | 10 +++----
arch/s390/include/asm/cache.h | 2 +-
arch/s390/kernel/swsusp_asm64.S | 2 +-
arch/sh/boot/compressed/vmlinux.scr | 2 +-
arch/sh/include/asm/cache.h | 2 +-
arch/sparc/boot/btfixupprep.c | 2 +-
arch/sparc/include/asm/cache.h | 2 +-
arch/um/kernel/dyn.lds.S | 2 +-
arch/um/kernel/init_task.c | 2 +-
arch/um/kernel/uml.lds.S | 2 +-
arch/x86/boot/compressed/mkpiggy.c | 2 +-
arch/x86/boot/compressed/vmlinux.lds.S | 4 +-
arch/x86/include/asm/cache.h | 2 +-
arch/x86/kernel/acpi/wakeup_32.S | 2 +-
arch/x86/kernel/init_task.c | 2 +-
arch/x86/kernel/setup_percpu.c | 2 +-
arch/x86/kernel/vmlinux.lds.S | 4 +-
include/asm-generic/percpu.h | 10 ++++----
include/asm-generic/vmlinux.lds.h | 38 +++++++++++++++---------------
include/linux/cache.h | 2 +-
include/linux/init.h | 2 +-
include/linux/init_task.h | 2 +-
include/linux/linkage.h | 8 +++---
include/linux/percpu-defs.h | 4 +-
include/linux/spinlock.h | 2 +-
kernel/module.c | 2 +-
62 files changed, 132 insertions(+), 142 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
There is already an architecture-independent __page_aligned_data macro
for this purpose, so removing the powerpc-specific macro should be
harmless.
Signed-off-by: Tim Abbott <tab...@ksplice.com>
Cc: Benjamin Herrenschmidt <be...@kernel.crashing.org>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Sam Ravnborg <s...@ravnborg.org>
Signed-off-by: Denys Vlasenko <vda....@googlemail.com>
---
arch/powerpc/include/asm/page_64.h | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index bfc4e02..358ff14 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -162,14 +162,6 @@ do { \
#endif /* !CONFIG_HUGETLB_PAGE */
-#ifdef MODULE
-#define __page_aligned __attribute__((__aligned__(PAGE_SIZE)))
-#else
-#define __page_aligned \
- __attribute__((__aligned__(PAGE_SIZE), \
- __section__(".data.page_aligned")))
-#endif
-
#define VM_DATA_DEFAULT_FLAGS \
(test_thread_flag(TIF_32BIT) ? \
VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64)
--
1.6.2.4
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S
index 0c26cc1..e5cd623 100644
--- a/arch/s390/kernel/swsusp_asm64.S
+++ b/arch/s390/kernel/swsusp_asm64.S
@@ -261,7 +261,7 @@ restore_registers:
lghi %r2,0
br %r14
- .section .data.nosave,"aw",@progbits
+ .section .data..nosave,"aw",@progbits
.align 8
.Ldisabled_wait_31:
.long 0x000a0000,0x00000000
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6f6da4f..ea36605 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -175,7 +175,7 @@
#define NOSAVE_DATA \
. = ALIGN(PAGE_SIZE); \
VMLINUX_SYMBOL(__nosave_begin) = .; \
- *(.data.nosave) \
+ *(.data..nosave) \
. = ALIGN(PAGE_SIZE); \
VMLINUX_SYMBOL(__nosave_end) = .;
diff --git a/include/linux/init.h b/include/linux/init.h
index ab1d31f..de99430 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -301,7 +301,7 @@ void __init parse_early_options(char *cmdline);
#endif
/* Data marked not to be saved by software suspend */
-#define __nosavedata __section(.data.nosave)
+#define __nosavedata __section(.data..nosave)
/* This means "can be init if no module support, otherwise module load
may call it." */
--
1.6.2.4
diff --git a/arch/ia64/include/asm/asmmacro.h b/arch/ia64/include/asm/asmmacro.h
index c1642fd..3ab6d75 100644
--- a/arch/ia64/include/asm/asmmacro.h
+++ b/arch/ia64/include/asm/asmmacro.h
@@ -70,12 +70,12 @@ name:
* path (ivt.S - TLB miss processing) or in places where it might not be
* safe to use a "tpa" instruction (mca_asm.S - error recovery).
*/
- .section ".data.patch.vtop", "a" // declare section & section attributes
+ .section ".data..patch.vtop", "a" // declare section & section attributes
.previous
#define LOAD_PHYSICAL(pr, reg, obj) \
[1:](pr)movl reg = obj; \
- .xdata4 ".data.patch.vtop", 1b-.
+ .xdata4 ".data..patch.vtop", 1b-.
/*
* For now, we always put in the McKinley E9 workaround. On CPUs that don't need it,
@@ -84,11 +84,11 @@ name:
#define DO_MCKINLEY_E9_WORKAROUND
#ifdef DO_MCKINLEY_E9_WORKAROUND
- .section ".data.patch.mckinley_e9", "a"
+ .section ".data..patch.mckinley_e9", "a"
.previous
/* workaround for Itanium 2 Errata 9: */
# define FSYS_RETURN \
- .xdata4 ".data.patch.mckinley_e9", 1f-.; \
+ .xdata4 ".data..patch.mckinley_e9", 1f-.; \
1:{ .mib; \
nop.m 0; \
mov r16=ar.pfs; \
@@ -107,11 +107,11 @@ name:
* If physical stack register size is different from DEF_NUM_STACK_REG,
* dynamically patch the kernel for correct size.
*/
- .section ".data.patch.phys_stack_reg", "a"
+ .section ".data..patch.phys_stack_reg", "a"
.previous
#define LOAD_PHYS_STACK_REG_SIZE(reg) \
[1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \
- .xdata4 ".data.patch.phys_stack_reg", 1b-.
+ .xdata4 ".data..patch.phys_stack_reg", 1b-.
/*
* Up until early 2004, use of .align within a function caused bad unwind info.
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index cf5e0a1..245d3e1 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -21,18 +21,18 @@
* to targets outside the shared object) and to avoid multi-phase kernel builds, we
* simply create minimalistic "patch lists" in special ELF sections.
*/
- .section ".data.patch.fsyscall_table", "a"
+ .section ".data..patch.fsyscall_table", "a"
.previous
#define LOAD_FSYSCALL_TABLE(reg) \
[1:] movl reg=0; \
- .xdata4 ".data.patch.fsyscall_table", 1b-.
+ .xdata4 ".data..patch.fsyscall_table", 1b-.
- .section ".data.patch.brl_fsys_bubble_down", "a"
+ .section ".data..patch.brl_fsys_bubble_down", "a"
.previous
#define BRL_COND_FSYS_BUBBLE_DOWN(pr) \
[1:](pr)brl.cond.sptk 0; \
;; \
- .xdata4 ".data.patch.brl_fsys_bubble_down", 1b-.
+ .xdata4 ".data..patch.brl_fsys_bubble_down", 1b-.
GLOBAL_ENTRY(__kernel_syscall_via_break)
.prologue
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S
index 88c64ed..d32b085 100644
--- a/arch/ia64/kernel/gate.lds.S
+++ b/arch/ia64/kernel/gate.lds.S
@@ -33,21 +33,21 @@ SECTIONS
*/
. = GATE_ADDR + 0x600;
- .data.patch : {
+ .data..patch : {
__paravirt_start_gate_mckinley_e9_patchlist = .;
- *(.data.patch.mckinley_e9)
+ *(.data..patch.mckinley_e9)
__paravirt_end_gate_mckinley_e9_patchlist = .;
__paravirt_start_gate_vtop_patchlist = .;
- *(.data.patch.vtop)
+ *(.data..patch.vtop)
__paravirt_end_gate_vtop_patchlist = .;
__paravirt_start_gate_fsyscall_patchlist = .;
- *(.data.patch.fsyscall_table)
+ *(.data..patch.fsyscall_table)
__paravirt_end_gate_fsyscall_patchlist = .;
__paravirt_start_gate_brl_fsys_bubble_down_patchlist = .;
- *(.data.patch.brl_fsys_bubble_down)
+ *(.data..patch.brl_fsys_bubble_down)
__paravirt_end_gate_brl_fsys_bubble_down_patchlist = .;
} :readable
diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h
index 292e214..d56753a 100644
--- a/arch/ia64/kernel/minstate.h
+++ b/arch/ia64/kernel/minstate.h
@@ -16,7 +16,7 @@
#define ACCOUNT_SYS_ENTER
#endif
-.section ".data.patch.rse", "a"
+.section ".data..patch.rse", "a"
.previous
/*
@@ -215,7 +215,7 @@
(pUStk) extr.u r17=r18,3,6; \
(pUStk) sub r16=r18,r22; \
[1:](pKStk) br.cond.sptk.many 1f; \
- .xdata4 ".data.patch.rse",1b-. \
+ .xdata4 ".data..patch.rse",1b-. \
;; \
cmp.ge p6,p7 = 33,r17; \
;; \
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 3e33809..b943eff 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -75,10 +75,10 @@ SECTIONS
__stop___mca_table = .;
}
- .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
+ .data..patch.phys_stack_reg : AT(ADDR(.data..patch.phys_stack_reg) - LOAD_OFFSET)
{
__start___phys_stack_reg_patchlist = .;
- *(.data.patch.phys_stack_reg)
+ *(.data..patch.phys_stack_reg)
__end___phys_stack_reg_patchlist = .;
}
@@ -110,24 +110,24 @@ SECTIONS
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(16)
- .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
+ .data..patch.vtop : AT(ADDR(.data..patch.vtop) - LOAD_OFFSET)
{
__start___vtop_patchlist = .;
- *(.data.patch.vtop)
+ *(.data..patch.vtop)
__end___vtop_patchlist = .;
}
- .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
+ .data..patch.rse : AT(ADDR(.data..patch.rse) - LOAD_OFFSET)
{
__start___rse_patchlist = .;
- *(.data.patch.rse)
+ *(.data..patch.rse)
__end___rse_patchlist = .;
}
- .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
+ .data..patch.mckinley_e9 : AT(ADDR(.data..patch.mckinley_e9) - LOAD_OFFSET)
{
__start___mckinley_e9_bundles = .;
- *(.data.patch.mckinley_e9)
+ *(.data..patch.mckinley_e9)
__end___mckinley_e9_bundles = .;
}
--
1.6.2.4
diff --git a/arch/ia64/include/asm/percpu.h b/arch/ia64/include/asm/percpu.h
index 30cf465..35d9aeb 100644
--- a/arch/ia64/include/asm/percpu.h
+++ b/arch/ia64/include/asm/percpu.h
@@ -31,7 +31,7 @@ extern void *per_cpu_init(void);
#endif /* SMP */
-#define PER_CPU_BASE_SECTION ".data.percpu"
+#define PER_CPU_BASE_SECTION ".data..percpu"
/*
* Be extremely careful when taking the address of this variable! Due to virtual
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 8087b90..1202a15 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -76,7 +76,7 @@ extern void setup_per_cpu_areas(void);
#ifndef PER_CPU_BASE_SECTION
#ifdef CONFIG_SMP
-#define PER_CPU_BASE_SECTION ".data.percpu"
+#define PER_CPU_BASE_SECTION ".data..percpu"
#else
#define PER_CPU_BASE_SECTION ".data"
#endif
@@ -88,15 +88,15 @@ extern void setup_per_cpu_areas(void);
#define PER_CPU_SHARED_ALIGNED_SECTION ""
#define PER_CPU_ALIGNED_SECTION ""
#else
-#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
-#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
+#define PER_CPU_SHARED_ALIGNED_SECTION "..shared_aligned"
+#define PER_CPU_ALIGNED_SECTION "..shared_aligned"
#endif
-#define PER_CPU_FIRST_SECTION ".first"
+#define PER_CPU_FIRST_SECTION "..first"
#else
#define PER_CPU_SHARED_ALIGNED_SECTION ""
-#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
+#define PER_CPU_ALIGNED_SECTION "..shared_aligned"
#define PER_CPU_FIRST_SECTION ""
#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 32cddc1..e304fcd 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -666,16 +666,16 @@
*/
#define PERCPU_VADDR(vaddr, phdr) \
VMLINUX_SYMBOL(__per_cpu_load) = .; \
- .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
+ .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
- LOAD_OFFSET) { \
VMLINUX_SYMBOL(__per_cpu_start) = .; \
- *(.data.percpu.first) \
- *(.data.percpu.page_aligned) \
- *(.data.percpu) \
- *(.data.percpu.shared_aligned) \
+ *(.data..percpu..first) \
+ *(.data..percpu..page_aligned) \
+ *(.data..percpu) \
+ *(.data..percpu..shared_aligned) \
VMLINUX_SYMBOL(__per_cpu_end) = .; \
} phdr \
- . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
+ . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
/**
* PERCPU - define output section for percpu area, simple version
@@ -687,18 +687,18 @@
*
* This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
* that __per_cpu_load is defined as a relative symbol against
- * .data.percpu which is required for relocatable x86_32
+ * .data..percpu which is required for relocatable x86_32
* configuration.
*/
#define PERCPU(align) \
. = ALIGN(align); \
- .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
+ .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__per_cpu_load) = .; \
VMLINUX_SYMBOL(__per_cpu_start) = .; \
- *(.data.percpu.first) \
- *(.data.percpu.page_aligned) \
- *(.data.percpu) \
- *(.data.percpu.shared_aligned) \
+ *(.data..percpu..first) \
+ *(.data..percpu..page_aligned) \
+ *(.data..percpu) \
+ *(.data..percpu..shared_aligned) \
VMLINUX_SYMBOL(__per_cpu_end) = .; \
}
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 5a5d6ce..2351191 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -127,11 +127,11 @@
* Declaration/definition used for per-CPU variables that must be page aligned.
*/
#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \
- DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \
+ DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \
__aligned(PAGE_SIZE)
#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
- DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \
+ DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \
__aligned(PAGE_SIZE)
/*
diff --git a/kernel/module.c b/kernel/module.c
index f82386b..5daf0ab 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -397,7 +397,7 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
const char *secstrings)
{
- return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
+ return find_sec(hdr, sechdrs, secstrings, ".data..percpu");
}
static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
--
1.6.2.4
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index d020eae..4a91e43 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -53,11 +53,11 @@ union thread_union init_thread_union __init_task_data
* guarantee that global objects will be laid out in memory in the same order
* as the order of declaration, so put these in different sections and use
* the linker script to order them. */
-pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE)));
+pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data..vm0.pmd"), aligned(PAGE_SIZE)));
#endif
-pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE)));
-pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE)));
+pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data..vm0.pgd"), aligned(PAGE_SIZE)));
+pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data..vm0.pte"), aligned(PAGE_SIZE)));
/*
* Initial task structure.
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 9dab4a4..33ec31d 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -105,10 +105,10 @@ SECTIONS
__bss_start = .;
/* page table entries need to be PAGE_SIZE aligned */
. = ALIGN(PAGE_SIZE);
- .data.vmpages : {
- *(.data.vm0.pmd)
- *(.data.vm0.pgd)
- *(.data.vm0.pte)
+ .data..vmpages : {
+ *(.data..vm0.pmd)
+ *(.data..vm0.pgd)
+ *(.data..vm0.pte)
}
.bss : {
*(.bss)
--
1.6.2.4
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index c5388b7..cbb6958 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -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:
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 189397e..63d579b 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -38,7 +38,7 @@
#define nr_syscalls ((syscall_table_size)/4)
- .section .text.entry
+ .section .text..entry
.balign 4
.macro LEDS val
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index b825ef3..e9a8cc6 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -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:
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 472eb8c..8b973f3 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -57,10 +57,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
diff --git a/arch/frv/mm/tlb-miss.S b/arch/frv/mm/tlb-miss.S
index 7f392bc..f3ac019 100644
--- a/arch/frv/mm/tlb-miss.S
+++ b/arch/frv/mm/tlb-miss.S
@@ -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
--
1.6.2.4
Denys,
Not read all your patches. But I had recently the problem
that I need a generic way to check for a symbol being
inside the kernel image (text or data). There wasn't
a common symbol that worked for both XIP ARM and normal
architectures. Is this something addressed by your patchkit?
It essentially needs common symbol(s) that can be used
to check for the kernel image itself.
-Andi
On Saturday 20 February 2010 10:22, Andi Kleen wrote:
> On Sat, Feb 20, 2010 at 01:03:33AM +0100, Denys Vlasenko wrote:
> > Hi Michal, Sam, folks,
> > Here is a new version of the -ffunction-sections -fdata-sections patch
> > series based on current Linus tree.
> Denys,
>
> Not read all your patches. But I had recently the problem
> that I need a generic way to check for a symbol being
> inside the kernel image (text or data).
I'm not sure I understood the problem.
> There wasn't
> a common symbol that worked for both XIP ARM and normal
> architectures. Is this something addressed by your patchkit?
Most likely not.
--
vda
> Here is a new version of the -ffunction-sections -fdata-sections patch
> series based on current Linus tree.
Aside from patch 17, which I would prefer that Haavard review, these
patches look correct (and patch 17 can be safely dropped). Please
consider the rest of Denys' patches in this patch series
Acked-by: Tim Abbott <tab...@ksplice.com>
The patches still apply fine on Linus' current master. There are no merge
conflicts with linux-next's current master, but we will need to do
something to merge with
"Blackfin: initial XIP support"
in linux-next, which introduces a direct reference to .data.percpu.* (not
using the normal PERCPU macros so they can put .data.percpu content inside
the .init.data section). That conflict looks easy to deal with by adding
a new macro to handle this case (CCing the author and blackfin maintainer;
it's possible that this blackfin patch is going in soon, in which case we
can just rebase these patches on top).
Michal, what are your thoughts on this patch series? The kbuild tree
would be a reasonable path for merging these patches.
-Tim Abbott
Thanks.
> [...]
>
> Michal, what are your thoughts on this patch series? The kbuild tree
> would be a reasonable path for merging these patches.
Yes it would. I'm sorry, I was a bit bussy last two weeks. I'll do some
random tests and add the patches to kbuild-next now. The patches look
simple enough for me and don't actually change any functionality if one
doesn't deliberately use -ffunction-sections -fdata-sections, so I hope
Linus will be fine with merging it for 2.6.34.
Michal
ive posted this patch for merging via the Blackfin tree now, so
hopefully it'll be in soon
-mike
David