diff --git a/cpu/cortexm_common/ldscripts/cortexm_base.ld b/cpu/cortexm_common/ldscripts/cortexm_base.ld index 4145e9219c..06283bc805 100644 --- a/cpu/cortexm_common/ldscripts/cortexm_base.ld +++ b/cpu/cortexm_common/ldscripts/cortexm_base.ld @@ -132,6 +132,10 @@ SECTIONS } > rom __tls_size = __tbss_end - __tdata_start; __tbss_size = __tls_size - __tdata_size; + PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); + PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); + PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) ); + PROVIDE( __arm64_tls_tcb_offset = MAX(16, __tls_align) ); /* .ARM.exidx is sorted, so has to go in its own output section. */ PROVIDE_HIDDEN (__exidx_start = .); diff --git a/cpu/lpc23xx/ldscripts/lpc23xx.ld b/cpu/lpc23xx/ldscripts/lpc23xx.ld index 48c5e91f9e..35e70ce3fc 100644 --- a/cpu/lpc23xx/ldscripts/lpc23xx.ld +++ b/cpu/lpc23xx/ldscripts/lpc23xx.ld @@ -106,6 +106,9 @@ SECTIONS } > rom __tls_size = __tbss_end - __tdata_start; __tbss_size = __tls_size - __tdata_size; + PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); + PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) ); + PROVIDE( __arm64_tls_tcb_offset = MAX(16, __tls_align) ); /* .ARM.exidx is sorted, so has to go in its own output section. */ PROVIDE_HIDDEN (__exidx_start = .); diff --git a/cpu/riscv_common/ldscripts/riscv_base.ld b/cpu/riscv_common/ldscripts/riscv_base.ld index 3097a30aed..609a47699d 100644 --- a/cpu/riscv_common/ldscripts/riscv_base.ld +++ b/cpu/riscv_common/ldscripts/riscv_base.ld @@ -159,6 +159,8 @@ SECTIONS } >flash : tls __tls_size = __tbss_end - __tdata_start; __tbss_size = __tls_size - __tdata_size; + PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); + PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); .lalign : {