source: rtems/c/src/lib/libbsp/m68k/idp/startup/linkcmds @ 960fd85

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

  • Property mode set to 100644
File size: 5.2 KB
Line 
1/* This file is a derivation of that found with the newlib-1.6 distribution
2 * for the idp.ld file.  That file, it appears, was originally written by
3 * Rob Savoye.  Other ideas came from Joel Sherrill for the RTEMS linkcmds
4 * file (this is basically a mixture of the two).
5 */
6
7/*
8 * Setup the memory map of the MC68ec0x0 Board (IDP)
9 * stack grows up towards high memory. This works for
10 * both the rom68k and the mon68k monitors.
11 */
12
13MEMORY
14{
15     ram : org = 0x10000, l = 2M
16}
17
18/*
19 * Declare some sizes.
20 */
21RamBase = DEFINED(RamBase) ? RamBase : 0x0;
22RamSize = DEFINED(RamSize) ? RamSize : 2M;
23HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
24_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
25
26SECTIONS
27{
28        ram : {
29                . = .;
30        } >ram
31
32        /*
33         * Text, data and bss segments
34         */
35        .text : {
36                *(.text*)
37
38                /*
39                 * C++ constructors/destructors
40                 */
41                *(.gnu.linkonce.t.*)
42
43                /*
44                 * Initialization and finalization code.
45                 *
46                 * Various files can provide initialization and finalization
47                 * functions.  crtbegin.o and crtend.o are two instances. The
48                 * body of these functions are in .init and .fini sections. We
49                 * accumulate the bodies here, and prepend function prologues
50                 * from crti.o and function epilogues from crtn.o. crti.o must
51                 * be linked first; crtn.o must be linked last.  Because these
52                 * are wildcards, it doesn't matter if the user does not
53                 * actually link against crti.o and crtn.o; the linker won't
54                 * look for a file to match a wildcard.  The wildcard also
55                 * means that it doesn't matter which directory crti.o and
56                 * crtn.o are in.
57                 */
58                PROVIDE (_init = .);
59                *crti.o(.init)
60                *(.init)
61                *crtn.o(.init)
62                PROVIDE (_fini = .);
63                *crti.o(.fini)
64                *(.fini)
65                *crtn.o(.fini)
66
67                /*
68                 * Special FreeBSD sysctl sections.
69                 */
70                . = ALIGN (16);
71                __start_set_sysctl_set = .;
72                *(set_sysctl_*);
73                __stop_set_sysctl_set = ABSOLUTE(.);
74                *(set_domain_*);
75                *(set_pseudo_*);
76
77                /*
78                 * C++ constructors/destructors
79                 *
80                 * gcc uses crtbegin.o to find the start of the constructors
81                 * and destructors so we make sure it is first.  Because this
82                 * is a wildcard, it doesn't matter if the user does not
83                 * actually link against crtbegin.o; the linker won't look for
84                 * a file to match a wildcard.  The wildcard also means that
85                 * it doesn't matter which directory crtbegin.o is in. The
86                 * constructor and destructor list are terminated in
87                 * crtend.o.  The same comments apply to it.
88                 */
89                . = ALIGN (16);
90                *crtbegin.o(.ctors)
91                *(.ctors)
92                *crtend.o(.ctors)
93                *crtbegin.o(.dtors)
94                *(.dtors)
95                *crtend.o(.dtors)
96
97                /*
98                 * Exception frame info
99                 */
100                . = ALIGN (16);
101                *(.eh_frame)
102
103                /*
104                 * Read-only data
105                 */
106                . = ALIGN (16);
107                _rodata_start = .;
108                *(.rodata*)
109                *(.gnu.linkonce.r*)
110
111                 . = ALIGN (16);
112                PROVIDE (_etext = .);
113        } >ram
114
115        .tdata : {
116                _TLS_Data_begin = .;
117                *(.tdata .tdata.* .gnu.linkonce.td.*)
118                _TLS_Data_end = .;
119        } >ram
120
121        .tbss : {
122                _TLS_BSS_begin = .;
123                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
124                _TLS_BSS_end = .;
125        } >ram
126
127        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
128        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
129        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
130        _TLS_Alignment = ALIGNOF (.tdata);
131
132        .data : {
133                PROVIDE (_copy_start = .);
134                *(.data*)
135                *(.gnu.linkonce.d*)
136                *(.gcc_except_table*)
137                *(.jcr)
138                . = ALIGN (16);
139                PROVIDE (_edata = .);
140                PROVIDE (_copy_end = .);
141        } >ram
142        .bss : {
143                _clear_start = .;
144                *(.dynbss)
145                *(.bss* .gnu.linkonce.b.*)
146                *(COMMON)
147                . = ALIGN (16);
148                PROVIDE (end = .);
149
150                . += _StackSize;
151                . = ALIGN (16);
152                _stack_init = .;
153                _clear_end = .;
154
155                WorkAreaBase = .;
156        } >ram
157
158  /* Stabs debugging sections.  */
159  .stab 0 : { *(.stab) }
160  .stabstr 0 : { *(.stabstr) }
161  .stab.excl 0 : { *(.stab.excl) }
162  .stab.exclstr 0 : { *(.stab.exclstr) }
163  .stab.index 0 : { *(.stab.index) }
164  .stab.indexstr 0 : { *(.stab.indexstr) }
165  .comment 0 : { *(.comment) }
166
167  /* DWARF debug sections.
168     Symbols in the DWARF debugging sections are relative to the beginning
169     of the section so we begin them at 0.  */
170  /* DWARF 1 */
171  .debug          0 : { *(.debug) }
172  .line           0 : { *(.line) }
173 
174  /* GNU DWARF 1 extensions */
175  .debug_srcinfo  0 : { *(.debug_srcinfo) }
176  .debug_sfnames  0 : { *(.debug_sfnames) }
177 
178  /* DWARF 1.1 and DWARF 2 */
179  .debug_aranges  0 : { *(.debug_aranges) }
180  .debug_pubnames 0 : { *(.debug_pubnames) }
181 
182  /* DWARF 2 */
183  .debug_info     0 : { *(.debug_info) }
184  .debug_abbrev   0 : { *(.debug_abbrev) }
185  .debug_line     0 : { *(.debug_line) }
186  .debug_frame    0 : { *(.debug_frame) }
187  .debug_str      0 : { *(.debug_str) }
188  .debug_loc      0 : { *(.debug_loc) }
189  .debug_macinfo  0 : { *(.debug_macinfo) }
190 
191  /* SGI/MIPS DWARF 2 extensions */
192  .debug_weaknames 0 : { *(.debug_weaknames) }
193  .debug_funcnames 0 : { *(.debug_funcnames) }
194  .debug_typenames 0 : { *(.debug_typenames) }
195  .debug_varnames  0 : { *(.debug_varnames) }
196  /* These must appear regardless of  .  */
197}
Note: See TracBrowser for help on using the repository browser.