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