public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: VMA and LMA calculation when section alignment is non null
       [not found] <BANLkTik6TcHnFHvV00ZYCrwOPeNSbAFGyw@mail.gmail.com>
@ 2011-04-20 19:40 ` Anitha Boyapati
  0 siblings, 0 replies; only message in thread
From: Anitha Boyapati @ 2011-04-20 19:40 UTC (permalink / raw)
  To: binutils; +Cc: Anitha Boyapati

On 20 April 2011 23:57, Anitha Boyapati <anitha.boyapati@gmail.com> wrote:
>
>
> Hi,
>
> I would like know more about LMA/VMA calculations.  Here is a small linker script (trimmed to relevant portions)
>
>  MEMORY
> {
>     FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 512K
> }
> SECTIONS
> {
>   .mysec1_os          :
>   {
>     *(.mysec1)
>   } >FLASH AT>FLASH
>   .text_os           :
>   {
>     *(.text .text.* )
>   } > FLASH AT>FLASH
> }
>
> It turns out that for some small application which uses .balign 8, the VMA and LMA of .text_os differs. I was debugging this when I hit the function lang_size_sections_1() from ldlang.c. As far as I understand VMA is caculated using os->bfd_section->alignment_power which is then set using bfd_set_section_vma(). This macro sets both lma and vma to some valid value.
>
> Now for lma processing, os->section_alignment is being used. What is the difference between os->bfd_section->alignment_power and os->section_alignment ? The values are different (It is 3 for former and -1 for latter). Please help.
> ...
>  if (os->section_alignment != -1)
>    lma = align_power (lma, os->section_alignment);
> ...

Hi again.

I am glad I found a relevant thread describing the exact problem
I am facing.

http://sourceware.org/ml/binutils/2010-12/msg00477.html

The given patch solves my issue too. (Sorry I havent referred to the
binutils version I am using. It is 2.20.1). Now my next question :
Since the patch was submitted after binutils 2.21 release, I am assuming that
no release of binutils has this patch included.

I would still appreciate anyone letting me know the difference between
os->bfd_section->alignment_power and os->section_alignment

Thanks
Anitha

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-20 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BANLkTik6TcHnFHvV00ZYCrwOPeNSbAFGyw@mail.gmail.com>
2011-04-20 19:40 ` VMA and LMA calculation when section alignment is non null Anitha Boyapati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).