testpico: more on timer reload
[megadrive.git] / megaed-stop / ed_app.ld
1 OUTPUT_ARCH(m68k)\r
2 SEARCH_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 MEMORY\r
31 {\r
32         rom : ORIGIN = 0x00100000, LENGTH = 0x00300000\r
33         ram : ORIGIN = 0x00ff0100, LENGTH = 0x0000FF00\r
34 }\r
35 \r
36 /*\r
37  * allocate the stack to be at the top of memory, since the stack\r
38  * grows down\r
39  */\r
40 \r
41 PROVIDE (__stack = 0x00fffff0);\r
42 \r
43 /*\r
44  * Initalize some symbols to be zero so we can reference them in the\r
45  * crt0 without core dumping. These functions are all optional, but\r
46  * we do this so we can have our crt0 always use them if they exist. \r
47  * This is so BSPs work better when using the crt0 installed with gcc.\r
48  * We have to initalize them twice, so we cover a.out (which prepends\r
49  * an underscore) and coff object file formats.\r
50  */\r
51 PROVIDE (hardware_init_hook = 0);\r
52 PROVIDE (_hardware_init_hook = 0);\r
53 PROVIDE (software_init_hook = 0);\r
54 PROVIDE (_software_init_hook = 0);\r
55 \r
56 SECTIONS\r
57 {\r
58   .text 0x00100000:\r
59   {\r
60     *(.text)\r
61     . = ALIGN(0x4);\r
62      __CTOR_LIST__ = .;\r
63     LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)\r
64     *(.ctors)\r
65     LONG(0)\r
66     __CTOR_END__ = .;\r
67     __DTOR_LIST__ = .;\r
68     LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)\r
69     *(.dtors)\r
70      LONG(0)\r
71     __DTOR_END__ = .;\r
72     *(.rodata*)\r
73     *(.gcc_except_table)\r
74 \r
75     __INIT_SECTION__ = . ;\r
76     *(.init)\r
77     SHORT (0x4e75)      /* rts */\r
78 \r
79     __FINI_SECTION__ = . ;\r
80     *(.fini)\r
81     SHORT (0x4e75)      /* rts */\r
82 \r
83     _etext = .;\r
84     *(.lit)\r
85   } > rom\r
86 \r
87   .data 0xff0100 :\r
88   {\r
89     *(.shdata)\r
90     *(.data)\r
91     _edata = .;\r
92   } > ram\r
93 \r
94   /* .bss 0xff0100 : */\r
95   .bss BLOCK (0x4) :\r
96   {\r
97     __bss_start = . ;\r
98     *(.shbss)\r
99     *(.bss)\r
100     *(COMMON)\r
101     *(.eh_fram)\r
102     *(.eh_frame)\r
103     _end =  ALIGN (0x8);\r
104     __end = _end;\r
105   } > ram\r
106 \r
107   .stab 0 (NOLOAD) :\r
108   {\r
109     *(.stab)\r
110   }\r
111 \r
112   .stabstr 0 (NOLOAD) :\r
113   {\r
114     *(.stabstr)\r
115   }\r
116 }\r