Whole document tree
    

Whole document tree

Untitled Document: SECTIONS
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Specifying Output Sections

The SECTIONS command controls exactly where input sections are placed into output sections, their order in the output file, and to which output sections they are allocated.

You may use at most one SECTIONS command in a script file, but you can have as many statements within it as you wish. Statements within the SECTIONS command can do one of three things:

  • define the entry point;

  • assign a value to a symbol;

  • describe the placement of a named output section, and which input sections go into it.

You can also use the first two operations--defining the entry point and defining symbols--outside the SECTIONS command: see section 3.6 The Entry Point, and 3.2.6 Assignment: Defining Symbols. They are permitted here as well for your convenience in reading the script, so that symbols and the entry point can be defined at meaningful points in your output-file layout.

If you do not use a SECTIONS command, the linker places each input section into an identically named output section in the order that the sections are first encountered in the input files. If all input sections are present in the first file, for example, the order of sections in the output file will match the order in the first input file.

3.4.1 Section Definitions  
3.4.2 Section Placement  
3.4.3 Section Data Expressions  
3.4.4 Optional Section Attributes  
3.4.5 Overlays  



This document was generated by root on January, 30 2002 using texi2html