d89f2206745c570eb4e68d7b6aa9c34d23d88f79
explain/tinyelf-arm.md
... | ... | @@ -0,0 +1,10 @@ |
1 | +# Tiny ELF binaries on ARM |
|
2 | + |
|
3 | +Looks like breadbox didn't want to go down *this* rabbithole. So we'll have to do it instead. |
|
4 | + |
|
5 | +* [`e_machine` seems to be the only checked header field](https://code.woboq.org/linux/linux/arch/arm/kernel/elf.c.html) (`e_entry` alignment checks are normal, because if it wouldn't be aligned, the code would segfault on entry.) |
|
6 | +* `phdr` parsing etc. is done architecture-independent, so the same tricks should be usable here as well. |
|
7 | + * 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. |
|
8 | +* 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. |
|
9 | + * Do we want to depend on Thumb-mode? |
|
10 | +* [Dynamic linking stuff](https://linux.weeaboo.software/explain/rtld#dynamic-linking_arm) |
|
... | ... | \ No newline at end of file |