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