1 | /* Linker script for the SH1 Low-Cost Eval Board. */ |
---|
2 | |
---|
3 | SEARCH_DIR(.) |
---|
4 | GROUP(-lc -lgcc) |
---|
5 | __DYNAMIC = 0; |
---|
6 | |
---|
7 | /* The location of RAM comes from the manual. We also leave an 8K pad |
---|
8 | for the monitor's own working data and stack. Note that the smallest |
---|
9 | boards only have 64K of RAM, so no room for SPEC benchmarks here! */ |
---|
10 | |
---|
11 | MEMORY |
---|
12 | { |
---|
13 | ram (rwx) : ORIGIN = 0xa002000, LENGTH = 0x10000 |
---|
14 | } |
---|
15 | |
---|
16 | /* Put the stack up high. */ |
---|
17 | /* (Commented out because it doesn't seem to work right) */ |
---|
18 | /*PROVIDE (__stack = 0xa00ff00);*/ |
---|
19 | |
---|
20 | /* Initalize some symbols to be zero so we can reference them in the |
---|
21 | crt0 without core dumping. These functions are all optional, but |
---|
22 | we do this so we can have our crt0 always use them if they exist. |
---|
23 | This is so BSPs work better when using the crt0 installed with gcc. |
---|
24 | We have to initalize them twice, so we cover a.out (which prepends |
---|
25 | an underscore) and coff object file formats. */ |
---|
26 | |
---|
27 | PROVIDE (hardware_init_hook = 0); |
---|
28 | PROVIDE (_hardware_init_hook = 0); |
---|
29 | PROVIDE (software_init_hook = 0); |
---|
30 | PROVIDE (_software_init_hook = 0); |
---|
31 | |
---|
32 | /* Put everything in ram (of course). */ |
---|
33 | |
---|
34 | SECTIONS |
---|
35 | { |
---|
36 | .text : |
---|
37 | { |
---|
38 | *(.text) |
---|
39 | . = ALIGN(0x4); |
---|
40 | __CTOR_LIST__ = .; |
---|
41 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
42 | ___ctors = .; |
---|
43 | *(.ctors) |
---|
44 | ___ctors_end = .; |
---|
45 | LONG(0) |
---|
46 | __CTOR_END__ = .; |
---|
47 | __DTOR_LIST__ = .; |
---|
48 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
49 | ___dtors = .; |
---|
50 | *(.dtors) |
---|
51 | ___dtors_end = .; |
---|
52 | LONG(0) |
---|
53 | __DTOR_END__ = .; |
---|
54 | *(.rodata) |
---|
55 | *(.gcc_except_table) |
---|
56 | |
---|
57 | _etext = .; |
---|
58 | *(.lit) |
---|
59 | } > ram |
---|
60 | |
---|
61 | .data BLOCK (0x4) : |
---|
62 | { |
---|
63 | *(.shdata) |
---|
64 | *(.data) |
---|
65 | _edata = .; |
---|
66 | } > ram |
---|
67 | |
---|
68 | .bss BLOCK (0x4) : |
---|
69 | { |
---|
70 | __bss_start = . ; |
---|
71 | *(.shbss) |
---|
72 | *(.bss) |
---|
73 | *(COMMON) |
---|
74 | _end = ALIGN (0x8); |
---|
75 | __end = _end; |
---|
76 | } > ram |
---|
77 | |
---|
78 | /* I know, I know, stack sections are supposed to be useless; but |
---|
79 | this actually worked for me, as opposed to the PROVIDE. */ |
---|
80 | .stack 0xa00ff00 : |
---|
81 | { |
---|
82 | __stack = .; |
---|
83 | } > ram |
---|
84 | |
---|
85 | .stab 0 (NOLOAD) : { *(.stab) } |
---|
86 | .stabstr 0 (NOLOAD) : { *(.stabstr) } |
---|
87 | |
---|
88 | /* DWARF debug sections. |
---|
89 | Symbols in the DWARF debugging sections are relative to |
---|
90 | the beginning of the section so we begin them at 0. */ |
---|
91 | /* DWARF 1 */ |
---|
92 | .debug 0 : { *(.debug) } |
---|
93 | .line 0 : { *(.line) } |
---|
94 | /* GNU DWARF 1 extensions */ |
---|
95 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
96 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
97 | /* DWARF 1.1 and DWARF 2 */ |
---|
98 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
99 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
100 | /* DWARF 2 */ |
---|
101 | .debug_info 0 : { *(.debug_info) } |
---|
102 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
103 | .debug_line 0 : { *(.debug_line) } |
---|
104 | .debug_frame 0 : { *(.debug_frame) } |
---|
105 | .debug_str 0 : { *(.debug_str) } |
---|
106 | .debug_loc 0 : { *(.debug_loc) } |
---|
107 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
108 | .debug_ranges 0 : { *(.debug_ranges) } |
---|
109 | /* SGI/MIPS DWARF 2 extensions */ |
---|
110 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
111 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
112 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
113 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
114 | } |
---|