The command language provides explicit control over the link process, allowing complete specification of the mapping between the linker's input files and its output. It controls:
output file layout
addresses of sections
placement of common blocks
You may supply a command file (also known as a linker script) to the linker either explicitly through the -T option, or implicitly as an ordinary file. Normally you should use the -T option. An implicit linker script should only be used when you want to augment, rather than replace, the default linker script; typically an implicit linker script would consist only of INPUT or GROUP commands.
If the linker opens a file that it cannot recognize as a supported object or archive format, nor as a linker script, it reports an error.
The linker command language is a collection of statements; some are simple keywords setting a particular option, some are used to select and group input files or name output files; and two statement types have a fundamental and pervasive impact on the linking process.
The most fundamental command of the linker command language is the SECTIONS command (see Section 39.4.). Every meaningful command script must have a SECTIONS command: it specifies a "picture" of the output file's layout, in varying degrees of detail. No other command is required in all cases.
The MEMORY command complements SECTIONS by describing the available memory in the target architecture. This command is optional; if you don't use a MEMORY command, the linker assumes sufficient memory is available in a contiguous block for all output. See Section 39.3.
You may include comments in linker scripts just as in C: delimited by "/*" and "*/". As in C, comments are syntactically equivalent to white-space.