* ldgram.y: Add support for REGION_ALIAS operator.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-scripts / memory.t
CommitLineData
3ec57632
NC
1MEMORY
2{
4a93e180
NC
3 R_TEXTMEM (ARX) : ORIGIN = 0x100, LENGTH = 32K
4 R_DATAMEM (AW) : org = 0x1000, l = (64 * 1024)
3ec57632
NC
5}
6
4a93e180
NC
7REGION_ALIAS ("A_TEXTMEM", R_TEXTMEM);
8REGION_ALIAS ("A_DATAMEM", R_DATAMEM);
9
10REGION_ALIAS ("TEXTMEM", A_TEXTMEM);
11REGION_ALIAS ("DATAMEM", A_DATAMEM);
12
3ec57632
NC
13SECTIONS
14{
15 . = 0;
16 .text :
17 {
18 /* The value returned by the ORIGIN operator is a constant.
19 However it is being assigned to a symbol declared within
20 a section. Therefore the symbol is section-relative and
21 its value will include the offset of that section from
22 the start of memory. ie the declaration:
23 text_start = ORIGIN (TEXTMEM);
24 here will result in text_start having a value of 0x200.
25 Hence we need to subtract the absolute value of the
26 location counter at this point in order to give text_start
27 a value that is truely absolute, and which coincidentally
28 will allow the tests in script.exp to work. */
29
30 text_start = ORIGIN(TEXTMEM) - ABSOLUTE (.);
31 *(.text)
32 *(.pr)
33 text_end = .;
34 } > TEXTMEM
35
36 data_start = ORIGIN (DATAMEM);
37 .data :
38 {
39 *(.data)
40 *(.rw)
41 data_end = .;
42 } >DATAMEM
43
44 fred = ORIGIN(DATAMEM) + LENGTH(DATAMEM);
45}
This page took 0.214395 seconds and 4 git commands to generate.