Commit | Line | Data |
---|---|---|
9d06555c HPN |
1 | # This is for embedded products (no MMU) with ELF. |
2 | MACHINE= | |
3 | SCRIPT_NAME=elf | |
4 | TEMPLATE_NAME=elf32 | |
24dd9f75 HPN |
5 | |
6 | # Symbols have underscore prepended. | |
7 | OUTPUT_FORMAT="elf32-us-cris" | |
9d06555c HPN |
8 | ARCH=cris |
9 | MAXPAGESIZE=32 | |
24dd9f75 | 10 | ENTRY=__start |
9d06555c HPN |
11 | EMBEDDED=yes |
12 | ALIGNMENT=32 | |
13 | TEXT_START_ADDR=0 | |
14 | ||
15 | # Put crt0 for flash/eprom etc. in this section. | |
5a8e7be2 AM |
16 | INITIAL_READONLY_SECTIONS= |
17 | if test -z "${CREATE_SHLIB}"; then | |
18 | INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" | |
19 | fi | |
20 | INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS} | |
21 | .startup : { KEEP(*(.startup)) }" | |
9d06555c | 22 | |
589bad82 HPN |
23 | # Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want |
24 | # most of the time, which is the start of all read-only sections; | |
25 | # there's at least .startup and .init before it. We have to resort to | |
26 | # trickery. Note that __Stext is always defined, not PROVIDE:d, since | |
27 | # external tools look for it. | |
28 | TEXT_START_SYMBOLS='__Stext = ADDR (.startup);' | |
29 | ||
24dd9f75 HPN |
30 | # The __start dance is to get us through assumptions about entry |
31 | # symbols, and to clear _start for normal use with sane programs. | |
32 | EXECUTABLE_SYMBOLS=' | |
24dd9f75 HPN |
33 | __start = DEFINED(__start) ? __start : |
34 | DEFINED(_start) ? _start : | |
35 | DEFINED(start) ? start : | |
36 | DEFINED(.startup) ? .startup + 2 : 2; | |
37 | ' | |
9d06555c HPN |
38 | |
39 | # Smuggle an "OTHER_TEXT_END_SYMBOLS" here. | |
465bc359 | 40 | OTHER_READONLY_SECTIONS="${RELOCATING+PROVIDE (__Etext = .);}" |
9d06555c HPN |
41 | DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' |
42 | ||
43 | # Smuggle an "OTHER_DATA_END_SYMBOLS" here. | |
465bc359 | 44 | OTHER_SDATA_SECTIONS="${RELOCATING+PROVIDE (__Edata = .);}" |
9d06555c HPN |
45 | |
46 | # If .bss does not immediately follow .data but has its own start | |
47 | # address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we | |
48 | # use ADDR(.bss) there. Instead, we use the symbol support for the | |
49 | # end symbol. | |
827a1c67 | 50 | OTHER_BSS_END_SYMBOLS=' |
9d06555c | 51 | PROVIDE (__Ebss = .); |
5b5cd1b0 | 52 | __Sbss = ADDR (.bss); |
9d06555c HPN |
53 | PROVIDE (_bss_start = __Sbss); |
54 | ' | |
827a1c67 | 55 | OTHER_END_SYMBOLS='PROVIDE (__end = .);' |
9d06555c HPN |
56 | |
57 | INIT_START=' | |
58 | . = ALIGN(2); | |
59 | ___init__start = .; | |
60 | PROVIDE (___do_global_ctors = .); | |
9d06555c HPN |
61 | ' |
62 | ||
63 | INIT_END=' | |
9d06555c HPN |
64 | PROVIDE (__init__end = .); |
65 | PROVIDE (___init__end = .); | |
66 | ' | |
67 | ||
68 | FINI_START=' | |
69 | . = ALIGN (2); | |
70 | ___fini__start = .; | |
71 | PROVIDE (___do_global_dtors = .); | |
9d06555c HPN |
72 | ' |
73 | ||
74 | FINI_END=' | |
9d06555c HPN |
75 | PROVIDE (__fini__end = .); |
76 | ___fini__end = .; | |
77 | ' | |
78 | ||
79 | CTOR_START=' | |
80 | PROVIDE (___ctors = .); | |
81 | ___elf_ctors_dtors_begin = .; | |
82 | ' | |
83 | ||
84 | CTOR_END=' | |
85 | PROVIDE (___ctors_end = .); | |
86 | ' | |
87 | ||
88 | DTOR_START=' | |
89 | PROVIDE (___dtors = .); | |
90 | ' | |
91 | ||
92 | CTOR_END=' | |
93 | PROVIDE (___dtors_end = .); | |
94 | ___elf_ctors_dtors_end = .; | |
95 | ' | |
96 | ||
9d06555c | 97 | # Also add the other symbols provided for rsim/xsim and elinux. |
827a1c67 | 98 | OTHER_SYMBOLS=' |
465bc359 AM |
99 | PROVIDE (__Eall = .); |
100 | PROVIDE (__Endmem = 0x10000000); | |
5b5cd1b0 HPN |
101 | PROVIDE (__Stacksize = 0); |
102 | ' | |
103 | NO_SMALL_DATA=yes |