Unliked ld.bfd, lld assigns 0 address to empty output sections and its linker variables. This will make
_tdata_start and _tdata_end zero. Assuming _tdata_end in this code to be adjacent to _tbss_start would be wrong and will trigger address faults as the TLS'
region p_memsz value will be wrong.
Assigning empty tbss_start to tdata[_start|_end] will follow ld.bfd and results in the proper 0 p_memsz.
Unliked ld.bfd, lld assigns 0 address to empty output sections and its linker variables. This will make _tdata_start and _tdata_end zero. Assuming _tdata_end in this code to be adjacent to _tbss_start would be wrong and will trigger address faults as the TLS' region p_memsz value will be wrong.
Assigning empty tbss_start to tdata[_start|_end] will follow ld.bfd and results in the proper 0 p_memsz.
Sponsored by: DARPA.