Section Data Expressions
Although these statements are shown separately here for ease of presentation,
no such segregation is needed within a section definition in the
For instance, with
You can accomplish this by defining the output
symbol= expression;
When you assign a value to a symbol within a particular section definition,
the value is relative to the beginning of the section (see
If you write input like the following,
BYTE(expression)
Multiple-byte quantities are represented in whatever byte order is appropriate
for the output file format (see
Create a symbol for each input file in the current section, set to the address
of the first byte of data written from that input file.
.text 0x2020 :
{
CREATE_OBJECT_SYMBOLS
*(.text)
_etext = ALIGN(0x2000);
}
...
}
afunction() { }
int adata=1;
int abss;
00004020 B _abss
00004000 D _adata
00002020 T _afunction
00004024 B _bbss
00004008 D _bdata
00002038 T _bfunction
00004028 B _cbss
00004010 D _cdata
00002050 T _cfunction
0000402c B _dbss
00004018 D _ddata
00002068 T _dfunction
00004020 D _edata
00004030 B _end
00004000 T _etext
00002020 t a.o
00002038 t b.o
00002050 t c.o
00002068 t d.o
symbol f= expression;
symbol
abs =14;
...
.data : { ...
rel=14 ; ...
} abs2 = 14 + ADDR(.data);
...
}
SHORT(expression)
LONG(expression)
QUAD(expression)
Specify the “fill pattern” for the current section. Any unspecified regions of
memory within the section (for example, regions you skip over by assigning a
new value to the location counter ‘.’) are filled with the two least significant bytes from the expression argument. A FILL statement covers memory locations after the point it occurs in the section definition; by including more than one FILL statement, you can have different fill patterns in different parts of an
output section.