Strange LMA/VMA behavior with regions

Anitha Boyapati anitha.boyapati@gmail.com
Fri May 13 04:15:00 GMT 2011


On 13 May 2011 09:10, Alan Modra <amodra@gmail.com> wrote:
> On Fri, May 13, 2011 at 08:14:19AM +0530, Anitha Boyapati wrote:
>> This is a bug.
>
> No, it is not.  Your script sets the VMA in two ways, an address on
> the output section, *and* by specifying a region with '>'.  The
> address overrides the region, so that is what you get for VMA. You

Agreed.

> are setting the LMA by specifying a region with 'AT>', so you get the
> current address of the region for LMA.
>

Oops. I have missed that. Point taken.

In the process of verifying further, I have changed the linker script
by removing 'AT>' , still same output is observed.

  1 .text_os      00000008  80000008  80000002  00000408  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, CODE

I am not specifying any LMA in this case but still I get the current
location for the LMA (Is this also expected?)

( However, if I don't specify VMA using '>', both LMA and VMA are
equal. Please find custom linker script attached for your convenience.
)


Anitha
-------------- next part --------------
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32",
	      "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
SEARCH_DIR("/proj/builds/AVR32_REL_3.2.0_build00/install/avr32/lib");
/* Do we need any of these for elf?
   __DYNAMIC = 0;    */
MEMORY
{
    FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 512K
}

/*
PHDRS {

flash PT_LOAD;
}
*/

SECTIONS
{
  .mysec1_os          :
  {
    *(.mysec1)
  } >FLASH AT>FLASH
  .text_os  ALIGN(8) : 
  {
    *(.text .text.* )
  } > FLASH
}


More information about the Binutils mailing list