From patchwork Fri Jul 23 20:29:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 114004 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 o6NKTnuQ001844 for ; Fri, 23 Jul 2010 20:29:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756562Ab0GWU3s (ORCPT ); Fri, 23 Jul 2010 16:29:48 -0400 Received: from pfepa.post.tele.dk ([195.41.46.235]:38899 "EHLO pfepa.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754029Ab0GWU3r (ORCPT ); Fri, 23 Jul 2010 16:29:47 -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 10580A50025; Fri, 23 Jul 2010 22:29:45 +0200 (CEST) Date: Fri, 23 Jul 2010 22:29:46 +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: <20100723202946.GA27288@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:29:49 +0000 (UTC) --- linux-2.6.35-rc4/scripts/module-common.lds +++ linux-2.6.35-rc4.new/scripts/module-common.lds @@ -3,6 +3,29 @@ * Archs are free to supply their own linker scripts. ld will * combine them automatically. */ + +/* .data.foo are generated by gcc itself with -fdata-sections, + * whereas double-dot sections (like .data..percpu) are generated + * by kernel's magic macros. + * + * Since this script does not specify what to do with double-dot sections, + * ld -r will coalesce all .data..foo input sections into one .data..foo + * output section, all .data..bar input sections into one .data..bar + * output section and so on. This is exactly what we want. + * + * Same goes for .text, .bss and .rodata. In case of .rodata, various + * .rodata.foo sections are generated by gcc even without -fdata-sections + */ + SECTIONS { + + /* Coalesce sections produced by gcc -ffunction-sections */ + .text 0 : AT(0) { *(.text .text.[A-Za-z0-9_$^]*) } + + /* Coalesce sections produced by gcc -fdata-sections */ + .rodata 0 : AT(0) { *(.rodata .rodata.[A-Za-z0-9_$^]*) } + .data 0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) } + .bss 0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) } + /DISCARD/ : { *(.discard) } }