source: rtems/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom @ 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: 3.6 KB
Line 
1/*
2 * This file contains GNU linker directives for a generic MC68360 board.
3 * Variations in memory size and allocation can be made by
4 * overriding some values with linker command-line arguments.
5 *
6 * These linker directives are for producing a PROM version.
7 * The data segment is placed at the end of the text segment in the PROM.
8 * The start-up code takes care of copying this region to RAM.
9 *
10 * Saskatchewan Accelerator Laboratory
11 * University of Saskatchewan
12 * Saskatoon, Saskatchewan, CANADA
13 * eric@skatter.usask.ca
14 */
15
16/*
17 * Declare some sizes.
18 * A heap size of 0 means `use all available memory for the heap'.
19 */
20RamBase = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize = DEFINED(RamSize) ? RamSize : 64M;
22HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
23_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
24
25/*
26 * Declare on-board memory.
27 */
28MEMORY {
29          ram : ORIGIN = 0x00000000, LENGTH = 64M
30          rom : ORIGIN = 0x0F000000, LENGTH = 1M
31        dpram : ORIGIN = 0x0E000000, LENGTH = 8k
32}
33
34/*
35 * Load objects
36 */
37SECTIONS {
38        /*
39         * Boot PROM
40         */
41        rom : {
42                _RomBase = .;
43        } >rom
44
45        /*
46         * Dynamic RAM
47         */
48        ram : {
49                RamBase = .;
50        } >ram
51
52        /*
53         * Text, data and bss segments
54         */
55        .text : AT(0x0) {
56                *(.text*)
57
58                /*
59                 * C++ constructors/destructors
60                 */
61                *(.gnu.linkonce.t.*)
62
63                /*
64                 * Initialization and finalization code.
65                 */
66                PROVIDE (_init = .);
67                *crti.o(.init)
68                *(.init)
69                *crtn.o(.init)
70                PROVIDE (_fini = .);
71                *crti.o(.fini)
72                *(.fini)
73                *crtn.o(.fini)
74
75                /*
76                 * Special FreeBSD sysctl sections.
77                 */
78                . = ALIGN (16);
79                __start_set_sysctl_set = .;
80                *(set_sysctl_*);
81                __stop_set_sysctl_set = ABSOLUTE(.);
82                *(set_domain_*);
83                *(set_pseudo_*);
84
85                /*
86                 * C++ constructors/destructors
87                 */
88                . = ALIGN (16);
89                *crtbegin.o(.ctors)
90                *(.ctors)
91                *crtend.o(.ctors)
92                *crtbegin.o(.dtors)
93                *(.dtors)
94                *crtend.o(.dtors)
95
96                /*
97                 * Exception frame info
98                 */
99                . = ALIGN (16);
100                *(.eh_frame)
101
102                /*
103                 * Read-only data
104                 */
105                . = ALIGN (16);
106                _rodata_start = . ;
107                *(.rodata*)
108                *(.gnu.linkonce.r*)
109
110                 . = ALIGN (16);
111                PROVIDE (etext = .);
112        } >rom
113
114        .tdata : {
115                _TLS_Data_begin = .;
116                *(.tdata .tdata.* .gnu.linkonce.td.*)
117                _TLS_Data_end = .;
118        } >rom
119
120        .tbss : {
121                _TLS_BSS_begin = .;
122                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
123                _TLS_BSS_end = .;
124        } >rom
125
126        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
127        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
128        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
129        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
130        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
131        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
132
133        .data : AT(SIZEOF(.text)) {
134                _copy_start = .;
135                *(.data)
136                *(.gnu.linkonce.d*)
137                *(.jcr)
138                *(.gcc_except_table*)
139                . = ALIGN (16);
140                PROVIDE (edata = .);
141                _copy_end = .;
142        } >ram
143        .bss : {
144                M68Kvec = .;
145                . += (256 * 4);
146                *(.dynbss)
147                *(.bss* .gnu.linkonce.b.*)
148                *(COMMON)
149                . = ALIGN (16);
150                PROVIDE (end = .);
151
152                . += _StackSize;
153                . = ALIGN (16);
154                _stack_init = .;
155                _clear_end = .;
156
157                WorkAreaBase = .;
158        } >ram
159
160        /*
161         * On-chip memory/peripherals
162         */
163        dpram : {
164                m360 = .;
165                . += (8 * 1024);
166        } >dpram
167}
Note: See TracBrowser for help on using the repository browser.