source: trunk/libs/newlib/src/libgloss/m68k/idpgdb.ld @ 544

Last change on this file since 544 was 444, checked in by satin@…, 7 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 3.3 KB
RevLine 
[444]1STARTUP(crt0.o)
2OUTPUT_ARCH(m68k)
3/* Uncomment this if you want srecords. This is needed for a.out
4 * if you plan to use GDB.
5OUTPUT_FORMAT(srec)
6 */
7
8SEARCH_DIR(.)
9GROUP(-lidpgdb -lc -lgcc)
10__DYNAMIC  =  0;
11
12/*
13 * Setup the memory map of the MC68ec0x0 Board (IDP)
14 * stack grows down from high memory. This works for
15 * both the rom68k and the mon68k monitors.
16 *
17 * The memory map look like this:
18 * +--------------------+ <- low memory
19 * | .text              |
20 * |        _etext      |
21 * |        ctor list   | the ctor and dtor lists are for
22 * |        dtor list   | C++ support
23 * +--------------------+
24 * | .data              | initialized data goes here
25 * |        _edata      |
26 * +--------------------+
27 * | .bss               |
28 * |        __bss_start | start of bss, cleared by crt0
29 * |        _end        | start of heap, used by sbrk()
30 * +--------------------+
31 * .                    .
32 * .                    .
33 * .                    .
34 * |        __stack     | top of stack
35 * +--------------------+
36 */
37
38/*
39 * When the IDP is not remapped (see rom68k's MP command in the
40 * "M68EC0x0IDP Users Manual", the first 64K bytes are reserved;
41 * Otherwise the first 256K bytes are reserved.
42 *
43 * The following memory map describes a unmapped IDP w/2MB RAM.
44 */
45
46MEMORY
47{
48  ram (rwx) : ORIGIN = 0x00010000, LENGTH = 2M-64K
49  rom0      : ORIGIN = 0x00800000, LENGTH = 1M
50  rom1      : ORIGIN = 0x00900000, LENGTH = 1M
51}
52
53/*
54 * allocate the stack to be at the top of memory, since the stack
55 * grows down
56 */
57
58PROVIDE (__stack = 2M - 8);
59
60/*
61 * Initalize some symbols to be zero so we can reference them in the
62 * crt0 without core dumping. These functions are all optional, but
63 * we do this so we can have our crt0 always use them if they exist.
64 * This is so BSPs work better when using the crt0 installed with gcc.
65 * We have to initalize them twice, so we cover a.out (which prepends
66 * an underscore) and coff object file formats.
67 */
68PROVIDE (hardware_init_hook = 0);
69PROVIDE (_hardware_init_hook = 0);
70PROVIDE (software_init_hook = 0);
71PROVIDE (_software_init_hook = 0);
72/*
73 * stick everything in ram (of course)
74 */
75SECTIONS
76{
77  .text :
78  {
79    CREATE_OBJECT_SYMBOLS
80    *(.text .text.*)
81
82    . = ALIGN(0x4);
83    /* These are for running static constructors and destructors under ELF.  */
84    KEEP (*crtbegin.o(.ctors))
85    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
86    KEEP (*(SORT(.ctors.*)))
87    KEEP (*(.ctors))
88    KEEP (*crtbegin.o(.dtors))
89    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
90    KEEP (*(SORT(.dtors.*)))
91    KEEP (*(.dtors))
92
93    *(.rodata .rodata.*)
94
95    . = ALIGN(0x4);
96    *(.gcc_except_table)
97
98    . = ALIGN(0x4);
99    *(.eh_frame)
100
101    . = ALIGN(0x4);
102    __INIT_SECTION__ = . ;
103    LONG (0x4e560000)   /* linkw %fp,#0 */
104    *(.init)
105    SHORT (0x4e5e)      /* unlk %fp */
106    SHORT (0x4e75)      /* rts */
107
108    . = ALIGN(0x4);
109    __FINI_SECTION__ = . ;
110    LONG (0x4e560000)   /* linkw %fp,#0 */
111    *(.fini)
112    SHORT (0x4e5e)      /* unlk %fp */
113    SHORT (0x4e75)      /* rts */
114
115    _etext = .;
116    *(.lit)
117  } > ram
118
119  .data :
120  {
121    *(.got.plt) *(.got)
122    *(.shdata)
123    *(.data .data.*)
124    _edata = .;
125  } > ram
126
127  .bss :
128  {
129    . = ALIGN(0x4);
130    __bss_start = . ;
131    *(.shbss)
132    *(.bss .bss.*)
133    *(COMMON)
134    _end =  ALIGN (0x8);
135    __end = _end;
136  } > ram
137
138  .stab 0 (NOLOAD) :
139  {
140    *(.stab)
141  }
142
143  .stabstr 0 (NOLOAD) :
144  {
145    *(.stabstr)
146  }
147}
Note: See TracBrowser for help on using the repository browser.