Download TR0129 MicroBlaze Embedded Tools Reference
Transcript
Linker Script Language
processor processor_name
{
processor definition
}
memory definitions and/or bus definitions
section_layout space_name
{
section placement statements
}
7.3
Syntax of the Linker Script Language
7.3.1
Preprocessing
When the linker loads an LSL file, the linker processes it with a C−style prepocessor. As such, it strips C and C++ comments.
You can use the standard ISO C preprocessor directives, such as #include, #define, #if/#else/#endif.
For example:
#include "arch.lsl"
Preprocess and include the file arch.lsl at this point in the LSL file.
7.3.2
Lexical Syntax
The following lexicon is used to describe the syntax of the Linker Script Language:
A ::= B
A ::= B C
A ::= B | C
<B>0|1
<B>>=0
<B>>=1
= A is defined as B
= A is defined as B and C; B is followed by C
= A is defined as B or C
= zero or one occurrence of B
= zero of more occurrences of B
= one of more occurrences of B
IDENTIFIER = a character sequence starting with ’a’−’z’, ’A’−’Z’ or ’_’.
Following characters may also be digits and dots ’.’
STRING
= sequence of characters not starting with \n, \r or \t
DQSTRING
= " STRING "
(double quoted string)
OCT_NUM
= octal number, starting with a zero (06, 045)
DEC_NUM
= decimal number, not starting with a zero (14, 1024)
HEX_NUM
= hexadecimal number, starting with ’0x’ (0x0023, 0xFF00)
OCT_NUM, DEC_NUM and HEX_NUM can be followed by a k (kilo), M (mega), or G (giga).
Characters in bold are characters that occur literally. Words in italics are higher order terms that are defined in the same or in
one of the other sections.
To write comments in LSL file, you can use the C style ’/*
*/’ or C++ style ’//’.
7−3