Tiny ELF binaries on ARM
Looks like breadbox didn't want to go down this rabbithole. So we'll have to do it instead.
-
e_machine
seems to be the only checked header field (e_entry
alignment checks are normal, because if it wouldn't be aligned, the code would segfault on entry.) -
phdr
parsing etc. is done architecture-independent, so the same tricks should be usable here as well.- However, on x86, we were using the way page mapping works to only have to specify a few flags, this probably can't be ported over.
- Each ARM opcode is 4 bytes long, and needs to be aligned. This kinda sucks for all the overlapping tricks. Also, arbitrary constants can't be loaded into registers easily.
- Do we want to depend on Thumb-mode?
- Dynamic linking stuff