3.3.2 Section placement with the FIRST and LAST attributes

You can make sure that a section is placed either first or last in its execution region. For example, you might want to make sure the section containing the vector table is placed first in the image.

To do this, use one of the following methods:
  • If you are not using scatter-loading, use the --first and --last linker command-line options to place input sections.
  • If you are using scatter-loading, use the attributes FIRST and LAST in the scatter file to mark the first and last input sections in an execution region if the placement order is important.
    However, FIRST and LAST must not violate the basic attribute sorting order. For example, FIRST RW is placed after any read-only code or read-only data.
Related concepts
3.1 The structure of an ARM ELF image
3.1.2 Input sections, output sections, regions, and program segments
3.1.3 Load view and execution view of an image
7.1 The scatter-loading mechanism
Related reference
8.5.2 Syntax of an input section description
9.50 --first=section_id
9.64 --last=section_id
Non-ConfidentialPDF file icon PDF versionARM DUI0377G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.