source: rtems/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds @ d60e760

4.115
Last change on this file since d60e760 was d60e760, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 22, 2014 at 7:45:39 AM

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.0 KB
Line 
1/*
2 * Declare some sizes.
3 */
4_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
5_RamSize = DEFINED(_RamSize) ? _RamSize : 16M;
6_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
7_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
8
9ENTRY("_start")
10/* The memory size is 16M to coincide with the simulator.
11   Don't change either without considering the other.  */
12MEMORY
13{
14  /* 0xc4 is a magic entry.  We should have the linker just
15  skip over it one day... */
16  vectors : o = 0x0000, l = 0xc4
17  magicvectors : o = 0xc4, l = 0x3c
18  /* We still only use 256k as the main ram size.  */
19  ram    : o = 0x0100, l = 0xfffefc /* 16MB RAM --> 0x3fefc */
20  /* The stack starts at the top of main ram.  */
21  topram : o = 0xfffffc, l = 0x4  /* 256K RAM --> 0x3fffc */
22  /* This holds variables in the "tiny" sections.  */
23  tiny   : o = 0xff8000, l = 0x7f00
24  /* At the very top of the address space is the 8-bit area.  */
25  eight  : o = 0xffff00, l = 0x100
26}
27
28
29SECTIONS
30{
31   .vectors :
32   {
33        *(.vectors)
34   }  > vectors
35
36    .text :
37    {
38        *(.text*)
39        *(.gnu.linkonce.t*)
40       
41        /*
42         * Special FreeBSD sysctl sections.
43         */
44        . = ALIGN (16);
45        ___start_set_sysctl_set = .;
46        *(set_sys*);                            /* sysctl set */
47        ___stop_set_sysctl_set = ABSOLUTE(.);
48        *(set_dom*);                            /* domain set */
49        *(set_pse*);
50
51        /*
52         * Read-only data
53         */
54        . = ALIGN (16);
55        PROVIDE(_rodata_start = . );
56        *(.rodata*)
57        *(.gnu.linkonce.r*)
58        PROVIDE(_erodata = . );
59
60         _etext = .;
61    }  >ram
62    .tdata SIZEOF(.text) + ADDR(.text): {
63        __TLS_Data_begin = .;
64        *(.tdata .tdata.* .gnu.linkonce.td.*)
65        __TLS_Data_end = .;
66    }  >ram
67    .tbss SIZEOF(.tdata) + ADDR(.tdata): {
68        __TLS_BSS_begin = .;
69        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
70        __TLS_BSS_end = .;
71    }  >ram
72    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
73    __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
74    __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
75    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
76    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
77    __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
78   .tors SIZEOF(.tbss) + ADDR(.tbss): {
79        ___ctors = . ;
80        *(.ctors)
81        ___ctors_end = . ;
82        ___dtors = . ;
83        *(.dtors)
84        ___dtors_end = . ;
85    }  >ram
86    .data SIZEOF(.tors) + ADDR(.tors):
87    {
88        *(.data*)
89        *(.gcc_exc*)
90        CONSTRUCTORS
91         _edata = .;
92    }  >ram
93    .bss SIZEOF(.data) + ADDR(.data):
94    {
95         _bss_start = .;
96        *(.bss* .gnu.linkonce.b.*)
97        *(COMMON)
98        . = ALIGN (64);
99        . += _StackSize;
100        _stack_init = .;
101        _clear_end = .;
102        _WorkAreaBase = .;
103         _end = .;
104         __end = .;
105    } >ram
106    .tiny : {
107        *(.tiny)
108    }  > tiny
109    .eight : {
110        *(.eight)
111    }  > eight
112    .stab 0 (NOLOAD) : {
113        [ .stab ]
114    }
115    .stabstr 0 (NOLOAD) : {
116        [ .stabstr ]
117    }
118
119}
Note: See TracBrowser for help on using the repository browser.