testpico: more on timer reload
[megadrive.git] / hexed / md.ld
CommitLineData
4db6e09f 1OUTPUT_ARCH(m68k)\r
2SEARCH_DIR(.)\r
3/*GROUP(-lbcc -lc -lgcc)*/\r
4__DYNAMIC = 0;\r
5\r
6/*\r
7 * Setup the memory map of the SEGA Genesis.\r
8 * stack grows down from high memory.\r
9 *\r
10 * The memory map look like this:\r
11 * +--------------------+ <- low memory\r
12 * | .text |\r
13 * | _etext |\r
14 * | ctor list | the ctor and dtor lists are for\r
15 * | dtor list | C++ support\r
16 * +--------------------+\r
17 * | .data | initialized data goes here\r
18 * | _edata |\r
19 * +--------------------+\r
20 * | .bss |\r
21 * | __bss_start | start of bss, cleared by crt0\r
22 * | _end | start of heap, used by sbrk()\r
23 * +--------------------+\r
24 * . .\r
25 * . .\r
26 * . .\r
27 * | __stack | top of stack\r
28 * +--------------------+\r
29 */\r
30/*\r
31MEMORY\r
32{\r
33 rom : ORIGIN = 0x00000000, LENGTH = 0x00400000\r
34 ram : ORIGIN = 0xffff0000, LENGTH = 0x00010000\r
35}\r
36*/\r
37\r
38MEMORY {\r
39 ram : ORIGIN = 0x0, LENGTH = 0xfffffff\r
40}\r
41\r
42/*\r
43 * allocate the stack to be at the top of memory, since the stack\r
44 * grows down\r
45 */\r
46\r
47PROVIDE (__stack = 0x00fffff0);\r
48\r
49PROVIDE (ram = 0xffff0000);\r
50/*\r
51 * Initalize some symbols to be zero so we can reference them in the\r
52 * crt0 without core dumping. These functions are all optional, but\r
53 * we do this so we can have our crt0 always use them if they exist. \r
54 * This is so BSPs work better when using the crt0 installed with gcc.\r
55 * We have to initalize them twice, so we cover a.out (which prepends\r
56 * an underscore) and coff object file formats.\r
57 */\r
58PROVIDE (hardware_init_hook = 0);\r
59PROVIDE (_hardware_init_hook = 0);\r
60PROVIDE (software_init_hook = 0);\r
61PROVIDE (_software_init_hook = 0);\r
62\r
63SECTIONS\r
64{\r
65 .text 0x00000000:\r
66 {\r
67 *(.text)\r
68 . = ALIGN(0x4);\r
69 __CTOR_LIST__ = .;\r
70 LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)\r
71 *(.ctors)\r
72 LONG(0)\r
73 __CTOR_END__ = .;\r
74 __DTOR_LIST__ = .;\r
75 LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)\r
76 *(.dtors)\r
77 LONG(0)\r
78 __DTOR_END__ = .;\r
79 *(.rodata)\r
80 *(.gcc_except_table) \r
81\r
82 __INIT_SECTION__ = . ;\r
83 *(.init)\r
84 SHORT (0x4e75) /* rts */\r
85\r
86 __FINI_SECTION__ = . ;\r
87 *(.fini)\r
88 SHORT (0x4e75) /* rts */\r
89\r
90 _etext = .;\r
91 *(.lit)\r
92 } > ram\r
93\r
94 .data BLOCK (0x4) :\r
95 {\r
96 *(.shdata)\r
97 *(.data)\r
0da5ab5d 98 . = ALIGN(0x10);\r
4db6e09f 99 _edata = .;\r
100 } > ram\r
101\r
102 .bss 0xff0000 :\r
103 {\r
104 __bss_start = . ;\r
105 *(.shbss)\r
106 *(.bss)\r
107 *(COMMON)\r
108 *(.eh_fram)\r
109 *(.eh_frame)\r
110 _end = ALIGN (0x8);\r
111 __end = _end;\r
112 } > ram\r
113\r
114 .stab 0 (NOLOAD) :\r
115 {\r
116 *(.stab)\r
117 }\r
118\r
119 .stabstr 0 (NOLOAD) :\r
120 {\r
121 *(.stabstr)\r
122 }\r
123}\r