3ee911dc |
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 = 0x00000000, LENGTH = 0x00400000\r |
33 | ram : ORIGIN = 0x00ff0000, LENGTH = 0x00010000\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 0x00000000:\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 | /*\r |
74 | *(.gcc_except_table)\r |
75 | \r |
76 | __INIT_SECTION__ = . ;\r |
77 | *(.init)\r |
78 | SHORT (0x4e75)\r |
79 | \r |
80 | __FINI_SECTION__ = . ;\r |
81 | *(.fini)\r |
82 | SHORT (0x4e75)\r |
83 | */\r |
84 | _etext = .;\r |
85 | *(.lit)\r |
86 | } > rom\r |
87 | \r |
88 | .data 0xff0000 :\r |
89 | {\r |
90 | *(.shdata)\r |
91 | *(.data)\r |
92 | _edata = .;\r |
93 | } > ram\r |
94 | \r |
95 | /* .bss 0xff0100 : */\r |
96 | .bss BLOCK (0x4) :\r |
97 | {\r |
98 | __bss_start = . ;\r |
99 | *(.shbss)\r |
100 | *(.bss)\r |
101 | *(COMMON)\r |
102 | *(.eh_fram)\r |
103 | *(.eh_frame)\r |
104 | _end = ALIGN (0x8);\r |
105 | __end = _end;\r |
106 | } > ram\r |
107 | \r |
108 | .stab 0 (NOLOAD) :\r |
109 | {\r |
110 | *(.stab)\r |
111 | }\r |
112 | \r |
113 | .stabstr 0 (NOLOAD) :\r |
114 | {\r |
115 | *(.stabstr)\r |
116 | }\r |
117 | }\r |