SLAU131V October 2004 – February 2020
SECTIONS
{
boot > BOOT1
{
-l rtsXX.lib<boot.c.obj> (.text)
-l rtsXX.lib<exit.c.obj strcpy.c.obj> (.text)
}
.rts > BOOT2
{
-l rtsXX.lib (.text)
}
.text > RAM
{
* (.text)
}
}
In Example 9, the .text sections of boot.c.obj, exit.c.obj, and strcpy.c.obj are extracted from the run-time-support library and placed in the .boot output section. The remainder of the run-time-support library object that is referenced is allocated to the .rts output section. Finally, the remainder of all other .text sections are to be placed in section .text.
An archive member or a list of members is specified by surrounding the member name(s) with angle brackets < and > after the library name. Any object files separated by commas or spaces from the specified archive file are legal within the angle brackets.
The --library option (which normally implies a library path search be made for the named file following the option) listed before each library in Example 9 is optional when listing specific archive members inside < >. Using < > implies that you are referring to a library.
To collect a set of the input sections from a library in one place, use the --library option within the SECTIONS directive. For example, the following collects all the .text sections from rts430.lib into the .rtstest section:
SECTIONS
{
.rtstest { -l rts430.lib(.text) } > RAM
}
NOTE
SECTIONS Directive Effect on --prioritySpecifying a library in a SECTIONS directive causes that library to be entered in the list of libraries that the linker searches to resolve references. If you use the --priority option, the first library specified in the command file will be searched first.