Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The GNU linker. - <b>specifying output sections</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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: Entry
Point:, and Assignment:.  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.


See Also: Entry Point Assignment

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson