mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
Kernel: Handle running programs that don't have a TLS image
Programs without a PT_TLS header won't have a master TLS image for us to copy, so we shouldn't try to copy the m_master_tls_region then.
This commit is contained in:
parent
a635619cc0
commit
899233a925
1 changed files with 2 additions and 1 deletions
|
@ -637,5 +637,6 @@ void Thread::make_thread_specific_region(Badge<Process>)
|
|||
auto* thread_local_storage = (u8*)((u8*)thread_specific_data) - align_up_to(process().m_master_tls_size, process().m_master_tls_alignment);
|
||||
m_thread_specific_data = VirtualAddress((u32)thread_specific_data);
|
||||
thread_specific_data->self = thread_specific_data;
|
||||
memcpy(thread_local_storage, process().m_master_tls_region->vaddr().as_ptr(), process().m_master_tls_size);
|
||||
if (process().m_master_tls_size)
|
||||
memcpy(thread_local_storage, process().m_master_tls_region->vaddr().as_ptr(), process().m_master_tls_size);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue