summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/sh/gensh2/startup/linkcmds')
-rw-r--r--c/src/lib/libbsp/sh/gensh2/startup/linkcmds4
1 files changed, 3 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
index 3f7b8bb1cc..ab7e31e5d0 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
@@ -153,9 +153,11 @@ SECTIONS
__TLS_BSS_end = .;
} > 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));
/* 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));