www.delorie.com/gnu/docs/binutils/ld_6.html   search  
Buy GNU books!

Untitled Document

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Linker Scripts

Every link is controlled by a linker script. This script is written in the linker command language.

The main purpose of the linker script is to describe how the sections in the input files should be mapped into the output file, and to control the memory layout of the output file. Most linker scripts do nothing more than this. However, when necessary, the linker script can also direct the linker to perform many other operations, using the commands described below.

The linker always uses a linker script. If you do not supply one yourself, the linker will use a default script that is compiled into the linker executable. You can use the `--verbose' command line option to display the default linker script. Certain command line options, such as `-r' or `-N', will affect the default linker script.

You may supply your own linker script by using the `-T' command line option. When you do this, your linker script will replace the default linker script.

You may also use linker scripts implicitly by naming them as input files to the linker, as though they were files to be linked. See section 3.11 Implicit Linker Scripts.

3.1 Basic Linker Script Concepts  
3.2 Linker Script Format  
3.3 Simple Linker Script Example  
3.4 Simple Linker Script Commands  
3.5 Assigning Values to Symbols  
3.6 SECTIONS command  SECTIONS Command
3.7 MEMORY command  MEMORY Command
3.8 PHDRS Command  
3.9 VERSION Command  
3.10 Expressions in Linker Scripts  
3.11 Implicit Linker Scripts  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003