ARM Technical Support Knowledge Articles

Can I use the same name for a load region and an execution region?

Applies to: DS-5, RealView Development Suite (RVDS)

Answer

It is ambiguous to have the same name for a load region and an execution region, although most of the time the linker will fail to report an error or warning.  

In the following scatter-file example, where ImageLimit(A) is used, the linker selects load region A rather than execution region A, which may not be what you would expect.

A 0x1000      ; load region A
{
   A_ER +0     
   {
        test.o(+RO)
   }
   A 0x2000   ; execution region A
   {
   }
}

B 0x4000
{
   B_ER ImageLimit(A)   ; expecting linker to place execution region B_ER after execution region A has finished
   {
     *(+RO, +RW, +ZI)
   }
}

The linker options --map --load_addr_map_info show that B_ER starts from 0x1010 instead of after the end of execution region A (address 0x2000 because execution region A is empty).

Memory Map of the image

Image Entry point : 0x00001000

Load Region A (Base: 0x00001000, Size: 0x00000010, Max: 0xffffffff, ABSOLUTE)
  Execution Region A_ER (Base: 0x00001000, Size: 0x00000010, Max: 0xffffffff, ABSOLUTE)
  Base Addr  Size       Type  Attr  Idx E Section Name Object
  0x00001000 0x00000010 Code   RO    1    * .text      test.o

  Execution Region A (Base: 0x00002000, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
  **** No section assigned to this execution region ****

Load Region B (Base: 0x00004000, Size: 0x00000004, Max: 0xffffffff, ABSOLUTE)
  Execution Region B_ER (Base: 0x00001010, Size: 0x00000004, Max: 0xffffffff, ABSOLUTE)
  Base Addr  Size       Type  Attr  Idx E Section Name Object
  0x00001010 0x00000004 Data  RW    2      .data       test.o


ARM Compiler tools do not emit an error or warning message about the ambiguity of the region names.

Workaround

To avoid this situation, you need to rename one of the regions. 

Article last edited on: 2012-04-24 11:54:37

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential