source: rtems/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds @ 9736283

5
Last change on this file since 9736283 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: 4.6 KB
Line 
1OUTPUT_FORMAT("elf32-bfin", "elf32-bfin",
2            "elf32-bfin")
3
4OUTPUT_ARCH(bfin)
5ENTRY(__start)
6
7/*
8 * Declare some sizes.
9 */
10_RamBase    = DEFINED(_RamBase)   ? _RamBase : 0x0;
11_RamSize    = DEFINED(_RamSize)   ? _RamSize : 0x04000000;
12_HeapSize   = DEFINED(_HeapSize)  ? _HeapSize : 0x10000;
13_StackSize  = DEFINED(_StackSize) ? _StackSize : 0x10000;
14
15MEMORY
16{
17      sdram(rwx)      : ORIGIN = 0x00000100, LENGTH = 0x04000000
18     
19      l1dataA(rwx)    : ORIGIN = 0xff800000, LENGTH = 0x00004000
20      l1dataAC(rwx)   : ORIGIN = 0xff804000, LENGTH = 0x00004000
21      l1dataB(rwx)    : ORIGIN = 0xff900000, LENGTH = 0x00004000
22      l1dataBC(rwx)   : ORIGIN = 0xff904000, LENGTH = 0x00004000
23     
24      l1code(rwx)     : ORIGIN = 0xffa00000, LENGTH = 0x0000C000
25      l1codeC(rwx)    : ORIGIN = 0xffa10000, LENGTH = 0x00004000
26      scratchpad(rwx) : ORIGIN = 0xffb00000, LENGTH = 0x00001000
27}
28
29SECTIONS
30{
31
32    .init          :
33    {
34        *(.l1code)
35        KEEP (*(.init))
36    } > sdram   /*=0*/
37
38    .text :
39    {
40         CREATE_OBJECT_SYMBOLS
41        *(.text)
42        *(.rodata*)
43        *(.gnu.linkonce.r*)
44       
45        /*
46         * Special FreeBSD sysctl sections.
47         */
48        . = ALIGN (16);
49        ___start_set_sysctl_set = .;
50        *(set_sysctl_*);
51        ___stop_set_sysctl_set = ABSOLUTE(.);
52        *(set_domain_*);
53        *(set_pseudo_*);
54
55         _etext = .;
56
57        ___CTOR_LIST__ = .;
58        LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)
59        *(.ctors)
60        LONG(0)
61        ___CTOR_END__ = .;
62        ___DTOR_LIST__ = .;
63        LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)
64        *(.dtors)
65        LONG(0)
66        ___DTOR_END__ = .;         
67    } > sdram
68
69    .tdata : {
70        __TLS_Data_begin = .;
71        *(.tdata .tdata.* .gnu.linkonce.td.*)
72        __TLS_Data_end = .;
73    } > sdram
74
75    .tbss : {
76        __TLS_BSS_begin = .;
77        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
78        __TLS_BSS_end = .;
79    } > sdram
80
81    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
82    __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
83    __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
84    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
85    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
86    __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
87   
88    .fini :
89    {
90        KEEP (*(.fini))
91    } > sdram  /*=0*/
92   
93    .data :
94    {
95        *(.data)
96        *(.jcr)
97        *(.gnu.linkonce.d*)
98        CONSTRUCTORS
99         _edata = .;
100    } > sdram
101
102    .eh_frame : { *(.eh_frame) } > sdram
103    .data1   : { *(.data1) } > sdram
104    .eh_frame : { *(.eh_frame) } > sdram
105    .gcc_except_table : { *(.gcc_except_table*) } > sdram
106
107    .rodata :
108    {
109        *(.rodata)
110        *(.rodata.*)
111        *(.gnu.linkonce.r*)
112    } > sdram
113
114   
115    .bss :
116    {
117         _bss_start = .;
118        _clear_start = .;
119        *(.bss)
120        *(.gnu.linkonce.b.*)
121        *(COMMON)
122        . = ALIGN (64);
123        _stack_init = .;
124        . += _StackSize;
125        _clear_end = .;
126        _WorkAreaBase = .;
127         _end = .;
128         __end = .;
129    } > sdram
130   
131/* Debugging stuff follows */
132
133  /* Stabs debugging sections.  */
134  .stab 0 : { *(.stab) }
135  .stabstr 0 : { *(.stabstr) }
136  .stab.excl 0 : { *(.stab.excl) }
137  .stab.exclstr 0 : { *(.stab.exclstr) }
138  .stab.index 0 : { *(.stab.index) }
139  .stab.indexstr 0 : { *(.stab.indexstr) }
140  .comment 0 : { *(.comment) }
141  /* DWARF debug sections.
142     Symbols in the DWARF debugging sections are relative to the beginning
143     of the section so we begin them at 0.  */
144  /* DWARF 1 */
145  .debug          0 : { *(.debug) }
146  .line           0 : { *(.line) }
147  /* GNU DWARF 1 extensions */
148  .debug_srcinfo  0 : { *(.debug_srcinfo) }
149  .debug_sfnames  0 : { *(.debug_sfnames) }
150  /* DWARF 1.1 and DWARF 2 */
151  .debug_aranges  0 : { *(.debug_aranges) }
152  .debug_pubnames 0 : { *(.debug_pubnames) }
153  /* DWARF 2 */
154  .debug_info     0 : { *(.debug_info) }
155  .debug_abbrev   0 : { *(.debug_abbrev) }
156  .debug_line     0 : { *(.debug_line) }
157  .debug_frame    0 : { *(.debug_frame) }
158  .debug_str      0 : { *(.debug_str) }
159  .debug_loc      0 : { *(.debug_loc) }
160  .debug_macinfo  0 : { *(.debug_macinfo) }
161  /* SGI/MIPS DWARF 2 extensions */
162  .debug_weaknames 0 : { *(.debug_weaknames) }
163  .debug_funcnames 0 : { *(.debug_funcnames) }
164  .debug_typenames 0 : { *(.debug_typenames) }
165  .debug_varnames  0 : { *(.debug_varnames) }
166  /*.stack 0x80000 : { _stack = .; *(.stack) }*/
167  /* These must appear regardless of  .  */   
168}
169
170__HeapSize = _HeapSize;
171__edata = _edata;
172__etext = _etext;
173
Note: See TracBrowser for help on using the repository browser.