Hi Linus,
Here is a new version of the -ffunction-sections -fdata-sections patch
series based on your current master. Please apply.
When I sent a version of this patch series at the start of the merge
window, Stephen Rothwell pointed out that the first patch conflicted
with several changes in linux-next, and it should be resent near the
end of the merge window once those changes were merged. There are
now no conflicting changes staged in linux-next[0], so now is probably
the optimal time to merge this patch series.
[0] There is one trivial merge conflict with next-20090403 because
e5083a63b6a8546c5fe1e571fe529e3939787ec2 was merged into master since
then, but this will presumably disappear when next catches up tomorrow.
-Tim Abbott
--
The purpose of this patch series is to make it possible to build the
kernel with "gcc -ffunction-sections -fdata-sections". There are two
major applications for this functionality: decreasing vmlinux image
size with --gc-sections, and Ksplice.
The original motivation for this functionality was to allow using the
linker's unused section garbage collection support (ld --gc-sections)
in order to get a smaller vmlinux image for embedded systems. People
have been developing patches for supporting building the kernel with
-ffunction-sections -fdata-sections for this purpose for a few years
now (e.g. [1]). The most recent previous set of patches for
--gc-sections was by Denys Vlasenko, and saved 10% on vmlinux size
with CONFIG_MODULES=n and 1% with CONFIG_MODULES=y [2,3,4]. The
primary source of complexity in the various patch series for doing
section garbage collection has been in the patches adding support for
compiling the kernel with -ffunction-sections -fdata-sections, so
merging this patch series should be a big step towards those
significant savings in kernel image size.
[1] <http://lkml.org/lkml/2006/6/4/169>
[2] <http://lkml.org/lkml/2007/9/5/90>
[3] <http://lkml.org/lkml/2007/9/7/110>
[4] <http://lkml.org/lkml/2008/7/1/499>
Support for building the kernel with -ffunction-sections
-fdata-sections is the only significant prerequisite change currently
required by Ksplice. Ksplice is a system for updating the Linux
kernel without rebooting [5].
[5] <http://lkml.org/lkml/2009/2/24/362> is the latest version of the
Ksplice patch series
Patches 1/4, 2/4, and 3/4 are independent of each other, but
all three are prerequisites for patch 4/4.
Anders Kaseorg (1):
modpost: Check the section flags, not name, to catch missing
"ax"/"aw"
Denys Vlasenko (1):
modpost: Support objects with more than 64k sections
Tim Abbott (1):
Make section names compatible with -ffunction-sections
-fdata-sections
Waseem Daher (1):
x86: Add an option to compile with -ffunction-sections
-fdata-sections
Documentation/mutex-design.txt | 4 +-
Makefile | 4 +
arch/alpha/kernel/head.S | 2 +-
arch/alpha/kernel/init_task.c | 2 +-
arch/alpha/kernel/vmlinux.lds.S | 14 ++--
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/init_task.c | 2 +-
arch/arm/kernel/vmlinux.lds.S | 16 ++--
arch/arm/mm/proc-v6.S | 2 +-
arch/arm/mm/proc-v7.S | 2 +-
arch/arm/mm/tlb-v6.S | 2 +-
arch/arm/mm/tlb-v7.S | 2 +-
arch/avr32/kernel/init_task.c | 2 +-
arch/avr32/kernel/vmlinux.lds.S | 6 +-
arch/avr32/mm/init.c | 2 +-
arch/blackfin/kernel/vmlinux.lds.S | 2 +-
arch/cris/kernel/process.c | 2 +-
arch/cris/kernel/vmlinux.lds.S | 2 +-
arch/frv/kernel/break.S | 4 +-
arch/frv/kernel/entry.S | 2 +-
arch/frv/kernel/head-mmu-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr401.S | 2 +-
arch/frv/kernel/head-uc-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr555.S | 2 +-
arch/frv/kernel/head.S | 4 +-
arch/frv/kernel/init_task.c | 2 +-
arch/frv/kernel/vmlinux.lds.S | 18 ++--
arch/frv/mm/tlb-miss.S | 2 +-
arch/h8300/boot/compressed/head.S | 2 +-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
arch/h8300/kernel/init_task.c | 2 +-
arch/h8300/kernel/vmlinux.lds.S | 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/head.S | 2 +-
arch/ia64/kernel/init_task.c | 4 +-
arch/ia64/kernel/ivt.S | 2 +-
arch/ia64/kernel/minstate.h | 4 +-
arch/ia64/kernel/paravirtentry.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 44 ++++----
arch/ia64/kvm/vmm_ivt.S | 2 +-
arch/ia64/xen/gate-data.S | 2 +-
arch/ia64/xen/xensetup.S | 2 +-
arch/m32r/kernel/head.S | 2 +-
arch/m32r/kernel/init_task.c | 2 +-
arch/m32r/kernel/vmlinux.lds.S | 8 +-
arch/m68k/kernel/head.S | 2 +-
arch/m68k/kernel/process.c | 2 +-
arch/m68k/kernel/sun3-head.S | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 6 +-
arch/m68k/kernel/vmlinux-sun3.lds | 4 +-
arch/m68knommu/kernel/init_task.c | 2 +-
arch/m68knommu/kernel/vmlinux.lds.S | 6 +-
arch/m68knommu/platform/68360/head-ram.S | 2 +-
arch/m68knommu/platform/68360/head-rom.S | 2 +-
arch/mips/kernel/init_task.c | 2 +-
arch/mips/kernel/vmlinux.lds.S | 8 +-
arch/mips/lasat/image/head.S | 2 +-
arch/mips/lasat/image/romscript.normal | 2 +-
arch/mn10300/kernel/head.S | 2 +-
arch/mn10300/kernel/init_task.c | 2 +-
arch/mn10300/kernel/vmlinux.lds.S | 16 ++--
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 | 8 +-
arch/parisc/kernel/vmlinux.lds.S | 26 +++---
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/include/asm/page_64.h | 2 +-
arch/powerpc/include/asm/ppc_asm.h | 4 +-
arch/powerpc/kernel/head_32.S | 2 +-
arch/powerpc/kernel/head_40x.S | 2 +-
arch/powerpc/kernel/head_44x.S | 2 +-
arch/powerpc/kernel/head_8xx.S | 2 +-
arch/powerpc/kernel/head_fsl_booke.S | 2 +-
arch/powerpc/kernel/init_task.c | 2 +-
arch/powerpc/kernel/machine_kexec_64.c | 2 +-
arch/powerpc/kernel/vdso.c | 2 +-
arch/powerpc/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/powerpc/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/powerpc/kernel/vmlinux.lds.S | 22 ++--
arch/s390/include/asm/cache.h | 2 +-
arch/s390/kernel/head.S | 2 +-
arch/s390/kernel/init_task.c | 2 +-
arch/s390/kernel/vdso.c | 2 +-
arch/s390/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/s390/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/s390/kernel/vmlinux.lds.S | 20 ++--
arch/sh/include/asm/cache.h | 2 +-
arch/sh/kernel/cpu/sh5/entry.S | 4 +-
arch/sh/kernel/head_32.S | 2 +-
arch/sh/kernel/head_64.S | 2 +-
arch/sh/kernel/init_task.c | 2 +-
arch/sh/kernel/irq.c | 4 +-
arch/sh/kernel/vmlinux_32.lds.S | 14 ++--
arch/sh/kernel/vmlinux_64.lds.S | 14 ++--
arch/sparc/boot/btfixupprep.c | 4 +-
arch/sparc/include/asm/cache.h | 2 +-
arch/sparc/kernel/head_32.S | 4 +-
arch/sparc/kernel/head_64.S | 2 +-
arch/sparc/kernel/init_task.c | 2 +-
arch/sparc/kernel/vmlinux.lds.S | 14 ++--
arch/um/include/asm/common.lds.S | 4 +-
arch/um/kernel/dyn.lds.S | 4 +-
arch/um/kernel/init_task.c | 4 +-
arch/um/kernel/uml.lds.S | 4 +-
arch/x86/Kconfig | 1 +
arch/x86/boot/compressed/head_32.S | 2 +-
arch/x86/boot/compressed/head_64.S | 2 +-
arch/x86/boot/compressed/relocs.c | 2 +-
arch/x86/boot/compressed/vmlinux.scr | 2 +-
arch/x86/boot/compressed/vmlinux_32.lds | 14 ++-
arch/x86/boot/compressed/vmlinux_64.lds | 10 +-
arch/x86/include/asm/cache.h | 4 +-
arch/x86/kernel/acpi/wakeup_32.S | 2 +-
arch/x86/kernel/head_32.S | 6 +-
arch/x86/kernel/head_64.S | 4 +-
arch/x86/kernel/init_task.c | 4 +-
arch/x86/kernel/setup_percpu.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
arch/x86/kernel/vmlinux_32.lds.S | 29 +++---
arch/x86/kernel/vmlinux_64.lds.S | 27 +++---
arch/xtensa/kernel/head.S | 2 +-
arch/xtensa/kernel/init_task.c | 2 +-
arch/xtensa/kernel/vmlinux.lds.S | 6 +-
include/asm-frv/init.h | 8 +-
include/asm-generic/vmlinux.lds.h | 35 ++++---
include/linux/cache.h | 2 +-
include/linux/init.h | 8 +-
include/linux/linkage.h | 4 +-
include/linux/percpu.h | 2 +-
include/linux/spinlock.h | 2 +-
kernel/module.c | 2 +-
lib/Kconfig.debug | 18 +++
scripts/mod/file2alias.c | 6 +-
scripts/mod/modpost.c | 155 ++++++++++++++++-----------
scripts/mod/modpost.h | 43 ++++++++
scripts/recordmcount.pl | 6 +-
144 files changed, 513 insertions(+), 407 deletions(-)
From: Denys Vlasenko <[email protected]>
This patch makes modpost able to process object files with more than
64k sections. Needed for huge kernel builds (allyesconfig, for example)
with -ffunction-sections.
Signed-off-by: Denys Vlasenko <[email protected]>
[[email protected]: updated for 2.6.29]
Signed-off-by: Anders Kaseorg <[email protected]>
---
scripts/mod/file2alias.c | 6 +-
scripts/mod/modpost.c | 94 ++++++++++++++++++++++++++++++++-------------
scripts/mod/modpost.h | 43 +++++++++++++++++++++
3 files changed, 113 insertions(+), 30 deletions(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a334428..49c669e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -761,16 +761,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
char *zeros = NULL;
/* We're looking for a section relative symbol */
- if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum)
+ if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
return;
/* Handle all-NULL symbols allocated into .bss */
- if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) {
+ if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
zeros = calloc(1, sym->st_size);
symval = zeros;
} else {
symval = (void *)info->hdr
- + info->sechdrs[sym->st_shndx].sh_offset
+ + info->sechdrs[get_secindex(info, sym)].sh_offset
+ sym->st_value;
}
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 41c2229..6bb55a4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -244,7 +244,7 @@ static enum export export_no(const char *s)
return export_unknown;
}
-static enum export export_from_sec(struct elf_info *elf, Elf_Section sec)
+static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
{
if (sec == elf->export_sec)
return export_plain;
@@ -364,6 +364,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
Elf_Ehdr *hdr;
Elf_Shdr *sechdrs;
Elf_Sym *sym;
+ const char *secstrings;
+ unsigned int symtab_idx = ~0U, symtab_shndx_idx = ~0U;
hdr = grab_file(filename, &info->size);
if (!hdr) {
@@ -400,8 +402,19 @@ static int parse_elf(struct elf_info *info, const char *filename)
return 0;
}
+ /* Fixups for more than 64k sections */
+ info->num_sections = hdr->e_shnum;
+ if (info->num_sections == 0) { /* more than 64k sections? */
+ /* doesn't need shndx2secindex() */
+ info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
+ }
+ info->secindex_strings = hdr->e_shstrndx;
+ if (info->secindex_strings == SHN_XINDEX)
+ info->secindex_strings =
+ shndx2secindex(TO_NATIVE(sechdrs[0].sh_link));
+
/* Fix endianness in section headers */
- for (i = 0; i < hdr->e_shnum; i++) {
+ for (i = 0; i < info->num_sections; i++) {
sechdrs[i].sh_type = TO_NATIVE(sechdrs[i].sh_type);
sechdrs[i].sh_offset = TO_NATIVE(sechdrs[i].sh_offset);
sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size);
@@ -411,9 +424,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
sechdrs[i].sh_addr = TO_NATIVE(sechdrs[i].sh_addr);
}
/* Find symbol table. */
- for (i = 1; i < hdr->e_shnum; i++) {
- const char *secstrings
- = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+ secstrings = (void *)hdr + sechdrs[info->secindex_strings].sh_offset;
+ for (i = 1; i < info->num_sections; i++) {
const char *secname;
int nobits = sechdrs[i].sh_type == SHT_NOBITS;
@@ -443,14 +455,24 @@ static int parse_elf(struct elf_info *info, const char *filename)
else if (strcmp(secname, "__markers_strings") == 0)
info->markers_strings_sec = i;
- if (sechdrs[i].sh_type != SHT_SYMTAB)
- continue;
+ if (sechdrs[i].sh_type == SHT_SYMTAB) {
+ symtab_idx = i;
+ info->symtab_start = (void *)hdr +
+ sechdrs[i].sh_offset;
+ info->symtab_stop = (void *)hdr +
+ sechdrs[i].sh_offset + sechdrs[i].sh_size;
+ info->strtab = (void *)hdr +
+ sechdrs[shndx2secindex(sechdrs[i].sh_link)].sh_offset;
+ }
- info->symtab_start = (void *)hdr + sechdrs[i].sh_offset;
- info->symtab_stop = (void *)hdr + sechdrs[i].sh_offset
- + sechdrs[i].sh_size;
- info->strtab = (void *)hdr +
- sechdrs[sechdrs[i].sh_link].sh_offset;
+ /* 32bit section no. table? ("more than 64k sections") */
+ if (sechdrs[i].sh_type == SHT_SYMTAB_SHNDX) {
+ symtab_shndx_idx = i;
+ info->symtab_shndx_start = (void *)hdr +
+ sechdrs[i].sh_offset;
+ info->symtab_shndx_stop = (void *)hdr +
+ sechdrs[i].sh_offset + sechdrs[i].sh_size;
+ }
}
if (!info->symtab_start)
fatal("%s has no symtab?\n", filename);
@@ -462,6 +484,21 @@ static int parse_elf(struct elf_info *info, const char *filename)
sym->st_value = TO_NATIVE(sym->st_value);
sym->st_size = TO_NATIVE(sym->st_size);
}
+
+ if (symtab_shndx_idx != ~0U) {
+ Elf32_Word *p;
+ if (symtab_idx !=
+ shndx2secindex(sechdrs[symtab_shndx_idx].sh_link))
+ fatal("%s: SYMTAB_SHNDX has bad sh_link: %u!=%u\n",
+ filename,
+ shndx2secindex(sechdrs[symtab_shndx_idx].sh_link),
+ symtab_idx);
+ /* Fix endianness */
+ for (p = info->symtab_shndx_start; p < info->symtab_shndx_stop;
+ p++)
+ *p = TO_NATIVE(*p);
+ }
+
return 1;
}
@@ -496,7 +533,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
Elf_Sym *sym, const char *symname)
{
unsigned int crc;
- enum export export = export_from_sec(info, sym->st_shndx);
+ enum export export = export_from_sec(info, get_secindex(info, sym));
switch (sym->st_shndx) {
case SHN_COMMON:
@@ -638,18 +675,18 @@ static const char *sym_name(struct elf_info *elf, Elf_Sym *sym)
return "(unknown)";
}
-static const char *sec_name(struct elf_info *elf, int shndx)
+static const char *sec_name(struct elf_info *elf, int secindex)
{
Elf_Shdr *sechdrs = elf->sechdrs;
return (void *)elf->hdr +
- elf->sechdrs[elf->hdr->e_shstrndx].sh_offset +
- sechdrs[shndx].sh_name;
+ elf->sechdrs[elf->secindex_strings].sh_offset +
+ sechdrs[secindex].sh_name;
}
static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr)
{
return (void *)elf->hdr +
- elf->sechdrs[elf->hdr->e_shstrndx].sh_offset +
+ elf->sechdrs[elf->secindex_strings].sh_offset +
sechdr->sh_name;
}
@@ -986,11 +1023,14 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
Elf_Sym *near = NULL;
Elf64_Sword distance = 20;
Elf64_Sword d;
+ unsigned int relsym_secindex;
if (relsym->st_name != 0)
return relsym;
+
+ relsym_secindex = get_secindex(elf, relsym);
for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) {
- if (sym->st_shndx != relsym->st_shndx)
+ if (get_secindex(elf, sym) != relsym_secindex)
continue;
if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
continue;
@@ -1052,9 +1092,9 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr,
for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) {
const char *symsec;
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
- symsec = sec_name(elf, sym->st_shndx);
+ symsec = sec_name(elf, get_secindex(elf, sym));
if (strcmp(symsec, sec) != 0)
continue;
if (!is_valid_name(elf, sym))
@@ -1251,7 +1291,7 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
const char *tosec;
enum mismatch mismatch;
- tosec = sec_name(elf, sym->st_shndx);
+ tosec = sec_name(elf, get_secindex(elf, sym));
mismatch = section_mismatch(fromsec, tosec);
if (mismatch != NO_MISMATCH) {
Elf_Sym *to;
@@ -1278,7 +1318,7 @@ static unsigned int *reloc_location(struct elf_info *elf,
Elf_Shdr *sechdr, Elf_Rela *r)
{
Elf_Shdr *sechdrs = elf->sechdrs;
- int section = sechdr->sh_info;
+ int section = shndx2secindex(sechdr->sh_info);
return (void *)elf->hdr + sechdrs[section].sh_offset +
(r->r_offset - sechdrs[section].sh_addr);
@@ -1386,7 +1426,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
r.r_addend = TO_NATIVE(rela->r_addend);
sym = elf->symtab_start + r_sym;
/* Skip special sections */
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
check_section_mismatch(modname, elf, &r, sym, fromsec);
}
@@ -1444,7 +1484,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
}
sym = elf->symtab_start + r_sym;
/* Skip special sections */
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
check_section_mismatch(modname, elf, &r, sym, fromsec);
}
@@ -1469,7 +1509,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
Elf_Shdr *sechdrs = elf->sechdrs;
/* Walk through all sections */
- for (i = 0; i < elf->hdr->e_shnum; i++) {
+ for (i = 0; i < elf->num_sections; i++) {
check_section(modname, elf, &elf->sechdrs[i]);
/* We want to process only relocation sections and not .init */
if (sechdrs[i].sh_type == SHT_RELA)
@@ -1499,7 +1539,7 @@ static void get_markers(struct elf_info *info, struct module *mod)
n = 0;
for (sym = info->symtab_start; sym < info->symtab_stop; sym++)
if (ELF_ST_TYPE(sym->st_info) == STT_OBJECT &&
- sym->st_shndx == info->markers_strings_sec &&
+ get_secindex(info, sym) == info->markers_strings_sec &&
!strncmp(info->strtab + sym->st_name,
"__mstrtab_", sizeof "__mstrtab_" - 1)) {
if (first_sym == NULL)
@@ -1523,7 +1563,7 @@ static void get_markers(struct elf_info *info, struct module *mod)
n = 0;
for (sym = first_sym; sym <= last_sym; sym++)
if (ELF_ST_TYPE(sym->st_info) == STT_OBJECT &&
- sym->st_shndx == info->markers_strings_sec &&
+ get_secindex(info, sym) == info->markers_strings_sec &&
!strncmp(info->strtab + sym->st_name,
"__mstrtab_", sizeof "__mstrtab_" - 1)) {
const char *name = strings + sym->st_value;
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 09f58e3..dbde650 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -132,8 +132,51 @@ struct elf_info {
const char *strtab;
char *modinfo;
unsigned int modinfo_len;
+
+ /* support for 32bit section numbers */
+
+ unsigned int num_sections; /* max_secindex + 1 */
+ unsigned int secindex_strings;
+ /* if Nth symbol table entry has .st_shndx = SHN_XINDEX,
+ * take shndx from symtab_shndx_start[N] instead */
+ Elf32_Word *symtab_shndx_start;
+ Elf32_Word *symtab_shndx_stop;
};
+static inline int is_shndx_special(unsigned int i)
+{
+ return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;
+}
+
+/* shndx is in [0..SHN_LORESERVE) U (SHN_HIRESERVE, 0xfffffff], thus:
+ * shndx == 0 <=> sechdrs[0]
+ * ......
+ * shndx == SHN_LORESERVE-1 <=> sechdrs[SHN_LORESERVE-1]
+ * shndx == SHN_HIRESERVE+1 <=> sechdrs[SHN_LORESERVE]
+ * shndx == SHN_HIRESERVE+2 <=> sechdrs[SHN_LORESERVE+1]
+ * ......
+ * fyi: sym->st_shndx is uint16, SHN_LORESERVE = ff00, SHN_HIRESERVE = ffff,
+ * so basically we map 0000..feff -> 0000..feff
+ * ff00..ffff -> (you are a bad boy, dont do it)
+ * 10000..xxxx -> ff00..(xxxx-0x100)
+ */
+static inline unsigned int shndx2secindex(unsigned int i)
+{
+ if (i <= SHN_HIRESERVE)
+ return i;
+ return i - (SHN_HIRESERVE + 1 - SHN_LORESERVE);
+}
+
+/* Accessor for sym->st_shndx, hides ugliness of "64k sections" */
+static inline unsigned int get_secindex(const struct elf_info *info,
+ const Elf_Sym *sym)
+{
+ if (sym->st_shndx != SHN_XINDEX)
+ return sym->st_shndx;
+ return shndx2secindex(info->symtab_shndx_start[sym -
+ info->symtab_start]);
+}
+
/* file2alias.c */
extern unsigned int cross_build;
void handle_moddevtable(struct module *mod, struct elf_info *info,
--
1.6.2.1
From: Waseem Daher <[email protected]>
This patch makes it possible to link and boot an x86 kernel with
-ffunction-sections and -fdata-sections enabled.
Modpost currently warns whenever it sees a section with a name
matching [.][0-9]+$ because they are often caused by section flag
mismatch errors. When compiling with -ffunction-sections
-fdata-sections, gcc places various classes of local symbols in
sections with names such as .rodata.__func__.12345, causing these
warnings to be printed spuriously. The simplest fix is to disable the
warning when CONFIG_FUNCTION_DATA_SECTIONS is enabled.
Signed-off-by: Waseem Daher <[email protected]>
[[email protected]: modpost support]
Signed-off-by: Tim Abbott <[email protected]>
[[email protected]: depend on x86, update CONFIG_FUNCTION_TRACER conflict]
Signed-off-by: Anders Kaseorg <[email protected]>
---
Makefile | 4 ++++
arch/x86/Kconfig | 1 +
arch/x86/kernel/vmlinux_32.lds.S | 1 +
arch/x86/kernel/vmlinux_64.lds.S | 1 +
include/asm-generic/vmlinux.lds.h | 5 ++++-
lib/Kconfig.debug | 18 ++++++++++++++++++
6 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index c6307b6..939104e 100644
--- a/Makefile
+++ b/Makefile
@@ -552,6 +552,10 @@ ifdef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS += -pg
endif
+ifdef CONFIG_FUNCTION_DATA_SECTIONS
+KBUILD_CFLAGS += -ffunction-sections -fdata-sections
+endif
+
# We trigger additional mismatches with less inlining
ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5b2196a..032d75d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,6 +28,7 @@ config X86
select HAVE_KPROBES
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARCH_WANT_FRAME_POINTERS
+ select HAVE_FUNCTION_DATA_SECTIONS
select HAVE_KRETPROBES
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 5342ea8..21c764e 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -187,6 +187,7 @@ SECTIONS
__bss_start = .; /* BSS */
*(.bss..page_aligned)
*(.bss)
+ *(.bss.[A-Za-z$_]*) /* handle -fdata-sections */
. = ALIGN(4);
__bss_stop = .;
}
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 98016a2..e7dac7d 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -246,6 +246,7 @@ SECTIONS
__bss_start = .; /* BSS */
*(.bss..page_aligned)
*(.bss)
+ *(.bss.[A-Za-z$_]*) /* handle -fdata-sections */
__bss_stop = .;
}
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 37feab0..70a2a67 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -88,6 +88,7 @@
/* .data section */
#define DATA_DATA \
*(.data) \
+ *(.data.[A-Za-z$_]*) /* handle -fdata-sections */ \
*(.data..init.refok) \
*(.ref.data) \
DEV_KEEP(init.data) \
@@ -119,7 +120,8 @@
. = ALIGN((align)); \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_rodata) = .; \
- *(.rodata) *(.rodata.*) \
+ *(.rodata) \
+ *(.rodata.[A-Za-z$_]*) /* handle -fdata-sections */ \
*(__vermagic) /* Kernel version magic */ \
*(__markers_strings) /* Markers: strings */ \
*(__tracepoints_strings)/* Tracepoints: strings */ \
@@ -286,6 +288,7 @@
ALIGN_FUNCTION(); \
*(.text.hot) \
*(.text) \
+ *(.text.[A-Za-z$_]*) /* handle -ffunction-sections */\
*(.ref.text) \
*(.text..init.refok) \
*(.text..exit.refok) \
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 9638d99..45fe0c2 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -591,6 +591,24 @@ config FRAME_POINTER
larger and slower, but it gives very useful debugging information
in case of kernel bugs. (precise oopses/stacktraces/warnings)
+config HAVE_FUNCTION_DATA_SECTIONS
+ bool
+
+config FUNCTION_DATA_SECTIONS
+ bool "Compile with -ffunction-sections -fdata-sections"
+ depends on HAVE_FUNCTION_DATA_SECTIONS
+ depends on !FUNCTION_TRACER
+ help
+ If you say Y here the compiler will give each function
+ and data structure its own ELF section.
+
+ This option conflicts with CONFIG_FUNCTION_TRACER, which
+ enables profiling code generation, because current GCC does
+ not support compiling with -ffunction-sections -pg (see
+ <http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html>).
+
+ If unsure, say N.
+
config BOOT_PRINTK_DELAY
bool "Delay each boot printk message by N milliseconds"
depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
--
1.6.2.1
The purpose of this patch is to make it possible to build the kernel
with "gcc -ffunction-sections -fdata-sections". This is a key step
towards being able to compile the kernel using the --gc-sections
linker option, which can be used to decrease the vmlinux size by
garbage collecting unused functions. Also, Ksplice's 'run-pre
matching' process is much simpler if the original kernel was compiled
with -ffunction-sections and -fdata-sections.
Currently, the kernel uses a number of "magic" section names such as
".data.nosave" and ".text.head".
The problem is that with -ffunction-sections -fdata-sections, gcc
places code like
static void head(...) {...}
in the .text.head section, and code like
static int nosave = 1;
in the .data.nosave section, causing code to be inappropriately placed
in the "magic" sections. This patch renames all "magic" section names
used by the kernel to use ".." rather than "." as the delimiter
between the section prefix (e.g. ".text") and suffix (e.g. "head"), so
that ".data.nosave" becomes ".data..nosave", etc. The key property of
these names is that there are no collisions between the kernel's
"magic" sections and the sections generated by gcc's
-ffunction-sections and -fdata-sections options. One can then
reference the sections generated by -ffunction-sections using a linker
script pattern such as *(.text.[A-Za-z$_]*)
This patch is based on an some earlier patches by Denys Vlasenko.
Those earlier patches used section names like ".kernel.text.head".
Because these names did not begin with e.g. ".text", the assembler did
not automatically use the correct section flags for them, and so one
needed to explicitly declare the sections flags when declaring a
section in assembly files using code such as:
.section .kernel.text.head, "ax", @progbits
These explicit section flags in assembly files turned out to be a
common source of confusion, and so I rewrote the patch with this new
section naming scheme suggested by Anders Kaseorg.
Signed-off-by: Tim Abbott <[email protected]>
Signed-off-by: Anders Kaseorg <[email protected]>
---
Documentation/mutex-design.txt | 4 +-
arch/alpha/kernel/head.S | 2 +-
arch/alpha/kernel/init_task.c | 2 +-
arch/alpha/kernel/vmlinux.lds.S | 14 ++++----
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/init_task.c | 2 +-
arch/arm/kernel/vmlinux.lds.S | 16 +++++-----
arch/arm/mm/proc-v6.S | 2 +-
arch/arm/mm/proc-v7.S | 2 +-
arch/arm/mm/tlb-v6.S | 2 +-
arch/arm/mm/tlb-v7.S | 2 +-
arch/avr32/kernel/init_task.c | 2 +-
arch/avr32/kernel/vmlinux.lds.S | 6 ++--
arch/avr32/mm/init.c | 2 +-
arch/blackfin/kernel/vmlinux.lds.S | 2 +-
arch/cris/kernel/process.c | 2 +-
arch/cris/kernel/vmlinux.lds.S | 2 +-
arch/frv/kernel/break.S | 4 +-
arch/frv/kernel/entry.S | 2 +-
arch/frv/kernel/head-mmu-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr401.S | 2 +-
arch/frv/kernel/head-uc-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr555.S | 2 +-
arch/frv/kernel/head.S | 4 +-
arch/frv/kernel/init_task.c | 2 +-
arch/frv/kernel/vmlinux.lds.S | 18 +++++-----
arch/frv/mm/tlb-miss.S | 2 +-
arch/h8300/boot/compressed/head.S | 2 +-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
arch/h8300/kernel/init_task.c | 2 +-
arch/h8300/kernel/vmlinux.lds.S | 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/head.S | 2 +-
arch/ia64/kernel/init_task.c | 4 +-
arch/ia64/kernel/ivt.S | 2 +-
arch/ia64/kernel/minstate.h | 4 +-
arch/ia64/kernel/paravirtentry.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 44 +++++++++++++-------------
arch/ia64/kvm/vmm_ivt.S | 2 +-
arch/ia64/xen/gate-data.S | 2 +-
arch/ia64/xen/xensetup.S | 2 +-
arch/m32r/kernel/head.S | 2 +-
arch/m32r/kernel/init_task.c | 2 +-
arch/m32r/kernel/vmlinux.lds.S | 8 ++--
arch/m68k/kernel/head.S | 2 +-
arch/m68k/kernel/process.c | 2 +-
arch/m68k/kernel/sun3-head.S | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 6 ++--
arch/m68k/kernel/vmlinux-sun3.lds | 4 +-
arch/m68knommu/kernel/init_task.c | 2 +-
arch/m68knommu/kernel/vmlinux.lds.S | 6 ++--
arch/m68knommu/platform/68360/head-ram.S | 2 +-
arch/m68knommu/platform/68360/head-rom.S | 2 +-
arch/mips/kernel/init_task.c | 2 +-
arch/mips/kernel/vmlinux.lds.S | 8 ++--
arch/mips/lasat/image/head.S | 2 +-
arch/mips/lasat/image/romscript.normal | 2 +-
arch/mn10300/kernel/head.S | 2 +-
arch/mn10300/kernel/init_task.c | 2 +-
arch/mn10300/kernel/vmlinux.lds.S | 16 +++++-----
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 | 8 ++--
arch/parisc/kernel/vmlinux.lds.S | 26 ++++++++--------
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/include/asm/page_64.h | 2 +-
arch/powerpc/include/asm/ppc_asm.h | 4 +-
arch/powerpc/kernel/head_32.S | 2 +-
arch/powerpc/kernel/head_40x.S | 2 +-
arch/powerpc/kernel/head_44x.S | 2 +-
arch/powerpc/kernel/head_8xx.S | 2 +-
arch/powerpc/kernel/head_fsl_booke.S | 2 +-
arch/powerpc/kernel/init_task.c | 2 +-
arch/powerpc/kernel/machine_kexec_64.c | 2 +-
arch/powerpc/kernel/vdso.c | 2 +-
arch/powerpc/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/powerpc/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/powerpc/kernel/vmlinux.lds.S | 22 +++++++-------
arch/s390/include/asm/cache.h | 2 +-
arch/s390/kernel/head.S | 2 +-
arch/s390/kernel/init_task.c | 2 +-
arch/s390/kernel/vdso.c | 2 +-
arch/s390/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/s390/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/s390/kernel/vmlinux.lds.S | 20 ++++++------
arch/sh/include/asm/cache.h | 2 +-
arch/sh/kernel/cpu/sh5/entry.S | 4 +-
arch/sh/kernel/head_32.S | 2 +-
arch/sh/kernel/head_64.S | 2 +-
arch/sh/kernel/init_task.c | 2 +-
arch/sh/kernel/irq.c | 4 +-
arch/sh/kernel/vmlinux_32.lds.S | 14 ++++----
arch/sh/kernel/vmlinux_64.lds.S | 14 ++++----
arch/sparc/boot/btfixupprep.c | 4 +-
arch/sparc/include/asm/cache.h | 2 +-
arch/sparc/kernel/head_32.S | 4 +-
arch/sparc/kernel/head_64.S | 2 +-
arch/sparc/kernel/init_task.c | 2 +-
arch/sparc/kernel/vmlinux.lds.S | 14 ++++----
arch/um/include/asm/common.lds.S | 4 +-
arch/um/kernel/dyn.lds.S | 4 +-
arch/um/kernel/init_task.c | 4 +-
arch/um/kernel/uml.lds.S | 4 +-
arch/x86/boot/compressed/head_32.S | 2 +-
arch/x86/boot/compressed/head_64.S | 2 +-
arch/x86/boot/compressed/relocs.c | 2 +-
arch/x86/boot/compressed/vmlinux.scr | 2 +-
arch/x86/boot/compressed/vmlinux_32.lds | 14 ++++++--
arch/x86/boot/compressed/vmlinux_64.lds | 10 ++++--
arch/x86/include/asm/cache.h | 4 +-
arch/x86/kernel/acpi/wakeup_32.S | 2 +-
arch/x86/kernel/head_32.S | 6 ++--
arch/x86/kernel/head_64.S | 4 +-
arch/x86/kernel/init_task.c | 4 +-
arch/x86/kernel/setup_percpu.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
arch/x86/kernel/vmlinux_32.lds.S | 28 ++++++++--------
arch/x86/kernel/vmlinux_64.lds.S | 26 ++++++++--------
arch/xtensa/kernel/head.S | 2 +-
arch/xtensa/kernel/init_task.c | 2 +-
arch/xtensa/kernel/vmlinux.lds.S | 6 ++--
include/asm-frv/init.h | 8 ++--
include/asm-generic/vmlinux.lds.h | 30 +++++++++---------
include/linux/cache.h | 2 +-
include/linux/init.h | 8 ++--
include/linux/linkage.h | 4 +-
include/linux/percpu.h | 2 +-
include/linux/spinlock.h | 2 +-
kernel/module.c | 2 +-
scripts/mod/modpost.c | 12 ++++----
scripts/recordmcount.pl | 6 ++--
139 files changed, 353 insertions(+), 345 deletions(-)
diff --git a/Documentation/mutex-design.txt b/Documentation/mutex-design.txt
index aa60d1f..c91ccc0 100644
--- a/Documentation/mutex-design.txt
+++ b/Documentation/mutex-design.txt
@@ -66,14 +66,14 @@ of advantages of mutexes:
c0377ccb <mutex_lock>:
c0377ccb: f0 ff 08 lock decl (%eax)
- c0377cce: 78 0e js c0377cde <.text.lock.mutex>
+ c0377cce: 78 0e js c0377cde <.text..lock.mutex>
c0377cd0: c3 ret
the unlocking fastpath is equally tight:
c0377cd1 <mutex_unlock>:
c0377cd1: f0 ff 00 lock incl (%eax)
- c0377cd4: 7e 0f jle c0377ce5 <.text.lock.mutex+0x7>
+ c0377cd4: 7e 0f jle c0377ce5 <.text..lock.mutex+0x7>
c0377cd6: c3 ret
- 'struct mutex' semantics are well-defined and are enforced if
diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
index 7ac1f13..16293d4 100644
--- a/arch/alpha/kernel/head.S
+++ b/arch/alpha/kernel/head.S
@@ -10,7 +10,7 @@
#include <asm/system.h>
#include <asm/asm-offsets.h>
-.section .text.head, "ax"
+.section .text..head, "ax"
.globl swapper_pg_dir
.globl _stext
swapper_pg_dir=SWAPPER_PGD
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index c2938e5..7929755 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -17,5 +17,5 @@ EXPORT_SYMBOL(init_mm);
EXPORT_SYMBOL(init_task);
union thread_union init_thread_union
- __attribute__((section(".data.init_thread")))
+ __attribute__((section(".data..init_thread")))
= { INIT_THREAD_INFO(init_task) };
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index ef37fc1..511f8ca 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -16,7 +16,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -93,18 +93,18 @@ SECTIONS
/* Freed after init ends here */
/* Note 2 page alignment above. */
- .data.init_thread : {
- *(.data.init_thread)
+ .data..init_thread : {
+ *(.data..init_thread)
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : {
- *(.data.page_aligned)
+ .data..page_aligned : {
+ *(.data..page_aligned)
}
. = ALIGN(64);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
_data = .;
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index cc87e17..fcd93f5 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
* numbers for r1.
*
*/
- .section ".text.head", "ax"
+ .section ".text..head", "ax"
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 21e17dc..705e759 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
* crap here - that's what the boot loader (or in extreme, well justified
* circumstances, zImage) is for.
*/
- .section ".text.head", "ax"
+ .section ".text..head", "ax"
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index e859af3..0b81b8f 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -29,7 +29,7 @@ EXPORT_SYMBOL(init_mm);
* The things we do for performance..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index c90f272..89c97c3 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,10 +23,10 @@ SECTIONS
#else
. = PAGE_OFFSET + TEXT_OFFSET;
#endif
- .text.head : {
+ .text..head : {
_stext = .;
_sinittext = .;
- *(.text.head)
+ *(.text..head)
}
.init : { /* Init code and data */
@@ -66,9 +66,9 @@ SECTIONS
. = ALIGN(4096);
__per_cpu_load = .;
__per_cpu_start = .;
- *(.data.percpu.page_aligned)
- *(.data.percpu)
- *(.data.percpu.shared_aligned)
+ *(.data..percpu.page_aligned)
+ *(.data..percpu)
+ *(.data..percpu.shared_aligned)
__per_cpu_end = .;
#ifndef CONFIG_XIP_KERNEL
__init_begin = _stext;
@@ -146,7 +146,7 @@ SECTIONS
* first, the init task union, aligned
* to an 8192 byte boundary.
*/
- *(.data.init_task)
+ *(.data..init_task)
#ifdef CONFIG_XIP_KERNEL
. = ALIGN(4096);
@@ -158,7 +158,7 @@ SECTIONS
. = ALIGN(4096);
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(4096);
__nosave_end = .;
@@ -166,7 +166,7 @@ SECTIONS
* then the cacheline aligned data
*/
. = ALIGN(32);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
/*
* The exception fixup table (might need resorting at runtime)
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index f0cc599..39d8dd1 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -132,7 +132,7 @@ cpu_v6_name:
.asciz "ARMv6-compatible processor"
.align
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
/*
* __v6_setup
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index d1ebec4..f03c14c 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -153,7 +153,7 @@ cpu_v7_name:
.ascii "ARMv7 Processor"
.align
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
/*
* __v7_setup
diff --git a/arch/arm/mm/tlb-v6.S b/arch/arm/mm/tlb-v6.S
index 20f84bb..7e9a62a 100644
--- a/arch/arm/mm/tlb-v6.S
+++ b/arch/arm/mm/tlb-v6.S
@@ -87,7 +87,7 @@ ENTRY(v6wbi_flush_kern_tlb_range)
mcr p15, 0, r2, c7, c5, 4 @ prefetch flush
mov pc, lr
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
.type v6wbi_tlb_fns, #object
ENTRY(v6wbi_tlb_fns)
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index 24ba510..875a0bd 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -80,7 +80,7 @@ ENTRY(v7wbi_flush_kern_tlb_range)
mov pc, lr
ENDPROC(v7wbi_flush_kern_tlb_range)
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
.type v7wbi_tlb_fns, #object
ENTRY(v7wbi_tlb_fns)
diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 993d56e..4678bc6 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(init_mm);
* Initial thread structure. Must be aligned on an 8192-byte boundary.
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 7910d41..5e73a02 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -95,15 +95,15 @@ SECTIONS
/*
* First, the init task union, aligned to an 8K boundary.
*/
- *(.data.init_task)
+ *(.data..init_task)
/* Then, the page-aligned data */
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
/* Then, the cacheline aligned data */
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
/* And the rest... */
*(.data.rel*)
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index e819fa6..533a011 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -24,7 +24,7 @@
#include <asm/setup.h>
#include <asm/sections.h>
-#define __page_aligned __attribute__((section(".data.page_aligned")))
+#define __page_aligned __attribute__((section(".data..page_aligned")))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 27952ae..f3ef8f1 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -94,7 +94,7 @@ SECTIONS
__sdata = .;
/* This gets done first, so the glob doesn't suck it in */
. = ALIGN(32);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
#if !L1_DATA_A_LENGTH
. = ALIGN(32);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 4df0b32..0f0b4bd 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index 0d2adfc..f603bc8 100644
--- a/arch/cris/kernel/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -68,7 +68,7 @@ SECTIONS
_edata = . ;
. = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
. = ALIGN(PAGE_SIZE); /* Init code and data. */
__init_begin = .;
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index bd0bdf9..cbb6958 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -21,7 +21,7 @@
#
# the break handler has its own stack
#
- .section .bss.stack
+ .section .bss..stack
.globl __break_user_context
.balign THREAD_SIZE
__break_stack:
@@ -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 99060ab..fe5479b 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-mmu-fr451.S b/arch/frv/kernel/head-mmu-fr451.S
index c8f210d..5900967 100644
--- a/arch/frv/kernel/head-mmu-fr451.S
+++ b/arch/frv/kernel/head-mmu-fr451.S
@@ -31,7 +31,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr401.S b/arch/frv/kernel/head-uc-fr401.S
index ee282be..ecba176 100644
--- a/arch/frv/kernel/head-uc-fr401.S
+++ b/arch/frv/kernel/head-uc-fr401.S
@@ -30,7 +30,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr451.S b/arch/frv/kernel/head-uc-fr451.S
index b10d9c8..ed9dd17 100644
--- a/arch/frv/kernel/head-uc-fr451.S
+++ b/arch/frv/kernel/head-uc-fr451.S
@@ -30,7 +30,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr555.S b/arch/frv/kernel/head-uc-fr555.S
index 39937c1..ee46b0b 100644
--- a/arch/frv/kernel/head-uc-fr555.S
+++ b/arch/frv/kernel/head-uc-fr555.S
@@ -29,7 +29,7 @@
#define __551_LCR 0xfeff1100
#define __551_LSBR 0xfeff1c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index fecf751..35e6391 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -27,7 +27,7 @@
# command line string
#
###############################################################################
- .section .text.head,"ax"
+ .section .text..head,"ax"
.balign 4
.globl _boot, __head_reference
@@ -541,7 +541,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/init_task.c b/arch/frv/kernel/init_task.c
index 29429a8..f57ec19 100644
--- a/arch/frv/kernel/init_task.c
+++ b/arch/frv/kernel/init_task.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index b95c4ea..a7bcf9b 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -26,7 +26,7 @@ SECTIONS
_sinittext = .;
.init.text : {
- *(.text.head)
+ *(.text..head)
#ifndef CONFIG_DEBUG_INFO
INIT_TEXT
EXIT_TEXT
@@ -71,13 +71,13 @@ SECTIONS
/* put sections together that have massive alignment issues */
. = ALIGN(THREAD_SIZE);
- .data.init_task : {
+ .data..init_task : {
/* init task record & stack */
- *(.data.init_task)
+ *(.data..init_task)
}
. = ALIGN(L1_CACHE_BYTES);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
.trap : {
/* trap table management - read entry-table.S before modifying */
@@ -94,10 +94,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
@@ -152,7 +152,7 @@ SECTIONS
.sbss : { *(.sbss .sbss.*) }
.bss : { *(.bss .bss.*) }
- .bss.stack : { *(.bss) }
+ .bss..stack : { *(.bss) }
__bss_stop = .;
_end = . ;
diff --git a/arch/frv/mm/tlb-miss.S b/arch/frv/mm/tlb-miss.S
index 0764348..0f41b41 100644
--- a/arch/frv/mm/tlb-miss.S
+++ b/arch/frv/mm/tlb-miss.S
@@ -16,7 +16,7 @@
#include <asm/highmem.h>
#include <asm/spr-regs.h>
- .section .text.tlbmiss
+ .section .text..tlbmiss
.balign 4
.globl __entry_insn_mmu_miss
diff --git a/arch/h8300/boot/compressed/head.S b/arch/h8300/boot/compressed/head.S
index 985a81a..10e9a2d 100644
--- a/arch/h8300/boot/compressed/head.S
+++ b/arch/h8300/boot/compressed/head.S
@@ -9,7 +9,7 @@
#define SRAM_START 0xff4000
- .section .text.startup
+ .section .text..startup
.global startup
startup:
mov.l #SRAM_START+0x8000, sp
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds
index 65e2a0d..a0a3a0e 100644
--- a/arch/h8300/boot/compressed/vmlinux.lds
+++ b/arch/h8300/boot/compressed/vmlinux.lds
@@ -4,7 +4,7 @@ SECTIONS
{
__stext = . ;
__text = .;
- *(.text.startup)
+ *(.text..startup)
*(.text)
__etext = . ;
}
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index cb5dc55..fb473b1 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -36,6 +36,6 @@ EXPORT_SYMBOL(init_task);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 43a87b9..c0e3635 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -101,7 +101,7 @@ SECTIONS
___data_start = . ;
. = ALIGN(0x2000) ;
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(0x4) ;
DATA_DATA
. = ALIGN(0x4) ;
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/include/asm/cache.h b/arch/ia64/include/asm/cache.h
index e7482bd..988254a 100644
--- a/arch/ia64/include/asm/cache.h
+++ b/arch/ia64/include/asm/cache.h
@@ -24,6 +24,6 @@
# define SMP_CACHE_BYTES (1 << 3)
#endif
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif /* _ASM_IA64_CACHE_H */
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/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate
index 1d87f84..af90125 100644
--- a/arch/ia64/kernel/Makefile.gate
+++ b/arch/ia64/kernel/Makefile.gate
@@ -21,7 +21,7 @@ GATECFLAGS_gate-syms.o = -r
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)
-# gate-data.o contains the gate DSO image as data in section .data.gate.
+# gate-data.o contains the gate DSO image as data in section .data..gate.
# We must build gate.so before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/gate-data.o: $(obj)/gate.so
diff --git a/arch/ia64/kernel/gate-data.S b/arch/ia64/kernel/gate-data.S
index 258c0a3..b3ef1c7 100644
--- a/arch/ia64/kernel/gate-data.S
+++ b/arch/ia64/kernel/gate-data.S
@@ -1,3 +1,3 @@
- .section .data.gate, "aw"
+ .section .data..gate, "aw"
.incbin "arch/ia64/kernel/gate.so"
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/head.S b/arch/ia64/kernel/head.S
index 23f846d..c0739fc 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -181,7 +181,7 @@ swapper_pg_dir:
halt_msg:
stringz "Halting kernel\n"
- .section .text.head,"ax"
+ .section .text..head,"ax"
.global start_ap
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 5b0e830..8a5028c 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -27,7 +27,7 @@ EXPORT_SYMBOL(init_mm);
* Initial task structure.
*
* We need to make sure that this is properly aligned due to the way process stacks are
- * handled. This is done by having a special ".data.init_task" section...
+ * handled. This is done by having a special ".data..init_task" section...
*/
#define init_thread_info init_task_mem.s.thread_info
@@ -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") __attribute__((section(".data..init_task"))) = {{
.task = INIT_TASK(init_task_mem.s.task),
.thread_info = INIT_THREAD_INFO(init_task_mem.s.task)
}};
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index ec9a5fd..0c14512 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -83,7 +83,7 @@
mov r19=n;; /* prepare to save predicates */ \
br.sptk.many dispatch_to_fault_handler
- .section .text.ivt,"ax"
+ .section .text..ivt,"ax"
.align 32768 // align on 32KB boundary
.global ia64_ivt
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/paravirtentry.S b/arch/ia64/kernel/paravirtentry.S
index 6158560..92d880c 100644
--- a/arch/ia64/kernel/paravirtentry.S
+++ b/arch/ia64/kernel/paravirtentry.S
@@ -28,7 +28,7 @@
#include "entry.h"
#define DATA8(sym, init_value) \
- .pushsection .data.read_mostly ; \
+ .pushsection .data..read_mostly ; \
.align 8 ; \
.global sym ; \
sym: ; \
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 4a95e86..e3f23f4 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -8,7 +8,7 @@
#define IVT_TEXT \
VMLINUX_SYMBOL(__start_ivt_text) = .; \
- *(.text.ivt) \
+ *(.text..ivt) \
VMLINUX_SYMBOL(__end_ivt_text) = .;
OUTPUT_FORMAT("elf64-ia64-little")
@@ -51,13 +51,13 @@ SECTIONS
KPROBES_TEXT
*(.gnu.linkonce.t*)
}
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
- { *(.text.head) }
+ .text..head : AT(ADDR(.text..head) - LOAD_OFFSET)
+ { *(.text..head) }
.text2 : AT(ADDR(.text2) - LOAD_OFFSET)
{ *(.text2) }
#ifdef CONFIG_SMP
- .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
- { *(.text.lock) }
+ .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET)
+ { *(.text..lock) }
#endif
_etext = .;
@@ -84,10 +84,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 = .;
}
@@ -148,24 +148,24 @@ SECTIONS
__initcall_end = .;
}
- .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 = .;
}
@@ -217,18 +217,18 @@ SECTIONS
__init_end = .;
/* The initial task and kernel stack */
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
- { *(.data.init_task) }
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET)
+ { *(.data..init_task) }
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET)
{ *(__special_page_section)
__start_gate_section = .;
- *(.data.gate)
+ *(.data..gate)
__stop_gate_section = .;
#ifdef CONFIG_XEN
. = ALIGN(PAGE_SIZE);
__xen_start_gate_section = .;
- *(.data.gate.xen)
+ *(.data..gate.xen)
__xen_stop_gate_section = .;
#endif
}
@@ -236,11 +236,11 @@ SECTIONS
* kernel data
*/
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
- { *(.data.read_mostly) }
+ .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) }
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET)
+ { *(.data..cacheline_aligned) }
/* Per-cpu data: */
. = ALIGN(PERCPU_PAGE_SIZE);
diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S
index 3ef1a01..c5ab23b 100644
--- a/arch/ia64/kvm/vmm_ivt.S
+++ b/arch/ia64/kvm/vmm_ivt.S
@@ -104,7 +104,7 @@ GLOBAL_ENTRY(kvm_vmm_panic)
br.call.sptk.many b6=vmm_panic_handler;
END(kvm_vmm_panic)
- .section .text.ivt,"ax"
+ .section .text..ivt,"ax"
.align 32768 // align on 32KB boundary
.global kvm_ia64_ivt
diff --git a/arch/ia64/xen/gate-data.S b/arch/ia64/xen/gate-data.S
index 7d4830a..6f95b6b 100644
--- a/arch/ia64/xen/gate-data.S
+++ b/arch/ia64/xen/gate-data.S
@@ -1,3 +1,3 @@
- .section .data.gate.xen, "aw"
+ .section .data..gate.xen, "aw"
.incbin "arch/ia64/xen/gate.so"
diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S
index 28fed1f..28def53 100644
--- a/arch/ia64/xen/xensetup.S
+++ b/arch/ia64/xen/xensetup.S
@@ -14,7 +14,7 @@
#include <linux/init.h>
#include <xen/interface/elfnote.h>
- .section .data.read_mostly
+ .section .data..read_mostly
.align 8
.global xen_domain_type
xen_domain_type:
diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S
index 9091606..2bac669 100644
--- a/arch/m32r/kernel/head.S
+++ b/arch/m32r/kernel/head.S
@@ -23,7 +23,7 @@ __INITDATA
/*
* References to members of the boot_cpu_data structure.
*/
-.section .text.head, "ax"
+.section .text..head, "ax"
.global start_kernel
.global __bss_start
.global _end
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 016885c..7c24cec 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -25,7 +25,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 9db05df..2bcc37e 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.boot : { *(.boot) } = 0
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -57,17 +57,17 @@ SECTIONS
. = ALIGN(4096);
__nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
+ .data_nosave : { *(.data..nosave) }
. = ALIGN(4096);
__nosave_end = .;
. = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* will be freed after init */
. = ALIGN(4096); /* Init code and data */
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index f513f53..bdb247e 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -577,7 +577,7 @@ func_define putn,1
#endif
.endm
-.section ".text.head","ax"
+.section ".text..head","ax"
ENTRY(_stext)
/*
* Version numbers of the bootinfo interface
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index ec37fb5..4b83a2e 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -47,7 +47,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"), aligned(THREAD_SIZE)))
+__attribute__((section(".data..init_task"), aligned(THREAD_SIZE)))
= { INIT_THREAD_INFO(init_task) };
/* initial task structure */
diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
index aad0159..5a6714b 100644
--- a/arch/m68k/kernel/sun3-head.S
+++ b/arch/m68k/kernel/sun3-head.S
@@ -29,7 +29,7 @@ kernel_pmd_table: .skip 0x2000
.globl kernel_pg_dir
.equ kernel_pg_dir,kernel_pmd_table
- .section .text.head
+ .section .text..head
ENTRY(_stext)
ENTRY(_start)
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index f846d4e..35b6da8 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0x1000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -35,7 +35,7 @@ SECTIONS
}
. = ALIGN(16);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
.bss : { *(.bss) } /* BSS */
@@ -78,7 +78,7 @@ SECTIONS
. = ALIGN(8192);
__init_end = .;
- .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */
+ .data..init_task : { *(.data..init_task) } /* The initial task and kernel stack */
_end = . ;
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index d9368c0..e6ce561 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0xE002000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -70,7 +70,7 @@ __init_begin = .;
#endif
. = ALIGN(PAGE_SIZE);
__init_end = .;
- .data.init.task : { *(.data.init_task) }
+ .data..init.task : { *(.data..init_task) }
.bss : { *(.bss) } /* BSS */
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index fe282de..1ea36d6 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -36,6 +36,6 @@ EXPORT_SYMBOL(init_task);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index 69ba9b1..bdf9b1c 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -55,7 +55,7 @@ SECTIONS {
.romvec : {
__rom_start = . ;
_romvec = .;
- *(.data.initvect)
+ *(.data..initvect)
} > romvec
#endif
@@ -66,7 +66,7 @@ SECTIONS {
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
- *(.text.lock)
+ *(.text..lock)
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
@@ -148,7 +148,7 @@ SECTIONS {
_sdata = . ;
DATA_DATA
. = ALIGN(8192) ;
- *(.data.init_task)
+ *(.data..init_task)
_edata = . ;
} > DATA
diff --git a/arch/m68knommu/platform/68360/head-ram.S b/arch/m68knommu/platform/68360/head-ram.S
index 2ef0624..8eb94fb 100644
--- a/arch/m68knommu/platform/68360/head-ram.S
+++ b/arch/m68knommu/platform/68360/head-ram.S
@@ -280,7 +280,7 @@ _dprbase:
* and then overwritten as needed.
*/
-.section ".data.initvect","awx"
+.section ".data..initvect","awx"
.long RAMEND /* Reset: Initial Stack Pointer - 0. */
.long _start /* Reset: Initial Program Counter - 1. */
.long buserr /* Bus Error - 2. */
diff --git a/arch/m68knommu/platform/68360/head-rom.S b/arch/m68knommu/platform/68360/head-rom.S
index 62ecf41..97510e5 100644
--- a/arch/m68knommu/platform/68360/head-rom.S
+++ b/arch/m68knommu/platform/68360/head-rom.S
@@ -291,7 +291,7 @@ _dprbase:
* and then overwritten as needed.
*/
-.section ".data.initvect","awx"
+.section ".data..initvect","awx"
.long RAMEND /* Reset: Initial Stack Pointer - 0. */
.long _start /* Reset: Initial Program Counter - 1. */
.long buserr /* Bus Error - 2. */
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index 149cd91..acb71af 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -26,7 +26,7 @@ EXPORT_SYMBOL(init_mm);
* The things we do for performance..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"),
+ __attribute__((__section__(".data..init_task"),
__aligned__(THREAD_SIZE))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 58738c8..6b302c7 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -77,7 +77,7 @@ SECTIONS
* object file alignment. Using 32768
*/
. = ALIGN(_PAGE_SIZE);
- *(.data.init_task)
+ *(.data..init_task)
DATA_DATA
CONSTRUCTORS
@@ -99,14 +99,14 @@ SECTIONS
. = ALIGN(_PAGE_SIZE);
.data_nosave : {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(_PAGE_SIZE);
__nosave_end = .;
. = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
_edata = .; /* End of data section */
diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S
index efb95f2..e0ecda9 100644
--- a/arch/mips/lasat/image/head.S
+++ b/arch/mips/lasat/image/head.S
@@ -1,7 +1,7 @@
#include <asm/lasat/head.h>
.text
- .section .text.start, "ax"
+ .section .text..start, "ax"
.set noreorder
.set mips3
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal
index 988f8ad..0864c96 100644
--- a/arch/mips/lasat/image/romscript.normal
+++ b/arch/mips/lasat/image/romscript.normal
@@ -4,7 +4,7 @@ SECTIONS
{
.text :
{
- *(.text.start)
+ *(.text..start)
}
/* Data in ROM */
diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S
index 606bd8c..dd0db5f 100644
--- a/arch/mn10300/kernel/head.S
+++ b/arch/mn10300/kernel/head.S
@@ -19,7 +19,7 @@
#include <asm/param.h>
#include <asm/unit/serial.h>
- .section .text.head,"ax"
+ .section .text..head,"ax"
###############################################################################
#
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index 5ac3566..599840f 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -31,7 +31,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index b825966..938792a 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -28,7 +28,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.text : {
*(
- .text.head
+ .text..head
.text
)
TEXT_TEXT
@@ -58,25 +58,25 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
+ .data_nosave : { *(.data..nosave) }
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : { *(.data.idt) }
+ .data..page_aligned : { *(.data..idt) }
. = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
/* rarely changed data like cpu maps */
. = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly)) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly)) {
+ *(.data..read_mostly)
_edata = .; /* End of data section */
}
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* might get freed after init */
. = ALIGN(PAGE_SIZE);
@@ -134,7 +134,7 @@ SECTIONS
__bss_start = .; /* BSS */
.bss : {
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
}
. = ALIGN(4);
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 32c2cca..45effe6 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -28,7 +28,7 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
void parisc_cache_init(void); /* initializes cache-flushing */
void disable_sr_hashing_asm(int); /* low level support for above */
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index ee80c92..7ccaf29 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -174,7 +174,7 @@ static inline void set_eiem(unsigned long val)
})
#ifdef CONFIG_SMP
-# define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
+# define __lock_aligned __attribute__((__section__(".data..lock_aligned")))
#endif
#define arch_align_stack(x) (x)
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0e3d9f9..4dbdf0e 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -345,7 +345,7 @@ smp_slave_stext:
ENDPROC(stext)
#ifndef CONFIG_64BIT
- .section .data.read_mostly
+ .section .data..read_mostly
.align 4
.export $global$,data
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 1e25a45..14394c0 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
+ __attribute__((aligned(128))) __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
#if PT_NLEVELS == 3
@@ -57,11 +57,11 @@ union thread_union init_thread_union
* 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 fd2cc4f..9f5184f 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -96,8 +96,8 @@ SECTIONS
/* rarely changed data like cpu maps */
. = ALIGN(16);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
. = ALIGN(L1_CACHE_BYTES);
@@ -108,14 +108,14 @@ SECTIONS
}
. = ALIGN(L1_CACHE_BYTES);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN(16);
- .data.lock_aligned : {
- *(.data.lock_aligned)
+ .data..lock_aligned : {
+ *(.data..lock_aligned)
}
/* nosave data is really only used for software suspend...it's here
@@ -124,7 +124,7 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
.data_nosave : {
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -136,10 +136,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)
@@ -151,8 +151,8 @@ SECTIONS
/* assembler code expects init_task to be 16k aligned */
. = ALIGN(16384);
/* init_task */
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
#ifdef CONFIG_64BIT
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 81de6eb..3f41ab9 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -38,7 +38,7 @@ extern struct ppc64_caches ppc64_caches;
#endif /* __powerpc64__ && ! __ASSEMBLY__ */
#if !defined(__ASSEMBLY__)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 043bfdf..2307910 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -157,7 +157,7 @@ do { \
#else
#define __page_aligned \
__attribute__((__aligned__(PAGE_SIZE), \
- __section__(".data.page_aligned")))
+ __section__(".data..page_aligned")))
#endif
#define VM_DATA_DEFAULT_FLAGS \
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index f59a666..676ed60 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -189,7 +189,7 @@ name: \
GLUE(.,name):
#define _INIT_GLOBAL(name) \
- .section ".text.init.refok"; \
+ .section ".text..init.refok"; \
.align 2 ; \
.globl name; \
.globl GLUE(.,name); \
@@ -229,7 +229,7 @@ name: \
GLUE(.,name):
#define _INIT_STATIC(name) \
- .section ".text.init.refok"; \
+ .section ".text..init.refok"; \
.align 2 ; \
.section ".opd","aw"; \
name: \
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 54e68c1..5ce5dfa 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -50,7 +50,7 @@
mtspr SPRN_DBAT##n##L,RB; \
1:
- .section .text.head, "ax"
+ .section .text..head, "ax"
.stabs "arch/powerpc/kernel/",N_SO,0,0,0f
.stabs "head_32.S",N_SO,0,0,0f
0:
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 56d8e5d..de69ecd 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -52,7 +52,7 @@
*
* This is all going to change RSN when we add bi_recs....... -- Dan
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index b56fecc..ab0b339 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -50,7 +50,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3c9452d..f6d1e67 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -38,7 +38,7 @@
#else
#define DO_8xx_CPU6(val, reg)
#endif
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4c22620..123bfec 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -53,7 +53,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 688b329..1162c3c 100644
--- a/arch/powerpc/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
@@ -21,7 +21,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 49e705f..815a13c 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -250,7 +250,7 @@ static void kexec_prepare_cpus(void)
* current, but that audit has not been performed.
*/
static union thread_union kexec_stack
- __attribute__((__section__(".data.init_task"))) = { };
+ __attribute__((__section__(".data..init_task"))) = { };
/* Our assembly helper, in kexec_stub.S */
extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ad06d5c..6685af8 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -74,7 +74,7 @@ static int vdso_ready;
static union {
struct vdso_data data;
u8 page[PAGE_SIZE];
-} vdso_data_store __attribute__((__section__(".data.page_aligned")));
+} vdso_data_store __attribute__((__section__(".data..page_aligned")));
struct vdso_data *vdso_data = &vdso_data_store.data;
/* Format of the patch table */
diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
index 556f0ca..10f61ac 100644
--- a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
+++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso32_start, vdso32_end
.balign PAGE_SIZE
diff --git a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
index 0529cb9..3c1cc59 100644
--- a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
+++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso64_start, vdso64_end
.balign PAGE_SIZE
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b9ef164..cedaad0 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -52,9 +52,9 @@ SECTIONS
/* Text and gots */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
ALIGN_FUNCTION();
- *(.text.head)
+ *(.text..head)
_text = .;
- *(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
+ *(.text .fixup .text..init.refok .text..exit.refok __ftr_alt_*)
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
@@ -254,28 +254,28 @@ SECTIONS
#else
. = ALIGN(16384);
#endif
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- *(.data.init_task)
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
+ *(.data..init_task)
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- *(.data.page_aligned)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
+ *(.data..page_aligned)
}
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
+ *(.data..cacheline_aligned)
}
. = ALIGN(L1_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
}
. = ALIGN(PAGE_SIZE);
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
}
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
index 9b86681..24aafa6 100644
--- a/arch/s390/include/asm/cache.h
+++ b/arch/s390/include/asm/cache.h
@@ -14,6 +14,6 @@
#define L1_CACHE_BYTES 256
#define L1_CACHE_SHIFT 8
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 1046c2c..d0cc437 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -35,7 +35,7 @@
#define ARCH_OFFSET 0
#endif
-.section ".text.head","ax"
+.section ".text..head","ax"
#ifndef CONFIG_IPL
.org 0
.long 0x00080000,0x80000000+startup # Just a restart PSW
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index 7db95c0..7cfd9af 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -30,7 +30,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 89b2e7f..e4c0609 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -64,7 +64,7 @@ __setup("vdso=", vdso_setup);
static union {
struct vdso_data data;
u8 page[PAGE_SIZE];
-} vdso_data_store __attribute__((__section__(".data.page_aligned")));
+} vdso_data_store __attribute__((__section__(".data..page_aligned")));
struct vdso_data *vdso_data = &vdso_data_store.data;
/*
diff --git a/arch/s390/kernel/vdso32/vdso32_wrapper.S b/arch/s390/kernel/vdso32/vdso32_wrapper.S
index 61639a8..025cb77 100644
--- a/arch/s390/kernel/vdso32/vdso32_wrapper.S
+++ b/arch/s390/kernel/vdso32/vdso32_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso32_start, vdso32_end
.balign PAGE_SIZE
diff --git a/arch/s390/kernel/vdso64/vdso64_wrapper.S b/arch/s390/kernel/vdso64/vdso64_wrapper.S
index d8e2ac1..d26126d 100644
--- a/arch/s390/kernel/vdso64/vdso64_wrapper.S
+++ b/arch/s390/kernel/vdso64/vdso64_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso64_start, vdso64_end
.balign PAGE_SIZE
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 7a2063e..c1f97b1 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -29,7 +29,7 @@ SECTIONS
. = 0x00000000;
.text : {
_text = .; /* Text and read-only data */
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -66,30 +66,30 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
.data_nosave : {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : {
- *(.data.idt)
+ .data..page_aligned : {
+ *(.data..idt)
}
. = ALIGN(0x100);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
. = ALIGN(0x100);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
_edata = .; /* End of data section */
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
/* will be freed after init */
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h
index 02df18e..455a9a9 100644
--- a/arch/sh/include/asm/cache.h
+++ b/arch/sh/include/asm/cache.h
@@ -14,7 +14,7 @@
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifndef __ASSEMBLY__
struct cache_info {
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index e640c63..433de32 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -2058,10 +2058,10 @@ asm_uaccess_end:
/*
- * --- .text.init Section
+ * --- .text..init Section
*/
- .section .text.init, "ax"
+ .section .text..init, "ax"
/*
* void trap_init (void)
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 788605f..4065946 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -40,7 +40,7 @@ ENTRY(empty_zero_page)
1:
.skip PAGE_SIZE - empty_zero_page - 1b
- .section .text.head, "ax"
+ .section .text..head, "ax"
/*
* Condition at the entry of _stext:
diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
index 7ccfb99..c3543d1 100644
--- a/arch/sh/kernel/head_64.S
+++ b/arch/sh/kernel/head_64.S
@@ -110,7 +110,7 @@ empty_bad_pte_table:
fpu_in_use: .quad 0
- .section .text.head, "ax"
+ .section .text..head, "ax"
.balign L1_CACHE_BYTES
/*
* Condition at the entry of __stext:
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index 80c35ff..af29479 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -21,7 +21,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 3f1372e..63cd9a0 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -158,10 +158,10 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
#ifdef CONFIG_IRQSTACKS
static char softirq_stack[NR_CPUS * THREAD_SIZE]
- __attribute__((__section__(".bss.page_aligned")));
+ __attribute__((__section__(".bss..page_aligned")));
static char hardirq_stack[NR_CPUS * THREAD_SIZE]
- __attribute__((__section__(".bss.page_aligned")));
+ __attribute__((__section__(".bss..page_aligned")));
/*
* allocate per-cpu stacks for hardirq and for softirq processing
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index d0b2a71..a7b1be0 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -31,7 +31,7 @@ SECTIONS
} = 0
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -61,19 +61,19 @@ SECTIONS
. = ALIGN(THREAD_SIZE);
.data : { /* Data */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.read_mostly)
+ *(.data..read_mostly)
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -131,7 +131,7 @@ SECTIONS
.bss : {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
index 33fa464..c7d5f5b 100644
--- a/arch/sh/kernel/vmlinux_64.lds.S
+++ b/arch/sh/kernel/vmlinux_64.lds.S
@@ -42,7 +42,7 @@ SECTIONS
} = 0
.text : C_PHYS(.text) {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
*(.text64)
*(.text..SHmedia32)
@@ -70,19 +70,19 @@ SECTIONS
. = ALIGN(THREAD_SIZE);
.data : C_PHYS(.data) { /* Data */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.read_mostly)
+ *(.data..read_mostly)
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -140,7 +140,7 @@ SECTIONS
.bss : C_PHYS(.bss) {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c
index 52a4208..e899f2a 100644
--- a/arch/sparc/boot/btfixupprep.c
+++ b/arch/sparc/boot/btfixupprep.c
@@ -171,7 +171,7 @@ main1:
}
} else if (buffer[nbase+4] != '_')
continue;
- if (!strcmp (sect, ".text.exit"))
+ if (!strcmp (sect, ".text..exit"))
continue;
if (strcmp (sect, ".text") &&
strcmp (sect, ".init.text") &&
@@ -325,7 +325,7 @@ main1:
(*rr)->next = NULL;
}
printf("! Generated by btfixupprep. Do not edit.\n\n");
- printf("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n");
+ printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n");
printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n");
for (i = 0; i < last; i++) {
f = array + i;
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h
index 41f85ae..2909f0a 100644
--- a/arch/sparc/include/asm/cache.h
+++ b/arch/sparc/include/asm/cache.h
@@ -19,7 +19,7 @@
#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifdef CONFIG_SPARC32
#include <asm/asi.h>
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index f0b4b51..0ca3dc5 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -72,7 +72,7 @@ sun4e_notsup:
.align 4
/* The Sparc trap table, bootloader gives us control at _start. */
- .section .text.head,"ax"
+ .section .text..head,"ax"
.globl start, _stext, _start, __stext
.globl trapbase
_start: /* danger danger */
@@ -735,7 +735,7 @@ go_to_highmem:
nop
/* The code above should be at beginning and we have to take care about
- * short jumps, as branching to .text.init section from .text is usually
+ * short jumps, as branching to .text..init section from .text is usually
* impossible */
__INIT
/* Acquire boot time privileged register values, this will help debugging.
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index 3a1b7bf..709353f 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -467,7 +467,7 @@ jump_to_sun4u_init:
jmpl %g2 + %g0, %g0
nop
- .section .text.init.refok
+ .section .text..init.refok
sun4u_init:
BRANCH_IF_SUN4V(g1, sun4v_init)
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index f28cb82..7f7a468 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -22,5 +22,5 @@ EXPORT_SYMBOL(init_task);
* in etrap.S which assumes it.
*/
union thread_union init_thread_union
- __attribute__((section (".data.init_task")))
+ __attribute__((section (".data..init_task")))
= { INIT_THREAD_INFO(init_task) };
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 7626708..66eddbe 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -41,7 +41,7 @@ SECTIONS
.text TEXTSTART :
{
_text = .;
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -59,20 +59,20 @@ SECTIONS
*(.data1)
}
. = ALIGN(SMP_CACHE_BYTES);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
. = ALIGN(SMP_CACHE_BYTES);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
/* End of data section */
_edata = .;
/* init_task */
. = ALIGN(THREAD_SIZE);
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
.fixup : {
__start___fixup = .;
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index cb02486..b623606 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -49,9 +49,9 @@
}
. = ALIGN(32);
- .data.percpu : {
+ .data..percpu : {
__per_cpu_start = . ;
- *(.data.percpu)
+ *(.data..percpu)
__per_cpu_end = . ;
}
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 9975e1a..a415658 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -97,9 +97,9 @@ SECTIONS
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(KERNEL_STACK_SIZE);
- *(.data.init_irqstack)
+ *(.data..init_irqstack)
DATA_DATA
*(.data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 806d381..eed073e 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -34,9 +34,9 @@ EXPORT_SYMBOL(init_task);
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
union thread_union cpu0_irqstack
- __attribute__((__section__(".data.init_irqstack"))) =
+ __attribute__((__section__(".data..init_irqstack"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 11b8352..7b03348 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -53,9 +53,9 @@ SECTIONS
.data :
{
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(KERNEL_STACK_SIZE);
- *(.data.init_irqstack)
+ *(.data..init_irqstack)
DATA_DATA
*(.gnu.linkonce.d*)
CONSTRUCTORS
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 3a8a866..b755fb8 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -29,7 +29,7 @@
#include <asm/boot.h>
#include <asm/asm-offsets.h>
-.section ".text.head","ax",@progbits
+.section ".text..head","ax",@progbits
ENTRY(startup_32)
cld
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index ed4a829..779e06d 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -33,7 +33,7 @@
#include <asm/processor-flags.h>
#include <asm/asm-offsets.h>
-.section ".text.head"
+.section ".text..head"
.code32
ENTRY(startup_32)
cld
diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index 857e492..af8b9c5 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -559,7 +559,7 @@ static void emit_relocs(int as_text)
/* Print the relocations in a form suitable that
* gas will like.
*/
- printf(".section \".data.reloc\",\"a\"\n");
+ printf(".section \".data..reloc\",\"a\"\n");
printf(".balign 4\n");
for (i = 0; i < reloc_count; i++) {
printf("\t .long 0x%08lx\n", relocs[i]);
diff --git a/arch/x86/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux.scr
index f02382a..862d748 100644
--- a/arch/x86/boot/compressed/vmlinux.scr
+++ b/arch/x86/boot/compressed/vmlinux.scr
@@ -1,6 +1,6 @@
SECTIONS
{
- .rodata.compressed : {
+ .rodata..compressed : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds b/arch/x86/boot/compressed/vmlinux_32.lds
index bb3c483..d70318a 100644
--- a/arch/x86/boot/compressed/vmlinux_32.lds
+++ b/arch/x86/boot/compressed/vmlinux_32.lds
@@ -7,13 +7,13 @@ SECTIONS
* address 0.
*/
. = 0;
- .text.head : {
+ .text..head : {
_head = . ;
- *(.text.head)
+ *(.text..head)
_ehead = . ;
}
- .rodata.compressed : {
- *(.rodata.compressed)
+ .rodata..compressed : {
+ *(.rodata..compressed)
}
.text : {
_text = .; /* Text */
@@ -21,6 +21,10 @@ SECTIONS
*(.text.*)
_etext = . ;
}
+ .got : {
+ *(.got)
+ *(.got.*)
+ }
.rodata : {
_rodata = . ;
*(.rodata) /* read-only data */
@@ -40,4 +44,6 @@ SECTIONS
*(COMMON)
_end = . ;
}
+ /* Be bold, and discard everything not explicitly mentioned */
+ /DISCARD/ : { *(*) }
}
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux_64.lds
index bef1ac8..d3d1468 100644
--- a/arch/x86/boot/compressed/vmlinux_64.lds
+++ b/arch/x86/boot/compressed/vmlinux_64.lds
@@ -7,13 +7,13 @@ SECTIONS
* address 0.
*/
. = 0;
- .text.head : {
+ .text..head : {
_head = . ;
- *(.text.head)
+ *(.text..head)
_ehead = . ;
}
- .rodata.compressed : {
- *(.rodata.compressed)
+ .rodata..compressed : {
+ *(.rodata..compressed)
}
.text : {
_text = .; /* Text */
@@ -45,4 +45,6 @@ SECTIONS
. = . + 4096 * 6;
_ebss = .;
}
+ /* Be bold, and discard everything not explicitly mentioned */
+ /DISCARD/ : { *(*) }
}
diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h
index 5d367ca..6b94d49 100644
--- a/arch/x86/include/asm/cache.h
+++ b/arch/x86/include/asm/cache.h
@@ -5,7 +5,7 @@
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifdef CONFIG_X86_VSMP
/* vSMP Internode cacheline shift */
@@ -13,7 +13,7 @@
#ifdef CONFIG_SMP
#define __cacheline_aligned_in_smp \
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \
- __attribute__((__section__(".data.page_aligned")))
+ __attribute__((__section__(".data..page_aligned")))
#endif
#endif
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 8ded418..13ab720 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -1,4 +1,4 @@
- .section .text.page_aligned
+ .section .text..page_aligned
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 3068388..4a4bfef 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -80,7 +80,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE)
* any particular GDT layout, because we load our own as soon as we
* can.
*/
-.section .text.head,"ax",@progbits
+.section .text..head,"ax",@progbits
ENTRY(startup_32)
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
us to not reload segments */
@@ -618,7 +618,7 @@ ENTRY(_stext)
/*
* BSS section
*/
-.section ".bss.page_aligned","wa"
+.section ".bss..page_aligned","wa"
.align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE
swapper_pg_pmd:
@@ -636,7 +636,7 @@ ENTRY(empty_zero_page)
* This starts the data section.
*/
#ifdef CONFIG_X86_PAE
-.section ".data.page_aligned","wa"
+.section ".data..page_aligned","wa"
/* Page-aligned for the benefit of paravirt? */
.align PAGE_SIZE_asm
ENTRY(swapper_pg_dir)
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 54b29bb..05b8013 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -41,7 +41,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map)
L3_START_KERNEL = pud_index(__START_KERNEL_map)
.text
- .section .text.head
+ .section .text..head
.code64
.globl startup_64
startup_64:
@@ -419,7 +419,7 @@ ENTRY(phys_base)
ENTRY(idt_table)
.skip IDT_ENTRIES * 16
- .section .bss.page_aligned, "aw", @nobits
+ .section .bss..page_aligned, "aw", @nobits
.align PAGE_SIZE
ENTRY(empty_zero_page)
.skip PAGE_SIZE
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index df3bf26..103b1c5 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -22,7 +22,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(init_task);
/*
* per-CPU TSS segments. Threads are completely 'soft' on Linux,
* no more per-task TSS's. The TSS size is kept cacheline-aligned
- * so they are allowed to end up in the .data.cacheline_aligned
+ * so they are allowed to end up in the .data..cacheline_aligned
* section. Since TSS's are completely CPU-local, we want them
* on exact cacheline boundaries, to eliminate cacheline ping-pong.
*/
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 3a97a4c..9548f29 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -407,7 +407,7 @@ void __init setup_per_cpu_areas(void)
#endif
#endif
/*
- * Up to this point, the boot CPU has been using .data.init
+ * Up to this point, the boot CPU has been using .data..init
* area. Reload any changed state for the boot CPU.
*/
if (cpu == boot_cpu_id)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a1d2883..2a88259 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -77,7 +77,7 @@ char ignore_fpu_irq;
* for this.
*/
gate_desc idt_table[256]
- __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };
+ __attribute__((__section__(".data..idt"))) = { { { { 0, 0 } } }, };
#endif
DECLARE_BITMAP(used_vectors, NR_VECTORS);
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 62ad500..5342ea8 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -31,15 +31,15 @@ SECTIONS
. = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
phys_startup_32 = startup_32 - LOAD_OFFSET;
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
+ .text..head : AT(ADDR(.text..head) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
- *(.text.head)
+ *(.text..head)
} :text = 0x9090
/* read-only */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */
- *(.text.page_aligned)
+ *(.text..page_aligned)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -71,32 +71,32 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- *(.data.page_aligned)
- *(.data.idt)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
+ *(.data..page_aligned)
+ *(.data..idt)
}
. = ALIGN(32);
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
+ *(.data..cacheline_aligned)
}
/* rarely changed data like cpu maps */
. = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
_edata = .; /* End of data section */
}
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- *(.data.init_task)
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
+ *(.data..init_task)
}
/* might get freed after init */
@@ -185,7 +185,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
. = ALIGN(4);
__bss_stop = .;
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index c874250..98016a2 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -32,7 +32,7 @@ SECTIONS
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
/* First the code that has to be first for bootstrapping */
- *(.text.head)
+ *(.text..head)
_stext = .;
/* Then the rest */
TEXT_TEXT
@@ -65,19 +65,19 @@ SECTIONS
} :data
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
. = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
}
. = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
}
#define VSYSCALL_ADDR (-10*1024*1024)
-#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
-#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data..read_mostly) + SIZEOF(.data..read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_VIRT_ADDR ((ADDR(.data..read_mostly) + SIZEOF(.data..read_mostly) + 4095) & ~(4095))
#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
@@ -125,14 +125,14 @@ SECTIONS
#undef VVIRT_OFFSET
#undef VVIRT
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
. = ALIGN(THREAD_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
}:data.init
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
}
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
@@ -236,7 +236,7 @@ SECTIONS
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
} :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
@@ -244,7 +244,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
__bss_stop = .;
}
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index 0817f9d..5e093b2 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -234,7 +234,7 @@ should_never_return:
* BSS section
*/
-.section ".bss.page_aligned", "w"
+.section ".bss..page_aligned", "w"
#ifdef CONFIG_MMU
ENTRY(swapper_pg_dir)
.fill PAGE_SIZE, 1, 0
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index e07f5c9..d07db9b 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -28,7 +28,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"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
struct task_struct init_task = INIT_TASK(init_task);
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index c1be9a4..4c1cfc9 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -124,14 +124,14 @@ SECTIONS
DATA_DATA
CONSTRUCTORS
. = ALIGN(XCHAL_ICACHE_LINESIZE);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
}
_edata = .;
/* The initial task */
. = ALIGN(8192);
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* Initialization code and data: */
@@ -262,7 +262,7 @@ SECTIONS
/* BSS section */
_bss_start = .;
- .bss : { *(.bss.page_aligned) *(.bss) }
+ .bss : { *(.bss..page_aligned) *(.bss) }
_bss_end = .;
_end = .;
diff --git a/include/asm-frv/init.h b/include/asm-frv/init.h
index 8b15838..4d21473 100644
--- a/include/asm-frv/init.h
+++ b/include/asm-frv/init.h
@@ -1,12 +1,12 @@
#ifndef _ASM_INIT_H
#define _ASM_INIT_H
-#define __init __attribute__ ((__section__ (".text.init")))
-#define __initdata __attribute__ ((__section__ (".data.init")))
+#define __init __attribute__ ((__section__ (".text..init")))
+#define __initdata __attribute__ ((__section__ (".data..init")))
/* For assembly routines */
-#define __INIT .section ".text.init",#alloc,#execinstr
+#define __INIT .section ".text..init",#alloc,#execinstr
#define __FINIT .previous
-#define __INITDATA .section ".data.init",#alloc,#write
+#define __INITDATA .section ".data..init",#alloc,#write
#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 7fa660f..37feab0 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -88,7 +88,7 @@
/* .data section */
#define DATA_DATA \
*(.data) \
- *(.data.init.refok) \
+ *(.data..init.refok) \
*(.ref.data) \
DEV_KEEP(init.data) \
DEV_KEEP(exit.data) \
@@ -287,8 +287,8 @@
*(.text.hot) \
*(.text) \
*(.ref.text) \
- *(.text.init.refok) \
- *(.exit.text.refok) \
+ *(.text..init.refok) \
+ *(.text..exit.refok) \
DEV_KEEP(init.text) \
DEV_KEEP(exit.text) \
CPU_KEEP(init.text) \
@@ -475,16 +475,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
@@ -496,17 +496,17 @@
*
* 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/cache.h b/include/linux/cache.h
index 97e2488..4c57065 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -31,7 +31,7 @@
#ifndef __cacheline_aligned
#define __cacheline_aligned \
__attribute__((__aligned__(SMP_CACHE_BYTES), \
- __section__(".data.cacheline_aligned")))
+ __section__(".data..cacheline_aligned")))
#endif /* __cacheline_aligned */
#ifndef __cacheline_aligned_in_smp
diff --git a/include/linux/init.h b/include/linux/init.h
index 68cb026..f87423d 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -62,9 +62,9 @@
/* backward compatibility note
* A few places hardcode the old section names:
- * .text.init.refok
- * .data.init.refok
- * .exit.text.refok
+ * .text..init.refok
+ * .data..init.refok
+ * .text..exit.refok
* They should be converted to use the defines from this file
*/
@@ -301,7 +301,7 @@ void __init parse_early_param(void);
#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." */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..bddaee6 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -18,8 +18,8 @@
# define asmregparm
#endif
-#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE)
-#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
+#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
+#define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
/*
* This is used by architectures to keep arguments on the stack
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index ee5615d..d208c5b 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -11,7 +11,7 @@
#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
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 252b245..1a67c69 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -60,7 +60,7 @@
/*
* Must define these before including other files, inline functions need them
*/
-#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
+#define LOCK_SECTION_NAME ".text..lock."KBUILD_BASENAME
#define LOCK_SECTION_START(extra) \
".subsection 1\n\t" \
diff --git a/kernel/module.c b/kernel/module.c
index c268a77..9c0404d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -525,7 +525,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)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8cc7061..4a3c375 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -797,9 +797,9 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };
/* sections that may refer to an init/exit section with no warning */
static const char *initref_sections[] =
{
- ".text.init.refok*",
- ".exit.text.refok*",
- ".data.init.refok*",
+ ".text..init.refok*",
+ ".text..exit.refok*",
+ ".data..init.refok*",
NULL
};
@@ -918,7 +918,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* Pattern 0:
* Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
* The pattern is identified by:
- * fromsec = .text.init.refok* | .data.init.refok*
+ * fromsec = .text..init.refok* | .data..init.refok*
*
* Pattern 1:
* If a module parameter is declared __initdata and permissions=0
@@ -942,8 +942,8 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer
*
* Pattern 3:
- * Whitelist all refereces from .text.head to .init.data
- * Whitelist all refereces from .text.head to .init.text
+ * Whitelist all references from .text..head to .init.data
+ * Whitelist all references from .text..head to .init.text
*
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 409596e..a638a1c 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -26,7 +26,7 @@
# which will also be the location of that section after final link.
# e.g.
#
-# .section ".text.sched"
+# .section ".text..sched"
# .globl my_func
# my_func:
# [...]
@@ -39,7 +39,7 @@
# [...]
#
# Both relocation offsets for the mcounts in the above example will be
-# offset from .text.sched. If we make another file called tmp.s with:
+# offset from .text..sched. If we make another file called tmp.s with:
#
# .section __mcount_loc
# .quad my_func + 0x5
@@ -51,7 +51,7 @@
# But this gets hard if my_func is not globl (a static function).
# In such a case we have:
#
-# .section ".text.sched"
+# .section ".text..sched"
# my_func:
# [...]
# call mcount (offset: 0x5)
--
1.6.2.1
From: Anders Kaseorg <[email protected]>
When you put
.section ".foo"
in an assembly file instead of
.section "foo", "ax"
, one of the possible symptoms is that modpost will see an
ld-generated section name ".foo.1" in section_rel() or section_rela().
But this heuristic has two problems: it will miss a bad section that
has no relocations, and it will incorrectly flag many gcc-generated
sections as bad when compiling with -ffunction-sections
-fdata-sections.
So instead of checking whether the section name matches a particular
pattern, we directly check for a missing SHF_ALLOC in the section
flags.
Signed-off-by: Anders Kaseorg <[email protected]>
---
scripts/mod/modpost.c | 49 ++++++++++++++++++-------------------------------
1 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 4a3c375..41c2229 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -716,41 +716,27 @@ int match(const char *sym, const char * const pat[])
/* sections that we do not want to do full section mismatch check on */
static const char *section_white_list[] =
- { ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
+ { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
/*
- * Is this section one we do not want to check?
- * This is often debug sections.
- * If we are going to check this section then
- * test if section name ends with a dot and a number.
- * This is used to find sections where the linker have
- * appended a dot-number to make the name unique.
+ * This is used to find sections missing the SHF_ALLOC flag.
* The cause of this is often a section specified in assembler
- * without "ax" / "aw" and the same section used in .c
- * code where gcc add these.
+ * without "ax" / "aw".
*/
-static int check_section(const char *modname, const char *sec)
-{
- const char *e = sec + strlen(sec) - 1;
- if (match(sec, section_white_list))
- return 1;
-
- if (*e && isdigit(*e)) {
- /* consume all digits */
- while (*e && e != sec && isdigit(*e))
- e--;
- if (*e == '.' && !strstr(sec, ".linkonce")) {
- warn("%s (%s): unexpected section name.\n"
- "The (.[number]+) following section name are "
- "ld generated and not expected.\n"
- "Did you forget to use \"ax\"/\"aw\" "
- "in a .S file?\n"
- "Note that for example <linux/init.h> contains\n"
- "section definitions for use in .S files.\n\n",
- modname, sec);
- }
+static void check_section(const char *modname, struct elf_info *elf,
+ Elf_Shdr *sechdr)
+{
+ const char *sec = sech_name(elf, sechdr);
+
+ if (sechdr->sh_type == SHT_PROGBITS &&
+ !(sechdr->sh_flags & SHF_ALLOC) &&
+ !match(sec, section_white_list)) {
+ warn("%s (%s): unexpected non-allocatable section.\n"
+ "Did you forget to use \"ax\"/\"aw\" in a .S file?\n"
+ "Note that for example <linux/init.h> contains\n"
+ "section definitions for use in .S files.\n\n",
+ modname, sec);
}
- return 0;
}
@@ -1377,7 +1363,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rela");
/* if from section (name) is know good then skip it */
- if (check_section(modname, fromsec))
+ if (match(fromsec, section_white_list))
return;
for (rela = start; rela < stop; rela++) {
@@ -1421,7 +1407,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rel");
/* if from section (name) is know good then skip it */
- if (check_section(modname, fromsec))
+ if (match(fromsec, section_white_list))
return;
for (rel = start; rel < stop; rel++) {
@@ -1484,6 +1470,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
/* Walk through all sections */
for (i = 0; i < elf->hdr->e_shnum; i++) {
+ check_section(modname, elf, &elf->sechdrs[i]);
/* We want to process only relocation sections and not .init */
if (sechdrs[i].sh_type == SHT_RELA)
section_rela(modname, elf, &elf->sechdrs[i]);
--
1.6.2.1
Linus,
I see that this -ffunction-sections -fdata-sections compatability patch
series didn't get merged for 2.6.30-rc1. Is there a problem with the
patches that needs to be addressed? Or are you planning to merge it
sometime later in this release cycle (Stephen Rothwell mentioned just
after -rc1 as a good time for these patches)?
It still applies to both linux-next and 2.6.30-rc1.
Thanks,
-Tim Abbott
On Wednesday 08 April 2009 10:04:04 Tim Abbott wrote:
> Linus,
>
> I see that this -ffunction-sections -fdata-sections compatability patch
> series didn't get merged for 2.6.30-rc1.
Yep, it'd be good if Linus took this. Pending scattered changes are
painful for everyone.
Thanks,
Rusty.
Is there a problem that is preventing this -ffunction-sections patch
series from being merged?
Support for building the kernel with -ffunction-sections is significant
progress for decreasing the kernel size on embedded systems using section
garbage collection. Support for -ffunction-sections is also the primary
change to the kernel needed as a prerequisite for the Ksplice rebootless
update system.
It still applies to 2.6.30-rc2 and linux-next.
Thanks,
-Tim Abbott
On Mon, 20 Apr 2009, Tim Abbott wrote:
>
> Is there a problem that is preventing this -ffunction-sections patch
> series from being merged?
Quite frankly, every time I see something like this, I shudder.
Why?
The bugs in the toolchains tend to be infinite and _really_ annoying.
We'll end up with everything from "gcc-xyz cannot handle it" to
"binutils-abc which was pre-released by RH/Ubuntu/SUSE will SIGSEGV".
And those are the _good_ cases. The bad cases are just silently
miscompiled/linked stuff under certain circumstances.
In other words, I'm not going to merge it without a _lot_ of people
pushing me on it with nice numbers etc. Because I absolutely hate the
tools issues that I'm convinced will happen the moment I merge it.
Linus
On Mon, 20 Apr 2009, Linus Torvalds wrote:
> Because I absolutely hate the tools issues that I'm convinced will
> happen the moment I merge it.
I assume you're only worried about toolchain problems for people who are
actually using the -ffunction-sections option. Would it help if the
-ffunction-sections compilation option were marked as experimental until
proven otherwise?
If you're not willing to merge even an experimental option for
-ffunction-sections, would you at least be willing to merge the first
three patches in the patch series? Compiling with -ffunction-sections
would not be supported by the mainline kernel, so any toolchain issues
with it would not be your problem. But any vendor that wants to take
advantage of -ffunction-sections would still be able to use it without
having to maintain 300 lines of scattered changes to the kernel.
-Tim Abbott
On Mon, 20 Apr 2009, Tim Abbott wrote:
>
> I assume you're only worried about toolchain problems for people who are
> actually using the -ffunction-sections option. Would it help if the
> -ffunction-sections compilation option were marked as experimental until
> proven otherwise?
The thing is, people will enable them, and then maybe the compiler
_appears_ to work, and things don't boot, and people spend tons of time
chasing down somethign that just turns out to be a tools issue and not a
kernel issue at all. And nobody happens to realize that what's up is that
the person who reported the regression had enabled an experimental
feature.
> If you're not willing to merge even an experimental option for
> -ffunction-sections, would you at least be willing to merge the first
> three patches in the patch series? Compiling with -ffunction-sections
> would not be supported by the mainline kernel, so any toolchain issues
> with it would not be your problem. But any vendor that wants to take
> advantage of -ffunction-sections would still be able to use it without
> having to maintain 300 lines of scattered changes to the kernel.
Are there any advantages outside of the size things?
Do we end up packing data better?
I'd like to have some more champions of this code, in other words.
I'd be ok with merging it, but I haven't really gotten a strong feeling
that anybody is going to enable it or use it.
Linus
On Tuesday 21 April 2009 01:40, Linus Torvalds wrote:
> Quite frankly, every time I see something like this, I shudder.
>
> Why?
>
> The bugs in the toolchains tend to be infinite and _really_ annoying.
Most bugs are annoying. :)
> We'll end up with everything from "gcc-xyz cannot handle it" to
> "binutils-abc which was pre-released by RH/Ubuntu/SUSE will SIGSEGV".
>
> And those are the _good_ cases. The bad cases are just silently
> miscompiled/linked stuff under certain circumstances.
>
> In other words, I'm not going to merge it without a _lot_ of people
> pushing me on it with nice numbers etc. Because I absolutely hate the
> tools issues that I'm convinced will happen the moment I merge it.
In some cases, section garbage collection discards nearly 10% of dead
code/data from kernel image. Actually, every time I add it to
a software project, I see quite an amount of dead code/data
eliminated. Even sadistic manual splitting of every function
and data object into its own .o file doesn't match it.
I can put it another way: let machine do what it does better,
and faster, than humans ever can:
I was pushing a patch for aic7xxx driver which eliminated ~150k
of dead code. It took a lot of time to eventually make it reach
mainline kernel. On and off, it took years.
With section garbage collection, that patch would not be even needed,
as gcc+ld would automagically detect that that code is dead.
--
vda
Linus Torvalds wrote:
>
> Are there any advantages outside of the size things?
>
> Do we end up packing data better?
>
> I'd like to have some more champions of this code, in other words.
>
> I'd be ok with merging it, but I haven't really gotten a strong feeling
> that anybody is going to enable it or use it.
>
It may be a long haul to get people to actually use it, but there is a
fairly major advantage near the end, and that is that we can structure
the source code in a way that makes sense for reading it, rather than
what will end up using what.
Assuming it does work correctly.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
On Tuesday 21 April 2009 03:25, H. Peter Anvin wrote:
> Linus Torvalds wrote:
> >
> > Are there any advantages outside of the size things?
> >
> > Do we end up packing data better?
> >
> > I'd like to have some more champions of this code, in other words.
> >
> > I'd be ok with merging it, but I haven't really gotten a strong feeling
> > that anybody is going to enable it or use it.
> >
>
> It may be a long haul to get people to actually use it, but there is a
> fairly major advantage near the end, and that is that we can structure
> the source code in a way that makes sense for reading it, rather than
> what will end up using what.
>
> Assuming it does work correctly.
It's not like it's known to be broken. I use it all the time
for the stuff I build.
--
vda
On Mon, 20 Apr 2009 17:35:32 -0700 (PDT)
Linus Torvalds <[email protected]> wrote:
>
>
> On Mon, 20 Apr 2009, Tim Abbott wrote:
> >
> > I assume you're only worried about toolchain problems for people
> > who are actually using the -ffunction-sections option. Would it
> > help if the -ffunction-sections compilation option were marked as
> > experimental until proven otherwise?
>
> The thing is, people will enable them, and then maybe the compiler
> _appears_ to work, and things don't boot, and people spend tons of
> time chasing down somethign that just turns out to be a tools issue
> and not a kernel issue at all. And nobody happens to realize that
> what's up is that the person who reported the regression had enabled
> an experimental feature.
>
> > If you're not willing to merge even an experimental option for
> > -ffunction-sections, would you at least be willing to merge the
> > first three patches in the patch series? Compiling with
> > -ffunction-sections would not be supported by the mainline kernel,
> > so any toolchain issues with it would not be your problem. But any
> > vendor that wants to take advantage of -ffunction-sections would
> > still be able to use it without having to maintain 300 lines of
> > scattered changes to the kernel.
>
> Are there any advantages outside of the size things?
we can probably drop a ton of ifdefs...
an alternative approach would be to have a special build target that
uses this, but makes a 2nd vmlinux, and then runs a diff on the symbols
against the regular one... and finds which functions got dropped.
Some patient soul can then go about and stick in ifdefs and stuff...
(or delete the totally not-used-by-anyone functions entirely)
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
On Mon, 20 Apr 2009, Arjan van de Ven wrote:
> an alternative approach would be to have a special build target that
> uses this, but makes a 2nd vmlinux, and then runs a diff on the symbols
> against the regular one... and finds which functions got dropped.
> Some patient soul can then go about and stick in ifdefs and stuff...
We wouldn’t even need a 2nd vmlinux for that. Once we can compile with
-ffunction-sections -fdata-sections, we can just ask the linker to print
the list of unused sections that it removed (--gc-sections
--print-gc-sections).
Anders
On Tue, 21 Apr 2009 09:10:58 am Linus Torvalds wrote:
>
> On Mon, 20 Apr 2009, Tim Abbott wrote:
> >
> > Is there a problem that is preventing this -ffunction-sections patch
> > series from being merged?
>
> Quite frankly, every time I see something like this, I shudder.
It's the section name cleanup which is the invasive part, and I'd like to
see merged now.
I don't care so much about actually flipping the option on.
Thanks,
Rusty.
On Mon, 20 Apr 2009, Linus Torvalds wrote:
> Are there any advantages outside of the size things?
The main reason I'm interested in these patches is that they are needed by
the Ksplice rebootless update system.
The Ksplice developers have been working to make Ksplice mergeable into
mainline for about a year now. I think it would be best for everyone if
Ksplice were merged before it gets shipped as a feature of a distribution
or as a widely deployed standalone product.
Ksplice, Inc., the company behind Ksplice, has been doing deployments of a
commercial rebootless update service based on Ksplice for several months
now. Once we make a variant of this service freely available for a
community Linux distribution later this year, we anticipate that many
deployed Linux systems will be running Ksplice. We'd like to be good
community members and merge Ksplice before that happens.
We broke off this -ffunction-sections patch series from the main Ksplice
patch series because it has significant independent interest and thus
could be merged first.
We are not asking you to make a decision at this time on whether or not
Ksplice should be merged. However, this -ffunction-sections patch series
is essentially the entire portion of the Ksplice patch series that touches
the rest of the kernel, so merging this patch series will make it much
easier to forward port Ksplice to new kernels or to merge Ksplice in the
future.
-Tim Abbott
> Are there any advantages outside of the size things?
Yes ksplice needs it too.
> Do we end up packing data better?
There used to be tools to do that (use profile feedback to pack
code), but I'm not sure they would help the kernel too much
because they were mostly aimed at demand paging. But such tools
definitely would need this infrastructure. Iirc there are some architectures
othat benefit from hold/cold partioning during execution.
> I'd like to have some more champions of this code, in other words.
I definitely like the size angle -- letting the linker eliminate
code without ifdef jungles certainly sounds attractive to me.
Also if we find broken toolchains I suppose it wouldn't be too
difficult to black list them.
-Andi
--
[email protected] -- Speaking for myself only.
> we can probably drop a ton of ifdefs...
That would require always forcing it to on.
> an alternative approach would be to have a special build target that
> uses this, but makes a 2nd vmlinux, and then runs a diff on the symbols
> against the regular one... and finds which functions got dropped.
> Some patient soul can then go about and stick in ifdefs and stuff...
I bet that would result in horrible looking code. If the toolchain
based approach can be made to work (and from the reports of people
who tried it it sounds like it can) that would be vastly preferable.
-Andi
--
[email protected] -- Speaking for myself only.
On Sun, Apr 05, 2009 at 07:14:34PM -0400, Tim Abbott wrote:
>Hi Linus,
>
>Here is a new version of the -ffunction-sections -fdata-sections patch
>series based on your current master. Please apply.
>
>When I sent a version of this patch series at the start of the merge
>window, Stephen Rothwell pointed out that the first patch conflicted
>with several changes in linux-next, and it should be resent near the
>end of the merge window once those changes were merged. There are
>now no conflicting changes staged in linux-next[0], so now is probably
>the optimal time to merge this patch series.
>
>[0] There is one trivial merge conflict with next-20090403 because
>e5083a63b6a8546c5fe1e571fe529e3939787ec2 was merged into master since
>then, but this will presumably disappear when next catches up tomorrow.
>
> -Tim Abbott
>
>--
>
>The purpose of this patch series is to make it possible to build the
>kernel with "gcc -ffunction-sections -fdata-sections". There are two
>major applications for this functionality: decreasing vmlinux image
>size with --gc-sections, and Ksplice.
Hello, Tim!
Nice work! But, don't -ffunction-sections and -fdata-sections have
collisions with '-g' and 'gprof'? Just like what gcc(1) describes.
CONFIG_DEBUG_INFO relies on '-g', and IIRIC, another project of
linux kernel is trying to 'gprof' the kernel too.
So, CONFIG_FUNCTION_DATA_SECTIONS probably needs to depend on
!CONFIG_DEBUG_INFO etc.
Am I missing something?
Thanks.
--
Live like a child, think like the god.
On Tue, 21 Apr 2009, Américo Wang wrote:
> Nice work! But, don't -ffunction-sections and -fdata-sections have
> collisions with '-g' and 'gprof'? Just like what gcc(1) describes.
That description seems to be long obsolete. gcc used to warn that
-ffunction-sections may affect debugging, but that warning was disabled
for ELF targets in 1999, presumably because ELF has always supported
arbitrary section names even though some other object formats have issues.
<http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00975.html>
I know that debugging under -ffunction-sections -g works fine on at least
x86, which is the only platform on which we currently propose to provide
this option, and based on that message it looks like other platforms are
fine too.
> IIRIC, another project of linux kernel is trying to 'gprof' the kernel
> too.
gprof requires compiling with -pg, and yes, there is a conflict with
-ffunction-sections -pg, as documented in the config help text.
<http://lkml.org/lkml/2009/2/4/487>
That is why CONFIG_FUNCTION_DATA_SECTIONS already depends on
!CONFIG_FUNCTION_TRACER. Any external project that tries to add -pg to an
-ffunction-sections kernel will get this warning from gcc:
warning: -ffunction-sections disabled; it makes profiling impossible
which makes the situation clear.
This conflict appears to be bogus, and we have had no trouble with
-ffunction-sections -pg after patching the conflict out of the gcc source.
So we may eventually be able to remove it.
<http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html>
Anders
Anders Kaseorg wrote:
> On Tue, 21 Apr 2009, Américo Wang wrote:
>> Nice work! But, don't -ffunction-sections and -fdata-sections have
>> collisions with '-g' and 'gprof'? Just like what gcc(1) describes.
>
> That description seems to be long obsolete. gcc used to warn that
> -ffunction-sections may affect debugging, but that warning was disabled
> for ELF targets in 1999, presumably because ELF has always supported
> arbitrary section names even though some other object formats have issues.
> <http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00975.html>
>
> I know that debugging under -ffunction-sections -g works fine on at least
> x86, which is the only platform on which we currently propose to provide
> this option, and based on that message it looks like other platforms are
> fine too.
Would you know actual version of gcc from which supports the combination of
-ffunction-sections and -g?
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: [email protected]
On Tue, Apr 21, 2009 at 03:20:56PM +0930, Rusty Russell wrote:
> On Tue, 21 Apr 2009 09:10:58 am Linus Torvalds wrote:
> >
> > On Mon, 20 Apr 2009, Tim Abbott wrote:
> > >
> > > Is there a problem that is preventing this -ffunction-sections patch
> > > series from being merged?
> >
> > Quite frankly, every time I see something like this, I shudder.
>
> It's the section name cleanup which is the invasive part, and I'd like to
> see merged now.
>
> I don't care so much about actually flipping the option on.
>
There are also already architectures in-tree that default enable it
today: frv, mips, and parisc. So at least the toolchain situation seems
to be sorted well enough for some people (admittedly easier if there are
fewer toolchain variants floating about..).
It is appealing from the embedded side at least, so it's forseeable that
most of the CONFIG_EMBEDDED users will enable it purely on the size
basis, especially since the tiny people seem to be mostly grasping at
straws these days..
On Wed, 22 Apr 2009, Masami Hiramatsu wrote:
> Would you know actual version of gcc from which supports the combination of
> -ffunction-sections and -g?
The warning about combining -ffunction-sections and -g was disabled on the
ELF target in gcc 2.95 (released August 1999). I think that combining
these options worked fine on ELF before then and the change in 1999 was
just disabling the warning on a target that it didn't apply to.
-Tim Abbott
On Mon, 20 Apr 2009, Linus Torvalds wrote:
> I'd be ok with merging it, but I haven't really gotten a strong feeling
> that anybody is going to enable it or use it.
Linus,
Would you be willing to merge the first 3 patches in this patch series at
this point? I'm resending these patches to resolve some conflicts that
was recently introduced.
To summarize the discussion, there are three uses for this code that have
significant interest.
One is decreasing the kernel size. Denys Vlasenko has numbers that using
the linker's --gc-sections option (for which these patches are a
prerequisite) saves 10% of the kernel size when CONFIG_MODULES=n, and 1%
when CONFIG_MODULES=y. Paul Mundt thinks many embedded users would use
this if it were available.
A related use is cleaning up a lot of ifdefs that exist only to decrease
the kernel size. Several developers commented favorably on the direction
of using section garbage collection for dead code removal.
Finally, Ksplice depends on the option added by this patch series.
The first 3 patches in this patch series fix problems associated with
using -ffunction-sections. As there are some architectures currently
using -ffunction-sections, these should ideally be merged now, especially
the first patch which involves scattered changes.
-Tim Abbott
From: Anders Kaseorg <[email protected]>
When you put
.section ".foo"
in an assembly file instead of
.section "foo", "ax"
, one of the possible symptoms is that modpost will see an
ld-generated section name ".foo.1" in section_rel() or section_rela().
But this heuristic has two problems: it will miss a bad section that
has no relocations, and it will incorrectly flag many gcc-generated
sections as bad when compiling with -ffunction-sections
-fdata-sections.
So instead of checking whether the section name matches a particular
pattern, we directly check for a missing SHF_ALLOC in the section
flags.
Signed-off-by: Anders Kaseorg <[email protected]>
---
scripts/mod/modpost.c | 49 ++++++++++++++++++-------------------------------
1 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f39132b..3e6ff75 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -716,41 +716,27 @@ int match(const char *sym, const char * const pat[])
/* sections that we do not want to do full section mismatch check on */
static const char *section_white_list[] =
- { ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
+ { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
/*
- * Is this section one we do not want to check?
- * This is often debug sections.
- * If we are going to check this section then
- * test if section name ends with a dot and a number.
- * This is used to find sections where the linker have
- * appended a dot-number to make the name unique.
+ * This is used to find sections missing the SHF_ALLOC flag.
* The cause of this is often a section specified in assembler
- * without "ax" / "aw" and the same section used in .c
- * code where gcc add these.
+ * without "ax" / "aw".
*/
-static int check_section(const char *modname, const char *sec)
-{
- const char *e = sec + strlen(sec) - 1;
- if (match(sec, section_white_list))
- return 1;
-
- if (*e && isdigit(*e)) {
- /* consume all digits */
- while (*e && e != sec && isdigit(*e))
- e--;
- if (*e == '.' && !strstr(sec, ".linkonce")) {
- warn("%s (%s): unexpected section name.\n"
- "The (.[number]+) following section name are "
- "ld generated and not expected.\n"
- "Did you forget to use \"ax\"/\"aw\" "
- "in a .S file?\n"
- "Note that for example <linux/init.h> contains\n"
- "section definitions for use in .S files.\n\n",
- modname, sec);
- }
+static void check_section(const char *modname, struct elf_info *elf,
+ Elf_Shdr *sechdr)
+{
+ const char *sec = sech_name(elf, sechdr);
+
+ if (sechdr->sh_type == SHT_PROGBITS &&
+ !(sechdr->sh_flags & SHF_ALLOC) &&
+ !match(sec, section_white_list)) {
+ warn("%s (%s): unexpected non-allocatable section.\n"
+ "Did you forget to use \"ax\"/\"aw\" in a .S file?\n"
+ "Note that for example <linux/init.h> contains\n"
+ "section definitions for use in .S files.\n\n",
+ modname, sec);
}
- return 0;
}
@@ -1377,7 +1363,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rela");
/* if from section (name) is know good then skip it */
- if (check_section(modname, fromsec))
+ if (match(fromsec, section_white_list))
return;
for (rela = start; rela < stop; rela++) {
@@ -1421,7 +1407,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rel");
/* if from section (name) is know good then skip it */
- if (check_section(modname, fromsec))
+ if (match(fromsec, section_white_list))
return;
for (rel = start; rel < stop; rel++) {
@@ -1484,6 +1470,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
/* Walk through all sections */
for (i = 0; i < elf->hdr->e_shnum; i++) {
+ check_section(modname, elf, &elf->sechdrs[i]);
/* We want to process only relocation sections and not .init */
if (sechdrs[i].sh_type == SHT_RELA)
section_rela(modname, elf, &elf->sechdrs[i]);
--
1.6.2.1
The purpose of this patch is to make it possible to build the kernel
with "gcc -ffunction-sections -fdata-sections". This is a key step
towards being able to compile the kernel using the --gc-sections
linker option, which can be used to decrease the vmlinux size by
garbage collecting unused functions. Also, Ksplice's 'run-pre
matching' process is much simpler if the original kernel was compiled
with -ffunction-sections and -fdata-sections.
Currently, the kernel uses a number of "magic" section names such as
".data.nosave" and ".text.head".
The problem is that with -ffunction-sections -fdata-sections, gcc
places code like
static void head(...) {...}
in the .text.head section, and code like
static int nosave = 1;
in the .data.nosave section, causing code to be inappropriately placed
in the "magic" sections. This patch renames all "magic" section names
used by the kernel to use ".." rather than "." as the delimiter
between the section prefix (e.g. ".text") and suffix (e.g. "head"), so
that ".data.nosave" becomes ".data..nosave", etc. The key property of
these names is that there are no collisions between the kernel's
"magic" sections and the sections generated by gcc's
-ffunction-sections and -fdata-sections options. One can then
reference the sections generated by -ffunction-sections using a linker
script pattern such as *(.text.[A-Za-z$_]*)
This patch is based on an some earlier patches by Denys Vlasenko.
Those earlier patches used section names like ".kernel.text.head".
Because these names did not begin with e.g. ".text", the assembler did
not automatically use the correct section flags for them, and so one
needed to explicitly declare the sections flags when declaring a
section in assembly files using code such as:
.section .kernel.text.head, "ax", @progbits
These explicit section flags in assembly files turned out to be a
common source of confusion, and so I rewrote the patch with this new
section naming scheme suggested by Anders Kaseorg.
Signed-off-by: Tim Abbott <[email protected]>
Signed-off-by: Anders Kaseorg <[email protected]>
---
Documentation/mutex-design.txt | 4 +-
arch/alpha/kernel/head.S | 2 +-
arch/alpha/kernel/init_task.c | 2 +-
arch/alpha/kernel/vmlinux.lds.S | 14 ++++----
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/init_task.c | 2 +-
arch/arm/kernel/vmlinux.lds.S | 16 +++++-----
arch/arm/mm/proc-v6.S | 2 +-
arch/arm/mm/proc-v7.S | 2 +-
arch/arm/mm/tlb-v6.S | 2 +-
arch/arm/mm/tlb-v7.S | 2 +-
arch/avr32/kernel/init_task.c | 2 +-
arch/avr32/kernel/vmlinux.lds.S | 6 ++--
arch/avr32/mm/init.c | 2 +-
arch/blackfin/kernel/vmlinux.lds.S | 2 +-
arch/cris/kernel/process.c | 2 +-
arch/cris/kernel/vmlinux.lds.S | 2 +-
arch/frv/include/asm/init.h | 8 ++--
arch/frv/kernel/break.S | 4 +-
arch/frv/kernel/entry.S | 2 +-
arch/frv/kernel/head-mmu-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr401.S | 2 +-
arch/frv/kernel/head-uc-fr451.S | 2 +-
arch/frv/kernel/head-uc-fr555.S | 2 +-
arch/frv/kernel/head.S | 4 +-
arch/frv/kernel/init_task.c | 2 +-
arch/frv/kernel/vmlinux.lds.S | 18 +++++-----
arch/frv/mm/tlb-miss.S | 2 +-
arch/h8300/boot/compressed/head.S | 2 +-
arch/h8300/boot/compressed/vmlinux.lds | 2 +-
arch/h8300/kernel/init_task.c | 2 +-
arch/h8300/kernel/vmlinux.lds.S | 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/head.S | 2 +-
arch/ia64/kernel/init_task.c | 4 +-
arch/ia64/kernel/ivt.S | 2 +-
arch/ia64/kernel/minstate.h | 4 +-
arch/ia64/kernel/paravirtentry.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 44 +++++++++++++-------------
arch/ia64/kvm/vmm_ivt.S | 2 +-
arch/ia64/xen/gate-data.S | 2 +-
arch/ia64/xen/xensetup.S | 2 +-
arch/m32r/kernel/head.S | 2 +-
arch/m32r/kernel/init_task.c | 2 +-
arch/m32r/kernel/vmlinux.lds.S | 8 ++--
arch/m68k/kernel/head.S | 2 +-
arch/m68k/kernel/process.c | 2 +-
arch/m68k/kernel/sun3-head.S | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 6 ++--
arch/m68k/kernel/vmlinux-sun3.lds | 4 +-
arch/m68knommu/kernel/init_task.c | 2 +-
arch/m68knommu/kernel/vmlinux.lds.S | 6 ++--
arch/m68knommu/platform/68360/head-ram.S | 2 +-
arch/m68knommu/platform/68360/head-rom.S | 2 +-
arch/microblaze/kernel/init_task.c | 2 +-
arch/microblaze/kernel/vmlinux.lds.S | 4 +-
arch/mips/kernel/init_task.c | 2 +-
arch/mips/kernel/vmlinux.lds.S | 8 ++--
arch/mips/lasat/image/head.S | 2 +-
arch/mips/lasat/image/romscript.normal | 2 +-
arch/mn10300/kernel/head.S | 2 +-
arch/mn10300/kernel/init_task.c | 2 +-
arch/mn10300/kernel/vmlinux.lds.S | 16 +++++-----
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 | 8 ++--
arch/parisc/kernel/vmlinux.lds.S | 26 ++++++++--------
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/include/asm/page_64.h | 2 +-
arch/powerpc/include/asm/ppc_asm.h | 4 +-
arch/powerpc/kernel/head_32.S | 2 +-
arch/powerpc/kernel/head_40x.S | 2 +-
arch/powerpc/kernel/head_44x.S | 2 +-
arch/powerpc/kernel/head_8xx.S | 2 +-
arch/powerpc/kernel/head_fsl_booke.S | 2 +-
arch/powerpc/kernel/init_task.c | 2 +-
arch/powerpc/kernel/machine_kexec_64.c | 2 +-
arch/powerpc/kernel/vdso.c | 2 +-
arch/powerpc/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/powerpc/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/powerpc/kernel/vmlinux.lds.S | 22 +++++++-------
arch/s390/include/asm/cache.h | 2 +-
arch/s390/kernel/head.S | 2 +-
arch/s390/kernel/init_task.c | 2 +-
arch/s390/kernel/vdso.c | 2 +-
arch/s390/kernel/vdso32/vdso32_wrapper.S | 2 +-
arch/s390/kernel/vdso64/vdso64_wrapper.S | 2 +-
arch/s390/kernel/vmlinux.lds.S | 20 ++++++------
arch/sh/include/asm/cache.h | 2 +-
arch/sh/kernel/cpu/sh5/entry.S | 4 +-
arch/sh/kernel/head_32.S | 2 +-
arch/sh/kernel/head_64.S | 2 +-
arch/sh/kernel/init_task.c | 2 +-
arch/sh/kernel/irq.c | 4 +-
arch/sh/kernel/vmlinux_32.lds.S | 14 ++++----
arch/sh/kernel/vmlinux_64.lds.S | 14 ++++----
arch/sparc/boot/btfixupprep.c | 4 +-
arch/sparc/include/asm/cache.h | 2 +-
arch/sparc/kernel/head_32.S | 4 +-
arch/sparc/kernel/head_64.S | 2 +-
arch/sparc/kernel/init_task.c | 2 +-
arch/sparc/kernel/vmlinux.lds.S | 14 ++++----
arch/um/include/asm/common.lds.S | 4 +-
arch/um/kernel/dyn.lds.S | 4 +-
arch/um/kernel/init_task.c | 4 +-
arch/um/kernel/uml.lds.S | 4 +-
arch/x86/boot/compressed/head_32.S | 2 +-
arch/x86/boot/compressed/head_64.S | 2 +-
arch/x86/boot/compressed/relocs.c | 2 +-
arch/x86/boot/compressed/vmlinux.scr | 2 +-
arch/x86/boot/compressed/vmlinux_32.lds | 14 ++++++--
arch/x86/boot/compressed/vmlinux_64.lds | 10 ++++--
arch/x86/include/asm/cache.h | 4 +-
arch/x86/kernel/acpi/wakeup_32.S | 2 +-
arch/x86/kernel/head_32.S | 6 ++--
arch/x86/kernel/head_64.S | 4 +-
arch/x86/kernel/init_task.c | 4 +-
arch/x86/kernel/setup_percpu.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
arch/x86/kernel/vmlinux_32.lds.S | 28 ++++++++--------
arch/x86/kernel/vmlinux_64.lds.S | 26 ++++++++--------
arch/xtensa/kernel/head.S | 2 +-
arch/xtensa/kernel/init_task.c | 2 +-
arch/xtensa/kernel/vmlinux.lds.S | 6 ++--
include/asm-generic/percpu.h | 2 +-
include/asm-generic/vmlinux.lds.h | 30 +++++++++---------
include/linux/cache.h | 2 +-
include/linux/init.h | 8 ++--
include/linux/linkage.h | 4 +-
include/linux/spinlock.h | 2 +-
kernel/module.c | 2 +-
scripts/mod/modpost.c | 12 ++++----
scripts/recordmcount.pl | 6 ++--
141 files changed, 356 insertions(+), 348 deletions(-)
diff --git a/Documentation/mutex-design.txt b/Documentation/mutex-design.txt
index aa60d1f..c91ccc0 100644
--- a/Documentation/mutex-design.txt
+++ b/Documentation/mutex-design.txt
@@ -66,14 +66,14 @@ of advantages of mutexes:
c0377ccb <mutex_lock>:
c0377ccb: f0 ff 08 lock decl (%eax)
- c0377cce: 78 0e js c0377cde <.text.lock.mutex>
+ c0377cce: 78 0e js c0377cde <.text..lock.mutex>
c0377cd0: c3 ret
the unlocking fastpath is equally tight:
c0377cd1 <mutex_unlock>:
c0377cd1: f0 ff 00 lock incl (%eax)
- c0377cd4: 7e 0f jle c0377ce5 <.text.lock.mutex+0x7>
+ c0377cd4: 7e 0f jle c0377ce5 <.text..lock.mutex+0x7>
c0377cd6: c3 ret
- 'struct mutex' semantics are well-defined and are enforced if
diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
index 7ac1f13..16293d4 100644
--- a/arch/alpha/kernel/head.S
+++ b/arch/alpha/kernel/head.S
@@ -10,7 +10,7 @@
#include <asm/system.h>
#include <asm/asm-offsets.h>
-.section .text.head, "ax"
+.section .text..head, "ax"
.globl swapper_pg_dir
.globl _stext
swapper_pg_dir=SWAPPER_PGD
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index c2938e5..7929755 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -17,5 +17,5 @@ EXPORT_SYMBOL(init_mm);
EXPORT_SYMBOL(init_task);
union thread_union init_thread_union
- __attribute__((section(".data.init_thread")))
+ __attribute__((section(".data..init_thread")))
= { INIT_THREAD_INFO(init_task) };
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index ef37fc1..511f8ca 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -16,7 +16,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -93,18 +93,18 @@ SECTIONS
/* Freed after init ends here */
/* Note 2 page alignment above. */
- .data.init_thread : {
- *(.data.init_thread)
+ .data..init_thread : {
+ *(.data..init_thread)
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : {
- *(.data.page_aligned)
+ .data..page_aligned : {
+ *(.data..page_aligned)
}
. = ALIGN(64);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
_data = .;
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index cc87e17..fcd93f5 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
* numbers for r1.
*
*/
- .section ".text.head", "ax"
+ .section ".text..head", "ax"
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 21e17dc..705e759 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
* crap here - that's what the boot loader (or in extreme, well justified
* circumstances, zImage) is for.
*/
- .section ".text.head", "ax"
+ .section ".text..head", "ax"
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index e859af3..0b81b8f 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -29,7 +29,7 @@ EXPORT_SYMBOL(init_mm);
* The things we do for performance..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index c90f272..89c97c3 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,10 +23,10 @@ SECTIONS
#else
. = PAGE_OFFSET + TEXT_OFFSET;
#endif
- .text.head : {
+ .text..head : {
_stext = .;
_sinittext = .;
- *(.text.head)
+ *(.text..head)
}
.init : { /* Init code and data */
@@ -66,9 +66,9 @@ SECTIONS
. = ALIGN(4096);
__per_cpu_load = .;
__per_cpu_start = .;
- *(.data.percpu.page_aligned)
- *(.data.percpu)
- *(.data.percpu.shared_aligned)
+ *(.data..percpu.page_aligned)
+ *(.data..percpu)
+ *(.data..percpu.shared_aligned)
__per_cpu_end = .;
#ifndef CONFIG_XIP_KERNEL
__init_begin = _stext;
@@ -146,7 +146,7 @@ SECTIONS
* first, the init task union, aligned
* to an 8192 byte boundary.
*/
- *(.data.init_task)
+ *(.data..init_task)
#ifdef CONFIG_XIP_KERNEL
. = ALIGN(4096);
@@ -158,7 +158,7 @@ SECTIONS
. = ALIGN(4096);
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(4096);
__nosave_end = .;
@@ -166,7 +166,7 @@ SECTIONS
* then the cacheline aligned data
*/
. = ALIGN(32);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
/*
* The exception fixup table (might need resorting at runtime)
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index f0cc599..39d8dd1 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -132,7 +132,7 @@ cpu_v6_name:
.asciz "ARMv6-compatible processor"
.align
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
/*
* __v6_setup
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index d1ebec4..f03c14c 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -153,7 +153,7 @@ cpu_v7_name:
.ascii "ARMv7 Processor"
.align
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
/*
* __v7_setup
diff --git a/arch/arm/mm/tlb-v6.S b/arch/arm/mm/tlb-v6.S
index 20f84bb..7e9a62a 100644
--- a/arch/arm/mm/tlb-v6.S
+++ b/arch/arm/mm/tlb-v6.S
@@ -87,7 +87,7 @@ ENTRY(v6wbi_flush_kern_tlb_range)
mcr p15, 0, r2, c7, c5, 4 @ prefetch flush
mov pc, lr
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
.type v6wbi_tlb_fns, #object
ENTRY(v6wbi_tlb_fns)
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index 24ba510..875a0bd 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -80,7 +80,7 @@ ENTRY(v7wbi_flush_kern_tlb_range)
mov pc, lr
ENDPROC(v7wbi_flush_kern_tlb_range)
- .section ".text.init", #alloc, #execinstr
+ .section ".text..init", #alloc, #execinstr
.type v7wbi_tlb_fns, #object
ENTRY(v7wbi_tlb_fns)
diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 993d56e..4678bc6 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(init_mm);
* Initial thread structure. Must be aligned on an 8192-byte boundary.
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 7910d41..5e73a02 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -95,15 +95,15 @@ SECTIONS
/*
* First, the init task union, aligned to an 8K boundary.
*/
- *(.data.init_task)
+ *(.data..init_task)
/* Then, the page-aligned data */
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
/* Then, the cacheline aligned data */
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
/* And the rest... */
*(.data.rel*)
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index e819fa6..533a011 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -24,7 +24,7 @@
#include <asm/setup.h>
#include <asm/sections.h>
-#define __page_aligned __attribute__((section(".data.page_aligned")))
+#define __page_aligned __attribute__((section(".data..page_aligned")))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 27952ae..f3ef8f1 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -94,7 +94,7 @@ SECTIONS
__sdata = .;
/* This gets done first, so the glob doesn't suck it in */
. = ALIGN(32);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
#if !L1_DATA_A_LENGTH
. = ALIGN(32);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 4df0b32..0f0b4bd 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index 0d2adfc..f603bc8 100644
--- a/arch/cris/kernel/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -68,7 +68,7 @@ SECTIONS
_edata = . ;
. = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
. = ALIGN(PAGE_SIZE); /* Init code and data. */
__init_begin = .;
diff --git a/arch/frv/include/asm/init.h b/arch/frv/include/asm/init.h
index 8b15838..4d21473 100644
--- a/arch/frv/include/asm/init.h
+++ b/arch/frv/include/asm/init.h
@@ -1,12 +1,12 @@
#ifndef _ASM_INIT_H
#define _ASM_INIT_H
-#define __init __attribute__ ((__section__ (".text.init")))
-#define __initdata __attribute__ ((__section__ (".data.init")))
+#define __init __attribute__ ((__section__ (".text..init")))
+#define __initdata __attribute__ ((__section__ (".data..init")))
/* For assembly routines */
-#define __INIT .section ".text.init",#alloc,#execinstr
+#define __INIT .section ".text..init",#alloc,#execinstr
#define __FINIT .previous
-#define __INITDATA .section ".data.init",#alloc,#write
+#define __INITDATA .section ".data..init",#alloc,#write
#endif
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index bd0bdf9..cbb6958 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -21,7 +21,7 @@
#
# the break handler has its own stack
#
- .section .bss.stack
+ .section .bss..stack
.globl __break_user_context
.balign THREAD_SIZE
__break_stack:
@@ -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 99060ab..fe5479b 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-mmu-fr451.S b/arch/frv/kernel/head-mmu-fr451.S
index c8f210d..5900967 100644
--- a/arch/frv/kernel/head-mmu-fr451.S
+++ b/arch/frv/kernel/head-mmu-fr451.S
@@ -31,7 +31,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr401.S b/arch/frv/kernel/head-uc-fr401.S
index ee282be..ecba176 100644
--- a/arch/frv/kernel/head-uc-fr401.S
+++ b/arch/frv/kernel/head-uc-fr401.S
@@ -30,7 +30,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr451.S b/arch/frv/kernel/head-uc-fr451.S
index b10d9c8..ed9dd17 100644
--- a/arch/frv/kernel/head-uc-fr451.S
+++ b/arch/frv/kernel/head-uc-fr451.S
@@ -30,7 +30,7 @@
#define __400_LCR 0xfe000100
#define __400_LSBR 0xfe000c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head-uc-fr555.S b/arch/frv/kernel/head-uc-fr555.S
index 39937c1..ee46b0b 100644
--- a/arch/frv/kernel/head-uc-fr555.S
+++ b/arch/frv/kernel/head-uc-fr555.S
@@ -29,7 +29,7 @@
#define __551_LCR 0xfeff1100
#define __551_LSBR 0xfeff1c00
- .section .text.init,"ax"
+ .section .text..init,"ax"
.balign 4
###############################################################################
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index fecf751..35e6391 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -27,7 +27,7 @@
# command line string
#
###############################################################################
- .section .text.head,"ax"
+ .section .text..head,"ax"
.balign 4
.globl _boot, __head_reference
@@ -541,7 +541,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/init_task.c b/arch/frv/kernel/init_task.c
index 29429a8..f57ec19 100644
--- a/arch/frv/kernel/init_task.c
+++ b/arch/frv/kernel/init_task.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index b95c4ea..a7bcf9b 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -26,7 +26,7 @@ SECTIONS
_sinittext = .;
.init.text : {
- *(.text.head)
+ *(.text..head)
#ifndef CONFIG_DEBUG_INFO
INIT_TEXT
EXIT_TEXT
@@ -71,13 +71,13 @@ SECTIONS
/* put sections together that have massive alignment issues */
. = ALIGN(THREAD_SIZE);
- .data.init_task : {
+ .data..init_task : {
/* init task record & stack */
- *(.data.init_task)
+ *(.data..init_task)
}
. = ALIGN(L1_CACHE_BYTES);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
.trap : {
/* trap table management - read entry-table.S before modifying */
@@ -94,10 +94,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
@@ -152,7 +152,7 @@ SECTIONS
.sbss : { *(.sbss .sbss.*) }
.bss : { *(.bss .bss.*) }
- .bss.stack : { *(.bss) }
+ .bss..stack : { *(.bss) }
__bss_stop = .;
_end = . ;
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
diff --git a/arch/h8300/boot/compressed/head.S b/arch/h8300/boot/compressed/head.S
index 985a81a..10e9a2d 100644
--- a/arch/h8300/boot/compressed/head.S
+++ b/arch/h8300/boot/compressed/head.S
@@ -9,7 +9,7 @@
#define SRAM_START 0xff4000
- .section .text.startup
+ .section .text..startup
.global startup
startup:
mov.l #SRAM_START+0x8000, sp
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds
index 65e2a0d..a0a3a0e 100644
--- a/arch/h8300/boot/compressed/vmlinux.lds
+++ b/arch/h8300/boot/compressed/vmlinux.lds
@@ -4,7 +4,7 @@ SECTIONS
{
__stext = . ;
__text = .;
- *(.text.startup)
+ *(.text..startup)
*(.text)
__etext = . ;
}
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index cb5dc55..fb473b1 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -36,6 +36,6 @@ EXPORT_SYMBOL(init_task);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 43a87b9..c0e3635 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -101,7 +101,7 @@ SECTIONS
___data_start = . ;
. = ALIGN(0x2000) ;
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(0x4) ;
DATA_DATA
. = ALIGN(0x4) ;
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/include/asm/cache.h b/arch/ia64/include/asm/cache.h
index e7482bd..988254a 100644
--- a/arch/ia64/include/asm/cache.h
+++ b/arch/ia64/include/asm/cache.h
@@ -24,6 +24,6 @@
# define SMP_CACHE_BYTES (1 << 3)
#endif
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif /* _ASM_IA64_CACHE_H */
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/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate
index 1d87f84..af90125 100644
--- a/arch/ia64/kernel/Makefile.gate
+++ b/arch/ia64/kernel/Makefile.gate
@@ -21,7 +21,7 @@ GATECFLAGS_gate-syms.o = -r
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)
-# gate-data.o contains the gate DSO image as data in section .data.gate.
+# gate-data.o contains the gate DSO image as data in section .data..gate.
# We must build gate.so before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/gate-data.o: $(obj)/gate.so
diff --git a/arch/ia64/kernel/gate-data.S b/arch/ia64/kernel/gate-data.S
index 258c0a3..b3ef1c7 100644
--- a/arch/ia64/kernel/gate-data.S
+++ b/arch/ia64/kernel/gate-data.S
@@ -1,3 +1,3 @@
- .section .data.gate, "aw"
+ .section .data..gate, "aw"
.incbin "arch/ia64/kernel/gate.so"
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/head.S b/arch/ia64/kernel/head.S
index 23f846d..c0739fc 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -181,7 +181,7 @@ swapper_pg_dir:
halt_msg:
stringz "Halting kernel\n"
- .section .text.head,"ax"
+ .section .text..head,"ax"
.global start_ap
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 5b0e830..8a5028c 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -27,7 +27,7 @@ EXPORT_SYMBOL(init_mm);
* Initial task structure.
*
* We need to make sure that this is properly aligned due to the way process stacks are
- * handled. This is done by having a special ".data.init_task" section...
+ * handled. This is done by having a special ".data..init_task" section...
*/
#define init_thread_info init_task_mem.s.thread_info
@@ -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") __attribute__((section(".data..init_task"))) = {{
.task = INIT_TASK(init_task_mem.s.task),
.thread_info = INIT_THREAD_INFO(init_task_mem.s.task)
}};
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index ec9a5fd..0c14512 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -83,7 +83,7 @@
mov r19=n;; /* prepare to save predicates */ \
br.sptk.many dispatch_to_fault_handler
- .section .text.ivt,"ax"
+ .section .text..ivt,"ax"
.align 32768 // align on 32KB boundary
.global ia64_ivt
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/paravirtentry.S b/arch/ia64/kernel/paravirtentry.S
index 6158560..92d880c 100644
--- a/arch/ia64/kernel/paravirtentry.S
+++ b/arch/ia64/kernel/paravirtentry.S
@@ -28,7 +28,7 @@
#include "entry.h"
#define DATA8(sym, init_value) \
- .pushsection .data.read_mostly ; \
+ .pushsection .data..read_mostly ; \
.align 8 ; \
.global sym ; \
sym: ; \
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 4a95e86..e3f23f4 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -8,7 +8,7 @@
#define IVT_TEXT \
VMLINUX_SYMBOL(__start_ivt_text) = .; \
- *(.text.ivt) \
+ *(.text..ivt) \
VMLINUX_SYMBOL(__end_ivt_text) = .;
OUTPUT_FORMAT("elf64-ia64-little")
@@ -51,13 +51,13 @@ SECTIONS
KPROBES_TEXT
*(.gnu.linkonce.t*)
}
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
- { *(.text.head) }
+ .text..head : AT(ADDR(.text..head) - LOAD_OFFSET)
+ { *(.text..head) }
.text2 : AT(ADDR(.text2) - LOAD_OFFSET)
{ *(.text2) }
#ifdef CONFIG_SMP
- .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
- { *(.text.lock) }
+ .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET)
+ { *(.text..lock) }
#endif
_etext = .;
@@ -84,10 +84,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 = .;
}
@@ -148,24 +148,24 @@ SECTIONS
__initcall_end = .;
}
- .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 = .;
}
@@ -217,18 +217,18 @@ SECTIONS
__init_end = .;
/* The initial task and kernel stack */
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
- { *(.data.init_task) }
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET)
+ { *(.data..init_task) }
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET)
{ *(__special_page_section)
__start_gate_section = .;
- *(.data.gate)
+ *(.data..gate)
__stop_gate_section = .;
#ifdef CONFIG_XEN
. = ALIGN(PAGE_SIZE);
__xen_start_gate_section = .;
- *(.data.gate.xen)
+ *(.data..gate.xen)
__xen_stop_gate_section = .;
#endif
}
@@ -236,11 +236,11 @@ SECTIONS
* kernel data
*/
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
- { *(.data.read_mostly) }
+ .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) }
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET)
+ { *(.data..cacheline_aligned) }
/* Per-cpu data: */
. = ALIGN(PERCPU_PAGE_SIZE);
diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S
index 3ef1a01..c5ab23b 100644
--- a/arch/ia64/kvm/vmm_ivt.S
+++ b/arch/ia64/kvm/vmm_ivt.S
@@ -104,7 +104,7 @@ GLOBAL_ENTRY(kvm_vmm_panic)
br.call.sptk.many b6=vmm_panic_handler;
END(kvm_vmm_panic)
- .section .text.ivt,"ax"
+ .section .text..ivt,"ax"
.align 32768 // align on 32KB boundary
.global kvm_ia64_ivt
diff --git a/arch/ia64/xen/gate-data.S b/arch/ia64/xen/gate-data.S
index 7d4830a..6f95b6b 100644
--- a/arch/ia64/xen/gate-data.S
+++ b/arch/ia64/xen/gate-data.S
@@ -1,3 +1,3 @@
- .section .data.gate.xen, "aw"
+ .section .data..gate.xen, "aw"
.incbin "arch/ia64/xen/gate.so"
diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S
index 28fed1f..28def53 100644
--- a/arch/ia64/xen/xensetup.S
+++ b/arch/ia64/xen/xensetup.S
@@ -14,7 +14,7 @@
#include <linux/init.h>
#include <xen/interface/elfnote.h>
- .section .data.read_mostly
+ .section .data..read_mostly
.align 8
.global xen_domain_type
xen_domain_type:
diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S
index 9091606..2bac669 100644
--- a/arch/m32r/kernel/head.S
+++ b/arch/m32r/kernel/head.S
@@ -23,7 +23,7 @@ __INITDATA
/*
* References to members of the boot_cpu_data structure.
*/
-.section .text.head, "ax"
+.section .text..head, "ax"
.global start_kernel
.global __bss_start
.global _end
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 016885c..7c24cec 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -25,7 +25,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 9db05df..2bcc37e 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.boot : { *(.boot) } = 0
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -57,17 +57,17 @@ SECTIONS
. = ALIGN(4096);
__nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
+ .data_nosave : { *(.data..nosave) }
. = ALIGN(4096);
__nosave_end = .;
. = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* will be freed after init */
. = ALIGN(4096); /* Init code and data */
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index f513f53..bdb247e 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -577,7 +577,7 @@ func_define putn,1
#endif
.endm
-.section ".text.head","ax"
+.section ".text..head","ax"
ENTRY(_stext)
/*
* Version numbers of the bootinfo interface
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index ec37fb5..4b83a2e 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -47,7 +47,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"), aligned(THREAD_SIZE)))
+__attribute__((section(".data..init_task"), aligned(THREAD_SIZE)))
= { INIT_THREAD_INFO(init_task) };
/* initial task structure */
diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
index aad0159..5a6714b 100644
--- a/arch/m68k/kernel/sun3-head.S
+++ b/arch/m68k/kernel/sun3-head.S
@@ -29,7 +29,7 @@ kernel_pmd_table: .skip 0x2000
.globl kernel_pg_dir
.equ kernel_pg_dir,kernel_pmd_table
- .section .text.head
+ .section .text..head
ENTRY(_stext)
ENTRY(_start)
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index f846d4e..35b6da8 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0x1000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -35,7 +35,7 @@ SECTIONS
}
. = ALIGN(16);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
.bss : { *(.bss) } /* BSS */
@@ -78,7 +78,7 @@ SECTIONS
. = ALIGN(8192);
__init_end = .;
- .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */
+ .data..init_task : { *(.data..init_task) } /* The initial task and kernel stack */
_end = . ;
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index d9368c0..e6ce561 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0xE002000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -70,7 +70,7 @@ __init_begin = .;
#endif
. = ALIGN(PAGE_SIZE);
__init_end = .;
- .data.init.task : { *(.data.init_task) }
+ .data..init.task : { *(.data..init_task) }
.bss : { *(.bss) } /* BSS */
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index fe282de..1ea36d6 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -36,6 +36,6 @@ EXPORT_SYMBOL(init_task);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index 69ba9b1..bdf9b1c 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -55,7 +55,7 @@ SECTIONS {
.romvec : {
__rom_start = . ;
_romvec = .;
- *(.data.initvect)
+ *(.data..initvect)
} > romvec
#endif
@@ -66,7 +66,7 @@ SECTIONS {
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
- *(.text.lock)
+ *(.text..lock)
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
@@ -148,7 +148,7 @@ SECTIONS {
_sdata = . ;
DATA_DATA
. = ALIGN(8192) ;
- *(.data.init_task)
+ *(.data..init_task)
_edata = . ;
} > DATA
diff --git a/arch/m68knommu/platform/68360/head-ram.S b/arch/m68knommu/platform/68360/head-ram.S
index 2ef0624..8eb94fb 100644
--- a/arch/m68knommu/platform/68360/head-ram.S
+++ b/arch/m68knommu/platform/68360/head-ram.S
@@ -280,7 +280,7 @@ _dprbase:
* and then overwritten as needed.
*/
-.section ".data.initvect","awx"
+.section ".data..initvect","awx"
.long RAMEND /* Reset: Initial Stack Pointer - 0. */
.long _start /* Reset: Initial Program Counter - 1. */
.long buserr /* Bus Error - 2. */
diff --git a/arch/m68knommu/platform/68360/head-rom.S b/arch/m68knommu/platform/68360/head-rom.S
index 62ecf41..97510e5 100644
--- a/arch/m68knommu/platform/68360/head-rom.S
+++ b/arch/m68knommu/platform/68360/head-rom.S
@@ -291,7 +291,7 @@ _dprbase:
* and then overwritten as needed.
*/
-.section ".data.initvect","awx"
+.section ".data..initvect","awx"
.long RAMEND /* Reset: Initial Stack Pointer - 0. */
.long _start /* Reset: Initial Program Counter - 1. */
.long buserr /* Bus Error - 2. */
diff --git a/arch/microblaze/kernel/init_task.c b/arch/microblaze/kernel/init_task.c
index 48eb9fb..70a23dc 100644
--- a/arch/microblaze/kernel/init_task.c
+++ b/arch/microblaze/kernel/init_task.c
@@ -22,7 +22,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"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
struct task_struct init_task = INIT_TASK(init_task);
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index 840385e..e332495 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -66,7 +66,7 @@ SECTIONS {
*(.data)
}
. = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
_edata = . ;
/* Reserve some low RAM for r0 based memory references */
@@ -76,7 +76,7 @@ SECTIONS {
/* The initial task */
. = ALIGN(8192);
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
. = ALIGN(8);
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index 149cd91..acb71af 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -26,7 +26,7 @@ EXPORT_SYMBOL(init_mm);
* The things we do for performance..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"),
+ __attribute__((__section__(".data..init_task"),
__aligned__(THREAD_SIZE))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 58738c8..6b302c7 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -77,7 +77,7 @@ SECTIONS
* object file alignment. Using 32768
*/
. = ALIGN(_PAGE_SIZE);
- *(.data.init_task)
+ *(.data..init_task)
DATA_DATA
CONSTRUCTORS
@@ -99,14 +99,14 @@ SECTIONS
. = ALIGN(_PAGE_SIZE);
.data_nosave : {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(_PAGE_SIZE);
__nosave_end = .;
. = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
_edata = .; /* End of data section */
diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S
index efb95f2..e0ecda9 100644
--- a/arch/mips/lasat/image/head.S
+++ b/arch/mips/lasat/image/head.S
@@ -1,7 +1,7 @@
#include <asm/lasat/head.h>
.text
- .section .text.start, "ax"
+ .section .text..start, "ax"
.set noreorder
.set mips3
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal
index 988f8ad..0864c96 100644
--- a/arch/mips/lasat/image/romscript.normal
+++ b/arch/mips/lasat/image/romscript.normal
@@ -4,7 +4,7 @@ SECTIONS
{
.text :
{
- *(.text.start)
+ *(.text..start)
}
/* Data in ROM */
diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S
index 8a8309f..3330c43 100644
--- a/arch/mn10300/kernel/head.S
+++ b/arch/mn10300/kernel/head.S
@@ -19,7 +19,7 @@
#include <asm/param.h>
#include <unit/serial.h>
- .section .text.head,"ax"
+ .section .text..head,"ax"
###############################################################################
#
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index 5ac3566..599840f 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -31,7 +31,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index b825966..938792a 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -28,7 +28,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.text : {
*(
- .text.head
+ .text..head
.text
)
TEXT_TEXT
@@ -58,25 +58,25 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
- .data_nosave : { *(.data.nosave) }
+ .data_nosave : { *(.data..nosave) }
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : { *(.data.idt) }
+ .data..page_aligned : { *(.data..idt) }
. = ALIGN(32);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+ .data..cacheline_aligned : { *(.data..cacheline_aligned) }
/* rarely changed data like cpu maps */
. = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly)) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly)) {
+ *(.data..read_mostly)
_edata = .; /* End of data section */
}
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* might get freed after init */
. = ALIGN(PAGE_SIZE);
@@ -134,7 +134,7 @@ SECTIONS
__bss_start = .; /* BSS */
.bss : {
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
}
. = ALIGN(4);
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 32c2cca..45effe6 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -28,7 +28,7 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
void parisc_cache_init(void); /* initializes cache-flushing */
void disable_sr_hashing_asm(int); /* low level support for above */
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index ee80c92..7ccaf29 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -174,7 +174,7 @@ static inline void set_eiem(unsigned long val)
})
#ifdef CONFIG_SMP
-# define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
+# define __lock_aligned __attribute__((__section__(".data..lock_aligned")))
#endif
#define arch_align_stack(x) (x)
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0e3d9f9..4dbdf0e 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -345,7 +345,7 @@ smp_slave_stext:
ENDPROC(stext)
#ifndef CONFIG_64BIT
- .section .data.read_mostly
+ .section .data..read_mostly
.align 4
.export $global$,data
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 1e25a45..14394c0 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
+ __attribute__((aligned(128))) __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
#if PT_NLEVELS == 3
@@ -57,11 +57,11 @@ union thread_union init_thread_union
* 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 fd2cc4f..9f5184f 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -96,8 +96,8 @@ SECTIONS
/* rarely changed data like cpu maps */
. = ALIGN(16);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
. = ALIGN(L1_CACHE_BYTES);
@@ -108,14 +108,14 @@ SECTIONS
}
. = ALIGN(L1_CACHE_BYTES);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN(16);
- .data.lock_aligned : {
- *(.data.lock_aligned)
+ .data..lock_aligned : {
+ *(.data..lock_aligned)
}
/* nosave data is really only used for software suspend...it's here
@@ -124,7 +124,7 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
.data_nosave : {
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -136,10 +136,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)
@@ -151,8 +151,8 @@ SECTIONS
/* assembler code expects init_task to be 16k aligned */
. = ALIGN(16384);
/* init_task */
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
#ifdef CONFIG_64BIT
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 81de6eb..3f41ab9 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -38,7 +38,7 @@ extern struct ppc64_caches ppc64_caches;
#endif /* __powerpc64__ && ! __ASSEMBLY__ */
#if !defined(__ASSEMBLY__)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 043bfdf..2307910 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -157,7 +157,7 @@ do { \
#else
#define __page_aligned \
__attribute__((__aligned__(PAGE_SIZE), \
- __section__(".data.page_aligned")))
+ __section__(".data..page_aligned")))
#endif
#define VM_DATA_DEFAULT_FLAGS \
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index f59a666..676ed60 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -189,7 +189,7 @@ name: \
GLUE(.,name):
#define _INIT_GLOBAL(name) \
- .section ".text.init.refok"; \
+ .section ".text..init.refok"; \
.align 2 ; \
.globl name; \
.globl GLUE(.,name); \
@@ -229,7 +229,7 @@ name: \
GLUE(.,name):
#define _INIT_STATIC(name) \
- .section ".text.init.refok"; \
+ .section ".text..init.refok"; \
.align 2 ; \
.section ".opd","aw"; \
name: \
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 54e68c1..5ce5dfa 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -50,7 +50,7 @@
mtspr SPRN_DBAT##n##L,RB; \
1:
- .section .text.head, "ax"
+ .section .text..head, "ax"
.stabs "arch/powerpc/kernel/",N_SO,0,0,0f
.stabs "head_32.S",N_SO,0,0,0f
0:
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 56d8e5d..de69ecd 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -52,7 +52,7 @@
*
* This is all going to change RSN when we add bi_recs....... -- Dan
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index b56fecc..ab0b339 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -50,7 +50,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3c9452d..f6d1e67 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -38,7 +38,7 @@
#else
#define DO_8xx_CPU6(val, reg)
#endif
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4c22620..123bfec 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -53,7 +53,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ .section .text..head, "ax"
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 688b329..1162c3c 100644
--- a/arch/powerpc/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
@@ -21,7 +21,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 49e705f..815a13c 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -250,7 +250,7 @@ static void kexec_prepare_cpus(void)
* current, but that audit has not been performed.
*/
static union thread_union kexec_stack
- __attribute__((__section__(".data.init_task"))) = { };
+ __attribute__((__section__(".data..init_task"))) = { };
/* Our assembly helper, in kexec_stub.S */
extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ad06d5c..6685af8 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -74,7 +74,7 @@ static int vdso_ready;
static union {
struct vdso_data data;
u8 page[PAGE_SIZE];
-} vdso_data_store __attribute__((__section__(".data.page_aligned")));
+} vdso_data_store __attribute__((__section__(".data..page_aligned")));
struct vdso_data *vdso_data = &vdso_data_store.data;
/* Format of the patch table */
diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
index 556f0ca..10f61ac 100644
--- a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
+++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso32_start, vdso32_end
.balign PAGE_SIZE
diff --git a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
index 0529cb9..3c1cc59 100644
--- a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
+++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso64_start, vdso64_end
.balign PAGE_SIZE
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b9ef164..cedaad0 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -52,9 +52,9 @@ SECTIONS
/* Text and gots */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
ALIGN_FUNCTION();
- *(.text.head)
+ *(.text..head)
_text = .;
- *(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
+ *(.text .fixup .text..init.refok .text..exit.refok __ftr_alt_*)
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
@@ -254,28 +254,28 @@ SECTIONS
#else
. = ALIGN(16384);
#endif
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- *(.data.init_task)
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
+ *(.data..init_task)
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- *(.data.page_aligned)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
+ *(.data..page_aligned)
}
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
+ *(.data..cacheline_aligned)
}
. = ALIGN(L1_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
}
. = ALIGN(PAGE_SIZE);
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
}
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h
index 9b86681..24aafa6 100644
--- a/arch/s390/include/asm/cache.h
+++ b/arch/s390/include/asm/cache.h
@@ -14,6 +14,6 @@
#define L1_CACHE_BYTES 256
#define L1_CACHE_SHIFT 8
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#endif
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index bba1449..e899eda 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -35,7 +35,7 @@
#define ARCH_OFFSET 0
#endif
-.section ".text.head","ax"
+.section ".text..head","ax"
#ifndef CONFIG_IPL
.org 0
.long 0x00080000,0x80000000+startup # Just a restart PSW
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index 7db95c0..7cfd9af 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -30,7 +30,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 89b2e7f..e4c0609 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -64,7 +64,7 @@ __setup("vdso=", vdso_setup);
static union {
struct vdso_data data;
u8 page[PAGE_SIZE];
-} vdso_data_store __attribute__((__section__(".data.page_aligned")));
+} vdso_data_store __attribute__((__section__(".data..page_aligned")));
struct vdso_data *vdso_data = &vdso_data_store.data;
/*
diff --git a/arch/s390/kernel/vdso32/vdso32_wrapper.S b/arch/s390/kernel/vdso32/vdso32_wrapper.S
index 61639a8..025cb77 100644
--- a/arch/s390/kernel/vdso32/vdso32_wrapper.S
+++ b/arch/s390/kernel/vdso32/vdso32_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso32_start, vdso32_end
.balign PAGE_SIZE
diff --git a/arch/s390/kernel/vdso64/vdso64_wrapper.S b/arch/s390/kernel/vdso64/vdso64_wrapper.S
index d8e2ac1..d26126d 100644
--- a/arch/s390/kernel/vdso64/vdso64_wrapper.S
+++ b/arch/s390/kernel/vdso64/vdso64_wrapper.S
@@ -1,7 +1,7 @@
#include <linux/init.h>
#include <asm/page.h>
- .section ".data.page_aligned"
+ .section ".data..page_aligned"
.globl vdso64_start, vdso64_end
.balign PAGE_SIZE
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 7a2063e..c1f97b1 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -29,7 +29,7 @@ SECTIONS
. = 0x00000000;
.text : {
_text = .; /* Text and read-only data */
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -66,30 +66,30 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
.data_nosave : {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
}
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : {
- *(.data.idt)
+ .data..page_aligned : {
+ *(.data..idt)
}
. = ALIGN(0x100);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
. = ALIGN(0x100);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
_edata = .; /* End of data section */
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
/* will be freed after init */
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h
index 02df18e..455a9a9 100644
--- a/arch/sh/include/asm/cache.h
+++ b/arch/sh/include/asm/cache.h
@@ -14,7 +14,7 @@
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifndef __ASSEMBLY__
struct cache_info {
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index e640c63..433de32 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -2058,10 +2058,10 @@ asm_uaccess_end:
/*
- * --- .text.init Section
+ * --- .text..init Section
*/
- .section .text.init, "ax"
+ .section .text..init, "ax"
/*
* void trap_init (void)
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 788605f..4065946 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -40,7 +40,7 @@ ENTRY(empty_zero_page)
1:
.skip PAGE_SIZE - empty_zero_page - 1b
- .section .text.head, "ax"
+ .section .text..head, "ax"
/*
* Condition at the entry of _stext:
diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
index 7ccfb99..c3543d1 100644
--- a/arch/sh/kernel/head_64.S
+++ b/arch/sh/kernel/head_64.S
@@ -110,7 +110,7 @@ empty_bad_pte_table:
fpu_in_use: .quad 0
- .section .text.head, "ax"
+ .section .text..head, "ax"
.balign L1_CACHE_BYTES
/*
* Condition at the entry of __stext:
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index 80c35ff..af29479 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -21,7 +21,7 @@ EXPORT_SYMBOL(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 3f1372e..63cd9a0 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -158,10 +158,10 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
#ifdef CONFIG_IRQSTACKS
static char softirq_stack[NR_CPUS * THREAD_SIZE]
- __attribute__((__section__(".bss.page_aligned")));
+ __attribute__((__section__(".bss..page_aligned")));
static char hardirq_stack[NR_CPUS * THREAD_SIZE]
- __attribute__((__section__(".bss.page_aligned")));
+ __attribute__((__section__(".bss..page_aligned")));
/*
* allocate per-cpu stacks for hardirq and for softirq processing
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index d0b2a71..a7b1be0 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -31,7 +31,7 @@ SECTIONS
} = 0
.text : {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -61,19 +61,19 @@ SECTIONS
. = ALIGN(THREAD_SIZE);
.data : { /* Data */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.read_mostly)
+ *(.data..read_mostly)
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -131,7 +131,7 @@ SECTIONS
.bss : {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
index 33fa464..c7d5f5b 100644
--- a/arch/sh/kernel/vmlinux_64.lds.S
+++ b/arch/sh/kernel/vmlinux_64.lds.S
@@ -42,7 +42,7 @@ SECTIONS
} = 0
.text : C_PHYS(.text) {
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
*(.text64)
*(.text..SHmedia32)
@@ -70,19 +70,19 @@ SECTIONS
. = ALIGN(THREAD_SIZE);
.data : C_PHYS(.data) { /* Data */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
. = ALIGN(L1_CACHE_BYTES);
- *(.data.read_mostly)
+ *(.data..read_mostly)
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -140,7 +140,7 @@ SECTIONS
.bss : C_PHYS(.bss) {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c
index 52a4208..e899f2a 100644
--- a/arch/sparc/boot/btfixupprep.c
+++ b/arch/sparc/boot/btfixupprep.c
@@ -171,7 +171,7 @@ main1:
}
} else if (buffer[nbase+4] != '_')
continue;
- if (!strcmp (sect, ".text.exit"))
+ if (!strcmp (sect, ".text..exit"))
continue;
if (strcmp (sect, ".text") &&
strcmp (sect, ".init.text") &&
@@ -325,7 +325,7 @@ main1:
(*rr)->next = NULL;
}
printf("! Generated by btfixupprep. Do not edit.\n\n");
- printf("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n");
+ printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n");
printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n");
for (i = 0; i < last; i++) {
f = array + i;
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h
index 41f85ae..2909f0a 100644
--- a/arch/sparc/include/asm/cache.h
+++ b/arch/sparc/include/asm/cache.h
@@ -19,7 +19,7 @@
#define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifdef CONFIG_SPARC32
#include <asm/asi.h>
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index f0b4b51..0ca3dc5 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -72,7 +72,7 @@ sun4e_notsup:
.align 4
/* The Sparc trap table, bootloader gives us control at _start. */
- .section .text.head,"ax"
+ .section .text..head,"ax"
.globl start, _stext, _start, __stext
.globl trapbase
_start: /* danger danger */
@@ -735,7 +735,7 @@ go_to_highmem:
nop
/* The code above should be at beginning and we have to take care about
- * short jumps, as branching to .text.init section from .text is usually
+ * short jumps, as branching to .text..init section from .text is usually
* impossible */
__INIT
/* Acquire boot time privileged register values, this will help debugging.
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index 3a1b7bf..709353f 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -467,7 +467,7 @@ jump_to_sun4u_init:
jmpl %g2 + %g0, %g0
nop
- .section .text.init.refok
+ .section .text..init.refok
sun4u_init:
BRANCH_IF_SUN4V(g1, sun4v_init)
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index f28cb82..7f7a468 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -22,5 +22,5 @@ EXPORT_SYMBOL(init_task);
* in etrap.S which assumes it.
*/
union thread_union init_thread_union
- __attribute__((section (".data.init_task")))
+ __attribute__((section (".data..init_task")))
= { INIT_THREAD_INFO(init_task) };
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 7626708..66eddbe 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -41,7 +41,7 @@ SECTIONS
.text TEXTSTART :
{
_text = .;
- *(.text.head)
+ *(.text..head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -59,20 +59,20 @@ SECTIONS
*(.data1)
}
. = ALIGN(SMP_CACHE_BYTES);
- .data.cacheline_aligned : {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : {
+ *(.data..cacheline_aligned)
}
. = ALIGN(SMP_CACHE_BYTES);
- .data.read_mostly : {
- *(.data.read_mostly)
+ .data..read_mostly : {
+ *(.data..read_mostly)
}
/* End of data section */
_edata = .;
/* init_task */
. = ALIGN(THREAD_SIZE);
- .data.init_task : {
- *(.data.init_task)
+ .data..init_task : {
+ *(.data..init_task)
}
.fixup : {
__start___fixup = .;
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index cb02486..b623606 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -49,9 +49,9 @@
}
. = ALIGN(32);
- .data.percpu : {
+ .data..percpu : {
__per_cpu_start = . ;
- *(.data.percpu)
+ *(.data..percpu)
__per_cpu_end = . ;
}
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 9975e1a..a415658 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -97,9 +97,9 @@ SECTIONS
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(KERNEL_STACK_SIZE);
- *(.data.init_irqstack)
+ *(.data..init_irqstack)
DATA_DATA
*(.data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 806d381..eed073e 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -34,9 +34,9 @@ EXPORT_SYMBOL(init_task);
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
union thread_union cpu0_irqstack
- __attribute__((__section__(".data.init_irqstack"))) =
+ __attribute__((__section__(".data..init_irqstack"))) =
{ INIT_THREAD_INFO(init_task) };
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 11b8352..7b03348 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -53,9 +53,9 @@ SECTIONS
.data :
{
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
. = ALIGN(KERNEL_STACK_SIZE);
- *(.data.init_irqstack)
+ *(.data..init_irqstack)
DATA_DATA
*(.gnu.linkonce.d*)
CONSTRUCTORS
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 3a8a866..b755fb8 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -29,7 +29,7 @@
#include <asm/boot.h>
#include <asm/asm-offsets.h>
-.section ".text.head","ax",@progbits
+.section ".text..head","ax",@progbits
ENTRY(startup_32)
cld
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index ed4a829..779e06d 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -33,7 +33,7 @@
#include <asm/processor-flags.h>
#include <asm/asm-offsets.h>
-.section ".text.head"
+.section ".text..head"
.code32
ENTRY(startup_32)
cld
diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index 857e492..af8b9c5 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -559,7 +559,7 @@ static void emit_relocs(int as_text)
/* Print the relocations in a form suitable that
* gas will like.
*/
- printf(".section \".data.reloc\",\"a\"\n");
+ printf(".section \".data..reloc\",\"a\"\n");
printf(".balign 4\n");
for (i = 0; i < reloc_count; i++) {
printf("\t .long 0x%08lx\n", relocs[i]);
diff --git a/arch/x86/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux.scr
index f02382a..862d748 100644
--- a/arch/x86/boot/compressed/vmlinux.scr
+++ b/arch/x86/boot/compressed/vmlinux.scr
@@ -1,6 +1,6 @@
SECTIONS
{
- .rodata.compressed : {
+ .rodata..compressed : {
input_len = .;
LONG(input_data_end - input_data) input_data = .;
*(.data)
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds b/arch/x86/boot/compressed/vmlinux_32.lds
index bb3c483..d70318a 100644
--- a/arch/x86/boot/compressed/vmlinux_32.lds
+++ b/arch/x86/boot/compressed/vmlinux_32.lds
@@ -7,13 +7,13 @@ SECTIONS
* address 0.
*/
. = 0;
- .text.head : {
+ .text..head : {
_head = . ;
- *(.text.head)
+ *(.text..head)
_ehead = . ;
}
- .rodata.compressed : {
- *(.rodata.compressed)
+ .rodata..compressed : {
+ *(.rodata..compressed)
}
.text : {
_text = .; /* Text */
@@ -21,6 +21,10 @@ SECTIONS
*(.text.*)
_etext = . ;
}
+ .got : {
+ *(.got)
+ *(.got.*)
+ }
.rodata : {
_rodata = . ;
*(.rodata) /* read-only data */
@@ -40,4 +44,6 @@ SECTIONS
*(COMMON)
_end = . ;
}
+ /* Be bold, and discard everything not explicitly mentioned */
+ /DISCARD/ : { *(*) }
}
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux_64.lds
index bef1ac8..d3d1468 100644
--- a/arch/x86/boot/compressed/vmlinux_64.lds
+++ b/arch/x86/boot/compressed/vmlinux_64.lds
@@ -7,13 +7,13 @@ SECTIONS
* address 0.
*/
. = 0;
- .text.head : {
+ .text..head : {
_head = . ;
- *(.text.head)
+ *(.text..head)
_ehead = . ;
}
- .rodata.compressed : {
- *(.rodata.compressed)
+ .rodata..compressed : {
+ *(.rodata..compressed)
}
.text : {
_text = .; /* Text */
@@ -45,4 +45,6 @@ SECTIONS
. = . + 4096 * 6;
_ebss = .;
}
+ /* Be bold, and discard everything not explicitly mentioned */
+ /DISCARD/ : { *(*) }
}
diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h
index 5d367ca..6b94d49 100644
--- a/arch/x86/include/asm/cache.h
+++ b/arch/x86/include/asm/cache.h
@@ -5,7 +5,7 @@
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
#ifdef CONFIG_X86_VSMP
/* vSMP Internode cacheline shift */
@@ -13,7 +13,7 @@
#ifdef CONFIG_SMP
#define __cacheline_aligned_in_smp \
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \
- __attribute__((__section__(".data.page_aligned")))
+ __attribute__((__section__(".data..page_aligned")))
#endif
#endif
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 8ded418..13ab720 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -1,4 +1,4 @@
- .section .text.page_aligned
+ .section .text..page_aligned
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 3068388..4a4bfef 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -80,7 +80,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE)
* any particular GDT layout, because we load our own as soon as we
* can.
*/
-.section .text.head,"ax",@progbits
+.section .text..head,"ax",@progbits
ENTRY(startup_32)
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
us to not reload segments */
@@ -618,7 +618,7 @@ ENTRY(_stext)
/*
* BSS section
*/
-.section ".bss.page_aligned","wa"
+.section ".bss..page_aligned","wa"
.align PAGE_SIZE_asm
#ifdef CONFIG_X86_PAE
swapper_pg_pmd:
@@ -636,7 +636,7 @@ ENTRY(empty_zero_page)
* This starts the data section.
*/
#ifdef CONFIG_X86_PAE
-.section ".data.page_aligned","wa"
+.section ".data..page_aligned","wa"
/* Page-aligned for the benefit of paravirt? */
.align PAGE_SIZE_asm
ENTRY(swapper_pg_dir)
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 54b29bb..05b8013 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -41,7 +41,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map)
L3_START_KERNEL = pud_index(__START_KERNEL_map)
.text
- .section .text.head
+ .section .text..head
.code64
.globl startup_64
startup_64:
@@ -419,7 +419,7 @@ ENTRY(phys_base)
ENTRY(idt_table)
.skip IDT_ENTRIES * 16
- .section .bss.page_aligned, "aw", @nobits
+ .section .bss..page_aligned, "aw", @nobits
.align PAGE_SIZE
ENTRY(empty_zero_page)
.skip PAGE_SIZE
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index df3bf26..103b1c5 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -22,7 +22,7 @@ struct mm_struct init_mm = INIT_MM(init_mm);
* "init_task" linker map entry..
*/
union thread_union init_thread_union
- __attribute__((__section__(".data.init_task"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(init_task);
/*
* per-CPU TSS segments. Threads are completely 'soft' on Linux,
* no more per-task TSS's. The TSS size is kept cacheline-aligned
- * so they are allowed to end up in the .data.cacheline_aligned
+ * so they are allowed to end up in the .data..cacheline_aligned
* section. Since TSS's are completely CPU-local, we want them
* on exact cacheline boundaries, to eliminate cacheline ping-pong.
*/
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 3a97a4c..9548f29 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -407,7 +407,7 @@ void __init setup_per_cpu_areas(void)
#endif
#endif
/*
- * Up to this point, the boot CPU has been using .data.init
+ * Up to this point, the boot CPU has been using .data..init
* area. Reload any changed state for the boot CPU.
*/
if (cpu == boot_cpu_id)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a1d2883..2a88259 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -77,7 +77,7 @@ char ignore_fpu_irq;
* for this.
*/
gate_desc idt_table[256]
- __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };
+ __attribute__((__section__(".data..idt"))) = { { { { 0, 0 } } }, };
#endif
DECLARE_BITMAP(used_vectors, NR_VECTORS);
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 62ad500..5342ea8 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -31,15 +31,15 @@ SECTIONS
. = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
phys_startup_32 = startup_32 - LOAD_OFFSET;
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
+ .text..head : AT(ADDR(.text..head) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
- *(.text.head)
+ *(.text..head)
} :text = 0x9090
/* read-only */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */
- *(.text.page_aligned)
+ *(.text..page_aligned)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -71,32 +71,32 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
}
. = ALIGN(PAGE_SIZE);
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- *(.data.page_aligned)
- *(.data.idt)
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
+ *(.data..page_aligned)
+ *(.data..idt)
}
. = ALIGN(32);
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
- *(.data.cacheline_aligned)
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
+ *(.data..cacheline_aligned)
}
/* rarely changed data like cpu maps */
. = ALIGN(32);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
_edata = .; /* End of data section */
}
. = ALIGN(THREAD_SIZE); /* init_task */
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- *(.data.init_task)
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
+ *(.data..init_task)
}
/* might get freed after init */
@@ -185,7 +185,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__init_end = .;
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
. = ALIGN(4);
__bss_stop = .;
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index c874250..98016a2 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -32,7 +32,7 @@ SECTIONS
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
/* First the code that has to be first for bootstrapping */
- *(.text.head)
+ *(.text..head)
_stext = .;
/* Then the rest */
TEXT_TEXT
@@ -65,19 +65,19 @@ SECTIONS
} :data
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
. = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
}
. = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
+ .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) {
+ *(.data..read_mostly)
}
#define VSYSCALL_ADDR (-10*1024*1024)
-#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
-#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data..read_mostly) + SIZEOF(.data..read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_VIRT_ADDR ((ADDR(.data..read_mostly) + SIZEOF(.data..read_mostly) + 4095) & ~(4095))
#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
@@ -125,14 +125,14 @@ SECTIONS
#undef VVIRT_OFFSET
#undef VVIRT
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
+ .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) {
. = ALIGN(THREAD_SIZE); /* init_task */
- *(.data.init_task)
+ *(.data..init_task)
}:data.init
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
+ .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
+ *(.data..page_aligned)
}
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
@@ -236,7 +236,7 @@ SECTIONS
.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
- *(.data.nosave)
+ *(.data..nosave)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
} :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
@@ -244,7 +244,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
__bss_start = .; /* BSS */
- *(.bss.page_aligned)
+ *(.bss..page_aligned)
*(.bss)
__bss_stop = .;
}
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index 0817f9d..5e093b2 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -234,7 +234,7 @@ should_never_return:
* BSS section
*/
-.section ".bss.page_aligned", "w"
+.section ".bss..page_aligned", "w"
#ifdef CONFIG_MMU
ENTRY(swapper_pg_dir)
.fill PAGE_SIZE, 1, 0
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index e07f5c9..d07db9b 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -28,7 +28,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"))) =
+ __attribute__((__section__(".data..init_task"))) =
{ INIT_THREAD_INFO(init_task) };
struct task_struct init_task = INIT_TASK(init_task);
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index c1be9a4..4c1cfc9 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -124,14 +124,14 @@ SECTIONS
DATA_DATA
CONSTRUCTORS
. = ALIGN(XCHAL_ICACHE_LINESIZE);
- *(.data.cacheline_aligned)
+ *(.data..cacheline_aligned)
}
_edata = .;
/* The initial task */
. = ALIGN(8192);
- .data.init_task : { *(.data.init_task) }
+ .data..init_task : { *(.data..init_task) }
/* Initialization code and data: */
@@ -262,7 +262,7 @@ SECTIONS
/* BSS section */
_bss_start = .;
- .bss : { *(.bss.page_aligned) *(.bss) }
+ .bss : { *(.bss..page_aligned) *(.bss) }
_bss_end = .;
_end = .;
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d7d50d7..1ce7788 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -71,7 +71,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
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 7fa660f..37feab0 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -88,7 +88,7 @@
/* .data section */
#define DATA_DATA \
*(.data) \
- *(.data.init.refok) \
+ *(.data..init.refok) \
*(.ref.data) \
DEV_KEEP(init.data) \
DEV_KEEP(exit.data) \
@@ -287,8 +287,8 @@
*(.text.hot) \
*(.text) \
*(.ref.text) \
- *(.text.init.refok) \
- *(.exit.text.refok) \
+ *(.text..init.refok) \
+ *(.text..exit.refok) \
DEV_KEEP(init.text) \
DEV_KEEP(exit.text) \
CPU_KEEP(init.text) \
@@ -475,16 +475,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
@@ -496,17 +496,17 @@
*
* 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/cache.h b/include/linux/cache.h
index 97e2488..4c57065 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -31,7 +31,7 @@
#ifndef __cacheline_aligned
#define __cacheline_aligned \
__attribute__((__aligned__(SMP_CACHE_BYTES), \
- __section__(".data.cacheline_aligned")))
+ __section__(".data..cacheline_aligned")))
#endif /* __cacheline_aligned */
#ifndef __cacheline_aligned_in_smp
diff --git a/include/linux/init.h b/include/linux/init.h
index f121a7a..60b1dd0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -62,9 +62,9 @@
/* backward compatibility note
* A few places hardcode the old section names:
- * .text.init.refok
- * .data.init.refok
- * .exit.text.refok
+ * .text..init.refok
+ * .data..init.refok
+ * .text..exit.refok
* They should be converted to use the defines from this file
*/
@@ -302,7 +302,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." */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..bddaee6 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -18,8 +18,8 @@
# define asmregparm
#endif
-#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE)
-#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
+#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
+#define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
/*
* This is used by architectures to keep arguments on the stack
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 252b245..1a67c69 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -60,7 +60,7 @@
/*
* Must define these before including other files, inline functions need them
*/
-#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
+#define LOCK_SECTION_NAME ".text..lock."KBUILD_BASENAME
#define LOCK_SECTION_START(extra) \
".subsection 1\n\t" \
diff --git a/kernel/module.c b/kernel/module.c
index e797812..4bec8c4 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -525,7 +525,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)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index df6e628..f39132b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -797,9 +797,9 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };
/* sections that may refer to an init/exit section with no warning */
static const char *initref_sections[] =
{
- ".text.init.refok*",
- ".exit.text.refok*",
- ".data.init.refok*",
+ ".text..init.refok*",
+ ".text..exit.refok*",
+ ".data..init.refok*",
NULL
};
@@ -918,7 +918,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* Pattern 0:
* Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
* The pattern is identified by:
- * fromsec = .text.init.refok* | .data.init.refok*
+ * fromsec = .text..init.refok* | .data..init.refok*
*
* Pattern 1:
* If a module parameter is declared __initdata and permissions=0
@@ -942,8 +942,8 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer
*
* Pattern 3:
- * Whitelist all refereces from .text.head to .init.data
- * Whitelist all refereces from .text.head to .init.text
+ * Whitelist all references from .text..head to .init.data
+ * Whitelist all references from .text..head to .init.text
*
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 409596e..a638a1c 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -26,7 +26,7 @@
# which will also be the location of that section after final link.
# e.g.
#
-# .section ".text.sched"
+# .section ".text..sched"
# .globl my_func
# my_func:
# [...]
@@ -39,7 +39,7 @@
# [...]
#
# Both relocation offsets for the mcounts in the above example will be
-# offset from .text.sched. If we make another file called tmp.s with:
+# offset from .text..sched. If we make another file called tmp.s with:
#
# .section __mcount_loc
# .quad my_func + 0x5
@@ -51,7 +51,7 @@
# But this gets hard if my_func is not globl (a static function).
# In such a case we have:
#
-# .section ".text.sched"
+# .section ".text..sched"
# my_func:
# [...]
# call mcount (offset: 0x5)
--
1.6.2.1
From: Denys Vlasenko <[email protected]>
This patch makes modpost able to process object files with more than
64k sections. Needed for huge kernel builds (allyesconfig, for example)
with -ffunction-sections.
Signed-off-by: Denys Vlasenko <[email protected]>
[[email protected]: updated for 2.6.29]
Signed-off-by: Anders Kaseorg <[email protected]>
---
scripts/mod/file2alias.c | 6 +-
scripts/mod/modpost.c | 94 ++++++++++++++++++++++++++++++++-------------
scripts/mod/modpost.h | 43 +++++++++++++++++++++
3 files changed, 113 insertions(+), 30 deletions(-)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a334428..49c669e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -761,16 +761,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
char *zeros = NULL;
/* We're looking for a section relative symbol */
- if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum)
+ if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
return;
/* Handle all-NULL symbols allocated into .bss */
- if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) {
+ if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
zeros = calloc(1, sym->st_size);
symval = zeros;
} else {
symval = (void *)info->hdr
- + info->sechdrs[sym->st_shndx].sh_offset
+ + info->sechdrs[get_secindex(info, sym)].sh_offset
+ sym->st_value;
}
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 3e6ff75..b963071 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -244,7 +244,7 @@ static enum export export_no(const char *s)
return export_unknown;
}
-static enum export export_from_sec(struct elf_info *elf, Elf_Section sec)
+static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
{
if (sec == elf->export_sec)
return export_plain;
@@ -364,6 +364,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
Elf_Ehdr *hdr;
Elf_Shdr *sechdrs;
Elf_Sym *sym;
+ const char *secstrings;
+ unsigned int symtab_idx = ~0U, symtab_shndx_idx = ~0U;
hdr = grab_file(filename, &info->size);
if (!hdr) {
@@ -400,8 +402,19 @@ static int parse_elf(struct elf_info *info, const char *filename)
return 0;
}
+ /* Fixups for more than 64k sections */
+ info->num_sections = hdr->e_shnum;
+ if (info->num_sections == 0) { /* more than 64k sections? */
+ /* doesn't need shndx2secindex() */
+ info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
+ }
+ info->secindex_strings = hdr->e_shstrndx;
+ if (info->secindex_strings == SHN_XINDEX)
+ info->secindex_strings =
+ shndx2secindex(TO_NATIVE(sechdrs[0].sh_link));
+
/* Fix endianness in section headers */
- for (i = 0; i < hdr->e_shnum; i++) {
+ for (i = 0; i < info->num_sections; i++) {
sechdrs[i].sh_type = TO_NATIVE(sechdrs[i].sh_type);
sechdrs[i].sh_offset = TO_NATIVE(sechdrs[i].sh_offset);
sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size);
@@ -411,9 +424,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
sechdrs[i].sh_addr = TO_NATIVE(sechdrs[i].sh_addr);
}
/* Find symbol table. */
- for (i = 1; i < hdr->e_shnum; i++) {
- const char *secstrings
- = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+ secstrings = (void *)hdr + sechdrs[info->secindex_strings].sh_offset;
+ for (i = 1; i < info->num_sections; i++) {
const char *secname;
int nobits = sechdrs[i].sh_type == SHT_NOBITS;
@@ -443,14 +455,24 @@ static int parse_elf(struct elf_info *info, const char *filename)
else if (strcmp(secname, "__markers_strings") == 0)
info->markers_strings_sec = i;
- if (sechdrs[i].sh_type != SHT_SYMTAB)
- continue;
+ if (sechdrs[i].sh_type == SHT_SYMTAB) {
+ symtab_idx = i;
+ info->symtab_start = (void *)hdr +
+ sechdrs[i].sh_offset;
+ info->symtab_stop = (void *)hdr +
+ sechdrs[i].sh_offset + sechdrs[i].sh_size;
+ info->strtab = (void *)hdr +
+ sechdrs[shndx2secindex(sechdrs[i].sh_link)].sh_offset;
+ }
- info->symtab_start = (void *)hdr + sechdrs[i].sh_offset;
- info->symtab_stop = (void *)hdr + sechdrs[i].sh_offset
- + sechdrs[i].sh_size;
- info->strtab = (void *)hdr +
- sechdrs[sechdrs[i].sh_link].sh_offset;
+ /* 32bit section no. table? ("more than 64k sections") */
+ if (sechdrs[i].sh_type == SHT_SYMTAB_SHNDX) {
+ symtab_shndx_idx = i;
+ info->symtab_shndx_start = (void *)hdr +
+ sechdrs[i].sh_offset;
+ info->symtab_shndx_stop = (void *)hdr +
+ sechdrs[i].sh_offset + sechdrs[i].sh_size;
+ }
}
if (!info->symtab_start)
fatal("%s has no symtab?\n", filename);
@@ -462,6 +484,21 @@ static int parse_elf(struct elf_info *info, const char *filename)
sym->st_value = TO_NATIVE(sym->st_value);
sym->st_size = TO_NATIVE(sym->st_size);
}
+
+ if (symtab_shndx_idx != ~0U) {
+ Elf32_Word *p;
+ if (symtab_idx !=
+ shndx2secindex(sechdrs[symtab_shndx_idx].sh_link))
+ fatal("%s: SYMTAB_SHNDX has bad sh_link: %u!=%u\n",
+ filename,
+ shndx2secindex(sechdrs[symtab_shndx_idx].sh_link),
+ symtab_idx);
+ /* Fix endianness */
+ for (p = info->symtab_shndx_start; p < info->symtab_shndx_stop;
+ p++)
+ *p = TO_NATIVE(*p);
+ }
+
return 1;
}
@@ -496,7 +533,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
Elf_Sym *sym, const char *symname)
{
unsigned int crc;
- enum export export = export_from_sec(info, sym->st_shndx);
+ enum export export = export_from_sec(info, get_secindex(info, sym));
switch (sym->st_shndx) {
case SHN_COMMON:
@@ -638,18 +675,18 @@ static const char *sym_name(struct elf_info *elf, Elf_Sym *sym)
return "(unknown)";
}
-static const char *sec_name(struct elf_info *elf, int shndx)
+static const char *sec_name(struct elf_info *elf, int secindex)
{
Elf_Shdr *sechdrs = elf->sechdrs;
return (void *)elf->hdr +
- elf->sechdrs[elf->hdr->e_shstrndx].sh_offset +
- sechdrs[shndx].sh_name;
+ elf->sechdrs[elf->secindex_strings].sh_offset +
+ sechdrs[secindex].sh_name;
}
static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr)
{
return (void *)elf->hdr +
- elf->sechdrs[elf->hdr->e_shstrndx].sh_offset +
+ elf->sechdrs[elf->secindex_strings].sh_offset +
sechdr->sh_name;
}
@@ -986,11 +1023,14 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
Elf_Sym *near = NULL;
Elf64_Sword distance = 20;
Elf64_Sword d;
+ unsigned int relsym_secindex;
if (relsym->st_name != 0)
return relsym;
+
+ relsym_secindex = get_secindex(elf, relsym);
for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) {
- if (sym->st_shndx != relsym->st_shndx)
+ if (get_secindex(elf, sym) != relsym_secindex)
continue;
if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
continue;
@@ -1052,9 +1092,9 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr,
for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) {
const char *symsec;
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
- symsec = sec_name(elf, sym->st_shndx);
+ symsec = sec_name(elf, get_secindex(elf, sym));
if (strcmp(symsec, sec) != 0)
continue;
if (!is_valid_name(elf, sym))
@@ -1251,7 +1291,7 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
const char *tosec;
enum mismatch mismatch;
- tosec = sec_name(elf, sym->st_shndx);
+ tosec = sec_name(elf, get_secindex(elf, sym));
mismatch = section_mismatch(fromsec, tosec);
if (mismatch != NO_MISMATCH) {
Elf_Sym *to;
@@ -1278,7 +1318,7 @@ static unsigned int *reloc_location(struct elf_info *elf,
Elf_Shdr *sechdr, Elf_Rela *r)
{
Elf_Shdr *sechdrs = elf->sechdrs;
- int section = sechdr->sh_info;
+ int section = shndx2secindex(sechdr->sh_info);
return (void *)elf->hdr + sechdrs[section].sh_offset +
(r->r_offset - sechdrs[section].sh_addr);
@@ -1386,7 +1426,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
r.r_addend = TO_NATIVE(rela->r_addend);
sym = elf->symtab_start + r_sym;
/* Skip special sections */
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
check_section_mismatch(modname, elf, &r, sym, fromsec);
}
@@ -1444,7 +1484,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
}
sym = elf->symtab_start + r_sym;
/* Skip special sections */
- if (sym->st_shndx >= SHN_LORESERVE)
+ if (is_shndx_special(sym->st_shndx))
continue;
check_section_mismatch(modname, elf, &r, sym, fromsec);
}
@@ -1469,7 +1509,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
Elf_Shdr *sechdrs = elf->sechdrs;
/* Walk through all sections */
- for (i = 0; i < elf->hdr->e_shnum; i++) {
+ for (i = 0; i < elf->num_sections; i++) {
check_section(modname, elf, &elf->sechdrs[i]);
/* We want to process only relocation sections and not .init */
if (sechdrs[i].sh_type == SHT_RELA)
@@ -1499,7 +1539,7 @@ static void get_markers(struct elf_info *info, struct module *mod)
n = 0;
for (sym = info->symtab_start; sym < info->symtab_stop; sym++)
if (ELF_ST_TYPE(sym->st_info) == STT_OBJECT &&
- sym->st_shndx == info->markers_strings_sec &&
+ get_secindex(info, sym) == info->markers_strings_sec &&
!strncmp(info->strtab + sym->st_name,
"__mstrtab_", sizeof "__mstrtab_" - 1)) {
if (first_sym == NULL)
@@ -1523,7 +1563,7 @@ static void get_markers(struct elf_info *info, struct module *mod)
n = 0;
for (sym = first_sym; sym <= last_sym; sym++)
if (ELF_ST_TYPE(sym->st_info) == STT_OBJECT &&
- sym->st_shndx == info->markers_strings_sec &&
+ get_secindex(info, sym) == info->markers_strings_sec &&
!strncmp(info->strtab + sym->st_name,
"__mstrtab_", sizeof "__mstrtab_" - 1)) {
const char *name = strings + sym->st_value;
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 09f58e3..dbde650 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -132,8 +132,51 @@ struct elf_info {
const char *strtab;
char *modinfo;
unsigned int modinfo_len;
+
+ /* support for 32bit section numbers */
+
+ unsigned int num_sections; /* max_secindex + 1 */
+ unsigned int secindex_strings;
+ /* if Nth symbol table entry has .st_shndx = SHN_XINDEX,
+ * take shndx from symtab_shndx_start[N] instead */
+ Elf32_Word *symtab_shndx_start;
+ Elf32_Word *symtab_shndx_stop;
};
+static inline int is_shndx_special(unsigned int i)
+{
+ return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;
+}
+
+/* shndx is in [0..SHN_LORESERVE) U (SHN_HIRESERVE, 0xfffffff], thus:
+ * shndx == 0 <=> sechdrs[0]
+ * ......
+ * shndx == SHN_LORESERVE-1 <=> sechdrs[SHN_LORESERVE-1]
+ * shndx == SHN_HIRESERVE+1 <=> sechdrs[SHN_LORESERVE]
+ * shndx == SHN_HIRESERVE+2 <=> sechdrs[SHN_LORESERVE+1]
+ * ......
+ * fyi: sym->st_shndx is uint16, SHN_LORESERVE = ff00, SHN_HIRESERVE = ffff,
+ * so basically we map 0000..feff -> 0000..feff
+ * ff00..ffff -> (you are a bad boy, dont do it)
+ * 10000..xxxx -> ff00..(xxxx-0x100)
+ */
+static inline unsigned int shndx2secindex(unsigned int i)
+{
+ if (i <= SHN_HIRESERVE)
+ return i;
+ return i - (SHN_HIRESERVE + 1 - SHN_LORESERVE);
+}
+
+/* Accessor for sym->st_shndx, hides ugliness of "64k sections" */
+static inline unsigned int get_secindex(const struct elf_info *info,
+ const Elf_Sym *sym)
+{
+ if (sym->st_shndx != SHN_XINDEX)
+ return sym->st_shndx;
+ return shndx2secindex(info->symtab_shndx_start[sym -
+ info->symtab_start]);
+}
+
/* file2alias.c */
extern unsigned int cross_build;
void handle_moddevtable(struct module *mod, struct elf_info *info,
--
1.6.2.1
On Thu, Apr 23, 2009 at 04:48:52PM -0400, Tim Abbott wrote:
> On Mon, 20 Apr 2009, Linus Torvalds wrote:
>
> > I'd be ok with merging it, but I haven't really gotten a strong feeling
> > that anybody is going to enable it or use it.
>
> Linus,
>
> Would you be willing to merge the first 3 patches in this patch series at
> this point? I'm resending these patches to resolve some conflicts that
> was recently introduced.
>
> To summarize the discussion, there are three uses for this code that have
> significant interest.
>
> One is decreasing the kernel size. Denys Vlasenko has numbers that using
> the linker's --gc-sections option (for which these patches are a
> prerequisite) saves 10% of the kernel size when CONFIG_MODULES=n, and 1%
> when CONFIG_MODULES=y. Paul Mundt thinks many embedded users would use
> this if it were available.
>
> A related use is cleaning up a lot of ifdefs that exist only to decrease
> the kernel size. Several developers commented favorably on the direction
> of using section garbage collection for dead code removal.
>
> Finally, Ksplice depends on the option added by this patch series.
>
> The first 3 patches in this patch series fix problems associated with
> using -ffunction-sections. As there are some architectures currently
> using -ffunction-sections, these should ideally be merged now, especially
> the first patch which involves scattered changes.
>
Given that this fixes issues with the existing in-tree users, it would
help to make them aware of this also.. added to the CC.
On Thu, Apr 23, 2009 at 04:49:32PM -0400, Tim Abbott wrote:
> The purpose of this patch is to make it possible to build the kernel
> with "gcc -ffunction-sections -fdata-sections". This is a key step
> towards being able to compile the kernel using the --gc-sections
> linker option, which can be used to decrease the vmlinux size by
> garbage collecting unused functions. Also, Ksplice's 'run-pre
> matching' process is much simpler if the original kernel was compiled
> with -ffunction-sections and -fdata-sections.
>
[snip]
> Signed-off-by: Tim Abbott <[email protected]>
> Signed-off-by: Anders Kaseorg <[email protected]>
As this is the only really invasive part of the patch, it would certainly
be good to see this merged early.
Acked-by: Paul Mundt <[email protected]>
Tim Abbott wrote:
> On Mon, 20 Apr 2009, Linus Torvalds wrote:
>
>> I'd be ok with merging it, but I haven't really gotten a strong feeling
>> that anybody is going to enable it or use it.
>
> Linus,
>
> Would you be willing to merge the first 3 patches in this patch series at
> this point? I'm resending these patches to resolve some conflicts that
> was recently introduced.
Hi Tim,
What would you think about posting these patches plus -ffunction-sections/
-fdata-sections patch to -mm tree, -tip tree, or -next tree as
"playable" Ksplice patchset?
If people use it and see it enough stable and useful, those patches
will be automatically pulled into linus kernel.
> To summarize the discussion, there are three uses for this code that have
> significant interest.
>
> One is decreasing the kernel size. Denys Vlasenko has numbers that using
> the linker's --gc-sections option (for which these patches are a
> prerequisite) saves 10% of the kernel size when CONFIG_MODULES=n, and 1%
> when CONFIG_MODULES=y. Paul Mundt thinks many embedded users would use
> this if it were available.
>
> A related use is cleaning up a lot of ifdefs that exist only to decrease
> the kernel size. Several developers commented favorably on the direction
> of using section garbage collection for dead code removal.
>
> Finally, Ksplice depends on the option added by this patch series.
>
> The first 3 patches in this patch series fix problems associated with
> using -ffunction-sections. As there are some architectures currently
> using -ffunction-sections, these should ideally be merged now, especially
> the first patch which involves scattered changes.
If there are actual problems on those arch, I think you'd better post
these patches as bugfixes with bug reports.
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: [email protected]
On Fri, 24 Apr 2009, Masami Hiramatsu wrote:
> What would you think about posting these patches plus -ffunction-sections/
> -fdata-sections patch to -mm tree, -tip tree, or -next tree as
> "playable" Ksplice patchset?
The section rename patch often merge conflicts with other changes. I
think that having it sit out in one of those trees for another release
would result in a lot of unnecessary work rebasing patches between that
tree and Linus' tree.
Once these -ffunction-sections support patches are merged, I intend to
post the rest of the Ksplice patchset for one of those trees.
> If there are actual problems on those arch, I think you'd better post
> these patches as bugfixes with bug reports.
These problems are all discussed in the commit messages of the relevant
patches.
One patch fixes modposting a kernel with more than 65536 ELF sections.
It is certainly possible to get this many with allyesconfig and
-ffunction-sections -fdata-sections.
Another fixes the issue that when you build with -ffunction-sections,
modpost will print a large number of spurious warnings when it sees
sections like .rodata.__func__.12345 which are generated by the __FUNC__
macro.
The patch with many scattered changes fixes the problem that with
-ffunction-sections -fdata-sections, a function named head gets put in the
".text.head" section, and your "static int percpu" ends up in the
".data.percpu" section and probably ends up being made percpu. This is a
potentially nasty problem.
-Tim Abbott
> ---
> Documentation/mutex-design.txt | 4 +-
> arch/alpha/kernel/head.S | 2 +-
...
> include/linux/linkage.h | 4 +-
> include/linux/spinlock.h | 2 +-
> kernel/module.c | 2 +-
> scripts/mod/modpost.c | 12 ++++----
> scripts/recordmcount.pl | 6 ++--
> 141 files changed, 356 insertions(+), 348 deletions(-)
This patch touches far too many files.
We should try to work out a method so we are in better control
of the section names, so renaming in the end is a simple patch
touching only a few files.
A few suggestions follows.
> diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
> index 7ac1f13..16293d4 100644
> --- a/arch/alpha/kernel/head.S
> +++ b/arch/alpha/kernel/head.S
> @@ -10,7 +10,7 @@
> #include <asm/system.h>
> #include <asm/asm-offsets.h>
>
> -.section .text.head, "ax"
> +.section .text..head, "ax"
Use __HEAD (from include/linux/init.h)
Same goes for all other uses of .text.head.
> .globl swapper_pg_dir
> .globl _stext
> swapper_pg_dir=SWAPPER_PGD
> diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
> index c2938e5..7929755 100644
> --- a/arch/alpha/kernel/init_task.c
> +++ b/arch/alpha/kernel/init_task.c
> @@ -17,5 +17,5 @@ EXPORT_SYMBOL(init_mm);
> EXPORT_SYMBOL(init_task);
>
> union thread_union init_thread_union
> - __attribute__((section(".data.init_thread")))
> + __attribute__((section(".data..init_thread")))
> = { INIT_THREAD_INFO(init_task) };
1) Either wait for the consolidation of init_tast or add a:
#define SECTION_INIT_THREAD __section(".data.init_thread")
to sched.h and use that one for all archs.
> diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
> index ef37fc1..511f8ca 100644
> --- a/arch/alpha/kernel/vmlinux.lds.S
> +++ b/arch/alpha/kernel/vmlinux.lds.S
> @@ -16,7 +16,7 @@ SECTIONS
>
> _text = .; /* Text and read-only data */
> .text : {
> - *(.text.head)
> + *(.text..head)
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
Use HEAD_TEXT (from include/asm-generic/vmlinux.lds.h)
> @@ -93,18 +93,18 @@ SECTIONS
> /* Freed after init ends here */
>
> /* Note 2 page alignment above. */
> - .data.init_thread : {
> - *(.data.init_thread)
> + .data..init_thread : {
> + *(.data..init_thread)
> }
Add something like:
#define DATA_THREAD(aling) \
...
to vmlinux.lds.h
>
> . = ALIGN(PAGE_SIZE);
> - .data.page_aligned : {
> - *(.data.page_aligned)
> + .data..page_aligned : {
> + *(.data..page_aligned)
> }
Add something like:
#define DATA_PAGE_ALIGNED() \
...
to vmlinux.lds.h
>
> . = ALIGN(64);
> - .data.cacheline_aligned : {
> - *(.data.cacheline_aligned)
> + .data..cacheline_aligned : {
> + *(.data..cacheline_aligned)
> }
Add something like:
#define DATA_CACHE_ALIGNED() \
...
to vmlinux.lds.h
>
> _data = .;
> diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
> index cc87e17..fcd93f5 100644
> --- a/arch/arm/kernel/head-nommu.S
> +++ b/arch/arm/kernel/head-nommu.S
> @@ -32,7 +32,7 @@
> * numbers for r1.
> *
> */
> - .section ".text.head", "ax"
> + .section ".text..head", "ax"
__HEAD
> ENTRY(stext)
> msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
> @ and irqs disabled
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index 21e17dc..705e759 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -74,7 +74,7 @@
> * crap here - that's what the boot loader (or in extreme, well justified
> * circumstances, zImage) is for.
> */
> - .section ".text.head", "ax"
> + .section ".text..head", "ax"
__HEAD
> ENTRY(stext)
> msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
> @ and irqs disabled
> diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
> index e859af3..0b81b8f 100644
> --- a/arch/arm/kernel/init_task.c
> +++ b/arch/arm/kernel/init_task.c
> @@ -29,7 +29,7 @@ EXPORT_SYMBOL(init_mm);
> * The things we do for performance..
> */
> union thread_union init_thread_union
> - __attribute__((__section__(".data.init_task"))) =
> + __attribute__((__section__(".data..init_task"))) =
> { INIT_THREAD_INFO(init_task) };
>
> /*
> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
> index c90f272..89c97c3 100644
> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -23,10 +23,10 @@ SECTIONS
> #else
> . = PAGE_OFFSET + TEXT_OFFSET;
> #endif
> - .text.head : {
> + .text..head : {
> _stext = .;
> _sinittext = .;
> - *(.text.head)
> + *(.text..head)
HEAD_TEXT
> }
>
> .init : { /* Init code and data */
> @@ -66,9 +66,9 @@ SECTIONS
> . = ALIGN(4096);
> __per_cpu_load = .;
> __per_cpu_start = .;
> - *(.data.percpu.page_aligned)
> - *(.data.percpu)
> - *(.data.percpu.shared_aligned)
> + *(.data..percpu.page_aligned)
> + *(.data..percpu)
> + *(.data..percpu.shared_aligned)
> __per_cpu_end = .;
PERCPU / PERCPU_VADDR
> #ifndef CONFIG_XIP_KERNEL
> __init_begin = _stext;
> @@ -146,7 +146,7 @@ SECTIONS
> * first, the init task union, aligned
> * to an 8192 byte boundary.
> */
> - *(.data.init_task)
> + *(.data..init_task)
>
> #ifdef CONFIG_XIP_KERNEL
> . = ALIGN(4096);
> @@ -158,7 +158,7 @@ SECTIONS
>
> . = ALIGN(4096);
> __nosave_begin = .;
> - *(.data.nosave)
> + *(.data..nosave)
> . = ALIGN(4096);
> __nosave_end = .;
Add whole bloce to a DATA_NOSAVE(align) in vmlinux.lds.h
>
> @@ -166,7 +166,7 @@ SECTIONS
> * then the cacheline aligned data
> */
> . = ALIGN(32);
> - *(.data.cacheline_aligned)
> + *(.data..cacheline_aligned)
>
> /*
> * The exception fixup table (might need resorting at runtime)
> diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
> index f0cc599..39d8dd1 100644
> --- a/arch/arm/mm/proc-v6.S
> +++ b/arch/arm/mm/proc-v6.S
> @@ -132,7 +132,7 @@ cpu_v6_name:
> .asciz "ARMv6-compatible processor"
> .align
>
> - .section ".text.init", #alloc, #execinstr
> + .section ".text..init", #alloc, #execinstr
Use __INIT (from init.h).
I will recommend that you do this in separate steps.
1) Is to define all the new sections to vmlinux.lds.h,
init.h and maybe other files.
To make this complete you need to go through several of the architectures.
If you have this ready soon we can push this upstream so the individual
architectures can apply their modifications.
So step 2 is to create individual patches for each architecture
and the remaining files. We can then carry this in -next until
we hit a merge window.
Until now this is pure cleanup.
The final step is to do the renaming in the few files that hold
the section definitions - it is a simple patch.
And then we can try out function-sections etc.
Sam
Tim Abbott wrote:
> On Fri, 24 Apr 2009, Masami Hiramatsu wrote:
>
>> What would you think about posting these patches plus -ffunction-sections/
>> -fdata-sections patch to -mm tree, -tip tree, or -next tree as
>> "playable" Ksplice patchset?
>
> The section rename patch often merge conflicts with other changes. I
> think that having it sit out in one of those trees for another release
> would result in a lot of unnecessary work rebasing patches between that
> tree and Linus' tree.
I think those are not unnecessary work, because those changes will also
be merged to linus tree in the future. Don't you think new feature
proposer should pay the cost for updating related works (or, obtaining
agreement of each developer for updating their patches)?
> Once these -ffunction-sections support patches are merged, I intend to
> post the rest of the Ksplice patchset for one of those trees.
Of course, but doesn't it need to be merged into linus tree?
>> If there are actual problems on those arch, I think you'd better post
>> these patches as bugfixes with bug reports.
>
> These problems are all discussed in the commit messages of the relevant
> patches.
>
> One patch fixes modposting a kernel with more than 65536 ELF sections.
> It is certainly possible to get this many with allyesconfig and
> -ffunction-sections -fdata-sections.
This will be reasonable bugfix for the arches which already use
-ffunction-sections -fdata-sections.
> Another fixes the issue that when you build with -ffunction-sections,
> modpost will print a large number of spurious warnings when it sees
> sections like .rodata.__func__.12345 which are generated by the __FUNC__
> macro.
Is that possible to change the patches to work if the kernel is compiled
with -ffunction-sections?
If so, no one will complain about those changes.
> The patch with many scattered changes fixes the problem that with
> -ffunction-sections -fdata-sections, a function named head gets put in the
> ".text.head" section, and your "static int percpu" ends up in the
> ".data.percpu" section and probably ends up being made percpu. This is a
> potentially nasty problem.
For this patch, I agree with Sam Ravnborg.
I think his suggestion is a good idea.
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: [email protected]
Signed-off-by: Tim Abbott <[email protected]>
Cc: Chris Zankel <[email protected]>
---
arch/xtensa/kernel/head.S | 3 ++-
arch/xtensa/kernel/vmlinux.lds.S | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index 0817f9d..d9ddc1b 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -19,6 +19,7 @@
#include <asm/page.h>
#include <asm/cacheasm.h>
+#include <linux/init.h>
#include <linux/linkage.h>
/*
@@ -45,7 +46,7 @@
* instruction.
*/
- .section .head.text, "ax"
+ __HEAD
.globl _start
_start: _j 2f
.align 4
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index c1be9a4..5accf51 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -85,8 +85,8 @@ SECTIONS
.text :
{
- /* The .head.text section must be the first section! */
- *(.head.text)
+ /* The HEAD_TEXT section must be the first section! */
+ HEAD_TEXT
*(.literal .text)
VMLINUX_SYMBOL(__sched_text_start) = .;
*(.sched.literal .sched.text)
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Hirokazu Takata <[email protected]>
---
arch/m32r/kernel/head.S | 2 +-
arch/m32r/kernel/vmlinux.lds.S | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S
index 9091606..0a71944 100644
--- a/arch/m32r/kernel/head.S
+++ b/arch/m32r/kernel/head.S
@@ -23,7 +23,7 @@ __INITDATA
/*
* References to members of the boot_cpu_data structure.
*/
-.section .text.head, "ax"
+__HEAD
.global start_kernel
.global __bss_start
.global _end
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 9db05df..4179adf 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.boot : { *(.boot) } = 0
.text : {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Russell King <[email protected]>
---
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/vmlinux.lds.S | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index cc87e17..4f10d1c 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
* numbers for r1.
*
*/
- .section ".text.head", "ax"
+ __HEAD
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 21e17dc..f1877a5 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
* crap here - that's what the boot loader (or in extreme, well justified
* circumstances, zImage) is for.
*/
- .section ".text.head", "ax"
+ __HEAD
ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@ and irqs disabled
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index c90f272..655fb75 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,10 +23,10 @@ SECTIONS
#else
. = PAGE_OFFSET + TEXT_OFFSET;
#endif
- .text.head : {
+ HEAD_TEXT_SECTION : {
_stext = .;
_sinittext = .;
- *(.text.head)
+ HEAD_TEXT
}
.init : { /* Init code and data */
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David S. Miller <[email protected]>
---
arch/sparc/kernel/head_32.S | 2 +-
arch/sparc/kernel/vmlinux.lds.S | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index f0b4b51..e91f01a 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -72,7 +72,7 @@ sun4e_notsup:
.align 4
/* The Sparc trap table, bootloader gives us control at _start. */
- .section .text.head,"ax"
+ __HEAD
.globl start, _stext, _start, __stext
.globl trapbase
_start: /* danger danger */
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index 7626708..fcbbd00 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -41,7 +41,7 @@ SECTIONS
.text TEXTSTART :
{
_text = .;
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
--
1.6.2.1
Using the HEAD_TEXT_SECTION macro in modpost requires including a few
more files from the linux headers.
The entry in head_sections[] ".head.text*" should be ".head.text",
since only that section name is actually used by any architectures. I
corrected this since preserving this over-broad pattern would have
involved some string concatination nastiness.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Rusty Russell <[email protected]>
---
scripts/mod/modpost.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index df6e628..f93645f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -16,6 +16,8 @@
#include <ctype.h>
#include "modpost.h"
#include "../../include/linux/license.h"
+#include "../../include/linux/section-names.h"
+#include "../../include/linux/stringify.h"
/* Are we using CONFIG_MODVERSIONS? */
int modversions = 0;
@@ -818,7 +820,7 @@ static const char *symbol_white_list[] =
NULL
};
-static const char *head_sections[] = { ".head.text*", NULL };
+static const char *head_sections[] = { __stringify(HEAD_TEXT_SECTION), NULL };
static const char *linker_symbols[] =
{ "__init_begin", "_sinittext", "_einittext", NULL };
@@ -942,8 +944,8 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer
*
* Pattern 3:
- * Whitelist all refereces from .text.head to .init.data
- * Whitelist all refereces from .text.head to .init.text
+ * Whitelist all refereces from HEAD_TEXT_SECTION to .init.data
+ * Whitelist all refereces from HEAD_TEXT_SECTION to .init.text
*
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David Howells <[email protected]>
---
arch/frv/kernel/head.S | 3 ++-
arch/frv/kernel/vmlinux.lds.S | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index fecf751..b825ef3 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -9,6 +9,7 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/init.h>
#include <linux/threads.h>
#include <linux/linkage.h>
#include <asm/thread_info.h>
@@ -27,7 +28,7 @@
# command line string
#
###############################################################################
- .section .text.head,"ax"
+ __HEAD
.balign 4
.globl _boot, __head_reference
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index b95c4ea..22d9787 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -26,7 +26,7 @@ SECTIONS
_sinittext = .;
.init.text : {
- *(.text.head)
+ HEAD_TEXT
#ifndef CONFIG_DEBUG_INFO
INIT_TEXT
EXIT_TEXT
--
1.6.2.1
On Fri, 24 Apr 2009, Sam Ravnborg wrote:
> This patch touches far too many files.
> We should try to work out a method so we are in better control
> of the section names, so renaming in the end is a simple patch
> touching only a few files.
OK, I'm now planning to implement this approach.
> > -.section .text.head, "ax"
> > +.section .text..head, "ax"
>
> Use __HEAD (from include/linux/init.h)
> Same goes for all other uses of .text.head.
I notice that __HEAD uses .head.text, while some architectures use
.text.head. It looks like this is just an inconsistency across
architectures that will be removed as a consequence of this cleanup work
(no architecture uses both .head.text and .text.head).
One challenge with this approach is that many linker scripts use these
section names in more complex ways than just squashing HEAD_TEXT at the
start of the text section. For example, the the linker scripts for x86
and ia64 have code like:
.text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
*(.text.head)
} :text = 0x9090
which can't user either the __HEAD macro (which is the full .section line)
or the HEAD_TEXT macro (which is the *(.head.text)). I think the right
way to solve this is to create a HEAD_TEXT_SECTION macro in a new header
(include/linux/section-names.h) and define everything else in terms of
that; these linker script blocks would then use HEAD_TEXT_SECTION when
necessary. The new header would grow to contain several other section
names used in both code and linker scripts as this work proceeds.
I'm sending with this a prototype patch series that replaces all
".head.text" and ".text.head" usage with these macros. Please review the
design, as I intend to implement this design for many other section names
in the near future.
-Tim Abbott
Tim Abbott (15):
Add new HEAD_TEXT_SECTION macro.
xtensa: convert to use __HEAD and HEAD_TEXT macros.
alpha: convert to use __HEAD and HEAD_TEXT macros.
frv: convert frv to use __HEAD and HEAD_TEXT macros.
arm: convert to use __HEAD and HEAD_TEXT macros.
ia64: convert to use __HEAD and HEAD_TEXT macros.
m32r: convert to use __HEAD and HEAD_TEXT macros.
m68k: convert to use __HEAD and HEAD_TEXT macros.
mn10300: convert to use __HEAD and HEAD_TEXT macros.
powerpc: convert to use __HEAD and HEAD_TEXT macros.
s390: convert to use __HEAD and HEAD_TEXT macros.
sh: convert to use __HEAD and HEAD_TEXT macros.
sparc: convert to use __HEAD and HEAD_TEXT macros.
x86: convert to use __HEAD and HEAD_TEXT macros.
modpost: convert modpost to use HEAD_TEXT_SECTION macro.
arch/alpha/kernel/head.S | 3 ++-
arch/alpha/kernel/vmlinux.lds.S | 2 +-
arch/arm/kernel/head-nommu.S | 2 +-
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/vmlinux.lds.S | 4 ++--
arch/frv/kernel/head.S | 3 ++-
arch/frv/kernel/vmlinux.lds.S | 2 +-
arch/ia64/kernel/head.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 4 ++--
arch/m32r/kernel/head.S | 2 +-
arch/m32r/kernel/vmlinux.lds.S | 2 +-
arch/m68k/kernel/head.S | 2 +-
arch/m68k/kernel/sun3-head.S | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 2 +-
arch/m68k/kernel/vmlinux-sun3.lds | 2 +-
arch/mn10300/kernel/head.S | 3 ++-
arch/mn10300/kernel/vmlinux.lds.S | 5 +----
arch/powerpc/kernel/head_32.S | 3 ++-
arch/powerpc/kernel/head_40x.S | 3 ++-
arch/powerpc/kernel/head_44x.S | 3 ++-
arch/powerpc/kernel/head_8xx.S | 3 ++-
arch/powerpc/kernel/head_fsl_booke.S | 3 ++-
arch/powerpc/kernel/vmlinux.lds.S | 2 +-
arch/s390/kernel/head.S | 3 ++-
arch/s390/kernel/vmlinux.lds.S | 4 ++--
arch/sh/kernel/head_32.S | 3 ++-
arch/sh/kernel/head_64.S | 5 ++++-
arch/sh/kernel/vmlinux_32.lds.S | 2 +-
arch/sh/kernel/vmlinux_64.lds.S | 2 +-
arch/sparc/kernel/head_32.S | 2 +-
arch/sparc/kernel/vmlinux.lds.S | 2 +-
arch/x86/boot/compressed/Makefile | 2 ++
arch/x86/boot/compressed/head_32.S | 3 ++-
arch/x86/boot/compressed/head_64.S | 3 ++-
.../{vmlinux_32.lds => vmlinux_32.lds.S} | 6 ++++--
.../{vmlinux_64.lds => vmlinux_64.lds.S} | 6 ++++--
arch/x86/kernel/head_32.S | 2 +-
arch/x86/kernel/head_64.S | 2 +-
arch/x86/kernel/vmlinux_32.lds.S | 4 ++--
arch/x86/kernel/vmlinux_64.lds.S | 2 +-
arch/xtensa/kernel/head.S | 3 ++-
arch/xtensa/kernel/vmlinux.lds.S | 4 ++--
include/asm-generic/vmlinux.lds.h | 4 +++-
include/linux/init.h | 4 +++-
include/linux/section-names.h | 6 ++++++
scripts/mod/modpost.c | 8 +++++---
46 files changed, 87 insertions(+), 56 deletions(-)
rename arch/x86/boot/compressed/{vmlinux_32.lds => vmlinux_32.lds.S} (89%)
rename arch/x86/boot/compressed/{vmlinux_64.lds => vmlinux_64.lds.S} (90%)
create mode 100644 include/linux/section-names.h
This patch is preparation for replacing all uses of ".head.text" or
".text.head" in the kernel with macros, so that the section name can
later be changed without having to touch a lot of the kernel.
Since some linker scripts do more complex things than referencing
HEAD_TEXT, we add a HEAD_TEXT_SECTION macro that just contains the
actual name.
I've defined HEAD_TEXT_SECTION in a new header,
include/linux/section-names.h, so that this section name only needs to
appear in one place. I anticipate creating similar macro structures
for a number of other section names.
The long-term goal here is to be able to change the kernel's magic
section names to those that are compatible with -ffunction-sections
-fdata-sections. This requires renaming all magic sections with names
of the form ".text.foo".
Signed-off-by: Tim Abbott <[email protected]>
---
include/asm-generic/vmlinux.lds.h | 4 +++-
include/linux/init.h | 4 +++-
include/linux/section-names.h | 6 ++++++
3 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 include/linux/section-names.h
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 7fa660f..eaa06ef 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -1,3 +1,5 @@
+#include <linux/section-names.h>
+
#ifndef LOAD_OFFSET
#define LOAD_OFFSET 0
#endif
@@ -331,7 +333,7 @@
#endif
/* Section used for early init (in .S files) */
-#define HEAD_TEXT *(.head.text)
+#define HEAD_TEXT *(HEAD_TEXT_SECTION)
/* init and exit section handling */
#define INIT_DATA \
diff --git a/include/linux/init.h b/include/linux/init.h
index f121a7a..20a1334 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -2,6 +2,8 @@
#define _LINUX_INIT_H
#include <linux/compiler.h>
+#include <linux/section-names.h>
+#include <linux/stringify.h>
/* These macros are used to mark some functions or
* initialized data (doesn't apply to uninitialized data)
@@ -107,7 +109,7 @@
#define __memexitconst __section(.memexit.rodata)
/* For assembly routines */
-#define __HEAD .section ".head.text","ax"
+#define __HEAD .section __stringify(HEAD_TEXT_SECTION),"ax"
#define __INIT .section ".init.text","ax"
#define __FINIT .previous
diff --git a/include/linux/section-names.h b/include/linux/section-names.h
new file mode 100644
index 0000000..c956f4e
--- /dev/null
+++ b/include/linux/section-names.h
@@ -0,0 +1,6 @@
+#ifndef __LINUX_SECTION_NAMES_H
+#define __LINUX_SECTION_NAMES_H
+
+#define HEAD_TEXT_SECTION .head.text
+
+#endif /* !__LINUX_SECTION_NAMES_H */
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Tony Luck <[email protected]>
---
arch/ia64/kernel/head.S | 2 +-
arch/ia64/kernel/vmlinux.lds.S | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 23f846d..a572160 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -181,7 +181,7 @@ swapper_pg_dir:
halt_msg:
stringz "Halting kernel\n"
- .section .text.head,"ax"
+ __HEAD
.global start_ap
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 4a95e86..a8b879e 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -51,8 +51,8 @@ SECTIONS
KPROBES_TEXT
*(.gnu.linkonce.t*)
}
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
- { *(.text.head) }
+ HEAD_TEXT_SECTION : AT(ADDR(HEAD_TEXT_SECTION) - LOAD_OFFSET)
+ { HEAD_TEXT }
.text2 : AT(ADDR(.text2) - LOAD_OFFSET)
{ *(.text2) }
#ifdef CONFIG_SMP
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Richard Henderson <[email protected]>
---
arch/alpha/kernel/head.S | 3 ++-
arch/alpha/kernel/vmlinux.lds.S | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
index 7ac1f13..4bdd1d2 100644
--- a/arch/alpha/kernel/head.S
+++ b/arch/alpha/kernel/head.S
@@ -7,10 +7,11 @@
* the kernel global pointer and jump to the kernel entry-point.
*/
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/asm-offsets.h>
-.section .text.head, "ax"
+__HEAD
.globl swapper_pg_dir
.globl _stext
swapper_pg_dir=SWAPPER_PGD
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index ef37fc1..b9d6568 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -16,7 +16,7 @@ SECTIONS
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Paul Mundt <[email protected]>
---
arch/sh/kernel/head_32.S | 3 ++-
arch/sh/kernel/head_64.S | 5 ++++-
arch/sh/kernel/vmlinux_32.lds.S | 2 +-
arch/sh/kernel/vmlinux_64.lds.S | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 788605f..a78be74 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -10,6 +10,7 @@
*
* Head.S contains the SH exception handlers and startup code.
*/
+#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/thread_info.h>
@@ -40,7 +41,7 @@ ENTRY(empty_zero_page)
1:
.skip PAGE_SIZE - empty_zero_page - 1b
- .section .text.head, "ax"
+ __HEAD
/*
* Condition at the entry of _stext:
diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
index 7ccfb99..3ea7658 100644
--- a/arch/sh/kernel/head_64.S
+++ b/arch/sh/kernel/head_64.S
@@ -8,6 +8,9 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
+
+#include <linux/init.h>
+
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/tlb.h>
@@ -110,7 +113,7 @@ empty_bad_pte_table:
fpu_in_use: .quad 0
- .section .text.head, "ax"
+ __HEAD
.balign L1_CACHE_BYTES
/*
* Condition at the entry of __stext:
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index d0b2a71..dd9b2ee 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -31,7 +31,7 @@ SECTIONS
} = 0
.text : {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
index 33fa464..6966446 100644
--- a/arch/sh/kernel/vmlinux_64.lds.S
+++ b/arch/sh/kernel/vmlinux_64.lds.S
@@ -42,7 +42,7 @@ SECTIONS
} = 0
.text : C_PHYS(.text) {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
*(.text64)
*(.text..SHmedia32)
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
---
arch/s390/kernel/head.S | 3 ++-
arch/s390/kernel/vmlinux.lds.S | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index bba1449..22596d7 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -23,6 +23,7 @@
*
*/
+#include <linux/init.h>
#include <asm/setup.h>
#include <asm/lowcore.h>
#include <asm/asm-offsets.h>
@@ -35,7 +36,7 @@
#define ARCH_OFFSET 0
#endif
-.section ".text.head","ax"
+__HEAD
#ifndef CONFIG_IPL
.org 0
.long 0x00080000,0x80000000+startup # Just a restart PSW
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 7a2063e..89399b8 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -29,8 +29,8 @@ SECTIONS
. = 0x00000000;
.text : {
_text = .; /* Text and read-only data */
- *(.text.head)
- TEXT_TEXT
+ HEAD_TEXT
+ TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Roman Zippel <[email protected]>
---
arch/m68k/kernel/head.S | 2 +-
arch/m68k/kernel/sun3-head.S | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 2 +-
arch/m68k/kernel/vmlinux-sun3.lds | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index f513f53..86edb5f 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -577,7 +577,7 @@ func_define putn,1
#endif
.endm
-.section ".text.head","ax"
+__HEAD
ENTRY(_stext)
/*
* Version numbers of the bootinfo interface
diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
index aad0159..9e5c3e5 100644
--- a/arch/m68k/kernel/sun3-head.S
+++ b/arch/m68k/kernel/sun3-head.S
@@ -29,7 +29,7 @@ kernel_pmd_table: .skip 0x2000
.globl kernel_pg_dir
.equ kernel_pg_dir,kernel_pmd_table
- .section .text.head
+ __HEAD
ENTRY(_stext)
ENTRY(_start)
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index f846d4e..01d212b 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0x1000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index d9368c0..c192f77 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -12,7 +12,7 @@ SECTIONS
. = 0xE002000;
_text = .; /* Text and read-only data */
.text : {
- *(.text.head)
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: David Howells <[email protected]>
---
arch/mn10300/kernel/head.S | 3 ++-
arch/mn10300/kernel/vmlinux.lds.S | 5 +----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S
index 8a8309f..14f27f3 100644
--- a/arch/mn10300/kernel/head.S
+++ b/arch/mn10300/kernel/head.S
@@ -9,6 +9,7 @@
* 2 of the Licence, or (at your option) any later version.
*/
+#include <linux/init.h>
#include <linux/threads.h>
#include <linux/linkage.h>
#include <linux/serial_reg.h>
@@ -19,7 +20,7 @@
#include <asm/param.h>
#include <unit/serial.h>
- .section .text.head,"ax"
+ __HEAD
###############################################################################
#
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index b825966..24de6b9 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -27,10 +27,7 @@ SECTIONS
_stext = .;
_text = .; /* Text and read-only data */
.text : {
- *(
- .text.head
- .text
- )
+ HEAD_TEXT
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/boot/compressed/Makefile | 2 +
arch/x86/boot/compressed/head_32.S | 3 +-
arch/x86/boot/compressed/head_64.S | 3 +-
arch/x86/boot/compressed/vmlinux_32.lds | 43 -------------------------
arch/x86/boot/compressed/vmlinux_32.lds.S | 45 ++++++++++++++++++++++++++
arch/x86/boot/compressed/vmlinux_64.lds | 48 ---------------------------
arch/x86/boot/compressed/vmlinux_64.lds.S | 50 +++++++++++++++++++++++++++++
arch/x86/kernel/head_32.S | 2 +-
arch/x86/kernel/head_64.S | 2 +-
arch/x86/kernel/vmlinux_32.lds.S | 4 +-
arch/x86/kernel/vmlinux_64.lds.S | 2 +-
11 files changed, 106 insertions(+), 98 deletions(-)
delete mode 100644 arch/x86/boot/compressed/vmlinux_32.lds
create mode 100644 arch/x86/boot/compressed/vmlinux_32.lds.S
delete mode 100644 arch/x86/boot/compressed/vmlinux_64.lds
create mode 100644 arch/x86/boot/compressed/vmlinux_64.lds.S
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 65551c9..617c939 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -19,6 +19,8 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
LDFLAGS := -m elf_$(UTS_MACHINE)
LDFLAGS_vmlinux := -T
+CPPFLAGS_vmlinux_$(BITS).lds += -P -U$(UTS_MACHINE)
+
$(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 3a8a866..a7c7a42 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -23,13 +23,14 @@
*/
.text
+#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
#include <asm/boot.h>
#include <asm/asm-offsets.h>
-.section ".text.head","ax",@progbits
+__HEAD
ENTRY(startup_32)
cld
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index ed4a829..a788a91 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -24,6 +24,7 @@
.code32
.text
+#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/pgtable_types.h>
@@ -33,7 +34,7 @@
#include <asm/processor-flags.h>
#include <asm/asm-offsets.h>
-.section ".text.head"
+__HEAD
.code32
ENTRY(startup_32)
cld
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds b/arch/x86/boot/compressed/vmlinux_32.lds
deleted file mode 100644
index bb3c483..0000000
--- a/arch/x86/boot/compressed/vmlinux_32.lds
+++ /dev/null
@@ -1,43 +0,0 @@
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
-ENTRY(startup_32)
-SECTIONS
-{
- /* Be careful parts of head_32.S assume startup_32 is at
- * address 0.
- */
- . = 0;
- .text.head : {
- _head = . ;
- *(.text.head)
- _ehead = . ;
- }
- .rodata.compressed : {
- *(.rodata.compressed)
- }
- .text : {
- _text = .; /* Text */
- *(.text)
- *(.text.*)
- _etext = . ;
- }
- .rodata : {
- _rodata = . ;
- *(.rodata) /* read-only data */
- *(.rodata.*)
- _erodata = . ;
- }
- .data : {
- _data = . ;
- *(.data)
- *(.data.*)
- _edata = . ;
- }
- .bss : {
- _bss = . ;
- *(.bss)
- *(.bss.*)
- *(COMMON)
- _end = . ;
- }
-}
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds.S b/arch/x86/boot/compressed/vmlinux_32.lds.S
new file mode 100644
index 0000000..73b3c58
--- /dev/null
+++ b/arch/x86/boot/compressed/vmlinux_32.lds.S
@@ -0,0 +1,45 @@
+#include <asm-generic/vmlinux.lds.h>
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(startup_32)
+SECTIONS
+{
+ /* Be careful parts of head_32.S assume startup_32 is at
+ * address 0.
+ */
+ . = 0;
+ HEAD_TEXT_SECTION : {
+ _head = . ;
+ HEAD_TEXT
+ _ehead = . ;
+ }
+ .rodata.compressed : {
+ *(.rodata.compressed)
+ }
+ .text : {
+ _text = .; /* Text */
+ *(.text)
+ *(.text.*)
+ _etext = . ;
+ }
+ .rodata : {
+ _rodata = . ;
+ *(.rodata) /* read-only data */
+ *(.rodata.*)
+ _erodata = . ;
+ }
+ .data : {
+ _data = . ;
+ *(.data)
+ *(.data.*)
+ _edata = . ;
+ }
+ .bss : {
+ _bss = . ;
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ _end = . ;
+ }
+}
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux_64.lds
deleted file mode 100644
index bef1ac8..0000000
--- a/arch/x86/boot/compressed/vmlinux_64.lds
+++ /dev/null
@@ -1,48 +0,0 @@
-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
-OUTPUT_ARCH(i386:x86-64)
-ENTRY(startup_64)
-SECTIONS
-{
- /* Be careful parts of head_64.S assume startup_32 is at
- * address 0.
- */
- . = 0;
- .text.head : {
- _head = . ;
- *(.text.head)
- _ehead = . ;
- }
- .rodata.compressed : {
- *(.rodata.compressed)
- }
- .text : {
- _text = .; /* Text */
- *(.text)
- *(.text.*)
- _etext = . ;
- }
- .rodata : {
- _rodata = . ;
- *(.rodata) /* read-only data */
- *(.rodata.*)
- _erodata = . ;
- }
- .data : {
- _data = . ;
- *(.data)
- *(.data.*)
- _edata = . ;
- }
- .bss : {
- _bss = . ;
- *(.bss)
- *(.bss.*)
- *(COMMON)
- . = ALIGN(8);
- _end_before_pgt = . ;
- . = ALIGN(4096);
- pgtable = . ;
- . = . + 4096 * 6;
- _ebss = .;
- }
-}
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds.S b/arch/x86/boot/compressed/vmlinux_64.lds.S
new file mode 100644
index 0000000..9235b15
--- /dev/null
+++ b/arch/x86/boot/compressed/vmlinux_64.lds.S
@@ -0,0 +1,50 @@
+#include <asm-generic/vmlinux.lds.h>
+
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
+ENTRY(startup_64)
+SECTIONS
+{
+ /* Be careful parts of head_64.S assume startup_32 is at
+ * address 0.
+ */
+ . = 0;
+ HEAD_TEXT_SECTION : {
+ _head = . ;
+ HEAD_TEXT
+ _ehead = . ;
+ }
+ .rodata.compressed : {
+ *(.rodata.compressed)
+ }
+ .text : {
+ _text = .; /* Text */
+ *(.text)
+ *(.text.*)
+ _etext = . ;
+ }
+ .rodata : {
+ _rodata = . ;
+ *(.rodata) /* read-only data */
+ *(.rodata.*)
+ _erodata = . ;
+ }
+ .data : {
+ _data = . ;
+ *(.data)
+ *(.data.*)
+ _edata = . ;
+ }
+ .bss : {
+ _bss = . ;
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ . = ALIGN(8);
+ _end_before_pgt = . ;
+ . = ALIGN(4096);
+ pgtable = . ;
+ . = . + 4096 * 6;
+ _ebss = .;
+ }
+}
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 3068388..a299ecc 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -80,7 +80,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE)
* any particular GDT layout, because we load our own as soon as we
* can.
*/
-.section .text.head,"ax",@progbits
+__HEAD
ENTRY(startup_32)
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
us to not reload segments */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 54b29bb..dbb6fb5 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -41,7 +41,7 @@ L4_START_KERNEL = pgd_index(__START_KERNEL_map)
L3_START_KERNEL = pud_index(__START_KERNEL_map)
.text
- .section .text.head
+ __HEAD
.code64
.globl startup_64
startup_64:
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 62ad500..2e364e7 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -31,9 +31,9 @@ SECTIONS
. = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
phys_startup_32 = startup_32 - LOAD_OFFSET;
- .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
+ HEAD_TEXT_SECTION : AT(ADDR(HEAD_TEXT_SECTION) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
- *(.text.head)
+ HEAD_TEXT
} :text = 0x9090
/* read-only */
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index c874250..2dcd7c9 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -32,7 +32,7 @@ SECTIONS
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
/* First the code that has to be first for bootstrapping */
- *(.text.head)
+ HEAD_TEXT
_stext = .;
/* Then the rest */
TEXT_TEXT
--
1.6.2.1
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text". Since this commit changes all
users in the architecture, this change should be harmless.
Signed-off-by: Tim Abbott <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
---
arch/powerpc/kernel/head_32.S | 3 ++-
arch/powerpc/kernel/head_40x.S | 3 ++-
arch/powerpc/kernel/head_44x.S | 3 ++-
arch/powerpc/kernel/head_8xx.S | 3 ++-
arch/powerpc/kernel/head_fsl_booke.S | 3 ++-
arch/powerpc/kernel/vmlinux.lds.S | 2 +-
6 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 54e68c1..c01467f 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -21,6 +21,7 @@
*
*/
+#include <linux/init.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -50,7 +51,7 @@
mtspr SPRN_DBAT##n##L,RB; \
1:
- .section .text.head, "ax"
+ __HEAD
.stabs "arch/powerpc/kernel/",N_SO,0,0,0f
.stabs "head_32.S",N_SO,0,0,0f
0:
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 56d8e5d..0c96911 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -31,6 +31,7 @@
*
*/
+#include <linux/init.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -52,7 +53,7 @@
*
* This is all going to change RSN when we add bi_recs....... -- Dan
*/
- .section .text.head, "ax"
+ __HEAD
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index b56fecc..18d8a16 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -28,6 +28,7 @@
* option) any later version.
*/
+#include <linux/init.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -50,7 +51,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ __HEAD
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3c9452d..52ff8c5 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -19,6 +19,7 @@
*
*/
+#include <linux/init.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -38,7 +39,7 @@
#else
#define DO_8xx_CPU6(val, reg)
#endif
- .section .text.head, "ax"
+ __HEAD
_ENTRY(_stext);
_ENTRY(_start);
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4c22620..5bdcc06 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -30,6 +30,7 @@
* option) any later version.
*/
+#include <linux/init.h>
#include <linux/threads.h>
#include <asm/processor.h>
#include <asm/page.h>
@@ -53,7 +54,7 @@
* r7 - End of kernel command line string
*
*/
- .section .text.head, "ax"
+ __HEAD
_ENTRY(_stext);
_ENTRY(_start);
/*
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b9ef164..d7425ff 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -52,7 +52,7 @@ SECTIONS
/* Text and gots */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
ALIGN_FUNCTION();
- *(.text.head)
+ HEAD_TEXT
_text = .;
*(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
SCHED_TEXT
--
1.6.2.1
On Sat, Apr 25, 2009 at 10:10:38PM -0400, Tim Abbott wrote:
> On Fri, 24 Apr 2009, Sam Ravnborg wrote:
>
> > This patch touches far too many files.
> > We should try to work out a method so we are in better control
> > of the section names, so renaming in the end is a simple patch
> > touching only a few files.
>
> OK, I'm now planning to implement this approach.
>
> > > -.section .text.head, "ax"
> > > +.section .text..head, "ax"
> >
> > Use __HEAD (from include/linux/init.h)
> > Same goes for all other uses of .text.head.
>
> I notice that __HEAD uses .head.text, while some architectures use
> .text.head. It looks like this is just an inconsistency across
> architectures that will be removed as a consequence of this cleanup work
> (no architecture uses both .head.text and .text.head).
>
The use of .text.head is quite intentional. See
f8657e1b55901e6c227094258d1fa3642fa242bd for starters. Most of the rest
of the platforms that switched did so for section mismatch avoidance
reasons, those that kept .head.text presumably did not hit these
mismatches or simply didn't care.
On Sat, Apr 25, 2009 at 10:10:38PM -0400, Tim Abbott wrote:
> On Fri, 24 Apr 2009, Sam Ravnborg wrote:
>
> > This patch touches far too many files.
> > We should try to work out a method so we are in better control
> > of the section names, so renaming in the end is a simple patch
> > touching only a few files.
>
> OK, I'm now planning to implement this approach.
>
> > > -.section .text.head, "ax"
> > > +.section .text..head, "ax"
> >
> > Use __HEAD (from include/linux/init.h)
> > Same goes for all other uses of .text.head.
>
> I notice that __HEAD uses .head.text, while some architectures use
> .text.head. It looks like this is just an inconsistency across
> architectures that will be removed as a consequence of this cleanup work
> (no architecture uses both .head.text and .text.head).
Correct - this is implied by the introduction of __HEAD.
For users of the old naming schme (like i386) you need to adjust the
linker script too.
> One challenge with this approach is that many linker scripts use these
> section names in more complex ways than just squashing HEAD_TEXT at the
> start of the text section. For example, the the linker scripts for x86
> and ia64 have code like:
>
> .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
> _text = .; /* Text and read-only data */
> *(.text.head)
> } :text = 0x9090
>
> which can't user either the __HEAD macro (which is the full .section line)
> or the HEAD_TEXT macro (which is the *(.head.text)).
The simple way to deal wi8th this is to accept some duplication of naming
in order to keep readability.
So I suggest you to use:
.head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {
_text = .; /* Text and read-only data */
HEAD_TEXT
} :text = 0x9090
We need to be carefull about keeping some sort of readability
of these linker macro files.
I was not specific in my last mail about this - but I assume you have
understood that the naming ".head.text" was selected so it is compatible
wiht -ffunction-sections. In other words no need for any ugly ".." here.
We should try to be as consistent as possible across architectures here
so it is better to toach a few additiona files rather than adding macros
and the like to accept there sub-optimal section naming.
Sam
On Sun, Apr 26, 2009 at 11:42:21AM +0900, Paul Mundt wrote:
> On Sat, Apr 25, 2009 at 10:10:38PM -0400, Tim Abbott wrote:
> > On Fri, 24 Apr 2009, Sam Ravnborg wrote:
> >
> > > This patch touches far too many files.
> > > We should try to work out a method so we are in better control
> > > of the section names, so renaming in the end is a simple patch
> > > touching only a few files.
> >
> > OK, I'm now planning to implement this approach.
> >
> > > > -.section .text.head, "ax"
> > > > +.section .text..head, "ax"
> > >
> > > Use __HEAD (from include/linux/init.h)
> > > Same goes for all other uses of .text.head.
> >
> > I notice that __HEAD uses .head.text, while some architectures use
> > .text.head. It looks like this is just an inconsistency across
> > architectures that will be removed as a consequence of this cleanup work
> > (no architecture uses both .head.text and .text.head).
> >
> The use of .text.head is quite intentional. See
> f8657e1b55901e6c227094258d1fa3642fa242bd for starters. Most of the rest
> of the platforms that switched did so for section mismatch avoidance
> reasons, those that kept .head.text presumably did not hit these
> mismatches or simply didn't care.
This is a mess that Tim's patches should clean up.
i386 should use .head.text - this is the 'correct' name for the head section.
And modpost does not accept ".text.head" anymore - thats cleaned up some time ago.
Sam
Looking at this I noticed a bug in a comment in modpost.
Sam
>From bece3302fa388ee643f8a6bc78463ac20a2f23bb Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sun, 26 Apr 2009 11:17:42 +0200
Subject: [PATCH] kbuild: fix comment in modpost.c
There is some confusion on naming of the head section.
Correct naming is .head.text.
Fix comment so we use correct naming.
Signed-off-by: Sam Ravnborg <[email protected]>
---
scripts/mod/modpost.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index c9a01ca..2fdf2bf 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -942,8 +942,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer
*
* Pattern 3:
- * Whitelist all refereces from .text.head to .init.data
- * Whitelist all refereces from .text.head to .init.text
+ * Whitelist all refereces from .head.text to any init section
*
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
--
1.6.0.2.GIT
On Sat, Apr 25, 2009 at 10:10:57PM -0400, Tim Abbott wrote:
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Chris Zankel <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/xtensa/kernel/head.S | 3 ++-
> arch/xtensa/kernel/vmlinux.lds.S | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
> index 0817f9d..d9ddc1b 100644
> --- a/arch/xtensa/kernel/head.S
> +++ b/arch/xtensa/kernel/head.S
> @@ -19,6 +19,7 @@
> #include <asm/page.h>
> #include <asm/cacheasm.h>
>
> +#include <linux/init.h>
> #include <linux/linkage.h>
>
> /*
> @@ -45,7 +46,7 @@
> * instruction.
> */
>
> - .section .head.text, "ax"
> + __HEAD
> .globl _start
> _start: _j 2f
> .align 4
> diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
> index c1be9a4..5accf51 100644
> --- a/arch/xtensa/kernel/vmlinux.lds.S
> +++ b/arch/xtensa/kernel/vmlinux.lds.S
> @@ -85,8 +85,8 @@ SECTIONS
>
> .text :
> {
> - /* The .head.text section must be the first section! */
> - *(.head.text)
> + /* The HEAD_TEXT section must be the first section! */
> + HEAD_TEXT
> *(.literal .text)
> VMLINUX_SYMBOL(__sched_text_start) = .;
> *(.sched.literal .sched.text)
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:10:58PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Richard Henderson <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/alpha/kernel/head.S | 3 ++-
> arch/alpha/kernel/vmlinux.lds.S | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
> index 7ac1f13..4bdd1d2 100644
> --- a/arch/alpha/kernel/head.S
> +++ b/arch/alpha/kernel/head.S
> @@ -7,10 +7,11 @@
> * the kernel global pointer and jump to the kernel entry-point.
> */
>
> +#include <linux/init.h>
> #include <asm/system.h>
> #include <asm/asm-offsets.h>
>
> -.section .text.head, "ax"
> +__HEAD
> .globl swapper_pg_dir
> .globl _stext
> swapper_pg_dir=SWAPPER_PGD
> diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
> index ef37fc1..b9d6568 100644
> --- a/arch/alpha/kernel/vmlinux.lds.S
> +++ b/arch/alpha/kernel/vmlinux.lds.S
> @@ -16,7 +16,7 @@ SECTIONS
>
> _text = .; /* Text and read-only data */
> .text : {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:10:59PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: David Howells <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/frv/kernel/head.S | 3 ++-
> arch/frv/kernel/vmlinux.lds.S | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
> index fecf751..b825ef3 100644
> --- a/arch/frv/kernel/head.S
> +++ b/arch/frv/kernel/head.S
> @@ -9,6 +9,7 @@
> * 2 of the License, or (at your option) any later version.
> */
>
> +#include <linux/init.h>
> #include <linux/threads.h>
> #include <linux/linkage.h>
> #include <asm/thread_info.h>
> @@ -27,7 +28,7 @@
> # command line string
> #
> ###############################################################################
> - .section .text.head,"ax"
> + __HEAD
> .balign 4
>
> .globl _boot, __head_reference
> diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
> index b95c4ea..22d9787 100644
> --- a/arch/frv/kernel/vmlinux.lds.S
> +++ b/arch/frv/kernel/vmlinux.lds.S
> @@ -26,7 +26,7 @@ SECTIONS
>
> _sinittext = .;
> .init.text : {
> - *(.text.head)
> + HEAD_TEXT
> #ifndef CONFIG_DEBUG_INFO
> INIT_TEXT
> EXIT_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:00PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Russell King <[email protected]>
> ---
> arch/arm/kernel/head-nommu.S | 2 +-
> arch/arm/kernel/head.S | 2 +-
> arch/arm/kernel/vmlinux.lds.S | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
> index cc87e17..4f10d1c 100644
> --- a/arch/arm/kernel/head-nommu.S
> +++ b/arch/arm/kernel/head-nommu.S
> @@ -32,7 +32,7 @@
> * numbers for r1.
> *
> */
> - .section ".text.head", "ax"
> + __HEAD
> ENTRY(stext)
> msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
> @ and irqs disabled
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index 21e17dc..f1877a5 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -74,7 +74,7 @@
> * crap here - that's what the boot loader (or in extreme, well justified
> * circumstances, zImage) is for.
> */
> - .section ".text.head", "ax"
> + __HEAD
> ENTRY(stext)
> msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
> @ and irqs disabled
> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
> index c90f272..655fb75 100644
> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -23,10 +23,10 @@ SECTIONS
> #else
> . = PAGE_OFFSET + TEXT_OFFSET;
> #endif
> - .text.head : {
> + HEAD_TEXT_SECTION : {
Spell it out direct rather than hiding the .head.text
behind a macro name here.
Sam
On Sat, Apr 25, 2009 at 10:11:01PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Tony Luck <[email protected]>
> ---
> arch/ia64/kernel/head.S | 2 +-
> arch/ia64/kernel/vmlinux.lds.S | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
> index 23f846d..a572160 100644
> --- a/arch/ia64/kernel/head.S
> +++ b/arch/ia64/kernel/head.S
> @@ -181,7 +181,7 @@ swapper_pg_dir:
> halt_msg:
> stringz "Halting kernel\n"
>
> - .section .text.head,"ax"
> + __HEAD
>
> .global start_ap
>
> diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
> index 4a95e86..a8b879e 100644
> --- a/arch/ia64/kernel/vmlinux.lds.S
> +++ b/arch/ia64/kernel/vmlinux.lds.S
> @@ -51,8 +51,8 @@ SECTIONS
> KPROBES_TEXT
> *(.gnu.linkonce.t*)
> }
> - .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
> - { *(.text.head) }
> + HEAD_TEXT_SECTION : AT(ADDR(HEAD_TEXT_SECTION) - LOAD_OFFSET)
> + { HEAD_TEXT }
1) Spell it out directly rahter than using a macro
2) Consider fixing the style when you are here anyway.
The 'correct' style is to use C rules for '{}' and indent.
But I guess you followed style of the file - which is ok.
Sam
On Sat, Apr 25, 2009 at 10:11:02PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Hirokazu Takata <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/m32r/kernel/head.S | 2 +-
> arch/m32r/kernel/vmlinux.lds.S | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S
> index 9091606..0a71944 100644
> --- a/arch/m32r/kernel/head.S
> +++ b/arch/m32r/kernel/head.S
> @@ -23,7 +23,7 @@ __INITDATA
> /*
> * References to members of the boot_cpu_data structure.
> */
> -.section .text.head, "ax"
> +__HEAD
> .global start_kernel
> .global __bss_start
> .global _end
> diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
> index 9db05df..4179adf 100644
> --- a/arch/m32r/kernel/vmlinux.lds.S
> +++ b/arch/m32r/kernel/vmlinux.lds.S
> @@ -27,7 +27,7 @@ SECTIONS
> _text = .; /* Text and read-only data */
> .boot : { *(.boot) } = 0
> .text : {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:03PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Geert Uytterhoeven <[email protected]>
> Cc: Roman Zippel <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/m68k/kernel/head.S | 2 +-
> arch/m68k/kernel/sun3-head.S | 2 +-
> arch/m68k/kernel/vmlinux-std.lds | 2 +-
> arch/m68k/kernel/vmlinux-sun3.lds | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
> index f513f53..86edb5f 100644
> --- a/arch/m68k/kernel/head.S
> +++ b/arch/m68k/kernel/head.S
> @@ -577,7 +577,7 @@ func_define putn,1
> #endif
> .endm
>
> -.section ".text.head","ax"
> +__HEAD
> ENTRY(_stext)
> /*
> * Version numbers of the bootinfo interface
> diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
> index aad0159..9e5c3e5 100644
> --- a/arch/m68k/kernel/sun3-head.S
> +++ b/arch/m68k/kernel/sun3-head.S
> @@ -29,7 +29,7 @@ kernel_pmd_table: .skip 0x2000
> .globl kernel_pg_dir
> .equ kernel_pg_dir,kernel_pmd_table
>
> - .section .text.head
> + __HEAD
> ENTRY(_stext)
> ENTRY(_start)
>
> diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
> index f846d4e..01d212b 100644
> --- a/arch/m68k/kernel/vmlinux-std.lds
> +++ b/arch/m68k/kernel/vmlinux-std.lds
> @@ -12,7 +12,7 @@ SECTIONS
> . = 0x1000;
> _text = .; /* Text and read-only data */
> .text : {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
> index d9368c0..c192f77 100644
> --- a/arch/m68k/kernel/vmlinux-sun3.lds
> +++ b/arch/m68k/kernel/vmlinux-sun3.lds
> @@ -12,7 +12,7 @@ SECTIONS
> . = 0xE002000;
> _text = .; /* Text and read-only data */
> .text : {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:04PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: David Howells <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/mn10300/kernel/head.S | 3 ++-
> arch/mn10300/kernel/vmlinux.lds.S | 5 +----
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/arch/mn10300/kernel/head.S b/arch/mn10300/kernel/head.S
> index 8a8309f..14f27f3 100644
> --- a/arch/mn10300/kernel/head.S
> +++ b/arch/mn10300/kernel/head.S
> @@ -9,6 +9,7 @@
> * 2 of the Licence, or (at your option) any later version.
> */
>
> +#include <linux/init.h>
> #include <linux/threads.h>
> #include <linux/linkage.h>
> #include <linux/serial_reg.h>
> @@ -19,7 +20,7 @@
> #include <asm/param.h>
> #include <unit/serial.h>
>
> - .section .text.head,"ax"
> + __HEAD
>
> ###############################################################################
> #
> diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
> index b825966..24de6b9 100644
> --- a/arch/mn10300/kernel/vmlinux.lds.S
> +++ b/arch/mn10300/kernel/vmlinux.lds.S
> @@ -27,10 +27,7 @@ SECTIONS
> _stext = .;
> _text = .; /* Text and read-only data */
> .text : {
> - *(
> - .text.head
> - .text
> - )
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:05PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/powerpc/kernel/head_32.S | 3 ++-
> arch/powerpc/kernel/head_40x.S | 3 ++-
> arch/powerpc/kernel/head_44x.S | 3 ++-
> arch/powerpc/kernel/head_8xx.S | 3 ++-
> arch/powerpc/kernel/head_fsl_booke.S | 3 ++-
> arch/powerpc/kernel/vmlinux.lds.S | 2 +-
> 6 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
> index 54e68c1..c01467f 100644
> --- a/arch/powerpc/kernel/head_32.S
> +++ b/arch/powerpc/kernel/head_32.S
> @@ -21,6 +21,7 @@
> *
> */
>
> +#include <linux/init.h>
> #include <asm/reg.h>
> #include <asm/page.h>
> #include <asm/mmu.h>
> @@ -50,7 +51,7 @@
> mtspr SPRN_DBAT##n##L,RB; \
> 1:
>
> - .section .text.head, "ax"
> + __HEAD
> .stabs "arch/powerpc/kernel/",N_SO,0,0,0f
> .stabs "head_32.S",N_SO,0,0,0f
> 0:
> diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
> index 56d8e5d..0c96911 100644
> --- a/arch/powerpc/kernel/head_40x.S
> +++ b/arch/powerpc/kernel/head_40x.S
> @@ -31,6 +31,7 @@
> *
> */
>
> +#include <linux/init.h>
> #include <asm/processor.h>
> #include <asm/page.h>
> #include <asm/mmu.h>
> @@ -52,7 +53,7 @@
> *
> * This is all going to change RSN when we add bi_recs....... -- Dan
> */
> - .section .text.head, "ax"
> + __HEAD
> _ENTRY(_stext);
> _ENTRY(_start);
>
> diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
> index b56fecc..18d8a16 100644
> --- a/arch/powerpc/kernel/head_44x.S
> +++ b/arch/powerpc/kernel/head_44x.S
> @@ -28,6 +28,7 @@
> * option) any later version.
> */
>
> +#include <linux/init.h>
> #include <asm/processor.h>
> #include <asm/page.h>
> #include <asm/mmu.h>
> @@ -50,7 +51,7 @@
> * r7 - End of kernel command line string
> *
> */
> - .section .text.head, "ax"
> + __HEAD
> _ENTRY(_stext);
> _ENTRY(_start);
> /*
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 3c9452d..52ff8c5 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -19,6 +19,7 @@
> *
> */
>
> +#include <linux/init.h>
> #include <asm/processor.h>
> #include <asm/page.h>
> #include <asm/mmu.h>
> @@ -38,7 +39,7 @@
> #else
> #define DO_8xx_CPU6(val, reg)
> #endif
> - .section .text.head, "ax"
> + __HEAD
> _ENTRY(_stext);
> _ENTRY(_start);
>
> diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
> index 4c22620..5bdcc06 100644
> --- a/arch/powerpc/kernel/head_fsl_booke.S
> +++ b/arch/powerpc/kernel/head_fsl_booke.S
> @@ -30,6 +30,7 @@
> * option) any later version.
> */
>
> +#include <linux/init.h>
> #include <linux/threads.h>
> #include <asm/processor.h>
> #include <asm/page.h>
> @@ -53,7 +54,7 @@
> * r7 - End of kernel command line string
> *
> */
> - .section .text.head, "ax"
> + __HEAD
> _ENTRY(_stext);
> _ENTRY(_start);
> /*
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index b9ef164..d7425ff 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -52,7 +52,7 @@ SECTIONS
> /* Text and gots */
> .text : AT(ADDR(.text) - LOAD_OFFSET) {
> ALIGN_FUNCTION();
> - *(.text.head)
> + HEAD_TEXT
> _text = .;
> *(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
> SCHED_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:06PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Martin Schwidefsky <[email protected]>
> Cc: Heiko Carstens <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/s390/kernel/head.S | 3 ++-
> arch/s390/kernel/vmlinux.lds.S | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
> index bba1449..22596d7 100644
> --- a/arch/s390/kernel/head.S
> +++ b/arch/s390/kernel/head.S
> @@ -23,6 +23,7 @@
> *
> */
>
> +#include <linux/init.h>
> #include <asm/setup.h>
> #include <asm/lowcore.h>
> #include <asm/asm-offsets.h>
> @@ -35,7 +36,7 @@
> #define ARCH_OFFSET 0
> #endif
>
> -.section ".text.head","ax"
> +__HEAD
> #ifndef CONFIG_IPL
> .org 0
> .long 0x00080000,0x80000000+startup # Just a restart PSW
> diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
> index 7a2063e..89399b8 100644
> --- a/arch/s390/kernel/vmlinux.lds.S
> +++ b/arch/s390/kernel/vmlinux.lds.S
> @@ -29,8 +29,8 @@ SECTIONS
> . = 0x00000000;
> .text : {
> _text = .; /* Text and read-only data */
> - *(.text.head)
> - TEXT_TEXT
> + HEAD_TEXT
> + TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> KPROBES_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:07PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Paul Mundt <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/sh/kernel/head_32.S | 3 ++-
> arch/sh/kernel/head_64.S | 5 ++++-
> arch/sh/kernel/vmlinux_32.lds.S | 2 +-
> arch/sh/kernel/vmlinux_64.lds.S | 2 +-
> 4 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
> index 788605f..a78be74 100644
> --- a/arch/sh/kernel/head_32.S
> +++ b/arch/sh/kernel/head_32.S
> @@ -10,6 +10,7 @@
> *
> * Head.S contains the SH exception handlers and startup code.
> */
> +#include <linux/init.h>
> #include <linux/linkage.h>
> #include <asm/thread_info.h>
>
> @@ -40,7 +41,7 @@ ENTRY(empty_zero_page)
> 1:
> .skip PAGE_SIZE - empty_zero_page - 1b
>
> - .section .text.head, "ax"
> + __HEAD
>
> /*
> * Condition at the entry of _stext:
> diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
> index 7ccfb99..3ea7658 100644
> --- a/arch/sh/kernel/head_64.S
> +++ b/arch/sh/kernel/head_64.S
> @@ -8,6 +8,9 @@
> * License. See the file "COPYING" in the main directory of this archive
> * for more details.
> */
> +
> +#include <linux/init.h>
> +
> #include <asm/page.h>
> #include <asm/cache.h>
> #include <asm/tlb.h>
> @@ -110,7 +113,7 @@ empty_bad_pte_table:
> fpu_in_use: .quad 0
>
>
> - .section .text.head, "ax"
> + __HEAD
> .balign L1_CACHE_BYTES
> /*
> * Condition at the entry of __stext:
> diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
> index d0b2a71..dd9b2ee 100644
> --- a/arch/sh/kernel/vmlinux_32.lds.S
> +++ b/arch/sh/kernel/vmlinux_32.lds.S
> @@ -31,7 +31,7 @@ SECTIONS
> } = 0
>
> .text : {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
> index 33fa464..6966446 100644
> --- a/arch/sh/kernel/vmlinux_64.lds.S
> +++ b/arch/sh/kernel/vmlinux_64.lds.S
> @@ -42,7 +42,7 @@ SECTIONS
> } = 0
>
> .text : C_PHYS(.text) {
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> *(.text64)
> *(.text..SHmedia32)
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:08PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: David S. Miller <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
> ---
> arch/sparc/kernel/head_32.S | 2 +-
> arch/sparc/kernel/vmlinux.lds.S | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
> index f0b4b51..e91f01a 100644
> --- a/arch/sparc/kernel/head_32.S
> +++ b/arch/sparc/kernel/head_32.S
> @@ -72,7 +72,7 @@ sun4e_notsup:
> .align 4
>
> /* The Sparc trap table, bootloader gives us control at _start. */
> - .section .text.head,"ax"
> + __HEAD
> .globl start, _stext, _start, __stext
> .globl trapbase
> _start: /* danger danger */
> diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
> index 7626708..fcbbd00 100644
> --- a/arch/sparc/kernel/vmlinux.lds.S
> +++ b/arch/sparc/kernel/vmlinux.lds.S
> @@ -41,7 +41,7 @@ SECTIONS
> .text TEXTSTART :
> {
> _text = .;
> - *(.text.head)
> + HEAD_TEXT
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
> --
> 1.6.2.1
>
On Sat, Apr 25, 2009 at 10:11:09PM -0400, Tim Abbott wrote:
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
>
> Signed-off-by: Tim Abbott <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: H. Peter Anvin <[email protected]>
> ---
> arch/x86/boot/compressed/Makefile | 2 +
> arch/x86/boot/compressed/head_32.S | 3 +-
> arch/x86/boot/compressed/head_64.S | 3 +-
> arch/x86/boot/compressed/vmlinux_32.lds | 43 -------------------------
> arch/x86/boot/compressed/vmlinux_32.lds.S | 45 ++++++++++++++++++++++++++
> arch/x86/boot/compressed/vmlinux_64.lds | 48 ---------------------------
> arch/x86/boot/compressed/vmlinux_64.lds.S | 50 +++++++++++++++++++++++++++++
> arch/x86/kernel/head_32.S | 2 +-
> arch/x86/kernel/head_64.S | 2 +-
> arch/x86/kernel/vmlinux_32.lds.S | 4 +-
> arch/x86/kernel/vmlinux_64.lds.S | 2 +-
> 11 files changed, 106 insertions(+), 98 deletions(-)
> delete mode 100644 arch/x86/boot/compressed/vmlinux_32.lds
> create mode 100644 arch/x86/boot/compressed/vmlinux_32.lds.S
> delete mode 100644 arch/x86/boot/compressed/vmlinux_64.lds
> create mode 100644 arch/x86/boot/compressed/vmlinux_64.lds.S
You should split this patch up in smaller pieces.
1) Rename from *lds to *.lds.S (and no other changes)
2) Introduce __HEAD & friends
And as before do not use HEAD_TEXT_SECTION
But otherwise it looks good. I will take a second look
when new patches are sent.
Sam
On Sat, Apr 25, 2009 at 10:11:10PM -0400, Tim Abbott wrote:
> Using the HEAD_TEXT_SECTION macro in modpost requires including a few
> more files from the linux headers.
>
> The entry in head_sections[] ".head.text*" should be ".head.text",
> since only that section name is actually used by any architectures. I
> corrected this since preserving this over-broad pattern would have
> involved some string concatination nastiness.
I have seen linkers that added a number after the section names
in certain situations. Often this is due to mix of sections
with different flags ("ax" versus no "ax").
This is the background for the wildcard.
With your patchset we should not see any such users - but we
should then warn if they showed up anyway if we do not silently
support them.
Sam
On Sat, 25 Apr 2009 02:53:58 am Sam Ravnborg wrote:
> > ---
> > Documentation/mutex-design.txt | 4 +-
> > arch/alpha/kernel/head.S | 2 +-
> ...
> > include/linux/linkage.h | 4 +-
> > include/linux/spinlock.h | 2 +-
> > kernel/module.c | 2 +-
> > scripts/mod/modpost.c | 12 ++++----
> > scripts/recordmcount.pl | 6 ++--
> > 141 files changed, 356 insertions(+), 348 deletions(-)
>
> This patch touches far too many files.
> We should try to work out a method so we are in better control
> of the section names, so renaming in the end is a simple patch
> touching only a few files.
Completely disagree. You'll end up touching all these files, and leaving
us with now-unnecessary a level of indirection. Also, you'll have performed
a giant pile of make-work, and bothered all the maintainers.
Just get Linus to apply the damn patch already; it's been sitting around too
long. Then do any cleanups which are actual cleanups.
Rusty.
On Sat, 25 Apr 2009, Tim Abbott wrote:
>
> This patch is preparation for replacing all uses of ".head.text" or
> ".text.head" in the kernel with macros, so that the section name can
> later be changed without having to touch a lot of the kernel.
I took the "trivially obvious" parts of this patch series - the ones that
were basically trivial one-liner cleanups (in addition to the first patch
that was needed for them, of course).
Anything that renamed files and did other infrastructure things (x86) or
that had vmlinux.lds.S files that didn't match the nice pattern I'd much
rather take as series of patches that first clean up the infrastructure
and then do the replacement.
Linus
On Sat, 25 Apr 2009, Tim Abbott wrote:
>
> This has the consequence of changing the section name use for head
> code from ".text.head" to ".head.text". Since this commit changes all
> users in the architecture, this change should be harmless.
Btw, this one really needs to unify the two lds files first. Look at
diff -u arch/x86/boot/compressed/vmlinux_*.lds
output and realize that they're basially exctly the same except for
trivial naming differences, and the fact that the64-bit version hs a
"pgtable" thing.
So this really needs to be done by first unifying the thing so that there
is _one_ arch/x86/boot/compressed/vmlinux.lds.S file with a preprocessor
that takes care of the trivial differences, and then after that, the
".text.init" games should just be removed.
Notice the _removed_.
I don't think the compressed stuff has any actual "init" code. It is just
a blob loader that loads the compressed kernel. There should be no need
for the init sections being special, so the vmlinux.lds.S file should just
have a ".text*" section.
Hmm?
Linus
On Sun, 26 Apr 2009, Linus Torvalds wrote:
>
> Btw, this one really needs to unify the two lds files first. Look at
>
> diff -u arch/x86/boot/compressed/vmlinux_*.lds
>
> output and realize that they're basially exctly the same except for
> trivial naming differences, and the fact that the64-bit version hs a
> "pgtable" thing.
>
> So this really needs to be done by first unifying the thing so that there
> is _one_ arch/x86/boot/compressed/vmlinux.lds.S file with a preprocessor
> that takes care of the trivial differences [..]
Something like this?
Looks obvious enough, and I think we could/should do the main
"vmlinux_32/64" files somewhat similarly to this too. But they have a lot
of other differences (the whole vsyscall setup etc), so that part isn't
nearly as trivial.
I compile-tested on both x86-64 and i386, but just one config each.
There's some trivial cleanup there (make the output format a Kconfig thign
rather than doing #ifdef's for it, and unify both 32-bit and 64-bit BSS
end to "_ebss", where 32-bit used to use the traditional "_end"), but
other than that it's really very mindless and straigt conversion.
For example, I think we should aim to remove "startup_32" vs "startup_64",
and just call it "startup", and get rid of one more difference. I didn't
do that.
Also, notice the comment in the unified vmlinux.lds.S talks about
"head_64" and "startup_32" which is an odd and incorrect mix, but that was
actually what the old 64-bit only lds file had, so the confusion isn't
new, and now that mixing is arguably more accurate thanks to the
vmlinux.lds.S file being shared between the two cases ;)
Linus
---
arch/x86/Kconfig | 5 ++
arch/x86/boot/compressed/Makefile | 2 +-
arch/x86/boot/compressed/head_32.S | 8 ++--
.../compressed/{vmlinux_64.lds => vmlinux.lds.S} | 11 +++++-
arch/x86/boot/compressed/vmlinux_32.lds | 43 --------------------
5 files changed, 20 insertions(+), 49 deletions(-)
rename arch/x86/boot/compressed/{vmlinux_64.lds => vmlinux.lds.S} (78%)
delete mode 100644 arch/x86/boot/compressed/vmlinux_32.lds
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9086e6..30f41d7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -47,6 +47,11 @@ config X86
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
+config OUTPUT_FORMAT
+ string
+ default "elf32-i386" if X86_32
+ default "elf64-x86-64" if X86_64
+
config ARCH_DEFCONFIG
string
default "arch/x86/configs/i386_defconfig" if X86_32
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 65551c9..0f4b5e2 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -19,7 +19,7 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
LDFLAGS := -m elf_$(UTS_MACHINE)
LDFLAGS_vmlinux := -T
-$(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE
+$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 3a8a866..85bd328 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -88,9 +88,9 @@ ENTRY(startup_32)
* where decompression in place becomes safe.
*/
pushl %esi
- leal _end(%ebp), %esi
- leal _end(%ebx), %edi
- movl $(_end - startup_32), %ecx
+ leal _ebss(%ebp), %esi
+ leal _ebss(%ebx), %edi
+ movl $(_ebss - startup_32), %ecx
std
rep
movsb
@@ -121,7 +121,7 @@ relocated:
*/
xorl %eax,%eax
leal _edata(%ebx),%edi
- leal _end(%ebx), %ecx
+ leal _ebss(%ebx), %ecx
subl %edi,%ecx
cld
rep
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux.lds.S
similarity index 78%
rename from arch/x86/boot/compressed/vmlinux_64.lds
rename to arch/x86/boot/compressed/vmlinux.lds.S
index bef1ac8..ffcb191 100644
--- a/arch/x86/boot/compressed/vmlinux_64.lds
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -1,6 +1,13 @@
-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
+
+#ifdef CONFIG_X86_64
OUTPUT_ARCH(i386:x86-64)
ENTRY(startup_64)
+#else
+OUTPUT_ARCH(i386)
+ENTRY(startup_32)
+#endif
+
SECTIONS
{
/* Be careful parts of head_64.S assume startup_32 is at
@@ -38,11 +45,13 @@ SECTIONS
*(.bss)
*(.bss.*)
*(COMMON)
+#ifdef CONFIG_X86_64
. = ALIGN(8);
_end_before_pgt = . ;
. = ALIGN(4096);
pgtable = . ;
. = . + 4096 * 6;
+#endif
_ebss = .;
}
}
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds b/arch/x86/boot/compressed/vmlinux_32.lds
deleted file mode 100644
index bb3c483..0000000
--- a/arch/x86/boot/compressed/vmlinux_32.lds
+++ /dev/null
@@ -1,43 +0,0 @@
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
-ENTRY(startup_32)
-SECTIONS
-{
- /* Be careful parts of head_32.S assume startup_32 is at
- * address 0.
- */
- . = 0;
- .text.head : {
- _head = . ;
- *(.text.head)
- _ehead = . ;
- }
- .rodata.compressed : {
- *(.rodata.compressed)
- }
- .text : {
- _text = .; /* Text */
- *(.text)
- *(.text.*)
- _etext = . ;
- }
- .rodata : {
- _rodata = . ;
- *(.rodata) /* read-only data */
- *(.rodata.*)
- _erodata = . ;
- }
- .data : {
- _data = . ;
- *(.data)
- *(.data.*)
- _edata = . ;
- }
- .bss : {
- _bss = . ;
- *(.bss)
- *(.bss.*)
- *(COMMON)
- _end = . ;
- }
-}
On Sun, 26 Apr 2009, Sam Ravnborg wrote:
> - * Whitelist all refereces from .text.head to .init.data
> - * Whitelist all refereces from .text.head to .init.text
> + * Whitelist all refereces from .head.text to any init section
While you're fixing that you might as well fix the spelling of
"references".
-Tim Abbott
On Sun, Apr 26, 2009 at 10:12:47AM -0700, Linus Torvalds wrote:
>
>
> On Sun, 26 Apr 2009, Linus Torvalds wrote:
> >
> > Btw, this one really needs to unify the two lds files first. Look at
> >
> > diff -u arch/x86/boot/compressed/vmlinux_*.lds
> >
> > output and realize that they're basially exctly the same except for
> > trivial naming differences, and the fact that the64-bit version hs a
> > "pgtable" thing.
> >
> > So this really needs to be done by first unifying the thing so that there
> > is _one_ arch/x86/boot/compressed/vmlinux.lds.S file with a preprocessor
> > that takes care of the trivial differences [..]
>
> Something like this?
Looks good/correct.
Acked-by: Sam Ravnborg <[email protected]>
You should add your s-o-b if you expect Ingo to pick it up.
Sam
On Sun, 26 Apr 2009, Sam Ravnborg wrote:
> On Sun, Apr 26, 2009 at 10:12:47AM -0700, Linus Torvalds wrote:
> >
> >
> > On Sun, 26 Apr 2009, Linus Torvalds wrote:
> > >
> > > Btw, this one really needs to unify the two lds files first. Look at
> > >
> > > diff -u arch/x86/boot/compressed/vmlinux_*.lds
> > >
> > > output and realize that they're basially exctly the same except for
> > > trivial naming differences, and the fact that the64-bit version hs a
> > > "pgtable" thing.
> > >
> > > So this really needs to be done by first unifying the thing so that there
> > > is _one_ arch/x86/boot/compressed/vmlinux.lds.S file with a preprocessor
> > > that takes care of the trivial differences [..]
> >
> > Something like this?
>
> Looks good/correct.
> Acked-by: Sam Ravnborg <[email protected]>
>
> You should add your s-o-b if you expect Ingo to pick it up.
Sure. I don't tend to add SOB lines for stuff that I'd not be ready to
commit, but with some testing and other people looking at it, I think it's
good to go.
Signed-off-by: Linus Torvalds <[email protected]>
As mentioned, though, the much more interesting case would be the _real_
kernel vmlinux.lds.S file, which is a lot more complex and where the
differences between 32-bit and 64-bit cases aren't totally trivial.
Looking at
diff -u arch/x86/kernel/vmlinux_*.lds.S | less -S
output, many of them are just whitespace, and others are trivial and
meaningless (comments in one, not the other, placement of alignment etc,
different ordering of sections like "parainstructions"). Yet others seem
to be things that we _could_ do in general, but that don't matter on one
architecture or other (x86-64 has ".eh_frame" in the DISCARD section, i386
apparently doesn't ever generate them, we could just use the x86-64
version).
Linus
>
> As mentioned, though, the much more interesting case would be the _real_
> kernel vmlinux.lds.S file, which is a lot more complex and where the
> differences between 32-bit and 64-bit cases aren't totally trivial.
Agreed.
But I expect someone else to do so.
When I am in unification mode I try to spend time on
architectures with less people involved.
Sam
> (x86-64 has ".eh_frame" in the DISCARD section, i386
> apparently doesn't ever generate them,
Modern i386 compilers should generate them too. It was merely a little
optimization to keep the vmlinux a little smaller / fast to write
in the !DEBUG_INFO case. Would make sense on i386 too.
-Andi
--
[email protected] -- Speaking for myself only.
Beautify vmlinux_64.lds.S:
- Use tabs for indent
- Located curly braces like in C code
- Rearranged a few comments
There is no functional changes in this patch
The beautification is done to prepare a unification
of the _32 and the _64 variants of the linker scripts.
Signed-off-by: Sam Ravnborg <[email protected]>
---
It is tested that the lds file could build - no further tests done.
[Despite my words in previous mail here is some x86 stuff]
Sam
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index c874250..6d5a5b0 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -15,69 +15,79 @@ OUTPUT_ARCH(i386:x86-64)
ENTRY(phys_startup_64)
jiffies_64 = jiffies;
PHDRS {
- text PT_LOAD FLAGS(5); /* R_E */
- data PT_LOAD FLAGS(7); /* RWE */
- user PT_LOAD FLAGS(7); /* RWE */
+ text PT_LOAD FLAGS(5); /* R_E */
+ data PT_LOAD FLAGS(7); /* RWE */
+ user PT_LOAD FLAGS(7); /* RWE */
data.init PT_LOAD FLAGS(7); /* RWE */
#ifdef CONFIG_SMP
percpu PT_LOAD FLAGS(7); /* RWE */
#endif
data.init2 PT_LOAD FLAGS(7); /* RWE */
- note PT_NOTE FLAGS(0); /* ___ */
+ note PT_NOTE FLAGS(0); /* ___ */
}
SECTIONS
{
- . = __START_KERNEL;
- phys_startup_64 = startup_64 - LOAD_OFFSET;
- .text : AT(ADDR(.text) - LOAD_OFFSET) {
- _text = .; /* Text and read-only data */
- /* First the code that has to be first for bootstrapping */
- *(.text.head)
- _stext = .;
- /* Then the rest */
- TEXT_TEXT
- SCHED_TEXT
- LOCK_TEXT
- KPROBES_TEXT
- IRQENTRY_TEXT
- *(.fixup)
- *(.gnu.warning)
- _etext = .; /* End of text section */
- } :text = 0x9090
-
- NOTES :text :note
-
- . = ALIGN(16); /* Exception table */
- __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- } :text = 0x9090
-
- RODATA
-
- . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
- /* Data */
- .data : AT(ADDR(.data) - LOAD_OFFSET) {
- DATA_DATA
- CONSTRUCTORS
- _edata = .; /* End of data section */
- } :data
+ . = __START_KERNEL;
+ phys_startup_64 = startup_64 - LOAD_OFFSET;
+
+ /* Text and read-only data */
+ .text : AT(ADDR(.text) - LOAD_OFFSET) {
+ _text = .;
+ /* First the code that has to be first for bootstrapping */
+ *(.text.head)
+ _stext = .;
+ /* Then the rest */
+ TEXT_TEXT
+ SCHED_TEXT
+ LOCK_TEXT
+ KPROBES_TEXT
+ IRQENTRY_TEXT
+ *(.fixup)
+ *(.gnu.warning)
+ /* End of text section */
+ _etext = .;
+ } :text = 0x9090
+
+ NOTES :text :note
+
+ /* Exception table */
+ . = ALIGN(16);
+ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ } :text = 0x9090
+ RODATA
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ /* Align data segment to page size boundary */
. = ALIGN(PAGE_SIZE);
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
- }
- . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
- }
+ /* Data */
+ .data : AT(ADDR(.data) - LOAD_OFFSET) {
+ DATA_DATA
+ CONSTRUCTORS
+ /* End of data section */
+ _edata = .;
+ } :data
+
+
+ .data.cacheline_aligned :
+ AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ *(.data.cacheline_aligned)
+ }
+
+ . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
+ .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
+ *(.data.read_mostly)
+ }
#define VSYSCALL_ADDR (-10*1024*1024)
-#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
-#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \
+ SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + \
+ SIZEOF(.data.read_mostly) + 4095) & ~(4095))
#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
@@ -85,37 +95,53 @@ SECTIONS
#define VVIRT_OFFSET (VSYSCALL_ADDR - VSYSCALL_VIRT_ADDR)
#define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
- . = VSYSCALL_ADDR;
- .vsyscall_0 : AT(VSYSCALL_PHYS_ADDR) { *(.vsyscall_0) } :user
- __vsyscall_0 = VSYSCALL_VIRT_ADDR;
+ . = VSYSCALL_ADDR;
+ .vsyscall_0 : AT(VSYSCALL_PHYS_ADDR) {
+ *(.vsyscall_0)
+ } :user
+
+ __vsyscall_0 = VSYSCALL_VIRT_ADDR;
+
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) {
+ *(.vsyscall_fn)
+ }
+
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data)) {
+ *(.vsyscall_gtod_data)
+ }
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) { *(.vsyscall_fn) }
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data))
- { *(.vsyscall_gtod_data) }
- vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data);
- .vsyscall_clock : AT(VLOAD(.vsyscall_clock))
- { *(.vsyscall_clock) }
- vsyscall_clock = VVIRT(.vsyscall_clock);
+ vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data);
+ .vsyscall_clock : AT(VLOAD(.vsyscall_clock)) {
+ *(.vsyscall_clock)
+ }
+ vsyscall_clock = VVIRT(.vsyscall_clock);
- .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1))
- { *(.vsyscall_1) }
- .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2))
- { *(.vsyscall_2) }
+ .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1)) {
+ *(.vsyscall_1)
+ }
+ .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2)) {
+ *(.vsyscall_2)
+ }
- .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) { *(.vgetcpu_mode) }
- vgetcpu_mode = VVIRT(.vgetcpu_mode);
+ .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) {
+ *(.vgetcpu_mode)
+ }
+ vgetcpu_mode = VVIRT(.vgetcpu_mode);
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .jiffies : AT(VLOAD(.jiffies)) { *(.jiffies) }
- jiffies = VVIRT(.jiffies);
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .jiffies : AT(VLOAD(.jiffies)) {
+ *(.jiffies)
+ }
+ jiffies = VVIRT(.jiffies);
- .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3))
- { *(.vsyscall_3) }
+ .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) {
+ *(.vsyscall_3)
+ }
- . = VSYSCALL_VIRT_ADDR + PAGE_SIZE;
+ . = VSYSCALL_VIRT_ADDR + PAGE_SIZE;
#undef VSYSCALL_ADDR
#undef VSYSCALL_PHYS_ADDR
@@ -125,156 +151,168 @@ SECTIONS
#undef VVIRT_OFFSET
#undef VVIRT
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- . = ALIGN(THREAD_SIZE); /* init_task */
- *(.data.init_task)
- }:data.init
+ /* init_task */
+ .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
+ . = ALIGN(THREAD_SIZE);
+ *(.data.init_task)
+ } :data.init
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
- }
+ .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ *(.data.page_aligned)
+ }
- .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
- /* might get freed after init */
- . = ALIGN(PAGE_SIZE);
- __smp_alt_begin = .;
- __smp_locks = .;
- *(.smp_locks)
- __smp_locks_end = .;
+ .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
+ /* might get freed after init */
+ . = ALIGN(PAGE_SIZE);
+ __smp_alt_begin = .;
+ __smp_locks = .;
+ *(.smp_locks)
+ __smp_locks_end = .;
+ . = ALIGN(PAGE_SIZE);
+ __smp_alt_end = .;
+ }
+
+ /* Init code and data */
. = ALIGN(PAGE_SIZE);
- __smp_alt_end = .;
- }
-
- . = ALIGN(PAGE_SIZE); /* Init code and data */
- __init_begin = .; /* paired with __init_end */
- .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
- _sinittext = .;
- INIT_TEXT
- _einittext = .;
- }
- .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
- __initdata_begin = .;
- INIT_DATA
- __initdata_end = .;
- }
-
- .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
- . = ALIGN(16);
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
- }
- .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
- __initcall_start = .;
- INITCALLS
- __initcall_end = .;
- }
- .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- }
- .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
- __x86_cpu_dev_start = .;
- *(.x86_cpu_dev.init)
- __x86_cpu_dev_end = .;
- }
- SECURITY_INIT
-
- . = ALIGN(8);
- .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
- __parainstructions = .;
- *(.parainstructions)
- __parainstructions_end = .;
- }
-
- .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+ __init_begin = .; /* paired with __init_end */
+ .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
+ _sinittext = .;
+ INIT_TEXT
+ _einittext = .;
+ }
+
+ .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
+ __initdata_begin = .;
+ INIT_DATA
+ __initdata_end = .;
+ }
+
+ .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
+ . = ALIGN(16);
+ __setup_start = .;
+ *(.init.setup)
+ __setup_end = .;
+ }
+
+ .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
+ __initcall_start = .;
+ INITCALLS
+ __initcall_end = .;
+ }
+
+ .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
+ __con_initcall_start = .;
+ *(.con_initcall.init)
+ __con_initcall_end = .;
+ }
+
+ .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
+ __x86_cpu_dev_start = .;
+ *(.x86_cpu_dev.init)
+ __x86_cpu_dev_end = .;
+ }
+
+ SECURITY_INIT
+
. = ALIGN(8);
- __alt_instructions = .;
- *(.altinstructions)
- __alt_instructions_end = .;
- }
- .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
- *(.altinstr_replacement)
- }
- /* .exit.text is discard at runtime, not link time, to deal with references
- from .altinstructions and .eh_frame */
- .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
- EXIT_TEXT
- }
- .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
- EXIT_DATA
- }
+ .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
+ __parainstructions = .;
+ *(.parainstructions)
+ __parainstructions_end = .;
+ }
+
+ .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+ . = ALIGN(8);
+ __alt_instructions = .;
+ *(.altinstructions)
+ __alt_instructions_end = .;
+ }
+
+ .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
+ *(.altinstr_replacement)
+ }
+
+ /*
+ * .exit.text is discard at runtime, not link time, to deal with
+ * references from .altinstructions and .eh_frame
+ */
+ .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
+ EXIT_TEXT
+ }
+
+ .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
+ EXIT_DATA
+ }
#ifdef CONFIG_BLK_DEV_INITRD
- . = ALIGN(PAGE_SIZE);
- .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
- __initramfs_start = .;
- *(.init.ramfs)
- __initramfs_end = .;
- }
+ . = ALIGN(PAGE_SIZE);
+ .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
+ __initramfs_start = .;
+ *(.init.ramfs)
+ __initramfs_end = .;
+ }
#endif
#ifdef CONFIG_SMP
- /*
- * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
- * output PHDR, so the next output section - __data_nosave - should
- * start another section data.init2. Also, pda should be at the head of
- * percpu area. Preallocate it and define the percpu offset symbol
- * so that it can be accessed as a percpu variable.
- */
- . = ALIGN(PAGE_SIZE);
- PERCPU_VADDR(0, :percpu)
+ /*
+ * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
+ * output PHDR, so the next output section - __data_nosave - should
+ * start another section data.init2. Also, pda should be at the head of
+ * percpu area. Preallocate it and define the percpu offset symbol
+ * so that it can be accessed as a percpu variable.
+ */
+ . = ALIGN(PAGE_SIZE);
+ PERCPU_VADDR(0, :percpu)
#else
- PERCPU(PAGE_SIZE)
+ PERCPU(PAGE_SIZE)
#endif
- . = ALIGN(PAGE_SIZE);
- __init_end = .;
-
- .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- __nosave_begin = .;
- *(.data.nosave)
- . = ALIGN(PAGE_SIZE);
- __nosave_end = .;
- } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
-
- .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
- __bss_start = .; /* BSS */
- *(.bss.page_aligned)
- *(.bss)
- __bss_stop = .;
- }
+ __init_end = .;
+
+ .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __nosave_begin = .;
+ *(.data.nosave)
+ . = ALIGN(PAGE_SIZE);
+ __nosave_end = .;
+ } :data.init2
+ /* use another section data.init2, see PERCPU_VADDR() above */
+
+ .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __bss_start = .; /* BSS */
+ *(.bss.page_aligned)
+ *(.bss)
+ __bss_stop = .;
+ }
- .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- __brk_base = . ;
- . += 64 * 1024 ; /* 64k alignment slop space */
- *(.brk_reservation) /* areas brk users have reserved */
- __brk_limit = . ;
- }
-
- _end = . ;
-
- /* Sections to be discarded */
- /DISCARD/ : {
- *(.exitcall.exit)
- *(.eh_frame)
- *(.discard)
+ .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __brk_base = .;
+ . += 64 * 1024; /* 64k alignment slop space */
+ *(.brk_reservation) /* areas brk users have reserved */
+ __brk_limit = .;
}
- STABS_DEBUG
+ _end = . ;
- DWARF_DEBUG
+ /* Sections to be discarded */
+ /DISCARD/ : {
+ *(.exitcall.exit)
+ *(.eh_frame)
+ *(.discard)
+ }
+
+ STABS_DEBUG
+ DWARF_DEBUG
}
- /*
- * Per-cpu symbols which need to be offset from __per_cpu_load
- * for the boot processor.
- */
+/*
+ * Per-cpu symbols which need to be offset from __per_cpu_load
+ * for the boot processor.
+ */
#define INIT_PER_CPU(x) init_per_cpu__##x = per_cpu__##x + __per_cpu_load
INIT_PER_CPU(gdt_page);
INIT_PER_CPU(irq_stack_union);
On Sun, 26 Apr 2009, Sam Ravnborg wrote:
> I was not specific in my last mail about this - but I assume you have
> understood that the naming ".head.text" was selected so it is compatible
> wiht -ffunction-sections. In other words no need for any ugly ".." here.
Yes, I did notice this. However, I think that the ".text..foo" naming
scheme is a better choice than the ".head.text" naming scheme.
One advantage is that it works better if people add new assembly code in
that section without using the proper macros. With ".head.text", if
someone were to naively write ".section .head.text", the section would not
have the SEC_ALLOC flag set. With ".text..head", gcc will assume the "ax"
section flags, and everything will work fine.
More importantly, the .head.text naming scheme fails for BSS sections.
If you replace
__attribute__((__section__(".bss.page_aligned")));
with
__attribute__((__section__(".page_aligned.bss")));
then you get section flags of @progbits rather than @nobits, which is
inappropriate for bss. The ".bss..page_aligned" naming scheme supports
this just fine.
Since it is desirable to have the Linux magic section names all use a
single naming scheme, this is why we settled on the .text..foo section
naming style.
> We should try to be as consistent as possible across architectures here
> so it is better to toach a few additiona files rather than adding macros
> and the like to accept there sub-optimal section naming.
I'm OK with doing this. But I prefer to avoid having ".head.text" appear
in all these places as it encourages people to write new code using
".head.text".
Also, as discussed above, we may want to change the name to ".text..head"
for consistency in the future, and having everything use the macros makes
this really easy.
-Tim Abbott
On Sun, 26 Apr 2009, Sam Ravnborg wrote:
> I have seen linkers that added a number after the section names
> in certain situations. Often this is due to mix of sections
> with different flags ("ax" versus no "ax").
> This is the background for the wildcard.
>
> With your patchset we should not see any such users - but we
> should then warn if they showed up anyway if we do not silently
> support them.
Right, that is exactly the purpose of my
[PATCH] modpost: Check the section flags, not name, to catch missing
"ax"/"aw"
<http://lkml.org/lkml/2009/2/26/503>
which is also the second patch in this thread (as [PATCH v3 2/3]).
This patch also catches some possible bugs that the existing check misses,
even without -ffunction-sections, so it would be nice to get it merged
independently.
Anders
* Linus Torvalds <[email protected]> wrote:
> On Sun, 26 Apr 2009, Sam Ravnborg wrote:
>
> > On Sun, Apr 26, 2009 at 10:12:47AM -0700, Linus Torvalds wrote:
> > >
> > >
> > > On Sun, 26 Apr 2009, Linus Torvalds wrote:
> > > >
> > > > Btw, this one really needs to unify the two lds files first. Look at
> > > >
> > > > diff -u arch/x86/boot/compressed/vmlinux_*.lds
> > > >
> > > > output and realize that they're basially exctly the same except for
> > > > trivial naming differences, and the fact that the64-bit version hs a
> > > > "pgtable" thing.
> > > >
> > > > So this really needs to be done by first unifying the thing so that there
> > > > is _one_ arch/x86/boot/compressed/vmlinux.lds.S file with a preprocessor
> > > > that takes care of the trivial differences [..]
> > >
> > > Something like this?
> >
> > Looks good/correct.
> > Acked-by: Sam Ravnborg <[email protected]>
> >
> > You should add your s-o-b if you expect Ingo to pick it up.
>
> Sure. I don't tend to add SOB lines for stuff that I'd not be
> ready to commit, but with some testing and other people looking at
> it, I think it's good to go.
>
> Signed-off-by: Linus Torvalds <[email protected]>
Thanks, applied to tip:x86/kbuild. I'll do some more testing of it
before pushing it out.
> As mentioned, though, the much more interesting case would be the
> _real_ kernel vmlinux.lds.S file, which is a lot more complex and
> where the differences between 32-bit and 64-bit cases aren't
> totally trivial.
>
> Looking at
>
> diff -u arch/x86/kernel/vmlinux_*.lds.S | less -S
>
> output, many of them are just whitespace, and others are trivial
> and meaningless (comments in one, not the other, placement of
> alignment etc, different ordering of sections like
> "parainstructions"). Yet others seem to be things that we _could_
> do in general, but that don't matter on one architecture or other
> (x86-64 has ".eh_frame" in the DISCARD section, i386 apparently
> doesn't ever generate them, we could just use the x86-64 version).
We generally do these by separating the unification into at least
2-3 distinct steps - a mechanic, low-risk cleanup first, preparatory
changes to bring the two files in sync second, and mechanic
unification as the third and final step.
That way any bugs are easily bisectable to a reasonably sized (and
reasonably risky) sub-patch. Review also gets much easier.
I've yet to see a non-trivial Makefile unification in arch/x86 that
does not regress :-) They concentrate a lot of quirks and implicit
dependencies and small but significant tricks. [usually we catch the
bugs early on though - but even at an early stage it's good to have
a reasonable splitup.]
Ingo
Commit-ID: 0a3ec21fcd311b26ab0f249d62960e127bc20ca8
Gitweb: http://git.kernel.org/tip/0a3ec21fcd311b26ab0f249d62960e127bc20ca8
Author: Sam Ravnborg <[email protected]>
AuthorDate: Sun, 26 Apr 2009 23:07:42 +0200
Committer: Ingo Molnar <[email protected]>
CommitDate: Mon, 27 Apr 2009 06:30:58 +0200
x86: beautify vmlinux_64.lds.S
Beautify vmlinux_64.lds.S:
- Use tabs for indent
- Located curly braces like in C code
- Rearranged a few comments
There is no functional changes in this patch
The beautification is done to prepare a unification
of the _32 and the _64 variants of the linker scripts.
[ Impact: cleanup ]
Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Tim Abbott <[email protected]>
Cc: Linus Torvalds <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/vmlinux_64.lds.S | 448 +++++++++++++++++++++-----------------
1 files changed, 243 insertions(+), 205 deletions(-)
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index c874250..6d5a5b0 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -15,69 +15,79 @@ OUTPUT_ARCH(i386:x86-64)
ENTRY(phys_startup_64)
jiffies_64 = jiffies;
PHDRS {
- text PT_LOAD FLAGS(5); /* R_E */
- data PT_LOAD FLAGS(7); /* RWE */
- user PT_LOAD FLAGS(7); /* RWE */
+ text PT_LOAD FLAGS(5); /* R_E */
+ data PT_LOAD FLAGS(7); /* RWE */
+ user PT_LOAD FLAGS(7); /* RWE */
data.init PT_LOAD FLAGS(7); /* RWE */
#ifdef CONFIG_SMP
percpu PT_LOAD FLAGS(7); /* RWE */
#endif
data.init2 PT_LOAD FLAGS(7); /* RWE */
- note PT_NOTE FLAGS(0); /* ___ */
+ note PT_NOTE FLAGS(0); /* ___ */
}
SECTIONS
{
- . = __START_KERNEL;
- phys_startup_64 = startup_64 - LOAD_OFFSET;
- .text : AT(ADDR(.text) - LOAD_OFFSET) {
- _text = .; /* Text and read-only data */
- /* First the code that has to be first for bootstrapping */
- *(.text.head)
- _stext = .;
- /* Then the rest */
- TEXT_TEXT
- SCHED_TEXT
- LOCK_TEXT
- KPROBES_TEXT
- IRQENTRY_TEXT
- *(.fixup)
- *(.gnu.warning)
- _etext = .; /* End of text section */
- } :text = 0x9090
-
- NOTES :text :note
-
- . = ALIGN(16); /* Exception table */
- __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- } :text = 0x9090
-
- RODATA
-
- . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
- /* Data */
- .data : AT(ADDR(.data) - LOAD_OFFSET) {
- DATA_DATA
- CONSTRUCTORS
- _edata = .; /* End of data section */
- } :data
+ . = __START_KERNEL;
+ phys_startup_64 = startup_64 - LOAD_OFFSET;
+
+ /* Text and read-only data */
+ .text : AT(ADDR(.text) - LOAD_OFFSET) {
+ _text = .;
+ /* First the code that has to be first for bootstrapping */
+ *(.text.head)
+ _stext = .;
+ /* Then the rest */
+ TEXT_TEXT
+ SCHED_TEXT
+ LOCK_TEXT
+ KPROBES_TEXT
+ IRQENTRY_TEXT
+ *(.fixup)
+ *(.gnu.warning)
+ /* End of text section */
+ _etext = .;
+ } :text = 0x9090
+
+ NOTES :text :note
+
+ /* Exception table */
+ . = ALIGN(16);
+ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ } :text = 0x9090
+ RODATA
- .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ /* Align data segment to page size boundary */
. = ALIGN(PAGE_SIZE);
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- *(.data.cacheline_aligned)
- }
- . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
- .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
- *(.data.read_mostly)
- }
+ /* Data */
+ .data : AT(ADDR(.data) - LOAD_OFFSET) {
+ DATA_DATA
+ CONSTRUCTORS
+ /* End of data section */
+ _edata = .;
+ } :data
+
+
+ .data.cacheline_aligned :
+ AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ *(.data.cacheline_aligned)
+ }
+
+ . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
+ .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
+ *(.data.read_mostly)
+ }
#define VSYSCALL_ADDR (-10*1024*1024)
-#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
-#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \
+ SIZEOF(.data.read_mostly) + 4095) & ~(4095))
+#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + \
+ SIZEOF(.data.read_mostly) + 4095) & ~(4095))
#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
@@ -85,37 +95,53 @@ SECTIONS
#define VVIRT_OFFSET (VSYSCALL_ADDR - VSYSCALL_VIRT_ADDR)
#define VVIRT(x) (ADDR(x) - VVIRT_OFFSET)
- . = VSYSCALL_ADDR;
- .vsyscall_0 : AT(VSYSCALL_PHYS_ADDR) { *(.vsyscall_0) } :user
- __vsyscall_0 = VSYSCALL_VIRT_ADDR;
+ . = VSYSCALL_ADDR;
+ .vsyscall_0 : AT(VSYSCALL_PHYS_ADDR) {
+ *(.vsyscall_0)
+ } :user
+
+ __vsyscall_0 = VSYSCALL_VIRT_ADDR;
+
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) {
+ *(.vsyscall_fn)
+ }
+
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data)) {
+ *(.vsyscall_gtod_data)
+ }
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) { *(.vsyscall_fn) }
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data))
- { *(.vsyscall_gtod_data) }
- vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data);
- .vsyscall_clock : AT(VLOAD(.vsyscall_clock))
- { *(.vsyscall_clock) }
- vsyscall_clock = VVIRT(.vsyscall_clock);
+ vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data);
+ .vsyscall_clock : AT(VLOAD(.vsyscall_clock)) {
+ *(.vsyscall_clock)
+ }
+ vsyscall_clock = VVIRT(.vsyscall_clock);
- .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1))
- { *(.vsyscall_1) }
- .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2))
- { *(.vsyscall_2) }
+ .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1)) {
+ *(.vsyscall_1)
+ }
+ .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2)) {
+ *(.vsyscall_2)
+ }
- .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) { *(.vgetcpu_mode) }
- vgetcpu_mode = VVIRT(.vgetcpu_mode);
+ .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) {
+ *(.vgetcpu_mode)
+ }
+ vgetcpu_mode = VVIRT(.vgetcpu_mode);
- . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
- .jiffies : AT(VLOAD(.jiffies)) { *(.jiffies) }
- jiffies = VVIRT(.jiffies);
+ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
+ .jiffies : AT(VLOAD(.jiffies)) {
+ *(.jiffies)
+ }
+ jiffies = VVIRT(.jiffies);
- .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3))
- { *(.vsyscall_3) }
+ .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) {
+ *(.vsyscall_3)
+ }
- . = VSYSCALL_VIRT_ADDR + PAGE_SIZE;
+ . = VSYSCALL_VIRT_ADDR + PAGE_SIZE;
#undef VSYSCALL_ADDR
#undef VSYSCALL_PHYS_ADDR
@@ -125,156 +151,168 @@ SECTIONS
#undef VVIRT_OFFSET
#undef VVIRT
- .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
- . = ALIGN(THREAD_SIZE); /* init_task */
- *(.data.init_task)
- }:data.init
+ /* init_task */
+ .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
+ . = ALIGN(THREAD_SIZE);
+ *(.data.init_task)
+ } :data.init
- .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- *(.data.page_aligned)
- }
+ .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ *(.data.page_aligned)
+ }
- .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
- /* might get freed after init */
- . = ALIGN(PAGE_SIZE);
- __smp_alt_begin = .;
- __smp_locks = .;
- *(.smp_locks)
- __smp_locks_end = .;
+ .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
+ /* might get freed after init */
+ . = ALIGN(PAGE_SIZE);
+ __smp_alt_begin = .;
+ __smp_locks = .;
+ *(.smp_locks)
+ __smp_locks_end = .;
+ . = ALIGN(PAGE_SIZE);
+ __smp_alt_end = .;
+ }
+
+ /* Init code and data */
. = ALIGN(PAGE_SIZE);
- __smp_alt_end = .;
- }
-
- . = ALIGN(PAGE_SIZE); /* Init code and data */
- __init_begin = .; /* paired with __init_end */
- .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
- _sinittext = .;
- INIT_TEXT
- _einittext = .;
- }
- .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
- __initdata_begin = .;
- INIT_DATA
- __initdata_end = .;
- }
-
- .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
- . = ALIGN(16);
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
- }
- .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
- __initcall_start = .;
- INITCALLS
- __initcall_end = .;
- }
- .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- }
- .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
- __x86_cpu_dev_start = .;
- *(.x86_cpu_dev.init)
- __x86_cpu_dev_end = .;
- }
- SECURITY_INIT
-
- . = ALIGN(8);
- .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
- __parainstructions = .;
- *(.parainstructions)
- __parainstructions_end = .;
- }
-
- .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+ __init_begin = .; /* paired with __init_end */
+ .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
+ _sinittext = .;
+ INIT_TEXT
+ _einittext = .;
+ }
+
+ .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
+ __initdata_begin = .;
+ INIT_DATA
+ __initdata_end = .;
+ }
+
+ .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
+ . = ALIGN(16);
+ __setup_start = .;
+ *(.init.setup)
+ __setup_end = .;
+ }
+
+ .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
+ __initcall_start = .;
+ INITCALLS
+ __initcall_end = .;
+ }
+
+ .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
+ __con_initcall_start = .;
+ *(.con_initcall.init)
+ __con_initcall_end = .;
+ }
+
+ .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
+ __x86_cpu_dev_start = .;
+ *(.x86_cpu_dev.init)
+ __x86_cpu_dev_end = .;
+ }
+
+ SECURITY_INIT
+
. = ALIGN(8);
- __alt_instructions = .;
- *(.altinstructions)
- __alt_instructions_end = .;
- }
- .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
- *(.altinstr_replacement)
- }
- /* .exit.text is discard at runtime, not link time, to deal with references
- from .altinstructions and .eh_frame */
- .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
- EXIT_TEXT
- }
- .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
- EXIT_DATA
- }
+ .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
+ __parainstructions = .;
+ *(.parainstructions)
+ __parainstructions_end = .;
+ }
+
+ .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+ . = ALIGN(8);
+ __alt_instructions = .;
+ *(.altinstructions)
+ __alt_instructions_end = .;
+ }
+
+ .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
+ *(.altinstr_replacement)
+ }
+
+ /*
+ * .exit.text is discard at runtime, not link time, to deal with
+ * references from .altinstructions and .eh_frame
+ */
+ .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
+ EXIT_TEXT
+ }
+
+ .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
+ EXIT_DATA
+ }
#ifdef CONFIG_BLK_DEV_INITRD
- . = ALIGN(PAGE_SIZE);
- .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
- __initramfs_start = .;
- *(.init.ramfs)
- __initramfs_end = .;
- }
+ . = ALIGN(PAGE_SIZE);
+ .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
+ __initramfs_start = .;
+ *(.init.ramfs)
+ __initramfs_end = .;
+ }
#endif
#ifdef CONFIG_SMP
- /*
- * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
- * output PHDR, so the next output section - __data_nosave - should
- * start another section data.init2. Also, pda should be at the head of
- * percpu area. Preallocate it and define the percpu offset symbol
- * so that it can be accessed as a percpu variable.
- */
- . = ALIGN(PAGE_SIZE);
- PERCPU_VADDR(0, :percpu)
+ /*
+ * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
+ * output PHDR, so the next output section - __data_nosave - should
+ * start another section data.init2. Also, pda should be at the head of
+ * percpu area. Preallocate it and define the percpu offset symbol
+ * so that it can be accessed as a percpu variable.
+ */
+ . = ALIGN(PAGE_SIZE);
+ PERCPU_VADDR(0, :percpu)
#else
- PERCPU(PAGE_SIZE)
+ PERCPU(PAGE_SIZE)
#endif
- . = ALIGN(PAGE_SIZE);
- __init_end = .;
-
- .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- __nosave_begin = .;
- *(.data.nosave)
- . = ALIGN(PAGE_SIZE);
- __nosave_end = .;
- } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
-
- .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE);
- __bss_start = .; /* BSS */
- *(.bss.page_aligned)
- *(.bss)
- __bss_stop = .;
- }
+ __init_end = .;
+
+ .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __nosave_begin = .;
+ *(.data.nosave)
+ . = ALIGN(PAGE_SIZE);
+ __nosave_end = .;
+ } :data.init2
+ /* use another section data.init2, see PERCPU_VADDR() above */
+
+ .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __bss_start = .; /* BSS */
+ *(.bss.page_aligned)
+ *(.bss)
+ __bss_stop = .;
+ }
- .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
- . = ALIGN(PAGE_SIZE);
- __brk_base = . ;
- . += 64 * 1024 ; /* 64k alignment slop space */
- *(.brk_reservation) /* areas brk users have reserved */
- __brk_limit = . ;
- }
-
- _end = . ;
-
- /* Sections to be discarded */
- /DISCARD/ : {
- *(.exitcall.exit)
- *(.eh_frame)
- *(.discard)
+ .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+ . = ALIGN(PAGE_SIZE);
+ __brk_base = .;
+ . += 64 * 1024; /* 64k alignment slop space */
+ *(.brk_reservation) /* areas brk users have reserved */
+ __brk_limit = .;
}
- STABS_DEBUG
+ _end = . ;
- DWARF_DEBUG
+ /* Sections to be discarded */
+ /DISCARD/ : {
+ *(.exitcall.exit)
+ *(.eh_frame)
+ *(.discard)
+ }
+
+ STABS_DEBUG
+ DWARF_DEBUG
}
- /*
- * Per-cpu symbols which need to be offset from __per_cpu_load
- * for the boot processor.
- */
+/*
+ * Per-cpu symbols which need to be offset from __per_cpu_load
+ * for the boot processor.
+ */
#define INIT_PER_CPU(x) init_per_cpu__##x = per_cpu__##x + __per_cpu_load
INIT_PER_CPU(gdt_page);
INIT_PER_CPU(irq_stack_union);
* Sam Ravnborg <[email protected]> wrote:
> > As mentioned, though, the much more interesting case would be
> > the _real_ kernel vmlinux.lds.S file, which is a lot more
> > complex and where the differences between 32-bit and 64-bit
> > cases aren't totally trivial.
>
> Agreed.
>
> But I expect someone else to do so.
> When I am in unification mode I try to spend time on
> architectures with less people involved.
thanks for reconsidering - and i've applied your patch - thanks Sam.
Architectures with lots of people involved (hm, what a strange way
to say 'x86' ;-) tend to be logistically more complex and there's an
(understandably) stronger pushback against regressions - but that is
also where unification is actually needed the most and where the
ongoing costs of splintered code is the highest. Your kbuild patches
are making quite a bit of difference so please dont hold back :)
Ingo
On Mon, Apr 27, 2009 at 06:59:10AM +0200, Ingo Molnar wrote:
>
> * Sam Ravnborg <[email protected]> wrote:
>
> > > As mentioned, though, the much more interesting case would be
> > > the _real_ kernel vmlinux.lds.S file, which is a lot more
> > > complex and where the differences between 32-bit and 64-bit
> > > cases aren't totally trivial.
> >
> > Agreed.
> >
> > But I expect someone else to do so.
> > When I am in unification mode I try to spend time on
> > architectures with less people involved.
>
> thanks for reconsidering - and i've applied your patch - thanks Sam.
>
> Architectures with lots of people involved (hm, what a strange way
> to say 'x86' ;-) tend to be logistically more complex and there's an
> (understandably) stronger pushback against regressions - but that is
> also where unification is actually needed the most and where the
> ongoing costs of splintered code is the highest.
Well - the effort done for sparc and m68k lately was also needed.
> Your kbuild patches
> are making quite a bit of difference so please dont hold back :)
The good patches are the ones that benefits all architectures.
Well - I can give the vmlinux_*.ds files a try.
Did you apply the patch to an append only branch or may I recreate
the patch?
I noticed a few minor things that can be 'fixed' to bring the inital
differences between 32 bit and 64 bit down.
But I can do these in a follow-up patch too.
Sam
* Sam Ravnborg <[email protected]> wrote:
> On Mon, Apr 27, 2009 at 06:59:10AM +0200, Ingo Molnar wrote:
> >
> > * Sam Ravnborg <[email protected]> wrote:
> >
> > > > As mentioned, though, the much more interesting case would be
> > > > the _real_ kernel vmlinux.lds.S file, which is a lot more
> > > > complex and where the differences between 32-bit and 64-bit
> > > > cases aren't totally trivial.
> > >
> > > Agreed.
> > >
> > > But I expect someone else to do so.
> > > When I am in unification mode I try to spend time on
> > > architectures with less people involved.
> >
> > thanks for reconsidering - and i've applied your patch - thanks Sam.
> >
> > Architectures with lots of people involved (hm, what a strange
> > way to say 'x86' ;-) tend to be logistically more complex and
> > there's an (understandably) stronger pushback against
> > regressions - but that is also where unification is actually
> > needed the most and where the ongoing costs of splintered code
> > is the highest.
>
> Well - the effort done for sparc and m68k lately was also needed.
>
> > Your kbuild patches are making quite a bit of difference so
> > please dont hold back :)
>
> The good patches are the ones that benefits all architectures.
The good patches are the ones that increase the quality of the
kernel and benefit people.
In terms of architecture code that means factoring out common code
and stemming the spread of architecture-specific local hacks.
For details that are inherently per arch - obviously improving the
more frequently used architectures helps more people, on average.
> Well - I can give the vmlinux_*.ds files a try.
> Did you apply the patch to an append only branch or may I recreate
> the patch?
> I noticed a few minor things that can be 'fixed' to bring the inital
> differences between 32 bit and 64 bit down.
>
> But I can do these in a follow-up patch too.
Yeah, please do a follow-up patch - unless the first patch is
outright wrong. I've got a fair amount of test-time in the first
patch already - and Linus's is on top of it so it would mean a
rebase of both.
Ingo
> >
> > The good patches are the ones that benefits all architectures.
>
> The good patches are the ones that increase the quality of the
> kernel and benefit people.
Should have read "the good kbuild patches" - it did not address
patches in general.
> > I noticed a few minor things that can be 'fixed' to bring the inital
> > differences between 32 bit and 64 bit down.
> >
> > But I can do these in a follow-up patch too.
>
> Yeah, please do a follow-up patch - unless the first patch is
> outright wrong.
A follow-up patch it will be.
Sam
On Sun, 26 Apr 2009, Sam Ravnborg wrote:
> > - .text.head : {
> > + HEAD_TEXT_SECTION : {
>
> Spell it out direct rather than hiding the .head.text
> behind a macro name here.
Does .head.text actually need its own output section here? I notice that
only the linker scripts for arm, x86, and ia64 have an output section for
.head.text; the rest just place it at the start of the .text or .init.text
output section. It would be great if we could eliminate these extra
references to .head.text by doing the same thing here.
-Tim Abbott
On Mon, Apr 27, 2009 at 12:46:21PM -0400, Tim Abbott wrote:
> On Sun, 26 Apr 2009, Sam Ravnborg wrote:
>
> > > - .text.head : {
> > > + HEAD_TEXT_SECTION : {
> >
> > Spell it out direct rather than hiding the .head.text
> > behind a macro name here.
>
> Does .head.text actually need its own output section here? I notice that
> only the linker scripts for arm, x86, and ia64 have an output section for
> .head.text; the rest just place it at the start of the .text or .init.text
> output section. It would be great if we could eliminate these extra
> references to .head.text by doing the same thing here.
It could be merged with the .init section. IOW, it becomes:
.init : { /* Init code and data */
_stext = .;
_sinittext = .;
*(.text.head)
INIT_TEXT
_einittext = .;
__proc_info_begin = .;
*(.proc.info.init)
__proc_info_end = .;
...
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
On Mon, 27 Apr 2009, Tim Abbott wrote:
>
> Does .head.text actually need its own output section here?
Probably not. Does the ARM build system massage the end result some way
looking for that .text.head section in the end? As you note, nobody else
cares, and the proper patch may be more along the lines of something
below.
Of course, most other architectures put the "init" section at the end, and
leave the HEAD_TEXT in the regular text section, but I suspect the ARM way
of laying things out (init text first) is probably better, since it allows
you to free that head code too.
Not that it likely much matters.
Linus
---
arch/arm/kernel/vmlinux.lds.S | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index c90f272..15520be 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,13 +23,11 @@ SECTIONS
#else
. = PAGE_OFFSET + TEXT_OFFSET;
#endif
- .text.head : {
- _stext = .;
- _sinittext = .;
- *(.text.head)
- }
.init : { /* Init code and data */
+ _stext = .;
+ _sinittext = .;
+ HEAD_TEXT
INIT_TEXT
_einittext = .;
__proc_info_begin = .;
>> Does .head.text actually need its own output section here?
>
> Probably not. Does the ARM build system massage the end result some way
> looking for that .text.head section in the end? As you note, nobody else
> cares, and the proper patch may be more along the lines of something
> below.
ia64 doesn't seem to care ... I changed the one use of .text.head
to be just .text. There are a couple of new "section mismatches"
(start_ap -> start_secondary and start_ap -> start_kernel), but
it still boots.
> Of course, most other architectures put the "init" section at the end, and
> leave the HEAD_TEXT in the regular text section, but I suspect the ARM way
> of laying things out (init text first) is probably better, since it allows
> you to free that head code too.
The start_ap code is still needed for hotplug cpu on ia64. So .text.init
won't work for me.
-Tony
From: Sam Ravnborg <[email protected]>
Subject: Re: [PATCH 07/15] m32r: convert to use __HEAD and HEAD_TEXT macros.
Date: Sun, 26 Apr 2009 13:21:45 +0200
> On Sat, Apr 25, 2009 at 10:11:02PM -0400, Tim Abbott wrote:
> > This has the consequence of changing the section name use for head
> > code from ".text.head" to ".head.text". Since this commit changes all
> > users in the architecture, this change should be harmless.
> >
> > Signed-off-by: Tim Abbott <[email protected]>
> > Cc: Hirokazu Takata <[email protected]>
> Acked-by: Sam Ravnborg <[email protected]>
Acked-by: Hirokazu Takata <[email protected]>
> > ---
> > arch/m32r/kernel/head.S | 2 +-
> > arch/m32r/kernel/vmlinux.lds.S | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S
> > index 9091606..0a71944 100644
> > --- a/arch/m32r/kernel/head.S
> > +++ b/arch/m32r/kernel/head.S
> > @@ -23,7 +23,7 @@ __INITDATA
> > /*
> > * References to members of the boot_cpu_data structure.
> > */
> > -.section .text.head, "ax"
> > +__HEAD
> > .global start_kernel
> > .global __bss_start
> > .global _end
> > diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
> > index 9db05df..4179adf 100644
> > --- a/arch/m32r/kernel/vmlinux.lds.S
> > +++ b/arch/m32r/kernel/vmlinux.lds.S
> > @@ -27,7 +27,7 @@ SECTIONS
> > _text = .; /* Text and read-only data */
> > .boot : { *(.boot) } = 0
> > .text : {
> > - *(.text.head)
> > + HEAD_TEXT
> > TEXT_TEXT
> > SCHED_TEXT
> > LOCK_TEXT
> > --
> > 1.6.2.1
> >
>
On Mon, Apr 27, 2009 at 10:06:26AM -0700, Linus Torvalds wrote:
> On Mon, 27 Apr 2009, Tim Abbott wrote:
> >
> > Does .head.text actually need its own output section here?
>
> Probably not. Does the ARM build system massage the end result some way
> looking for that .text.head section in the end? As you note, nobody else
> cares, and the proper patch may be more along the lines of something
> below.
>
> Of course, most other architectures put the "init" section at the end, and
> leave the HEAD_TEXT in the regular text section, but I suspect the ARM way
> of laying things out (init text first) is probably better, since it allows
> you to free that head code too.
There are a few platforms were due to excess bootloader primitivity (read
the boot format is a simple blob) it is desireable to have the entry point
at the lowest address of the final image - because that is what the firmware
is expecting.
Ralf
Commit-ID: 83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
Gitweb: http://git.kernel.org/tip/83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
Author: Sam Ravnborg <[email protected]>
AuthorDate: Thu, 30 Apr 2009 12:03:16 +0200
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 30 Apr 2009 12:36:50 +0200
x86: boot/compressed/vmlinux.lds.S: fix build of bzImage with 64 bit compiler
Jesper reported that he saw following build issue:
> ld:arch/x86/boot/compressed/vmlinux.lds:9: syntax error
> make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
> make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
> make: *** [bzImage] Error 2
CPP defines the symbol "i386" to "1".
Undefine this to fix it.
[ Impact: build fix with certain tool chains ]
Reported-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Linus Torvalds <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/boot/compressed/vmlinux.lds.S | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index ffcb191..0d26c92 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -1,5 +1,7 @@
OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
+#undef i386
+
#ifdef CONFIG_X86_64
OUTPUT_ARCH(i386:x86-64)
ENTRY(startup_64)
tip-bot for Sam Ravnborg wrote:
> Commit-ID: 83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
> Gitweb: http://git.kernel.org/tip/83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
> Author: Sam Ravnborg <[email protected]>
> AuthorDate: Thu, 30 Apr 2009 12:03:16 +0200
> Committer: Ingo Molnar <[email protected]>
> CommitDate: Thu, 30 Apr 2009 12:36:50 +0200
>
> x86: boot/compressed/vmlinux.lds.S: fix build of bzImage with 64 bit compiler
>
> Jesper reported that he saw following build issue:
>
> > ld:arch/x86/boot/compressed/vmlinux.lds:9: syntax error
> > make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
> > make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
> > make: *** [bzImage] Error 2
>
> CPP defines the symbol "i386" to "1".
> Undefine this to fix it.
>
I'm wondering if we should build the *.lds.S with -ansi or some other
gcc option which disables ALL non-underscore macros.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
On Thu, Apr 30, 2009 at 07:52:55AM -0700, H. Peter Anvin wrote:
> tip-bot for Sam Ravnborg wrote:
> > Commit-ID: 83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
> > Gitweb: http://git.kernel.org/tip/83c4832683bc8ebcd1687b3c0bf3ba1ab253dd4f
> > Author: Sam Ravnborg <[email protected]>
> > AuthorDate: Thu, 30 Apr 2009 12:03:16 +0200
> > Committer: Ingo Molnar <[email protected]>
> > CommitDate: Thu, 30 Apr 2009 12:36:50 +0200
> >
> > x86: boot/compressed/vmlinux.lds.S: fix build of bzImage with 64 bit compiler
> >
> > Jesper reported that he saw following build issue:
> >
> > > ld:arch/x86/boot/compressed/vmlinux.lds:9: syntax error
> > > make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
> > > make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
> > > make: *** [bzImage] Error 2
> >
> > CPP defines the symbol "i386" to "1".
> > Undefine this to fix it.
> >
>
> I'm wondering if we should build the *.lds.S with -ansi or some other
> gcc option which disables ALL non-underscore macros.
I did not know that -ansi had this effect.
We are only seldomly hitting this issue and I wonder
if it could break something in out included headers.
Most likely not.
Sam
Sam Ravnborg wrote:
>>>
>> I'm wondering if we should build the *.lds.S with -ansi or some other
>> gcc option which disables ALL non-underscore macros.
>
> I did not know that -ansi had this effect.
> We are only seldomly hitting this issue and I wonder
> if it could break something in out included headers.
> Most likely not.
>
The other thing to recognize is probably that lds files aren't assembly,
they're something else entirely. Rather than reusing the *.S rules,
having specific rules for them probably would make sense.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
On Thu, Apr 30, 2009 at 09:29:25AM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >>>
> >> I'm wondering if we should build the *.lds.S with -ansi or some other
> >> gcc option which disables ALL non-underscore macros.
> >
> > I did not know that -ansi had this effect.
> > We are only seldomly hitting this issue and I wonder
> > if it could break something in out included headers.
> > Most likely not.
> >
>
> The other thing to recognize is probably that lds files aren't assembly,
> they're something else entirely. Rather than reusing the *.S rules,
> having specific rules for them probably would make sense.
We already have that:
(scripts/Makfile.build)
# Linker scripts preprocessor (.lds.S -> .lds)
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds_S = LDS $@
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<
$(obj)/%.lds: $(src)/%.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)
So adding -ansi is trivial and will only hit .lds.S files.
I assume the lds files are named .S is because we shared rules
long time ago.
Sam
Sam Ravnborg wrote:
>
> So adding -ansi is trivial and will only hit .lds.S files.
>
> I assume the lds files are named .S is because we shared rules
> long time ago.
>
Yes, the naming is rather ugly that way.
-hpa