From patchwork Fri Jul 23 20:24:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 114002 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 o6NKOqlI000577 for ; Fri, 23 Jul 2010 20:24:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756256Ab0GWUYv (ORCPT ); Fri, 23 Jul 2010 16:24:51 -0400 Received: from pfepa.post.tele.dk ([195.41.46.235]:38479 "EHLO pfepa.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753346Ab0GWUYv (ORCPT ); Fri, 23 Jul 2010 16:24:51 -0400 Received: from merkur.ravnborg.org (x1-6-00-1e-2a-84-ae-3e.k225.webspeed.dk [80.163.61.94]) by pfepa.post.tele.dk (Postfix) with ESMTP id E032EA50020; Fri, 23 Jul 2010 22:24:47 +0200 (CEST) Date: Fri, 23 Jul 2010 22:24:49 +0200 From: Sam Ravnborg To: Denys Vlasenko Cc: Tim Abbott , Tim Bird , James Bottomley , linux-kernel@vger.kernel.org, Matt Fleming , linux-arch@vger.kernel.org, Arnd Bergmann , Michal Marek , Parisc List Subject: Re: Testing of function/data-sections on linux-2.6.35-rc4 Message-ID: <20100723202448.GB27054@merkur.ravnborg.org> References: <201007181703.17022.vda.linux@googlemail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201007181703.17022.vda.linux@googlemail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@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]); Fri, 23 Jul 2010 20:24:52 +0000 (UTC) --- linux-2.6.35-rc4/arch/arm/boot/compressed/vmlinux.lds.in +++ linux-2.6.35-rc4.new/arch/arm/boot/compressed/vmlinux.lds.in @@ -29,12 +29,10 @@ .text : { _start = .; *(.start) - *(.text) - *(.text.*) + *(.text .text.*) *(.fixup) *(.gnu.warning) - *(.rodata) - *(.rodata.*) + *(.rodata .rodata.*) *(.glue_7) *(.glue_7t) *(.piggydata) This is one example where the patch only does layout changes. --- linux-2.6.35-rc4/arch/arm/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/arm/kernel/vmlinux.lds.S @@ -95,8 +95,7 @@ *(.fixup) #endif *(.gnu.warning) - *(.rodata) - *(.rodata.*) + *(.rodata .rodata.*) *(.glue_7) *(.glue_7t) Likewise... --- linux-2.6.35-rc4/arch/frv/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/frv/kernel/vmlinux.lds.S @@ -114,7 +114,7 @@ .sbss : { *(.sbss .sbss.*) } .bss : { *(.bss .bss.*) } - .bss..stack : { *(.bss) } + .bss..stack : { *(.bss) } /* BUG??? we already absorbed it into .bss */ As the comments says the last line is redundant - remove it. --- linux-2.6.35-rc4/include/asm-generic/vmlinux.lds.h +++ linux-2.6.35-rc4.new/include/asm-generic/vmlinux.lds.h @@ -140,9 +140,21 @@ #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 .data.[A-Za-z0-9_$^]*) \ *(.ref.data) \ DEV_KEEP(init.data) \ DEV_KEEP(exit.data) \ @@ -202,7 +214,7 @@ . = ALIGN((align)); \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__start_rodata) = .; \ - *(.rodata) *(.rodata.*) \ + *(.rodata .rodata.[A-Za-z0-9_$^]*) \ .rodata deserve same comment as .data