From d60e760e8096feac0fff494f9bb1a0538115a905 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 22 Apr 2014 09:45:39 +0200 Subject: 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. --- doc/cpu_supplement/general.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/cpu_supplement/general.t b/doc/cpu_supplement/general.t index 173f84fcc9..3d84c2a901 100644 --- a/doc/cpu_supplement/general.t +++ b/doc/cpu_supplement/general.t @@ -355,9 +355,11 @@ in its linker command file: _TLS_BSS_end = .; @} _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; +_TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; +_TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; -_TLS_Alignment = ALIGNOF (.tdata); +_TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); @end example @section CPU counter -- cgit v1.2.3