Bananymous 
							
						 
						
							
								ca9361abc1 
								
							 
						 
						
							
							
								
								DynamicLoader: Add support for dladdr  
							
							
							
						 
						
							2025-08-19 16:23:30 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								45ad6082bc 
								
							 
						 
						
							
							
								
								DynamicLoader: Support dlopen(NULL, ...)  
							
							
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								82b351469b 
								
							 
						 
						
							
							
								
								DynamicLoader: Setup thread id when initializing TLS  
							
							... 
							
							
							
							This allows pre-libc code use pthread functions
(__cxa_guard_release calls pthread_cond_broadcast) 
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								7831c74e8c 
								
							 
						 
						
							
							
								
								DynamicLoader: Add support for LD_LIBRARY_PATH  
							
							... 
							
							
							
							Also fix a bug with dlopen with TLS 
							
						 
						
							2025-07-31 22:47:29 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								521457eb92 
								
							 
						 
						
							
							
								
								DynamicLoader: Add support for calling destructors  
							
							... 
							
							
							
							After all libraries are initialized, their destructors are registered
using atexit 
							
						 
						
							2025-06-28 16:55:13 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								397219c22e 
								
							 
						 
						
							
							
								
								LibC: Implement very hacky dlopen/dlsym/dclose  
							
							... 
							
							
							
							If ELF loading fails, this will just crash the program :D
And there is no support for RTLD_LOCAL 
							
						 
						
							2025-06-28 16:55:13 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								4a00cb7d55 
								
							 
						 
						
							
							
								
								DynamicLoader: Add few more TLS relocations  
							
							
							
						 
						
							2025-06-16 15:06:48 +03:00  
				
					
						
							
							
								
								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 
							
						 
						
							
								415b20f884 
								
							 
						 
						
							
							
								
								LibC: Remove errno EEXISTS  
							
							... 
							
							
							
							I don't know why I had added this. It doesn't seem to be a thing on
either POSIX or linux. This was literally equivalent to EXIST 
							
						 
						
							2024-12-02 20:13:38 +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