cosmopolitan/ape
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
..
public Improve open source compatibility 2022-09-08 03:19:35 -07:00
aarch64.lds Fix tests on aarch64 2023-07-29 19:02:25 -07:00
ape-m1.c Mint APE Loader 1.6 2023-08-09 00:27:26 -07:00
ape.internal.h Get aarch64 hello world working 2023-05-10 04:20:47 -07:00
ape.lds Introduce post-linker that converts ELF to PE 2023-08-09 18:46:06 -07:00
ape.mk Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
ape.S Fix Windows stack size 2023-08-09 00:51:30 -07:00
apeinstall.sh Make improvements 2023-07-11 04:41:50 -07:00
apeuninstall.sh Mint APE Loader 1.6 2023-08-09 00:27:26 -07:00
blink-linux-aarch64.gz Make blink support conditionally linkable into APE 2023-06-17 07:55:35 -07:00
blink-xnu-aarch64.gz Make blink support conditionally linkable into APE 2023-06-17 07:55:35 -07:00
idata.internal.h Introduce post-linker that converts ELF to PE 2023-08-09 18:46:06 -07:00
launch.S Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
loader-macho.S Mint APE Loader v1.3 2023-07-23 17:08:14 -07:00
loader.c Mint APE Loader 1.6 2023-08-09 00:27:26 -07:00
loader.lds Mint APE Loader v1.3 2023-07-23 17:08:14 -07:00
macros.internal.h [metal] Fix bug: do not initialize IDT & TSS if unneeded (#654) 2022-10-10 20:54:46 -07:00
mz.ansi Initial import 2020-06-15 07:18:57 -07:00
notice.inc Initial import 2020-06-15 07:18:57 -07:00
relocations.h Optimize memory layout 2022-09-12 04:26:52 -07:00
sections.internal.h Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
start.S Mint APE Loader 1.6 2023-08-09 00:27:26 -07:00
systemcall.S Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00