summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sh/gensh2/startup/linkcmds4
-rw-r--r--c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram4
-rw-r--r--c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom4
3 files changed, 9 insertions, 3 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));
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
index 2260b835b5..c962e8f9a0 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
@@ -152,9 +152,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));
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
index a0f98019f9..321760aa6f 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
@@ -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));