SPRUIG8J January 2018 – March 2024
In Example12-4, 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 Example12-4 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 rts7100_le.lib into the .rtstest section:
SECTIONS
{
.rtstest { -l rts7100_le.lib(.text) } > RAM
}