cosmopolitan/libc/elf
Jōshin 7d31fc311a
Loaders rewrite argv[0] for old binaries (#1170)
For this to work, a loader has to be able to tell the difference between
an ‘old’ and a ‘new’ binary. This is achieved via a repurposing of ELF’s
e_flags field. We previously tried to use the padding in e_ident for it,
but binutils was resetting it to zero in e.g. strip.

This introduces one new ELF flag for cosmopolitan binaries. It is called
`EF_APE_MODERN`. We choose 0x101ca75, "lol cat 5".

It should now be safe to install the ape loader binfmt registration with
the `P` flag.
2024-05-07 20:42:18 -04:00
..
struct Reduce header complexity 2023-11-28 14:39:42 -08:00
BUILD.mk more modeline errata (#1019) 2023-12-16 23:07:10 -05:00
def.h Loaders rewrite argv[0] for old binaries (#1170) 2024-05-07 20:42:18 -04:00
elf.h Reduce header complexity 2023-11-28 14:39:42 -08:00
findelfsectionbyname.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getelfprogramheaderaddress.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfsectionaddress.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfsectionheaderaddress.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfsectionname.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfsectionnamestringtable.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getelfsegmentaddress.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfstring.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
getelfstringtable.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getelfsymbols.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getelfsymboltable.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
iself64binary.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
iselfsymbolcontent.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
link.h Add <link.h> for absl 2023-12-08 20:04:10 -08: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 Reduce header complexity 2023-11-28 14:39:42 -08:00