A linker combines and arranges data and instructions from one or more object code files into a single file, or
image. This image is ready to execute on the target platform. The CodeWarrior linker uses settings from the host's integrated development environment (IDE) or command line to determine how to generate the image file.
The linker also normally requires a linker command file and may read a 'libs.db' file that defines the
EWL
(Embedded Warrior Library) model. A linker command file allows you to specify precise details of how data and instructions should be arranged in the image file.
Note: For more information on the Embedded Warrior Library (EWL) for C or C++, see the following manuals: EWL C Reference and EWL C++ Reference
The following is the list of steps the CodeWarrior linker takes to build an executable image.
- read settings : retrieves your settings from the IDE or the command line to determine how to perform subsequent steps
- read linker command file : retrieves commands to determine how to arrange object code in the final image
- read object code : retrieves data and executable objects that are the result of compilation or assembly
- delete unused objects ("deadstripping") : deletes objects that are not referred to by the rest of the program
- resolve references among objects : arranges objects to compose the image then computes the addresses of the objects
- output link map and image files : writes files on the host system, ready to load onto the target system