source: trunk/libs/newlib/src/libgloss/mips/sde32.ld @ 546

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

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

File size: 4.7 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  .rodata : {
97    *(.rdata)
98    *(.rodata)
99    *(.rodata.*)
100    *(.gnu.linkonce.r.*)
101  }
102   _fdata = ALIGN(16);
103  .data : {
104    *(.data)
105    *(.data.*)
106    *(.gnu.linkonce.d.*)
107  }
108  . = ALIGN(8);
109  _gp = . + 0x8000;
110  __global = _gp;
111  .lit8 : {
112    *(.lit8)
113  }
114  .lit4 : {
115    *(.lit4)
116  }
117  .sdata : {
118    *(.sdata)
119    *(.sdata.*)
120    *(.gnu.linkonce.s.*)
121  }
122  . = ALIGN(4);
123  PROVIDE (edata  =  .);
124  _edata  =  .;
125  _fbss = .;
126  .sbss : {
127    *(.sbss)
128    *(.sbss.*)
129    *(.gnu.linkonce.sb.*)
130    *(.scommon)
131  }
132  .bss : {
133    _bss_start = . ;
134    *(.bss)
135    *(.bss.*)
136    *(.gnu.linkonce.b.*)
137    *(COMMON)
138  }
139
140  PROVIDE (end = .);
141  _end = .;
142
143  /* DWARF debug sections.
144     Symbols in the DWARF debugging sections are relative to
145     the beginning of the section so we begin them at 0.  */
146
147  /* DWARF 1 */
148  .debug          0 : { *(.debug) }
149  .line           0 : { *(.line) }
150
151  /* GNU DWARF 1 extensions */
152  .debug_srcinfo  0 : { *(.debug_srcinfo) }
153  .debug_sfnames  0 : { *(.debug_sfnames) }
154
155  /* DWARF 1.1 and DWARF 2 */
156  .debug_aranges  0 : { *(.debug_aranges) }
157  .debug_pubnames 0 : { *(.debug_pubnames) }
158
159  /* DWARF 2 */
160  .debug_info     0 : { *(.debug_info) }
161  .debug_abbrev   0 : { *(.debug_abbrev) }
162  .debug_line     0 : { *(.debug_line) }
163  .debug_frame    0 : { *(.debug_frame) }
164  .debug_str      0 : { *(.debug_str) }
165  .debug_loc      0 : { *(.debug_loc) }
166  .debug_macinfo  0 : { *(.debug_macinfo) }
167  .debug_ranges   0 : { *(.debug_ranges) }
168
169  /* SGI/MIPS DWARF 2 extensions */
170  .debug_weaknames 0 : { *(.debug_weaknames) }
171  .debug_funcnames 0 : { *(.debug_funcnames) }
172  .debug_typenames 0 : { *(.debug_typenames) }
173  .debug_varnames  0 : { *(.debug_varnames) }
174
175  /* Special sections generated by gcc */
176  /* Newer GNU linkers strip by default */
177  .mdebug.abi32            0 : { KEEP(*(.mdebug.abi32)) }
178  .mdebug.abiN32           0 : { KEEP(*(.mdebug.abiN32)) }
179  .mdebug.abi64            0 : { KEEP(*(.mdebug.abi64)) }
180  .mdebug.abiO64           0 : { KEEP(*(.mdebug.abiO64)) }
181  .mdebug.eabi32           0 : { KEEP(*(.mdebug.eabi32)) }
182  .mdebug.eabi64           0 : { KEEP(*(.mdebug.eabi64)) }
183  .gcc_compiled_long32     0 : { KEEP(*(.gcc_compiled_long32)) }
184  .gcc_compiled_long64     0 : { KEEP(*(.gcc_compiled_long64)) }
185}
Note: See TracBrowser for help on using the repository browser.