From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12506 invoked by alias); 11 May 2011 08:12:23 -0000 Received: (qmail 12494 invoked by uid 22791); 11 May 2011 08:12:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_BJ,TW_JC,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 May 2011 08:12:08 +0000 Received: by iwg8 with SMTP id 8so441657iwg.0 for ; Wed, 11 May 2011 01:12:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.173.133 with SMTP id r5mr4925287icz.47.1305101527468; Wed, 11 May 2011 01:12:07 -0700 (PDT) Received: by 10.42.196.70 with HTTP; Wed, 11 May 2011 01:12:07 -0700 (PDT) In-Reply-To: <20110511071806.GD3625@bubble.grove.modra.org> References: <20110428005642.GG19947@bubble.grove.modra.org> <20110429003231.GO19947@bubble.grove.modra.org> <20110505003450.GD7018@bubble.grove.modra.org> <20110505035729.GF7018@bubble.grove.modra.org> <20110511071806.GD3625@bubble.grove.modra.org> Date: Wed, 11 May 2011 08:12:00 -0000 Message-ID: Subject: Re: some question about output section From: loody To: amodra@gmail.com, binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00137.txt.bz2 HI: 2011/5/11 Alan Modra : > On Wed, May 11, 2011 at 02:27:09PM +0800, loody wrote: >> 2. I found if the LMA of 2 sections are quite close, the size of >> objcopy will get small, script1. >> But why if the LMA of third section is close to previous section, the >> size will still get big, script2? > > Why do you think the LMAs are close? I think it will be better if I say "the binary size that objcopy generate is quite small, when the LMA of section2 is right behind the section1." > > Your scripts are setting LMA of a section to the end VMA of the > previous section. =A0I suspect that wasn't what you intended. in script2, "text' is the place that flash running for and "onlyTest" is located at dram area. That means, I can put some functions that need performance in "onlyTest" and this part of code will copy to dram at the end of "text" section. > See ld.info LOADADDR and SIZEOF. > Thank you,