1# originates from thread-local-storage.ld
2
3if(CONFIG_THREAD_LOCAL_STORAGE)
4  zephyr_linker_section(NAME .tdata LMA FLASH NOINPUT)
5  zephyr_linker_section_configure(SECTION .tdata INPUT ".tdata")
6  zephyr_linker_section_configure(SECTION .tdata INPUT ".tdata.*")
7  zephyr_linker_section_configure(SECTION .tdata INPUT ".gnu.linkonce.td.*")
8  # GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
9
10  zephyr_linker_section(NAME .tbss LMA FLASH NOINPUT)
11  zephyr_linker_section_configure(SECTION .tbss INPUT ".tbss")
12  zephyr_linker_section_configure(SECTION .tbss INPUT ".tbss.*")
13  zephyr_linker_section_configure(SECTION .tbss INPUT ".gnu.linkonce.tb.*")
14  zephyr_linker_section_configure(SECTION .tbss INPUT ".tcommon")
15  # GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
16
17  #
18  # These needs to be outside of the tdata/tbss
19  # sections or else they would be considered
20  # thread-local variables, and the code would use
21  # the wrong values.
22  #
23  # This scheme is not yet handled
24  if(CONFIG_XIP)
25#	/* The "master copy" of tdata should be only in flash on XIP systems */
26#	PROVIDE(__tdata_start = LOADADDR(tdata));
27  else()
28#	PROVIDE(__tdata_start = ADDR(tdata));
29  endif()
30#	PROVIDE(__tdata_size = SIZEOF(tdata));
31#	PROVIDE(__tdata_end = __tdata_start + __tdata_size);
32#	PROVIDE(__tdata_align = ALIGNOF(tdata));
33#
34#	PROVIDE(__tbss_start = ADDR(tbss));
35#	PROVIDE(__tbss_size = SIZEOF(tbss));
36#	PROVIDE(__tbss_end = __tbss_start + __tbss_size);
37#	PROVIDE(__tbss_align = ALIGNOF(tbss));
38#
39#	PROVIDE(__tls_start = __tdata_start);
40#	PROVIDE(__tls_end = __tbss_end);
41#	PROVIDE(__tls_size = __tbss_end - __tdata_start);
42
43endif()
44