Linker
Creating a link map
To create a linker map file:
- Select your project in Project Explorer
File->Properties
- In the left-hand panel, select:
- C/C++ Build
- Settings
- C/C++ Build
- Then in the right-hand panel, select
- MCU Linker
- Miscellaneous
- MCU Linker
- Under the "Other options" add
- -Map=link.map
- Now rebuild and you will have a complete linker map called link.map
Creating a symbolic load map
The objdump ('arm-none-eabi-objdump') utility is used create a load map. This is the information used to load the image into memory. To automatically create a load map every time you do a build:
- Select the project in the Project Explorer
- Right-click and select "Properties"
- Expand the "C/C++ Build" item
- Click on "Settings"
- Select the "Build steps" tab
- In the "Post-build steps" "Command" field, enter:
arm-none-eabi-objdump -h -S ${BuildArtifactFileName} >${BuildArtifactFileBaseName}.lss
- Click apply
Next time you do a build, this will now run and create you a linker map in a file called <projectname>.lss
Additional information
1. Within the pre- and post-build steps, you can enter multiple commands, separated by a ";". For example, to display the size of the target executable and get a link map, enter the following command To enable it, do the following: <pre> arm-none-eabi-size ${BuildArtifactFileName}; arm-none-eabi-objdump -h -S ${BuildArtifactFileName} >${BuildArtifactFileBaseName}.lss </pre>
2. To view the objdump documentation: To find the options you can use with objdump, see
Help->Help Contents
- Code Red Technologies Documentation
- Tools Documentation
- GNU Binary utilities
- Tools Documentation
