How to Create a Customized Linker Directives File

It is strongly suggested that you consult the existing default linker directives examples provided in the target library directories of the distribution. When you do not specify a linker directives file for a program build, these default directives files will be used. The default linker directives filenames are:

default.lnk Used for normal, absolutely-located programs

pic.lnk Appropriate for PIC (Position Independent Code) programs

pid.lnk Appropriate for PID (Position Independent Data) programs

picpid.lnk Appropriate when using both PIC and PID

Not all target library directories will contain all of these linker directives files, although default.lnk exists in the default target library directory for all targets. A suggested method for customizing a linker directives file is to copy the default link map and make appropriate changes to it, such as altering the addresses of text and data, specifying additional user-defined sections, changing the sizes of the stack (via .stack) and heap (via .heap) areas, specifying different sections to be placed in ROM, and removing unnecessary sections. Before removing a section from the linker directives file, please read the following section on Special Sections. Starting from a default section map reduces the risk of failing to include a required section.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.