source: rtems/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds @ d60e760

4.115
Last change on this file since d60e760 was d60e760, checked in by Sebastian Huber <sebastian.huber@…>, on 04/22/14 at 07:45:39

bsps: Fix TLS support in linker command files

The TLS section symbols had wrong values in case of an empty TLS data
section and a nonempty TLS BSS section.

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