source: trunk/libs/newlib/src/libgloss/v850/sim.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: 5.4 KB
Line 
1/* Default linker script, for normal executables */
2OUTPUT_FORMAT("elf32-v850", "elf32-v850",
3              "elf32-v850")
4OUTPUT_ARCH(v850)
5ENTRY(_start)
6GROUP(-lc -lsim -lgcc)
7SEARCH_DIR(.);
8EXTERN(__ctbp __ep __gp);
9SECTIONS
10{
11  /* This saves a little space in the ELF file, since the zda starts
12     at a higher location that the ELF headers take up.  */
13  .zdata 0x160 :
14  {
15        *(.zdata)
16        *(.zbss)
17        *(reszdata)
18        *(.zcommon)
19  }
20  /* This is the read only part of the zero data area.
21     Having it as a seperate section prevents its
22     attributes from being inherited by the zdata
23     section.  Specifically it prevents the zdata
24     section from being marked READONLY.  */
25  .rozdata ALIGN (4) :
26  {
27        *(.rozdata)
28        *(romzdata)
29        *(romzbss)
30  }
31  /* Read-only sections, merged into text segment.  */
32  . = 0x100000;
33  .interp       : { *(.interp) }
34  .hash         : { *(.hash) }
35  .dynsym       : { *(.dynsym) }
36  .dynstr       : { *(.dynstr) }
37  .rel.text     : { *(.rel.text) }
38  .rela.text    : { *(.rela.text) }
39  .rel.data     : { *(.rel.data) }
40  .rela.data    : { *(.rela.data) }
41  .rel.rodata   : { *(.rel.rodata) }
42  .rela.rodata  : { *(.rela.rodata) }
43  .rel.gcc_except_table : { *(.rel.gcc_except_table) }
44  .rela.gcc_except_table : { *(.rela.gcc_except_table) }
45  .rel.got      : { *(.rel.got) }
46  .rela.got     : { *(.rela.got) }
47  .rel.ctors    : { *(.rel.ctors) }
48  .rela.ctors   : { *(.rela.ctors) }
49  .rel.dtors    : { *(.rel.dtors) }
50  .rela.dtors   : { *(.rela.dtors) }
51  .rel.init     : { *(.rel.init) }
52  .rela.init    : { *(.rela.init) }
53  .rel.fini     : { *(.rel.fini) }
54  .rela.fini    : { *(.rela.fini) }
55  .rel.bss      : { *(.rel.bss) }
56  .rela.bss     : { *(.rela.bss) }
57  .rel.plt      : { *(.rel.plt) }
58  .rela.plt     : { *(.rela.plt) }
59  .init         : { KEEP (*(.init)) } =0
60  .plt          : { *(.plt) }
61  .text         :
62  {
63    *(.text)
64    *(.text.*)
65    /* .gnu.warning sections are handled specially by elf32.em.  */
66    *(.gnu.warning)
67    *(.gnu.linkonce.t*)
68  } =0
69  _etext = .;
70  PROVIDE (etext = .);
71   /* This is special code area at the end of the normal text section.
72      It contains a small lookup table at the start followed by the
73      code pointed to by entries in the lookup table.  */
74  .call_table_data ALIGN (4) :
75  {
76    PROVIDE(__ctbp = .);
77    *(.call_table_data)
78  } = 0xff   /* Fill gaps with 0xff.  */
79  .call_table_text :
80  {
81    *(.call_table_text)
82  }
83  .fini         : { KEEP (*(.fini)) } =0
84  .rodata       : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
85  .rodata1      : { *(.rodata1) }
86  .data         :
87  {
88    *(.data)
89    *(.data.*)
90    *(.gnu.linkonce.d*)
91    CONSTRUCTORS
92  }
93  .data1        : { *(.data1) }
94  .ctors        :
95  {
96    ___ctors = .;
97    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
98    KEEP (*(SORT(.ctors.*)))
99    KEEP (*crtend(.ctors))
100    ___ctors_end = .;
101  }
102  .dtors        :
103  {
104    ___dtors = .;
105    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
106    KEEP (*(SORT(.dtors.*)))
107    KEEP (*crtend.o(.dtors))
108    ___dtors_end = .;
109  }
110  .jcr          :
111  {
112    KEEP (*(.jcr))
113  }
114  .gcc_except_table : { *(.gcc_except_table) }
115  .got          : { *(.got.plt) *(.got) }
116  .dynamic      : { *(.dynamic) }
117  .tdata ALIGN (4) :
118  {
119        PROVIDE (__ep = .);
120        *(.tbyte)
121        *(.tcommon_byte)
122        *(.tdata)
123        *(.tbss)
124        *(.tcommon)
125  }
126  /* We want the small data sections together, so single-instruction offsets
127     can access them all, and initialized data all before uninitialized, so
128     we can shorten the on-disk segment size.  */
129  .sdata ALIGN (4) :
130  {
131        PROVIDE (__gp = . + 0x8000);
132        *(.sdata)
133   }
134  /* See comment about .rozdata. */
135  .rosdata ALIGN (4) :
136  {
137        *(.rosdata)
138  }
139  /* We place the .sbss data section AFTER the .rosdata section, so that
140     it can directly preceed the .bss section.  This allows runtime startup
141     code to initialise all the zero-data sections by simply taking the
142     value of '_edata' and zeroing until it reaches '_end'.  */
143  .sbss :
144  {
145        __sbss_start = .;
146        *(.sbss)
147        *(.scommon)
148  }
149  _edata  = DEFINED (__sbss_start) ? __sbss_start : . ;
150  PROVIDE (edata = _edata);
151  .bss       :
152  {
153        __bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;
154        __real_bss_start = . ;
155        *(.dynbss)
156        *(.bss)
157        *(COMMON)
158  }
159  _end = . ;
160  PROVIDE (end = .);
161
162  .note.renesas 0 : { KEEP(*(.note.renesas)) } 
163
164  /* Stabs debugging sections.  */
165  .stab 0               : { *(.stab) }
166  .stabstr 0            : { *(.stabstr) }
167  .stab.excl 0          : { *(.stab.excl) }
168  .stab.exclstr 0       : { *(.stab.exclstr) }
169  .stab.index 0         : { *(.stab.index) }
170  .stab.indexstr 0      : { *(.stab.indexstr) }
171  .comment 0            : { *(.comment) }
172  /* DWARF debug sections.
173     Symbols in the DWARF debugging sections are relative to the beginning
174     of the section so we begin them at 0.  */
175  /* DWARF 1 */
176  .debug          0     : { *(.debug) }
177  .line           0     : { *(.line) }
178  /* GNU DWARF 1 extensions */
179  .debug_srcinfo  0     : { *(.debug_srcinfo) }
180  .debug_sfnames  0     : { *(.debug_sfnames) }
181  /* DWARF 1.1 and DWARF 2 */
182  .debug_aranges  0     : { *(.debug_aranges) }
183  .debug_pubnames 0     : { *(.debug_pubnames) }
184  /* DWARF 2 */
185  .debug_info     0     : { *(.debug_info) *(.gnu.linkonce.wi.*) }
186  .debug_abbrev   0     : { *(.debug_abbrev) }
187  .debug_line     0     : { *(.debug_line) }
188  .debug_frame    0     : { *(.debug_frame) }
189  .debug_str      0     : { *(.debug_str) }
190  .debug_loc      0     : { *(.debug_loc) }
191  .debug_macinfo  0     : { *(.debug_macinfo) }
192  /* SGI/MIPS DWARF 2 extensions.  */
193  .debug_weaknames 0    : { *(.debug_weaknames) }
194  .debug_funcnames 0    : { *(.debug_funcnames) }
195  .debug_typenames 0    : { *(.debug_typenames) }
196  .debug_varnames  0    : { *(.debug_varnames) }
197  /* User stack.  */
198  .stack 0x200000       :
199  {
200        __stack = .;
201        *(.stack)
202  }
203}
204
Note: See TracBrowser for help on using the repository browser.