06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.18 Symdefs file format<br />

7.18.1 Example symdefs file<br />

Accessing and managing symbols with armlink<br />

The symdefs file defines symbols and <strong>the</strong>ir values. The file consists of:<br />

Identification line<br />

The identification line in a symdefs file comprises:<br />

• an identifying string, ##, which must be <strong>the</strong> first 11 characters in<br />

<strong>the</strong> file for <strong>the</strong> linker to recognize it as a symdefs file<br />

• linker version information, in <strong>the</strong> format:<br />

<strong>ARM</strong> <strong>Linker</strong>, <strong>ARM</strong>CCver [Build num]:<br />

• date and time of <strong>the</strong> most recent update of <strong>the</strong> symdefs file, in <strong>the</strong> format:<br />

Last Updated: Date<br />

The version and update information are not part of <strong>the</strong> identifying string.<br />

Comments You can insert comments manually with a text editor. Comments have <strong>the</strong><br />

following properties:<br />

• The first line must start with <strong>the</strong> special identifying comment ##.<br />

This comment is inserted by <strong>the</strong> linker when <strong>the</strong> file is produced and must<br />

not be manually deleted.<br />

• Any line where <strong>the</strong> first non-whitespace character is a semicolon (;) or hash<br />

(#) is a comment.<br />

• A semicolon (;) or hash (#) after <strong>the</strong> first non-whitespace character does not<br />

start a comment.<br />

• Blank lines are ignored and can be inserted to improve readability.<br />

Symbol information<br />

The symbol information is provided on a single line, and comprises:<br />

Symbol value The linker writes <strong>the</strong> absolute address of <strong>the</strong> symbol in fixed<br />

hexadecimal format, for example, 0x00008000. If you edit<br />

<strong>the</strong> file, you can use ei<strong>the</strong>r hexadecimal or decimal formats<br />

for <strong>the</strong> address value.<br />

Type flag A single letter to show symbol type:<br />

A <strong>ARM</strong> code<br />

T Thumb code<br />

D Data<br />

N Number.<br />

Symbol name The symbol name.<br />

This example shows a typical symdefs file format:<br />

## <strong>ARM</strong> <strong>Linker</strong>, <strong>ARM</strong>CC41 [Build num]: Last Updated: Date<br />

;value type name, this is an added comment<br />

0x00008000 A __main<br />

0x00008004 A __scatterload<br />

0x000080E0 T main<br />

0x0000814D T _main_arg<br />

Example 7-3 Symdefs file format<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 7-21<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!