mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Revision:
179:b0033dcd6934
Parent:
177:d650f5d4c87a
Child:
180:96ed750bd169
--- a/platform/mbed_retarget.cpp	Thu Nov 23 11:57:25 2017 +0000
+++ b/platform/mbed_retarget.cpp	Thu Dec 07 14:01:42 2017 +0000
@@ -940,7 +940,11 @@
 extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {}
 extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {}
 #if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
-extern "C" WEAK void *__aeabi_read_tp (void) { return NULL ;}
+#pragma section="__iar_tls$$DATA"
+extern "C" WEAK void *__aeabi_read_tp (void) {
+  // Thread Local storage is not supported, using main thread memory for errno
+  return __section_begin("__iar_tls$$DATA");
+}
 #endif
 #elif defined(__CC_ARM)
 // Do nothing