From patchwork Wed Jul 28 23:47:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Vlasenko X-Patchwork-Id: 114963 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6SNmng5008208 for ; Wed, 28 Jul 2010 23:48:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756657Ab0G1XsY (ORCPT ); Wed, 28 Jul 2010 19:48:24 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:43782 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755841Ab0G1XsU (ORCPT ); Wed, 28 Jul 2010 19:48:20 -0400 Received: by mail-fx0-f46.google.com with SMTP id 14so1531455fxm.19 for ; Wed, 28 Jul 2010 16:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=7ccWA39NtJ+5izqLyeOCIpuZj/HCFpdjKTE9xKWnOj4=; b=K0t+5XUBoJ0/1yYAKK86p0JelU3Haq7IDdR6tMwK7afhZFAr4xrHUFC/0YCl6EdrY+ aG7MCFqlftReEkd0CaHDYG5OYzPjmGDqzjFt6qR2++Pj8wOUEJzX1RpcOsChVNh3fpPh qCZ9tS/WP+F6ZFeHONPLmEt+q//daGHzhDy70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=QkKdPvct3ZBiBSDtvff6LXMWn9Y3RvrptYi69zKl2k9o6Qts8S9LwLN6ZlqIkKZooh 04RUT9SvRV98vKBn73yHZ2pApRMwIjcdXba0F0jYJxk48WBHrEHzKD8G4hn9OU1NrbPY NXtY6R6TbwJyAi+r4WTIEC20XNtVsGVggsG0g= Received: by 10.223.122.146 with SMTP id l18mr10730210far.82.1280360898612; Wed, 28 Jul 2010 16:48:18 -0700 (PDT) Received: from localhost.localdomain (221.47.broadband5.iol.cz [88.100.47.221]) by mx.google.com with ESMTPS id a9sm54590faa.3.2010.07.28.16.48.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 16:48:17 -0700 (PDT) From: Denys Vlasenko To: Michal Marek , linux-kbuild , linux-arch@vger.kernel.org, Parisc List Cc: lkml , Sam Ravnborg , Tim Abbott , Tim Bird , James Bottomley , Matt Fleming , Arnd Bergmann , Anders Kaseorg , Andi Kleen , Stephen Rothwell , Denys Vlasenko Subject: [PATCH 3/4] kernel linker stripts: accomodate function and data sections Date: Thu, 29 Jul 2010 01:47:55 +0200 Message-Id: <1280360876-2571-4-git-send-email-vda.linux@googlemail.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1280360876-2571-1-git-send-email-vda.linux@googlemail.com> References: <1280360876-2571-1-git-send-email-vda.linux@googlemail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 28 Jul 2010 23:48:50 +0000 (UTC) diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index 8b973f3..9949f1a 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S @@ -114,7 +114,6 @@ SECTIONS .sbss : { *(.sbss .sbss.*) } .bss : { *(.bss .bss.*) } - .bss..stack : { *(.bss) } __bss_stop = .; _end = . ; diff --git a/arch/ia64/scripts/check-segrel.lds b/arch/ia64/scripts/check-segrel.lds index 85a0d54..1e23df4 100644 --- a/arch/ia64/scripts/check-segrel.lds +++ b/arch/ia64/scripts/check-segrel.lds @@ -1,9 +1,9 @@ SECTIONS { . = SIZEOF_HEADERS; - .rodata : { *(.rodata) } :ro + .rodata : { *(.rodata) *(.rodata.*) } :ro .note : { *(.note*) } . = 0xa0000; - .data : { *(.data) } :dat + .data : { *(.data) *(.data.*) } :dat /DISCARD/ : { *(*) } } PHDRS { diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S index a91b271..c095a5b 100644 --- a/arch/m68knommu/kernel/vmlinux.lds.S +++ b/arch/m68knommu/kernel/vmlinux.lds.S @@ -169,6 +169,7 @@ SECTIONS { . = ALIGN(4); _sbss = . ; *(.bss) + *(.bss.*) *(COMMON) . = ALIGN(4) ; _ebss = . ; diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal index 0864c96..408e5ad 100644 --- a/arch/mips/lasat/image/romscript.normal +++ b/arch/mips/lasat/image/romscript.normal @@ -12,6 +12,7 @@ SECTIONS .data ALIGN(0x10) : { *(.data) + *(.data.*) } _image_start = ADDR(.data); _image_size = SIZEOF(.data); diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index d64a6bb..56d472c 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -112,6 +112,7 @@ SECTIONS } .bss : { *(.bss) + *(.bss.*) *(COMMON) } __bss_stop = .; diff --git a/arch/sh/kernel/vsyscall/vsyscall.lds.S b/arch/sh/kernel/vsyscall/vsyscall.lds.S index 6d59ee7..19ee0cb 100644 --- a/arch/sh/kernel/vsyscall/vsyscall.lds.S +++ b/arch/sh/kernel/vsyscall/vsyscall.lds.S @@ -35,7 +35,7 @@ SECTIONS */ . = 0x400; - .text : { *(.text) } :text =0x90909090 + .text : { *(.text) *(.text.*) } :text =0x90909090 .note : { *(.note.*) } :text :note .eh_frame_hdr : { *(.eh_frame_hdr ) } :text :eh_frame_hdr .eh_frame : { diff --git a/arch/x86/kernel/acpi/realmode/wakeup.lds.S b/arch/x86/kernel/acpi/realmode/wakeup.lds.S index 060fff8..38f18e8 100644 --- a/arch/x86/kernel/acpi/realmode/wakeup.lds.S +++ b/arch/x86/kernel/acpi/realmode/wakeup.lds.S @@ -42,6 +42,7 @@ SECTIONS .bss : { __bss_start = .; *(.bss) + *(.bss.*) __bss_end = .; } diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index d0bb522..eb5b2a6 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -307,6 +307,7 @@ SECTIONS __bss_start = .; *(.bss..page_aligned) *(.bss) + *(.bss.*) . = ALIGN(4); __bss_stop = .; } diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 030a954..079895a 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -146,9 +146,22 @@ #define TRACE_SYSCALLS() #endif +/* .data.foo are generated by gcc itself with -fdata-sections, + * whereas double-dot sections (like .data..percpu) are generated + * by kernel's magic macros. + * + * arch/.../vmlinux.lds.S decides where to place various double-dot sections + * as needed by its arch, here DATA_DATA needs to be careful and collect + * only .data and .data.foo sections, skipping .data..foo + * + * Same goes for .text, .bss and .rodata. In case of .rodata, various + * .rodata.foo sections are generated by gcc even without -fdata-sections + */ + /* .data section */ #define DATA_DATA \ *(.data) \ + *(.data.[A-Za-z0-9_$^]*) \ *(.ref.data) \ DEV_KEEP(init.data) \ DEV_KEEP(exit.data) \ @@ -212,7 +225,8 @@ . = ALIGN((align)); \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__start_rodata) = .; \ - *(.rodata) *(.rodata.*) \ + *(.rodata) \ + *(.rodata.[A-Za-z0-9_$^]*) \ *(__vermagic) /* Kernel version magic */ \ *(__markers_strings) /* Markers: strings */ \ *(__tracepoints_strings)/* Tracepoints: strings */ \ @@ -379,6 +393,7 @@ ALIGN_FUNCTION(); \ *(.text.hot) \ *(.text) \ + *(.text.[A-Za-z0-9_$^]*) \ *(.ref.text) \ DEV_KEEP(init.text) \ DEV_KEEP(exit.text) \ @@ -512,6 +527,7 @@ *(.bss..page_aligned) \ *(.dynbss) \ *(.bss) \ + *(.bss.[A-Za-z0-9_$^]*) \ *(COMMON) \ }