cosmopolitan/libc/nt
Justine Tunney dd53f31147
Introduce post-linker that converts ELF to PE
If you build a static ELF executable in `ld -q` mode (which leaves rela
sections inside the binary) then you can run it through the elf2pe.com
program afterwards, which will turn it into a PE executable. We have a
new trick for defining WIN32 DLL imports in C without any assembly code.
This also achieves the optimally tiny and perfect PE binary structure.

We need this because it isn't possible to have a GNU ld linker script
generate a PE file where the virtual pointer and the file pointer can
drift apart. This post-linker can do that. One cool benefit is we can
now use a smaller 512-byte alignment in the file, and an even bigger
64kb alignment for the segment virtual addresses, and the executable
ends up being smaller.

Another program introduced by this change is pecheck.com which can do
extensive linting of PE static executables to help explain why Windows
won't load it.
2023-08-09 18:46:06 -07:00
..
advapi32 Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
API-MS-Win-Core-Synch-l1-2-0 Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
comdlg32 Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
enum Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
gdi32 Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
iphlpapi Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
kernel32 Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
MsWSock Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
nt Correct more typos (#500) 2022-07-21 20:53:30 -07:00
ntdll Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
pdh Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
PowrProf Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
psapi Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
struct Introduce post-linker that converts ELF to PE 2023-08-09 18:46:06 -07:00
thunk Validate privileged code relationships 2023-06-08 04:38:06 -07:00
typedef Add epoll and do more release readiness changes 2020-11-28 12:01:51 -08:00
user32 Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
ws2_32 Clean up more WIN32 APIs 2023-08-01 14:17:03 -07:00
accounting.h Make improvements 2022-05-28 00:28:09 -07:00
automation.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
codegen.h Make improvements 2020-12-01 03:43:40 -08:00
codegen.sh Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
comdlg.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
comms.h Make fixes and improvements 2022-10-19 07:19:19 -07:00
console.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
createfile.h Improve synchronization 2022-04-15 15:31:55 -07:00
debug.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
dll.h Make numerous improvements 2021-09-28 01:52:34 -07:00
efi.h Make progress towards aarch64 build 2023-05-10 04:20:46 -07:00
errors.h Run clang-format on most sources 2023-04-27 05:44:32 -07:00
events.h Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
files.h Add posix semaphores support 2022-10-14 09:21:02 -07:00
iocp.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
ipc.h Make more fixes and improvements 2023-07-29 18:44:15 -07:00
iphlpapi.h Add test for ioctl(SIOCGIFCONF) and polyfill on BSDs 2021-06-25 18:44:04 -07:00
master.sh Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
memory.h Add mlock() and munlock() 2023-04-27 10:42:52 -07:00
messagebox.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
nt.mk Remove 5000 WIN32 APIs 2023-07-28 14:32:34 -07:00
ntdll.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
ntdllimport.h Get LIBC_RUNTIME and LIBC_CALLS building on aarch64 2023-05-10 04:20:47 -07:00
ntdllimport.S Introduce native support for MacOS ARM64 2023-05-20 04:17:03 -07:00
paint.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
pdh.h Fix some win32 definitions 2022-03-22 19:54:36 -07:00
pedef.internal.h Add UEFI support 2021-02-21 21:33:04 -08:00
privilege.h Fix some win32 definitions 2022-03-22 19:54:36 -07:00
process.h Improve the affinity system calls 2022-10-06 15:08:29 -07:00
registry.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
runtime.h Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
signals.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
startupinfo.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
synchronization.h Improve Windows Console I/O 2023-08-08 05:44:40 -07:00
system.h Improve isystem includes and magic numbers 2021-08-14 23:36:36 -07:00
systeminfo.h Fix cosmopolitan.h for C++ 2021-02-01 04:04:44 -08:00
sysv2nt.S Make progress towards aarch64 build 2023-05-10 04:20:46 -07:00
thread.h Improve threading support further 2022-05-17 04:14:28 -07:00
version.h Fix POLLIN|POLLOUT when together on Windows 2023-08-08 10:33:52 -07:00
windows.h Run clang-format on most sources 2023-04-27 05:44:32 -07:00
winsock.h Support non-blocking i/o across platforms 2023-07-23 02:56:47 -07:00