thread-local-storage.cmake 1.3 KB

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