cosmopolitan/libc/elf
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
..
struct Introduce post-linker that converts ELF to PE 2023-08-09 18:46:06 -07:00
def.h Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
elf.h Introduce GetElfSegmentAddress() function 2023-07-23 17:36:18 -07:00
elf.mk Clean up more code 2023-06-18 01:00:05 -07:00
findelfsectionbyname.c Mint APE Loader v1.4 2023-07-25 05:48:08 -07:00
getelfprogramheaderaddress.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
getelfsectionaddress.c Fix a bunch of Windows bugs reported on Discord 2023-07-28 06:17:34 -07:00
getelfsectionheaderaddress.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
getelfsectionname.c Rewrite .zip.o file linker 2023-06-10 09:29:44 -07:00
getelfsectionnamestringtable.c Clean up more code 2023-06-18 01:00:05 -07:00
getelfsegmentaddress.c Introduce GetElfSegmentAddress() function 2023-07-23 17:36:18 -07:00
getelfstring.c Clean up more code 2023-07-06 08:03:24 -07:00
getelfstringtable.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
getelfsymbols.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
getelfsymboltable.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
iself64binary.c Clean up more code 2023-06-18 01:00:05 -07:00
iselfsymbolcontent.c Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00
pf2prot.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
scalar.h Clean up more code 2023-06-18 01:00:05 -07:00
tinyelf.internal.h Rewrite Cosmopolitan Ar 2023-07-02 10:19:16 -07:00