From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17574 invoked by alias); 12 May 2011 14:09:35 -0000 Received: (qmail 17565 invoked by uid 22791); 12 May 2011 14:09:34 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 May 2011 14:09:20 +0000 Received: by wyf19 with SMTP id 19so1496655wyf.0 for ; Thu, 12 May 2011 07:09:19 -0700 (PDT) Received: by 10.217.2.73 with SMTP id o51mr1876353wes.66.1305209359200; Thu, 12 May 2011 07:09:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.45.1 with HTTP; Thu, 12 May 2011 07:08:59 -0700 (PDT) In-Reply-To: References: From: Anitha Boyapati Date: Thu, 12 May 2011 14:09:00 -0000 Message-ID: Subject: Re: Strange LMA/VMA behavior with regions To: binutils@sourceware.org, amodra@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00172.txt.bz2 > On Wed, May 11, 2011 at 12:50:31PM +0530, Abnikant Singh wrote: >> =A0 .text_os ALIGN(8) : > > This says to set the address of the output section .text_os. =A0When you > set the address, any input section alignment is ignored. =A0This happens I agree that ALIGN() overrides input section alignment. But if we set address for VMA using ALIGN(), should it affect LMA too? I think it should not. To illustrate further, I'll =A0use the initial output presented in the previous post. Please refer to the row of section [ 1] .text_os. Sections: Idx Name =A0 =A0 =A0 =A0 =A0 =A0=A0Size =A0 =A0 =A0VMA =A0 =A0 =A0 LMA =A0 = =A0 =A0 File off =A0Algn =A00 .mysec1_os =A0 =A000000002 =A080000000 =A080000000 =A000000400 =A02**0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CONTENTS, ALLOC, LOA= D, READONLY, CODE =A01 .text_os =A0 =A0 =A0 =A0 =A000000008 =A080000008 =A080000002 =A0000004= 08 =A02**3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CONTENTS, ALLOC, LOA= D, READONLY, CODE Here =A0the value of LMA (=A00x80000002) is not 8-aligned. =A0The section .text_os is described in linker script as: .text_os ALIGN(8) : =A0{ =A0 =A0*(.text .text.* ) ... Note that address of LMA is not set explicitly. In such a scenario it is a little counter-intuitive to see LMA not following input section's alignment (2**3 in this case)=A0although no ALIGN() or AT() have been used. Looks like a bug to me. =A0Please let me know the reason if otherwise. -- Anitha (I was not subscribed to ML, so the conversation was copied from archives. Formatting issues might turn up. Please excuse)