source: rtems/c/src/lib/libbsp/sparc64/shared/startup/linkcmds @ 71d093f0

4.115
Last change on this file since 71d093f0 was 48449a8, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/11 at 16:46:36

2011-10-06 Gedare Bloom <giddyup44@…>

PR 1920/bsp

  • shared/helenos/kernel/sparc64/src/sun4u/takemmu.S, shared/start/start.S, shared/startup/bspgetworkarea.c, shared/startup/linkcmds: Fix BSP memory use to support more than 4 MB of RAM.
  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[566a1806]1/*  linkcmds
2 *
3 *  $Id$
4 */
5
6/*
7 * For alignment, SPARC v9 specifies that instructions are 4-byte aligned,
8 * and the worst-case alignment requirements for data are for quad-word
9 * accesses, which must be 16-byte aligned.
10 */
11
12/*
13 * Declare some sizes.
14 */
15RamBase = DEFINED(RamBase) ? RamBase : 0x0;
[48449a8]16RamSize = DEFINED(RamSize) ? RamSize : 12M;
17HeapSize = DEFINED(HeapSize) ? HeapSize : 1M;
18StackSize = DEFINED(StackSize) ? StackSize : 1M;
[566a1806]19
20RAM_END = RamBase + RamSize;
21
22/* Default linker script, for normal executables */
23OUTPUT_FORMAT("elf64-sparc")
24ENTRY(start)
25
26MEMORY
27        {
[48449a8]28                ram : ORIGIN = 0x0, LENGTH = 12M
[566a1806]29        }
30
31
32SECTIONS
33{
34  /* Read-only sections, merged into text segment: */
35  .hash          : { *(.hash)           }
36  .dynsym        : { *(.dynsym)         }
37  .dynstr        : { *(.dynstr)         }
38  .gnu.version   : { *(.gnu.version)    }
39  .gnu.version_d   : { *(.gnu.version_d)        }
40  .gnu.version_r   : { *(.gnu.version_r)        }
41  .rel.init      : { *(.rel.init)               }
42  .rela.init     : { *(.rela.init)      }
43  .rel.text      :
44    {
45      *(.rel.text)
46      *(.rel.text.*)
47      *(.rel.gnu.linkonce.t*)
48    }
49  .rela.text     :
50    {
51      *(.rela.text)
52      *(.rela.text.*)
53      *(.rela.gnu.linkonce.t*)
54    }
55  .rel.fini      : { *(.rel.fini)               }
56  .rela.fini     : { *(.rela.fini)      }
57  .rel.rodata    :
58    {
59      *(.rel.rodata)
60      *(.rel.rodata.*)
61      *(.rel.gnu.linkonce.r*)
62    }
63  .rela.rodata   :
64    {
65      *(.rela.rodata)
66      *(.rela.rodata.*)
67      *(.rela.gnu.linkonce.r*)
68    }
69  .rel.data      :
70    {
71      *(.rel.data)
72      *(.rel.data.*)
73      *(.rel.gnu.linkonce.d*)
74    }
75  .rela.data     :
76    {
77      *(.rela.data)
78      *(.rela.data.*)
79      *(.rela.gnu.linkonce.d*)
80    }
81  .rel.ctors     : { *(.rel.ctors)      }
82  .rela.ctors    : { *(.rela.ctors)     }
83  .rel.dtors     : { *(.rel.dtors)      }
84  .rela.dtors    : { *(.rela.dtors)     }
85  .rel.got       : { *(.rel.got)                }
86  .rela.got      : { *(.rela.got)               }
87  .rel.bss       : { *(.rel.bss)                }
88  .rela.bss      : { *(.rela.bss)               }
89  .rel.plt       : { *(.rel.plt)                }
90  .rela.plt      : { *(.rela.plt)               }
91  /* Internal text space or external memory */
92  .text 0x4000 : AT (0x4000)
93  {
94    *(BOOTSTRAP);
95    *(.text*)
96
97    /*
98     * Special FreeBSD sysctl sections.
99     */
100    . = ALIGN (16);
101    __start_set_sysctl_set = .;
102    *(set_sysctl_*);
103    __stop_set_sysctl_set = ABSOLUTE(.);
104    *(set_domain_*);
105    *(set_pseudo_*);
106
107    *(.eh_frame)
108    . = ALIGN (16);
109
110    *(.gnu.linkonce.t*)
[5714bc5]111    *(.gcc_except_table*)
[566a1806]112
113    /*
114     * C++ constructors
115     */
116    /* gcc uses crtbegin.o to find the start of
117       the constructors, so we make sure it is
118       first.  Because this is a wildcard, it
119       doesn't matter if the user does not
120       actually link against crtbegin.o; the
121       linker won't look for a file to match a
122       wildcard.  The wildcard also means that it
123       doesn't matter which directory crtbegin.o
124       is in.  */
125    KEEP (*crtbegin.o(.ctors))
126    KEEP (*crtbegin?.o(.ctors))
127    /* We don't want to include the .ctor section from
128       the crtend.o file until after the sorted ctors.
129       The .ctor section from the crtend file contains the
130       end of ctors marker and it must be last */
131    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
132    KEEP (*(SORT(.ctors.*)))
133    KEEP (*(.ctors))
134    KEEP (*crtbegin.o(.dtors))
135    KEEP (*crtbegin?.o(.dtors))
136    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
137    KEEP (*(SORT(.dtors.*)))
138    KEEP (*(.dtors))
139
140    _rodata_start = . ;
141    *(.rodata*)
142    *(.gnu.linkonce.r*)
143    _erodata = ALIGN( 0x10 ) ;
144
145    etext = ALIGN(2);
146    _etext = . ;
147
148    *(.init)
149    PROVIDE (_fini = .);
150    KEEP (*(.fini))
151    *(.lit)
152    *(.shdata)
153
154     . = ALIGN (16);
155    _endtext = . ;
156  } > ram
157 
158  .data   : AT (ADDR (.text) + SIZEOF (.text))
159  {
160     PROVIDE (__data_start = .) ;
161    data_start = . ;
162    _data_start = . ;
163    *(.data)
164    *(.data*)
165    *(.rodata)  /* We need to include .rodata here if gcc is used */
166    *(.rodata*) /* with -fdata-sections.  */
167    *(.gnu.linkonce.d*)
168    . = ALIGN(2);
169    edata = . ;
170    _edata = . ;
171     PROVIDE (__data_end = .) ;
172  } > ram
173 
174  /* XXX
175   __data_load_start = LOADADDR(.data);
176   __data_load_end = __data_load_start + SIZEOF(.data);
177  */
178   . = ALIGN (16);
179  .dynamic        : { *(.dynamic)       } >ram
180  .jcr        : { *(.jcr)     } > ram
181  .shbss      : { *(.shbss)  } > ram
182  .bss        :
183  {
184    FILL(0x00000000);
185    . = ALIGN(16);
186    __bss_start = ALIGN(0x8);
187    bss_start = .;
188    bss_start = .;
189    *(.bss .bss* .gnu.linkonce.b*)
190    *(COMMON)
191    . = ALIGN (16);
192    end = .;
193    _end = .;
194    __end = .;
195 
196    . = ALIGN (16); /* arbitrary alignment */
197    PROVIDE (WorkAreaBase = .);
198    . += HeapSize;
199    PROVIDE (HeapBase = .);
200    . += HeapSize;
201    . += StackSize;
202     PROVIDE (__stack = .);
203     PROVIDE (StackStart = .);
204  } > ram
205}
206
207
Note: See TracBrowser for help on using the repository browser.