hmmdyl / LWDR

LightWeight D Runtime targeting ARM Cortex CPUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Thread Local Storage (TLS)

hmmdyl opened this issue · comments

Thread Local Storage (TLS) is not supported. TLS is reliant on RTOS support - TLS variables are allocated in a heap and the pointer is stored in the RTOS' Thread Control Block (TCB). __aeabi_read_tp must then read this pointer.

TLS support is complete (but not committed).

I needed to add support to my linker script with the following:

  .tdata : 
  {
    . = ALIGN(4);
  	_tdata = .;
  	*(.tdata)
  	*(.tdata*)
  	. = ALIGN(4);
  } >FLASH
  _tdata_size = SIZEOF(.tdata);
  
  .tbss :
  {
    . = ALIGN(4);
  	_tbss = .;
  	*(.tbss)
  	*(.tbss.*)
  	*(.tcommon)
  	_etbss = .;
  	. = ALIGN(4);
  } >FLASH
  _tbss_size = SIZEOF(.tbss);

This is based on the work from denizzzka.

Fixed in commit #8067eb7