Creating a linker script

Generating a linker script for an application

To generate a linker script for an application, do the following:

  1. Select the application project in the Project Navigator or C/C++ Projects view, and right-click Generate Linker Script or click Xilinx Tools > Generate Linker Script.
  2. The left side of the dialog box is read-only except for Output Script name and project build settings in Modify project build settings as follows.
  3. Configure the following sections of the Linker Script Generator dialog box Basic tab:

  4. If you require more control over the definition of memory sections and assignments to them, use the Linker Script Generator dialog box Advanced tab:

  5. Click OK. If there are errors, they must be corrected before you can build your application with the new linker script.

Note: If the linker script already exists, a message window appears, asking if you want to overwrite the file. Click OK to overwrite the file or Cancel to cancel the overwrite.

SDK automatically adds the linker script to the linker settings for a managed make project based on the options selected in Modify project build settings as follows.

Adding the linker script manually

If you want to manually add the linker script for a managed make flow, do the following:

  1. Right-click your managed make project and select C/C++ Build Settings.
  2. Click the linker corresponding to your target processor, for example MicroBlaze gcc linker.
  3. Select Linker Script to add the linker script.

For standard make projects, add the linker script manually to your makefile linker options.
Related concepts
Linker scripts

Related tasks
Building projects

Copyright 1995-2011 Xilinx, Inc. All rights reserved.