seL4 / sel4runtime

A minimal runtime for seL4 applications.
Other
12 stars 29 forks source link

lld: Fix .tdata/.tbss addresses when .tdata is empty #17

Closed heshamelmatary closed 9 months ago

heshamelmatary commented 1 year ago

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.

kent-mcleod commented 1 year ago

Are you able to address the gitlint and style checks? Then it should be good to merge.