ARM Technical Support Knowledge Articles

armlink/fromelf: Merging load regions to obtain a single binary output

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

Answer

When placing code and data using scatter-loading, you might need to place more than one execution region at a fixed address in e.g. ROM or Flash, which must not be moved or copied to another location.

This can be achieved using the FIXED attribute for regions within the scatter file. The FIXED attribute forces the load address and execution address of a region to be the same (making it a 'root region'), so that it will not be moved/copied. This is achieved by inserting padding into the output file.

For example:

ROM_1 0x0 0x20000
{
  ER_1 0x0
  {
    init.o (+RO, +FIRST)
    * (+RO)
  }
  
  ER_2 0x10000 FIXED
  {
    app.o (+RO)
  }
  
  RAM 0x20000
  {
    * (+RW, +ZI)
  }
} 

Note the use of FIXED, so that both ER_1 and ER_2 are root regions, and only one output file is created by fromelf (named ER_1).

An alternative techinique is to use one of the fromelf options: --bincombined (available in RVCT 4.0 or later), --i32combined or --m32combined.  These options will generate one output file for an image containing multiple load regions, with a root region in each.

Article last edited on: 2012-03-22 12:12:39

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