[PATCH 4/5] bsps: Thread-local storage (TLS) for linkcmds

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jan 29 10:17:51 UTC 2014


---
 c/src/lib/libbsp/arm/gba/startup/linkcmds          |   33 +++++++++-----------
 c/src/lib/libbsp/arm/shared/startup/linkcmds.base  |    8 +++++
 c/src/lib/libbsp/avr/avrtest/startup/linkcmds      |   18 +++++++++-
 c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds    |   17 ++++++++++
 c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds    |   17 ++++++++++
 c/src/lib/libbsp/h8300/h8sim/startup/linkcmds      |   16 +++++++++-
 c/src/lib/libbsp/i386/pc386/startup/linkcmds       |   14 ++++++++
 c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds    |   14 ++++++++
 c/src/lib/libbsp/lm32/milkymist/startup/linkcmds   |   14 ++++++++
 c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds     |   15 +++++++++
 c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds     |   14 ++++++++
 c/src/lib/libbsp/m68k/av5282/startup/linkcmds      |   17 ++++++++++
 c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash |   19 +++++++++++-
 c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram   |   17 ++++++++++
 c/src/lib/libbsp/m68k/csb360/startup/linkcmds      |   18 +++++++++++
 c/src/lib/libbsp/m68k/gen68302/startup/linkcmds    |   18 +++++++++++
 c/src/lib/libbsp/m68k/gen68340/startup/linkcmds    |   18 +++++++++++
 c/src/lib/libbsp/m68k/gen68360/startup/linkcmds    |   18 +++++++++++
 .../libbsp/m68k/gen68360/startup/linkcmds.bootp    |   18 +++++++++++
 .../lib/libbsp/m68k/gen68360/startup/linkcmds.prom |   18 +++++++++++
 c/src/lib/libbsp/m68k/idp/startup/linkcmds         |   18 +++++++++++
 .../lib/libbsp/m68k/mcf5206elite/startup/linkcmds  |   17 ++++++++++
 .../m68k/mcf5206elite/startup/linkcmds.flash       |   17 ++++++++++
 c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds    |   17 ++++++++++
 c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds    |   17 ++++++++++
 c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds     |   17 ++++++++++
 .../lib/libbsp/m68k/mcf5235/startup/linkcmdsflash  |   19 +++++++++++-
 c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram  |   17 ++++++++++
 c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds     |   17 ++++++++++
 .../lib/libbsp/m68k/mcf5329/startup/linkcmdsflash  |   17 ++++++++++
 c/src/lib/libbsp/m68k/mrm332/startup/linkcmds      |   18 +++++++++++
 c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM  |   16 +++++++++-
 c/src/lib/libbsp/m68k/mvme136/startup/linkcmds     |   18 +++++++++++
 c/src/lib/libbsp/m68k/mvme147/startup/linkcmds     |   18 +++++++++++
 c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds    |   18 +++++++++++
 c/src/lib/libbsp/m68k/mvme162/startup/linkcmds     |   18 +++++++++++
 c/src/lib/libbsp/m68k/mvme167/startup/linkcmds     |   17 ++++++++++
 c/src/lib/libbsp/m68k/ods68302/startup/debugger    |   15 +++++++++
 c/src/lib/libbsp/m68k/ods68302/startup/linkcmds    |   20 +++++++++++-
 c/src/lib/libbsp/m68k/ods68302/startup/rom         |   15 +++++++++
 c/src/lib/libbsp/m68k/shared/startup/linkcmds.base |    8 +++++
 c/src/lib/libbsp/m68k/sim68000/startup/linkcmds    |   20 +++++++++++-
 c/src/lib/libbsp/m68k/uC5282/startup/linkcmds      |   17 ++++++++++
 c/src/lib/libbsp/mips/csb350/startup/linkcmds      |   17 ++++++++++
 .../lib/libbsp/mips/genmongoosev/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/mips/hurricane/startup/linkcmds   |   18 +++++++++++
 c/src/lib/libbsp/mips/jmr3904/startup/linkcmds     |   18 +++++++++++
 c/src/lib/libbsp/mips/malta/startup/linkcmds       |   18 +++++++++++
 c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds    |   18 +++++++++++
 c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds    |   18 +++++++++++
 c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds   |   14 ++++++++
 c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds  |   14 ++++++++
 c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds     |   14 ++++++++
 .../libbsp/powerpc/gen5200/startup/linkcmds.base   |   15 +++++++++
 .../lib/libbsp/powerpc/haleakala/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds   |   17 ++++++++++
 .../lib/libbsp/powerpc/mpc8260ads/startup/linkcmds |   17 ++++++++++
 c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds  |   15 +++++++++
 .../lib/libbsp/powerpc/score603e/startup/linkcmds  |   14 ++++++++
 c/src/lib/libbsp/powerpc/shared/startup/linkcmds   |   17 ++++++++++
 .../libbsp/powerpc/shared/startup/linkcmds.base    |    8 +++++
 c/src/lib/libbsp/powerpc/ss555/startup/linkcmds    |   17 +++++++++-
 .../libbsp/powerpc/tqm8xx/startup/linkcmds.base    |   17 ++++++++++
 c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds  |   17 ++++++++++
 c/src/lib/libbsp/sh/gensh1/startup/linkcmds        |   20 ++++++++++--
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds        |   20 ++++++++++--
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram    |   20 ++++++++++--
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom    |   20 ++++++++++--
 c/src/lib/libbsp/sh/gensh4/startup/linkcmds        |   14 ++++++++
 c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom    |   14 ++++++++
 .../lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram  |   14 ++++++++
 c/src/lib/libbsp/sh/shsim/startup/linkcmds         |   18 +++++++++-
 c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim     |   18 +++++++++-
 .../lib/libbsp/sparc/shared/startup/linkcmds.base  |   14 ++++++++
 c/src/lib/libbsp/sparc64/shared/startup/linkcmds   |   17 +++++++++-
 c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds  |   14 ++++++++
 79 files changed, 1279 insertions(+), 44 deletions(-)

diff --git a/c/src/lib/libbsp/arm/gba/startup/linkcmds b/c/src/lib/libbsp/arm/gba/startup/linkcmds
index 4765e04..6c97ed8 100644
--- a/c/src/lib/libbsp/arm/gba/startup/linkcmds
+++ b/c/src/lib/libbsp/arm/gba/startup/linkcmds
@@ -139,6 +139,20 @@ SECTIONS
     SORT(CONSTRUCTORS)
     . = ALIGN(4);
   } =0xFF
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } =0xFF
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   __rodata_end = . ;
 
   .eh_frame :
@@ -219,22 +233,7 @@ SECTIONS
 /*************************************************************************
   calculate __ro_end
  *************************************************************************/
-  __ro_end =
-	ADDR(.text) +
-	SIZEOF(.text) +
-	SIZEOF(.init) +
-	SIZEOF(.fini) +
-	SIZEOF(.rodata) +
-	SIZEOF(.eh_frame) +
-	SIZEOF(.gcc_except_table) +
-	SIZEOF(.ctors) +
-	SIZEOF(.dtors) +
-	SIZEOF(.jcr) +
-	SIZEOF(.ARM.extab) +
-	SIZEOF(.ARM.exidx) +
-	SIZEOF(.preinit_array) +
-	SIZEOF(.init_array) +
-	SIZEOF(.fini_array);
+  __ro_end = .;
   PROVIDE(__text_end__ = __ro_end );
 
 /*** IWRAM ***/
@@ -301,7 +300,6 @@ SECTIONS
     *(EXCLUDE_FILE(*.rodata.* *.ewram.o *.iwram.o) .data)
     *(.data.* .gnu.linkonce.d.*)
     *(.data1)
-    *(.tdata .tdata.* .gnu.linkonce.td.*)
     *(.sdata .sdata.* .gnu.linkonce.s.*)
     . = ALIGN(4);
   } =0xFF
@@ -322,7 +320,6 @@ SECTIONS
   .bss :
   {
     *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
-    *(.tbss .tbss.* .gnu.linkonce.tb.*)
     *(.tcommon)
     *(.sbss .sbss.* .gnu.linkonce.sb.*)
     *(.scommon)
diff --git a/c/src/lib/libbsp/arm/shared/startup/linkcmds.base b/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
index a401e6c..16ca19f 100644
--- a/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
@@ -122,11 +122,19 @@ SECTIONS {
 		*(.gcc_except_table .gcc_except_table.*)
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
 	.tdata : ALIGN_WITH_INPUT {
+		_TLS_Data_begin = .;
 		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
 	.tbss : ALIGN_WITH_INPUT {
+		_TLS_BSS_begin = .;
 		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
 	.preinit_array : ALIGN_WITH_INPUT {
 		PROVIDE_HIDDEN (__preinit_array_start = .);
 		KEEP (*(.preinit_array))
diff --git a/c/src/lib/libbsp/avr/avrtest/startup/linkcmds b/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
index fff7564..c78562a 100644
--- a/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
+++ b/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
@@ -151,9 +151,23 @@ SECTIONS
     KEEP (*(.fini0))
      _etext = . ;
   }  > text
-  .data	  : AT (ADDR (.text) + SIZEOF (.text))
-  {
+  .tdata : AT (ADDR (.text) + SIZEOF (.text)) {
      PROVIDE (__data_start = .) ;
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }  > data
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }  > data
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+  .data	  :
+  {
     *(.data)
     *(.data*)
     *(.rodata)  /* We need to include .rodata here if gcc is used */
diff --git a/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds b/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
index a556d4b..a8c5375 100644
--- a/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
@@ -65,6 +65,23 @@ SECTIONS
         LONG(0)
         ___DTOR_END__ = .;         
     } > sdram
+
+    .tdata : {
+        __TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        __TLS_Data_end = .;
+    } > sdram
+
+    .tbss : {
+        __TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        __TLS_BSS_end = .;
+    } > sdram
+
+    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+    __TLS_Alignment = ALIGNOF (.tdata);
     
     .fini :
     {
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds b/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
index c1872e1..9d2366d 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
@@ -73,6 +73,23 @@ SECTIONS
         LONG(0)
         ___DTOR_END__ = .;         
     } > sdram
+
+    .tdata : {
+        __TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        __TLS_Data_end = .;
+    } > sdram
+
+    .tbss : {
+        __TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        __TLS_BSS_end = .;
+    } > sdram
+
+    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+    __TLS_Alignment = ALIGNOF (.tdata);
     
     .fini :
     {
diff --git a/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds b/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
index 51d5d05..02fa04e 100644
--- a/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
@@ -62,6 +62,23 @@ SECTIONS
         LONG(0)
         ___DTOR_END__ = .;         
     } > sdram
+
+    .tdata : {
+        __TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        __TLS_Data_end = .;
+    } > sdram
+
+    .tbss : {
+        __TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        __TLS_BSS_end = .;
+    } > sdram
+
+    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+    __TLS_Alignment = ALIGNOF (.tdata);
     
     .fini :
     {
diff --git a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
index b15662a..bf0ad6f 100644
--- a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
+++ b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
@@ -59,7 +59,21 @@ SECTIONS
 
 	 _etext = .;
     }  >ram
-   .tors SIZEOF(.text) + ADDR(.text): {
+    .tdata SIZEOF(.text) + ADDR(.text): {
+        __TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        __TLS_Data_end = .;
+    }  >ram
+    .tbss SIZEOF(.tdata) + ADDR(.tdata): {
+        __TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        __TLS_BSS_end = .;
+    }  >ram
+    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+    __TLS_Alignment = ALIGNOF (.tdata);
+   .tors SIZEOF(.tbss) + ADDR(.tbss): {
         ___ctors = . ;
         *(.ctors)
         ___ctors_end = . ;
diff --git a/c/src/lib/libbsp/i386/pc386/startup/linkcmds b/c/src/lib/libbsp/i386/pc386/startup/linkcmds
index 04d5fea..c59d4f5 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/linkcmds
+++ b/c/src/lib/libbsp/i386/pc386/startup/linkcmds
@@ -97,6 +97,20 @@ SECTIONS
   PROVIDE (etext = .);
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .eh_frame_hdr : { *(.eh_frame_hdr) }
   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds b/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
index 1e0d085..a1db0f2 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
+++ b/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
@@ -79,6 +79,20 @@ SECTIONS
 
   .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> sdram
   .rodata1        : { *(.rodata1) }	> sdram
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } > sdram
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } > sdram
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
 
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
diff --git a/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds b/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
index aeebec7..31c6c9b 100644
--- a/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
+++ b/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
@@ -78,6 +78,20 @@ SECTIONS
 
   .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> sdram
   .rodata1        : { *(.rodata1) }	> sdram
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } > sdram
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } > sdram
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
 
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds b/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
index 15141f9..4fbf54f 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
+++ b/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
@@ -61,6 +61,21 @@ SECTIONS
     PROVIDE(__romdatastart = .); /* IF_ROROM */
   } > RAM
 
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > RAM
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > RAM
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
+
   .data : {
     . = ALIGN(32 / 8);
     PROVIDE (__datastart = .); /* IF_ROROM */
diff --git a/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds b/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
index e389db0..adde91c 100644
--- a/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
+++ b/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
@@ -80,6 +80,20 @@ SECTIONS
   PROVIDE (etext = .);
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .sdata2         :
   {
     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmds b/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
index 089d3d4..447fea9 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
@@ -133,6 +133,23 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >ram
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } >ram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >ram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
         .data : {
             PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
index 59fb269..2c1aa77 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
@@ -132,8 +132,25 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >flash
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } >flash
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >flash
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
-        .data 0x1000 : AT ( ADDR(.text) + SIZEOF ( .text ) )
+        .data 0x1000 : AT ( ADDR(.tdata) + SIZEOF ( .tdata ) )
 	{
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
index fabfbe2..e01d4d5 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
@@ -132,6 +132,23 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >ram
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } >ram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >ram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
         .data : {
             PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/csb360/startup/linkcmds b/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
index 27297e0..1ec50d7 100644
--- a/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
@@ -102,6 +102,24 @@ SECTIONS
 
    } > ram
 
+   .tdata : {
+	_TLS_Data_begin = .;
+	*(.tdata .tdata.* .gnu.linkonce.td.*)
+	_TLS_Data_end = .;
+   } >ram
+
+   .tbss : {
+	_TLS_BSS_begin = .;
+	*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+	_TLS_BSS_end = .;
+   } >ram
+
+   _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+   _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+   _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+   _TLS_Alignment = ALIGNOF (.tdata);
+
+
    .data :
    {
 	copy_start = .;
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
index adc9a62..957d94b 100644
--- a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
@@ -114,6 +114,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
index 0ddc675..0a9d764 100644
--- a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
@@ -142,6 +142,24 @@ SECTIONS {
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
index a76ab96..6b86db2 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
@@ -106,6 +106,24 @@ SECTIONS {
                  . = ALIGN (16);
                 PROVIDE (etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 _copy_start = .;
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
index 48e38fd..0c1e710 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
@@ -111,6 +111,24 @@ SECTIONS {
                  . = ALIGN (16);
                 PROVIDE (etext = .);
         } >rom
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >rom
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >rom
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : AT(SIZEOF(.text)) {
                 _copy_start = .;
                 *(.data)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
index 75beeaf..a360a3a 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
@@ -110,6 +110,24 @@ SECTIONS {
                  . = ALIGN (16);
                 PROVIDE (etext = .);
         } >rom
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >rom
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >rom
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : AT(SIZEOF(.text)) {
                 _copy_start = .;
                 *(.data)
diff --git a/c/src/lib/libbsp/m68k/idp/startup/linkcmds b/c/src/lib/libbsp/m68k/idp/startup/linkcmds
index 247b48d..eaaf200 100644
--- a/c/src/lib/libbsp/m68k/idp/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/idp/startup/linkcmds
@@ -111,6 +111,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
index 89e0825..ee8ddaa 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
@@ -137,6 +137,23 @@ SECTIONS
 
    } > ram
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    .data BLOCK (0x4) : {
            copy_start = .;
            *(.shdata)
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
index 8e01947..5f49fcd 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
@@ -137,6 +137,23 @@ SECTIONS
 
    } >rom
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >rom
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >rom
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    .data 0x30000400 : AT(LOADADDR(.text) + SIZEOF(.text)) {
            copy_start = .;
            . = ALIGN (0x10);
diff --git a/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
index f5fe3d0..761b4e2 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
@@ -116,11 +116,28 @@ SECTIONS
 
         *(.console_gdb_xfer)
         *(.bootstrap_data)
+    } >flash
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
         . = ALIGN(16);
         _estuff = .;
         PROVIDE (_etext = .);
     } >flash
 
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >flash
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     .data 0x20000400 : AT (_estuff)
     {
         PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
index 1eff44b..fabbda8 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
@@ -116,11 +116,28 @@ SECTIONS
 
         *(.console_gdb_xfer)
         *(.bootstrap_data)
+    } >flash
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
         . = ALIGN(16);
         _estuff = .;
         PROVIDE (_etext = .);
     } >flash
 
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >flash
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     .data 0x20000400 : AT (_estuff)
     {
         PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
index 8cb0503..4afe1d2 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
@@ -140,6 +140,23 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >ram
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } > dram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } > dram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
         .data : {
             PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
index 26eb9fd..7a8a2fc 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
@@ -144,8 +144,25 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >flash
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } >flash
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >flash
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
-        .data 0x4000 : AT ( ADDR(.text) + SIZEOF ( .text ) )
+        .data 0x4000 : AT ( ADDR(.tdata) + SIZEOF ( .tdata ) )
 	{
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
index 054d3f8..d80a4cd 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
@@ -140,6 +140,23 @@ SECTIONS
         _estuff = .;
     PROVIDE (_etext = .);
     } >ram
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } >ram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } >ram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
         
         .data : {
             PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
index be68702..f660bc3 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
@@ -132,6 +132,23 @@ SECTIONS
         PROVIDE (_etext = .);
     } > dram
 
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } > dram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } > dram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     .data :
     {
         PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
index 7137f5f..282e381 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
@@ -123,11 +123,28 @@ SECTIONS
 
         *(.console_gdb_xfer)
         *(.bootstrap_data)
+    } > boot_flash
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
         . = ALIGN(16);
         _estuff = .;
         PROVIDE (_etext = .);
     } > boot_flash
 
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } > boot_flash
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     .data 0x40000500 : AT (_estuff)
     {
         PROVIDE( _data_dest_start = . );
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
index 854cfe4..651fc9f 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
@@ -135,6 +135,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
index 574e64c..48b2f3f 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
+++ b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
@@ -146,8 +146,22 @@ SECTIONS
     _etext = .;
     _endtext = .;
   } > rom
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } > rom
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } > rom
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .gcc_exc :
-  AT ( ADDR(.text) + SIZEOF( .text ) )
+  AT ( ADDR(.tdata) + SIZEOF( .tdata ) )
   {
     *(.gcc_exc)
   } > ram
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
index 0f90431..fec7115 100644
--- a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
@@ -111,6 +111,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
index 6438e4d..5d2170d 100644
--- a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
@@ -115,6 +115,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
index 5c30b23..e262802 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
@@ -115,6 +115,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
index 862c2f6..49e3b4d 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
@@ -118,6 +118,24 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         } >ram
+
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >ram
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >ram
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
index 9e80f1c..7b480d2 100644
--- a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
@@ -125,6 +125,23 @@ SECTIONS
     . = ALIGN (16);
     PROVIDE (_etext = .);
   } >ram
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   
   .data : {
     PROVIDE (_copy_start = .);
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/debugger b/c/src/lib/libbsp/m68k/ods68302/startup/debugger
index 4b6f3f6..f1653e5 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/debugger
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/debugger
@@ -23,6 +23,21 @@ SECTIONS
     __DTOR_END__ = .;
   }
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   .vtable (ADDR(.text) + SIZEOF(.text))  :
   {
     vtable_start = .;
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
index 5a15e9d..e5664d8 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
@@ -128,8 +128,26 @@ SECTIONS
                 PROVIDE (_etext = .);
         } >rom
 
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} >rom
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} >rom
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
+
         .data (ADDR(.vtable) + SIZEOF(.vtable)) : 
-          AT (ADDR(.text) + SIZEOF(.text)) {
+          AT (ADDR(.tdata) + SIZEOF(.tdata)) {
                 PROVIDE (_copy_start = .);
                 *(.data*)
 		*(.gnu.linkonce.d*)
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/rom b/c/src/lib/libbsp/m68k/ods68302/startup/rom
index 29c4959..ef2c527 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/rom
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/rom
@@ -22,6 +22,21 @@ SECTIONS
     LONG(0)
     __DTOR_END__ = .;
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   
   .vtable 0 :
   {
diff --git a/c/src/lib/libbsp/m68k/shared/startup/linkcmds.base b/c/src/lib/libbsp/m68k/shared/startup/linkcmds.base
index 7675002..253ea26 100644
--- a/c/src/lib/libbsp/m68k/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/m68k/shared/startup/linkcmds.base
@@ -57,11 +57,19 @@ SECTIONS {
 		*(.gcc_except_table .gcc_except_table.*)
 	} > REGION_TEXT AT > REGION_TEXT_LOAD
 	.tdata : ALIGN_WITH_INPUT {
+		_TLS_Data_begin = .;
 		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
 	} > REGION_TEXT AT > REGION_TEXT_LOAD
 	.tbss : ALIGN_WITH_INPUT {
+		_TLS_BSS_begin = .;
 		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
 	} > REGION_TEXT AT > REGION_TEXT_LOAD
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
 	.preinit_array : ALIGN_WITH_INPUT {
 		PROVIDE_HIDDEN (__preinit_array_start = .);
 		KEEP (*(.preinit_array))
diff --git a/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds b/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
index eeae18b..9744f50 100644
--- a/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
@@ -108,7 +108,25 @@ SECTIONS
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
         }
-        .data 0x80000 : AT (ADDR(.text) + SIZEOF (.text)) {
+
+	.tdata ADDR(.text) + SIZEOF (.text) : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	}
+
+	.tbss ADDR(.tdata) + SIZEOF (.tdata) : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	}
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
+        .data 0x80000 : AT (ADDR(.tdata) + SIZEOF (.tdata)) {
                 PROVIDE (_copy_start = .);
                 *(.data*)
 		*(.gnu.linkonce.d*)
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
index d7f810e..7b8dd9e 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
@@ -149,6 +149,23 @@ SECTIONS
         PROVIDE (_etext = .);
     } >ram
 
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } > ram
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
+    } > ram
+
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     .data : {
         PROVIDE( _data_dest_start = . );
         PROVIDE( _copy_start = .);
diff --git a/c/src/lib/libbsp/mips/csb350/startup/linkcmds b/c/src/lib/libbsp/mips/csb350/startup/linkcmds
index bfa8e2f..ceda3e2 100644
--- a/c/src/lib/libbsp/mips/csb350/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/csb350/startup/linkcmds
@@ -114,6 +114,23 @@ SECTIONS
     *(.gnu.linkonce.r*)
   } >ram  
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   .data : 
   {
     _fdata = ALIGN(16);
diff --git a/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds b/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
index a851b06..f095069 100644
--- a/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
@@ -111,6 +111,23 @@ SECTIONS
     *(.gnu.linkonce.r*)
   } >ram  
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   .data : 
   {
     _fdata = ALIGN(16);
diff --git a/c/src/lib/libbsp/mips/hurricane/startup/linkcmds b/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
index 7891462..0962039 100644
--- a/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
@@ -99,6 +99,24 @@ SECTIONS
     *(.rodata.*)
     *(.gnu.linkonce.r*)
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    _fdata = ALIGN(16);
 
   .data : {
diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds b/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds
index 1360bf4..9d98018 100644
--- a/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds
@@ -95,6 +95,24 @@ SECTIONS
     *(.rodata.*)
     *(.gnu.linkonce.r*)
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    _fdata = ALIGN(16);
 
   .data : {
diff --git a/c/src/lib/libbsp/mips/malta/startup/linkcmds b/c/src/lib/libbsp/mips/malta/startup/linkcmds
index 0b11b9c..8be52ef 100644
--- a/c/src/lib/libbsp/mips/malta/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/malta/startup/linkcmds
@@ -95,6 +95,24 @@ SECTIONS
     *(.rodata.*)
     *(.gnu.linkonce.r*)
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    _fdata = ALIGN(16);
 
   .data : {
diff --git a/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds b/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
index 1f8a4c2..6c15b7e 100644
--- a/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
@@ -99,6 +99,24 @@ SECTIONS
     *(.rodata.*)
     *(.gnu.linkonce.r*)
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    _fdata = ALIGN(16);
 
   .data : {
diff --git a/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds b/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
index 4e5d6c8..488f9f7 100644
--- a/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
@@ -99,6 +99,24 @@ SECTIONS
     *(.rodata.*)
     *(.gnu.linkonce.r*)
   }
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
    _fdata = ALIGN(16);
 
   .data : {
diff --git a/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds b/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
index 11a98ba..00e2871 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
+++ b/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
@@ -132,6 +132,20 @@ SECTIONS
   } =0
   .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
   .rodata1   : { *(.rodata1) }
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .eh_frame_hdr : { *(.eh_frame_hdr) }
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
index cdbc7a0..55c04b4 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
@@ -195,10 +195,27 @@ SECTIONS
         . = ALIGN(32 / 8);
         *(.rodata .rodata.* .gnu.linkonce.r.*)
         *(.rodata1)
+    } > onchip_memory_0
+
+    .tdata : {
+        _TLS_Data_begin = .;
+        *(.tdata .tdata.* .gnu.linkonce.td.*)
+        _TLS_Data_end = .;
+    } > onchip_memory_0
+
+    .tbss : {
+        _TLS_BSS_begin = .;
+        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+        _TLS_BSS_end = .;
         . = ALIGN(32 / 8);
         PROVIDE (__ram_rodata_end = ABSOLUTE(.));
     } > onchip_memory_0
 
+    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+    _TLS_Alignment = ALIGNOF (.tdata);
+
     PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
 
     .rwdata  :
diff --git a/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds b/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
index a186b6d..667e193 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
@@ -95,6 +95,20 @@ SECTIONS
   .fini			  : { _fini = .; *(.fini)	} >CODE
   .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> CODE
   .rodata1        : { *(.rodata1) }	> CODE
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >CODE
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >CODE
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
 _SDA2_BASE_ = __SDATA2_START__ + 0x8000;
   .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  }	> CODE
   .sbss2          : { 
diff --git a/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds b/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
index 61df06a..0f4d247 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
@@ -64,6 +64,20 @@ SECTIONS
   .fini		  : { _fini = .; *(.fini)	}
   .rodata  	  : { *(.rodata*) *(.gnu.linkonce.r*) }
   .rodata1	  : { *(.rodata1) }
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .eh_frame	  : { *(.eh_frame) }
   _etext = .;
   PROVIDE (etext = .);
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
index 637a973..0cb5692 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
@@ -121,6 +121,21 @@ SECTIONS {
 		PROVIDE (etext = .);
 	} > RAM
 
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} > RAM
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} > RAM
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
 	.sdata2 : {
 		PROVIDE (_SDA2_BASE_ = 32768);
 
diff --git a/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds b/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
index 788a347..3c7942e 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
@@ -141,6 +141,23 @@ SECTIONS
 
   text.size = text.end - text.start;
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >RAM
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >RAM
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   .jcr : { KEEP (*(.jcr)) } >RAM
 
     .rel.dyn : {
diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
index 54e728e..9307a9e 100644
--- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
@@ -138,6 +138,23 @@ SECTIONS
     PROVIDE (etext = .);
     PROVIDE (__etext = .);
  } > ram
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
  
   .rel.dyn        :
     {
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
index 444420a..0ff192e 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
@@ -140,6 +140,23 @@ SECTIONS
 
     } > ram
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ram
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ram
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
 
   .rel.dyn        :
     {
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds b/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
index 7744ce6..079d3fc 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
@@ -76,6 +76,21 @@ SECTIONS
   PROVIDE (__DTOR_END__ = .);
   .jcr            : { KEEP (*(.jcr))	} > ROM =0
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >ROM =0
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >ROM =0
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   .rodata :
   {
     *(.rodata .rodata.* .gnu.linkonce.r.*)
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds b/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
index 0c28ace..d1da9a2 100644
--- a/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
@@ -103,6 +103,20 @@ SECTIONS
   .fini		  : { _fini = .; __fini = .; *(.fini)		} >RAM
   .rodata  	  : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM
   .rodata1	  : { *(.rodata1)		} >RAM
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >RAM
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >RAM
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .eh_frame	  : { *(.eh_frame)		} >RAM
   _etext = .;
   PROVIDE (_etext = .);
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
index f2860d5..df5affb 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
@@ -80,6 +80,23 @@ SECTIONS
   .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> CODE
   .rodata1        : { *(.rodata1) }	> CODE
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >CODE
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >CODE
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(0x10000) + (. & (0x10000 - 1));
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base
index 5a330d6..060e7a1 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base
@@ -109,11 +109,19 @@ SECTIONS {
 		*(.gcc_except_table .gcc_except_table.*)
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
 	.tdata : ALIGN_WITH_INPUT {
+		_TLS_Data_begin = .;
 		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
 	.tbss : ALIGN_WITH_INPUT {
+		_TLS_BSS_begin = .;
 		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
 	} > REGION_RODATA AT > REGION_RODATA_LOAD
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
 	.preinit_array : ALIGN_WITH_INPUT {
 		PROVIDE_HIDDEN (__preinit_array_start = .);
 		KEEP (*(.preinit_array))
diff --git a/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds b/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
index f321404..45a18fa 100644
--- a/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
@@ -132,6 +132,13 @@ SECTIONS
     text.end = .;
     PROVIDE (etext = .);
     PROVIDE (__etext = .);
+  }
+  text.size = text.end - text.start;
+
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
 
     /* 
      * .data section contents, copied to RAM at system startup. 
@@ -139,7 +146,15 @@ SECTIONS
     . = ALIGN(0x20);
     data.contents.start = .;
   }
-  text.size = text.end - text.start;
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
 
   /*
    * If debugging, stack the read/write sections directly after the text
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
index d23e98a..ba6c1ea 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
@@ -113,6 +113,23 @@ SECTIONS {
 		PROVIDE (etext = .);
 	} > RAM
 
+	.tdata : {
+		_TLS_Data_begin = .;
+		*(.tdata .tdata.* .gnu.linkonce.td.*)
+		_TLS_Data_end = .;
+	} > RAM
+
+	.tbss : {
+		_TLS_BSS_begin = .;
+		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+		_TLS_BSS_end = .;
+	} > RAM
+
+	_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+	_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+	_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+	_TLS_Alignment = ALIGNOF (.tdata);
+
 	.sdata2 : {
 		PROVIDE (_SDA2_BASE_ = 32768);
 
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds b/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
index 74a10aa..ed8ef75 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
@@ -94,6 +94,23 @@ SECTIONS
   .rodata         : { *(.rodata.* .gnu.linkonce.r*)                    } > RAM
   .rodata1        : { *(.rodata1)                                      } > RAM
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >RAM
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >RAM
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   /* Initialised small data addressed as offsets from r2 */
 _SDA2_BASE_ = __SDATA2_START__ + 0x8000;
   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)          } > RAM
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds b/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
index a92d9a1..3929b21 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
@@ -94,6 +94,23 @@ SECTIONS
   .rodata         : { *(.rodata.* .gnu.linkonce.r*)                    } > RAM
   .rodata1        : { *(.rodata1)                                      } > RAM
 
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } >RAM
+
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } >RAM
+
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
+
   /* Initialised small data addressed as offsets from r2 */
 _SDA2_BASE_ = __SDATA2_START__ + 0x8000;
   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)          } > RAM
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
index 90715b2..6a447a4 100644
--- a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
@@ -128,9 +128,23 @@ SECTIONS
   } > ram
   _etext = .;
   PROVIDE (etext = .);
-  .fini    .  : { *(.fini)    } =0
-  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .fini    .  : { *(.fini)    } > ram =0
+  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
index be04e23..7c090bb 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
@@ -139,9 +139,23 @@ SECTIONS
   } > ram
   _etext = .;
   PROVIDE (etext = .);
-  .fini    .  : { *(.fini)    } =0
-  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .fini    .  : { *(.fini)    } > ram =0
+  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
index 1d75185..48c5f4f 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
@@ -138,9 +138,23 @@ SECTIONS
   } > ram
   _etext = .;
   PROVIDE (etext = .);
-  .fini    .  : { *(.fini)    } =0
-  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .fini    .  : { *(.fini)    } > ram =0
+  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
index b734437..930fa6d 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
@@ -139,9 +139,23 @@ SECTIONS
   } > ram
   _etext = .;
   PROVIDE (etext = .);
-  .fini    .  : { *(.fini)    } =0
-  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .fini    .  : { *(.fini)    } > ram =0
+  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
index 2546bf2..e38cb63 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
@@ -93,6 +93,20 @@ SECTIONS
     *(.rodata.*) 
     *(.gnu.linkonce.r*) 
   } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   .ctors   : 
   {
     ___ctors = .;
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
index a5cd939..89325c0 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
@@ -105,6 +105,20 @@ SECTIONS
     *(.gnu.linkonce.r*) 
     . = ALIGN(32);
   } > rom
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > rom
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > rom
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   .ctors   : 
   {
     ___ctors = .;
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
index 68c3b1a..0ce6eff 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
@@ -92,6 +92,20 @@ SECTIONS
     *(.gnu.linkonce.r*) 
     . = ALIGN(32);
   } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   .ctors   :  AT(LOADADDR(.rodata) + SIZEOF(.rodata))
   {
     ___ctors = .;
diff --git a/c/src/lib/libbsp/sh/shsim/startup/linkcmds b/c/src/lib/libbsp/sh/shsim/startup/linkcmds
index a12af48..4da05e4 100644
--- a/c/src/lib/libbsp/sh/shsim/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/shsim/startup/linkcmds
@@ -127,8 +127,22 @@ SECTIONS
   } =0
   _etext = .;
   PROVIDE (etext = .);
-  .rodata  .  : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .rodata  .  : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim b/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
index 9e5c86f..6543fbd 100644
--- a/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
+++ b/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
@@ -121,8 +121,22 @@ SECTIONS
   } =0
   _etext = .;
   PROVIDE (etext = .);
-  .rodata  .  : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) }
-  .rodata1 .  : { *(.rodata1) }
+  .rodata  .  : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) } > ram
+  .rodata1 .  : { *(.rodata1) } > ram
+  .tdata : {
+    __TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    __TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    __TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    __TLS_BSS_end = .;
+  } > ram
+  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
+  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
+  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
+  __TLS_Alignment = ALIGNOF (.tdata);
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(128) + (. & (128 - 1));
diff --git a/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base b/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
index 848f46b..a024378 100644
--- a/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base
@@ -108,6 +108,20 @@ SECTIONS
     *(.shdata)
     . = ALIGN (16);
   } > ram
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } > ram
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } > ram
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .rtemsroset : {
     /* for pre rtems-libbsd FreeBSD code */
     __start_set_sysctl_set = .;
diff --git a/c/src/lib/libbsp/sparc64/shared/startup/linkcmds b/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
index ae9688d..661ad2e 100644
--- a/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
+++ b/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
@@ -148,8 +148,23 @@ SECTIONS
     _endtext = . ;
     _etext = . ;
   } > ram
+
+  .tdata : AT (ADDR (.text) + SIZEOF (.text)) {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  } > ram
+  .tbss : AT (ADDR (.tdata) + SIZEOF (.tdata)) {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  } > ram
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   
-  .data	  : AT (ADDR (.text) + SIZEOF (.text))
+  .data	  : AT (ADDR (.tbss) + SIZEOF (.tbss))
   {
      PROVIDE (__data_start = .) ;
     data_start = . ;
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds b/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
index cf30f3b..3d0912c 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
+++ b/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
@@ -91,6 +91,20 @@ SECTIONS
   .fini		: { KEEP (*(.fini)) } =0
   .rodata	: { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
   .rodata1	: { *(.rodata1) }
+  .tdata : {
+    _TLS_Data_begin = .;
+    *(.tdata .tdata.* .gnu.linkonce.td.*)
+    _TLS_Data_end = .;
+  }
+  .tbss : {
+    _TLS_BSS_begin = .;
+    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
+    _TLS_BSS_end = .;
+  }
+  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
+  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
+  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
+  _TLS_Alignment = ALIGNOF (.tdata);
   .data		:
   {
     *(.data)
-- 
1.7.7




More information about the devel mailing list