Bananymous
5ad7d7edb1
DynamicLoader: Fix TLS on 32 bit platform
...
There were two problems with my previous implementation
- TLS was not allocated if nothing used it. There is a fallback
initialization in _init_libc, but this was not enough if one of the
init functions tried to access errno.
- __tls_get_addr was not resolved. If __tls_get_addr was called through
a plt entry, everything would just break :(
2025-06-06 16:27:07 +03:00
Bananymous
1c882ea361
DynamicLoader: Don't print TODOs on PT_GNU_ headers
...
These should be either handled by kernel or just used as optimizations.
There is no requirement to handle them in dynamic loader
2025-06-01 13:48:03 +03:00
Bananymous
2cbfe70a28
DynamicLoader: Don't leak fds
2025-04-20 18:18:32 +03:00
Bananymous
ac90800c3c
Kernel/LibC/DynamicLoader: Implement thread local storage
...
For some reason this does not work on 32 bit version, so it is disabled
on that platform. I'll have to look into it later to find the bug :)
2025-04-15 23:33:39 +03:00
Bananymous
254fd80088
DynamicLoader: Cleanup and prepare for TLS
2025-04-15 23:31:17 +03:00
Bananymous
36baf7b0af
Kernel/LibC/DynamicLoader: Update process start ABI
...
We now use SysV abi for process startup
2025-04-15 23:05:52 +03:00
Bananymous
e6026cb0b8
DynamicLoader: Handle circular dependencies
2025-04-15 23:05:52 +03:00
Bananymous
4f49d60e4a
DynamicLoader/LibC: lazy malloc environ
...
This allows DynamicLoader to just set the value of global environ symbol
without libc needing to malloc it at startup
2025-04-15 23:05:52 +03:00
Bananymous
c6cd185cb5
DynamicLoader: Fix copy relocations
...
Weak symbols are now actually resolved to the same strong symbol between
shared objects and copy relocations now work!
2025-01-24 19:23:33 +02:00
Bananymous
3a465cb94f
DynamicLoader: Don't write to pltgot if it does not exist
...
This makes `tcc` compile runnable executables
2024-12-04 21:11:43 +02:00
Bananymous
708a720d9d
Kernel: Remove SYS_OPEN
...
This can be done with SYS_OPENAT with fd set to AT_FDCWD
2024-09-17 16:16:47 +03:00
Bananymous
4006a04817
DynamicLoader: Don't do file backed mapping over file bounds
2024-09-11 19:30:35 +03:00
Bananymous
19d16620a6
DynamicLoader: Don't do file backed mapping for filesz == 0
2024-09-05 14:50:05 +03:00
Bananymous
e8bcebfb8e
DynamicLoader: Use file backed mmap when possible
2024-09-05 13:59:39 +03:00
Bananymous
aa7e92b275
Userspace: Write a dynamic loader
...
This allows running executing dynamically linked executables!
2024-09-05 12:58:21 +03:00