megaed-sv: add exception handler
[megadrive.git] / nshtest / md.ld
... / ...
CommitLineData
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
98 _edata = .;\r
99 } > ram\r
100\r
101 .bss 0xff0000 :\r
102 {\r
103 __bss_start = . ;\r
104 *(.shbss)\r
105 *(.bss)\r
106 *(COMMON)\r
107 *(.eh_fram)\r
108 *(.eh_frame)\r
109 _end = ALIGN (0x8);\r
110 __end = _end;\r
111 } > ram\r
112\r
113 .stab 0 (NOLOAD) :\r
114 {\r
115 *(.stab)\r
116 }\r
117\r
118 .stabstr 0 (NOLOAD) :\r
119 {\r
120 *(.stabstr)\r
121 }\r
122}\r