2000-10-09 Kazu Hirata <kazu@hxi.com>
[deliverable/binutils-gdb.git] / ld / scripttempl / crisaout.sc
1 cat <<EOF
2 OUTPUT_FORMAT("a.out-cris")
3 OUTPUT_ARCH(cris)
4 ENTRY(__start)
5 SECTIONS
6 {
7 .text ${RELOCATING+ ${TEXT_START_ADDR}}:
8 {
9 CREATE_OBJECT_SYMBOLS;
10 ${RELOCATING+ __Stext = .;}
11 ${RELOCATING+*(.startup)}
12 *(.text)
13 ${RELOCATING+__start = DEFINED(__start) ? __start :
14 DEFINED(_start) ? _start :
15 DEFINED(start) ? start :
16 DEFINED(.startup) ? .startup + 2 : 2;}
17 ${RELOCATING+*(.text.*)}
18 ${RELOCATING+*(.gnu.linkonce.t*)}
19 ${RELOCATING+*(.rodata)}
20 ${RELOCATING+*(.rodata.*)}
21 ${RELOCATING+*(.gnu.linkonce.r*)}
22
23 /* Do not "provide" init-start and fini-start symbols; they might be
24 referred to weakly, so the linker would not override the zero
25 default.
26 FIXME: It's somewhat unexpected to have code emitted by the linker
27 script. Some other mechanism could probably do better. */
28 ${RELOCATING+. = ALIGN (2);}
29 ${RELOCATING+ ___init__start = .;}
30 ${RELOCATING+PROVIDE (___do_global_ctors = .);}
31 ${RELOCATING+SHORT (0xe1fc); /* push srp */}
32 ${RELOCATING+SHORT (0xbe7e);}
33 ${RELOCATING+*(.init)}
34 ${RELOCATING+SHORT (0x0d3e); /* jump [sp+] */}
35 ${RELOCATING+PROVIDE (__init__end = .);}
36 ${RELOCATING+PROVIDE (___init__end = .);}
37
38 ${RELOCATING+. = ALIGN (2);}
39 ${RELOCATING+ ___fini__start = .;}
40 ${RELOCATING+PROVIDE (___do_global_dtors = .);}
41 ${RELOCATING+SHORT (0xe1fc); /* push srp */}
42 ${RELOCATING+SHORT (0xbe7e);}
43 ${RELOCATING+*(.fini)}
44 ${RELOCATING+SHORT (0x0d3e); /* jump [sp+] */}
45 ${RELOCATING+PROVIDE (__fini__end = .);}
46 ${RELOCATING+ ___fini__end = .;}
47
48 /* Cater to linking from ELF. */
49 ${CONSTRUCTING+ PROVIDE(___ctors = .);}
50 ${CONSTRUCTING+ ___elf_ctors_dtors_begin = .;}
51 ${CONSTRUCTING+ KEEP (*crtbegin.o(.ctors))}
52 ${CONSTRUCTING+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))}
53 ${CONSTRUCTING+ KEEP (*(SORT(.ctors.*)))}
54 ${CONSTRUCTING+ KEEP (*(.ctors))}
55 ${CONSTRUCTING+ PROVIDE(___ctors_end = .);}
56
57 ${CONSTRUCTING+ PROVIDE(___dtors = .);}
58 ${CONSTRUCTING+ KEEP (*crtbegin.o(.dtors))}
59 ${CONSTRUCTING+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))}
60 ${CONSTRUCTING+ KEEP (*(SORT(.dtors.*)))}
61 ${CONSTRUCTING+ KEEP (*(.dtors))}
62 ${CONSTRUCTING+ PROVIDE(___dtors_end = .);}
63 ${CONSTRUCTING+ ___elf_ctors_dtors_end = .;}
64
65 ${RELOCATING+ __Etext = .;}
66
67 /* Deprecated, use __Etext. */
68 ${RELOCATING+ PROVIDE(_etext = .);}
69 }
70
71 /* Any dot-relative start-expression (such as "ALIGN(2)", also including
72 the "default" .data alignment expression) will use the initial, raw
73 size of .text and will be incorrect if the alignment used is less
74 than the alignment for .text (which might depend on input and obj
75 format). FIXME: Seems like a bug in ld. Seems hard to fix. Seems
76 unimportant. */
77 .data :
78 {
79 ${RELOCATING+ __Sdata = .;}
80 *(.data);
81 ${RELOCATING+*(.data.*)}
82 ${RELOCATING+*(.gnu.linkonce.d*)}
83 ${RELOCATING+*(.eh_frame) /* FIXME: Make .text */}
84 ${RELOCATING+*(.gcc_except_table)}
85 ${RELOCATING+ __Edata = .;}
86
87 /* Deprecated, use __Edata. */
88 ${RELOCATING+ PROVIDE(_edata = .);}
89 }
90
91 .bss :
92 {
93 /* Deprecated, use __Sbss. */
94 ${RELOCATING+ PROVIDE(_bss_start = .);}
95
96 ${RELOCATING+ __Sbss = .;}
97 *(.bss)
98 ${RELOCATING+*(.bss.*)}
99 *(COMMON)
100 ${RELOCATING+ __Ebss = .;}
101
102 /* Deprecated, use __Ebss or __Eall as appropriate. */
103 ${RELOCATING+ PROVIDE(_end = .);}
104 ${RELOCATING+ PROVIDE(__end = .);}
105 }
106 ${RELOCATING+ __Eall = .;}
107
108 /* Unfortunately, stabs are not mappable from ELF to a.out.
109 It can probably be fixed with some amount of work. */
110 /DISCARD/ :
111 { *(.stab) *(.stab*) *(.debug) *(.debug*) *(.comment) *(.gnu.warning.*) }
112
113 /* For the rsim and xsim simulators. */
114 ${RELOCATING+ PROVIDE(__Endmem = 0x10000000);}
115
116 /* For elinux. */
117 ${RELOCATING+ PROVIDE(__Stacksize = 0);}
118 }
119 EOF
This page took 0.032008 seconds and 4 git commands to generate.