ld: SECTIONS
1
1 3.6 SECTIONS Command
1 ====================
1
1 The 'SECTIONS' command tells the linker how to map input sections into
1 output sections, and how to place the output sections in memory.
1
1 The format of the 'SECTIONS' command is:
1 SECTIONS
1 {
1 SECTIONS-COMMAND
1 SECTIONS-COMMAND
1 ...
1 }
1
1 Each SECTIONS-COMMAND may of be one of the following:
1
1 * an 'ENTRY' command (⇒Entry command Entry Point.)
1 * a symbol assignment (⇒Assignments)
1 * an output section description
1 * an overlay description
1
1 The 'ENTRY' command and symbol assignments are permitted inside the
1 'SECTIONS' command for convenience in using the location counter in
1 those commands. This can also make the linker script easier to
1 understand because you can use those commands at meaningful points in
1 the layout of the output file.
1
1 Output section descriptions and overlay descriptions are described
1 below.
1
1 If you do not use a 'SECTIONS' command in your linker script, the
1 linker will place each input section into an identically named output
1 section in the order that the sections are first encountered in the
1 input files. If all input sections are present in the first file, for
1 example, the order of sections in the output file will match the order
1 in the first input file. The first section will be at address zero.
1
Menu