source: trunk/libs/newlib/src/libgloss/mips/idt.ld @ 444

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

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

File size: 4.6 KB
Line 
1/* The following TEXT start address leaves space for the monitor
2   workspace. i.e. the NEC VR4300 (IDT) first free address is actually
3   0xa001af20. */
4
5ENTRY(_start)
6STARTUP(crt0.o)
7OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")
8GROUP(-lc -lidt -lgcc)
9SEARCH_DIR(.)
10__DYNAMIC  =  0;
11
12/*
13 * Allocate the stack to be at the top of memory, since the stack
14 * grows down
15 */
16PROVIDE (__stack = 0);
17/* PROVIDE (__global = 0); */
18
19/*
20 * Initalize some symbols to be zero so we can reference them in the
21 * crt0 without core dumping. These functions are all optional, but
22 * we do this so we can have our crt0 always use them if they exist.
23 * This is so BSPs work better when using the crt0 installed with gcc.
24 * We have to initalize them twice, so we multiple object file
25 * formats, as some prepend an underscore.
26 */
27PROVIDE (hardware_exit_hook = 0);
28PROVIDE (hardware_hazard_hook = 0);
29PROVIDE (hardware_init_hook = 0);
30PROVIDE (software_init_hook = 0);
31
32SECTIONS
33{       
34  . = 0xA0020000;
35  .text : {
36    _ftext = . ;
37    PROVIDE (eprol = .);
38    *(.text)
39    *(.text.*)
40    *(.gnu.linkonce.t.*)
41    *(.mips16.fn.*)
42    *(.mips16.call.*)
43  }
44  .init : {
45    KEEP (*(.init))
46  }
47  .fini : {
48    KEEP (*(.fini))
49  }
50  .rel.sdata : {
51    PROVIDE (__runtime_reloc_start = .);
52    *(.rel.sdata)
53    PROVIDE (__runtime_reloc_stop = .);
54  }
55  PROVIDE (etext = .);
56  _etext  =  .;
57 
58  .eh_frame_hdr : { *(.eh_frame_hdr) }
59  .eh_frame : { KEEP (*(.eh_frame)) }
60  .gcc_except_table : { *(.gcc_except_table) }
61  .jcr : { KEEP (*(.jcr)) }
62  .ctors    :
63  {
64    /* gcc uses crtbegin.o to find the start of
65       the constructors, so we make sure it is
66       first.  Because this is a wildcard, it
67       doesn't matter if the user does not
68       actually link against crtbegin.o; the
69       linker won't look for a file to match a
70       wildcard.  The wildcard also means that it
71       doesn't matter which directory crtbegin.o
72       is in.  */
73
74    KEEP (*crtbegin.o(.ctors))
75
76    /* We don't want to include the .ctor section from
77       from the crtend.o file until after the sorted ctors.
78       The .ctor section from the crtend file contains the
79       end of ctors marker and it must be last */
80
81    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
82    KEEP (*(SORT(.ctors.*)))
83    KEEP (*(.ctors))
84  }
85
86  .dtors    :
87  {
88    KEEP (*crtbegin.o(.dtors))
89    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
90    KEEP (*(SORT(.dtors.*)))
91    KEEP (*(.dtors))
92  }
93
94  . = .;
95  .rodata : {
96    *(.rdata)
97    *(.rodata)
98    *(.rodata.*)
99    *(.gnu.linkonce.r.*)
100  }
101   _fdata = ALIGN(16);
102  .data : {
103    *(.data)
104    *(.data.*)
105    *(.gnu.linkonce.d.*)
106  }
107  . = ALIGN(8);
108  _gp = . + 0x8000;
109  __global = _gp;
110  .lit8 : {
111    *(.lit8)
112  }
113  .lit4 : {
114    *(.lit4)
115  }
116  .sdata : {
117    *(.sdata)
118    *(.sdata.*)
119    *(.gnu.linkonce.s.*)
120  }
121  . = ALIGN(4);
122   PROVIDE (edata  =  .);
123   _edata  =  .;
124   _fbss = .;
125  .sbss : {
126    *(.sbss)
127    *(.sbss.*)
128    *(.gnu.linkonce.sb.*)
129    *(.scommon)
130  }
131  .bss : {
132    _bss_start = . ;
133    *(.bss)
134    *(.bss.*)
135    *(.gnu.linkonce.b.*)
136    *(COMMON)
137  }
138
139  PROVIDE (end = .);
140  _end = .;
141
142  /* DWARF debug sections.
143     Symbols in the DWARF debugging sections are relative to
144     the beginning of the section so we begin them at 0.  */
145
146  /* DWARF 1 */
147  .debug          0 : { *(.debug) }
148  .line           0 : { *(.line) }
149
150  /* GNU DWARF 1 extensions */
151  .debug_srcinfo  0 : { *(.debug_srcinfo) }
152  .debug_sfnames  0 : { *(.debug_sfnames) }
153
154  /* DWARF 1.1 and DWARF 2 */
155  .debug_aranges  0 : { *(.debug_aranges) }
156  .debug_pubnames 0 : { *(.debug_pubnames) }
157
158  /* DWARF 2 */
159  .debug_info     0 : { *(.debug_info) }
160  .debug_abbrev   0 : { *(.debug_abbrev) }
161  .debug_line     0 : { *(.debug_line) }
162  .debug_frame    0 : { *(.debug_frame) }
163  .debug_str      0 : { *(.debug_str) }
164  .debug_loc      0 : { *(.debug_loc) }
165  .debug_macinfo  0 : { *(.debug_macinfo) }
166  .debug_ranges   0 : { *(.debug_ranges) }
167
168  /* SGI/MIPS DWARF 2 extensions */
169  .debug_weaknames 0 : { *(.debug_weaknames) }
170  .debug_funcnames 0 : { *(.debug_funcnames) }
171  .debug_typenames 0 : { *(.debug_typenames) }
172  .debug_varnames  0 : { *(.debug_varnames) }
173
174  /* Special sections generated by gcc */
175  /* Newer GNU linkers strip by default */
176  .mdebug.abi32            0 : { KEEP(*(.mdebug.abi32)) }
177  .mdebug.abiN32           0 : { KEEP(*(.mdebug.abiN32)) }
178  .mdebug.abi64            0 : { KEEP(*(.mdebug.abi64)) }
179  .mdebug.abiO64           0 : { KEEP(*(.mdebug.abiO64)) }
180  .mdebug.eabi32           0 : { KEEP(*(.mdebug.eabi32)) }
181  .mdebug.eabi64           0 : { KEEP(*(.mdebug.eabi64)) }
182  .gcc_compiled_long32     0 : { KEEP(*(.gcc_compiled_long32)) }
183  .gcc_compiled_long64     0 : { KEEP(*(.gcc_compiled_long64)) }
184}
Note: See TracBrowser for help on using the repository browser.