From 960fd8546fb0130058e6a588fbc62d696d01df0e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 28 Jan 2014 11:52:17 +0100 Subject: bsps: Thread-local storage (TLS) for linkcmds --- c/src/lib/libbsp/sh/gensh2/startup/linkcmds | 20 +++++++++++++++++--- c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram | 20 +++++++++++++++++--- c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom | 20 +++++++++++++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) (limited to 'c/src/lib/libbsp/sh/gensh2') diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds index be04e23faa..7c090bb7ef 100644 --- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds +++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds @@ -139,9 +139,23 @@ SECTIONS } > ram _etext = .; PROVIDE (etext = .); - .fini . : { *(.fini) } =0 - .rodata . : { *(.rodata*) *(.gnu.linkonce.r*) } - .rodata1 . : { *(.rodata1) } + .fini . : { *(.fini) } > ram =0 + .rodata . : { *(.rodata*) *(.gnu.linkonce.r*) } > ram + .rodata1 . : { *(.rodata1) } > ram + .tdata : { + __TLS_Data_begin = .; + *(.tdata .tdata.* .gnu.linkonce.td.*) + __TLS_Data_end = .; + } > ram + .tbss : { + __TLS_BSS_begin = .; + *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) + __TLS_BSS_end = .; + } > ram + __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin; + __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin; + __TLS_Size = __TLS_BSS_end - __TLS_Data_begin; + __TLS_Alignment = ALIGNOF (.tdata); /* 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 1d75185354..48c5f4fa46 100644 --- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram +++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram @@ -138,9 +138,23 @@ SECTIONS } > ram _etext = .; PROVIDE (etext = .); - .fini . : { *(.fini) } =0 - .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 . : { *(.rodata1) } + .fini . : { *(.fini) } > ram =0 + .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } > ram + .rodata1 . : { *(.rodata1) } > ram + .tdata : { + __TLS_Data_begin = .; + *(.tdata .tdata.* .gnu.linkonce.td.*) + __TLS_Data_end = .; + } > ram + .tbss : { + __TLS_BSS_begin = .; + *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) + __TLS_BSS_end = .; + } > ram + __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin; + __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin; + __TLS_Size = __TLS_BSS_end - __TLS_Data_begin; + __TLS_Alignment = ALIGNOF (.tdata); /* 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 b734437d5c..930fa6d13d 100644 --- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom +++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom @@ -139,9 +139,23 @@ SECTIONS } > ram _etext = .; PROVIDE (etext = .); - .fini . : { *(.fini) } =0 - .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 . : { *(.rodata1) } + .fini . : { *(.fini) } > ram =0 + .rodata . : { *(.rodata) *(.gnu.linkonce.r*) } > ram + .rodata1 . : { *(.rodata1) } > ram + .tdata : { + __TLS_Data_begin = .; + *(.tdata .tdata.* .gnu.linkonce.td.*) + __TLS_Data_end = .; + } > ram + .tbss : { + __TLS_BSS_begin = .; + *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) + __TLS_BSS_end = .; + } > ram + __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin; + __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin; + __TLS_Size = __TLS_BSS_end - __TLS_Data_begin; + __TLS_Alignment = ALIGNOF (.tdata); /* 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)); -- cgit v1.2.3