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. --- c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'c/src/lib/libbsp/powerpc/mbx8xx') diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds index 9307a9e8cc..45332bceaa 100644 --- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds +++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds @@ -152,9 +152,11 @@ SECTIONS } >ram _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)); .rel.dyn : { -- cgit v1.2.3